diff --git a/docs/configuration.asciidoc b/docs/configuration.asciidoc index df5774975..0041730c4 100644 --- a/docs/configuration.asciidoc +++ b/docs/configuration.asciidoc @@ -242,6 +242,27 @@ see https://github.com/elasticsearch/elasticsearch-js/blob/master/src/lib/nodes_ + +`createNodeAgent`[[config-create-node-agent]]:: `Function` -- Override the way that the client creates node.js `Agent`[https://nodejs.org/api/http.html#http_class_http_agent] objects. The value of this property will be executed every time a new Node is added to the client (either from the initial seed or from sniffing) and can return any value that node's http(s) module accepts as `agent:` configuration. ++ +The function is called with two arguments, first an `HttpConnector`[http://github.com/spalger/elasticsearch-js/blob/master/src/lib/connectors/http.js] object and the second the config object initially passed when creating the client. + +Default::: `HttpConnector#createAgent()` + +Disable Agent creation::: ++ +[source,js] +----- +var client = new elasticsearch.Client({ + createNodeAgent: function () { + return false; + } +}); +----- + + + + === Examples Connect to just a single seed node, and use sniffing to find the rest of the cluster. @@ -343,22 +364,3 @@ var client = new elasticsearch.Client({ } }) ----- - - - -`createNodeAgent`[[config-createNodeAgent]]:: `Function` -- Override the way that the client creates node.js `Agent`[https://nodejs.org/api/http.html#http_class_http_agent] objects. The value of this property will be executed every time a new Node is added to the client (either from the initial seed or from sniffing) and can return any value that node's http(s) module accepts as `agent:` configuration. -+ -The function is called with two arguments, first an `HttpConnector`[http://github.com/spalger/elasticsearch-js/blob/master/src/lib/connectors/http.js] object and the second the config object initially passed when creating the client. - -Default::: `HttpConnector#createAgent()` - -Disable Agent creation::: -+ -[source,js] ------ -var client = new elasticsearch.Client({ - createNodeAgent: function () { - return false; - } -}); ------ diff --git a/scripts/generate/templates/configuration_docs.tmpl b/scripts/generate/templates/configuration_docs.tmpl index acd992f63..f554c5cca 100644 --- a/scripts/generate/templates/configuration_docs.tmpl +++ b/scripts/generate/templates/configuration_docs.tmpl @@ -233,6 +233,27 @@ see https://github.com/elasticsearch/elasticsearch-js/blob/master/src/lib/nodes_ + +`createNodeAgent`[[config-create-node-agent]]:: `Function` -- Override the way that the client creates node.js `Agent`[https://nodejs.org/api/http.html#http_class_http_agent] objects. The value of this property will be executed every time a new Node is added to the client (either from the initial seed or from sniffing) and can return any value that node's http(s) module accepts as `agent:` configuration. ++ +The function is called with two arguments, first an `HttpConnector`[http://github.com/spalger/elasticsearch-js/blob/master/src/lib/connectors/http.js] object and the second the config object initially passed when creating the client. + +Default::: `HttpConnector#createAgent()` + +Disable Agent creation::: ++ +[source,js] +----- +var client = new elasticsearch.Client({ + createNodeAgent: function () { + return false; + } +}); +----- + + + + === Examples Connect to just a single seed node, and use sniffing to find the rest of the cluster. @@ -334,22 +355,3 @@ var client = new elasticsearch.Client({ } }) ----- - - - -`createNodeAgent`[[config-createNodeAgent]]:: `Function` -- Override the way that the client creates node.js `Agent`[https://nodejs.org/api/http.html#http_class_http_agent] objects. The value of this property will be executed every time a new Node is added to the client (either from the initial seed or from sniffing) and can return any value that node's http(s) module accepts as `agent:` configuration. -+ -The function is called with two arguments, first an `HttpConnector`[http://github.com/spalger/elasticsearch-js/blob/master/src/lib/connectors/http.js] object and the second the config object initially passed when creating the client. - -Default::: `HttpConnector#createAgent()` - -Disable Agent creation::: -+ -[source,js] ------ -var client = new elasticsearch.Client({ - createNodeAgent: function () { - return false; - } -}); ------