diff --git a/src/lib/apis/0_90.js b/src/lib/apis/0_90.js deleted file mode 100644 index 573de1bc4..000000000 --- a/src/lib/apis/0_90.js +++ /dev/null @@ -1,3269 +0,0 @@ -var ca = require('../client_action').factory; -var namespace = require('../client_action').namespaceFactory; -var api = module.exports = {}; - -api._namespaces = ['cluster', 'indices']; - -/** - * Perform a [bulk](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/docs-bulk.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.consistency - Explicit write consistency setting for the operation - * @param {<>} params.refresh - Refresh the index after performing the operation - * @param {<>} [params.replication=sync] - Explicitely set the replication type - * @param {<>} params.type - Default document type for items which don't provide one - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.index - Default index for items which don't provide one - */ -api.bulk = ca({ - params: { - consistency: { - type: 'enum', - options: [ - 'one', - 'quorum', - 'all' - ] - }, - refresh: { - type: 'boolean' - }, - replication: { - type: 'enum', - 'default': 'sync', - options: [ - 'sync', - 'async' - ] - }, - type: { - type: 'string' - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_bulk', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_bulk', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_bulk' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -/** - * Perform a [clearScroll](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/search-request-scroll.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.scrollId - A comma-separated list of scroll IDs to clear - */ -api.clearScroll = ca({ - url: { - fmt: '/_search/scroll/<%=scrollId%>', - req: { - scrollId: { - type: 'list' - } - } - }, - paramAsBody: 'scrollId', - method: 'DELETE' -}); - -api.cluster = namespace(); - -/** - * Perform a [cluster.getSettings](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/cluster-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.cluster.prototype.getSettings = ca({ - url: { - fmt: '/_cluster/settings' - } -}); - -/** - * Perform a [cluster.health](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/cluster-health.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} [params.level=cluster] - Specify the level of detail for returned information - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.waitForActiveShards - Wait until the specified number of shards is active - * @param {<>} params.waitForNodes - Wait until the specified number of nodes is available - * @param {<>} params.waitForRelocatingShards - Wait until the specified number of relocating shards is finished - * @param {<>} params.waitForStatus - Wait until cluster is in a specific state - * @param {<>} params.index - Limit the information returned to a specific index - */ -api.cluster.prototype.health = ca({ - params: { - level: { - type: 'enum', - 'default': 'cluster', - options: [ - 'cluster', - 'indices', - 'shards' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - }, - waitForActiveShards: { - type: 'number', - name: 'wait_for_active_shards' - }, - waitForNodes: { - type: 'string', - name: 'wait_for_nodes' - }, - waitForRelocatingShards: { - type: 'number', - name: 'wait_for_relocating_shards' - }, - waitForStatus: { - type: 'enum', - 'default': null, - options: [ - 'green', - 'yellow', - 'red' - ], - name: 'wait_for_status' - } - }, - urls: [ - { - fmt: '/_cluster/health/<%=index%>', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_cluster/health' - } - ] -}); - -/** - * Perform a [cluster.nodeHotThreads](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/cluster-nodes-hot-threads.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.interval - The interval for the second sampling of threads - * @param {<>} params.snapshots - Number of samples of thread stacktrace (default: 10) - * @param {<>} params.threads - Specify the number of threads to provide information for (default: 3) - * @param {<>} params.type - The type to sample (default: cpu) - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - */ -api.cluster.prototype.nodeHotThreads = ca({ - params: { - interval: { - type: 'time' - }, - snapshots: { - type: 'number' - }, - threads: { - type: 'number' - }, - type: { - type: 'enum', - options: [ - 'cpu', - 'wait', - 'block' - ] - } - }, - urls: [ - { - fmt: '/_nodes/<%=nodeId%>/hotthreads', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_nodes/hotthreads' - } - ] -}); - -/** - * Perform a [cluster.nodeInfo](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/cluster-nodes-info.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.all - Return all available information - * @param {<>} params.clear - Reset the default settings - * @param {<>} params.http - Return information about HTTP - * @param {<>} params.jvm - Return information about the JVM - * @param {<>} params.network - Return information about network - * @param {<>} params.os - Return information about the operating system - * @param {<>} params.plugin - Return information about plugins - * @param {<>} params.process - Return information about the Elasticsearch process - * @param {<>} params.settings - Return information about node settings - * @param {<>} params.threadPool - Return information about the thread pool - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.transport - Return information about transport - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - */ -api.cluster.prototype.nodeInfo = ca({ - params: { - all: { - type: 'boolean' - }, - clear: { - type: 'boolean' - }, - http: { - type: 'boolean' - }, - jvm: { - type: 'boolean' - }, - network: { - type: 'boolean' - }, - os: { - type: 'boolean' - }, - plugin: { - type: 'boolean' - }, - process: { - type: 'boolean' - }, - settings: { - type: 'boolean' - }, - threadPool: { - type: 'boolean', - name: 'thread_pool' - }, - timeout: { - type: 'time' - }, - transport: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/_nodes/<%=nodeId%>', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_nodes' - } - ] -}); - -/** - * Perform a [cluster.nodeShutdown](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/cluster-nodes-shutdown.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.delay - Set the delay for the operation (default: 1s) - * @param {<>} params.exit - Exit the JVM as well (default: true) - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to perform the operation on; use `_local` to perform the operation on the node you're connected to, leave empty to perform the operation on all nodes - */ -api.cluster.prototype.nodeShutdown = ca({ - params: { - delay: { - type: 'time' - }, - exit: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/_cluster/nodes/<%=nodeId%>/_shutdown', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_shutdown' - } - ], - method: 'POST' -}); - -/** - * Perform a [cluster.nodeStats](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/cluster-nodes-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.all - Return all available information - * @param {<>} params.clear - Reset the default level of detail - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return detailed information for, when returning the `indices` metric family (supports wildcards) - * @param {<>} params.fs - Return information about the filesystem - * @param {<>} params.http - Return information about HTTP - * @param {<>} params.indices - Return information about indices - * @param {<>} params.jvm - Return information about the JVM - * @param {<>} params.network - Return information about network - * @param {<>} params.os - Return information about the operating system - * @param {<>} params.process - Return information about the Elasticsearch process - * @param {<>} params.threadPool - Return information about the thread pool - * @param {<>} params.transport - Return information about transport - * @param {<>} params.metricFamily - Limit the information returned to a certain metric family - * @param {<>} params.metric - Limit the information returned for `indices` family to a specific metric - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - */ -api.cluster.prototype.nodeStats = ca({ - params: { - all: { - type: 'boolean' - }, - clear: { - type: 'boolean' - }, - fields: { - type: 'list' - }, - fs: { - type: 'boolean' - }, - http: { - type: 'boolean' - }, - indices: { - type: 'boolean' - }, - jvm: { - type: 'boolean' - }, - network: { - type: 'boolean' - }, - os: { - type: 'boolean' - }, - process: { - type: 'boolean' - }, - threadPool: { - type: 'boolean', - name: 'thread_pool' - }, - transport: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/_nodes/<%=nodeId%>/stats', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_nodes/stats' - } - ] -}); - -/** - * Perform a [cluster.pendingTasks](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/cluster-pending.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Specify timeout for connection to master - */ -api.cluster.prototype.pendingTasks = ca({ - params: { - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_cluster/pending_tasks' - } -}); - -/** - * Perform a [cluster.putSettings](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/cluster-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.cluster.prototype.putSettings = ca({ - url: { - fmt: '/_cluster/settings' - }, - method: 'PUT' -}); - -/** - * Perform a [cluster.reroute](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/cluster-reroute.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.dryRun - Simulate the operation only and return the resulting state - * @param {<>} params.filterMetadata - Don't return cluster state metadata (default: false) - */ -api.cluster.prototype.reroute = ca({ - params: { - dryRun: { - type: 'boolean', - name: 'dry_run' - }, - filterMetadata: { - type: 'boolean', - name: 'filter_metadata' - } - }, - url: { - fmt: '/_cluster/reroute' - }, - method: 'POST' -}); - -/** - * Perform a [cluster.state](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/cluster-state.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.filterBlocks - Do not return information about blocks - * @param {<>} params.filterIndexTemplates - Do not return information about index templates - * @param {<>, <>, <>} params.filterIndices - Limit returned metadata information to specific indices - * @param {<>} params.filterMetadata - Do not return information about indices metadata - * @param {<>} params.filterNodes - Do not return information about nodes - * @param {<>} params.filterRoutingTable - Do not return information about shard allocation (`routing_table` and `routing_nodes`) - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Specify timeout for connection to master - */ -api.cluster.prototype.state = ca({ - params: { - filterBlocks: { - type: 'boolean', - name: 'filter_blocks' - }, - filterIndexTemplates: { - type: 'boolean', - name: 'filter_index_templates' - }, - filterIndices: { - type: 'list', - name: 'filter_indices' - }, - filterMetadata: { - type: 'boolean', - name: 'filter_metadata' - }, - filterNodes: { - type: 'boolean', - name: 'filter_nodes' - }, - filterRoutingTable: { - type: 'boolean', - name: 'filter_routing_table' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_cluster/state' - } -}); - -/** - * Perform a [count](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/search-count.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} [params.ignoreIndices=none] - When performed on multiple indices, allows to ignore `missing` ones - * @param {<>} params.minScore - Include only documents with a specific `_score` value in the result - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.source - The URL-encoded query definition (instead of using the request body) - * @param {<>, <>, <>} params.index - A comma-separated list of indices to restrict the results - * @param {<>, <>, <>} params.type - A comma-separated list of types to restrict the results - */ -api.count = ca({ - params: { - ignoreIndices: { - type: 'enum', - 'default': 'none', - options: [ - 'none', - 'missing' - ], - name: 'ignore_indices' - }, - minScore: { - type: 'number', - name: 'min_score' - }, - preference: { - type: 'string' - }, - routing: { - type: 'string' - }, - source: { - type: 'string' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_count', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_count', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_count' - } - ], - method: 'POST' -}); - -/** - * Perform a [delete](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/docs-delete.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.consistency - Specific write consistency setting for the operation - * @param {<>} params.parent - ID of parent document - * @param {<>} params.refresh - Refresh the index after performing the operation - * @param {<>} [params.replication=sync] - Specific replication type - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api['delete'] = ca({ - params: { - consistency: { - type: 'enum', - options: [ - 'one', - 'quorum', - 'all' - ] - }, - parent: { - type: 'string' - }, - refresh: { - type: 'boolean' - }, - replication: { - type: 'enum', - 'default': 'sync', - options: [ - 'sync', - 'async' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [deleteByQuery](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/docs-delete-by-query.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.consistency - Specific write consistency setting for the operation - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} [params.ignoreIndices=none] - When performed on multiple indices, allows to ignore `missing` ones - * @param {<>} [params.replication=sync] - Specific replication type - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.routing - Specific routing value - * @param {<>} params.source - The URL-encoded query definition (instead of using the request body) - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.index - A comma-separated list of indices to restrict the operation; use `_all` to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of types to restrict the operation - */ -api.deleteByQuery = ca({ - params: { - analyzer: { - type: 'string' - }, - consistency: { - type: 'enum', - options: [ - 'one', - 'quorum', - 'all' - ] - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - ignoreIndices: { - type: 'enum', - 'default': 'none', - options: [ - 'none', - 'missing' - ], - name: 'ignore_indices' - }, - replication: { - type: 'enum', - 'default': 'sync', - options: [ - 'sync', - 'async' - ] - }, - q: { - type: 'string' - }, - routing: { - type: 'string' - }, - source: { - type: 'string' - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_query', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_query', - req: { - index: { - type: 'list' - } - } - } - ], - method: 'DELETE' -}); - -/** - * Perform a [exists](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document (use `_all` to fetch the first document matching the ID across all types) - */ -api.exists = ca({ - params: { - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [explain](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/search-explain.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzeWildcard - Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false) - * @param {<>} params.analyzer - The analyzer for the query string query - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The default field for query string query (default: _all) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return in the response - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.lowercaseExpandedTerms - Specify whether query terms should be lowercased - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.routing - Specific routing value - * @param {<>} params.source - The URL-encoded query definition (instead of using the request body) - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.explain = ca({ - params: { - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - analyzer: { - type: 'string' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - fields: { - type: 'list' - }, - lenient: { - type: 'boolean' - }, - lowercaseExpandedTerms: { - type: 'boolean', - name: 'lowercase_expanded_terms' - }, - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'string' - }, - source: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_explain', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [get](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return in the response - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document (use `_all` to fetch the first document matching the ID across all types) - */ -api.get = ca({ - params: { - fields: { - type: 'list' - }, - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [getSource](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document; use `_all` to fetch the first document matching the ID across all types - */ -api.getSource = ca({ - params: { - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_source', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [index](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/docs-index_.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.consistency - Explicit write consistency setting for the operation - * @param {<>} [params.opType=index] - Explicit operation type - * @param {<>} params.parent - ID of the parent document - * @param {<>} params.percolate - Percolator queries to execute while indexing the document - * @param {<>} params.refresh - Refresh the index after performing the operation - * @param {<>} [params.replication=sync] - Specific replication type - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.index = ca({ - params: { - consistency: { - type: 'enum', - options: [ - 'one', - 'quorum', - 'all' - ] - }, - opType: { - type: 'enum', - 'default': 'index', - options: [ - 'index', - 'create' - ], - name: 'op_type' - }, - parent: { - type: 'string' - }, - percolate: { - type: 'string' - }, - refresh: { - type: 'boolean' - }, - replication: { - type: 'enum', - 'default': 'sync', - options: [ - 'sync', - 'async' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - timestamp: { - type: 'time' - }, - ttl: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external' - ], - name: 'version_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/<%=type%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - } - ], - needBody: true, - method: 'POST' -}); - -api.indices = namespace(); - -/** - * Perform a [indices.analyze](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-analyze.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The name of the analyzer to use - * @param {<>} params.field - Use the analyzer configured for this field (instead of passing the analyzer name) - * @param {<>, <>, <>} params.filters - A comma-separated list of filters to use for the analysis - * @param {<>} params.index - The name of the index to scope the operation - * @param {<>} params.preferLocal - With `true`, specify that a local shard should be used if available, with `false`, use a random shard (default: true) - * @param {<>} params.text - The text on which the analysis should be performed (when request body is not used) - * @param {<>} params.tokenizer - The name of the tokenizer to use for the analysis - * @param {<>} [params.format=detailed] - Format of the output - */ -api.indices.prototype.analyze = ca({ - params: { - analyzer: { - type: 'string' - }, - field: { - type: 'string' - }, - filters: { - type: 'list' - }, - index: { - type: 'string' - }, - preferLocal: { - type: 'boolean', - name: 'prefer_local' - }, - text: { - type: 'string' - }, - tokenizer: { - type: 'string' - }, - format: { - type: 'enum', - 'default': 'detailed', - options: [ - 'detailed', - 'text' - ] - } - }, - urls: [ - { - fmt: '/<%=index%>/_analyze', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_analyze' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.clearCache](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-clearcache.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.fieldData - Clear field data - * @param {<>} params.fielddata - Clear field data - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to clear when using the `field_data` parameter (default: all) - * @param {<>} params.filter - Clear filter caches - * @param {<>} params.filterCache - Clear filter caches - * @param {<>} params.filterKeys - A comma-separated list of keys to clear when using the `filter_cache` parameter (default: all) - * @param {<>} params.id - Clear ID caches for parent/child - * @param {<>} params.idCache - Clear ID caches for parent/child - * @param {<>} [params.ignoreIndices=none] - When performed on multiple indices, allows to ignore `missing` ones - * @param {<>, <>, <>} params.index - A comma-separated list of index name to limit the operation - * @param {<>} params.recycler - Clear the recycler cache - */ -api.indices.prototype.clearCache = ca({ - params: { - fieldData: { - type: 'boolean', - name: 'field_data' - }, - fielddata: { - type: 'boolean' - }, - fields: { - type: 'list' - }, - filter: { - type: 'boolean' - }, - filterCache: { - type: 'boolean', - name: 'filter_cache' - }, - filterKeys: { - type: 'boolean', - name: 'filter_keys' - }, - id: { - type: 'boolean' - }, - idCache: { - type: 'boolean', - name: 'id_cache' - }, - ignoreIndices: { - type: 'enum', - 'default': 'none', - options: [ - 'none', - 'missing' - ], - name: 'ignore_indices' - }, - index: { - type: 'list' - }, - recycler: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_cache/clear', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cache/clear' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.close](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-open-close.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.index - The name of the index - */ -api.indices.prototype.close = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/<%=index%>/_close', - req: { - index: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [indices.create](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-create-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.index - The name of the index - */ -api.indices.prototype.create = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/<%=index%>', - req: { - index: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [indices.delete](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-delete-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of indices to delete; use `_all` or empty string to delete all indices - */ -api.indices.prototype['delete'] = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - urls: [ - { - fmt: '/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/' - } - ], - method: 'DELETE' -}); - -/** - * Perform a [indices.deleteAlias](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit timestamp for the document - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.index - The name of the index with an alias - * @param {<>} params.name - The name of the alias to be deleted - */ -api.indices.prototype.deleteAlias = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'string' - }, - name: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [indices.deleteMapping](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-delete-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` for all indices - * @param {<>} params.type - The name of the document type to delete - */ -api.indices.prototype.deleteMapping = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [indices.deleteTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.name - The name of the template - */ -api.indices.prototype.deleteTemplate = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [indices.deleteWarmer](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-warmers.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of index names to register warmer for; use `_all` or empty string to perform the operation on all indices - * @param {<>} params.name - The name of the warmer (supports wildcards); leave empty to delete all warmers - * @param {<>, <>, <>} params.type - A comma-separated list of document types to register warmer for; use `_all` or empty string to perform the operation on all types - */ -api.indices.prototype.deleteWarmer = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_warmer/<%=name%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - }, - name: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_warmer/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_warmer', - req: { - index: { - type: 'list' - } - } - } - ], - method: 'DELETE' -}); - -/** - * Perform a [indices.exists](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-get-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.index - A comma-separated list of indices to check - */ -api.indices.prototype.exists = ca({ - url: { - fmt: '/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [indices.existsAlias](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} [params.ignoreIndices=none] - When performed on multiple indices, allows to ignore `missing` ones - * @param {<>, <>, <>} params.index - A comma-separated list of index names to filter aliases - * @param {<>, <>, <>} params.name - A comma-separated list of alias names to return - */ -api.indices.prototype.existsAlias = ca({ - params: { - ignoreIndices: { - type: 'enum', - 'default': 'none', - options: [ - 'none', - 'missing' - ], - name: 'ignore_indices' - } - }, - urls: [ - { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/_alias/<%=name%>', - req: { - name: { - type: 'list' - } - } - } - ], - method: 'HEAD' -}); - -/** - * Perform a [indices.existsType](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-types-exists.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} [params.ignoreIndices=none] - When performed on multiple indices, allows to ignore `missing` ones - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` to check the types across all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to check - */ -api.indices.prototype.existsType = ca({ - params: { - ignoreIndices: { - type: 'enum', - 'default': 'none', - options: [ - 'none', - 'missing' - ], - name: 'ignore_indices' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [indices.flush](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-flush.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.force - Whether a flush should be forced even if it is not necessarily needed ie. if no changes will be committed to the index. This is useful if transaction log IDs should be incremented even if no uncommitted changes are present. (This setting can be considered as internal) - * @param {<>} params.full - If set to true a new index writer is created and settings that have been changed related to the index writer will be refreshed. Note: if a full flush is required for a setting to take effect this will be part of the settings update process and it not required to be executed by the user. (This setting can be considered as internal) - * @param {<>} [params.ignoreIndices=none] - When performed on multiple indices, allows to ignore `missing` ones - * @param {<>} params.refresh - Refresh the index after performing the operation - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string for all indices - */ -api.indices.prototype.flush = ca({ - params: { - force: { - type: 'boolean' - }, - full: { - type: 'boolean' - }, - ignoreIndices: { - type: 'enum', - 'default': 'none', - options: [ - 'none', - 'missing' - ], - name: 'ignore_indices' - }, - refresh: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_flush', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_flush' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.getAlias](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} [params.ignoreIndices=none] - When performed on multiple indices, allows to ignore `missing` ones - * @param {<>, <>, <>} params.index - A comma-separated list of index names to filter aliases - * @param {<>, <>, <>} params.name - A comma-separated list of alias names to return - */ -api.indices.prototype.getAlias = ca({ - params: { - ignoreIndices: { - type: 'enum', - 'default': 'none', - options: [ - 'none', - 'missing' - ], - name: 'ignore_indices' - } - }, - urls: [ - { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/_alias/<%=name%>', - req: { - name: { - type: 'list' - } - } - } - ] -}); - -/** - * Perform a [indices.getAliases](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.index - A comma-separated list of index names to filter aliases - */ -api.indices.prototype.getAliases = ca({ - params: { - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/<%=index%>/_aliases', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_aliases' - } - ] -}); - -/** - * Perform a [indices.getFieldMapping](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-get-field-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.includeDefaults - Whether the default mapping values should be returned as well - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} params.type - A comma-separated list of document types - * @param {<>, <>, <>} params.field - A comma-separated list of fields - */ -api.indices.prototype.getFieldMapping = ca({ - params: { - includeDefaults: { - type: 'boolean', - name: 'include_defaults' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_mapping/field/<%=field%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - }, - field: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_mapping/field/<%=field%>', - req: { - index: { - type: 'list' - }, - field: { - type: 'list' - } - } - }, - { - fmt: '/_mapping/field/<%=field%>', - req: { - field: { - type: 'list' - } - } - } - ] -}); - -/** - * Perform a [indices.getMapping](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-get-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} params.type - A comma-separated list of document types - */ -api.indices.prototype.getMapping = ca({ - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_mapping', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_mapping', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_mapping' - } - ] -}); - -/** - * Perform a [indices.getSettings](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-get-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.getSettings = ca({ - urls: [ - { - fmt: '/<%=index%>/_settings', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_settings' - } - ] -}); - -/** - * Perform a [indices.getTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.name - The name of the template - */ -api.indices.prototype.getTemplate = ca({ - urls: [ - { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - { - fmt: '/_template' - } - ] -}); - -/** - * Perform a [indices.getWarmer](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-warmers.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.index - A comma-separated list of index names to restrict the operation; use `_all` to perform the operation on all indices - * @param {<>} params.name - The name of the warmer (supports wildcards); leave empty to get all warmers - * @param {<>, <>, <>} params.type - A comma-separated list of document types to restrict the operation; leave empty to perform the operation on all types - */ -api.indices.prototype.getWarmer = ca({ - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_warmer/<%=name%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - }, - name: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_warmer/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_warmer', - req: { - index: { - type: 'list' - } - } - } - ] -}); - -/** - * Perform a [indices.open](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-open-close.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.index - The name of the index - */ -api.indices.prototype.open = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/<%=index%>/_open', - req: { - index: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [indices.optimize](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-optimize.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flush - Specify whether the index should be flushed after performing the operation (default: true) - * @param {<>} [params.ignoreIndices=none] - When performed on multiple indices, allows to ignore `missing` ones - * @param {<>} params.maxNumSegments - The number of segments the index should be merged into (default: dynamic) - * @param {<>} params.onlyExpungeDeletes - Specify whether the operation should only expunge deleted documents - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.refresh - Specify whether the index should be refreshed after performing the operation (default: true) - * @param {<>} params.waitForMerge - Specify whether the request should block until the merge process is finished (default: true) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.optimize = ca({ - params: { - flush: { - type: 'boolean' - }, - ignoreIndices: { - type: 'enum', - 'default': 'none', - options: [ - 'none', - 'missing' - ], - name: 'ignore_indices' - }, - maxNumSegments: { - type: 'number', - name: 'max_num_segments' - }, - onlyExpungeDeletes: { - type: 'boolean', - name: 'only_expunge_deletes' - }, - operationThreading: { - name: 'operation_threading' - }, - refresh: { - type: 'boolean' - }, - waitForMerge: { - type: 'boolean', - name: 'wait_for_merge' - } - }, - urls: [ - { - fmt: '/<%=index%>/_optimize', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_optimize' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.putAlias](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit timestamp for the document - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.index - The name of the index with an alias - * @param {<>} params.name - The name of the alias to be created or updated - */ -api.indices.prototype.putAlias = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - urls: [ - { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'string' - }, - name: { - type: 'string' - } - } - }, - { - fmt: '/_alias/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_alias', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_alias' - } - ], - method: 'PUT' -}); - -/** - * Perform a [indices.putMapping](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-put-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreConflicts - Specify whether to ignore conflicts while updating the mapping (default: false) - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` to perform the operation on all indices - * @param {<>} params.type - The name of the document type - */ -api.indices.prototype.putMapping = ca({ - params: { - ignoreConflicts: { - type: 'boolean', - name: 'ignore_conflicts' - }, - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/_mapping', - req: { - index: { - type: 'list' - }, - type: { - type: 'string' - } - } - }, - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [indices.putSettings](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.putSettings = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - urls: [ - { - fmt: '/<%=index%>/_settings', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_settings' - } - ], - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [indices.putTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.order - The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers) - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.name - The name of the template - */ -api.indices.prototype.putTemplate = ca({ - params: { - order: { - type: 'number' - }, - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [indices.putWarmer](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-warmers.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of index names to register the warmer for; use `_all` or empty string to perform the operation on all indices - * @param {<>} params.name - The name of the warmer - * @param {<>, <>, <>} params.type - A comma-separated list of document types to register the warmer for; leave empty to perform the operation on all types - */ -api.indices.prototype.putWarmer = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_warmer/<%=name%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - }, - name: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_warmer/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'string' - } - } - } - ], - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [indices.refresh](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-refresh.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} [params.ignoreIndices=none] - When performed on multiple indices, allows to ignore `missing` ones - * @param {anything} params.operationThreading - TODO: ? - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.refresh = ca({ - params: { - ignoreIndices: { - type: 'enum', - 'default': 'none', - options: [ - 'none', - 'missing' - ], - name: 'ignore_indices' - }, - operationThreading: { - name: 'operation_threading' - } - }, - urls: [ - { - fmt: '/<%=index%>/_refresh', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_refresh' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.segments](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-segments.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} [params.ignoreIndices=none] - When performed on multiple indices, allows to ignore `missing` ones - * @param {anything} params.operationThreading - TODO: ? - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.segments = ca({ - params: { - ignoreIndices: { - type: 'enum', - 'default': 'none', - options: [ - 'none', - 'missing' - ], - name: 'ignore_indices' - }, - operationThreading: { - name: 'operation_threading' - } - }, - urls: [ - { - fmt: '/<%=index%>/_segments', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_segments' - } - ] -}); - -/** - * Perform a [indices.snapshotIndex](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-gateway-snapshot.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} [params.ignoreIndices=none] - When performed on multiple indices, allows to ignore `missing` ones - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string for all indices - */ -api.indices.prototype.snapshotIndex = ca({ - params: { - ignoreIndices: { - type: 'enum', - 'default': 'none', - options: [ - 'none', - 'missing' - ], - name: 'ignore_indices' - } - }, - urls: [ - { - fmt: '/<%=index%>/_gateway/snapshot', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_gateway/snapshot' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.stats](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.all - Return all available information - * @param {<>} params.clear - Reset the default level of detail - * @param {<>} params.completion - Return information about completion suggester stats - * @param {<>, <>, <>} params.completionFields - A comma-separated list of fields for `completion` metric (supports wildcards) - * @param {<>} params.docs - Return information about indexed and deleted documents - * @param {<>} params.fielddata - Return information about field data - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields for `fielddata` metric (supports wildcards) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return detailed information for, when returning the `search` statistics - * @param {<>} params.filterCache - Return information about filter cache - * @param {<>} params.flush - Return information about flush operations - * @param {<>} params.get - Return information about get operations - * @param {<>} params.groups - A comma-separated list of search groups for `search` statistics - * @param {<>} params.idCache - Return information about ID cache - * @param {<>} [params.ignoreIndices=none] - When performed on multiple indices, allows to ignore `missing` ones - * @param {<>} params.indexing - Return information about indexing operations - * @param {<>} params.merge - Return information about merge operations - * @param {<>} params.refresh - Return information about refresh operations - * @param {<>} params.search - Return information about search operations; use the `groups` parameter to include information for specific search groups - * @param {<>} params.store - Return information about the size of the index - * @param {<>} params.warmer - Return information about warmers - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.indexingTypes - A comma-separated list of document types to include in the `indexing` statistics - * @param {<>} params.metricFamily - Limit the information returned to a specific metric - * @param {<>, <>, <>} params.searchGroups - A comma-separated list of search groups to include in the `search` statistics - */ -api.indices.prototype.stats = ca({ - params: { - all: { - type: 'boolean' - }, - clear: { - type: 'boolean' - }, - completion: { - type: 'boolean' - }, - completionFields: { - type: 'list', - name: 'completion_fields' - }, - docs: { - type: 'boolean' - }, - fielddata: { - type: 'boolean' - }, - fielddataFields: { - type: 'list', - name: 'fielddata_fields' - }, - fields: { - type: 'list' - }, - filterCache: { - type: 'boolean', - name: 'filter_cache' - }, - flush: { - type: 'boolean' - }, - get: { - type: 'boolean' - }, - groups: { - type: 'boolean' - }, - idCache: { - type: 'boolean', - name: 'id_cache' - }, - ignoreIndices: { - type: 'enum', - 'default': 'none', - options: [ - 'none', - 'missing' - ], - name: 'ignore_indices' - }, - indexing: { - type: 'boolean' - }, - merge: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - search: { - type: 'boolean' - }, - store: { - type: 'boolean' - }, - warmer: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_stats', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_stats' - } - ] -}); - -/** - * Perform a [indices.status](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-status.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} [params.ignoreIndices=none] - When performed on multiple indices, allows to ignore `missing` ones - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.recovery - Return information about shard recovery - * @param {<>} params.snapshot - TODO: ? - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.status = ca({ - params: { - ignoreIndices: { - type: 'enum', - 'default': 'none', - options: [ - 'none', - 'missing' - ], - name: 'ignore_indices' - }, - operationThreading: { - name: 'operation_threading' - }, - recovery: { - type: 'boolean' - }, - snapshot: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_status', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_status' - } - ] -}); - -/** - * Perform a [indices.updateAliases](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Request timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of index names to filter aliases - */ -api.indices.prototype.updateAliases = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_aliases' - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [indices.validateQuery](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/search-validate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.explain - Return detailed information about the error - * @param {<>} [params.ignoreIndices=none] - When performed on multiple indices, allows to ignore `missing` ones - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.source - The URL-encoded query definition (instead of using the request body) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.index - A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to restrict the operation; leave empty to perform the operation on all types - */ -api.indices.prototype.validateQuery = ca({ - params: { - explain: { - type: 'boolean' - }, - ignoreIndices: { - type: 'enum', - 'default': 'none', - options: [ - 'none', - 'missing' - ], - name: 'ignore_indices' - }, - operationThreading: { - name: 'operation_threading' - }, - source: { - type: 'string' - }, - q: { - type: 'string' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_validate/query', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_validate/query', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_validate/query' - } - ], - method: 'POST' -}); - -/** - * Perform a [info](http://www.elasticsearch.org/guide/) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.info = ca({ - url: { - fmt: '/' - } -}); - -/** - * Perform a [mget](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/docs-multi-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return in the response - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.mget = ca({ - params: { - fields: { - type: 'list' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_mget', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_mget', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_mget' - } - ], - needBody: true, - method: 'POST' -}); - -/** - * Perform a [mlt](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/search-more-like-this.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.boostTerms - The boost factor - * @param {<>} params.maxDocFreq - The word occurrence frequency as count: words with higher occurrence in the corpus will be ignored - * @param {<>} params.maxQueryTerms - The maximum query terms to be included in the generated query - * @param {<>} params.maxWordLen - The minimum length of the word: longer words will be ignored - * @param {<>} params.minDocFreq - The word occurrence frequency as count: words with lower occurrence in the corpus will be ignored - * @param {<>} params.minTermFreq - The term frequency as percent: terms with lower occurence in the source document will be ignored - * @param {<>} params.minWordLen - The minimum length of the word: shorter words will be ignored - * @param {<>, <>, <>} params.mltFields - Specific fields to perform the query against - * @param {<>} params.percentTermsToMatch - How many terms have to match in order to consider the document a match (default: 0.3) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.searchFrom - The offset from which to return results - * @param {<>, <>, <>} params.searchIndices - A comma-separated list of indices to perform the query against (default: the index containing the document) - * @param {<>} params.searchQueryHint - The search query hint - * @param {<>} params.searchScroll - A scroll search request definition - * @param {<>} params.searchSize - The number of documents to return (default: 10) - * @param {<>} params.searchSource - A specific search request definition (instead of using the request body) - * @param {<>} params.searchType - Specific search type (eg. `dfs_then_fetch`, `count`, etc) - * @param {<>, <>, <>} params.searchTypes - A comma-separated list of types to perform the query against (default: the same type as the document) - * @param {<>, <>, <>} params.stopWords - A list of stop words to be ignored - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document (use `_all` to fetch the first document matching the ID across all types) - */ -api.mlt = ca({ - params: { - boostTerms: { - type: 'number', - name: 'boost_terms' - }, - maxDocFreq: { - type: 'number', - name: 'max_doc_freq' - }, - maxQueryTerms: { - type: 'number', - name: 'max_query_terms' - }, - maxWordLen: { - type: 'number', - name: 'max_word_len' - }, - minDocFreq: { - type: 'number', - name: 'min_doc_freq' - }, - minTermFreq: { - type: 'number', - name: 'min_term_freq' - }, - minWordLen: { - type: 'number', - name: 'min_word_len' - }, - mltFields: { - type: 'list', - name: 'mlt_fields' - }, - percentTermsToMatch: { - type: 'number', - name: 'percent_terms_to_match' - }, - routing: { - type: 'string' - }, - searchFrom: { - type: 'number', - name: 'search_from' - }, - searchIndices: { - type: 'list', - name: 'search_indices' - }, - searchQueryHint: { - type: 'string', - name: 'search_query_hint' - }, - searchScroll: { - type: 'string', - name: 'search_scroll' - }, - searchSize: { - type: 'number', - name: 'search_size' - }, - searchSource: { - type: 'string', - name: 'search_source' - }, - searchType: { - type: 'string', - name: 'search_type' - }, - searchTypes: { - type: 'list', - name: 'search_types' - }, - stopWords: { - type: 'list', - name: 'stop_words' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_mlt', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [msearch](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/search-multi-search.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.searchType - Search operation type - * @param {<>, <>, <>} params.index - A comma-separated list of index names to use as default - * @param {<>, <>, <>} params.type - A comma-separated list of document types to use as default - */ -api.msearch = ca({ - params: { - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'query_and_fetch', - 'dfs_query_then_fetch', - 'dfs_query_and_fetch', - 'count', - 'scan' - ], - name: 'search_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_msearch', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_msearch', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_msearch' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -/** - * Perform a [percolate](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/search-percolate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.preferLocal - With `true`, specify that a local shard should be used if available, with `false`, use a random shard (default: true) - * @param {<>} params.index - The name of the index with a registered percolator query - * @param {<>} params.type - The document type - */ -api.percolate = ca({ - params: { - preferLocal: { - type: 'boolean', - name: 'prefer_local' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/_percolate', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [ping](http://www.elasticsearch.org/guide/) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.ping = ca({ - url: { - fmt: '/' - }, - requestTimeout: 3000, - method: 'HEAD' -}); - -/** - * Perform a [scroll](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/search-request-scroll.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.scrollId - The scroll ID - */ -api.scroll = ca({ - params: { - scroll: { - type: 'time' - }, - scrollId: { - type: 'string', - name: 'scroll_id' - } - }, - urls: [ - { - fmt: '/_search/scroll/<%=scrollId%>', - req: { - scrollId: { - type: 'string' - } - } - }, - { - fmt: '/_search/scroll' - } - ], - paramAsBody: 'scrollId', - method: 'POST' -}); - -/** - * Perform a [search](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/search-search.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.explain - Specify whether to return detailed information about score computation as part of a hit - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return as part of a hit - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} [params.ignoreIndices=none] - When performed on multiple indices, allows to ignore `missing` ones - * @param {<>, <>, <>} params.indicesBoost - Comma-separated list of index boosts - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.lowercaseExpandedTerms - Specify whether query terms should be lowercased - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>} params.source - The URL-encoded request definition using the Query DSL (instead of using request body) - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.suggestField - Specify which field to use for suggestions - * @param {<>} [params.suggestMode=missing] - Specify suggest mode - * @param {<>} params.suggestSize - How many suggestions to return in response - * @param {<>} params.suggestText - The source text for which the suggestions should be returned - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.search = ca({ - params: { - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - explain: { - type: 'boolean' - }, - fields: { - type: 'list' - }, - from: { - type: 'number' - }, - ignoreIndices: { - type: 'enum', - 'default': 'none', - options: [ - 'none', - 'missing' - ], - name: 'ignore_indices' - }, - indicesBoost: { - type: 'list', - name: 'indices_boost' - }, - lenient: { - type: 'boolean' - }, - lowercaseExpandedTerms: { - type: 'boolean', - name: 'lowercase_expanded_terms' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'query_and_fetch', - 'dfs_query_then_fetch', - 'dfs_query_and_fetch', - 'count', - 'scan' - ], - name: 'search_type' - }, - size: { - type: 'number' - }, - sort: { - type: 'list' - }, - source: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - stats: { - type: 'list' - }, - suggestField: { - type: 'string', - name: 'suggest_field' - }, - suggestMode: { - type: 'enum', - 'default': 'missing', - options: [ - 'missing', - 'popular', - 'always' - ], - name: 'suggest_mode' - }, - suggestSize: { - type: 'number', - name: 'suggest_size' - }, - suggestText: { - type: 'string', - name: 'suggest_text' - }, - timeout: { - type: 'time' - }, - version: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_search', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_search', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_search' - } - ], - method: 'POST' -}); - -/** - * Perform a [suggest](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/search-search.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} [params.ignoreIndices=none] - When performed on multiple indices, allows to ignore `missing` ones - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.source - The URL-encoded request definition (instead of using request body) - * @param {<>, <>, <>} params.index - A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices - */ -api.suggest = ca({ - params: { - ignoreIndices: { - type: 'enum', - 'default': 'none', - options: [ - 'none', - 'missing' - ], - name: 'ignore_indices' - }, - preference: { - type: 'string' - }, - routing: { - type: 'string' - }, - source: { - type: 'string' - } - }, - urls: [ - { - fmt: '/<%=index%>/_suggest', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_suggest' - } - ], - method: 'POST' -}); - -/** - * Perform a [update](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/docs-update.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.consistency - Explicit write consistency setting for the operation - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return in the response - * @param {<>} params.lang - The script language (default: mvel) - * @param {<>} params.parent - ID of the parent document - * @param {<>} params.percolate - Perform percolation during the operation; use specific registered query name, attribute, or wildcard - * @param {<>} params.refresh - Refresh the index after performing the operation - * @param {<>} [params.replication=sync] - Specific replication type - * @param {<>} params.retryOnConflict - Specify how many times should the operation be retried when a conflict occurs (default: 0) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.script - The URL-encoded script definition (instead of using request body) - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.update = ca({ - params: { - consistency: { - type: 'enum', - options: [ - 'one', - 'quorum', - 'all' - ] - }, - fields: { - type: 'list' - }, - lang: { - type: 'string' - }, - parent: { - type: 'string' - }, - percolate: { - type: 'string' - }, - refresh: { - type: 'boolean' - }, - replication: { - type: 'enum', - 'default': 'sync', - options: [ - 'sync', - 'async' - ] - }, - retryOnConflict: { - type: 'number', - name: 'retry_on_conflict' - }, - routing: { - type: 'string' - }, - script: { - type: 'string' - }, - timeout: { - type: 'time' - }, - timestamp: { - type: 'time' - }, - ttl: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_update', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [create](https://www.elastic.co/guide/en/elasticsearch/reference/0.90/docs-index_.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.consistency - Explicit write consistency setting for the operation - * @param {<>} params.parent - ID of the parent document - * @param {<>} params.percolate - Percolator queries to execute while indexing the document - * @param {<>} params.refresh - Refresh the index after performing the operation - * @param {<>} [params.replication=sync] - Specific replication type - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.create = ca.proxy(api.index, { - transform: function (params) { - params.op_type = 'create'; - } -}); diff --git a/src/lib/apis/1_7.js b/src/lib/apis/1_7.js deleted file mode 100644 index ff0c01133..000000000 --- a/src/lib/apis/1_7.js +++ /dev/null @@ -1,6381 +0,0 @@ -var ca = require('../client_action').makeFactoryWithModifier(function (spec) { - return require('../utils').merge(spec, { - params: { - filterPath: { - type: 'list', - name: 'filter_path' - } - } - }); -}); -var namespace = require('../client_action').namespaceFactory; -var api = module.exports = {}; - -api._namespaces = ['cat', 'cluster', 'indices', 'nodes', 'snapshot']; - -/** - * Perform a [bulk](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/docs-bulk.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.consistency - Explicit write consistency setting for the operation - * @param {<>} params.refresh - Refresh the index after performing the operation - * @param {<>} [params.replication=sync] - Explicitely set the replication type - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.type - Default document type for items which don't provide one - * @param {<>} params.index - Default index for items which don't provide one - */ -api.bulk = ca({ - params: { - consistency: { - type: 'enum', - options: [ - 'one', - 'quorum', - 'all' - ] - }, - refresh: { - type: 'boolean' - }, - replication: { - type: 'enum', - 'default': 'sync', - options: [ - 'sync', - 'async' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - type: { - type: 'string' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_bulk', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_bulk', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_bulk' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -api.cat = namespace(); - -/** - * Perform a [cat.aliases](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/cat.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.name - A comma-separated list of alias names to return - */ -api.cat.prototype.aliases = ca({ - params: { - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/aliases/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/_cat/aliases' - } - ] -}); - -/** - * Perform a [cat.allocation](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/cat-allocation.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information - */ -api.cat.prototype.allocation = ca({ - params: { - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'm', - 'g' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/allocation/<%=nodeId%>', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_cat/allocation' - } - ] -}); - -/** - * Perform a [cat.count](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/cat-count.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.count = ca({ - params: { - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/count/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/count' - } - ] -}); - -/** - * Perform a [cat.fielddata](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/cat-fielddata.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return the fielddata size - */ -api.cat.prototype.fielddata = ca({ - params: { - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'm', - 'g' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - v: { - type: 'boolean', - 'default': false - }, - fields: { - type: 'list' - } - }, - urls: [ - { - fmt: '/_cat/fielddata/<%=fields%>', - req: { - fields: { - type: 'list' - } - } - }, - { - fmt: '/_cat/fielddata' - } - ] -}); - -/** - * Perform a [cat.health](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/cat-health.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} [params.ts=true] - Set to false to disable timestamping - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.health = ca({ - params: { - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - ts: { - type: 'boolean', - 'default': true - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/health' - } -}); - -/** - * Perform a [cat.help](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/cat.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.help - Return help information - */ -api.cat.prototype.help = ca({ - params: { - help: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat' - } -}); - -/** - * Perform a [cat.indices](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/cat-indices.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.pri - Set to true to return stats only for primary shards - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.indices = ca({ - params: { - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'm', - 'g' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - pri: { - type: 'boolean', - 'default': false - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/indices/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/indices' - } - ] -}); - -/** - * Perform a [cat.master](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/cat-master.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.master = ca({ - params: { - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/master' - } -}); - -/** - * Perform a [cat.nodes](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/cat-nodes.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.nodes = ca({ - params: { - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/nodes' - } -}); - -/** - * Perform a [cat.pendingTasks](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/cat-pending-tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.pendingTasks = ca({ - params: { - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/pending_tasks' - } -}); - -/** - * Perform a [cat.plugins](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/cat-plugins.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.plugins = ca({ - params: { - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/plugins' - } -}); - -/** - * Perform a [cat.recovery](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/cat-recovery.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.recovery = ca({ - params: { - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'm', - 'g' - ] - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/recovery/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/recovery' - } - ] -}); - -/** - * Perform a [cat.segments](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/cat-segments.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} [params.v=true] - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.segments = ca({ - params: { - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - v: { - type: 'boolean', - 'default': true - } - }, - urls: [ - { - fmt: '/_cat/segments/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/segments' - } - ] -}); - -/** - * Perform a [cat.shards](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/cat-shards.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.shards = ca({ - params: { - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/shards/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/shards' - } - ] -}); - -/** - * Perform a [cat.threadPool](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/cat-thread-pool.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>} params.fullId - Enables displaying the complete node ids - */ -api.cat.prototype.threadPool = ca({ - params: { - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - v: { - type: 'boolean', - 'default': false - }, - fullId: { - type: 'boolean', - 'default': false, - name: 'full_id' - } - }, - url: { - fmt: '/_cat/thread_pool' - } -}); - -/** - * Perform a [clearScroll](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/search-request-scroll.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.scrollId - A comma-separated list of scroll IDs to clear - */ -api.clearScroll = ca({ - urls: [ - { - fmt: '/_search/scroll/<%=scrollId%>', - req: { - scrollId: { - type: 'list' - } - } - }, - { - fmt: '/_search/scroll' - } - ], - paramAsBody: 'scrollId', - method: 'DELETE' -}); - -api.cluster = namespace(); - -/** - * Perform a [cluster.getSettings](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/cluster-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - */ -api.cluster.prototype.getSettings = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_cluster/settings' - } -}); - -/** - * Perform a [cluster.health](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/cluster-health.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} [params.level=cluster] - Specify the level of detail for returned information - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.waitForActiveShards - Wait until the specified number of shards is active - * @param {<>} params.waitForNodes - Wait until the specified number of nodes is available - * @param {<>} params.waitForRelocatingShards - Wait until the specified number of relocating shards is finished - * @param {<>} params.waitForStatus - Wait until cluster is in a specific state - * @param {<>} params.index - Limit the information returned to a specific index - */ -api.cluster.prototype.health = ca({ - params: { - level: { - type: 'enum', - 'default': 'cluster', - options: [ - 'cluster', - 'indices', - 'shards' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - }, - waitForActiveShards: { - type: 'number', - name: 'wait_for_active_shards' - }, - waitForNodes: { - type: 'string', - name: 'wait_for_nodes' - }, - waitForRelocatingShards: { - type: 'number', - name: 'wait_for_relocating_shards' - }, - waitForStatus: { - type: 'enum', - 'default': null, - options: [ - 'green', - 'yellow', - 'red' - ], - name: 'wait_for_status' - } - }, - urls: [ - { - fmt: '/_cluster/health/<%=index%>', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_cluster/health' - } - ] -}); - -/** - * Perform a [cluster.pendingTasks](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/cluster-pending.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Specify timeout for connection to master - */ -api.cluster.prototype.pendingTasks = ca({ - params: { - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_cluster/pending_tasks' - } -}); - -/** - * Perform a [cluster.putSettings](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/cluster-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - */ -api.cluster.prototype.putSettings = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_cluster/settings' - }, - method: 'PUT' -}); - -/** - * Perform a [cluster.reroute](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/cluster-reroute.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.dryRun - Simulate the operation only and return the resulting state - * @param {<>} params.explain - Return an explanation of why the commands can or cannot be executed - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics. Defaults to all but metadata - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - */ -api.cluster.prototype.reroute = ca({ - params: { - dryRun: { - type: 'boolean', - name: 'dry_run' - }, - explain: { - type: 'boolean' - }, - metric: { - type: 'list', - options: [ - '_all', - 'blocks', - 'metadata', - 'nodes', - 'routing_table', - 'master_node', - 'version' - ] - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_cluster/reroute' - }, - method: 'POST' -}); - -/** - * Perform a [cluster.state](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/cluster-state.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics - */ -api.cluster.prototype.state = ca({ - params: { - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/_cluster/state/<%=metric%>/<%=index%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'blocks', - 'metadata', - 'nodes', - 'routing_table', - 'routing_nodes', - 'master_node', - 'version' - ] - }, - index: { - type: 'list' - } - } - }, - { - fmt: '/_cluster/state/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'blocks', - 'metadata', - 'nodes', - 'routing_table', - 'routing_nodes', - 'master_node', - 'version' - ] - } - } - }, - { - fmt: '/_cluster/state' - } - ] -}); - -/** - * Perform a [cluster.stats](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/cluster-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - */ -api.cluster.prototype.stats = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - human: { - type: 'boolean', - 'default': false - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_cluster/stats/nodes/<%=nodeId%>', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_cluster/stats' - } - ] -}); - -/** - * Perform a [count](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/search-count.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.minScore - Include only documents with a specific `_score` value in the result - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.lowercaseExpandedTerms - Specify whether query terms should be lowercased - * @param {<>, <>, <>} params.index - A comma-separated list of indices to restrict the results - * @param {<>, <>, <>} params.type - A comma-separated list of types to restrict the results - */ -api.count = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - minScore: { - type: 'number', - name: 'min_score' - }, - preference: { - type: 'string' - }, - routing: { - type: 'string' - }, - q: { - type: 'string' - }, - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - lenient: { - type: 'boolean' - }, - lowercaseExpandedTerms: { - type: 'boolean', - name: 'lowercase_expanded_terms' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_count', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_count', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_count' - } - ], - method: 'POST' -}); - -/** - * Perform a [countPercolate](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/search-percolate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.percolateIndex - The index to count percolate the document into. Defaults to index. - * @param {<>} params.percolateType - The type to count percolate document into. Defaults to type. - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index of the document being count percolated. - * @param {<>} params.type - The type of the document being count percolated. - * @param {<>} params.id - Substitute the document in the request body with a document that is known by the specified id. On top of the id, the index and type parameter will be used to retrieve the document from within the cluster. - */ -api.countPercolate = ca({ - params: { - routing: { - type: 'list' - }, - preference: { - type: 'string' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - percolateIndex: { - type: 'string', - name: 'percolate_index' - }, - percolateType: { - type: 'string', - name: 'percolate_type' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_percolate/count', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/<%=type%>/_percolate/count', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - } - ], - method: 'POST' -}); - -/** - * Perform a [delete](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/docs-delete.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.consistency - Specific write consistency setting for the operation - * @param {<>} params.parent - ID of parent document - * @param {<>} params.refresh - Refresh the index after performing the operation - * @param {<>} [params.replication=sync] - Specific replication type - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api['delete'] = ca({ - params: { - consistency: { - type: 'enum', - options: [ - 'one', - 'quorum', - 'all' - ] - }, - parent: { - type: 'string' - }, - refresh: { - type: 'boolean' - }, - replication: { - type: 'enum', - 'default': 'sync', - options: [ - 'sync', - 'async' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [deleteByQuery](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/docs-delete-by-query.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.consistency - Specific write consistency setting for the operation - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} [params.replication=sync] - Specific replication type - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.index - A comma-separated list of indices to restrict the operation; use `_all` to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of types to restrict the operation - */ -api.deleteByQuery = ca({ - params: { - analyzer: { - type: 'string' - }, - consistency: { - type: 'enum', - options: [ - 'one', - 'quorum', - 'all' - ] - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - replication: { - type: 'enum', - 'default': 'sync', - options: [ - 'sync', - 'async' - ] - }, - q: { - type: 'string' - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_query', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_query', - req: { - index: { - type: 'list' - } - } - } - ], - method: 'DELETE' -}); - -/** - * Perform a [deleteScript](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - Script ID - * @param {<>} params.lang - Script language - */ -api.deleteScript = ca({ - params: { - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/_scripts/<%=lang%>/<%=id%>', - req: { - lang: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [deleteTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - Template ID - */ -api.deleteTemplate = ca({ - params: { - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/_search/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [exists](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document (use `_all` to fetch the first document matching the ID across all types) - */ -api.exists = ca({ - params: { - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [explain](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/search-explain.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzeWildcard - Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false) - * @param {<>} params.analyzer - The analyzer for the query string query - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The default field for query string query (default: _all) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return in the response - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.lowercaseExpandedTerms - Specify whether query terms should be lowercased - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.explain = ca({ - params: { - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - analyzer: { - type: 'string' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - fields: { - type: 'list' - }, - lenient: { - type: 'boolean' - }, - lowercaseExpandedTerms: { - type: 'boolean', - name: 'lowercase_expanded_terms' - }, - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_explain', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [fieldStats](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/search-field-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for to get field statistics for (min value, max value, and more) - * @param {<>} [params.level=cluster] - Defines if field stats should be returned on a per index level or on a cluster wide level - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.fieldStats = ca({ - params: { - fields: { - type: 'list' - }, - level: { - type: 'enum', - 'default': 'cluster', - options: [ - 'indices', - 'cluster' - ] - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_field_stats', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_field_stats' - } - ], - method: 'POST' -}); - -/** - * Perform a [get](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return in the response - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document (use `_all` to fetch the first document matching the ID across all types) - */ -api.get = ca({ - params: { - fields: { - type: 'list' - }, - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [getScript](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - Script ID - * @param {<>} params.lang - Script language - */ -api.getScript = ca({ - params: { - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/_scripts/<%=lang%>/<%=id%>', - req: { - lang: { - type: 'string' - }, - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [getSource](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document; use `_all` to fetch the first document matching the ID across all types - */ -api.getSource = ca({ - params: { - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_source', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [getTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - Template ID - */ -api.getTemplate = ca({ - params: { - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/_search/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [index](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/docs-index_.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.consistency - Explicit write consistency setting for the operation - * @param {<>} [params.opType=index] - Explicit operation type - * @param {<>} params.parent - ID of the parent document - * @param {<>} params.refresh - Refresh the index after performing the operation - * @param {<>} [params.replication=sync] - Specific replication type - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.index = ca({ - params: { - consistency: { - type: 'enum', - options: [ - 'one', - 'quorum', - 'all' - ] - }, - opType: { - type: 'enum', - 'default': 'index', - options: [ - 'index', - 'create' - ], - name: 'op_type' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'boolean' - }, - replication: { - type: 'enum', - 'default': 'sync', - options: [ - 'sync', - 'async' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - timestamp: { - type: 'time' - }, - ttl: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/<%=type%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - } - ], - needBody: true, - method: 'POST' -}); - -api.indices = namespace(); - -/** - * Perform a [indices.analyze](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-analyze.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The name of the analyzer to use - * @param {<>, <>, <>} params.charFilters - A comma-separated list of character filters to use for the analysis - * @param {<>} params.field - Use the analyzer configured for this field (instead of passing the analyzer name) - * @param {<>, <>, <>} params.filters - A comma-separated list of filters to use for the analysis - * @param {<>} params.index - The name of the index to scope the operation - * @param {<>} params.preferLocal - With `true`, specify that a local shard should be used if available, with `false`, use a random shard (default: true) - * @param {<>} params.text - The text on which the analysis should be performed (when request body is not used) - * @param {<>} params.tokenizer - The name of the tokenizer to use for the analysis - * @param {<>} [params.format=detailed] - Format of the output - */ -api.indices.prototype.analyze = ca({ - params: { - analyzer: { - type: 'string' - }, - charFilters: { - type: 'list', - name: 'char_filters' - }, - field: { - type: 'string' - }, - filters: { - type: 'list' - }, - index: { - type: 'string' - }, - preferLocal: { - type: 'boolean', - name: 'prefer_local' - }, - text: { - type: 'string' - }, - tokenizer: { - type: 'string' - }, - format: { - type: 'enum', - 'default': 'detailed', - options: [ - 'detailed', - 'text' - ] - } - }, - urls: [ - { - fmt: '/<%=index%>/_analyze', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_analyze' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.clearCache](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-clearcache.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.fieldData - Clear field data - * @param {<>} params.fielddata - Clear field data - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to clear when using the `field_data` parameter (default: all) - * @param {<>} params.filter - Clear filter caches - * @param {<>} params.filterCache - Clear filter caches - * @param {<>} params.filterKeys - A comma-separated list of keys to clear when using the `filter_cache` parameter (default: all) - * @param {<>} params.id - Clear ID caches for parent/child - * @param {<>} params.idCache - Clear ID caches for parent/child - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index name to limit the operation - * @param {<>} params.recycler - Clear the recycler cache - * @param {<>} params.queryCache - Clear query cache - */ -api.indices.prototype.clearCache = ca({ - params: { - fieldData: { - type: 'boolean', - name: 'field_data' - }, - fielddata: { - type: 'boolean' - }, - fields: { - type: 'list' - }, - filter: { - type: 'boolean' - }, - filterCache: { - type: 'boolean', - name: 'filter_cache' - }, - filterKeys: { - type: 'boolean', - name: 'filter_keys' - }, - id: { - type: 'boolean' - }, - idCache: { - type: 'boolean', - name: 'id_cache' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - index: { - type: 'list' - }, - recycler: { - type: 'boolean' - }, - queryCache: { - type: 'boolean', - name: 'query_cache' - } - }, - urls: [ - { - fmt: '/<%=index%>/_cache/clear', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cache/clear' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.close](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-open-close.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.index - The name of the index - */ -api.indices.prototype.close = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - url: { - fmt: '/<%=index%>/_close', - req: { - index: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [indices.create](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-create-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.index - The name of the index - */ -api.indices.prototype.create = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/<%=index%>', - req: { - index: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [indices.delete](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-delete-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices - */ -api.indices.prototype['delete'] = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [indices.deleteAlias](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit timestamp for the document - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of index names (supports wildcards); use `_all` for all indices - * @param {<>, <>, <>} params.name - A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices. - */ -api.indices.prototype.deleteAlias = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [indices.deleteMapping](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-delete-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of index names (supports wildcards); use `_all` for all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to delete (supports wildcards); use `_all` to delete all document types in the specified indices. - */ -api.indices.prototype.deleteMapping = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/_mapping', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [indices.deleteTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.name - The name of the template - */ -api.indices.prototype.deleteTemplate = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [indices.deleteWarmer](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-warmers.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.name - A comma-separated list of warmer names to delete (supports wildcards); use `_all` to delete all warmers in the specified indices. You must specify a name either in the uri or in the parameters. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to delete warmers from (supports wildcards); use `_all` to perform the operation on all indices. - */ -api.indices.prototype.deleteWarmer = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - name: { - type: 'list' - } - }, - url: { - fmt: '/<%=index%>/_warmer/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [indices.exists](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-exists.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of indices to check - */ -api.indices.prototype.exists = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - url: { - fmt: '/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [indices.existsAlias](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open,closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names to filter aliases - * @param {<>, <>, <>} params.name - A comma-separated list of alias names to return - */ -api.indices.prototype.existsAlias = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': [ - 'open', - 'closed' - ], - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/_alias/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_alias', - req: { - index: { - type: 'list' - } - } - } - ], - method: 'HEAD' -}); - -/** - * Perform a [indices.existsTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.name - The name of the template - */ -api.indices.prototype.existsTemplate = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - local: { - type: 'boolean' - } - }, - url: { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [indices.existsType](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-types-exists.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` to check the types across all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to check - */ -api.indices.prototype.existsType = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [indices.flush](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-flush.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.force - Whether a flush should be forced even if it is not necessarily needed ie. if no changes will be committed to the index. This is useful if transaction log IDs should be incremented even if no uncommitted changes are present. (This setting can be considered as internal) - * @param {<>} params.waitIfOngoing - If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. The default is false and will cause an exception to be thrown on the shard level if another flush operation is already running. - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string for all indices - */ -api.indices.prototype.flush = ca({ - params: { - force: { - type: 'boolean' - }, - waitIfOngoing: { - type: 'boolean', - name: 'wait_if_ongoing' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_flush', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_flush' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.flushSynced](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-synced-flush.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string for all indices - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - */ -api.indices.prototype.flushSynced = ca({ - urls: [ - { - fmt: '/<%=index%>/_flush/synced', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_flush/synced' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.get](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-get-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.ignoreUnavailable - Ignore unavailable indexes (default: false) - * @param {<>} params.allowNoIndices - Ignore if a wildcard expression resolves to no concrete indices (default: false) - * @param {<>} [params.expandWildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (default: open) - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} params.feature - A comma-separated list of features - */ -api.indices.prototype.get = ca({ - params: { - local: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=feature%>', - req: { - index: { - type: 'list' - }, - feature: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>', - req: { - index: { - type: 'list' - } - } - } - ] -}); - -/** - * Perform a [indices.getAlias](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names to filter aliases - * @param {<>, <>, <>} params.name - A comma-separated list of alias names to return - */ -api.indices.prototype.getAlias = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/_alias/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_alias', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_alias' - } - ] -}); - -/** - * Perform a [indices.getAliases](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names to filter aliases - * @param {<>, <>, <>} params.name - A comma-separated list of alias names to filter - */ -api.indices.prototype.getAliases = ca({ - params: { - timeout: { - type: 'time' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_aliases/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_aliases', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_aliases/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/_aliases' - } - ] -}); - -/** - * Perform a [indices.getFieldMapping](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-get-field-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.includeDefaults - Whether the default mapping values should be returned as well - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} params.type - A comma-separated list of document types - * @param {<>, <>, <>} params.field - A comma-separated list of fields - */ -api.indices.prototype.getFieldMapping = ca({ - params: { - includeDefaults: { - type: 'boolean', - name: 'include_defaults' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_mapping/<%=type%>/field/<%=field%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - }, - field: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_mapping/field/<%=field%>', - req: { - index: { - type: 'list' - }, - field: { - type: 'list' - } - } - }, - { - fmt: '/_mapping/<%=type%>/field/<%=field%>', - req: { - type: { - type: 'list' - }, - field: { - type: 'list' - } - } - }, - { - fmt: '/_mapping/field/<%=field%>', - req: { - field: { - type: 'list' - } - } - } - ] -}); - -/** - * Perform a [indices.getMapping](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-get-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} params.type - A comma-separated list of document types - */ -api.indices.prototype.getMapping = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_mapping/<%=type%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_mapping', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_mapping/<%=type%>', - req: { - type: { - type: 'list' - } - } - }, - { - fmt: '/_mapping' - } - ] -}); - -/** - * Perform a [indices.getSettings](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-get-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open,closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.name - The name of the settings that should be included - */ -api.indices.prototype.getSettings = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': [ - 'open', - 'closed' - ], - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_settings/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_settings', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_settings/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/_settings' - } - ] -}); - -/** - * Perform a [indices.getTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.name - The name of the template - */ -api.indices.prototype.getTemplate = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - { - fmt: '/_template' - } - ] -}); - -/** - * Perform a [indices.getUpgrade](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-upgrade.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.getUpgrade = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - human: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/<%=index%>/_upgrade', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_upgrade' - } - ] -}); - -/** - * Perform a [indices.getWarmer](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-warmers.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names to restrict the operation; use `_all` to perform the operation on all indices - * @param {<>, <>, <>} params.name - The name of the warmer (supports wildcards); leave empty to get all warmers - * @param {<>, <>, <>} params.type - A comma-separated list of document types to restrict the operation; leave empty to perform the operation on all types - */ -api.indices.prototype.getWarmer = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_warmer/<%=name%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_warmer/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_warmer', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_warmer/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/_warmer' - } - ] -}); - -/** - * Perform a [indices.open](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-open-close.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.index - The name of the index - */ -api.indices.prototype.open = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'closed', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - url: { - fmt: '/<%=index%>/_open', - req: { - index: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [indices.optimize](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-optimize.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flush - Specify whether the index should be flushed after performing the operation (default: true) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.maxNumSegments - The number of segments the index should be merged into (default: dynamic) - * @param {<>} params.onlyExpungeDeletes - Specify whether the operation should only expunge deleted documents - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.waitForMerge - Specify whether the request should block until the merge process is finished (default: true) - * @param {<>} params.force - Force a merge operation to run, even if there is a single segment in the index (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.optimize = ca({ - params: { - flush: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - maxNumSegments: { - type: 'number', - name: 'max_num_segments' - }, - onlyExpungeDeletes: { - type: 'boolean', - name: 'only_expunge_deletes' - }, - operationThreading: { - name: 'operation_threading' - }, - waitForMerge: { - type: 'boolean', - name: 'wait_for_merge' - }, - force: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_optimize', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_optimize' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.putAlias](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit timestamp for the document - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices. - * @param {<>} params.name - The name of the alias to be created or updated - */ -api.indices.prototype.putAlias = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'string' - } - } - }, - method: 'PUT' -}); - -/** - * Perform a [indices.putMapping](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-put-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreConflicts - Specify whether to ignore conflicts while updating the mapping (default: false) - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices. - * @param {<>} params.type - The name of the document type - */ -api.indices.prototype.putMapping = ca({ - params: { - ignoreConflicts: { - type: 'boolean', - name: 'ignore_conflicts' - }, - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_mapping/<%=type%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/_mapping/<%=type%>', - req: { - type: { - type: 'string' - } - } - } - ], - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [indices.putSettings](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.putSettings = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - } - }, - urls: [ - { - fmt: '/<%=index%>/_settings', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_settings' - } - ], - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [indices.putTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.order - The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers) - * @param {<>} params.create - Whether the index template should only be added if new or can also replace an existing one - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.name - The name of the template - */ -api.indices.prototype.putTemplate = ca({ - params: { - order: { - type: 'number' - }, - create: { - type: 'boolean', - 'default': false - }, - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - } - }, - url: { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [indices.putWarmer](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-warmers.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) in the search request to warm - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices in the search request to warm. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both, in the search request to warm. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to register the warmer for; use `_all` or omit to perform the operation on all indices - * @param {<>} params.name - The name of the warmer - * @param {<>, <>, <>} params.type - A comma-separated list of document types to register the warmer for; leave empty to perform the operation on all types - */ -api.indices.prototype.putWarmer = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_warmer/<%=name%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - }, - name: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_warmer/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'string' - } - } - }, - { - fmt: '/_warmer/<%=name%>', - req: { - name: { - type: 'string' - } - } - } - ], - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [indices.recovery](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-recovery.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.detailed - Whether to display detailed information about shard recovery - * @param {<>} params.activeOnly - Display only those recoveries that are currently on-going - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.recovery = ca({ - params: { - detailed: { - type: 'boolean', - 'default': false - }, - activeOnly: { - type: 'boolean', - 'default': false, - name: 'active_only' - }, - human: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/<%=index%>/_recovery', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_recovery' - } - ] -}); - -/** - * Perform a [indices.refresh](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-refresh.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.force - Force a refresh even if not required - * @param {anything} params.operationThreading - TODO: ? - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.refresh = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - force: { - type: 'boolean', - 'default': false - }, - operationThreading: { - name: 'operation_threading' - } - }, - urls: [ - { - fmt: '/<%=index%>/_refresh', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_refresh' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.segments](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-segments.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {anything} params.operationThreading - TODO: ? - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.segments = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - human: { - type: 'boolean', - 'default': false - }, - operationThreading: { - name: 'operation_threading' - } - }, - urls: [ - { - fmt: '/<%=index%>/_segments', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_segments' - } - ] -}); - -/** - * Perform a [indices.stats](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.completionFields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields for `fielddata` index metric (supports wildcards) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) - * @param {<>, <>, <>} params.groups - A comma-separated list of search groups for `search` index metric - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>} [params.level=indices] - Return stats aggregated at cluster, index or shard level - * @param {<>, <>, <>} params.types - A comma-separated list of document types for the `indexing` index metric - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.metric - Limit the information returned the specific metrics. - */ -api.indices.prototype.stats = ca({ - params: { - completionFields: { - type: 'list', - name: 'completion_fields' - }, - fielddataFields: { - type: 'list', - name: 'fielddata_fields' - }, - fields: { - type: 'list' - }, - groups: { - type: 'list' - }, - human: { - type: 'boolean', - 'default': false - }, - level: { - type: 'enum', - 'default': 'indices', - options: [ - 'cluster', - 'indices', - 'shards' - ] - }, - types: { - type: 'list' - } - }, - urls: [ - { - fmt: '/<%=index%>/_stats/<%=metric%>', - req: { - index: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'filter_cache', - 'flush', - 'get', - 'id_cache', - 'indexing', - 'merge', - 'percolate', - 'query_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/_stats/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'filter_cache', - 'flush', - 'get', - 'id_cache', - 'indexing', - 'merge', - 'percolate', - 'query_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/<%=index%>/_stats', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_stats' - } - ] -}); - -/** - * Perform a [indices.status](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-status.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.recovery - Return information about shard recovery - * @param {<>} params.snapshot - TODO: ? - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.status = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - human: { - type: 'boolean', - 'default': false - }, - operationThreading: { - name: 'operation_threading' - }, - recovery: { - type: 'boolean' - }, - snapshot: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_status', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_status' - } - ] -}); - -/** - * Perform a [indices.updateAliases](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Request timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - */ -api.indices.prototype.updateAliases = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_aliases' - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [indices.upgrade](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-upgrade.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.waitForCompletion - Specify whether the request should block until the all segments are upgraded (default: true) - * @param {<>} params.onlyAncientSegments - If true, only ancient (an older Lucene major release) segments will be upgraded - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.upgrade = ca({ - params: { - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - waitForCompletion: { - type: 'boolean', - name: 'wait_for_completion' - }, - onlyAncientSegments: { - type: 'boolean', - name: 'only_ancient_segments' - } - }, - urls: [ - { - fmt: '/<%=index%>/_upgrade', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_upgrade' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.validateQuery](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/search-validate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.explain - Return detailed information about the error - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.lowercaseExpandedTerms - Specify whether query terms should be lowercased - * @param {<>} params.rewrite - Provide a more detailed explanation showing the actual Lucene query that will be executed. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to restrict the operation; leave empty to perform the operation on all types - */ -api.indices.prototype.validateQuery = ca({ - params: { - explain: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - operationThreading: { - name: 'operation_threading' - }, - q: { - type: 'string' - }, - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - lenient: { - type: 'boolean' - }, - lowercaseExpandedTerms: { - type: 'boolean', - name: 'lowercase_expanded_terms' - }, - rewrite: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_validate/query', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_validate/query', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_validate/query' - } - ], - method: 'POST' -}); - -/** - * Perform a [info](http://www.elastic.co/guide/) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.info = ca({ - url: { - fmt: '/' - } -}); - -/** - * Perform a [mget](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/docs-multi-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return in the response - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.mget = ca({ - params: { - fields: { - type: 'list' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_mget', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_mget', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_mget' - } - ], - needBody: true, - method: 'POST' -}); - -/** - * Perform a [mlt](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/search-more-like-this.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.boostTerms - The boost factor - * @param {<>} params.maxDocFreq - The word occurrence frequency as count: words with higher occurrence in the corpus will be ignored - * @param {<>} params.maxQueryTerms - The maximum query terms to be included in the generated query - * @param {<>} params.maxWordLength - The minimum length of the word: longer words will be ignored - * @param {<>} params.minDocFreq - The word occurrence frequency as count: words with lower occurrence in the corpus will be ignored - * @param {<>} params.minTermFreq - The term frequency as percent: terms with lower occurence in the source document will be ignored - * @param {<>} params.minWordLength - The minimum length of the word: shorter words will be ignored - * @param {<>, <>, <>} params.mltFields - Specific fields to perform the query against - * @param {<>} params.percentTermsToMatch - How many terms have to match in order to consider the document a match (default: 0.3) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.searchFrom - The offset from which to return results - * @param {<>, <>, <>} params.searchIndices - A comma-separated list of indices to perform the query against (default: the index containing the document) - * @param {<>} params.searchScroll - A scroll search request definition - * @param {<>} params.searchSize - The number of documents to return (default: 10) - * @param {<>} params.searchSource - A specific search request definition (instead of using the request body) - * @param {<>} params.searchType - Specific search type (eg. `dfs_then_fetch`, `count`, etc) - * @param {<>, <>, <>} params.searchTypes - A comma-separated list of types to perform the query against (default: the same type as the document) - * @param {<>, <>, <>} params.stopWords - A list of stop words to be ignored - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document (use `_all` to fetch the first document matching the ID across all types) - */ -api.mlt = ca({ - params: { - boostTerms: { - type: 'number', - name: 'boost_terms' - }, - maxDocFreq: { - type: 'number', - name: 'max_doc_freq' - }, - maxQueryTerms: { - type: 'number', - name: 'max_query_terms' - }, - maxWordLength: { - type: 'number', - name: 'max_word_length' - }, - minDocFreq: { - type: 'number', - name: 'min_doc_freq' - }, - minTermFreq: { - type: 'number', - name: 'min_term_freq' - }, - minWordLength: { - type: 'number', - name: 'min_word_length' - }, - mltFields: { - type: 'list', - name: 'mlt_fields' - }, - percentTermsToMatch: { - type: 'number', - name: 'percent_terms_to_match' - }, - routing: { - type: 'string' - }, - searchFrom: { - type: 'number', - name: 'search_from' - }, - searchIndices: { - type: 'list', - name: 'search_indices' - }, - searchScroll: { - type: 'string', - name: 'search_scroll' - }, - searchSize: { - type: 'number', - name: 'search_size' - }, - searchSource: { - type: 'string', - name: 'search_source' - }, - searchType: { - type: 'string', - name: 'search_type' - }, - searchTypes: { - type: 'list', - name: 'search_types' - }, - stopWords: { - type: 'list', - name: 'stop_words' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_mlt', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [mpercolate](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/search-percolate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.index - The index of the document being count percolated to use as default - * @param {<>} params.type - The type of the document being percolated to use as default. - */ -api.mpercolate = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_mpercolate', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_mpercolate', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_mpercolate' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -/** - * Perform a [msearch](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/search-multi-search.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.searchType - Search operation type - * @param {<>, <>, <>} params.index - A comma-separated list of index names to use as default - * @param {<>, <>, <>} params.type - A comma-separated list of document types to use as default - */ -api.msearch = ca({ - params: { - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'query_and_fetch', - 'dfs_query_then_fetch', - 'dfs_query_and_fetch', - 'count', - 'scan' - ], - name: 'search_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_msearch', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_msearch', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_msearch' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -/** - * Perform a [mtermvectors](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/docs-multi-termvectors.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.ids - A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body - * @param {<>} params.termStatistics - Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.fieldStatistics=true] - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.offsets=true] - Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.positions=true] - Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.payloads=true] - Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) .Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.routing - Specific routing value. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.parent - Parent id of documents. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.realtime - Specifies if requests are real-time as opposed to near-real-time (default: true). - * @param {<>} params.index - The index in which the document resides. - * @param {<>} params.type - The type of the document. - */ -api.mtermvectors = ca({ - params: { - ids: { - type: 'list', - required: false - }, - termStatistics: { - type: 'boolean', - 'default': false, - required: false, - name: 'term_statistics' - }, - fieldStatistics: { - type: 'boolean', - 'default': true, - required: false, - name: 'field_statistics' - }, - fields: { - type: 'list', - required: false - }, - offsets: { - type: 'boolean', - 'default': true, - required: false - }, - positions: { - type: 'boolean', - 'default': true, - required: false - }, - payloads: { - type: 'boolean', - 'default': true, - required: false - }, - preference: { - type: 'string', - required: false - }, - routing: { - type: 'string', - required: false - }, - parent: { - type: 'string', - required: false - }, - realtime: { - type: 'boolean', - required: false - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_mtermvectors', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_mtermvectors', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_mtermvectors' - } - ], - method: 'POST' -}); - -api.nodes = namespace(); - -/** - * Perform a [nodes.hotThreads](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/cluster-nodes-hot-threads.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.interval - The interval for the second sampling of threads - * @param {<>} params.snapshots - Number of samples of thread stacktrace (default: 10) - * @param {<>} params.threads - Specify the number of threads to provide information for (default: 3) - * @param {<>} params.ignoreIdleThreads - Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue (default: true) - * @param {<>} params.type - The type to sample (default: cpu) - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - */ -api.nodes.prototype.hotThreads = ca({ - params: { - interval: { - type: 'time' - }, - snapshots: { - type: 'number' - }, - threads: { - type: 'number' - }, - ignoreIdleThreads: { - type: 'boolean', - name: 'ignore_idle_threads' - }, - type: { - type: 'enum', - options: [ - 'cpu', - 'wait', - 'block' - ] - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_nodes/<%=nodeId%>/hotthreads', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_nodes/hotthreads' - } - ] -}); - -/** - * Perform a [nodes.info](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/cluster-nodes-info.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.metric - A comma-separated list of metrics you wish returned. Leave empty to return all. - */ -api.nodes.prototype.info = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - human: { - type: 'boolean', - 'default': false - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_nodes/<%=nodeId%>/<%=metric%>', - req: { - nodeId: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - 'settings', - 'os', - 'process', - 'jvm', - 'thread_pool', - 'network', - 'transport', - 'http', - 'plugins' - ] - } - } - }, - { - fmt: '/_nodes/<%=nodeId%>', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_nodes/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - 'settings', - 'os', - 'process', - 'jvm', - 'thread_pool', - 'network', - 'transport', - 'http', - 'plugins' - ] - } - } - }, - { - fmt: '/_nodes' - } - ] -}); - -/** - * Perform a [nodes.shutdown](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/cluster-nodes-shutdown.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.delay - Set the delay for the operation (default: 1s) - * @param {<>} params.exit - Exit the JVM as well (default: true) - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to perform the operation on; use `_local` to perform the operation on the node you're connected to, leave empty to perform the operation on all nodes - */ -api.nodes.prototype.shutdown = ca({ - params: { - delay: { - type: 'time' - }, - exit: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/_cluster/nodes/<%=nodeId%>/_shutdown', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_shutdown' - } - ], - method: 'POST' -}); - -/** - * Perform a [nodes.stats](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/cluster-nodes-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.completionFields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields for `fielddata` index metric (supports wildcards) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) - * @param {<>} params.groups - A comma-separated list of search groups for `search` index metric - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>} [params.level=node] - Return indices stats aggregated at node, index or shard level - * @param {<>, <>, <>} params.types - A comma-separated list of document types for the `indexing` index metric - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics - * @param {<>, <>, <>} params.indexMetric - Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified. - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - */ -api.nodes.prototype.stats = ca({ - params: { - completionFields: { - type: 'list', - name: 'completion_fields' - }, - fielddataFields: { - type: 'list', - name: 'fielddata_fields' - }, - fields: { - type: 'list' - }, - groups: { - type: 'boolean' - }, - human: { - type: 'boolean', - 'default': false - }, - level: { - type: 'enum', - 'default': 'node', - options: [ - 'node', - 'indices', - 'shards' - ] - }, - types: { - type: 'list' - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_nodes/<%=nodeId%>/stats/<%=metric%>/<%=indexMetric%>', - req: { - nodeId: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'network', - 'os', - 'process', - 'thread_pool', - 'transport' - ] - }, - indexMetric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'filter_cache', - 'flush', - 'get', - 'id_cache', - 'indexing', - 'merge', - 'percolate', - 'query_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/_nodes/<%=nodeId%>/stats/<%=metric%>', - req: { - nodeId: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'network', - 'os', - 'process', - 'thread_pool', - 'transport' - ] - } - } - }, - { - fmt: '/_nodes/stats/<%=metric%>/<%=indexMetric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'network', - 'os', - 'process', - 'thread_pool', - 'transport' - ] - }, - indexMetric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'filter_cache', - 'flush', - 'get', - 'id_cache', - 'indexing', - 'merge', - 'percolate', - 'query_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/_nodes/<%=nodeId%>/stats', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_nodes/stats/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'network', - 'os', - 'process', - 'thread_pool', - 'transport' - ] - } - } - }, - { - fmt: '/_nodes/stats' - } - ] -}); - -/** - * Perform a [percolate](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/search-percolate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.percolateFormat - Return an array of matching query IDs instead of objects - * @param {<>} params.percolateIndex - The index to percolate the document into. Defaults to index. - * @param {<>} params.percolateType - The type to percolate document into. Defaults to type. - * @param {<>} params.percolateRouting - The routing value to use when percolating the existing document. - * @param {<>} params.percolatePreference - Which shard to prefer when executing the percolate request. - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index of the document being percolated. - * @param {<>} params.type - The type of the document being percolated. - * @param {<>} params.id - Substitute the document in the request body with a document that is known by the specified id. On top of the id, the index and type parameter will be used to retrieve the document from within the cluster. - */ -api.percolate = ca({ - params: { - routing: { - type: 'list' - }, - preference: { - type: 'string' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - percolateFormat: { - type: 'enum', - options: [ - 'ids' - ], - name: 'percolate_format' - }, - percolateIndex: { - type: 'string', - name: 'percolate_index' - }, - percolateType: { - type: 'string', - name: 'percolate_type' - }, - percolateRouting: { - type: 'string', - name: 'percolate_routing' - }, - percolatePreference: { - type: 'string', - name: 'percolate_preference' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_percolate', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/<%=type%>/_percolate', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - } - ], - method: 'POST' -}); - -/** - * Perform a [ping](http://www.elastic.co/guide/) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.ping = ca({ - url: { - fmt: '/' - }, - requestTimeout: 3000, - method: 'HEAD' -}); - -/** - * Perform a [putScript](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} [params.opType=index] - Explicit operation type - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - Script ID - * @param {<>} params.lang - Script language - */ -api.putScript = ca({ - params: { - opType: { - type: 'enum', - 'default': 'index', - options: [ - 'index', - 'create' - ], - name: 'op_type' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/_scripts/<%=lang%>/<%=id%>', - req: { - lang: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [putTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} [params.opType=index] - Explicit operation type - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - Template ID - */ -api.putTemplate = ca({ - params: { - opType: { - type: 'enum', - 'default': 'index', - options: [ - 'index', - 'create' - ], - name: 'op_type' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/_search/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [scroll](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/search-request-scroll.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.scrollId - The scroll ID - */ -api.scroll = ca({ - params: { - scroll: { - type: 'time' - }, - scrollId: { - type: 'string', - name: 'scroll_id' - } - }, - urls: [ - { - fmt: '/_search/scroll/<%=scrollId%>', - req: { - scrollId: { - type: 'string' - } - } - }, - { - fmt: '/_search/scroll' - } - ], - paramAsBody: 'scrollId', - method: 'POST' -}); - -/** - * Perform a [search](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/search-search.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.explain - Specify whether to return detailed information about score computation as part of a hit - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return as part of a hit - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields to return as the field data representation of a field for each hit - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.lowercaseExpandedTerms - Specify whether query terms should be lowercased - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.suggestField - Specify which field to use for suggestions - * @param {<>} [params.suggestMode=missing] - Specify suggest mode - * @param {<>} params.suggestSize - How many suggestions to return in response - * @param {<>} params.suggestText - The source text for which the suggestions should be returned - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.trackScores - Whether to calculate and return scores even if they are not used for sorting - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.queryCache - Specify if query cache should be used for this request or not, defaults to index level setting - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.search = ca({ - params: { - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - explain: { - type: 'boolean' - }, - fields: { - type: 'list' - }, - fielddataFields: { - type: 'list', - name: 'fielddata_fields' - }, - from: { - type: 'number' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - lenient: { - type: 'boolean' - }, - lowercaseExpandedTerms: { - type: 'boolean', - name: 'lowercase_expanded_terms' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'query_and_fetch', - 'dfs_query_then_fetch', - 'dfs_query_and_fetch', - 'count', - 'scan' - ], - name: 'search_type' - }, - size: { - type: 'number' - }, - sort: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - stats: { - type: 'list' - }, - suggestField: { - type: 'string', - name: 'suggest_field' - }, - suggestMode: { - type: 'enum', - 'default': 'missing', - options: [ - 'missing', - 'popular', - 'always' - ], - name: 'suggest_mode' - }, - suggestSize: { - type: 'number', - name: 'suggest_size' - }, - suggestText: { - type: 'string', - name: 'suggest_text' - }, - timeout: { - type: 'time' - }, - trackScores: { - type: 'boolean', - name: 'track_scores' - }, - version: { - type: 'boolean' - }, - queryCache: { - type: 'boolean', - name: 'query_cache' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_search', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_search', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_search' - } - ], - method: 'POST' -}); - -/** - * Perform a [searchExists](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/search-exists.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.minScore - Include only documents with a specific `_score` value in the result - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.lowercaseExpandedTerms - Specify whether query terms should be lowercased - * @param {<>, <>, <>} params.index - A comma-separated list of indices to restrict the results - * @param {<>, <>, <>} params.type - A comma-separated list of types to restrict the results - */ -api.searchExists = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - minScore: { - type: 'number', - name: 'min_score' - }, - preference: { - type: 'string' - }, - routing: { - type: 'string' - }, - q: { - type: 'string' - }, - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - lenient: { - type: 'boolean' - }, - lowercaseExpandedTerms: { - type: 'boolean', - name: 'lowercase_expanded_terms' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_search/exists', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_search/exists', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_search/exists' - } - ], - method: 'POST' -}); - -/** - * Perform a [searchShards](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/search-shards.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.searchShards = ca({ - params: { - preference: { - type: 'string' - }, - routing: { - type: 'string' - }, - local: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_search_shards', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_search_shards', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_search_shards' - } - ], - method: 'POST' -}); - -/** - * Perform a [searchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.searchTemplate = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - preference: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'query_and_fetch', - 'dfs_query_then_fetch', - 'dfs_query_and_fetch', - 'count', - 'scan' - ], - name: 'search_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_search/template', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_search/template', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_search/template' - } - ], - method: 'POST' -}); - -api.snapshot = namespace(); - -/** - * Perform a [snapshot.create](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.waitForCompletion - Should this request wait until the operation has completed before returning - * @param {<>} params.repository - A repository name - * @param {<>} params.snapshot - A snapshot name - */ -api.snapshot.prototype.create = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForCompletion: { - type: 'boolean', - 'default': false, - name: 'wait_for_completion' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [snapshot.createRepository](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.verify - Whether to verify the repository after creation - * @param {<>} params.repository - A repository name - */ -api.snapshot.prototype.createRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - }, - verify: { - type: 'boolean' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>', - req: { - repository: { - type: 'string' - } - } - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [snapshot.delete](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.repository - A repository name - * @param {<>} params.snapshot - A snapshot name - */ -api.snapshot.prototype['delete'] = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [snapshot.deleteRepository](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.repository - A comma-separated list of repository names - */ -api.snapshot.prototype.deleteRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>', - req: { - repository: { - type: 'list' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [snapshot.get](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.repository - A repository name - * @param {<>, <>, <>} params.snapshot - A comma-separated list of snapshot names - */ -api.snapshot.prototype.get = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'list' - } - } - } -}); - -/** - * Perform a [snapshot.getRepository](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.repository - A comma-separated list of repository names - */ -api.snapshot.prototype.getRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/_snapshot/<%=repository%>', - req: { - repository: { - type: 'list' - } - } - }, - { - fmt: '/_snapshot' - } - ] -}); - -/** - * Perform a [snapshot.restore](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.waitForCompletion - Should this request wait until the operation has completed before returning - * @param {<>} params.repository - A repository name - * @param {<>} params.snapshot - A snapshot name - */ -api.snapshot.prototype.restore = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForCompletion: { - type: 'boolean', - 'default': false, - name: 'wait_for_completion' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>/_restore', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [snapshot.status](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.repository - A repository name - * @param {<>, <>, <>} params.snapshot - A comma-separated list of snapshot names - */ -api.snapshot.prototype.status = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - urls: [ - { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>/_status', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'list' - } - } - }, - { - fmt: '/_snapshot/<%=repository%>/_status', - req: { - repository: { - type: 'string' - } - } - }, - { - fmt: '/_snapshot/_status' - } - ] -}); - -/** - * Perform a [snapshot.verifyRepository](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.repository - A repository name - */ -api.snapshot.prototype.verifyRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/_verify', - req: { - repository: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [suggest](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/search-suggesters.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params.index - A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices - */ -api.suggest = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - preference: { - type: 'string' - }, - routing: { - type: 'string' - } - }, - urls: [ - { - fmt: '/<%=index%>/_suggest', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_suggest' - } - ], - needBody: true, - method: 'POST' -}); - -/** - * Perform a [termvector](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/docs-termvectors.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.termStatistics - Specifies if total term frequency and document frequency should be returned. - * @param {<>} [params.fieldStatistics=true] - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return. - * @param {<>} [params.offsets=true] - Specifies if term offsets should be returned. - * @param {<>} [params.positions=true] - Specifies if term positions should be returned. - * @param {<>} [params.payloads=true] - Specifies if term payloads should be returned. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random). - * @param {<>} params.routing - Specific routing value. - * @param {<>} params.parent - Parent id of documents. - * @param {<>} params.realtime - Specifies if request is real-time as opposed to near-real-time (default: true). - * @param {<>} params.index - The index in which the document resides. - * @param {<>} params.type - The type of the document. - * @param {<>} params.id - The id of the document. - */ -api.termvector = ca({ - params: { - termStatistics: { - type: 'boolean', - 'default': false, - required: false, - name: 'term_statistics' - }, - fieldStatistics: { - type: 'boolean', - 'default': true, - required: false, - name: 'field_statistics' - }, - fields: { - type: 'list', - required: false - }, - offsets: { - type: 'boolean', - 'default': true, - required: false - }, - positions: { - type: 'boolean', - 'default': true, - required: false - }, - payloads: { - type: 'boolean', - 'default': true, - required: false - }, - preference: { - type: 'string', - required: false - }, - routing: { - type: 'string', - required: false - }, - parent: { - type: 'string', - required: false - }, - realtime: { - type: 'boolean', - required: false - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_termvector', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/<%=type%>/_termvector', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - } - ], - method: 'POST' -}); - -/** - * Perform a [update](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/docs-update.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.consistency - Explicit write consistency setting for the operation - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return in the response - * @param {<>} params.lang - The script language (default: groovy) - * @param {<>} params.parent - ID of the parent document. Is is only used for routing and when for the upsert request - * @param {<>} params.refresh - Refresh the index after performing the operation - * @param {<>} [params.replication=sync] - Specific replication type - * @param {<>} params.retryOnConflict - Specify how many times should the operation be retried when a conflict occurs (default: 0) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.script - The URL-encoded script definition (instead of using request body) - * @param {<>} params.scriptId - The id of a stored script - * @param {<>} params.scriptedUpsert - True if the script referenced in script or script_id should be called to perform inserts - defaults to false - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.update = ca({ - params: { - consistency: { - type: 'enum', - options: [ - 'one', - 'quorum', - 'all' - ] - }, - fields: { - type: 'list' - }, - lang: { - type: 'string' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'boolean' - }, - replication: { - type: 'enum', - 'default': 'sync', - options: [ - 'sync', - 'async' - ] - }, - retryOnConflict: { - type: 'number', - name: 'retry_on_conflict' - }, - routing: { - type: 'string' - }, - script: { - type: 'string' - }, - scriptId: { - type: 'string', - name: 'script_id' - }, - scriptedUpsert: { - type: 'boolean', - name: 'scripted_upsert' - }, - timeout: { - type: 'time' - }, - timestamp: { - type: 'time' - }, - ttl: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_update', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [create](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/docs-index_.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.consistency - Explicit write consistency setting for the operation - * @param {<>} params.parent - ID of the parent document - * @param {<>} params.refresh - Refresh the index after performing the operation - * @param {<>} [params.replication=sync] - Specific replication type - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.create = ca.proxy(api.index, { - transform: function (params) { - params.op_type = 'create'; - } -}); diff --git a/src/lib/apis/2_4.js b/src/lib/apis/2_4.js deleted file mode 100644 index e597b172b..000000000 --- a/src/lib/apis/2_4.js +++ /dev/null @@ -1,6785 +0,0 @@ -var ca = require('../client_action').makeFactoryWithModifier(function (spec) { - return require('../utils').merge(spec, { - params: { - filterPath: { - type: 'list', - name: 'filter_path' - } - } - }); -}); -var namespace = require('../client_action').namespaceFactory; -var api = module.exports = {}; - -api._namespaces = ['cat', 'cluster', 'indices', 'nodes', 'snapshot', 'tasks']; - -/** - * Perform a [bulk](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/docs-bulk.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.consistency - Explicit write consistency setting for the operation - * @param {<>} params.refresh - Refresh the index after performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.type - Default document type for items which don't provide one - * @param {<>, <>, <>} params.fields - Default comma-separated list of fields to return in the response for updates - * @param {<>} params.index - Default index for items which don't provide one - */ -api.bulk = ca({ - params: { - consistency: { - type: 'enum', - options: [ - 'one', - 'quorum', - 'all' - ] - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - type: { - type: 'string' - }, - fields: { - type: 'list' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_bulk', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_bulk', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_bulk' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -api.cat = namespace(); - -/** - * Perform a [cat.aliases](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/cat.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.name - A comma-separated list of alias names to return - */ -api.cat.prototype.aliases = ca({ - params: { - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/aliases/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/_cat/aliases' - } - ] -}); - -/** - * Perform a [cat.allocation](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/cat-allocation.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information - */ -api.cat.prototype.allocation = ca({ - params: { - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'm', - 'g' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/allocation/<%=nodeId%>', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_cat/allocation' - } - ] -}); - -/** - * Perform a [cat.count](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/cat-count.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.count = ca({ - params: { - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/count/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/count' - } - ] -}); - -/** - * Perform a [cat.fielddata](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/cat-fielddata.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return the fielddata size - */ -api.cat.prototype.fielddata = ca({ - params: { - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'm', - 'g' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - v: { - type: 'boolean', - 'default': false - }, - fields: { - type: 'list' - } - }, - urls: [ - { - fmt: '/_cat/fielddata/<%=fields%>', - req: { - fields: { - type: 'list' - } - } - }, - { - fmt: '/_cat/fielddata' - } - ] -}); - -/** - * Perform a [cat.health](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/cat-health.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} [params.ts=true] - Set to false to disable timestamping - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.health = ca({ - params: { - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - ts: { - type: 'boolean', - 'default': true - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/health' - } -}); - -/** - * Perform a [cat.help](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/cat.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.help - Return help information - */ -api.cat.prototype.help = ca({ - params: { - help: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat' - } -}); - -/** - * Perform a [cat.indices](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/cat-indices.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.pri - Set to true to return stats only for primary shards - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.indices = ca({ - params: { - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'm', - 'g' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - pri: { - type: 'boolean', - 'default': false - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/indices/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/indices' - } - ] -}); - -/** - * Perform a [cat.master](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/cat-master.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.master = ca({ - params: { - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/master' - } -}); - -/** - * Perform a [cat.nodeattrs](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/cat-nodeattrs.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.nodeattrs = ca({ - params: { - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/nodeattrs' - } -}); - -/** - * Perform a [cat.nodes](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/cat-nodes.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.nodes = ca({ - params: { - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/nodes' - } -}); - -/** - * Perform a [cat.pendingTasks](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/cat-pending-tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.pendingTasks = ca({ - params: { - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/pending_tasks' - } -}); - -/** - * Perform a [cat.plugins](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/cat-plugins.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.plugins = ca({ - params: { - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/plugins' - } -}); - -/** - * Perform a [cat.recovery](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/cat-recovery.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.recovery = ca({ - params: { - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'm', - 'g' - ] - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/recovery/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/recovery' - } - ] -}); - -/** - * Perform a [cat.repositories](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/cat-repositories.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.repositories = ca({ - params: { - local: { - type: 'boolean', - 'default': false - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/repositories' - } -}); - -/** - * Perform a [cat.segments](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/cat-segments.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.segments = ca({ - params: { - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/segments/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/segments' - } - ] -}); - -/** - * Perform a [cat.shards](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/cat-shards.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.shards = ca({ - params: { - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/shards/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/shards' - } - ] -}); - -/** - * Perform a [cat.snapshots](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/cat-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Set to true to ignore unavailable snapshots - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.repository - Name of repository from which to fetch the snapshot information - */ -api.cat.prototype.snapshots = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - 'default': false, - name: 'ignore_unavailable' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/snapshots/<%=repository%>', - req: { - repository: { - type: 'list' - } - } - } -}); - -/** - * Perform a [cat.threadPool](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/cat-thread-pool.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>} params.fullId - Enables displaying the complete node ids - */ -api.cat.prototype.threadPool = ca({ - params: { - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - v: { - type: 'boolean', - 'default': false - }, - fullId: { - type: 'boolean', - 'default': false, - name: 'full_id' - } - }, - url: { - fmt: '/_cat/thread_pool' - } -}); - -/** - * Perform a [clearScroll](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/search-request-scroll.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.scrollId - A comma-separated list of scroll IDs to clear - */ -api.clearScroll = ca({ - urls: [ - { - fmt: '/_search/scroll/<%=scrollId%>', - req: { - scrollId: { - type: 'list' - } - } - }, - { - fmt: '/_search/scroll' - } - ], - paramAsBody: { - param: 'scrollId', - body: 'scroll_id' - }, - method: 'DELETE' -}); - -api.cluster = namespace(); - -/** - * Perform a [cluster.getSettings](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/cluster-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - */ -api.cluster.prototype.getSettings = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_cluster/settings' - } -}); - -/** - * Perform a [cluster.health](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/cluster-health.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} [params.level=cluster] - Specify the level of detail for returned information - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.waitForActiveShards - Wait until the specified number of shards is active - * @param {<>} params.waitForNodes - Wait until the specified number of nodes is available - * @param {<>} params.waitForRelocatingShards - Wait until the specified number of relocating shards is finished - * @param {<>} params.waitForStatus - Wait until cluster is in a specific state - * @param {<>, <>, <>} params.index - Limit the information returned to a specific index - */ -api.cluster.prototype.health = ca({ - params: { - level: { - type: 'enum', - 'default': 'cluster', - options: [ - 'cluster', - 'indices', - 'shards' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - }, - waitForActiveShards: { - type: 'number', - name: 'wait_for_active_shards' - }, - waitForNodes: { - type: 'string', - name: 'wait_for_nodes' - }, - waitForRelocatingShards: { - type: 'number', - name: 'wait_for_relocating_shards' - }, - waitForStatus: { - type: 'enum', - 'default': null, - options: [ - 'green', - 'yellow', - 'red' - ], - name: 'wait_for_status' - } - }, - urls: [ - { - fmt: '/_cluster/health/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cluster/health' - } - ] -}); - -/** - * Perform a [cluster.pendingTasks](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/cluster-pending.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Specify timeout for connection to master - */ -api.cluster.prototype.pendingTasks = ca({ - params: { - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_cluster/pending_tasks' - } -}); - -/** - * Perform a [cluster.putSettings](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/cluster-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - */ -api.cluster.prototype.putSettings = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_cluster/settings' - }, - method: 'PUT' -}); - -/** - * Perform a [cluster.reroute](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/cluster-reroute.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.dryRun - Simulate the operation only and return the resulting state - * @param {<>} params.explain - Return an explanation of why the commands can or cannot be executed - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics. Defaults to all but metadata - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - */ -api.cluster.prototype.reroute = ca({ - params: { - dryRun: { - type: 'boolean', - name: 'dry_run' - }, - explain: { - type: 'boolean' - }, - metric: { - type: 'list', - options: [ - '_all', - 'blocks', - 'metadata', - 'nodes', - 'routing_table', - 'master_node', - 'version' - ] - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_cluster/reroute' - }, - method: 'POST' -}); - -/** - * Perform a [cluster.state](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/cluster-state.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics - */ -api.cluster.prototype.state = ca({ - params: { - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/_cluster/state/<%=metric%>/<%=index%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'blocks', - 'metadata', - 'nodes', - 'routing_table', - 'routing_nodes', - 'master_node', - 'version' - ] - }, - index: { - type: 'list' - } - } - }, - { - fmt: '/_cluster/state/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'blocks', - 'metadata', - 'nodes', - 'routing_table', - 'routing_nodes', - 'master_node', - 'version' - ] - } - } - }, - { - fmt: '/_cluster/state' - } - ] -}); - -/** - * Perform a [cluster.stats](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/cluster-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - */ -api.cluster.prototype.stats = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - human: { - type: 'boolean', - 'default': false - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_cluster/stats/nodes/<%=nodeId%>', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_cluster/stats' - } - ] -}); - -/** - * Perform a [count](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/search-count.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.minScore - Include only documents with a specific `_score` value in the result - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.lowercaseExpandedTerms - Specify whether query terms should be lowercased - * @param {<>, <>, <>} params.index - A comma-separated list of indices to restrict the results - * @param {<>, <>, <>} params.type - A comma-separated list of types to restrict the results - */ -api.count = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - minScore: { - type: 'number', - name: 'min_score' - }, - preference: { - type: 'string' - }, - routing: { - type: 'string' - }, - q: { - type: 'string' - }, - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - lenient: { - type: 'boolean' - }, - lowercaseExpandedTerms: { - type: 'boolean', - name: 'lowercase_expanded_terms' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_count', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_count', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_count' - } - ], - method: 'POST' -}); - -/** - * Perform a [countPercolate](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/search-percolate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.percolateIndex - The index to count percolate the document into. Defaults to index. - * @param {<>} params.percolateType - The type to count percolate document into. Defaults to type. - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index of the document being count percolated. - * @param {<>} params.type - The type of the document being count percolated. - * @param {<>} params.id - Substitute the document in the request body with a document that is known by the specified id. On top of the id, the index and type parameter will be used to retrieve the document from within the cluster. - */ -api.countPercolate = ca({ - params: { - routing: { - type: 'list' - }, - preference: { - type: 'string' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - percolateIndex: { - type: 'string', - name: 'percolate_index' - }, - percolateType: { - type: 'string', - name: 'percolate_type' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_percolate/count', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/<%=type%>/_percolate/count', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - } - ], - method: 'POST' -}); - -/** - * Perform a [delete](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/docs-delete.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.consistency - Specific write consistency setting for the operation - * @param {<>} params.parent - ID of parent document - * @param {<>} params.refresh - Refresh the index after performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api['delete'] = ca({ - params: { - consistency: { - type: 'enum', - options: [ - 'one', - 'quorum', - 'all' - ] - }, - parent: { - type: 'string' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [deleteScript](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - Script ID - * @param {<>} params.lang - Script language - */ -api.deleteScript = ca({ - params: { - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/_scripts/<%=lang%>/<%=id%>', - req: { - lang: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [deleteTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - Template ID - */ -api.deleteTemplate = ca({ - params: { - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/_search/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [exists](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document (use `_all` to fetch the first document matching the ID across all types) - */ -api.exists = ca({ - params: { - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [explain](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/search-explain.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzeWildcard - Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false) - * @param {<>} params.analyzer - The analyzer for the query string query - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The default field for query string query (default: _all) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return in the response - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.lowercaseExpandedTerms - Specify whether query terms should be lowercased - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.explain = ca({ - params: { - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - analyzer: { - type: 'string' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - fields: { - type: 'list' - }, - lenient: { - type: 'boolean' - }, - lowercaseExpandedTerms: { - type: 'boolean', - name: 'lowercase_expanded_terms' - }, - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_explain', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [fieldStats](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/search-field-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for to get field statistics for (min value, max value, and more) - * @param {<>} [params.level=cluster] - Defines if field stats should be returned on a per index level or on a cluster wide level - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.fieldStats = ca({ - params: { - fields: { - type: 'list' - }, - level: { - type: 'enum', - 'default': 'cluster', - options: [ - 'indices', - 'cluster' - ] - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_field_stats', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_field_stats' - } - ], - method: 'POST' -}); - -/** - * Perform a [get](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return in the response - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document (use `_all` to fetch the first document matching the ID across all types) - */ -api.get = ca({ - params: { - fields: { - type: 'list' - }, - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [getScript](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - Script ID - * @param {<>} params.lang - Script language - */ -api.getScript = ca({ - params: { - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/_scripts/<%=lang%>/<%=id%>', - req: { - lang: { - type: 'string' - }, - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [getSource](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document; use `_all` to fetch the first document matching the ID across all types - */ -api.getSource = ca({ - params: { - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_source', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [getTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - Template ID - */ -api.getTemplate = ca({ - params: { - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/_search/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [index](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/docs-index_.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.consistency - Explicit write consistency setting for the operation - * @param {<>} [params.opType=index] - Explicit operation type - * @param {<>} params.parent - ID of the parent document - * @param {<>} params.refresh - Refresh the affected shards after performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.index = ca({ - params: { - consistency: { - type: 'enum', - options: [ - 'one', - 'quorum', - 'all' - ] - }, - opType: { - type: 'enum', - 'default': 'index', - options: [ - 'index', - 'create' - ], - name: 'op_type' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - timestamp: { - type: 'time' - }, - ttl: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/<%=type%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - } - ], - needBody: true, - method: 'POST' -}); - -api.indices = namespace(); - -/** - * Perform a [indices.analyze](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/indices-analyze.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The name of the analyzer to use - * @param {<>, <>, <>} params.charFilters - Deprecated : A comma-separated list of character filters to use for the analysis - * @param {<>, <>, <>} params.charFilter - A comma-separated list of character filters to use for the analysis - * @param {<>} params.field - Use the analyzer configured for this field (instead of passing the analyzer name) - * @param {<>, <>, <>} params.filters - Deprecated : A comma-separated list of filters to use for the analysis - * @param {<>, <>, <>} params.filter - A comma-separated list of filters to use for the analysis - * @param {<>} params.index - The name of the index to scope the operation - * @param {<>} params.preferLocal - With `true`, specify that a local shard should be used if available, with `false`, use a random shard (default: true) - * @param {<>, <>, <>} params.text - The text on which the analysis should be performed (when request body is not used) - * @param {<>} params.tokenizer - The name of the tokenizer to use for the analysis - * @param {<>} params.explain - With `true`, outputs more advanced details. (default: false) - * @param {<>, <>, <>} params.attributes - A comma-separated list of token attributes to output, this parameter works only with `explain=true` - * @param {<>} [params.format=detailed] - Format of the output - */ -api.indices.prototype.analyze = ca({ - params: { - analyzer: { - type: 'string' - }, - charFilters: { - type: 'list', - name: 'char_filters' - }, - charFilter: { - type: 'list', - name: 'char_filter' - }, - field: { - type: 'string' - }, - filters: { - type: 'list' - }, - filter: { - type: 'list' - }, - index: { - type: 'string' - }, - preferLocal: { - type: 'boolean', - name: 'prefer_local' - }, - text: { - type: 'list' - }, - tokenizer: { - type: 'string' - }, - explain: { - type: 'boolean' - }, - attributes: { - type: 'list' - }, - format: { - type: 'enum', - 'default': 'detailed', - options: [ - 'detailed', - 'text' - ] - } - }, - urls: [ - { - fmt: '/<%=index%>/_analyze', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_analyze' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.clearCache](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/indices-clearcache.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.fieldData - Clear field data - * @param {<>} params.fielddata - Clear field data - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to clear when using the `field_data` parameter (default: all) - * @param {<>} params.query - Clear query caches - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index name to limit the operation - * @param {<>} params.recycler - Clear the recycler cache - * @param {<>} params.request - Clear request cache - */ -api.indices.prototype.clearCache = ca({ - params: { - fieldData: { - type: 'boolean', - name: 'field_data' - }, - fielddata: { - type: 'boolean' - }, - fields: { - type: 'list' - }, - query: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - index: { - type: 'list' - }, - recycler: { - type: 'boolean' - }, - request: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_cache/clear', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cache/clear' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.close](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/indices-open-close.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma separated list of indices to close - */ -api.indices.prototype.close = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - url: { - fmt: '/<%=index%>/_close', - req: { - index: { - type: 'list' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [indices.create](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/indices-create-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.updateAllTypes - Whether to update the mapping for all fields with the same name across all types or not - * @param {<>} params.index - The name of the index - */ -api.indices.prototype.create = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - updateAllTypes: { - type: 'boolean', - name: 'update_all_types' - } - }, - url: { - fmt: '/<%=index%>', - req: { - index: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [indices.delete](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/indices-delete-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices - */ -api.indices.prototype['delete'] = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [indices.deleteAlias](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit timestamp for the document - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of index names (supports wildcards); use `_all` for all indices - * @param {<>, <>, <>} params.name - A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices. - */ -api.indices.prototype.deleteAlias = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [indices.deleteTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.name - The name of the template - */ -api.indices.prototype.deleteTemplate = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [indices.deleteWarmer](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/indices-warmers.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.name - A comma-separated list of warmer names to delete (supports wildcards); use `_all` to delete all warmers in the specified indices. You must specify a name either in the uri or in the parameters. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to delete warmers from (supports wildcards); use `_all` to perform the operation on all indices. - */ -api.indices.prototype.deleteWarmer = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - name: { - type: 'list' - } - }, - url: { - fmt: '/<%=index%>/_warmer/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [indices.exists](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/indices-exists.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of indices to check - */ -api.indices.prototype.exists = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - url: { - fmt: '/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [indices.existsAlias](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open,closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names to filter aliases - * @param {<>, <>, <>} params.name - A comma-separated list of alias names to return - */ -api.indices.prototype.existsAlias = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': [ - 'open', - 'closed' - ], - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/_alias/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_alias', - req: { - index: { - type: 'list' - } - } - } - ], - method: 'HEAD' -}); - -/** - * Perform a [indices.existsTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.name - The name of the template - */ -api.indices.prototype.existsTemplate = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - local: { - type: 'boolean' - } - }, - url: { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [indices.existsType](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/indices-types-exists.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` to check the types across all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to check - */ -api.indices.prototype.existsType = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [indices.flush](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/indices-flush.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.force - Whether a flush should be forced even if it is not necessarily needed ie. if no changes will be committed to the index. This is useful if transaction log IDs should be incremented even if no uncommitted changes are present. (This setting can be considered as internal) - * @param {<>} params.waitIfOngoing - If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. The default is false and will cause an exception to be thrown on the shard level if another flush operation is already running. - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string for all indices - */ -api.indices.prototype.flush = ca({ - params: { - force: { - type: 'boolean' - }, - waitIfOngoing: { - type: 'boolean', - name: 'wait_if_ongoing' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_flush', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_flush' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.flushSynced](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/indices-synced-flush.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string for all indices - */ -api.indices.prototype.flushSynced = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_flush/synced', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_flush/synced' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.forcemerge](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/indices-forcemerge.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flush - Specify whether the index should be flushed after performing the operation (default: true) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.maxNumSegments - The number of segments the index should be merged into (default: dynamic) - * @param {<>} params.onlyExpungeDeletes - Specify whether the operation should only expunge deleted documents - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.waitForMerge - Specify whether the request should block until the merge process is finished (default: true) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.forcemerge = ca({ - params: { - flush: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - maxNumSegments: { - type: 'number', - name: 'max_num_segments' - }, - onlyExpungeDeletes: { - type: 'boolean', - name: 'only_expunge_deletes' - }, - operationThreading: { - name: 'operation_threading' - }, - waitForMerge: { - type: 'boolean', - name: 'wait_for_merge' - } - }, - urls: [ - { - fmt: '/<%=index%>/_forcemerge', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_forcemerge' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.get](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/indices-get-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.ignoreUnavailable - Ignore unavailable indexes (default: false) - * @param {<>} params.allowNoIndices - Ignore if a wildcard expression resolves to no concrete indices (default: false) - * @param {<>} [params.expandWildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (default: open) - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.human - Whether to return version and creation date values in human-readable format. - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} params.feature - A comma-separated list of features - */ -api.indices.prototype.get = ca({ - params: { - local: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - human: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=feature%>', - req: { - index: { - type: 'list' - }, - feature: { - type: 'list', - options: [ - '_settings', - '_mappings', - '_warmers', - '_aliases' - ] - } - } - }, - { - fmt: '/<%=index%>', - req: { - index: { - type: 'list' - } - } - } - ] -}); - -/** - * Perform a [indices.getAlias](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names to filter aliases - * @param {<>, <>, <>} params.name - A comma-separated list of alias names to return - */ -api.indices.prototype.getAlias = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/_alias/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_alias', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_alias' - } - ] -}); - -/** - * Perform a [indices.getAliases](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names to filter aliases - * @param {<>, <>, <>} params.name - A comma-separated list of alias names to filter - */ -api.indices.prototype.getAliases = ca({ - params: { - timeout: { - type: 'time' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_aliases/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_aliases', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_aliases/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/_aliases' - } - ] -}); - -/** - * Perform a [indices.getFieldMapping](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/indices-get-field-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.includeDefaults - Whether the default mapping values should be returned as well - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} params.type - A comma-separated list of document types - * @param {<>, <>, <>} params.fields - A comma-separated list of fields - */ -api.indices.prototype.getFieldMapping = ca({ - params: { - includeDefaults: { - type: 'boolean', - name: 'include_defaults' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_mapping/<%=type%>/field/<%=fields%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - }, - fields: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_mapping/field/<%=fields%>', - req: { - index: { - type: 'list' - }, - fields: { - type: 'list' - } - } - }, - { - fmt: '/_mapping/<%=type%>/field/<%=fields%>', - req: { - type: { - type: 'list' - }, - fields: { - type: 'list' - } - } - }, - { - fmt: '/_mapping/field/<%=fields%>', - req: { - fields: { - type: 'list' - } - } - } - ] -}); - -/** - * Perform a [indices.getMapping](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/indices-get-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} params.type - A comma-separated list of document types - */ -api.indices.prototype.getMapping = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_mapping/<%=type%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_mapping', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_mapping/<%=type%>', - req: { - type: { - type: 'list' - } - } - }, - { - fmt: '/_mapping' - } - ] -}); - -/** - * Perform a [indices.getSettings](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/indices-get-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open,closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.human - Whether to return version and creation date values in human-readable format. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.name - The name of the settings that should be included - */ -api.indices.prototype.getSettings = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': [ - 'open', - 'closed' - ], - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - local: { - type: 'boolean' - }, - human: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/<%=index%>/_settings/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_settings', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_settings/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/_settings' - } - ] -}); - -/** - * Perform a [indices.getTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.name - The comma separated names of the index templates - */ -api.indices.prototype.getTemplate = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/_template' - } - ] -}); - -/** - * Perform a [indices.getUpgrade](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/indices-upgrade.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.getUpgrade = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - human: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/<%=index%>/_upgrade', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_upgrade' - } - ] -}); - -/** - * Perform a [indices.getWarmer](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/indices-warmers.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names to restrict the operation; use `_all` to perform the operation on all indices - * @param {<>, <>, <>} params.name - The name of the warmer (supports wildcards); leave empty to get all warmers - * @param {<>, <>, <>} params.type - A comma-separated list of document types to restrict the operation; leave empty to perform the operation on all types - */ -api.indices.prototype.getWarmer = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_warmer/<%=name%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_warmer/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_warmer', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_warmer/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/_warmer' - } - ] -}); - -/** - * Perform a [indices.open](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/indices-open-close.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma separated list of indices to open - */ -api.indices.prototype.open = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'closed', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - url: { - fmt: '/<%=index%>/_open', - req: { - index: { - type: 'list' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [indices.optimize](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/indices-optimize.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flush - Specify whether the index should be flushed after performing the operation (default: true) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.maxNumSegments - The number of segments the index should be merged into (default: dynamic) - * @param {<>} params.onlyExpungeDeletes - Specify whether the operation should only expunge deleted documents - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.waitForMerge - Specify whether the request should block until the merge process is finished (default: true) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.optimize = ca({ - params: { - flush: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - maxNumSegments: { - type: 'number', - name: 'max_num_segments' - }, - onlyExpungeDeletes: { - type: 'boolean', - name: 'only_expunge_deletes' - }, - operationThreading: { - name: 'operation_threading' - }, - waitForMerge: { - type: 'boolean', - name: 'wait_for_merge' - } - }, - urls: [ - { - fmt: '/<%=index%>/_optimize', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_optimize' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.putAlias](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit timestamp for the document - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices. - * @param {<>} params.name - The name of the alias to be created or updated - */ -api.indices.prototype.putAlias = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'string' - } - } - }, - method: 'PUT' -}); - -/** - * Perform a [indices.putMapping](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/indices-put-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.updateAllTypes - Whether to update the mapping for all fields with the same name across all types or not - * @param {<>, <>, <>} params.index - A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices. - * @param {<>} params.type - The name of the document type - */ -api.indices.prototype.putMapping = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - updateAllTypes: { - type: 'boolean', - name: 'update_all_types' - } - }, - urls: [ - { - fmt: '/<%=index%>/_mapping/<%=type%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/_mapping/<%=type%>', - req: { - type: { - type: 'string' - } - } - } - ], - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [indices.putSettings](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/indices-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.putSettings = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - } - }, - urls: [ - { - fmt: '/<%=index%>/_settings', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_settings' - } - ], - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [indices.putTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.order - The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers) - * @param {<>} params.create - Whether the index template should only be added if new or can also replace an existing one - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.name - The name of the template - */ -api.indices.prototype.putTemplate = ca({ - params: { - order: { - type: 'number' - }, - create: { - type: 'boolean', - 'default': false - }, - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - } - }, - url: { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [indices.putWarmer](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/indices-warmers.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) in the search request to warm - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices in the search request to warm. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both, in the search request to warm. - * @param {<>} params.requestCache - Specify whether the request to be warmed should use the request cache, defaults to index level setting - * @param {<>, <>, <>} params.index - A comma-separated list of index names to register the warmer for; use `_all` or omit to perform the operation on all indices - * @param {<>} params.name - The name of the warmer - * @param {<>, <>, <>} params.type - A comma-separated list of document types to register the warmer for; leave empty to perform the operation on all types - */ -api.indices.prototype.putWarmer = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - requestCache: { - type: 'boolean', - name: 'request_cache' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_warmer/<%=name%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - }, - name: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_warmer/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'string' - } - } - }, - { - fmt: '/_warmer/<%=name%>', - req: { - name: { - type: 'string' - } - } - } - ], - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [indices.recovery](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/indices-recovery.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.detailed - Whether to display detailed information about shard recovery - * @param {<>} params.activeOnly - Display only those recoveries that are currently on-going - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.recovery = ca({ - params: { - detailed: { - type: 'boolean', - 'default': false - }, - activeOnly: { - type: 'boolean', - 'default': false, - name: 'active_only' - }, - human: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/<%=index%>/_recovery', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_recovery' - } - ] -}); - -/** - * Perform a [indices.refresh](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/indices-refresh.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.force - Force a refresh even if not required - * @param {anything} params.operationThreading - TODO: ? - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.refresh = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - force: { - type: 'boolean', - 'default': false - }, - operationThreading: { - name: 'operation_threading' - } - }, - urls: [ - { - fmt: '/<%=index%>/_refresh', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_refresh' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.segments](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/indices-segments.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.verbose - Includes detailed memory usage by Lucene. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.segments = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - human: { - type: 'boolean', - 'default': false - }, - operationThreading: { - name: 'operation_threading' - }, - verbose: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/<%=index%>/_segments', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_segments' - } - ] -}); - -/** - * Perform a [indices.shardStores](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/indices-shards-stores.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.status - A comma-separated list of statuses used to filter on shards to get store information for - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {anything} params.operationThreading - TODO: ? - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.shardStores = ca({ - params: { - status: { - type: 'list', - options: [ - 'green', - 'yellow', - 'red', - 'all' - ] - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - operationThreading: { - name: 'operation_threading' - } - }, - urls: [ - { - fmt: '/<%=index%>/_shard_stores', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_shard_stores' - } - ] -}); - -/** - * Perform a [indices.stats](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/indices-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.completionFields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields for `fielddata` index metric (supports wildcards) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) - * @param {<>, <>, <>} params.groups - A comma-separated list of search groups for `search` index metric - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>} [params.level=indices] - Return stats aggregated at cluster, index or shard level - * @param {<>, <>, <>} params.types - A comma-separated list of document types for the `indexing` index metric - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.metric - Limit the information returned the specific metrics. - */ -api.indices.prototype.stats = ca({ - params: { - completionFields: { - type: 'list', - name: 'completion_fields' - }, - fielddataFields: { - type: 'list', - name: 'fielddata_fields' - }, - fields: { - type: 'list' - }, - groups: { - type: 'list' - }, - human: { - type: 'boolean', - 'default': false - }, - level: { - type: 'enum', - 'default': 'indices', - options: [ - 'cluster', - 'indices', - 'shards' - ] - }, - types: { - type: 'list' - } - }, - urls: [ - { - fmt: '/<%=index%>/_stats/<%=metric%>', - req: { - index: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'percolate', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/_stats/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'percolate', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/<%=index%>/_stats', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_stats' - } - ] -}); - -/** - * Perform a [indices.updateAliases](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Request timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - */ -api.indices.prototype.updateAliases = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_aliases' - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [indices.upgrade](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/indices-upgrade.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.waitForCompletion - Specify whether the request should block until the all segments are upgraded (default: false) - * @param {<>} params.onlyAncientSegments - If true, only ancient (an older Lucene major release) segments will be upgraded - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.upgrade = ca({ - params: { - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - waitForCompletion: { - type: 'boolean', - name: 'wait_for_completion' - }, - onlyAncientSegments: { - type: 'boolean', - name: 'only_ancient_segments' - } - }, - urls: [ - { - fmt: '/<%=index%>/_upgrade', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_upgrade' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.validateQuery](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/search-validate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.explain - Return detailed information about the error - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.lowercaseExpandedTerms - Specify whether query terms should be lowercased - * @param {<>} params.rewrite - Provide a more detailed explanation showing the actual Lucene query that will be executed. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to restrict the operation; leave empty to perform the operation on all types - */ -api.indices.prototype.validateQuery = ca({ - params: { - explain: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - operationThreading: { - name: 'operation_threading' - }, - q: { - type: 'string' - }, - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - lenient: { - type: 'boolean' - }, - lowercaseExpandedTerms: { - type: 'boolean', - name: 'lowercase_expanded_terms' - }, - rewrite: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_validate/query', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_validate/query', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_validate/query' - } - ], - method: 'POST' -}); - -/** - * Perform a [info](https://www.elastic.co/guide/) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.info = ca({ - url: { - fmt: '/' - } -}); - -/** - * Perform a [mget](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/docs-multi-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return in the response - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.mget = ca({ - params: { - fields: { - type: 'list' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_mget', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_mget', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_mget' - } - ], - needBody: true, - method: 'POST' -}); - -/** - * Perform a [mpercolate](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/search-percolate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.index - The index of the document being count percolated to use as default - * @param {<>} params.type - The type of the document being percolated to use as default. - */ -api.mpercolate = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_mpercolate', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_mpercolate', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_mpercolate' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -/** - * Perform a [msearch](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/search-multi-search.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.searchType - Search operation type - * @param {<>, <>, <>} params.index - A comma-separated list of index names to use as default - * @param {<>, <>, <>} params.type - A comma-separated list of document types to use as default - */ -api.msearch = ca({ - params: { - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'query_and_fetch', - 'dfs_query_then_fetch', - 'dfs_query_and_fetch', - 'count', - 'scan' - ], - name: 'search_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_msearch', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_msearch', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_msearch' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -/** - * Perform a [mtermvectors](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/docs-multi-termvectors.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.ids - A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body - * @param {<>} params.termStatistics - Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.fieldStatistics=true] - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.offsets=true] - Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.positions=true] - Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.payloads=true] - Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) .Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.routing - Specific routing value. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.parent - Parent id of documents. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.realtime - Specifies if requests are real-time as opposed to near-real-time (default: true). - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index in which the document resides. - * @param {<>} params.type - The type of the document. - */ -api.mtermvectors = ca({ - params: { - ids: { - type: 'list', - required: false - }, - termStatistics: { - type: 'boolean', - 'default': false, - required: false, - name: 'term_statistics' - }, - fieldStatistics: { - type: 'boolean', - 'default': true, - required: false, - name: 'field_statistics' - }, - fields: { - type: 'list', - required: false - }, - offsets: { - type: 'boolean', - 'default': true, - required: false - }, - positions: { - type: 'boolean', - 'default': true, - required: false - }, - payloads: { - type: 'boolean', - 'default': true, - required: false - }, - preference: { - type: 'string', - required: false - }, - routing: { - type: 'string', - required: false - }, - parent: { - type: 'string', - required: false - }, - realtime: { - type: 'boolean', - required: false - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_mtermvectors', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_mtermvectors', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_mtermvectors' - } - ], - method: 'POST' -}); - -api.nodes = namespace(); - -/** - * Perform a [nodes.hotThreads](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/cluster-nodes-hot-threads.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.interval - The interval for the second sampling of threads - * @param {<>} params.snapshots - Number of samples of thread stacktrace (default: 10) - * @param {<>} params.threads - Specify the number of threads to provide information for (default: 3) - * @param {<>} params.ignoreIdleThreads - Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue (default: true) - * @param {<>} params.type - The type to sample (default: cpu) - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - */ -api.nodes.prototype.hotThreads = ca({ - params: { - interval: { - type: 'time' - }, - snapshots: { - type: 'number' - }, - threads: { - type: 'number' - }, - ignoreIdleThreads: { - type: 'boolean', - name: 'ignore_idle_threads' - }, - type: { - type: 'enum', - options: [ - 'cpu', - 'wait', - 'block' - ] - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_nodes/<%=nodeId%>/hotthreads', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_nodes/hotthreads' - } - ] -}); - -/** - * Perform a [nodes.info](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/cluster-nodes-info.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.metric - A comma-separated list of metrics you wish returned. Leave empty to return all. - */ -api.nodes.prototype.info = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - human: { - type: 'boolean', - 'default': false - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_nodes/<%=nodeId%>/<%=metric%>', - req: { - nodeId: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - 'settings', - 'os', - 'process', - 'jvm', - 'thread_pool', - 'transport', - 'http', - 'plugins' - ] - } - } - }, - { - fmt: '/_nodes/<%=nodeId%>', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_nodes/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - 'settings', - 'os', - 'process', - 'jvm', - 'thread_pool', - 'transport', - 'http', - 'plugins' - ] - } - } - }, - { - fmt: '/_nodes' - } - ] -}); - -/** - * Perform a [nodes.stats](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/cluster-nodes-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.completionFields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields for `fielddata` index metric (supports wildcards) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) - * @param {<>} params.groups - A comma-separated list of search groups for `search` index metric - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>} [params.level=node] - Return indices stats aggregated at node, index or shard level - * @param {<>, <>, <>} params.types - A comma-separated list of document types for the `indexing` index metric - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics - * @param {<>, <>, <>} params.indexMetric - Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified. - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - */ -api.nodes.prototype.stats = ca({ - params: { - completionFields: { - type: 'list', - name: 'completion_fields' - }, - fielddataFields: { - type: 'list', - name: 'fielddata_fields' - }, - fields: { - type: 'list' - }, - groups: { - type: 'boolean' - }, - human: { - type: 'boolean', - 'default': false - }, - level: { - type: 'enum', - 'default': 'node', - options: [ - 'node', - 'indices', - 'shards' - ] - }, - types: { - type: 'list' - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_nodes/<%=nodeId%>/stats/<%=metric%>/<%=indexMetric%>', - req: { - nodeId: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport' - ] - }, - indexMetric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'percolate', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/_nodes/<%=nodeId%>/stats/<%=metric%>', - req: { - nodeId: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport' - ] - } - } - }, - { - fmt: '/_nodes/stats/<%=metric%>/<%=indexMetric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport' - ] - }, - indexMetric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'percolate', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/_nodes/<%=nodeId%>/stats', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_nodes/stats/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport' - ] - } - } - }, - { - fmt: '/_nodes/stats' - } - ] -}); - -/** - * Perform a [percolate](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/search-percolate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.percolateIndex - The index to percolate the document into. Defaults to index. - * @param {<>} params.percolateType - The type to percolate document into. Defaults to type. - * @param {<>} params.percolateRouting - The routing value to use when percolating the existing document. - * @param {<>} params.percolatePreference - Which shard to prefer when executing the percolate request. - * @param {<>} params.percolateFormat - Return an array of matching query IDs instead of objects - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index of the document being percolated. - * @param {<>} params.type - The type of the document being percolated. - * @param {<>} params.id - Substitute the document in the request body with a document that is known by the specified id. On top of the id, the index and type parameter will be used to retrieve the document from within the cluster. - */ -api.percolate = ca({ - params: { - routing: { - type: 'list' - }, - preference: { - type: 'string' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - percolateIndex: { - type: 'string', - name: 'percolate_index' - }, - percolateType: { - type: 'string', - name: 'percolate_type' - }, - percolateRouting: { - type: 'string', - name: 'percolate_routing' - }, - percolatePreference: { - type: 'string', - name: 'percolate_preference' - }, - percolateFormat: { - type: 'enum', - options: [ - 'ids' - ], - name: 'percolate_format' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_percolate', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/<%=type%>/_percolate', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - } - ], - method: 'POST' -}); - -/** - * Perform a [ping](https://www.elastic.co/guide/) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.ping = ca({ - url: { - fmt: '/' - }, - requestTimeout: 3000, - method: 'HEAD' -}); - -/** - * Perform a [putScript](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} [params.opType=index] - Explicit operation type - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - Script ID - * @param {<>} params.lang - Script language - */ -api.putScript = ca({ - params: { - opType: { - type: 'enum', - 'default': 'index', - options: [ - 'index', - 'create' - ], - name: 'op_type' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/_scripts/<%=lang%>/<%=id%>', - req: { - lang: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [putTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} [params.opType=index] - Explicit operation type - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - Template ID - */ -api.putTemplate = ca({ - params: { - opType: { - type: 'enum', - 'default': 'index', - options: [ - 'index', - 'create' - ], - name: 'op_type' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/_search/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [reindex](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/docs-reindex.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} params.consistency - Explicit write consistency setting for the operation - * @param {<>} params.waitForCompletion - Should the request should block until the reindex is complete. - * @param {<>} params.requestsPerSecond - The throttle for this request in sub-requests per second. 0 means set no throttle. - */ -api.reindex = ca({ - params: { - refresh: { - type: 'boolean' - }, - timeout: { - type: 'time', - 'default': '1m' - }, - consistency: { - type: 'enum', - options: [ - 'one', - 'quorum', - 'all' - ] - }, - waitForCompletion: { - type: 'boolean', - 'default': false, - name: 'wait_for_completion' - }, - requestsPerSecond: { - type: 'number', - 'default': 0, - name: 'requests_per_second' - } - }, - url: { - fmt: '/_reindex' - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [reindexRethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/docs-reindex.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.requestsPerSecond - The throttle to set on this request in sub-requests per second. "unlimited" means set no throttle, otherwise it must be a float greater than 0. - * @param {<>} params.taskId - The task id to rethrottle - */ -api.reindexRethrottle = ca({ - params: { - requestsPerSecond: { - type: 'number', - required: true, - name: 'requests_per_second' - } - }, - url: { - fmt: '/_reindex/<%=taskId%>/_rethrottle', - req: { - taskId: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [renderSearchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - The id of the stored search template - */ -api.renderSearchTemplate = ca({ - urls: [ - { - fmt: '/_render/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - { - fmt: '/_render/template' - } - ], - method: 'POST' -}); - -/** - * Perform a [scroll](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/search-request-scroll.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.scrollId - The scroll ID - */ -api.scroll = ca({ - params: { - scroll: { - type: 'time' - }, - scrollId: { - type: 'string', - name: 'scroll_id' - } - }, - urls: [ - { - fmt: '/_search/scroll/<%=scrollId%>', - req: { - scrollId: { - type: 'string' - } - } - }, - { - fmt: '/_search/scroll' - } - ], - paramAsBody: { - param: 'scrollId', - body: 'scroll_id' - }, - method: 'POST' -}); - -/** - * Perform a [search](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/search-search.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.explain - Specify whether to return detailed information about score computation as part of a hit - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return as part of a hit - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields to return as the field data representation of a field for each hit - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.lowercaseExpandedTerms - Specify whether query terms should be lowercased - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.suggestField - Specify which field to use for suggestions - * @param {<>} [params.suggestMode=missing] - Specify suggest mode - * @param {<>} params.suggestSize - How many suggestions to return in response - * @param {<>} params.suggestText - The source text for which the suggestions should be returned - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.trackScores - Whether to calculate and return scores even if they are not used for sorting - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.search = ca({ - params: { - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - explain: { - type: 'boolean' - }, - fields: { - type: 'list' - }, - fielddataFields: { - type: 'list', - name: 'fielddata_fields' - }, - from: { - type: 'number' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - lenient: { - type: 'boolean' - }, - lowercaseExpandedTerms: { - type: 'boolean', - name: 'lowercase_expanded_terms' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'dfs_query_then_fetch', - 'count', - 'scan' - ], - name: 'search_type' - }, - size: { - type: 'number' - }, - sort: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - terminateAfter: { - type: 'number', - name: 'terminate_after' - }, - stats: { - type: 'list' - }, - suggestField: { - type: 'string', - name: 'suggest_field' - }, - suggestMode: { - type: 'enum', - 'default': 'missing', - options: [ - 'missing', - 'popular', - 'always' - ], - name: 'suggest_mode' - }, - suggestSize: { - type: 'number', - name: 'suggest_size' - }, - suggestText: { - type: 'string', - name: 'suggest_text' - }, - timeout: { - type: 'time' - }, - trackScores: { - type: 'boolean', - name: 'track_scores' - }, - version: { - type: 'boolean' - }, - requestCache: { - type: 'boolean', - name: 'request_cache' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_search', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_search', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_search' - } - ], - method: 'POST' -}); - -/** - * Perform a [searchExists](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/search-exists.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.minScore - Include only documents with a specific `_score` value in the result - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.lowercaseExpandedTerms - Specify whether query terms should be lowercased - * @param {<>, <>, <>} params.index - A comma-separated list of indices to restrict the results - * @param {<>, <>, <>} params.type - A comma-separated list of types to restrict the results - */ -api.searchExists = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - minScore: { - type: 'number', - name: 'min_score' - }, - preference: { - type: 'string' - }, - routing: { - type: 'string' - }, - q: { - type: 'string' - }, - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - lenient: { - type: 'boolean' - }, - lowercaseExpandedTerms: { - type: 'boolean', - name: 'lowercase_expanded_terms' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_search/exists', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_search/exists', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_search/exists' - } - ], - method: 'POST' -}); - -/** - * Perform a [searchShards](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/search-shards.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.searchShards = ca({ - params: { - preference: { - type: 'string' - }, - routing: { - type: 'string' - }, - local: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_search_shards', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_search_shards', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_search_shards' - } - ], - method: 'POST' -}); - -/** - * Perform a [searchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.searchTemplate = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - preference: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'query_and_fetch', - 'dfs_query_then_fetch', - 'dfs_query_and_fetch', - 'count', - 'scan' - ], - name: 'search_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_search/template', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_search/template', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_search/template' - } - ], - method: 'POST' -}); - -api.snapshot = namespace(); - -/** - * Perform a [snapshot.create](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.waitForCompletion - Should this request wait until the operation has completed before returning - * @param {<>} params.repository - A repository name - * @param {<>} params.snapshot - A snapshot name - */ -api.snapshot.prototype.create = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForCompletion: { - type: 'boolean', - 'default': false, - name: 'wait_for_completion' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [snapshot.createRepository](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.verify - Whether to verify the repository after creation - * @param {<>} params.repository - A repository name - */ -api.snapshot.prototype.createRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - }, - verify: { - type: 'boolean' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>', - req: { - repository: { - type: 'string' - } - } - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [snapshot.delete](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.repository - A repository name - * @param {<>} params.snapshot - A snapshot name - */ -api.snapshot.prototype['delete'] = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [snapshot.deleteRepository](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.repository - A comma-separated list of repository names - */ -api.snapshot.prototype.deleteRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>', - req: { - repository: { - type: 'list' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [snapshot.get](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.repository - A repository name - * @param {<>, <>, <>} params.snapshot - A comma-separated list of snapshot names - */ -api.snapshot.prototype.get = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'list' - } - } - } -}); - -/** - * Perform a [snapshot.getRepository](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.repository - A comma-separated list of repository names - */ -api.snapshot.prototype.getRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/_snapshot/<%=repository%>', - req: { - repository: { - type: 'list' - } - } - }, - { - fmt: '/_snapshot' - } - ] -}); - -/** - * Perform a [snapshot.restore](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.waitForCompletion - Should this request wait until the operation has completed before returning - * @param {<>} params.repository - A repository name - * @param {<>} params.snapshot - A snapshot name - */ -api.snapshot.prototype.restore = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForCompletion: { - type: 'boolean', - 'default': false, - name: 'wait_for_completion' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>/_restore', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [snapshot.status](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.repository - A repository name - * @param {<>, <>, <>} params.snapshot - A comma-separated list of snapshot names - */ -api.snapshot.prototype.status = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - urls: [ - { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>/_status', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'list' - } - } - }, - { - fmt: '/_snapshot/<%=repository%>/_status', - req: { - repository: { - type: 'string' - } - } - }, - { - fmt: '/_snapshot/_status' - } - ] -}); - -/** - * Perform a [snapshot.verifyRepository](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.repository - A repository name - */ -api.snapshot.prototype.verifyRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/_verify', - req: { - repository: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [suggest](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/search-suggesters.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params.index - A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices - */ -api.suggest = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - preference: { - type: 'string' - }, - routing: { - type: 'string' - } - }, - urls: [ - { - fmt: '/<%=index%>/_suggest', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_suggest' - } - ], - needBody: true, - method: 'POST' -}); - -api.tasks = namespace(); - -/** - * Perform a [tasks.cancel](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/tasks.html#_task_cancellation) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.actions - A comma-separated list of actions that should be cancelled. Leave empty to cancel all. - * @param {<>} params.parentNode - Cancel tasks with specified parent node. - * @param {<>} params.parentTask - Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all. - * @param {<>} params.taskId - Cancel the task with specified id - */ -api.tasks.prototype.cancel = ca({ - params: { - nodeId: { - type: 'list', - name: 'node_id' - }, - actions: { - type: 'list' - }, - parentNode: { - type: 'string', - name: 'parent_node' - }, - parentTask: { - type: 'string', - name: 'parent_task' - } - }, - urls: [ - { - fmt: '/_tasks/<%=taskId%>/_cancel', - req: { - taskId: { - type: 'string' - } - } - }, - { - fmt: '/_tasks/_cancel' - } - ], - method: 'POST' -}); - -/** - * Perform a [tasks.list](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/tasks.html#_current_tasks_information) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.actions - A comma-separated list of actions that should be returned. Leave empty to return all. - * @param {<>} params.detailed - Return detailed task information (default: false) - * @param {<>} params.parentNode - Return tasks with specified parent node. - * @param {<>} params.parentTask - Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all. - * @param {<>} params.waitForCompletion - Wait for the matching tasks to complete (default: false) - * @param {<>} params.taskId - Return the task with specified id (node_id:task_number) - */ -api.tasks.prototype.list = ca({ - params: { - nodeId: { - type: 'list', - name: 'node_id' - }, - actions: { - type: 'list' - }, - detailed: { - type: 'boolean' - }, - parentNode: { - type: 'string', - name: 'parent_node' - }, - parentTask: { - type: 'string', - name: 'parent_task' - }, - waitForCompletion: { - type: 'boolean', - name: 'wait_for_completion' - } - }, - urls: [ - { - fmt: '/_tasks/<%=taskId%>', - req: { - taskId: { - type: 'string' - } - } - }, - { - fmt: '/_tasks' - } - ] -}); - -/** - * Perform a [termvectors](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/docs-termvectors.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.termStatistics - Specifies if total term frequency and document frequency should be returned. - * @param {<>} [params.fieldStatistics=true] - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. - * @param {<>} params.dfs - Specifies if distributed frequencies should be returned instead shard frequencies. - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return. - * @param {<>} [params.offsets=true] - Specifies if term offsets should be returned. - * @param {<>} [params.positions=true] - Specifies if term positions should be returned. - * @param {<>} [params.payloads=true] - Specifies if term payloads should be returned. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random). - * @param {<>} params.routing - Specific routing value. - * @param {<>} params.parent - Parent id of documents. - * @param {<>} params.realtime - Specifies if request is real-time as opposed to near-real-time (default: true). - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index in which the document resides. - * @param {<>} params.type - The type of the document. - * @param {<>} params.id - The id of the document, when not specified a doc param should be supplied. - */ -api.termvectors = ca({ - params: { - termStatistics: { - type: 'boolean', - 'default': false, - required: false, - name: 'term_statistics' - }, - fieldStatistics: { - type: 'boolean', - 'default': true, - required: false, - name: 'field_statistics' - }, - dfs: { - type: 'boolean', - 'default': false, - required: false - }, - fields: { - type: 'list', - required: false - }, - offsets: { - type: 'boolean', - 'default': true, - required: false - }, - positions: { - type: 'boolean', - 'default': true, - required: false - }, - payloads: { - type: 'boolean', - 'default': true, - required: false - }, - preference: { - type: 'string', - required: false - }, - routing: { - type: 'string', - required: false - }, - parent: { - type: 'string', - required: false - }, - realtime: { - type: 'boolean', - required: false - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_termvectors', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/<%=type%>/_termvectors', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - } - ], - method: 'POST' -}); - -/** - * Perform a [update](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/docs-update.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.consistency - Explicit write consistency setting for the operation - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return in the response - * @param {<>} params.lang - The script language (default: groovy) - * @param {<>} params.parent - ID of the parent document. Is is only used for routing and when for the upsert request - * @param {<>} params.refresh - Refresh the index after performing the operation - * @param {<>} params.retryOnConflict - Specify how many times should the operation be retried when a conflict occurs (default: 0) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.script - The URL-encoded script definition (instead of using request body) - * @param {<>} params.scriptId - The id of a stored script - * @param {<>} params.scriptedUpsert - True if the script referenced in script or script_id should be called to perform inserts - defaults to false - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.update = ca({ - params: { - consistency: { - type: 'enum', - options: [ - 'one', - 'quorum', - 'all' - ] - }, - fields: { - type: 'list' - }, - lang: { - type: 'string' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'boolean' - }, - retryOnConflict: { - type: 'number', - name: 'retry_on_conflict' - }, - routing: { - type: 'string' - }, - script: { - type: 'string' - }, - scriptId: { - type: 'string', - name: 'script_id' - }, - scriptedUpsert: { - type: 'boolean', - name: 'scripted_upsert' - }, - timeout: { - type: 'time' - }, - timestamp: { - type: 'time' - }, - ttl: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_update', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [updateByQuery](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/docs-update-by-query.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.explain - Specify whether to return detailed information about score computation as part of a hit - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return as part of a hit - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields to return as the field data representation of a field for each hit - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.conflicts=abort] - What to do when the reindex hits version conflicts? - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.lowercaseExpandedTerms - Specify whether query terms should be lowercased - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.searchTimeout - Explicit timeout for each search request. Defaults to no timeout. - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.suggestField - Specify which field to use for suggestions - * @param {<>} [params.suggestMode=missing] - Specify suggest mode - * @param {<>} params.suggestSize - How many suggestions to return in response - * @param {<>} params.suggestText - The source text for which the suggestions should be returned - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} params.trackScores - Whether to calculate and return scores even if they are not used for sorting - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.versionType - Should the document increment the version number (internal) on hit or not (reindex) - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} params.consistency - Explicit write consistency setting for the operation - * @param {<>} params.scrollSize - Size on the scroll request powering the update_by_query - * @param {<>} params.waitForCompletion - Should the request should block until the reindex is complete. - * @param {<>} params.requestsPerSecond - The throttle for this request in sub-requests per second. 0 means set no throttle. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.updateByQuery = ca({ - params: { - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - explain: { - type: 'boolean' - }, - fields: { - type: 'list' - }, - fielddataFields: { - type: 'list', - name: 'fielddata_fields' - }, - from: { - type: 'number' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - conflicts: { - type: 'enum', - 'default': 'abort', - options: [ - 'abort', - 'proceed' - ] - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - lenient: { - type: 'boolean' - }, - lowercaseExpandedTerms: { - type: 'boolean', - name: 'lowercase_expanded_terms' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'dfs_query_then_fetch' - ], - name: 'search_type' - }, - searchTimeout: { - type: 'time', - name: 'search_timeout' - }, - size: { - type: 'number' - }, - sort: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - terminateAfter: { - type: 'number', - name: 'terminate_after' - }, - stats: { - type: 'list' - }, - suggestField: { - type: 'string', - name: 'suggest_field' - }, - suggestMode: { - type: 'enum', - 'default': 'missing', - options: [ - 'missing', - 'popular', - 'always' - ], - name: 'suggest_mode' - }, - suggestSize: { - type: 'number', - name: 'suggest_size' - }, - suggestText: { - type: 'string', - name: 'suggest_text' - }, - timeout: { - type: 'time', - 'default': '1m' - }, - trackScores: { - type: 'boolean', - name: 'track_scores' - }, - version: { - type: 'boolean' - }, - versionType: { - type: 'boolean', - name: 'version_type' - }, - requestCache: { - type: 'boolean', - name: 'request_cache' - }, - refresh: { - type: 'boolean' - }, - consistency: { - type: 'enum', - options: [ - 'one', - 'quorum', - 'all' - ] - }, - scrollSize: { - type: 'number', - name: 'scroll_size' - }, - waitForCompletion: { - type: 'boolean', - 'default': false, - name: 'wait_for_completion' - }, - requestsPerSecond: { - type: 'number', - 'default': 0, - name: 'requests_per_second' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_update_by_query', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_update_by_query', - req: { - index: { - type: 'list' - } - } - } - ], - method: 'POST' -}); - -/** - * Perform a [create](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/docs-index_.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.consistency - Explicit write consistency setting for the operation - * @param {<>} params.parent - ID of the parent document - * @param {<>} params.refresh - Refresh the affected shards after performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.create = ca.proxy(api.index, { - transform: function (params) { - params.op_type = 'create'; - } -}); diff --git a/src/lib/apis/5_0.js b/src/lib/apis/5_0.js deleted file mode 100644 index f478b03aa..000000000 --- a/src/lib/apis/5_0.js +++ /dev/null @@ -1,7013 +0,0 @@ -var ca = require('../client_action').makeFactoryWithModifier(function (spec) { - return require('../utils').merge(spec, { - params: { - filterPath: { - type: 'list', - name: 'filter_path' - } - } - }); -}); -var namespace = require('../client_action').namespaceFactory; -var api = module.exports = {}; - -api._namespaces = ['cat', 'cluster', 'indices', 'ingest', 'nodes', 'snapshot', 'tasks']; - -/** - * Perform a [bulk](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-bulk.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the bulk operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.type - Default document type for items which don't provide one - * @param {<>, <>, <>} params.fields - Default comma-separated list of fields to return in the response for updates, can be overridden on each sub-request - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request - * @param {<>, <>, <>} params._sourceExclude - Default list of fields to exclude from the returned _source field, can be overridden on each sub-request - * @param {<>, <>, <>} params._sourceInclude - Default list of fields to extract and return from the _source field, can be overridden on each sub-request - * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with - * @param {<>} params.index - Default index for items which don't provide one - */ -api.bulk = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - type: { - type: 'string' - }, - fields: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - pipeline: { - type: 'string' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_bulk', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_bulk', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_bulk' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -api.cat = namespace(); - -/** - * Perform a [cat.aliases](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.name - A comma-separated list of alias names to return - */ -api.cat.prototype.aliases = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/aliases/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/_cat/aliases' - } - ] -}); - -/** - * Perform a [cat.allocation](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-allocation.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information - */ -api.cat.prototype.allocation = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'kb', - 'm', - 'mb', - 'g', - 'gb', - 't', - 'tb', - 'p', - 'pb' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/allocation/<%=nodeId%>', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_cat/allocation' - } - ] -}); - -/** - * Perform a [cat.count](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-count.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.count = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/count/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/count' - } - ] -}); - -/** - * Perform a [cat.fielddata](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-fielddata.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return the fielddata size - */ -api.cat.prototype.fielddata = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'kb', - 'm', - 'mb', - 'g', - 'gb', - 't', - 'tb', - 'p', - 'pb' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - v: { - type: 'boolean', - 'default': false - }, - fields: { - type: 'list' - } - }, - urls: [ - { - fmt: '/_cat/fielddata/<%=fields%>', - req: { - fields: { - type: 'list' - } - } - }, - { - fmt: '/_cat/fielddata' - } - ] -}); - -/** - * Perform a [cat.health](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-health.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} [params.ts=true] - Set to false to disable timestamping - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.health = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - ts: { - type: 'boolean', - 'default': true - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/health' - } -}); - -/** - * Perform a [cat.help](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.help - Return help information - */ -api.cat.prototype.help = ca({ - params: { - help: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat' - } -}); - -/** - * Perform a [cat.indices](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-indices.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.health - A health status ("green", "yellow", or "red" to filter only indices matching the specified health status - * @param {<>} params.help - Return help information - * @param {<>} params.pri - Set to true to return stats only for primary shards - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.indices = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'm', - 'g' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - health: { - type: 'enum', - 'default': null, - options: [ - 'green', - 'yellow', - 'red' - ] - }, - help: { - type: 'boolean', - 'default': false - }, - pri: { - type: 'boolean', - 'default': false - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/indices/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/indices' - } - ] -}); - -/** - * Perform a [cat.master](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-master.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.master = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/master' - } -}); - -/** - * Perform a [cat.nodeattrs](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-nodeattrs.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.nodeattrs = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/nodeattrs' - } -}); - -/** - * Perform a [cat.nodes](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-nodes.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.fullId - Return the full node ID instead of the shortened version (default: false) - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.nodes = ca({ - params: { - format: { - type: 'string' - }, - fullId: { - type: 'boolean', - name: 'full_id' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/nodes' - } -}); - -/** - * Perform a [cat.pendingTasks](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-pending-tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.pendingTasks = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/pending_tasks' - } -}); - -/** - * Perform a [cat.plugins](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-plugins.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.plugins = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/plugins' - } -}); - -/** - * Perform a [cat.recovery](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-recovery.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.recovery = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'kb', - 'm', - 'mb', - 'g', - 'gb', - 't', - 'tb', - 'p', - 'pb' - ] - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/recovery/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/recovery' - } - ] -}); - -/** - * Perform a [cat.repositories](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-repositories.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.repositories = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean', - 'default': false - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/repositories' - } -}); - -/** - * Perform a [cat.segments](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-segments.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.segments = ca({ - params: { - format: { - type: 'string' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/segments/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/segments' - } - ] -}); - -/** - * Perform a [cat.shards](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-shards.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.shards = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/shards/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/shards' - } - ] -}); - -/** - * Perform a [cat.snapshots](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.ignoreUnavailable - Set to true to ignore unavailable snapshots - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.repository - Name of repository from which to fetch the snapshot information - */ -api.cat.prototype.snapshots = ca({ - params: { - format: { - type: 'string' - }, - ignoreUnavailable: { - type: 'boolean', - 'default': false, - name: 'ignore_unavailable' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/snapshots/<%=repository%>', - req: { - repository: { - type: 'list' - } - } - }, - { - fmt: '/_cat/snapshots' - } - ] -}); - -/** - * Perform a [cat.tasks](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.actions - A comma-separated list of actions that should be returned. Leave empty to return all. - * @param {<>} params.detailed - Return detailed task information (default: false) - * @param {<>} params.parentNode - Return tasks with specified parent node. - * @param {<>} params.parentTask - Return tasks with specified parent task id. Set to -1 to return all. - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.tasks = ca({ - params: { - format: { - type: 'string' - }, - nodeId: { - type: 'list', - name: 'node_id' - }, - actions: { - type: 'list' - }, - detailed: { - type: 'boolean' - }, - parentNode: { - type: 'string', - name: 'parent_node' - }, - parentTask: { - type: 'number', - name: 'parent_task' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/tasks' - } -}); - -/** - * Perform a [cat.threadPool](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cat-thread-pool.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.size - The multiplier in which to display values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.threadPoolPatterns - A comma-separated list of regular-expressions to filter the thread pools in the output - */ -api.cat.prototype.threadPool = ca({ - params: { - format: { - type: 'string' - }, - size: { - type: 'enum', - options: [ - '', - 'k', - 'm', - 'g', - 't', - 'p' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/thread_pool/<%=threadPoolPatterns%>', - req: { - threadPoolPatterns: { - type: 'list' - } - } - }, - { - fmt: '/_cat/thread_pool' - } - ] -}); - -/** - * Perform a [clearScroll](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-request-scroll.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.scrollId - A comma-separated list of scroll IDs to clear - */ -api.clearScroll = ca({ - urls: [ - { - fmt: '/_search/scroll/<%=scrollId%>', - req: { - scrollId: { - type: 'list' - } - } - }, - { - fmt: '/_search/scroll' - } - ], - paramAsBody: { - param: 'scrollId', - body: 'scroll_id' - }, - method: 'DELETE' -}); - -api.cluster = namespace(); - -/** - * Perform a [cluster.allocationExplain](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cluster-allocation-explain.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.includeYesDecisions - Return 'YES' decisions in explanation (default: false) - * @param {<>} params.includeDiskInfo - Return information about disk usage and shard sizes (default: false) - */ -api.cluster.prototype.allocationExplain = ca({ - params: { - includeYesDecisions: { - type: 'boolean', - name: 'include_yes_decisions' - }, - includeDiskInfo: { - type: 'boolean', - name: 'include_disk_info' - } - }, - url: { - fmt: '/_cluster/allocation/explain' - }, - method: 'POST' -}); - -/** - * Perform a [cluster.getSettings](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cluster-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.includeDefaults - Whether to return all default clusters setting. - */ -api.cluster.prototype.getSettings = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - }, - includeDefaults: { - type: 'boolean', - 'default': false, - name: 'include_defaults' - } - }, - url: { - fmt: '/_cluster/settings' - } -}); - -/** - * Perform a [cluster.health](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cluster-health.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} [params.level=cluster] - Specify the level of detail for returned information - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.waitForActiveShards - Wait until the specified number of shards is active - * @param {<>} params.waitForNodes - Wait until the specified number of nodes is available - * @param {<>} params.waitForEvents - Wait until all currently queued events with the given priority are processed - * @param {<>} params.waitForNoRelocatingShards - Whether to wait until there are no relocating shards in the cluster - * @param {<>} params.waitForStatus - Wait until cluster is in a specific state - * @param {<>, <>, <>} params.index - Limit the information returned to a specific index - */ -api.cluster.prototype.health = ca({ - params: { - level: { - type: 'enum', - 'default': 'cluster', - options: [ - 'cluster', - 'indices', - 'shards' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - waitForNodes: { - type: 'string', - name: 'wait_for_nodes' - }, - waitForEvents: { - type: 'enum', - options: [ - 'immediate', - 'urgent', - 'high', - 'normal', - 'low', - 'languid' - ], - name: 'wait_for_events' - }, - waitForNoRelocatingShards: { - type: 'boolean', - name: 'wait_for_no_relocating_shards' - }, - waitForStatus: { - type: 'enum', - 'default': null, - options: [ - 'green', - 'yellow', - 'red' - ], - name: 'wait_for_status' - } - }, - urls: [ - { - fmt: '/_cluster/health/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cluster/health' - } - ] -}); - -/** - * Perform a [cluster.pendingTasks](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cluster-pending.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Specify timeout for connection to master - */ -api.cluster.prototype.pendingTasks = ca({ - params: { - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_cluster/pending_tasks' - } -}); - -/** - * Perform a [cluster.putSettings](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cluster-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - */ -api.cluster.prototype.putSettings = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_cluster/settings' - }, - method: 'PUT' -}); - -/** - * Perform a [cluster.reroute](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cluster-reroute.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.dryRun - Simulate the operation only and return the resulting state - * @param {<>} params.explain - Return an explanation of why the commands can or cannot be executed - * @param {<>} params.retryFailed - Retries allocation of shards that are blocked due to too many subsequent allocation failures - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics. Defaults to all but metadata - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - */ -api.cluster.prototype.reroute = ca({ - params: { - dryRun: { - type: 'boolean', - name: 'dry_run' - }, - explain: { - type: 'boolean' - }, - retryFailed: { - type: 'boolean', - name: 'retry_failed' - }, - metric: { - type: 'list', - options: [ - '_all', - 'blocks', - 'metadata', - 'nodes', - 'routing_table', - 'master_node', - 'version' - ] - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_cluster/reroute' - }, - method: 'POST' -}); - -/** - * Perform a [cluster.state](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cluster-state.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics - */ -api.cluster.prototype.state = ca({ - params: { - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/_cluster/state/<%=metric%>/<%=index%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'blocks', - 'metadata', - 'nodes', - 'routing_table', - 'routing_nodes', - 'master_node', - 'version' - ] - }, - index: { - type: 'list' - } - } - }, - { - fmt: '/_cluster/state/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'blocks', - 'metadata', - 'nodes', - 'routing_table', - 'routing_nodes', - 'master_node', - 'version' - ] - } - } - }, - { - fmt: '/_cluster/state' - } - ] -}); - -/** - * Perform a [cluster.stats](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cluster-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - */ -api.cluster.prototype.stats = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - human: { - type: 'boolean', - 'default': false - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_cluster/stats/nodes/<%=nodeId%>', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_cluster/stats' - } - ] -}); - -/** - * Perform a [count](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-count.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.minScore - Include only documents with a specific `_score` value in the result - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.lowercaseExpandedTerms - Specify whether query terms should be lowercased - * @param {<>, <>, <>} params.index - A comma-separated list of indices to restrict the results - * @param {<>, <>, <>} params.type - A comma-separated list of types to restrict the results - */ -api.count = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - minScore: { - type: 'number', - name: 'min_score' - }, - preference: { - type: 'string' - }, - routing: { - type: 'string' - }, - q: { - type: 'string' - }, - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - lenient: { - type: 'boolean' - }, - lowercaseExpandedTerms: { - type: 'boolean', - name: 'lowercase_expanded_terms' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_count', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_count', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_count' - } - ], - method: 'POST' -}); - -/** - * Perform a [countPercolate](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-percolate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.percolateIndex - The index to count percolate the document into. Defaults to index. - * @param {<>} params.percolateType - The type to count percolate document into. Defaults to type. - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index of the document being count percolated. - * @param {<>} params.type - The type of the document being count percolated. - * @param {<>} params.id - Substitute the document in the request body with a document that is known by the specified id. On top of the id, the index and type parameter will be used to retrieve the document from within the cluster. - */ -api.countPercolate = ca({ - params: { - routing: { - type: 'list' - }, - preference: { - type: 'string' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - percolateIndex: { - type: 'string', - name: 'percolate_index' - }, - percolateType: { - type: 'string', - name: 'percolate_type' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_percolate/count', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/<%=type%>/_percolate/count', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - } - ], - method: 'POST' -}); - -/** - * Perform a [create](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-index_.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.parent - ID of the parent document - * @param {<>} params.refresh - If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.create = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - timestamp: { - type: 'time' - }, - ttl: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - }, - pipeline: { - type: 'string' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_create', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [delete](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-delete.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the delete operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.parent - ID of parent document - * @param {<>} params.refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api['delete'] = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [deleteByQuery](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-delete-by-query.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.conflicts=abort] - What to do when the delete-by-query hits version conflicts? - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.lowercaseExpandedTerms - Specify whether query terms should be lowercased - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.searchTimeout - Explicit timeout for each search request. Defaults to no timeout. - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the delete by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.scrollSize - Size on the scroll request powering the update_by_query - * @param {<>} params.waitForCompletion - Should the request should block until the delete-by-query is complete. - * @param {<>} params.requestsPerSecond - The throttle to set on this request in sub-requests per second. -1 means set no throttle as does "unlimited" which is the only non-float this accepts. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.deleteByQuery = ca({ - params: { - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - from: { - type: 'number' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - conflicts: { - type: 'enum', - 'default': 'abort', - options: [ - 'abort', - 'proceed' - ] - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - lenient: { - type: 'boolean' - }, - lowercaseExpandedTerms: { - type: 'boolean', - name: 'lowercase_expanded_terms' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'dfs_query_then_fetch' - ], - name: 'search_type' - }, - searchTimeout: { - type: 'time', - name: 'search_timeout' - }, - size: { - type: 'number' - }, - sort: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - terminateAfter: { - type: 'number', - name: 'terminate_after' - }, - stats: { - type: 'list' - }, - version: { - type: 'boolean' - }, - requestCache: { - type: 'boolean', - name: 'request_cache' - }, - refresh: { - type: 'boolean' - }, - timeout: { - type: 'time', - 'default': '1m' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - scrollSize: { - type: 'number', - name: 'scroll_size' - }, - waitForCompletion: { - type: 'boolean', - 'default': false, - name: 'wait_for_completion' - }, - requestsPerSecond: { - type: 'number', - 'default': 0, - name: 'requests_per_second' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_delete_by_query', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_delete_by_query', - req: { - index: { - type: 'list' - } - } - } - ], - needBody: true, - method: 'POST' -}); - -/** - * Perform a [deleteScript](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Script ID - * @param {<>} params.lang - Script language - */ -api.deleteScript = ca({ - url: { - fmt: '/_scripts/<%=lang%>/<%=id%>', - req: { - lang: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [deleteTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Template ID - */ -api.deleteTemplate = ca({ - url: { - fmt: '/_search/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [exists](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document (use `_all` to fetch the first document matching the ID across all types) - */ -api.exists = ca({ - params: { - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [explain](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-explain.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzeWildcard - Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false) - * @param {<>} params.analyzer - The analyzer for the query string query - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The default field for query string query (default: _all) - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.lowercaseExpandedTerms - Specify whether query terms should be lowercased - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.explain = ca({ - params: { - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - analyzer: { - type: 'string' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - storedFields: { - type: 'list', - name: 'stored_fields' - }, - lenient: { - type: 'boolean' - }, - lowercaseExpandedTerms: { - type: 'boolean', - name: 'lowercase_expanded_terms' - }, - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_explain', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [fieldStats](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-field-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for to get field statistics for (min value, max value, and more) - * @param {<>} [params.level=cluster] - Defines if field stats should be returned on a per index level or on a cluster wide level - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.fieldStats = ca({ - params: { - fields: { - type: 'list' - }, - level: { - type: 'enum', - 'default': 'cluster', - options: [ - 'indices', - 'cluster' - ] - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_field_stats', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_field_stats' - } - ], - method: 'POST' -}); - -/** - * Perform a [get](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document (use `_all` to fetch the first document matching the ID across all types) - */ -api.get = ca({ - params: { - storedFields: { - type: 'list', - name: 'stored_fields' - }, - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [getScript](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Script ID - * @param {<>} params.lang - Script language - */ -api.getScript = ca({ - url: { - fmt: '/_scripts/<%=lang%>/<%=id%>', - req: { - lang: { - type: 'string' - }, - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [getSource](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document; use `_all` to fetch the first document matching the ID across all types - */ -api.getSource = ca({ - params: { - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_source', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [getTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Template ID - */ -api.getTemplate = ca({ - url: { - fmt: '/_search/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [index](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-index_.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} [params.opType=index] - Explicit operation type - * @param {<>} params.parent - ID of the parent document - * @param {<>} params.refresh - If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.index = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - opType: { - type: 'enum', - 'default': 'index', - options: [ - 'index', - 'create' - ], - name: 'op_type' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - timestamp: { - type: 'time' - }, - ttl: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - }, - pipeline: { - type: 'string' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/<%=type%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - } - ], - needBody: true, - method: 'POST' -}); - -api.indices = namespace(); - -/** - * Perform a [indices.analyze](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-analyze.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The name of the analyzer to use - * @param {<>, <>, <>} params.charFilter - A comma-separated list of character filters to use for the analysis - * @param {<>} params.field - Use the analyzer configured for this field (instead of passing the analyzer name) - * @param {<>, <>, <>} params.filter - A comma-separated list of filters to use for the analysis - * @param {<>} params.index - The name of the index to scope the operation - * @param {<>} params.preferLocal - With `true`, specify that a local shard should be used if available, with `false`, use a random shard (default: true) - * @param {<>, <>, <>} params.text - The text on which the analysis should be performed (when request body is not used) - * @param {<>} params.tokenizer - The name of the tokenizer to use for the analysis - * @param {<>} params.explain - With `true`, outputs more advanced details. (default: false) - * @param {<>, <>, <>} params.attributes - A comma-separated list of token attributes to output, this parameter works only with `explain=true` - * @param {<>} [params.format=detailed] - Format of the output - */ -api.indices.prototype.analyze = ca({ - params: { - analyzer: { - type: 'string' - }, - charFilter: { - type: 'list', - name: 'char_filter' - }, - field: { - type: 'string' - }, - filter: { - type: 'list' - }, - index: { - type: 'string' - }, - preferLocal: { - type: 'boolean', - name: 'prefer_local' - }, - text: { - type: 'list' - }, - tokenizer: { - type: 'string' - }, - explain: { - type: 'boolean' - }, - attributes: { - type: 'list' - }, - format: { - type: 'enum', - 'default': 'detailed', - options: [ - 'detailed', - 'text' - ] - } - }, - urls: [ - { - fmt: '/<%=index%>/_analyze', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_analyze' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.clearCache](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-clearcache.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.fieldData - Clear field data - * @param {<>} params.fielddata - Clear field data - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to clear when using the `field_data` parameter (default: all) - * @param {<>} params.query - Clear query caches - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index name to limit the operation - * @param {<>} params.recycler - Clear the recycler cache - * @param {<>} params.request - Clear request cache - */ -api.indices.prototype.clearCache = ca({ - params: { - fieldData: { - type: 'boolean', - name: 'field_data' - }, - fielddata: { - type: 'boolean' - }, - fields: { - type: 'list' - }, - query: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - index: { - type: 'list' - }, - recycler: { - type: 'boolean' - }, - request: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_cache/clear', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cache/clear' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.close](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-open-close.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma separated list of indices to close - */ -api.indices.prototype.close = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - url: { - fmt: '/<%=index%>/_close', - req: { - index: { - type: 'list' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [indices.create](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-create-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for before the operation returns. - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.updateAllTypes - Whether to update the mapping for all fields with the same name across all types or not - * @param {<>} params.index - The name of the index - */ -api.indices.prototype.create = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - updateAllTypes: { - type: 'boolean', - name: 'update_all_types' - } - }, - url: { - fmt: '/<%=index%>', - req: { - index: { - type: 'string' - } - } - }, - method: 'PUT' -}); - -/** - * Perform a [indices.delete](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-delete-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices - */ -api.indices.prototype['delete'] = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [indices.deleteAlias](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit timestamp for the document - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of index names (supports wildcards); use `_all` for all indices - * @param {<>, <>, <>} params.name - A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices. - */ -api.indices.prototype.deleteAlias = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [indices.deleteTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.name - The name of the template - */ -api.indices.prototype.deleteTemplate = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [indices.exists](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-exists.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of indices to check - */ -api.indices.prototype.exists = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - url: { - fmt: '/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [indices.existsAlias](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open,closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names to filter aliases - * @param {<>, <>, <>} params.name - A comma-separated list of alias names to return - */ -api.indices.prototype.existsAlias = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': [ - 'open', - 'closed' - ], - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/_alias/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_alias', - req: { - index: { - type: 'list' - } - } - } - ], - method: 'HEAD' -}); - -/** - * Perform a [indices.existsTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.name - The name of the template - */ -api.indices.prototype.existsTemplate = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - local: { - type: 'boolean' - } - }, - url: { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [indices.existsType](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-types-exists.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` to check the types across all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to check - */ -api.indices.prototype.existsType = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - url: { - fmt: '/<%=index%>/_mapping/<%=type%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [indices.flush](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-flush.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.force - Whether a flush should be forced even if it is not necessarily needed ie. if no changes will be committed to the index. This is useful if transaction log IDs should be incremented even if no uncommitted changes are present. (This setting can be considered as internal) - * @param {<>} params.waitIfOngoing - If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. The default is true. If set to false the flush will be skipped iff if another flush operation is already running. - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string for all indices - */ -api.indices.prototype.flush = ca({ - params: { - force: { - type: 'boolean' - }, - waitIfOngoing: { - type: 'boolean', - name: 'wait_if_ongoing' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_flush', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_flush' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.flushSynced](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-synced-flush.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string for all indices - */ -api.indices.prototype.flushSynced = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_flush/synced', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_flush/synced' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.forcemerge](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-forcemerge.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flush - Specify whether the index should be flushed after performing the operation (default: true) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.maxNumSegments - The number of segments the index should be merged into (default: dynamic) - * @param {<>} params.onlyExpungeDeletes - Specify whether the operation should only expunge deleted documents - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.waitForMerge - Specify whether the request should block until the merge process is finished (default: true) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.forcemerge = ca({ - params: { - flush: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - maxNumSegments: { - type: 'number', - name: 'max_num_segments' - }, - onlyExpungeDeletes: { - type: 'boolean', - name: 'only_expunge_deletes' - }, - operationThreading: { - name: 'operation_threading' - }, - waitForMerge: { - type: 'boolean', - name: 'wait_for_merge' - } - }, - urls: [ - { - fmt: '/<%=index%>/_forcemerge', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_forcemerge' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.get](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-get-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.ignoreUnavailable - Ignore unavailable indexes (default: false) - * @param {<>} params.allowNoIndices - Ignore if a wildcard expression resolves to no concrete indices (default: false) - * @param {<>} [params.expandWildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (default: open) - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.human - Whether to return version and creation date values in human-readable format. - * @param {<>} params.includeDefaults - Whether to return all default setting for each of the indices. - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} params.feature - A comma-separated list of features - */ -api.indices.prototype.get = ca({ - params: { - local: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - human: { - type: 'boolean', - 'default': false - }, - includeDefaults: { - type: 'boolean', - 'default': false, - name: 'include_defaults' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=feature%>', - req: { - index: { - type: 'list' - }, - feature: { - type: 'list', - options: [ - '_settings', - '_mappings', - '_aliases' - ] - } - } - }, - { - fmt: '/<%=index%>', - req: { - index: { - type: 'list' - } - } - } - ] -}); - -/** - * Perform a [indices.getAlias](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=all] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names to filter aliases - * @param {<>, <>, <>} params.name - A comma-separated list of alias names to return - */ -api.indices.prototype.getAlias = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'all', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/_alias/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_alias', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_alias' - } - ] -}); - -/** - * Perform a [indices.getFieldMapping](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-get-field-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.includeDefaults - Whether the default mapping values should be returned as well - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} params.type - A comma-separated list of document types - * @param {<>, <>, <>} params.fields - A comma-separated list of fields - */ -api.indices.prototype.getFieldMapping = ca({ - params: { - includeDefaults: { - type: 'boolean', - name: 'include_defaults' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_mapping/<%=type%>/field/<%=fields%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - }, - fields: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_mapping/field/<%=fields%>', - req: { - index: { - type: 'list' - }, - fields: { - type: 'list' - } - } - }, - { - fmt: '/_mapping/<%=type%>/field/<%=fields%>', - req: { - type: { - type: 'list' - }, - fields: { - type: 'list' - } - } - }, - { - fmt: '/_mapping/field/<%=fields%>', - req: { - fields: { - type: 'list' - } - } - } - ] -}); - -/** - * Perform a [indices.getMapping](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-get-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} params.type - A comma-separated list of document types - */ -api.indices.prototype.getMapping = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_mapping/<%=type%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_mapping', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_mapping/<%=type%>', - req: { - type: { - type: 'list' - } - } - }, - { - fmt: '/_mapping' - } - ] -}); - -/** - * Perform a [indices.getSettings](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-get-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open,closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.human - Whether to return version and creation date values in human-readable format. - * @param {<>} params.includeDefaults - Whether to return all default setting for each of the indices. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.name - The name of the settings that should be included - */ -api.indices.prototype.getSettings = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': [ - 'open', - 'closed' - ], - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - local: { - type: 'boolean' - }, - human: { - type: 'boolean', - 'default': false - }, - includeDefaults: { - type: 'boolean', - 'default': false, - name: 'include_defaults' - } - }, - urls: [ - { - fmt: '/<%=index%>/_settings/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_settings', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_settings/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/_settings' - } - ] -}); - -/** - * Perform a [indices.getTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.name - The comma separated names of the index templates - */ -api.indices.prototype.getTemplate = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/_template' - } - ] -}); - -/** - * Perform a [indices.getUpgrade](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-upgrade.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.getUpgrade = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - human: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/<%=index%>/_upgrade', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_upgrade' - } - ] -}); - -/** - * Perform a [indices.open](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-open-close.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma separated list of indices to open - */ -api.indices.prototype.open = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'closed', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - url: { - fmt: '/<%=index%>/_open', - req: { - index: { - type: 'list' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [indices.putAlias](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit timestamp for the document - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices. - * @param {<>} params.name - The name of the alias to be created or updated - */ -api.indices.prototype.putAlias = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'string' - } - } - }, - method: 'PUT' -}); - -/** - * Perform a [indices.putMapping](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-put-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.updateAllTypes - Whether to update the mapping for all fields with the same name across all types or not - * @param {<>, <>, <>} params.index - A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices. - * @param {<>} params.type - The name of the document type - */ -api.indices.prototype.putMapping = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - updateAllTypes: { - type: 'boolean', - name: 'update_all_types' - } - }, - urls: [ - { - fmt: '/<%=index%>/_mapping/<%=type%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/_mapping/<%=type%>', - req: { - type: { - type: 'string' - } - } - } - ], - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [indices.putSettings](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.preserveExisting - Whether to update existing settings. If set to `true` existing settings on an index remain unchanged, the default is `false` - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.putSettings = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - preserveExisting: { - type: 'boolean', - name: 'preserve_existing' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - } - }, - urls: [ - { - fmt: '/<%=index%>/_settings', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_settings' - } - ], - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [indices.putTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.order - The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers) - * @param {<>} params.create - Whether the index template should only be added if new or can also replace an existing one - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.name - The name of the template - */ -api.indices.prototype.putTemplate = ca({ - params: { - order: { - type: 'number' - }, - create: { - type: 'boolean', - 'default': false - }, - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - } - }, - url: { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [indices.recovery](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-recovery.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.detailed - Whether to display detailed information about shard recovery - * @param {<>} params.activeOnly - Display only those recoveries that are currently on-going - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.recovery = ca({ - params: { - detailed: { - type: 'boolean', - 'default': false - }, - activeOnly: { - type: 'boolean', - 'default': false, - name: 'active_only' - }, - human: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/<%=index%>/_recovery', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_recovery' - } - ] -}); - -/** - * Perform a [indices.refresh](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-refresh.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.refresh = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_refresh', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_refresh' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.rollover](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-rollover-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.dryRun - If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for on the newly created rollover index before the operation returns. - * @param {<>} params.alias - The name of the alias to rollover - * @param {<>} params.newIndex - The name of the rollover index - */ -api.indices.prototype.rollover = ca({ - params: { - timeout: { - type: 'time' - }, - dryRun: { - type: 'boolean', - name: 'dry_run' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - } - }, - urls: [ - { - fmt: '/<%=alias%>/_rollover/<%=newIndex%>', - req: { - alias: { - type: 'string' - }, - newIndex: { - type: 'string' - } - } - }, - { - fmt: '/<%=alias%>/_rollover', - req: { - alias: { - type: 'string' - } - } - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.segments](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-segments.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.verbose - Includes detailed memory usage by Lucene. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.segments = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - human: { - type: 'boolean', - 'default': false - }, - operationThreading: { - name: 'operation_threading' - }, - verbose: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/<%=index%>/_segments', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_segments' - } - ] -}); - -/** - * Perform a [indices.shardStores](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-shards-stores.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.status - A comma-separated list of statuses used to filter on shards to get store information for - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {anything} params.operationThreading - TODO: ? - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.shardStores = ca({ - params: { - status: { - type: 'list', - options: [ - 'green', - 'yellow', - 'red', - 'all' - ] - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - operationThreading: { - name: 'operation_threading' - } - }, - urls: [ - { - fmt: '/<%=index%>/_shard_stores', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_shard_stores' - } - ] -}); - -/** - * Perform a [indices.shrink](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-shrink-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for on the shrunken index before the operation returns. - * @param {<>} params.index - The name of the source index to shrink - * @param {<>} params.target - The name of the target index to shrink into - */ -api.indices.prototype.shrink = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - } - }, - url: { - fmt: '/<%=index%>/_shrink/<%=target%>', - req: { - index: { - type: 'string' - }, - target: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [indices.stats](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.completionFields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields for `fielddata` index metric (supports wildcards) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) - * @param {<>, <>, <>} params.groups - A comma-separated list of search groups for `search` index metric - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>} [params.level=indices] - Return stats aggregated at cluster, index or shard level - * @param {<>, <>, <>} params.types - A comma-separated list of document types for the `indexing` index metric - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.metric - Limit the information returned the specific metrics. - */ -api.indices.prototype.stats = ca({ - params: { - completionFields: { - type: 'list', - name: 'completion_fields' - }, - fielddataFields: { - type: 'list', - name: 'fielddata_fields' - }, - fields: { - type: 'list' - }, - groups: { - type: 'list' - }, - human: { - type: 'boolean', - 'default': false - }, - level: { - type: 'enum', - 'default': 'indices', - options: [ - 'cluster', - 'indices', - 'shards' - ] - }, - types: { - type: 'list' - } - }, - urls: [ - { - fmt: '/<%=index%>/_stats/<%=metric%>', - req: { - index: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'percolate', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/_stats/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'percolate', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/<%=index%>/_stats', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_stats' - } - ] -}); - -/** - * Perform a [indices.updateAliases](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Request timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - */ -api.indices.prototype.updateAliases = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_aliases' - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [indices.upgrade](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/indices-upgrade.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.waitForCompletion - Specify whether the request should block until the all segments are upgraded (default: false) - * @param {<>} params.onlyAncientSegments - If true, only ancient (an older Lucene major release) segments will be upgraded - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.upgrade = ca({ - params: { - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - waitForCompletion: { - type: 'boolean', - name: 'wait_for_completion' - }, - onlyAncientSegments: { - type: 'boolean', - name: 'only_ancient_segments' - } - }, - urls: [ - { - fmt: '/<%=index%>/_upgrade', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_upgrade' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.validateQuery](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-validate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.explain - Return detailed information about the error - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.lowercaseExpandedTerms - Specify whether query terms should be lowercased - * @param {<>} params.rewrite - Provide a more detailed explanation showing the actual Lucene query that will be executed. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to restrict the operation; leave empty to perform the operation on all types - */ -api.indices.prototype.validateQuery = ca({ - params: { - explain: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - operationThreading: { - name: 'operation_threading' - }, - q: { - type: 'string' - }, - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - lenient: { - type: 'boolean' - }, - lowercaseExpandedTerms: { - type: 'boolean', - name: 'lowercase_expanded_terms' - }, - rewrite: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_validate/query', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_validate/query', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_validate/query' - } - ], - method: 'POST' -}); - -/** - * Perform a [info](https://www.elastic.co/guide/) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.info = ca({ - url: { - fmt: '/' - } -}); - -api.ingest = namespace(); - -/** - * Perform a [ingest.deletePipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/5.0/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.id - Pipeline ID - */ -api.ingest.prototype.deletePipeline = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_ingest/pipeline/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [ingest.getPipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/5.0/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.id - Comma separated list of pipeline ids. Wildcards supported - */ -api.ingest.prototype.getPipeline = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - urls: [ - { - fmt: '/_ingest/pipeline/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - { - fmt: '/_ingest/pipeline' - } - ] -}); - -/** - * Perform a [ingest.putPipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/5.0/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.id - Pipeline ID - */ -api.ingest.prototype.putPipeline = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_ingest/pipeline/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [ingest.simulate](https://www.elastic.co/guide/en/elasticsearch/plugins/5.0/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.verbose - Verbose mode. Display data output for each processor in executed pipeline - * @param {<>} params.id - Pipeline ID - */ -api.ingest.prototype.simulate = ca({ - params: { - verbose: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_ingest/pipeline/<%=id%>/_simulate', - req: { - id: { - type: 'string' - } - } - }, - { - fmt: '/_ingest/pipeline/_simulate' - } - ], - needBody: true, - method: 'POST' -}); - -/** - * Perform a [mget](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-multi-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.mget = ca({ - params: { - storedFields: { - type: 'list', - name: 'stored_fields' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_mget', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_mget', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_mget' - } - ], - needBody: true, - method: 'POST' -}); - -/** - * Perform a [mpercolate](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-percolate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.index - The index of the document being count percolated to use as default - * @param {<>} params.type - The type of the document being percolated to use as default. - */ -api.mpercolate = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_mpercolate', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_mpercolate', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_mpercolate' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -/** - * Perform a [msearch](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-multi-search.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.searchType - Search operation type - * @param {<>} params.maxConcurrentSearches - Controls the maximum number of concurrent searches the multi search api will execute - * @param {<>, <>, <>} params.index - A comma-separated list of index names to use as default - * @param {<>, <>, <>} params.type - A comma-separated list of document types to use as default - */ -api.msearch = ca({ - params: { - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'query_and_fetch', - 'dfs_query_then_fetch', - 'dfs_query_and_fetch' - ], - name: 'search_type' - }, - maxConcurrentSearches: { - type: 'number', - name: 'max_concurrent_searches' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_msearch', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_msearch', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_msearch' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -/** - * Perform a [msearchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.searchType - Search operation type - * @param {<>, <>, <>} params.index - A comma-separated list of index names to use as default - * @param {<>, <>, <>} params.type - A comma-separated list of document types to use as default - */ -api.msearchTemplate = ca({ - params: { - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'query_and_fetch', - 'dfs_query_then_fetch', - 'dfs_query_and_fetch' - ], - name: 'search_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_msearch/template', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_msearch/template', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_msearch/template' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -/** - * Perform a [mtermvectors](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-multi-termvectors.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.ids - A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body - * @param {<>} params.termStatistics - Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.fieldStatistics=true] - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.offsets=true] - Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.positions=true] - Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.payloads=true] - Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) .Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.routing - Specific routing value. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.parent - Parent id of documents. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.realtime - Specifies if requests are real-time as opposed to near-real-time (default: true). - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index in which the document resides. - * @param {<>} params.type - The type of the document. - */ -api.mtermvectors = ca({ - params: { - ids: { - type: 'list', - required: false - }, - termStatistics: { - type: 'boolean', - 'default': false, - required: false, - name: 'term_statistics' - }, - fieldStatistics: { - type: 'boolean', - 'default': true, - required: false, - name: 'field_statistics' - }, - fields: { - type: 'list', - required: false - }, - offsets: { - type: 'boolean', - 'default': true, - required: false - }, - positions: { - type: 'boolean', - 'default': true, - required: false - }, - payloads: { - type: 'boolean', - 'default': true, - required: false - }, - preference: { - type: 'string', - required: false - }, - routing: { - type: 'string', - required: false - }, - parent: { - type: 'string', - required: false - }, - realtime: { - type: 'boolean', - required: false - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_mtermvectors', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_mtermvectors', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_mtermvectors' - } - ], - method: 'POST' -}); - -api.nodes = namespace(); - -/** - * Perform a [nodes.hotThreads](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cluster-nodes-hot-threads.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.interval - The interval for the second sampling of threads - * @param {<>} params.snapshots - Number of samples of thread stacktrace (default: 10) - * @param {<>} params.threads - Specify the number of threads to provide information for (default: 3) - * @param {<>} params.ignoreIdleThreads - Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue (default: true) - * @param {<>} params.type - The type to sample (default: cpu) - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - */ -api.nodes.prototype.hotThreads = ca({ - params: { - interval: { - type: 'time' - }, - snapshots: { - type: 'number' - }, - threads: { - type: 'number' - }, - ignoreIdleThreads: { - type: 'boolean', - name: 'ignore_idle_threads' - }, - type: { - type: 'enum', - options: [ - 'cpu', - 'wait', - 'block' - ] - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_nodes/<%=nodeId%>/hotthreads', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_nodes/hotthreads' - } - ] -}); - -/** - * Perform a [nodes.info](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cluster-nodes-info.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.metric - A comma-separated list of metrics you wish returned. Leave empty to return all. - */ -api.nodes.prototype.info = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - human: { - type: 'boolean', - 'default': false - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_nodes/<%=nodeId%>/<%=metric%>', - req: { - nodeId: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - 'settings', - 'os', - 'process', - 'jvm', - 'thread_pool', - 'transport', - 'http', - 'plugins', - 'ingest' - ] - } - } - }, - { - fmt: '/_nodes/<%=nodeId%>', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_nodes/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - 'settings', - 'os', - 'process', - 'jvm', - 'thread_pool', - 'transport', - 'http', - 'plugins', - 'ingest' - ] - } - } - }, - { - fmt: '/_nodes' - } - ] -}); - -/** - * Perform a [nodes.stats](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/cluster-nodes-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.completionFields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields for `fielddata` index metric (supports wildcards) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) - * @param {<>} params.groups - A comma-separated list of search groups for `search` index metric - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>} [params.level=node] - Return indices stats aggregated at index, node or shard level - * @param {<>, <>, <>} params.types - A comma-separated list of document types for the `indexing` index metric - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics - * @param {<>, <>, <>} params.indexMetric - Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified. - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - */ -api.nodes.prototype.stats = ca({ - params: { - completionFields: { - type: 'list', - name: 'completion_fields' - }, - fielddataFields: { - type: 'list', - name: 'fielddata_fields' - }, - fields: { - type: 'list' - }, - groups: { - type: 'boolean' - }, - human: { - type: 'boolean', - 'default': false - }, - level: { - type: 'enum', - 'default': 'node', - options: [ - 'indices', - 'node', - 'shards' - ] - }, - types: { - type: 'list' - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_nodes/<%=nodeId%>/stats/<%=metric%>/<%=indexMetric%>', - req: { - nodeId: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport', - 'discovery' - ] - }, - indexMetric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'percolate', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/_nodes/<%=nodeId%>/stats/<%=metric%>', - req: { - nodeId: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport', - 'discovery' - ] - } - } - }, - { - fmt: '/_nodes/stats/<%=metric%>/<%=indexMetric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport', - 'discovery' - ] - }, - indexMetric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'percolate', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/_nodes/<%=nodeId%>/stats', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_nodes/stats/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport', - 'discovery' - ] - } - } - }, - { - fmt: '/_nodes/stats' - } - ] -}); - -/** - * Perform a [percolate](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-percolate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.percolateIndex - The index to percolate the document into. Defaults to index. - * @param {<>} params.percolateType - The type to percolate document into. Defaults to type. - * @param {<>} params.percolateRouting - The routing value to use when percolating the existing document. - * @param {<>} params.percolatePreference - Which shard to prefer when executing the percolate request. - * @param {<>} params.percolateFormat - Return an array of matching query IDs instead of objects - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index of the document being percolated. - * @param {<>} params.type - The type of the document being percolated. - * @param {<>} params.id - Substitute the document in the request body with a document that is known by the specified id. On top of the id, the index and type parameter will be used to retrieve the document from within the cluster. - */ -api.percolate = ca({ - params: { - routing: { - type: 'list' - }, - preference: { - type: 'string' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - percolateIndex: { - type: 'string', - name: 'percolate_index' - }, - percolateType: { - type: 'string', - name: 'percolate_type' - }, - percolateRouting: { - type: 'string', - name: 'percolate_routing' - }, - percolatePreference: { - type: 'string', - name: 'percolate_preference' - }, - percolateFormat: { - type: 'enum', - options: [ - 'ids' - ], - name: 'percolate_format' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_percolate', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/<%=type%>/_percolate', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - } - ], - method: 'POST' -}); - -/** - * Perform a [ping](https://www.elastic.co/guide/) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.ping = ca({ - url: { - fmt: '/' - }, - requestTimeout: 3000, - method: 'HEAD' -}); - -/** - * Perform a [putScript](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Script ID - * @param {<>} params.lang - Script language - */ -api.putScript = ca({ - url: { - fmt: '/_scripts/<%=lang%>/<%=id%>', - req: { - lang: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [putTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Template ID - */ -api.putTemplate = ca({ - url: { - fmt: '/_search/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [reindex](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-reindex.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the reindex operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.waitForCompletion - Should the request should block until the reindex is complete. - * @param {<>} params.requestsPerSecond - The throttle to set on this request in sub-requests per second. -1 means set no throttle as does "unlimited" which is the only non-float this accepts. - */ -api.reindex = ca({ - params: { - refresh: { - type: 'boolean' - }, - timeout: { - type: 'time', - 'default': '1m' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - waitForCompletion: { - type: 'boolean', - 'default': false, - name: 'wait_for_completion' - }, - requestsPerSecond: { - type: 'number', - 'default': 0, - name: 'requests_per_second' - } - }, - url: { - fmt: '/_reindex' - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [reindexRethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-reindex.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.requestsPerSecond - The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. - * @param {<>} params.taskId - The task id to rethrottle - */ -api.reindexRethrottle = ca({ - params: { - requestsPerSecond: { - type: 'number', - required: true, - name: 'requests_per_second' - } - }, - url: { - fmt: '/_reindex/<%=taskId%>/_rethrottle', - req: { - taskId: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [renderSearchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - The id of the stored search template - */ -api.renderSearchTemplate = ca({ - urls: [ - { - fmt: '/_render/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - { - fmt: '/_render/template' - } - ], - method: 'POST' -}); - -/** - * Perform a [scroll](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-request-scroll.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.scrollId - The scroll ID - */ -api.scroll = ca({ - params: { - scroll: { - type: 'time' - }, - scrollId: { - type: 'string', - name: 'scroll_id' - } - }, - urls: [ - { - fmt: '/_search/scroll/<%=scrollId%>', - req: { - scrollId: { - type: 'string' - } - } - }, - { - fmt: '/_search/scroll' - } - ], - paramAsBody: { - param: 'scrollId', - body: 'scroll_id' - }, - method: 'POST' -}); - -/** - * Perform a [search](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-search.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.explain - Specify whether to return detailed information about score computation as part of a hit - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return as part of a hit - * @param {<>, <>, <>} params.docvalueFields - A comma-separated list of fields to return as the docvalue representation of a field for each hit - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields to return as the docvalue representation of a field for each hit - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.lowercaseExpandedTerms - Specify whether query terms should be lowercased - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.suggestField - Specify which field to use for suggestions - * @param {<>} [params.suggestMode=missing] - Specify suggest mode - * @param {<>} params.suggestSize - How many suggestions to return in response - * @param {<>} params.suggestText - The source text for which the suggestions should be returned - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.trackScores - Whether to calculate and return scores even if they are not used for sorting - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.search = ca({ - params: { - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - explain: { - type: 'boolean' - }, - storedFields: { - type: 'list', - name: 'stored_fields' - }, - docvalueFields: { - type: 'list', - name: 'docvalue_fields' - }, - fielddataFields: { - type: 'list', - name: 'fielddata_fields' - }, - from: { - type: 'number' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - lenient: { - type: 'boolean' - }, - lowercaseExpandedTerms: { - type: 'boolean', - name: 'lowercase_expanded_terms' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'dfs_query_then_fetch' - ], - name: 'search_type' - }, - size: { - type: 'number' - }, - sort: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - terminateAfter: { - type: 'number', - name: 'terminate_after' - }, - stats: { - type: 'list' - }, - suggestField: { - type: 'string', - name: 'suggest_field' - }, - suggestMode: { - type: 'enum', - 'default': 'missing', - options: [ - 'missing', - 'popular', - 'always' - ], - name: 'suggest_mode' - }, - suggestSize: { - type: 'number', - name: 'suggest_size' - }, - suggestText: { - type: 'string', - name: 'suggest_text' - }, - timeout: { - type: 'time' - }, - trackScores: { - type: 'boolean', - name: 'track_scores' - }, - version: { - type: 'boolean' - }, - requestCache: { - type: 'boolean', - name: 'request_cache' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_search', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_search', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_search' - } - ], - method: 'POST' -}); - -/** - * Perform a [searchShards](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-shards.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.searchShards = ca({ - params: { - preference: { - type: 'string' - }, - routing: { - type: 'string' - }, - local: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_search_shards', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_search_shards', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_search_shards' - } - ], - method: 'POST' -}); - -/** - * Perform a [searchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.searchTemplate = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - preference: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'query_and_fetch', - 'dfs_query_then_fetch', - 'dfs_query_and_fetch' - ], - name: 'search_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_search/template', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_search/template', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_search/template' - } - ], - method: 'POST' -}); - -api.snapshot = namespace(); - -/** - * Perform a [snapshot.create](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.waitForCompletion - Should this request wait until the operation has completed before returning - * @param {<>} params.repository - A repository name - * @param {<>} params.snapshot - A snapshot name - */ -api.snapshot.prototype.create = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForCompletion: { - type: 'boolean', - 'default': false, - name: 'wait_for_completion' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [snapshot.createRepository](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.verify - Whether to verify the repository after creation - * @param {<>} params.repository - A repository name - */ -api.snapshot.prototype.createRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - }, - verify: { - type: 'boolean' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>', - req: { - repository: { - type: 'string' - } - } - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [snapshot.delete](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.repository - A repository name - * @param {<>} params.snapshot - A snapshot name - */ -api.snapshot.prototype['delete'] = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [snapshot.deleteRepository](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.repository - A comma-separated list of repository names - */ -api.snapshot.prototype.deleteRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>', - req: { - repository: { - type: 'list' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [snapshot.get](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.ignoreUnavailable - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown - * @param {<>} params.repository - A repository name - * @param {<>, <>, <>} params.snapshot - A comma-separated list of snapshot names - */ -api.snapshot.prototype.get = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'list' - } - } - } -}); - -/** - * Perform a [snapshot.getRepository](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.repository - A comma-separated list of repository names - */ -api.snapshot.prototype.getRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/_snapshot/<%=repository%>', - req: { - repository: { - type: 'list' - } - } - }, - { - fmt: '/_snapshot' - } - ] -}); - -/** - * Perform a [snapshot.restore](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.waitForCompletion - Should this request wait until the operation has completed before returning - * @param {<>} params.repository - A repository name - * @param {<>} params.snapshot - A snapshot name - */ -api.snapshot.prototype.restore = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForCompletion: { - type: 'boolean', - 'default': false, - name: 'wait_for_completion' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>/_restore', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [snapshot.status](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.ignoreUnavailable - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown - * @param {<>} params.repository - A repository name - * @param {<>, <>, <>} params.snapshot - A comma-separated list of snapshot names - */ -api.snapshot.prototype.status = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - } - }, - urls: [ - { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>/_status', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'list' - } - } - }, - { - fmt: '/_snapshot/<%=repository%>/_status', - req: { - repository: { - type: 'string' - } - } - }, - { - fmt: '/_snapshot/_status' - } - ] -}); - -/** - * Perform a [snapshot.verifyRepository](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.repository - A repository name - */ -api.snapshot.prototype.verifyRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/_verify', - req: { - repository: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [suggest](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-suggesters.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params.index - A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices - */ -api.suggest = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - preference: { - type: 'string' - }, - routing: { - type: 'string' - } - }, - urls: [ - { - fmt: '/<%=index%>/_suggest', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_suggest' - } - ], - needBody: true, - method: 'POST' -}); - -api.tasks = namespace(); - -/** - * Perform a [tasks.cancel](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.actions - A comma-separated list of actions that should be cancelled. Leave empty to cancel all. - * @param {<>} params.parentNode - Cancel tasks with specified parent node. - * @param {<>} params.parentTask - Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all. - * @param {<>} params.taskId - Cancel the task with specified task id (node_id:task_number) - */ -api.tasks.prototype.cancel = ca({ - params: { - nodeId: { - type: 'list', - name: 'node_id' - }, - actions: { - type: 'list' - }, - parentNode: { - type: 'string', - name: 'parent_node' - }, - parentTask: { - type: 'string', - name: 'parent_task' - } - }, - urls: [ - { - fmt: '/_tasks/<%=taskId%>/_cancel', - req: { - taskId: { - type: 'string' - } - } - }, - { - fmt: '/_tasks/_cancel' - } - ], - method: 'POST' -}); - -/** - * Perform a [tasks.get](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForCompletion - Wait for the matching tasks to complete (default: false) - * @param {<>} params.taskId - Return the task with specified id (node_id:task_number) - */ -api.tasks.prototype.get = ca({ - params: { - waitForCompletion: { - type: 'boolean', - name: 'wait_for_completion' - } - }, - url: { - fmt: '/_tasks/<%=taskId%>', - req: { - taskId: { - type: 'string' - } - } - } -}); - -/** - * Perform a [tasks.list](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.actions - A comma-separated list of actions that should be returned. Leave empty to return all. - * @param {<>} params.detailed - Return detailed task information (default: false) - * @param {<>} params.parentNode - Return tasks with specified parent node. - * @param {<>} params.parentTask - Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all. - * @param {<>} params.waitForCompletion - Wait for the matching tasks to complete (default: false) - * @param {<>} [params.groupBy=nodes] - Group tasks by nodes or parent/child relationships - */ -api.tasks.prototype.list = ca({ - params: { - nodeId: { - type: 'list', - name: 'node_id' - }, - actions: { - type: 'list' - }, - detailed: { - type: 'boolean' - }, - parentNode: { - type: 'string', - name: 'parent_node' - }, - parentTask: { - type: 'string', - name: 'parent_task' - }, - waitForCompletion: { - type: 'boolean', - name: 'wait_for_completion' - }, - groupBy: { - type: 'enum', - 'default': 'nodes', - options: [ - 'nodes', - 'parents' - ], - name: 'group_by' - } - }, - url: { - fmt: '/_tasks' - } -}); - -/** - * Perform a [termvectors](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-termvectors.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.termStatistics - Specifies if total term frequency and document frequency should be returned. - * @param {<>} [params.fieldStatistics=true] - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return. - * @param {<>} [params.offsets=true] - Specifies if term offsets should be returned. - * @param {<>} [params.positions=true] - Specifies if term positions should be returned. - * @param {<>} [params.payloads=true] - Specifies if term payloads should be returned. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random). - * @param {<>} params.routing - Specific routing value. - * @param {<>} params.parent - Parent id of documents. - * @param {<>} params.realtime - Specifies if request is real-time as opposed to near-real-time (default: true). - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index in which the document resides. - * @param {<>} params.type - The type of the document. - * @param {<>} params.id - The id of the document, when not specified a doc param should be supplied. - */ -api.termvectors = ca({ - params: { - termStatistics: { - type: 'boolean', - 'default': false, - required: false, - name: 'term_statistics' - }, - fieldStatistics: { - type: 'boolean', - 'default': true, - required: false, - name: 'field_statistics' - }, - fields: { - type: 'list', - required: false - }, - offsets: { - type: 'boolean', - 'default': true, - required: false - }, - positions: { - type: 'boolean', - 'default': true, - required: false - }, - payloads: { - type: 'boolean', - 'default': true, - required: false - }, - preference: { - type: 'string', - required: false - }, - routing: { - type: 'string', - required: false - }, - parent: { - type: 'string', - required: false - }, - realtime: { - type: 'boolean', - required: false - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_termvectors', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/<%=type%>/_termvectors', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - } - ], - method: 'POST' -}); - -/** - * Perform a [update](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-update.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the update operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return in the response - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.lang - The script language (default: groovy) - * @param {<>} params.parent - ID of the parent document. Is is only used for routing and when for the upsert request - * @param {<>} params.refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.retryOnConflict - Specify how many times should the operation be retried when a conflict occurs (default: 0) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.update = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - fields: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - lang: { - type: 'string' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - retryOnConflict: { - type: 'number', - name: 'retry_on_conflict' - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - timestamp: { - type: 'time' - }, - ttl: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_update', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [updateByQuery](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-update-by-query.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.conflicts=abort] - What to do when the update by query hits version conflicts? - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.lowercaseExpandedTerms - Specify whether query terms should be lowercased - * @param {<>} params.pipeline - Ingest pipeline to set on index requests made by this action. (default: none) - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.searchTimeout - Explicit timeout for each search request. Defaults to no timeout. - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.versionType - Should the document increment the version number (internal) on hit or not (reindex) - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the update by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.scrollSize - Size on the scroll request powering the update_by_query - * @param {<>} params.waitForCompletion - Should the request should block until the update by query operation is complete. - * @param {<>} params.requestsPerSecond - The throttle to set on this request in sub-requests per second. -1 means set no throttle as does "unlimited" which is the only non-float this accepts. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.updateByQuery = ca({ - params: { - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - from: { - type: 'number' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - conflicts: { - type: 'enum', - 'default': 'abort', - options: [ - 'abort', - 'proceed' - ] - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - lenient: { - type: 'boolean' - }, - lowercaseExpandedTerms: { - type: 'boolean', - name: 'lowercase_expanded_terms' - }, - pipeline: { - type: 'string' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'dfs_query_then_fetch' - ], - name: 'search_type' - }, - searchTimeout: { - type: 'time', - name: 'search_timeout' - }, - size: { - type: 'number' - }, - sort: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - terminateAfter: { - type: 'number', - name: 'terminate_after' - }, - stats: { - type: 'list' - }, - version: { - type: 'boolean' - }, - versionType: { - type: 'boolean', - name: 'version_type' - }, - requestCache: { - type: 'boolean', - name: 'request_cache' - }, - refresh: { - type: 'boolean' - }, - timeout: { - type: 'time', - 'default': '1m' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - scrollSize: { - type: 'number', - name: 'scroll_size' - }, - waitForCompletion: { - type: 'boolean', - 'default': false, - name: 'wait_for_completion' - }, - requestsPerSecond: { - type: 'number', - 'default': 0, - name: 'requests_per_second' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_update_by_query', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_update_by_query', - req: { - index: { - type: 'list' - } - } - } - ], - method: 'POST' -}); diff --git a/src/lib/apis/5_1.js b/src/lib/apis/5_1.js deleted file mode 100644 index 7f295a602..000000000 --- a/src/lib/apis/5_1.js +++ /dev/null @@ -1,7149 +0,0 @@ -var ca = require('../client_action').makeFactoryWithModifier(function (spec) { - return require('../utils').merge(spec, { - params: { - filterPath: { - type: 'list', - name: 'filter_path' - } - } - }); -}); -var namespace = require('../client_action').namespaceFactory; -var api = module.exports = {}; - -api._namespaces = ['cat', 'cluster', 'indices', 'ingest', 'nodes', 'snapshot', 'tasks']; - -/** - * Perform a [bulk](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-bulk.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the bulk operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.type - Default document type for items which don't provide one - * @param {<>, <>, <>} params.fields - Default comma-separated list of fields to return in the response for updates, can be overridden on each sub-request - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request - * @param {<>, <>, <>} params._sourceExclude - Default list of fields to exclude from the returned _source field, can be overridden on each sub-request - * @param {<>, <>, <>} params._sourceInclude - Default list of fields to extract and return from the _source field, can be overridden on each sub-request - * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with - * @param {<>} params.index - Default index for items which don't provide one - */ -api.bulk = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - type: { - type: 'string' - }, - fields: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - pipeline: { - type: 'string' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_bulk', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_bulk', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_bulk' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -api.cat = namespace(); - -/** - * Perform a [cat.aliases](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.name - A comma-separated list of alias names to return - */ -api.cat.prototype.aliases = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/aliases/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/_cat/aliases' - } - ] -}); - -/** - * Perform a [cat.allocation](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-allocation.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information - */ -api.cat.prototype.allocation = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'kb', - 'm', - 'mb', - 'g', - 'gb', - 't', - 'tb', - 'p', - 'pb' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/allocation/<%=nodeId%>', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_cat/allocation' - } - ] -}); - -/** - * Perform a [cat.count](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-count.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.count = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/count/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/count' - } - ] -}); - -/** - * Perform a [cat.fielddata](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-fielddata.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return the fielddata size - */ -api.cat.prototype.fielddata = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'kb', - 'm', - 'mb', - 'g', - 'gb', - 't', - 'tb', - 'p', - 'pb' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - }, - fields: { - type: 'list' - } - }, - urls: [ - { - fmt: '/_cat/fielddata/<%=fields%>', - req: { - fields: { - type: 'list' - } - } - }, - { - fmt: '/_cat/fielddata' - } - ] -}); - -/** - * Perform a [cat.health](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-health.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} [params.ts=true] - Set to false to disable timestamping - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.health = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - ts: { - type: 'boolean', - 'default': true - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/health' - } -}); - -/** - * Perform a [cat.help](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - */ -api.cat.prototype.help = ca({ - params: { - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - } - }, - url: { - fmt: '/_cat' - } -}); - -/** - * Perform a [cat.indices](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-indices.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.health - A health status ("green", "yellow", or "red" to filter only indices matching the specified health status - * @param {<>} params.help - Return help information - * @param {<>} params.pri - Set to true to return stats only for primary shards - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.indices = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'm', - 'g' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - health: { - type: 'enum', - 'default': null, - options: [ - 'green', - 'yellow', - 'red' - ] - }, - help: { - type: 'boolean', - 'default': false - }, - pri: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/indices/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/indices' - } - ] -}); - -/** - * Perform a [cat.master](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-master.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.master = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/master' - } -}); - -/** - * Perform a [cat.nodeattrs](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-nodeattrs.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.nodeattrs = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/nodeattrs' - } -}); - -/** - * Perform a [cat.nodes](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-nodes.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.fullId - Return the full node ID instead of the shortened version (default: false) - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.nodes = ca({ - params: { - format: { - type: 'string' - }, - fullId: { - type: 'boolean', - name: 'full_id' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/nodes' - } -}); - -/** - * Perform a [cat.pendingTasks](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-pending-tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.pendingTasks = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/pending_tasks' - } -}); - -/** - * Perform a [cat.plugins](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-plugins.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.plugins = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/plugins' - } -}); - -/** - * Perform a [cat.recovery](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-recovery.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.recovery = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'kb', - 'm', - 'mb', - 'g', - 'gb', - 't', - 'tb', - 'p', - 'pb' - ] - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/recovery/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/recovery' - } - ] -}); - -/** - * Perform a [cat.repositories](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-repositories.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.repositories = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean', - 'default': false - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/repositories' - } -}); - -/** - * Perform a [cat.segments](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-segments.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.segments = ca({ - params: { - format: { - type: 'string' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/segments/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/segments' - } - ] -}); - -/** - * Perform a [cat.shards](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-shards.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.shards = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/shards/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/shards' - } - ] -}); - -/** - * Perform a [cat.snapshots](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.ignoreUnavailable - Set to true to ignore unavailable snapshots - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.repository - Name of repository from which to fetch the snapshot information - */ -api.cat.prototype.snapshots = ca({ - params: { - format: { - type: 'string' - }, - ignoreUnavailable: { - type: 'boolean', - 'default': false, - name: 'ignore_unavailable' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/snapshots/<%=repository%>', - req: { - repository: { - type: 'list' - } - } - }, - { - fmt: '/_cat/snapshots' - } - ] -}); - -/** - * Perform a [cat.tasks](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.actions - A comma-separated list of actions that should be returned. Leave empty to return all. - * @param {<>} params.detailed - Return detailed task information (default: false) - * @param {<>} params.parentNode - Return tasks with specified parent node. - * @param {<>} params.parentTask - Return tasks with specified parent task id. Set to -1 to return all. - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.tasks = ca({ - params: { - format: { - type: 'string' - }, - nodeId: { - type: 'list', - name: 'node_id' - }, - actions: { - type: 'list' - }, - detailed: { - type: 'boolean' - }, - parentNode: { - type: 'string', - name: 'parent_node' - }, - parentTask: { - type: 'number', - name: 'parent_task' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/tasks' - } -}); - -/** - * Perform a [cat.templates](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>} params.name - A pattern that returned template names must match - */ -api.cat.prototype.templates = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/templates/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - { - fmt: '/_cat/templates' - } - ] -}); - -/** - * Perform a [cat.threadPool](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cat-thread-pool.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.size - The multiplier in which to display values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.threadPoolPatterns - A comma-separated list of regular-expressions to filter the thread pools in the output - */ -api.cat.prototype.threadPool = ca({ - params: { - format: { - type: 'string' - }, - size: { - type: 'enum', - options: [ - '', - 'k', - 'm', - 'g', - 't', - 'p' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/thread_pool/<%=threadPoolPatterns%>', - req: { - threadPoolPatterns: { - type: 'list' - } - } - }, - { - fmt: '/_cat/thread_pool' - } - ] -}); - -/** - * Perform a [clearScroll](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-request-scroll.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.scrollId - A comma-separated list of scroll IDs to clear - */ -api.clearScroll = ca({ - urls: [ - { - fmt: '/_search/scroll/<%=scrollId%>', - req: { - scrollId: { - type: 'list' - } - } - }, - { - fmt: '/_search/scroll' - } - ], - paramAsBody: { - param: 'scrollId', - body: 'scroll_id' - }, - method: 'DELETE' -}); - -api.cluster = namespace(); - -/** - * Perform a [cluster.allocationExplain](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cluster-allocation-explain.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.includeYesDecisions - Return 'YES' decisions in explanation (default: false) - * @param {<>} params.includeDiskInfo - Return information about disk usage and shard sizes (default: false) - */ -api.cluster.prototype.allocationExplain = ca({ - params: { - includeYesDecisions: { - type: 'boolean', - name: 'include_yes_decisions' - }, - includeDiskInfo: { - type: 'boolean', - name: 'include_disk_info' - } - }, - url: { - fmt: '/_cluster/allocation/explain' - }, - method: 'POST' -}); - -/** - * Perform a [cluster.getSettings](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cluster-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.includeDefaults - Whether to return all default clusters setting. - */ -api.cluster.prototype.getSettings = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - }, - includeDefaults: { - type: 'boolean', - 'default': false, - name: 'include_defaults' - } - }, - url: { - fmt: '/_cluster/settings' - } -}); - -/** - * Perform a [cluster.health](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cluster-health.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} [params.level=cluster] - Specify the level of detail for returned information - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.waitForActiveShards - Wait until the specified number of shards is active - * @param {<>} params.waitForNodes - Wait until the specified number of nodes is available - * @param {<>} params.waitForEvents - Wait until all currently queued events with the given priority are processed - * @param {<>} params.waitForNoRelocatingShards - Whether to wait until there are no relocating shards in the cluster - * @param {<>} params.waitForStatus - Wait until cluster is in a specific state - * @param {<>, <>, <>} params.index - Limit the information returned to a specific index - */ -api.cluster.prototype.health = ca({ - params: { - level: { - type: 'enum', - 'default': 'cluster', - options: [ - 'cluster', - 'indices', - 'shards' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - waitForNodes: { - type: 'string', - name: 'wait_for_nodes' - }, - waitForEvents: { - type: 'enum', - options: [ - 'immediate', - 'urgent', - 'high', - 'normal', - 'low', - 'languid' - ], - name: 'wait_for_events' - }, - waitForNoRelocatingShards: { - type: 'boolean', - name: 'wait_for_no_relocating_shards' - }, - waitForStatus: { - type: 'enum', - 'default': null, - options: [ - 'green', - 'yellow', - 'red' - ], - name: 'wait_for_status' - } - }, - urls: [ - { - fmt: '/_cluster/health/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cluster/health' - } - ] -}); - -/** - * Perform a [cluster.pendingTasks](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cluster-pending.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Specify timeout for connection to master - */ -api.cluster.prototype.pendingTasks = ca({ - params: { - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_cluster/pending_tasks' - } -}); - -/** - * Perform a [cluster.putSettings](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cluster-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - */ -api.cluster.prototype.putSettings = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_cluster/settings' - }, - method: 'PUT' -}); - -/** - * Perform a [cluster.reroute](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cluster-reroute.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.dryRun - Simulate the operation only and return the resulting state - * @param {<>} params.explain - Return an explanation of why the commands can or cannot be executed - * @param {<>} params.retryFailed - Retries allocation of shards that are blocked due to too many subsequent allocation failures - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics. Defaults to all but metadata - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - */ -api.cluster.prototype.reroute = ca({ - params: { - dryRun: { - type: 'boolean', - name: 'dry_run' - }, - explain: { - type: 'boolean' - }, - retryFailed: { - type: 'boolean', - name: 'retry_failed' - }, - metric: { - type: 'list', - options: [ - '_all', - 'blocks', - 'metadata', - 'nodes', - 'routing_table', - 'master_node', - 'version' - ] - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_cluster/reroute' - }, - method: 'POST' -}); - -/** - * Perform a [cluster.state](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cluster-state.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics - */ -api.cluster.prototype.state = ca({ - params: { - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/_cluster/state/<%=metric%>/<%=index%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'blocks', - 'metadata', - 'nodes', - 'routing_table', - 'routing_nodes', - 'master_node', - 'version' - ] - }, - index: { - type: 'list' - } - } - }, - { - fmt: '/_cluster/state/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'blocks', - 'metadata', - 'nodes', - 'routing_table', - 'routing_nodes', - 'master_node', - 'version' - ] - } - } - }, - { - fmt: '/_cluster/state' - } - ] -}); - -/** - * Perform a [cluster.stats](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cluster-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - */ -api.cluster.prototype.stats = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - human: { - type: 'boolean', - 'default': false - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_cluster/stats/nodes/<%=nodeId%>', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_cluster/stats' - } - ] -}); - -/** - * Perform a [count](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-count.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.minScore - Include only documents with a specific `_score` value in the result - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>, <>, <>} params.index - A comma-separated list of indices to restrict the results - * @param {<>, <>, <>} params.type - A comma-separated list of types to restrict the results - */ -api.count = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - minScore: { - type: 'number', - name: 'min_score' - }, - preference: { - type: 'string' - }, - routing: { - type: 'string' - }, - q: { - type: 'string' - }, - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - lenient: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_count', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_count', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_count' - } - ], - method: 'POST' -}); - -/** - * Perform a [countPercolate](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-percolate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.percolateIndex - The index to count percolate the document into. Defaults to index. - * @param {<>} params.percolateType - The type to count percolate document into. Defaults to type. - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index of the document being count percolated. - * @param {<>} params.type - The type of the document being count percolated. - * @param {<>} params.id - Substitute the document in the request body with a document that is known by the specified id. On top of the id, the index and type parameter will be used to retrieve the document from within the cluster. - */ -api.countPercolate = ca({ - params: { - routing: { - type: 'list' - }, - preference: { - type: 'string' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - percolateIndex: { - type: 'string', - name: 'percolate_index' - }, - percolateType: { - type: 'string', - name: 'percolate_type' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_percolate/count', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/<%=type%>/_percolate/count', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - } - ], - method: 'POST' -}); - -/** - * Perform a [create](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-index_.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.parent - ID of the parent document - * @param {<>} params.refresh - If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.create = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - timestamp: { - type: 'time' - }, - ttl: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - }, - pipeline: { - type: 'string' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_create', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [delete](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-delete.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the delete operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.parent - ID of parent document - * @param {<>} params.refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api['delete'] = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [deleteByQuery](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-delete-by-query.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.conflicts=abort] - What to do when the delete-by-query hits version conflicts? - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.searchTimeout - Explicit timeout for each search request. Defaults to no timeout. - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the delete by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.scrollSize - Size on the scroll request powering the update_by_query - * @param {<>} params.waitForCompletion - Should the request should block until the delete-by-query is complete. - * @param {<>} params.requestsPerSecond - The throttle for this request in sub-requests per second. -1 means no throttle. - * @param {<>} [params.slices=1] - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.deleteByQuery = ca({ - params: { - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - from: { - type: 'number' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - conflicts: { - type: 'enum', - 'default': 'abort', - options: [ - 'abort', - 'proceed' - ] - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - lenient: { - type: 'boolean' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'dfs_query_then_fetch' - ], - name: 'search_type' - }, - searchTimeout: { - type: 'time', - name: 'search_timeout' - }, - size: { - type: 'number' - }, - sort: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - terminateAfter: { - type: 'number', - name: 'terminate_after' - }, - stats: { - type: 'list' - }, - version: { - type: 'boolean' - }, - requestCache: { - type: 'boolean', - name: 'request_cache' - }, - refresh: { - type: 'boolean' - }, - timeout: { - type: 'time', - 'default': '1m' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - scrollSize: { - type: 'number', - name: 'scroll_size' - }, - waitForCompletion: { - type: 'boolean', - 'default': false, - name: 'wait_for_completion' - }, - requestsPerSecond: { - type: 'number', - 'default': 0, - name: 'requests_per_second' - }, - slices: { - type: 'integer', - 'default': 1 - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_delete_by_query', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_delete_by_query', - req: { - index: { - type: 'list' - } - } - } - ], - needBody: true, - method: 'POST' -}); - -/** - * Perform a [deleteScript](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Script ID - * @param {<>} params.lang - Script language - */ -api.deleteScript = ca({ - url: { - fmt: '/_scripts/<%=lang%>/<%=id%>', - req: { - lang: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [deleteTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Template ID - */ -api.deleteTemplate = ca({ - url: { - fmt: '/_search/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [exists](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document (use `_all` to fetch the first document matching the ID across all types) - */ -api.exists = ca({ - params: { - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [explain](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-explain.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzeWildcard - Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false) - * @param {<>} params.analyzer - The analyzer for the query string query - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The default field for query string query (default: _all) - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.explain = ca({ - params: { - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - analyzer: { - type: 'string' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - storedFields: { - type: 'list', - name: 'stored_fields' - }, - lenient: { - type: 'boolean' - }, - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_explain', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [fieldStats](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-field-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for to get field statistics for (min value, max value, and more) - * @param {<>} [params.level=cluster] - Defines if field stats should be returned on a per index level or on a cluster wide level - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.fieldStats = ca({ - params: { - fields: { - type: 'list' - }, - level: { - type: 'enum', - 'default': 'cluster', - options: [ - 'indices', - 'cluster' - ] - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_field_stats', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_field_stats' - } - ], - method: 'POST' -}); - -/** - * Perform a [get](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document (use `_all` to fetch the first document matching the ID across all types) - */ -api.get = ca({ - params: { - storedFields: { - type: 'list', - name: 'stored_fields' - }, - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [getScript](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Script ID - * @param {<>} params.lang - Script language - */ -api.getScript = ca({ - url: { - fmt: '/_scripts/<%=lang%>/<%=id%>', - req: { - lang: { - type: 'string' - }, - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [getSource](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document; use `_all` to fetch the first document matching the ID across all types - */ -api.getSource = ca({ - params: { - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_source', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [getTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Template ID - */ -api.getTemplate = ca({ - url: { - fmt: '/_search/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [index](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-index_.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} [params.opType=index] - Explicit operation type - * @param {<>} params.parent - ID of the parent document - * @param {<>} params.refresh - If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.index = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - opType: { - type: 'enum', - 'default': 'index', - options: [ - 'index', - 'create' - ], - name: 'op_type' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - timestamp: { - type: 'time' - }, - ttl: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - }, - pipeline: { - type: 'string' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/<%=type%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - } - ], - needBody: true, - method: 'POST' -}); - -api.indices = namespace(); - -/** - * Perform a [indices.analyze](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-analyze.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The name of the analyzer to use - * @param {<>, <>, <>} params.charFilter - A comma-separated list of character filters to use for the analysis - * @param {<>} params.field - Use the analyzer configured for this field (instead of passing the analyzer name) - * @param {<>, <>, <>} params.filter - A comma-separated list of filters to use for the analysis - * @param {<>} params.index - The name of the index to scope the operation - * @param {<>} params.preferLocal - With `true`, specify that a local shard should be used if available, with `false`, use a random shard (default: true) - * @param {<>, <>, <>} params.text - The text on which the analysis should be performed (when request body is not used) - * @param {<>} params.tokenizer - The name of the tokenizer to use for the analysis - * @param {<>} params.explain - With `true`, outputs more advanced details. (default: false) - * @param {<>, <>, <>} params.attributes - A comma-separated list of token attributes to output, this parameter works only with `explain=true` - * @param {<>} [params.format=detailed] - Format of the output - */ -api.indices.prototype.analyze = ca({ - params: { - analyzer: { - type: 'string' - }, - charFilter: { - type: 'list', - name: 'char_filter' - }, - field: { - type: 'string' - }, - filter: { - type: 'list' - }, - index: { - type: 'string' - }, - preferLocal: { - type: 'boolean', - name: 'prefer_local' - }, - text: { - type: 'list' - }, - tokenizer: { - type: 'string' - }, - explain: { - type: 'boolean' - }, - attributes: { - type: 'list' - }, - format: { - type: 'enum', - 'default': 'detailed', - options: [ - 'detailed', - 'text' - ] - } - }, - urls: [ - { - fmt: '/<%=index%>/_analyze', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_analyze' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.clearCache](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-clearcache.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.fieldData - Clear field data - * @param {<>} params.fielddata - Clear field data - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to clear when using the `field_data` parameter (default: all) - * @param {<>} params.query - Clear query caches - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index name to limit the operation - * @param {<>} params.recycler - Clear the recycler cache - * @param {<>} params.request - Clear request cache - */ -api.indices.prototype.clearCache = ca({ - params: { - fieldData: { - type: 'boolean', - name: 'field_data' - }, - fielddata: { - type: 'boolean' - }, - fields: { - type: 'list' - }, - query: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - index: { - type: 'list' - }, - recycler: { - type: 'boolean' - }, - request: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_cache/clear', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cache/clear' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.close](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-open-close.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma separated list of indices to close - */ -api.indices.prototype.close = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - url: { - fmt: '/<%=index%>/_close', - req: { - index: { - type: 'list' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [indices.create](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-create-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for before the operation returns. - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.updateAllTypes - Whether to update the mapping for all fields with the same name across all types or not - * @param {<>} params.index - The name of the index - */ -api.indices.prototype.create = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - updateAllTypes: { - type: 'boolean', - name: 'update_all_types' - } - }, - url: { - fmt: '/<%=index%>', - req: { - index: { - type: 'string' - } - } - }, - method: 'PUT' -}); - -/** - * Perform a [indices.delete](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-delete-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices - */ -api.indices.prototype['delete'] = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [indices.deleteAlias](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit timestamp for the document - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of index names (supports wildcards); use `_all` for all indices - * @param {<>, <>, <>} params.name - A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices. - */ -api.indices.prototype.deleteAlias = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [indices.deleteTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.name - The name of the template - */ -api.indices.prototype.deleteTemplate = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [indices.exists](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-exists.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of indices to check - */ -api.indices.prototype.exists = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - url: { - fmt: '/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [indices.existsAlias](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open,closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names to filter aliases - * @param {<>, <>, <>} params.name - A comma-separated list of alias names to return - */ -api.indices.prototype.existsAlias = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': [ - 'open', - 'closed' - ], - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/_alias/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_alias', - req: { - index: { - type: 'list' - } - } - } - ], - method: 'HEAD' -}); - -/** - * Perform a [indices.existsTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.name - The name of the template - */ -api.indices.prototype.existsTemplate = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - local: { - type: 'boolean' - } - }, - url: { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [indices.existsType](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-types-exists.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` to check the types across all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to check - */ -api.indices.prototype.existsType = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - url: { - fmt: '/<%=index%>/_mapping/<%=type%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [indices.flush](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-flush.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.force - Whether a flush should be forced even if it is not necessarily needed ie. if no changes will be committed to the index. This is useful if transaction log IDs should be incremented even if no uncommitted changes are present. (This setting can be considered as internal) - * @param {<>} params.waitIfOngoing - If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. The default is true. If set to false the flush will be skipped iff if another flush operation is already running. - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string for all indices - */ -api.indices.prototype.flush = ca({ - params: { - force: { - type: 'boolean' - }, - waitIfOngoing: { - type: 'boolean', - name: 'wait_if_ongoing' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_flush', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_flush' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.flushSynced](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-synced-flush.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string for all indices - */ -api.indices.prototype.flushSynced = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_flush/synced', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_flush/synced' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.forcemerge](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-forcemerge.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flush - Specify whether the index should be flushed after performing the operation (default: true) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.maxNumSegments - The number of segments the index should be merged into (default: dynamic) - * @param {<>} params.onlyExpungeDeletes - Specify whether the operation should only expunge deleted documents - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.waitForMerge - Specify whether the request should block until the merge process is finished (default: true) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.forcemerge = ca({ - params: { - flush: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - maxNumSegments: { - type: 'number', - name: 'max_num_segments' - }, - onlyExpungeDeletes: { - type: 'boolean', - name: 'only_expunge_deletes' - }, - operationThreading: { - name: 'operation_threading' - }, - waitForMerge: { - type: 'boolean', - name: 'wait_for_merge' - } - }, - urls: [ - { - fmt: '/<%=index%>/_forcemerge', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_forcemerge' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.get](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-get-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.ignoreUnavailable - Ignore unavailable indexes (default: false) - * @param {<>} params.allowNoIndices - Ignore if a wildcard expression resolves to no concrete indices (default: false) - * @param {<>} [params.expandWildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (default: open) - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.human - Whether to return version and creation date values in human-readable format. - * @param {<>} params.includeDefaults - Whether to return all default setting for each of the indices. - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} params.feature - A comma-separated list of features - */ -api.indices.prototype.get = ca({ - params: { - local: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - human: { - type: 'boolean', - 'default': false - }, - includeDefaults: { - type: 'boolean', - 'default': false, - name: 'include_defaults' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=feature%>', - req: { - index: { - type: 'list' - }, - feature: { - type: 'list', - options: [ - '_settings', - '_mappings', - '_aliases' - ] - } - } - }, - { - fmt: '/<%=index%>', - req: { - index: { - type: 'list' - } - } - } - ] -}); - -/** - * Perform a [indices.getAlias](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=all] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names to filter aliases - * @param {<>, <>, <>} params.name - A comma-separated list of alias names to return - */ -api.indices.prototype.getAlias = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'all', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/_alias/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_alias', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_alias' - } - ] -}); - -/** - * Perform a [indices.getFieldMapping](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-get-field-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.includeDefaults - Whether the default mapping values should be returned as well - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} params.type - A comma-separated list of document types - * @param {<>, <>, <>} params.fields - A comma-separated list of fields - */ -api.indices.prototype.getFieldMapping = ca({ - params: { - includeDefaults: { - type: 'boolean', - name: 'include_defaults' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_mapping/<%=type%>/field/<%=fields%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - }, - fields: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_mapping/field/<%=fields%>', - req: { - index: { - type: 'list' - }, - fields: { - type: 'list' - } - } - }, - { - fmt: '/_mapping/<%=type%>/field/<%=fields%>', - req: { - type: { - type: 'list' - }, - fields: { - type: 'list' - } - } - }, - { - fmt: '/_mapping/field/<%=fields%>', - req: { - fields: { - type: 'list' - } - } - } - ] -}); - -/** - * Perform a [indices.getMapping](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-get-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} params.type - A comma-separated list of document types - */ -api.indices.prototype.getMapping = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_mapping/<%=type%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_mapping', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_mapping/<%=type%>', - req: { - type: { - type: 'list' - } - } - }, - { - fmt: '/_mapping' - } - ] -}); - -/** - * Perform a [indices.getSettings](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-get-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open,closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.human - Whether to return version and creation date values in human-readable format. - * @param {<>} params.includeDefaults - Whether to return all default setting for each of the indices. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.name - The name of the settings that should be included - */ -api.indices.prototype.getSettings = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': [ - 'open', - 'closed' - ], - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - local: { - type: 'boolean' - }, - human: { - type: 'boolean', - 'default': false - }, - includeDefaults: { - type: 'boolean', - 'default': false, - name: 'include_defaults' - } - }, - urls: [ - { - fmt: '/<%=index%>/_settings/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_settings', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_settings/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/_settings' - } - ] -}); - -/** - * Perform a [indices.getTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.name - The comma separated names of the index templates - */ -api.indices.prototype.getTemplate = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/_template' - } - ] -}); - -/** - * Perform a [indices.getUpgrade](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-upgrade.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.getUpgrade = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - human: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/<%=index%>/_upgrade', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_upgrade' - } - ] -}); - -/** - * Perform a [indices.open](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-open-close.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma separated list of indices to open - */ -api.indices.prototype.open = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'closed', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - url: { - fmt: '/<%=index%>/_open', - req: { - index: { - type: 'list' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [indices.putAlias](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit timestamp for the document - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices. - * @param {<>} params.name - The name of the alias to be created or updated - */ -api.indices.prototype.putAlias = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'string' - } - } - }, - method: 'PUT' -}); - -/** - * Perform a [indices.putMapping](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-put-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.updateAllTypes - Whether to update the mapping for all fields with the same name across all types or not - * @param {<>, <>, <>} params.index - A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices. - * @param {<>} params.type - The name of the document type - */ -api.indices.prototype.putMapping = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - updateAllTypes: { - type: 'boolean', - name: 'update_all_types' - } - }, - urls: [ - { - fmt: '/<%=index%>/_mapping/<%=type%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/_mapping/<%=type%>', - req: { - type: { - type: 'string' - } - } - } - ], - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [indices.putSettings](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.preserveExisting - Whether to update existing settings. If set to `true` existing settings on an index remain unchanged, the default is `false` - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.putSettings = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - preserveExisting: { - type: 'boolean', - name: 'preserve_existing' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - } - }, - urls: [ - { - fmt: '/<%=index%>/_settings', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_settings' - } - ], - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [indices.putTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.order - The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers) - * @param {<>} params.create - Whether the index template should only be added if new or can also replace an existing one - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.name - The name of the template - */ -api.indices.prototype.putTemplate = ca({ - params: { - order: { - type: 'number' - }, - create: { - type: 'boolean', - 'default': false - }, - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - } - }, - url: { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [indices.recovery](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-recovery.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.detailed - Whether to display detailed information about shard recovery - * @param {<>} params.activeOnly - Display only those recoveries that are currently on-going - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.recovery = ca({ - params: { - detailed: { - type: 'boolean', - 'default': false - }, - activeOnly: { - type: 'boolean', - 'default': false, - name: 'active_only' - }, - human: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/<%=index%>/_recovery', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_recovery' - } - ] -}); - -/** - * Perform a [indices.refresh](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-refresh.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.refresh = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_refresh', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_refresh' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.rollover](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-rollover-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.dryRun - If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for on the newly created rollover index before the operation returns. - * @param {<>} params.alias - The name of the alias to rollover - * @param {<>} params.newIndex - The name of the rollover index - */ -api.indices.prototype.rollover = ca({ - params: { - timeout: { - type: 'time' - }, - dryRun: { - type: 'boolean', - name: 'dry_run' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - } - }, - urls: [ - { - fmt: '/<%=alias%>/_rollover/<%=newIndex%>', - req: { - alias: { - type: 'string' - }, - newIndex: { - type: 'string' - } - } - }, - { - fmt: '/<%=alias%>/_rollover', - req: { - alias: { - type: 'string' - } - } - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.segments](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-segments.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.verbose - Includes detailed memory usage by Lucene. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.segments = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - human: { - type: 'boolean', - 'default': false - }, - operationThreading: { - name: 'operation_threading' - }, - verbose: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/<%=index%>/_segments', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_segments' - } - ] -}); - -/** - * Perform a [indices.shardStores](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-shards-stores.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.status - A comma-separated list of statuses used to filter on shards to get store information for - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {anything} params.operationThreading - TODO: ? - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.shardStores = ca({ - params: { - status: { - type: 'list', - options: [ - 'green', - 'yellow', - 'red', - 'all' - ] - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - operationThreading: { - name: 'operation_threading' - } - }, - urls: [ - { - fmt: '/<%=index%>/_shard_stores', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_shard_stores' - } - ] -}); - -/** - * Perform a [indices.shrink](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-shrink-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for on the shrunken index before the operation returns. - * @param {<>} params.index - The name of the source index to shrink - * @param {<>} params.target - The name of the target index to shrink into - */ -api.indices.prototype.shrink = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - } - }, - url: { - fmt: '/<%=index%>/_shrink/<%=target%>', - req: { - index: { - type: 'string' - }, - target: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [indices.stats](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.completionFields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields for `fielddata` index metric (supports wildcards) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) - * @param {<>, <>, <>} params.groups - A comma-separated list of search groups for `search` index metric - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>} [params.level=indices] - Return stats aggregated at cluster, index or shard level - * @param {<>, <>, <>} params.types - A comma-separated list of document types for the `indexing` index metric - * @param {<>} params.includeSegmentFileSizes - Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.metric - Limit the information returned the specific metrics. - */ -api.indices.prototype.stats = ca({ - params: { - completionFields: { - type: 'list', - name: 'completion_fields' - }, - fielddataFields: { - type: 'list', - name: 'fielddata_fields' - }, - fields: { - type: 'list' - }, - groups: { - type: 'list' - }, - human: { - type: 'boolean', - 'default': false - }, - level: { - type: 'enum', - 'default': 'indices', - options: [ - 'cluster', - 'indices', - 'shards' - ] - }, - types: { - type: 'list' - }, - includeSegmentFileSizes: { - type: 'boolean', - 'default': false, - name: 'include_segment_file_sizes' - } - }, - urls: [ - { - fmt: '/<%=index%>/_stats/<%=metric%>', - req: { - index: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'percolate', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/_stats/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'percolate', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/<%=index%>/_stats', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_stats' - } - ] -}); - -/** - * Perform a [indices.updateAliases](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Request timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - */ -api.indices.prototype.updateAliases = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_aliases' - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [indices.upgrade](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/indices-upgrade.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.waitForCompletion - Specify whether the request should block until the all segments are upgraded (default: false) - * @param {<>} params.onlyAncientSegments - If true, only ancient (an older Lucene major release) segments will be upgraded - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.upgrade = ca({ - params: { - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - waitForCompletion: { - type: 'boolean', - name: 'wait_for_completion' - }, - onlyAncientSegments: { - type: 'boolean', - name: 'only_ancient_segments' - } - }, - urls: [ - { - fmt: '/<%=index%>/_upgrade', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_upgrade' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.validateQuery](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-validate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.explain - Return detailed information about the error - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.rewrite - Provide a more detailed explanation showing the actual Lucene query that will be executed. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to restrict the operation; leave empty to perform the operation on all types - */ -api.indices.prototype.validateQuery = ca({ - params: { - explain: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - operationThreading: { - name: 'operation_threading' - }, - q: { - type: 'string' - }, - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - lenient: { - type: 'boolean' - }, - rewrite: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_validate/query', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_validate/query', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_validate/query' - } - ], - method: 'POST' -}); - -/** - * Perform a [info](https://www.elastic.co/guide/) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.info = ca({ - url: { - fmt: '/' - } -}); - -api.ingest = namespace(); - -/** - * Perform a [ingest.deletePipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/5.1/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.id - Pipeline ID - */ -api.ingest.prototype.deletePipeline = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_ingest/pipeline/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [ingest.getPipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/5.1/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.id - Comma separated list of pipeline ids. Wildcards supported - */ -api.ingest.prototype.getPipeline = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - urls: [ - { - fmt: '/_ingest/pipeline/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - { - fmt: '/_ingest/pipeline' - } - ] -}); - -/** - * Perform a [ingest.putPipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/5.1/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.id - Pipeline ID - */ -api.ingest.prototype.putPipeline = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_ingest/pipeline/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [ingest.simulate](https://www.elastic.co/guide/en/elasticsearch/plugins/5.1/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.verbose - Verbose mode. Display data output for each processor in executed pipeline - * @param {<>} params.id - Pipeline ID - */ -api.ingest.prototype.simulate = ca({ - params: { - verbose: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_ingest/pipeline/<%=id%>/_simulate', - req: { - id: { - type: 'string' - } - } - }, - { - fmt: '/_ingest/pipeline/_simulate' - } - ], - needBody: true, - method: 'POST' -}); - -/** - * Perform a [mget](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-multi-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.mget = ca({ - params: { - storedFields: { - type: 'list', - name: 'stored_fields' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_mget', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_mget', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_mget' - } - ], - needBody: true, - method: 'POST' -}); - -/** - * Perform a [mpercolate](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-percolate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.index - The index of the document being count percolated to use as default - * @param {<>} params.type - The type of the document being percolated to use as default. - */ -api.mpercolate = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_mpercolate', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_mpercolate', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_mpercolate' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -/** - * Perform a [msearch](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-multi-search.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.searchType - Search operation type - * @param {<>} params.maxConcurrentSearches - Controls the maximum number of concurrent searches the multi search api will execute - * @param {<>, <>, <>} params.index - A comma-separated list of index names to use as default - * @param {<>, <>, <>} params.type - A comma-separated list of document types to use as default - */ -api.msearch = ca({ - params: { - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'query_and_fetch', - 'dfs_query_then_fetch', - 'dfs_query_and_fetch' - ], - name: 'search_type' - }, - maxConcurrentSearches: { - type: 'number', - name: 'max_concurrent_searches' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_msearch', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_msearch', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_msearch' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -/** - * Perform a [msearchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.searchType - Search operation type - * @param {<>, <>, <>} params.index - A comma-separated list of index names to use as default - * @param {<>, <>, <>} params.type - A comma-separated list of document types to use as default - */ -api.msearchTemplate = ca({ - params: { - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'query_and_fetch', - 'dfs_query_then_fetch', - 'dfs_query_and_fetch' - ], - name: 'search_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_msearch/template', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_msearch/template', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_msearch/template' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -/** - * Perform a [mtermvectors](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-multi-termvectors.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.ids - A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body - * @param {<>} params.termStatistics - Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.fieldStatistics=true] - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.offsets=true] - Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.positions=true] - Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.payloads=true] - Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) .Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.routing - Specific routing value. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.parent - Parent id of documents. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.realtime - Specifies if requests are real-time as opposed to near-real-time (default: true). - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index in which the document resides. - * @param {<>} params.type - The type of the document. - */ -api.mtermvectors = ca({ - params: { - ids: { - type: 'list', - required: false - }, - termStatistics: { - type: 'boolean', - 'default': false, - required: false, - name: 'term_statistics' - }, - fieldStatistics: { - type: 'boolean', - 'default': true, - required: false, - name: 'field_statistics' - }, - fields: { - type: 'list', - required: false - }, - offsets: { - type: 'boolean', - 'default': true, - required: false - }, - positions: { - type: 'boolean', - 'default': true, - required: false - }, - payloads: { - type: 'boolean', - 'default': true, - required: false - }, - preference: { - type: 'string', - required: false - }, - routing: { - type: 'string', - required: false - }, - parent: { - type: 'string', - required: false - }, - realtime: { - type: 'boolean', - required: false - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_mtermvectors', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_mtermvectors', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_mtermvectors' - } - ], - method: 'POST' -}); - -api.nodes = namespace(); - -/** - * Perform a [nodes.hotThreads](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cluster-nodes-hot-threads.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.interval - The interval for the second sampling of threads - * @param {<>} params.snapshots - Number of samples of thread stacktrace (default: 10) - * @param {<>} params.threads - Specify the number of threads to provide information for (default: 3) - * @param {<>} params.ignoreIdleThreads - Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue (default: true) - * @param {<>} params.type - The type to sample (default: cpu) - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - */ -api.nodes.prototype.hotThreads = ca({ - params: { - interval: { - type: 'time' - }, - snapshots: { - type: 'number' - }, - threads: { - type: 'number' - }, - ignoreIdleThreads: { - type: 'boolean', - name: 'ignore_idle_threads' - }, - type: { - type: 'enum', - options: [ - 'cpu', - 'wait', - 'block' - ] - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_nodes/<%=nodeId%>/hotthreads', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_nodes/hotthreads' - } - ] -}); - -/** - * Perform a [nodes.info](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cluster-nodes-info.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.metric - A comma-separated list of metrics you wish returned. Leave empty to return all. - */ -api.nodes.prototype.info = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - human: { - type: 'boolean', - 'default': false - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_nodes/<%=nodeId%>/<%=metric%>', - req: { - nodeId: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - 'settings', - 'os', - 'process', - 'jvm', - 'thread_pool', - 'transport', - 'http', - 'plugins', - 'ingest' - ] - } - } - }, - { - fmt: '/_nodes/<%=nodeId%>', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_nodes/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - 'settings', - 'os', - 'process', - 'jvm', - 'thread_pool', - 'transport', - 'http', - 'plugins', - 'ingest' - ] - } - } - }, - { - fmt: '/_nodes' - } - ] -}); - -/** - * Perform a [nodes.stats](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/cluster-nodes-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.completionFields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields for `fielddata` index metric (supports wildcards) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) - * @param {<>} params.groups - A comma-separated list of search groups for `search` index metric - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>} [params.level=node] - Return indices stats aggregated at index, node or shard level - * @param {<>, <>, <>} params.types - A comma-separated list of document types for the `indexing` index metric - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.includeSegmentFileSizes - Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics - * @param {<>, <>, <>} params.indexMetric - Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified. - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - */ -api.nodes.prototype.stats = ca({ - params: { - completionFields: { - type: 'list', - name: 'completion_fields' - }, - fielddataFields: { - type: 'list', - name: 'fielddata_fields' - }, - fields: { - type: 'list' - }, - groups: { - type: 'boolean' - }, - human: { - type: 'boolean', - 'default': false - }, - level: { - type: 'enum', - 'default': 'node', - options: [ - 'indices', - 'node', - 'shards' - ] - }, - types: { - type: 'list' - }, - timeout: { - type: 'time' - }, - includeSegmentFileSizes: { - type: 'boolean', - 'default': false, - name: 'include_segment_file_sizes' - } - }, - urls: [ - { - fmt: '/_nodes/<%=nodeId%>/stats/<%=metric%>/<%=indexMetric%>', - req: { - nodeId: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport', - 'discovery' - ] - }, - indexMetric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'percolate', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/_nodes/<%=nodeId%>/stats/<%=metric%>', - req: { - nodeId: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport', - 'discovery' - ] - } - } - }, - { - fmt: '/_nodes/stats/<%=metric%>/<%=indexMetric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport', - 'discovery' - ] - }, - indexMetric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'percolate', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/_nodes/<%=nodeId%>/stats', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_nodes/stats/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport', - 'discovery' - ] - } - } - }, - { - fmt: '/_nodes/stats' - } - ] -}); - -/** - * Perform a [percolate](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-percolate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.percolateIndex - The index to percolate the document into. Defaults to index. - * @param {<>} params.percolateType - The type to percolate document into. Defaults to type. - * @param {<>} params.percolateRouting - The routing value to use when percolating the existing document. - * @param {<>} params.percolatePreference - Which shard to prefer when executing the percolate request. - * @param {<>} params.percolateFormat - Return an array of matching query IDs instead of objects - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index of the document being percolated. - * @param {<>} params.type - The type of the document being percolated. - * @param {<>} params.id - Substitute the document in the request body with a document that is known by the specified id. On top of the id, the index and type parameter will be used to retrieve the document from within the cluster. - */ -api.percolate = ca({ - params: { - routing: { - type: 'list' - }, - preference: { - type: 'string' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - percolateIndex: { - type: 'string', - name: 'percolate_index' - }, - percolateType: { - type: 'string', - name: 'percolate_type' - }, - percolateRouting: { - type: 'string', - name: 'percolate_routing' - }, - percolatePreference: { - type: 'string', - name: 'percolate_preference' - }, - percolateFormat: { - type: 'enum', - options: [ - 'ids' - ], - name: 'percolate_format' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_percolate', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/<%=type%>/_percolate', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - } - ], - method: 'POST' -}); - -/** - * Perform a [ping](https://www.elastic.co/guide/) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.ping = ca({ - url: { - fmt: '/' - }, - requestTimeout: 3000, - method: 'HEAD' -}); - -/** - * Perform a [putScript](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Script ID - * @param {<>} params.lang - Script language - */ -api.putScript = ca({ - url: { - fmt: '/_scripts/<%=lang%>/<%=id%>', - req: { - lang: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [putTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Template ID - */ -api.putTemplate = ca({ - url: { - fmt: '/_search/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [reindex](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-reindex.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the reindex operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.waitForCompletion - Should the request should block until the reindex is complete. - * @param {<>} params.requestsPerSecond - The throttle to set on this request in sub-requests per second. -1 means no throttle. - * @param {<>} [params.slices=1] - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. - */ -api.reindex = ca({ - params: { - refresh: { - type: 'boolean' - }, - timeout: { - type: 'time', - 'default': '1m' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - waitForCompletion: { - type: 'boolean', - 'default': false, - name: 'wait_for_completion' - }, - requestsPerSecond: { - type: 'number', - 'default': 0, - name: 'requests_per_second' - }, - slices: { - type: 'integer', - 'default': 1 - } - }, - url: { - fmt: '/_reindex' - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [reindexRethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-reindex.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.requestsPerSecond - The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. - * @param {<>} params.taskId - The task id to rethrottle - */ -api.reindexRethrottle = ca({ - params: { - requestsPerSecond: { - type: 'number', - required: true, - name: 'requests_per_second' - } - }, - url: { - fmt: '/_reindex/<%=taskId%>/_rethrottle', - req: { - taskId: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [renderSearchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - The id of the stored search template - */ -api.renderSearchTemplate = ca({ - urls: [ - { - fmt: '/_render/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - { - fmt: '/_render/template' - } - ], - method: 'POST' -}); - -/** - * Perform a [scroll](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-request-scroll.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.scrollId - The scroll ID - */ -api.scroll = ca({ - params: { - scroll: { - type: 'time' - }, - scrollId: { - type: 'string', - name: 'scroll_id' - } - }, - urls: [ - { - fmt: '/_search/scroll/<%=scrollId%>', - req: { - scrollId: { - type: 'string' - } - } - }, - { - fmt: '/_search/scroll' - } - ], - paramAsBody: { - param: 'scrollId', - body: 'scroll_id' - }, - method: 'POST' -}); - -/** - * Perform a [search](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-search.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.explain - Specify whether to return detailed information about score computation as part of a hit - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return as part of a hit - * @param {<>, <>, <>} params.docvalueFields - A comma-separated list of fields to return as the docvalue representation of a field for each hit - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields to return as the docvalue representation of a field for each hit - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.suggestField - Specify which field to use for suggestions - * @param {<>} [params.suggestMode=missing] - Specify suggest mode - * @param {<>} params.suggestSize - How many suggestions to return in response - * @param {<>} params.suggestText - The source text for which the suggestions should be returned - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.trackScores - Whether to calculate and return scores even if they are not used for sorting - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.search = ca({ - params: { - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - explain: { - type: 'boolean' - }, - storedFields: { - type: 'list', - name: 'stored_fields' - }, - docvalueFields: { - type: 'list', - name: 'docvalue_fields' - }, - fielddataFields: { - type: 'list', - name: 'fielddata_fields' - }, - from: { - type: 'number' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - lenient: { - type: 'boolean' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'dfs_query_then_fetch' - ], - name: 'search_type' - }, - size: { - type: 'number' - }, - sort: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - terminateAfter: { - type: 'number', - name: 'terminate_after' - }, - stats: { - type: 'list' - }, - suggestField: { - type: 'string', - name: 'suggest_field' - }, - suggestMode: { - type: 'enum', - 'default': 'missing', - options: [ - 'missing', - 'popular', - 'always' - ], - name: 'suggest_mode' - }, - suggestSize: { - type: 'number', - name: 'suggest_size' - }, - suggestText: { - type: 'string', - name: 'suggest_text' - }, - timeout: { - type: 'time' - }, - trackScores: { - type: 'boolean', - name: 'track_scores' - }, - version: { - type: 'boolean' - }, - requestCache: { - type: 'boolean', - name: 'request_cache' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_search', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_search', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_search' - } - ], - method: 'POST' -}); - -/** - * Perform a [searchShards](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-shards.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.searchShards = ca({ - params: { - preference: { - type: 'string' - }, - routing: { - type: 'string' - }, - local: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_search_shards', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_search_shards', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_search_shards' - } - ], - method: 'POST' -}); - -/** - * Perform a [searchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.explain - Specify whether to return detailed information about score computation as part of a hit - * @param {<>} params.profile - Specify whether to profile the query execution - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.searchTemplate = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - preference: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'query_and_fetch', - 'dfs_query_then_fetch', - 'dfs_query_and_fetch' - ], - name: 'search_type' - }, - explain: { - type: 'boolean' - }, - profile: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_search/template', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_search/template', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_search/template' - } - ], - method: 'POST' -}); - -api.snapshot = namespace(); - -/** - * Perform a [snapshot.create](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.waitForCompletion - Should this request wait until the operation has completed before returning - * @param {<>} params.repository - A repository name - * @param {<>} params.snapshot - A snapshot name - */ -api.snapshot.prototype.create = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForCompletion: { - type: 'boolean', - 'default': false, - name: 'wait_for_completion' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [snapshot.createRepository](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.verify - Whether to verify the repository after creation - * @param {<>} params.repository - A repository name - */ -api.snapshot.prototype.createRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - }, - verify: { - type: 'boolean' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>', - req: { - repository: { - type: 'string' - } - } - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [snapshot.delete](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.repository - A repository name - * @param {<>} params.snapshot - A snapshot name - */ -api.snapshot.prototype['delete'] = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [snapshot.deleteRepository](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.repository - A comma-separated list of repository names - */ -api.snapshot.prototype.deleteRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>', - req: { - repository: { - type: 'list' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [snapshot.get](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.ignoreUnavailable - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown - * @param {<>} params.repository - A repository name - * @param {<>, <>, <>} params.snapshot - A comma-separated list of snapshot names - */ -api.snapshot.prototype.get = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'list' - } - } - } -}); - -/** - * Perform a [snapshot.getRepository](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.repository - A comma-separated list of repository names - */ -api.snapshot.prototype.getRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/_snapshot/<%=repository%>', - req: { - repository: { - type: 'list' - } - } - }, - { - fmt: '/_snapshot' - } - ] -}); - -/** - * Perform a [snapshot.restore](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.waitForCompletion - Should this request wait until the operation has completed before returning - * @param {<>} params.repository - A repository name - * @param {<>} params.snapshot - A snapshot name - */ -api.snapshot.prototype.restore = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForCompletion: { - type: 'boolean', - 'default': false, - name: 'wait_for_completion' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>/_restore', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [snapshot.status](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.ignoreUnavailable - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown - * @param {<>} params.repository - A repository name - * @param {<>, <>, <>} params.snapshot - A comma-separated list of snapshot names - */ -api.snapshot.prototype.status = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - } - }, - urls: [ - { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>/_status', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'list' - } - } - }, - { - fmt: '/_snapshot/<%=repository%>/_status', - req: { - repository: { - type: 'string' - } - } - }, - { - fmt: '/_snapshot/_status' - } - ] -}); - -/** - * Perform a [snapshot.verifyRepository](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.repository - A repository name - */ -api.snapshot.prototype.verifyRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/_verify', - req: { - repository: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [suggest](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/search-suggesters.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params.index - A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices - */ -api.suggest = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - preference: { - type: 'string' - }, - routing: { - type: 'string' - } - }, - urls: [ - { - fmt: '/<%=index%>/_suggest', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_suggest' - } - ], - needBody: true, - method: 'POST' -}); - -api.tasks = namespace(); - -/** - * Perform a [tasks.cancel](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.actions - A comma-separated list of actions that should be cancelled. Leave empty to cancel all. - * @param {<>} params.parentNode - Cancel tasks with specified parent node. - * @param {<>} params.parentTask - Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all. - * @param {<>} params.taskId - Cancel the task with specified task id (node_id:task_number) - */ -api.tasks.prototype.cancel = ca({ - params: { - nodeId: { - type: 'list', - name: 'node_id' - }, - actions: { - type: 'list' - }, - parentNode: { - type: 'string', - name: 'parent_node' - }, - parentTask: { - type: 'string', - name: 'parent_task' - } - }, - urls: [ - { - fmt: '/_tasks/<%=taskId%>/_cancel', - req: { - taskId: { - type: 'string' - } - } - }, - { - fmt: '/_tasks/_cancel' - } - ], - method: 'POST' -}); - -/** - * Perform a [tasks.get](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForCompletion - Wait for the matching tasks to complete (default: false) - * @param {<>} params.taskId - Return the task with specified id (node_id:task_number) - */ -api.tasks.prototype.get = ca({ - params: { - waitForCompletion: { - type: 'boolean', - name: 'wait_for_completion' - } - }, - url: { - fmt: '/_tasks/<%=taskId%>', - req: { - taskId: { - type: 'string' - } - } - } -}); - -/** - * Perform a [tasks.list](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.actions - A comma-separated list of actions that should be returned. Leave empty to return all. - * @param {<>} params.detailed - Return detailed task information (default: false) - * @param {<>} params.parentNode - Return tasks with specified parent node. - * @param {<>} params.parentTask - Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all. - * @param {<>} params.waitForCompletion - Wait for the matching tasks to complete (default: false) - * @param {<>} [params.groupBy=nodes] - Group tasks by nodes or parent/child relationships - */ -api.tasks.prototype.list = ca({ - params: { - nodeId: { - type: 'list', - name: 'node_id' - }, - actions: { - type: 'list' - }, - detailed: { - type: 'boolean' - }, - parentNode: { - type: 'string', - name: 'parent_node' - }, - parentTask: { - type: 'string', - name: 'parent_task' - }, - waitForCompletion: { - type: 'boolean', - name: 'wait_for_completion' - }, - groupBy: { - type: 'enum', - 'default': 'nodes', - options: [ - 'nodes', - 'parents' - ], - name: 'group_by' - } - }, - url: { - fmt: '/_tasks' - } -}); - -/** - * Perform a [termvectors](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-termvectors.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.termStatistics - Specifies if total term frequency and document frequency should be returned. - * @param {<>} [params.fieldStatistics=true] - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return. - * @param {<>} [params.offsets=true] - Specifies if term offsets should be returned. - * @param {<>} [params.positions=true] - Specifies if term positions should be returned. - * @param {<>} [params.payloads=true] - Specifies if term payloads should be returned. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random). - * @param {<>} params.routing - Specific routing value. - * @param {<>} params.parent - Parent id of documents. - * @param {<>} params.realtime - Specifies if request is real-time as opposed to near-real-time (default: true). - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index in which the document resides. - * @param {<>} params.type - The type of the document. - * @param {<>} params.id - The id of the document, when not specified a doc param should be supplied. - */ -api.termvectors = ca({ - params: { - termStatistics: { - type: 'boolean', - 'default': false, - required: false, - name: 'term_statistics' - }, - fieldStatistics: { - type: 'boolean', - 'default': true, - required: false, - name: 'field_statistics' - }, - fields: { - type: 'list', - required: false - }, - offsets: { - type: 'boolean', - 'default': true, - required: false - }, - positions: { - type: 'boolean', - 'default': true, - required: false - }, - payloads: { - type: 'boolean', - 'default': true, - required: false - }, - preference: { - type: 'string', - required: false - }, - routing: { - type: 'string', - required: false - }, - parent: { - type: 'string', - required: false - }, - realtime: { - type: 'boolean', - required: false - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_termvectors', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/<%=type%>/_termvectors', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - } - ], - method: 'POST' -}); - -/** - * Perform a [update](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-update.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the update operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return in the response - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.lang - The script language (default: painless) - * @param {<>} params.parent - ID of the parent document. Is is only used for routing and when for the upsert request - * @param {<>} params.refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.retryOnConflict - Specify how many times should the operation be retried when a conflict occurs (default: 0) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.update = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - fields: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - lang: { - type: 'string' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - retryOnConflict: { - type: 'number', - name: 'retry_on_conflict' - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - timestamp: { - type: 'time' - }, - ttl: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_update', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [updateByQuery](https://www.elastic.co/guide/en/elasticsearch/reference/5.1/docs-update-by-query.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.conflicts=abort] - What to do when the update by query hits version conflicts? - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.pipeline - Ingest pipeline to set on index requests made by this action. (default: none) - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.searchTimeout - Explicit timeout for each search request. Defaults to no timeout. - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.versionType - Should the document increment the version number (internal) on hit or not (reindex) - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the update by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.scrollSize - Size on the scroll request powering the update_by_query - * @param {<>} params.waitForCompletion - Should the request should block until the update by query operation is complete. - * @param {<>} params.requestsPerSecond - The throttle to set on this request in sub-requests per second. -1 means no throttle. - * @param {<>} [params.slices=1] - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.updateByQuery = ca({ - params: { - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - from: { - type: 'number' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - conflicts: { - type: 'enum', - 'default': 'abort', - options: [ - 'abort', - 'proceed' - ] - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - lenient: { - type: 'boolean' - }, - pipeline: { - type: 'string' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'dfs_query_then_fetch' - ], - name: 'search_type' - }, - searchTimeout: { - type: 'time', - name: 'search_timeout' - }, - size: { - type: 'number' - }, - sort: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - terminateAfter: { - type: 'number', - name: 'terminate_after' - }, - stats: { - type: 'list' - }, - version: { - type: 'boolean' - }, - versionType: { - type: 'boolean', - name: 'version_type' - }, - requestCache: { - type: 'boolean', - name: 'request_cache' - }, - refresh: { - type: 'boolean' - }, - timeout: { - type: 'time', - 'default': '1m' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - scrollSize: { - type: 'number', - name: 'scroll_size' - }, - waitForCompletion: { - type: 'boolean', - 'default': false, - name: 'wait_for_completion' - }, - requestsPerSecond: { - type: 'number', - 'default': 0, - name: 'requests_per_second' - }, - slices: { - type: 'integer', - 'default': 1 - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_update_by_query', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_update_by_query', - req: { - index: { - type: 'list' - } - } - } - ], - method: 'POST' -}); diff --git a/src/lib/apis/5_2.js b/src/lib/apis/5_2.js deleted file mode 100644 index 93125c76f..000000000 --- a/src/lib/apis/5_2.js +++ /dev/null @@ -1,7150 +0,0 @@ -var ca = require('../client_action').makeFactoryWithModifier(function (spec) { - return require('../utils').merge(spec, { - params: { - filterPath: { - type: 'list', - name: 'filter_path' - } - } - }); -}); -var namespace = require('../client_action').namespaceFactory; -var api = module.exports = {}; - -api._namespaces = ['cat', 'cluster', 'indices', 'ingest', 'nodes', 'snapshot', 'tasks']; - -/** - * Perform a [bulk](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-bulk.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the bulk operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.type - Default document type for items which don't provide one - * @param {<>, <>, <>} params.fields - Default comma-separated list of fields to return in the response for updates, can be overridden on each sub-request - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request - * @param {<>, <>, <>} params._sourceExclude - Default list of fields to exclude from the returned _source field, can be overridden on each sub-request - * @param {<>, <>, <>} params._sourceInclude - Default list of fields to extract and return from the _source field, can be overridden on each sub-request - * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with - * @param {<>} params.index - Default index for items which don't provide one - */ -api.bulk = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - type: { - type: 'string' - }, - fields: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - pipeline: { - type: 'string' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_bulk', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_bulk', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_bulk' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -api.cat = namespace(); - -/** - * Perform a [cat.aliases](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.name - A comma-separated list of alias names to return - */ -api.cat.prototype.aliases = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/aliases/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/_cat/aliases' - } - ] -}); - -/** - * Perform a [cat.allocation](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-allocation.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information - */ -api.cat.prototype.allocation = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'kb', - 'm', - 'mb', - 'g', - 'gb', - 't', - 'tb', - 'p', - 'pb' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/allocation/<%=nodeId%>', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_cat/allocation' - } - ] -}); - -/** - * Perform a [cat.count](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-count.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.count = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/count/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/count' - } - ] -}); - -/** - * Perform a [cat.fielddata](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-fielddata.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return the fielddata size - */ -api.cat.prototype.fielddata = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'kb', - 'm', - 'mb', - 'g', - 'gb', - 't', - 'tb', - 'p', - 'pb' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - }, - fields: { - type: 'list' - } - }, - urls: [ - { - fmt: '/_cat/fielddata/<%=fields%>', - req: { - fields: { - type: 'list' - } - } - }, - { - fmt: '/_cat/fielddata' - } - ] -}); - -/** - * Perform a [cat.health](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-health.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} [params.ts=true] - Set to false to disable timestamping - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.health = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - ts: { - type: 'boolean', - 'default': true - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/health' - } -}); - -/** - * Perform a [cat.help](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - */ -api.cat.prototype.help = ca({ - params: { - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - } - }, - url: { - fmt: '/_cat' - } -}); - -/** - * Perform a [cat.indices](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-indices.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.health - A health status ("green", "yellow", or "red" to filter only indices matching the specified health status - * @param {<>} params.help - Return help information - * @param {<>} params.pri - Set to true to return stats only for primary shards - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.indices = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'm', - 'g' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - health: { - type: 'enum', - 'default': null, - options: [ - 'green', - 'yellow', - 'red' - ] - }, - help: { - type: 'boolean', - 'default': false - }, - pri: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/indices/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/indices' - } - ] -}); - -/** - * Perform a [cat.master](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-master.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.master = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/master' - } -}); - -/** - * Perform a [cat.nodeattrs](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-nodeattrs.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.nodeattrs = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/nodeattrs' - } -}); - -/** - * Perform a [cat.nodes](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-nodes.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.fullId - Return the full node ID instead of the shortened version (default: false) - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.nodes = ca({ - params: { - format: { - type: 'string' - }, - fullId: { - type: 'boolean', - name: 'full_id' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/nodes' - } -}); - -/** - * Perform a [cat.pendingTasks](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-pending-tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.pendingTasks = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/pending_tasks' - } -}); - -/** - * Perform a [cat.plugins](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-plugins.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.plugins = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/plugins' - } -}); - -/** - * Perform a [cat.recovery](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-recovery.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.recovery = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'kb', - 'm', - 'mb', - 'g', - 'gb', - 't', - 'tb', - 'p', - 'pb' - ] - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/recovery/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/recovery' - } - ] -}); - -/** - * Perform a [cat.repositories](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-repositories.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.repositories = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean', - 'default': false - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/repositories' - } -}); - -/** - * Perform a [cat.segments](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-segments.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.segments = ca({ - params: { - format: { - type: 'string' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/segments/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/segments' - } - ] -}); - -/** - * Perform a [cat.shards](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-shards.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.shards = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/shards/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/shards' - } - ] -}); - -/** - * Perform a [cat.snapshots](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.ignoreUnavailable - Set to true to ignore unavailable snapshots - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.repository - Name of repository from which to fetch the snapshot information - */ -api.cat.prototype.snapshots = ca({ - params: { - format: { - type: 'string' - }, - ignoreUnavailable: { - type: 'boolean', - 'default': false, - name: 'ignore_unavailable' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/snapshots/<%=repository%>', - req: { - repository: { - type: 'list' - } - } - }, - { - fmt: '/_cat/snapshots' - } - ] -}); - -/** - * Perform a [cat.tasks](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.actions - A comma-separated list of actions that should be returned. Leave empty to return all. - * @param {<>} params.detailed - Return detailed task information (default: false) - * @param {<>} params.parentNode - Return tasks with specified parent node. - * @param {<>} params.parentTask - Return tasks with specified parent task id. Set to -1 to return all. - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.tasks = ca({ - params: { - format: { - type: 'string' - }, - nodeId: { - type: 'list', - name: 'node_id' - }, - actions: { - type: 'list' - }, - detailed: { - type: 'boolean' - }, - parentNode: { - type: 'string', - name: 'parent_node' - }, - parentTask: { - type: 'number', - name: 'parent_task' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/tasks' - } -}); - -/** - * Perform a [cat.templates](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>} params.name - A pattern that returned template names must match - */ -api.cat.prototype.templates = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/templates/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - { - fmt: '/_cat/templates' - } - ] -}); - -/** - * Perform a [cat.threadPool](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cat-thread-pool.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.size - The multiplier in which to display values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.threadPoolPatterns - A comma-separated list of regular-expressions to filter the thread pools in the output - */ -api.cat.prototype.threadPool = ca({ - params: { - format: { - type: 'string' - }, - size: { - type: 'enum', - options: [ - '', - 'k', - 'm', - 'g', - 't', - 'p' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/thread_pool/<%=threadPoolPatterns%>', - req: { - threadPoolPatterns: { - type: 'list' - } - } - }, - { - fmt: '/_cat/thread_pool' - } - ] -}); - -/** - * Perform a [clearScroll](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-request-scroll.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.scrollId - A comma-separated list of scroll IDs to clear - */ -api.clearScroll = ca({ - urls: [ - { - fmt: '/_search/scroll/<%=scrollId%>', - req: { - scrollId: { - type: 'list' - } - } - }, - { - fmt: '/_search/scroll' - } - ], - paramAsBody: { - param: 'scrollId', - body: 'scroll_id', - castToArray: true - }, - method: 'DELETE' -}); - -api.cluster = namespace(); - -/** - * Perform a [cluster.allocationExplain](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cluster-allocation-explain.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.includeYesDecisions - Return 'YES' decisions in explanation (default: false) - * @param {<>} params.includeDiskInfo - Return information about disk usage and shard sizes (default: false) - */ -api.cluster.prototype.allocationExplain = ca({ - params: { - includeYesDecisions: { - type: 'boolean', - name: 'include_yes_decisions' - }, - includeDiskInfo: { - type: 'boolean', - name: 'include_disk_info' - } - }, - url: { - fmt: '/_cluster/allocation/explain' - }, - method: 'POST' -}); - -/** - * Perform a [cluster.getSettings](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cluster-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.includeDefaults - Whether to return all default clusters setting. - */ -api.cluster.prototype.getSettings = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - }, - includeDefaults: { - type: 'boolean', - 'default': false, - name: 'include_defaults' - } - }, - url: { - fmt: '/_cluster/settings' - } -}); - -/** - * Perform a [cluster.health](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cluster-health.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} [params.level=cluster] - Specify the level of detail for returned information - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.waitForActiveShards - Wait until the specified number of shards is active - * @param {<>} params.waitForNodes - Wait until the specified number of nodes is available - * @param {<>} params.waitForEvents - Wait until all currently queued events with the given priority are processed - * @param {<>} params.waitForNoRelocatingShards - Whether to wait until there are no relocating shards in the cluster - * @param {<>} params.waitForStatus - Wait until cluster is in a specific state - * @param {<>, <>, <>} params.index - Limit the information returned to a specific index - */ -api.cluster.prototype.health = ca({ - params: { - level: { - type: 'enum', - 'default': 'cluster', - options: [ - 'cluster', - 'indices', - 'shards' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - waitForNodes: { - type: 'string', - name: 'wait_for_nodes' - }, - waitForEvents: { - type: 'enum', - options: [ - 'immediate', - 'urgent', - 'high', - 'normal', - 'low', - 'languid' - ], - name: 'wait_for_events' - }, - waitForNoRelocatingShards: { - type: 'boolean', - name: 'wait_for_no_relocating_shards' - }, - waitForStatus: { - type: 'enum', - 'default': null, - options: [ - 'green', - 'yellow', - 'red' - ], - name: 'wait_for_status' - } - }, - urls: [ - { - fmt: '/_cluster/health/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cluster/health' - } - ] -}); - -/** - * Perform a [cluster.pendingTasks](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cluster-pending.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Specify timeout for connection to master - */ -api.cluster.prototype.pendingTasks = ca({ - params: { - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_cluster/pending_tasks' - } -}); - -/** - * Perform a [cluster.putSettings](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cluster-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - */ -api.cluster.prototype.putSettings = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_cluster/settings' - }, - method: 'PUT' -}); - -/** - * Perform a [cluster.reroute](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cluster-reroute.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.dryRun - Simulate the operation only and return the resulting state - * @param {<>} params.explain - Return an explanation of why the commands can or cannot be executed - * @param {<>} params.retryFailed - Retries allocation of shards that are blocked due to too many subsequent allocation failures - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics. Defaults to all but metadata - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - */ -api.cluster.prototype.reroute = ca({ - params: { - dryRun: { - type: 'boolean', - name: 'dry_run' - }, - explain: { - type: 'boolean' - }, - retryFailed: { - type: 'boolean', - name: 'retry_failed' - }, - metric: { - type: 'list', - options: [ - '_all', - 'blocks', - 'metadata', - 'nodes', - 'routing_table', - 'master_node', - 'version' - ] - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_cluster/reroute' - }, - method: 'POST' -}); - -/** - * Perform a [cluster.state](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cluster-state.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics - */ -api.cluster.prototype.state = ca({ - params: { - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/_cluster/state/<%=metric%>/<%=index%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'blocks', - 'metadata', - 'nodes', - 'routing_table', - 'routing_nodes', - 'master_node', - 'version' - ] - }, - index: { - type: 'list' - } - } - }, - { - fmt: '/_cluster/state/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'blocks', - 'metadata', - 'nodes', - 'routing_table', - 'routing_nodes', - 'master_node', - 'version' - ] - } - } - }, - { - fmt: '/_cluster/state' - } - ] -}); - -/** - * Perform a [cluster.stats](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cluster-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - */ -api.cluster.prototype.stats = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - human: { - type: 'boolean', - 'default': false - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_cluster/stats/nodes/<%=nodeId%>', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_cluster/stats' - } - ] -}); - -/** - * Perform a [count](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-count.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.minScore - Include only documents with a specific `_score` value in the result - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>, <>, <>} params.index - A comma-separated list of indices to restrict the results - * @param {<>, <>, <>} params.type - A comma-separated list of types to restrict the results - */ -api.count = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - minScore: { - type: 'number', - name: 'min_score' - }, - preference: { - type: 'string' - }, - routing: { - type: 'string' - }, - q: { - type: 'string' - }, - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - lenient: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_count', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_count', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_count' - } - ], - method: 'POST' -}); - -/** - * Perform a [countPercolate](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-percolate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.percolateIndex - The index to count percolate the document into. Defaults to index. - * @param {<>} params.percolateType - The type to count percolate document into. Defaults to type. - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index of the document being count percolated. - * @param {<>} params.type - The type of the document being count percolated. - * @param {<>} params.id - Substitute the document in the request body with a document that is known by the specified id. On top of the id, the index and type parameter will be used to retrieve the document from within the cluster. - */ -api.countPercolate = ca({ - params: { - routing: { - type: 'list' - }, - preference: { - type: 'string' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - percolateIndex: { - type: 'string', - name: 'percolate_index' - }, - percolateType: { - type: 'string', - name: 'percolate_type' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_percolate/count', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/<%=type%>/_percolate/count', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - } - ], - method: 'POST' -}); - -/** - * Perform a [create](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-index_.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.parent - ID of the parent document - * @param {<>} params.refresh - If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.create = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - timestamp: { - type: 'time' - }, - ttl: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - }, - pipeline: { - type: 'string' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_create', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [delete](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-delete.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the delete operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.parent - ID of parent document - * @param {<>} params.refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api['delete'] = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [deleteByQuery](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-delete-by-query.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.conflicts=abort] - What to do when the delete-by-query hits version conflicts? - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.searchTimeout - Explicit timeout for each search request. Defaults to no timeout. - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the delete by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.scrollSize - Size on the scroll request powering the update_by_query - * @param {<>} params.waitForCompletion - Should the request should block until the delete-by-query is complete. - * @param {<>} params.requestsPerSecond - The throttle for this request in sub-requests per second. -1 means no throttle. - * @param {<>} [params.slices=1] - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.deleteByQuery = ca({ - params: { - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - from: { - type: 'number' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - conflicts: { - type: 'enum', - 'default': 'abort', - options: [ - 'abort', - 'proceed' - ] - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - lenient: { - type: 'boolean' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'dfs_query_then_fetch' - ], - name: 'search_type' - }, - searchTimeout: { - type: 'time', - name: 'search_timeout' - }, - size: { - type: 'number' - }, - sort: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - terminateAfter: { - type: 'number', - name: 'terminate_after' - }, - stats: { - type: 'list' - }, - version: { - type: 'boolean' - }, - requestCache: { - type: 'boolean', - name: 'request_cache' - }, - refresh: { - type: 'boolean' - }, - timeout: { - type: 'time', - 'default': '1m' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - scrollSize: { - type: 'number', - name: 'scroll_size' - }, - waitForCompletion: { - type: 'boolean', - 'default': false, - name: 'wait_for_completion' - }, - requestsPerSecond: { - type: 'number', - 'default': 0, - name: 'requests_per_second' - }, - slices: { - type: 'number', - 'default': 1 - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_delete_by_query', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_delete_by_query', - req: { - index: { - type: 'list' - } - } - } - ], - needBody: true, - method: 'POST' -}); - -/** - * Perform a [deleteScript](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Script ID - * @param {<>} params.lang - Script language - */ -api.deleteScript = ca({ - url: { - fmt: '/_scripts/<%=lang%>/<%=id%>', - req: { - lang: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [deleteTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Template ID - */ -api.deleteTemplate = ca({ - url: { - fmt: '/_search/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [exists](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document (use `_all` to fetch the first document matching the ID across all types) - */ -api.exists = ca({ - params: { - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [explain](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-explain.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzeWildcard - Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false) - * @param {<>} params.analyzer - The analyzer for the query string query - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The default field for query string query (default: _all) - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.explain = ca({ - params: { - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - analyzer: { - type: 'string' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - storedFields: { - type: 'list', - name: 'stored_fields' - }, - lenient: { - type: 'boolean' - }, - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_explain', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [fieldStats](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-field-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for to get field statistics for (min value, max value, and more) - * @param {<>} [params.level=cluster] - Defines if field stats should be returned on a per index level or on a cluster wide level - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.fieldStats = ca({ - params: { - fields: { - type: 'list' - }, - level: { - type: 'enum', - 'default': 'cluster', - options: [ - 'indices', - 'cluster' - ] - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_field_stats', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_field_stats' - } - ], - method: 'POST' -}); - -/** - * Perform a [get](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document (use `_all` to fetch the first document matching the ID across all types) - */ -api.get = ca({ - params: { - storedFields: { - type: 'list', - name: 'stored_fields' - }, - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [getScript](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Script ID - * @param {<>} params.lang - Script language - */ -api.getScript = ca({ - url: { - fmt: '/_scripts/<%=lang%>/<%=id%>', - req: { - lang: { - type: 'string' - }, - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [getSource](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document; use `_all` to fetch the first document matching the ID across all types - */ -api.getSource = ca({ - params: { - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_source', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [getTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Template ID - */ -api.getTemplate = ca({ - url: { - fmt: '/_search/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [index](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-index_.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} [params.opType=index] - Explicit operation type - * @param {<>} params.parent - ID of the parent document - * @param {<>} params.refresh - If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.index = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - opType: { - type: 'enum', - 'default': 'index', - options: [ - 'index', - 'create' - ], - name: 'op_type' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - timestamp: { - type: 'time' - }, - ttl: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - }, - pipeline: { - type: 'string' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/<%=type%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - } - ], - needBody: true, - method: 'POST' -}); - -api.indices = namespace(); - -/** - * Perform a [indices.analyze](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-analyze.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The name of the analyzer to use - * @param {<>, <>, <>} params.charFilter - A comma-separated list of character filters to use for the analysis - * @param {<>} params.field - Use the analyzer configured for this field (instead of passing the analyzer name) - * @param {<>, <>, <>} params.filter - A comma-separated list of filters to use for the analysis - * @param {<>} params.index - The name of the index to scope the operation - * @param {<>} params.preferLocal - With `true`, specify that a local shard should be used if available, with `false`, use a random shard (default: true) - * @param {<>, <>, <>} params.text - The text on which the analysis should be performed (when request body is not used) - * @param {<>} params.tokenizer - The name of the tokenizer to use for the analysis - * @param {<>} params.explain - With `true`, outputs more advanced details. (default: false) - * @param {<>, <>, <>} params.attributes - A comma-separated list of token attributes to output, this parameter works only with `explain=true` - * @param {<>} [params.format=detailed] - Format of the output - */ -api.indices.prototype.analyze = ca({ - params: { - analyzer: { - type: 'string' - }, - charFilter: { - type: 'list', - name: 'char_filter' - }, - field: { - type: 'string' - }, - filter: { - type: 'list' - }, - index: { - type: 'string' - }, - preferLocal: { - type: 'boolean', - name: 'prefer_local' - }, - text: { - type: 'list' - }, - tokenizer: { - type: 'string' - }, - explain: { - type: 'boolean' - }, - attributes: { - type: 'list' - }, - format: { - type: 'enum', - 'default': 'detailed', - options: [ - 'detailed', - 'text' - ] - } - }, - urls: [ - { - fmt: '/<%=index%>/_analyze', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_analyze' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.clearCache](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-clearcache.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.fieldData - Clear field data - * @param {<>} params.fielddata - Clear field data - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to clear when using the `field_data` parameter (default: all) - * @param {<>} params.query - Clear query caches - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index name to limit the operation - * @param {<>} params.recycler - Clear the recycler cache - * @param {<>} params.request - Clear request cache - */ -api.indices.prototype.clearCache = ca({ - params: { - fieldData: { - type: 'boolean', - name: 'field_data' - }, - fielddata: { - type: 'boolean' - }, - fields: { - type: 'list' - }, - query: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - index: { - type: 'list' - }, - recycler: { - type: 'boolean' - }, - request: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_cache/clear', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cache/clear' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.close](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-open-close.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma separated list of indices to close - */ -api.indices.prototype.close = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - url: { - fmt: '/<%=index%>/_close', - req: { - index: { - type: 'list' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [indices.create](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-create-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for before the operation returns. - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.updateAllTypes - Whether to update the mapping for all fields with the same name across all types or not - * @param {<>} params.index - The name of the index - */ -api.indices.prototype.create = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - updateAllTypes: { - type: 'boolean', - name: 'update_all_types' - } - }, - url: { - fmt: '/<%=index%>', - req: { - index: { - type: 'string' - } - } - }, - method: 'PUT' -}); - -/** - * Perform a [indices.delete](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-delete-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices - */ -api.indices.prototype['delete'] = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [indices.deleteAlias](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit timestamp for the document - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of index names (supports wildcards); use `_all` for all indices - * @param {<>, <>, <>} params.name - A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices. - */ -api.indices.prototype.deleteAlias = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [indices.deleteTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.name - The name of the template - */ -api.indices.prototype.deleteTemplate = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [indices.exists](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-exists.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of indices to check - */ -api.indices.prototype.exists = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - url: { - fmt: '/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [indices.existsAlias](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open,closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names to filter aliases - * @param {<>, <>, <>} params.name - A comma-separated list of alias names to return - */ -api.indices.prototype.existsAlias = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': [ - 'open', - 'closed' - ], - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/_alias/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_alias', - req: { - index: { - type: 'list' - } - } - } - ], - method: 'HEAD' -}); - -/** - * Perform a [indices.existsTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.name - The name of the template - */ -api.indices.prototype.existsTemplate = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - local: { - type: 'boolean' - } - }, - url: { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [indices.existsType](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-types-exists.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` to check the types across all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to check - */ -api.indices.prototype.existsType = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - url: { - fmt: '/<%=index%>/_mapping/<%=type%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [indices.flush](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-flush.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.force - Whether a flush should be forced even if it is not necessarily needed ie. if no changes will be committed to the index. This is useful if transaction log IDs should be incremented even if no uncommitted changes are present. (This setting can be considered as internal) - * @param {<>} params.waitIfOngoing - If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. The default is true. If set to false the flush will be skipped iff if another flush operation is already running. - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string for all indices - */ -api.indices.prototype.flush = ca({ - params: { - force: { - type: 'boolean' - }, - waitIfOngoing: { - type: 'boolean', - name: 'wait_if_ongoing' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_flush', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_flush' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.flushSynced](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-synced-flush.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string for all indices - */ -api.indices.prototype.flushSynced = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_flush/synced', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_flush/synced' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.forcemerge](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-forcemerge.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flush - Specify whether the index should be flushed after performing the operation (default: true) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.maxNumSegments - The number of segments the index should be merged into (default: dynamic) - * @param {<>} params.onlyExpungeDeletes - Specify whether the operation should only expunge deleted documents - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.waitForMerge - Specify whether the request should block until the merge process is finished (default: true) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.forcemerge = ca({ - params: { - flush: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - maxNumSegments: { - type: 'number', - name: 'max_num_segments' - }, - onlyExpungeDeletes: { - type: 'boolean', - name: 'only_expunge_deletes' - }, - operationThreading: { - name: 'operation_threading' - }, - waitForMerge: { - type: 'boolean', - name: 'wait_for_merge' - } - }, - urls: [ - { - fmt: '/<%=index%>/_forcemerge', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_forcemerge' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.get](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-get-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.ignoreUnavailable - Ignore unavailable indexes (default: false) - * @param {<>} params.allowNoIndices - Ignore if a wildcard expression resolves to no concrete indices (default: false) - * @param {<>} [params.expandWildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (default: open) - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.human - Whether to return version and creation date values in human-readable format. - * @param {<>} params.includeDefaults - Whether to return all default setting for each of the indices. - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} params.feature - A comma-separated list of features - */ -api.indices.prototype.get = ca({ - params: { - local: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - human: { - type: 'boolean', - 'default': false - }, - includeDefaults: { - type: 'boolean', - 'default': false, - name: 'include_defaults' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=feature%>', - req: { - index: { - type: 'list' - }, - feature: { - type: 'list', - options: [ - '_settings', - '_mappings', - '_aliases' - ] - } - } - }, - { - fmt: '/<%=index%>', - req: { - index: { - type: 'list' - } - } - } - ] -}); - -/** - * Perform a [indices.getAlias](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=all] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names to filter aliases - * @param {<>, <>, <>} params.name - A comma-separated list of alias names to return - */ -api.indices.prototype.getAlias = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'all', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/_alias/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_alias', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_alias' - } - ] -}); - -/** - * Perform a [indices.getFieldMapping](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-get-field-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.includeDefaults - Whether the default mapping values should be returned as well - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} params.type - A comma-separated list of document types - * @param {<>, <>, <>} params.fields - A comma-separated list of fields - */ -api.indices.prototype.getFieldMapping = ca({ - params: { - includeDefaults: { - type: 'boolean', - name: 'include_defaults' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_mapping/<%=type%>/field/<%=fields%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - }, - fields: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_mapping/field/<%=fields%>', - req: { - index: { - type: 'list' - }, - fields: { - type: 'list' - } - } - }, - { - fmt: '/_mapping/<%=type%>/field/<%=fields%>', - req: { - type: { - type: 'list' - }, - fields: { - type: 'list' - } - } - }, - { - fmt: '/_mapping/field/<%=fields%>', - req: { - fields: { - type: 'list' - } - } - } - ] -}); - -/** - * Perform a [indices.getMapping](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-get-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} params.type - A comma-separated list of document types - */ -api.indices.prototype.getMapping = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_mapping/<%=type%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_mapping', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_mapping/<%=type%>', - req: { - type: { - type: 'list' - } - } - }, - { - fmt: '/_mapping' - } - ] -}); - -/** - * Perform a [indices.getSettings](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-get-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open,closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.human - Whether to return version and creation date values in human-readable format. - * @param {<>} params.includeDefaults - Whether to return all default setting for each of the indices. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.name - The name of the settings that should be included - */ -api.indices.prototype.getSettings = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': [ - 'open', - 'closed' - ], - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - local: { - type: 'boolean' - }, - human: { - type: 'boolean', - 'default': false - }, - includeDefaults: { - type: 'boolean', - 'default': false, - name: 'include_defaults' - } - }, - urls: [ - { - fmt: '/<%=index%>/_settings/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_settings', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_settings/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/_settings' - } - ] -}); - -/** - * Perform a [indices.getTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.name - The comma separated names of the index templates - */ -api.indices.prototype.getTemplate = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/_template' - } - ] -}); - -/** - * Perform a [indices.getUpgrade](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-upgrade.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.getUpgrade = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - human: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/<%=index%>/_upgrade', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_upgrade' - } - ] -}); - -/** - * Perform a [indices.open](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-open-close.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma separated list of indices to open - */ -api.indices.prototype.open = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'closed', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - url: { - fmt: '/<%=index%>/_open', - req: { - index: { - type: 'list' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [indices.putAlias](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit timestamp for the document - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices. - * @param {<>} params.name - The name of the alias to be created or updated - */ -api.indices.prototype.putAlias = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'string' - } - } - }, - method: 'PUT' -}); - -/** - * Perform a [indices.putMapping](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-put-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.updateAllTypes - Whether to update the mapping for all fields with the same name across all types or not - * @param {<>, <>, <>} params.index - A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices. - * @param {<>} params.type - The name of the document type - */ -api.indices.prototype.putMapping = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - updateAllTypes: { - type: 'boolean', - name: 'update_all_types' - } - }, - urls: [ - { - fmt: '/<%=index%>/_mapping/<%=type%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/_mapping/<%=type%>', - req: { - type: { - type: 'string' - } - } - } - ], - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [indices.putSettings](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.preserveExisting - Whether to update existing settings. If set to `true` existing settings on an index remain unchanged, the default is `false` - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.putSettings = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - preserveExisting: { - type: 'boolean', - name: 'preserve_existing' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - } - }, - urls: [ - { - fmt: '/<%=index%>/_settings', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_settings' - } - ], - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [indices.putTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.order - The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers) - * @param {<>} params.create - Whether the index template should only be added if new or can also replace an existing one - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.name - The name of the template - */ -api.indices.prototype.putTemplate = ca({ - params: { - order: { - type: 'number' - }, - create: { - type: 'boolean', - 'default': false - }, - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - } - }, - url: { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [indices.recovery](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-recovery.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.detailed - Whether to display detailed information about shard recovery - * @param {<>} params.activeOnly - Display only those recoveries that are currently on-going - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.recovery = ca({ - params: { - detailed: { - type: 'boolean', - 'default': false - }, - activeOnly: { - type: 'boolean', - 'default': false, - name: 'active_only' - }, - human: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/<%=index%>/_recovery', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_recovery' - } - ] -}); - -/** - * Perform a [indices.refresh](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-refresh.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.refresh = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_refresh', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_refresh' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.rollover](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-rollover-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.dryRun - If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for on the newly created rollover index before the operation returns. - * @param {<>} params.alias - The name of the alias to rollover - * @param {<>} params.newIndex - The name of the rollover index - */ -api.indices.prototype.rollover = ca({ - params: { - timeout: { - type: 'time' - }, - dryRun: { - type: 'boolean', - name: 'dry_run' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - } - }, - urls: [ - { - fmt: '/<%=alias%>/_rollover/<%=newIndex%>', - req: { - alias: { - type: 'string' - }, - newIndex: { - type: 'string' - } - } - }, - { - fmt: '/<%=alias%>/_rollover', - req: { - alias: { - type: 'string' - } - } - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.segments](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-segments.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.verbose - Includes detailed memory usage by Lucene. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.segments = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - human: { - type: 'boolean', - 'default': false - }, - operationThreading: { - name: 'operation_threading' - }, - verbose: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/<%=index%>/_segments', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_segments' - } - ] -}); - -/** - * Perform a [indices.shardStores](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-shards-stores.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.status - A comma-separated list of statuses used to filter on shards to get store information for - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {anything} params.operationThreading - TODO: ? - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.shardStores = ca({ - params: { - status: { - type: 'list', - options: [ - 'green', - 'yellow', - 'red', - 'all' - ] - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - operationThreading: { - name: 'operation_threading' - } - }, - urls: [ - { - fmt: '/<%=index%>/_shard_stores', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_shard_stores' - } - ] -}); - -/** - * Perform a [indices.shrink](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-shrink-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for on the shrunken index before the operation returns. - * @param {<>} params.index - The name of the source index to shrink - * @param {<>} params.target - The name of the target index to shrink into - */ -api.indices.prototype.shrink = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - } - }, - url: { - fmt: '/<%=index%>/_shrink/<%=target%>', - req: { - index: { - type: 'string' - }, - target: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [indices.stats](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.completionFields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields for `fielddata` index metric (supports wildcards) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) - * @param {<>, <>, <>} params.groups - A comma-separated list of search groups for `search` index metric - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>} [params.level=indices] - Return stats aggregated at cluster, index or shard level - * @param {<>, <>, <>} params.types - A comma-separated list of document types for the `indexing` index metric - * @param {<>} params.includeSegmentFileSizes - Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.metric - Limit the information returned the specific metrics. - */ -api.indices.prototype.stats = ca({ - params: { - completionFields: { - type: 'list', - name: 'completion_fields' - }, - fielddataFields: { - type: 'list', - name: 'fielddata_fields' - }, - fields: { - type: 'list' - }, - groups: { - type: 'list' - }, - human: { - type: 'boolean', - 'default': false - }, - level: { - type: 'enum', - 'default': 'indices', - options: [ - 'cluster', - 'indices', - 'shards' - ] - }, - types: { - type: 'list' - }, - includeSegmentFileSizes: { - type: 'boolean', - 'default': false, - name: 'include_segment_file_sizes' - } - }, - urls: [ - { - fmt: '/<%=index%>/_stats/<%=metric%>', - req: { - index: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'percolate', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/_stats/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'percolate', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/<%=index%>/_stats', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_stats' - } - ] -}); - -/** - * Perform a [indices.updateAliases](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Request timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - */ -api.indices.prototype.updateAliases = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_aliases' - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [indices.upgrade](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-upgrade.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.waitForCompletion - Specify whether the request should block until the all segments are upgraded (default: false) - * @param {<>} params.onlyAncientSegments - If true, only ancient (an older Lucene major release) segments will be upgraded - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.upgrade = ca({ - params: { - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - waitForCompletion: { - type: 'boolean', - name: 'wait_for_completion' - }, - onlyAncientSegments: { - type: 'boolean', - name: 'only_ancient_segments' - } - }, - urls: [ - { - fmt: '/<%=index%>/_upgrade', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_upgrade' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.validateQuery](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-validate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.explain - Return detailed information about the error - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.rewrite - Provide a more detailed explanation showing the actual Lucene query that will be executed. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to restrict the operation; leave empty to perform the operation on all types - */ -api.indices.prototype.validateQuery = ca({ - params: { - explain: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - operationThreading: { - name: 'operation_threading' - }, - q: { - type: 'string' - }, - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - lenient: { - type: 'boolean' - }, - rewrite: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_validate/query', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_validate/query', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_validate/query' - } - ], - method: 'POST' -}); - -/** - * Perform a [info](https://www.elastic.co/guide/) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.info = ca({ - url: { - fmt: '/' - } -}); - -api.ingest = namespace(); - -/** - * Perform a [ingest.deletePipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/5.2/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.id - Pipeline ID - */ -api.ingest.prototype.deletePipeline = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_ingest/pipeline/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [ingest.getPipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/5.2/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.id - Comma separated list of pipeline ids. Wildcards supported - */ -api.ingest.prototype.getPipeline = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - urls: [ - { - fmt: '/_ingest/pipeline/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - { - fmt: '/_ingest/pipeline' - } - ] -}); - -/** - * Perform a [ingest.putPipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/5.2/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.id - Pipeline ID - */ -api.ingest.prototype.putPipeline = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_ingest/pipeline/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [ingest.simulate](https://www.elastic.co/guide/en/elasticsearch/plugins/5.2/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.verbose - Verbose mode. Display data output for each processor in executed pipeline - * @param {<>} params.id - Pipeline ID - */ -api.ingest.prototype.simulate = ca({ - params: { - verbose: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_ingest/pipeline/<%=id%>/_simulate', - req: { - id: { - type: 'string' - } - } - }, - { - fmt: '/_ingest/pipeline/_simulate' - } - ], - needBody: true, - method: 'POST' -}); - -/** - * Perform a [mget](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-multi-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.mget = ca({ - params: { - storedFields: { - type: 'list', - name: 'stored_fields' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_mget', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_mget', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_mget' - } - ], - needBody: true, - method: 'POST' -}); - -/** - * Perform a [mpercolate](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-percolate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.index - The index of the document being count percolated to use as default - * @param {<>} params.type - The type of the document being percolated to use as default. - */ -api.mpercolate = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_mpercolate', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_mpercolate', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_mpercolate' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -/** - * Perform a [msearch](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-multi-search.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.searchType - Search operation type - * @param {<>} params.maxConcurrentSearches - Controls the maximum number of concurrent searches the multi search api will execute - * @param {<>, <>, <>} params.index - A comma-separated list of index names to use as default - * @param {<>, <>, <>} params.type - A comma-separated list of document types to use as default - */ -api.msearch = ca({ - params: { - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'query_and_fetch', - 'dfs_query_then_fetch', - 'dfs_query_and_fetch' - ], - name: 'search_type' - }, - maxConcurrentSearches: { - type: 'number', - name: 'max_concurrent_searches' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_msearch', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_msearch', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_msearch' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -/** - * Perform a [msearchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.searchType - Search operation type - * @param {<>, <>, <>} params.index - A comma-separated list of index names to use as default - * @param {<>, <>, <>} params.type - A comma-separated list of document types to use as default - */ -api.msearchTemplate = ca({ - params: { - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'query_and_fetch', - 'dfs_query_then_fetch', - 'dfs_query_and_fetch' - ], - name: 'search_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_msearch/template', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_msearch/template', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_msearch/template' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -/** - * Perform a [mtermvectors](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-multi-termvectors.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.ids - A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body - * @param {<>} params.termStatistics - Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.fieldStatistics=true] - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.offsets=true] - Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.positions=true] - Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.payloads=true] - Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) .Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.routing - Specific routing value. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.parent - Parent id of documents. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.realtime - Specifies if requests are real-time as opposed to near-real-time (default: true). - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index in which the document resides. - * @param {<>} params.type - The type of the document. - */ -api.mtermvectors = ca({ - params: { - ids: { - type: 'list', - required: false - }, - termStatistics: { - type: 'boolean', - 'default': false, - required: false, - name: 'term_statistics' - }, - fieldStatistics: { - type: 'boolean', - 'default': true, - required: false, - name: 'field_statistics' - }, - fields: { - type: 'list', - required: false - }, - offsets: { - type: 'boolean', - 'default': true, - required: false - }, - positions: { - type: 'boolean', - 'default': true, - required: false - }, - payloads: { - type: 'boolean', - 'default': true, - required: false - }, - preference: { - type: 'string', - required: false - }, - routing: { - type: 'string', - required: false - }, - parent: { - type: 'string', - required: false - }, - realtime: { - type: 'boolean', - required: false - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_mtermvectors', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_mtermvectors', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_mtermvectors' - } - ], - method: 'POST' -}); - -api.nodes = namespace(); - -/** - * Perform a [nodes.hotThreads](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cluster-nodes-hot-threads.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.interval - The interval for the second sampling of threads - * @param {<>} params.snapshots - Number of samples of thread stacktrace (default: 10) - * @param {<>} params.threads - Specify the number of threads to provide information for (default: 3) - * @param {<>} params.ignoreIdleThreads - Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue (default: true) - * @param {<>} params.type - The type to sample (default: cpu) - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - */ -api.nodes.prototype.hotThreads = ca({ - params: { - interval: { - type: 'time' - }, - snapshots: { - type: 'number' - }, - threads: { - type: 'number' - }, - ignoreIdleThreads: { - type: 'boolean', - name: 'ignore_idle_threads' - }, - type: { - type: 'enum', - options: [ - 'cpu', - 'wait', - 'block' - ] - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_nodes/<%=nodeId%>/hotthreads', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_nodes/hotthreads' - } - ] -}); - -/** - * Perform a [nodes.info](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cluster-nodes-info.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.metric - A comma-separated list of metrics you wish returned. Leave empty to return all. - */ -api.nodes.prototype.info = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - human: { - type: 'boolean', - 'default': false - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_nodes/<%=nodeId%>/<%=metric%>', - req: { - nodeId: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - 'settings', - 'os', - 'process', - 'jvm', - 'thread_pool', - 'transport', - 'http', - 'plugins', - 'ingest' - ] - } - } - }, - { - fmt: '/_nodes/<%=nodeId%>', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_nodes/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - 'settings', - 'os', - 'process', - 'jvm', - 'thread_pool', - 'transport', - 'http', - 'plugins', - 'ingest' - ] - } - } - }, - { - fmt: '/_nodes' - } - ] -}); - -/** - * Perform a [nodes.stats](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/cluster-nodes-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.completionFields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields for `fielddata` index metric (supports wildcards) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) - * @param {<>} params.groups - A comma-separated list of search groups for `search` index metric - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>} [params.level=node] - Return indices stats aggregated at index, node or shard level - * @param {<>, <>, <>} params.types - A comma-separated list of document types for the `indexing` index metric - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.includeSegmentFileSizes - Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics - * @param {<>, <>, <>} params.indexMetric - Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified. - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - */ -api.nodes.prototype.stats = ca({ - params: { - completionFields: { - type: 'list', - name: 'completion_fields' - }, - fielddataFields: { - type: 'list', - name: 'fielddata_fields' - }, - fields: { - type: 'list' - }, - groups: { - type: 'boolean' - }, - human: { - type: 'boolean', - 'default': false - }, - level: { - type: 'enum', - 'default': 'node', - options: [ - 'indices', - 'node', - 'shards' - ] - }, - types: { - type: 'list' - }, - timeout: { - type: 'time' - }, - includeSegmentFileSizes: { - type: 'boolean', - 'default': false, - name: 'include_segment_file_sizes' - } - }, - urls: [ - { - fmt: '/_nodes/<%=nodeId%>/stats/<%=metric%>/<%=indexMetric%>', - req: { - nodeId: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport', - 'discovery' - ] - }, - indexMetric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'percolate', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/_nodes/<%=nodeId%>/stats/<%=metric%>', - req: { - nodeId: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport', - 'discovery' - ] - } - } - }, - { - fmt: '/_nodes/stats/<%=metric%>/<%=indexMetric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport', - 'discovery' - ] - }, - indexMetric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'percolate', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/_nodes/<%=nodeId%>/stats', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_nodes/stats/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport', - 'discovery' - ] - } - } - }, - { - fmt: '/_nodes/stats' - } - ] -}); - -/** - * Perform a [percolate](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-percolate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.percolateIndex - The index to percolate the document into. Defaults to index. - * @param {<>} params.percolateType - The type to percolate document into. Defaults to type. - * @param {<>} params.percolateRouting - The routing value to use when percolating the existing document. - * @param {<>} params.percolatePreference - Which shard to prefer when executing the percolate request. - * @param {<>} params.percolateFormat - Return an array of matching query IDs instead of objects - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index of the document being percolated. - * @param {<>} params.type - The type of the document being percolated. - * @param {<>} params.id - Substitute the document in the request body with a document that is known by the specified id. On top of the id, the index and type parameter will be used to retrieve the document from within the cluster. - */ -api.percolate = ca({ - params: { - routing: { - type: 'list' - }, - preference: { - type: 'string' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - percolateIndex: { - type: 'string', - name: 'percolate_index' - }, - percolateType: { - type: 'string', - name: 'percolate_type' - }, - percolateRouting: { - type: 'string', - name: 'percolate_routing' - }, - percolatePreference: { - type: 'string', - name: 'percolate_preference' - }, - percolateFormat: { - type: 'enum', - options: [ - 'ids' - ], - name: 'percolate_format' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_percolate', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/<%=type%>/_percolate', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - } - ], - method: 'POST' -}); - -/** - * Perform a [ping](https://www.elastic.co/guide/) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.ping = ca({ - url: { - fmt: '/' - }, - requestTimeout: 3000, - method: 'HEAD' -}); - -/** - * Perform a [putScript](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Script ID - * @param {<>} params.lang - Script language - */ -api.putScript = ca({ - url: { - fmt: '/_scripts/<%=lang%>/<%=id%>', - req: { - lang: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [putTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Template ID - */ -api.putTemplate = ca({ - url: { - fmt: '/_search/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [reindex](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-reindex.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the reindex operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.waitForCompletion - Should the request should block until the reindex is complete. - * @param {<>} params.requestsPerSecond - The throttle to set on this request in sub-requests per second. -1 means no throttle. - * @param {<>} [params.slices=1] - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. - */ -api.reindex = ca({ - params: { - refresh: { - type: 'boolean' - }, - timeout: { - type: 'time', - 'default': '1m' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - waitForCompletion: { - type: 'boolean', - 'default': false, - name: 'wait_for_completion' - }, - requestsPerSecond: { - type: 'number', - 'default': 0, - name: 'requests_per_second' - }, - slices: { - type: 'number', - 'default': 1 - } - }, - url: { - fmt: '/_reindex' - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [reindexRethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-reindex.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.requestsPerSecond - The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. - * @param {<>} params.taskId - The task id to rethrottle - */ -api.reindexRethrottle = ca({ - params: { - requestsPerSecond: { - type: 'number', - required: true, - name: 'requests_per_second' - } - }, - url: { - fmt: '/_reindex/<%=taskId%>/_rethrottle', - req: { - taskId: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [renderSearchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - The id of the stored search template - */ -api.renderSearchTemplate = ca({ - urls: [ - { - fmt: '/_render/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - { - fmt: '/_render/template' - } - ], - method: 'POST' -}); - -/** - * Perform a [scroll](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-request-scroll.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.scrollId - The scroll ID - */ -api.scroll = ca({ - params: { - scroll: { - type: 'time' - }, - scrollId: { - type: 'string', - name: 'scroll_id' - } - }, - urls: [ - { - fmt: '/_search/scroll/<%=scrollId%>', - req: { - scrollId: { - type: 'string' - } - } - }, - { - fmt: '/_search/scroll' - } - ], - paramAsBody: { - param: 'scrollId', - body: 'scroll_id' - }, - method: 'POST' -}); - -/** - * Perform a [search](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-search.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.explain - Specify whether to return detailed information about score computation as part of a hit - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return as part of a hit - * @param {<>, <>, <>} params.docvalueFields - A comma-separated list of fields to return as the docvalue representation of a field for each hit - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields to return as the docvalue representation of a field for each hit - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.suggestField - Specify which field to use for suggestions - * @param {<>} [params.suggestMode=missing] - Specify suggest mode - * @param {<>} params.suggestSize - How many suggestions to return in response - * @param {<>} params.suggestText - The source text for which the suggestions should be returned - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.trackScores - Whether to calculate and return scores even if they are not used for sorting - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.search = ca({ - params: { - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - explain: { - type: 'boolean' - }, - storedFields: { - type: 'list', - name: 'stored_fields' - }, - docvalueFields: { - type: 'list', - name: 'docvalue_fields' - }, - fielddataFields: { - type: 'list', - name: 'fielddata_fields' - }, - from: { - type: 'number' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - lenient: { - type: 'boolean' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'dfs_query_then_fetch' - ], - name: 'search_type' - }, - size: { - type: 'number' - }, - sort: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - terminateAfter: { - type: 'number', - name: 'terminate_after' - }, - stats: { - type: 'list' - }, - suggestField: { - type: 'string', - name: 'suggest_field' - }, - suggestMode: { - type: 'enum', - 'default': 'missing', - options: [ - 'missing', - 'popular', - 'always' - ], - name: 'suggest_mode' - }, - suggestSize: { - type: 'number', - name: 'suggest_size' - }, - suggestText: { - type: 'string', - name: 'suggest_text' - }, - timeout: { - type: 'time' - }, - trackScores: { - type: 'boolean', - name: 'track_scores' - }, - version: { - type: 'boolean' - }, - requestCache: { - type: 'boolean', - name: 'request_cache' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_search', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_search', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_search' - } - ], - method: 'POST' -}); - -/** - * Perform a [searchShards](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-shards.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.searchShards = ca({ - params: { - preference: { - type: 'string' - }, - routing: { - type: 'string' - }, - local: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_search_shards', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_search_shards', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_search_shards' - } - ], - method: 'POST' -}); - -/** - * Perform a [searchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.explain - Specify whether to return detailed information about score computation as part of a hit - * @param {<>} params.profile - Specify whether to profile the query execution - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.searchTemplate = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - preference: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'query_and_fetch', - 'dfs_query_then_fetch', - 'dfs_query_and_fetch' - ], - name: 'search_type' - }, - explain: { - type: 'boolean' - }, - profile: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_search/template', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_search/template', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_search/template' - } - ], - method: 'POST' -}); - -api.snapshot = namespace(); - -/** - * Perform a [snapshot.create](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.waitForCompletion - Should this request wait until the operation has completed before returning - * @param {<>} params.repository - A repository name - * @param {<>} params.snapshot - A snapshot name - */ -api.snapshot.prototype.create = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForCompletion: { - type: 'boolean', - 'default': false, - name: 'wait_for_completion' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [snapshot.createRepository](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.verify - Whether to verify the repository after creation - * @param {<>} params.repository - A repository name - */ -api.snapshot.prototype.createRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - }, - verify: { - type: 'boolean' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>', - req: { - repository: { - type: 'string' - } - } - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [snapshot.delete](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.repository - A repository name - * @param {<>} params.snapshot - A snapshot name - */ -api.snapshot.prototype['delete'] = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [snapshot.deleteRepository](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.repository - A comma-separated list of repository names - */ -api.snapshot.prototype.deleteRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>', - req: { - repository: { - type: 'list' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [snapshot.get](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.ignoreUnavailable - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown - * @param {<>} params.repository - A repository name - * @param {<>, <>, <>} params.snapshot - A comma-separated list of snapshot names - */ -api.snapshot.prototype.get = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'list' - } - } - } -}); - -/** - * Perform a [snapshot.getRepository](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.repository - A comma-separated list of repository names - */ -api.snapshot.prototype.getRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/_snapshot/<%=repository%>', - req: { - repository: { - type: 'list' - } - } - }, - { - fmt: '/_snapshot' - } - ] -}); - -/** - * Perform a [snapshot.restore](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.waitForCompletion - Should this request wait until the operation has completed before returning - * @param {<>} params.repository - A repository name - * @param {<>} params.snapshot - A snapshot name - */ -api.snapshot.prototype.restore = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForCompletion: { - type: 'boolean', - 'default': false, - name: 'wait_for_completion' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>/_restore', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [snapshot.status](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.ignoreUnavailable - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown - * @param {<>} params.repository - A repository name - * @param {<>, <>, <>} params.snapshot - A comma-separated list of snapshot names - */ -api.snapshot.prototype.status = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - } - }, - urls: [ - { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>/_status', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'list' - } - } - }, - { - fmt: '/_snapshot/<%=repository%>/_status', - req: { - repository: { - type: 'string' - } - } - }, - { - fmt: '/_snapshot/_status' - } - ] -}); - -/** - * Perform a [snapshot.verifyRepository](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.repository - A repository name - */ -api.snapshot.prototype.verifyRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/_verify', - req: { - repository: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [suggest](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-suggesters.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params.index - A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices - */ -api.suggest = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - preference: { - type: 'string' - }, - routing: { - type: 'string' - } - }, - urls: [ - { - fmt: '/<%=index%>/_suggest', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_suggest' - } - ], - needBody: true, - method: 'POST' -}); - -api.tasks = namespace(); - -/** - * Perform a [tasks.cancel](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.actions - A comma-separated list of actions that should be cancelled. Leave empty to cancel all. - * @param {<>} params.parentNode - Cancel tasks with specified parent node. - * @param {<>} params.parentTask - Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all. - * @param {<>} params.taskId - Cancel the task with specified task id (node_id:task_number) - */ -api.tasks.prototype.cancel = ca({ - params: { - nodeId: { - type: 'list', - name: 'node_id' - }, - actions: { - type: 'list' - }, - parentNode: { - type: 'string', - name: 'parent_node' - }, - parentTask: { - type: 'string', - name: 'parent_task' - } - }, - urls: [ - { - fmt: '/_tasks/<%=taskId%>/_cancel', - req: { - taskId: { - type: 'string' - } - } - }, - { - fmt: '/_tasks/_cancel' - } - ], - method: 'POST' -}); - -/** - * Perform a [tasks.get](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForCompletion - Wait for the matching tasks to complete (default: false) - * @param {<>} params.taskId - Return the task with specified id (node_id:task_number) - */ -api.tasks.prototype.get = ca({ - params: { - waitForCompletion: { - type: 'boolean', - name: 'wait_for_completion' - } - }, - url: { - fmt: '/_tasks/<%=taskId%>', - req: { - taskId: { - type: 'string' - } - } - } -}); - -/** - * Perform a [tasks.list](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.actions - A comma-separated list of actions that should be returned. Leave empty to return all. - * @param {<>} params.detailed - Return detailed task information (default: false) - * @param {<>} params.parentNode - Return tasks with specified parent node. - * @param {<>} params.parentTask - Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all. - * @param {<>} params.waitForCompletion - Wait for the matching tasks to complete (default: false) - * @param {<>} [params.groupBy=nodes] - Group tasks by nodes or parent/child relationships - */ -api.tasks.prototype.list = ca({ - params: { - nodeId: { - type: 'list', - name: 'node_id' - }, - actions: { - type: 'list' - }, - detailed: { - type: 'boolean' - }, - parentNode: { - type: 'string', - name: 'parent_node' - }, - parentTask: { - type: 'string', - name: 'parent_task' - }, - waitForCompletion: { - type: 'boolean', - name: 'wait_for_completion' - }, - groupBy: { - type: 'enum', - 'default': 'nodes', - options: [ - 'nodes', - 'parents' - ], - name: 'group_by' - } - }, - url: { - fmt: '/_tasks' - } -}); - -/** - * Perform a [termvectors](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-termvectors.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.termStatistics - Specifies if total term frequency and document frequency should be returned. - * @param {<>} [params.fieldStatistics=true] - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return. - * @param {<>} [params.offsets=true] - Specifies if term offsets should be returned. - * @param {<>} [params.positions=true] - Specifies if term positions should be returned. - * @param {<>} [params.payloads=true] - Specifies if term payloads should be returned. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random). - * @param {<>} params.routing - Specific routing value. - * @param {<>} params.parent - Parent id of documents. - * @param {<>} params.realtime - Specifies if request is real-time as opposed to near-real-time (default: true). - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index in which the document resides. - * @param {<>} params.type - The type of the document. - * @param {<>} params.id - The id of the document, when not specified a doc param should be supplied. - */ -api.termvectors = ca({ - params: { - termStatistics: { - type: 'boolean', - 'default': false, - required: false, - name: 'term_statistics' - }, - fieldStatistics: { - type: 'boolean', - 'default': true, - required: false, - name: 'field_statistics' - }, - fields: { - type: 'list', - required: false - }, - offsets: { - type: 'boolean', - 'default': true, - required: false - }, - positions: { - type: 'boolean', - 'default': true, - required: false - }, - payloads: { - type: 'boolean', - 'default': true, - required: false - }, - preference: { - type: 'string', - required: false - }, - routing: { - type: 'string', - required: false - }, - parent: { - type: 'string', - required: false - }, - realtime: { - type: 'boolean', - required: false - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_termvectors', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/<%=type%>/_termvectors', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - } - ], - method: 'POST' -}); - -/** - * Perform a [update](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-update.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the update operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return in the response - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.lang - The script language (default: painless) - * @param {<>} params.parent - ID of the parent document. Is is only used for routing and when for the upsert request - * @param {<>} params.refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.retryOnConflict - Specify how many times should the operation be retried when a conflict occurs (default: 0) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.update = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - fields: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - lang: { - type: 'string' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - retryOnConflict: { - type: 'number', - name: 'retry_on_conflict' - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - timestamp: { - type: 'time' - }, - ttl: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_update', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [updateByQuery](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-update-by-query.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.conflicts=abort] - What to do when the update by query hits version conflicts? - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.pipeline - Ingest pipeline to set on index requests made by this action. (default: none) - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.searchTimeout - Explicit timeout for each search request. Defaults to no timeout. - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.versionType - Should the document increment the version number (internal) on hit or not (reindex) - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the update by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.scrollSize - Size on the scroll request powering the update_by_query - * @param {<>} params.waitForCompletion - Should the request should block until the update by query operation is complete. - * @param {<>} params.requestsPerSecond - The throttle to set on this request in sub-requests per second. -1 means no throttle. - * @param {<>} [params.slices=1] - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.updateByQuery = ca({ - params: { - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - from: { - type: 'number' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - conflicts: { - type: 'enum', - 'default': 'abort', - options: [ - 'abort', - 'proceed' - ] - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - lenient: { - type: 'boolean' - }, - pipeline: { - type: 'string' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'dfs_query_then_fetch' - ], - name: 'search_type' - }, - searchTimeout: { - type: 'time', - name: 'search_timeout' - }, - size: { - type: 'number' - }, - sort: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - terminateAfter: { - type: 'number', - name: 'terminate_after' - }, - stats: { - type: 'list' - }, - version: { - type: 'boolean' - }, - versionType: { - type: 'boolean', - name: 'version_type' - }, - requestCache: { - type: 'boolean', - name: 'request_cache' - }, - refresh: { - type: 'boolean' - }, - timeout: { - type: 'time', - 'default': '1m' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - scrollSize: { - type: 'number', - name: 'scroll_size' - }, - waitForCompletion: { - type: 'boolean', - 'default': false, - name: 'wait_for_completion' - }, - requestsPerSecond: { - type: 'number', - 'default': 0, - name: 'requests_per_second' - }, - slices: { - type: 'number', - 'default': 1 - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_update_by_query', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_update_by_query', - req: { - index: { - type: 'list' - } - } - } - ], - method: 'POST' -}); diff --git a/src/lib/apis/5_3.js b/src/lib/apis/5_3.js deleted file mode 100644 index 2fcb9cfa2..000000000 --- a/src/lib/apis/5_3.js +++ /dev/null @@ -1,7135 +0,0 @@ -var ca = require('../client_action').makeFactoryWithModifier(function (spec) { - return require('../utils').merge(spec, { - params: { - filterPath: { - type: 'list', - name: 'filter_path' - } - } - }); -}); -var namespace = require('../client_action').namespaceFactory; -var api = module.exports = {}; - -api._namespaces = ['cat', 'cluster', 'indices', 'ingest', 'nodes', 'snapshot', 'tasks']; - -/** - * Perform a [bulk](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-bulk.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the bulk operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.type - Default document type for items which don't provide one - * @param {<>, <>, <>} params.fields - Default comma-separated list of fields to return in the response for updates, can be overridden on each sub-request - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request - * @param {<>, <>, <>} params._sourceExclude - Default list of fields to exclude from the returned _source field, can be overridden on each sub-request - * @param {<>, <>, <>} params._sourceInclude - Default list of fields to extract and return from the _source field, can be overridden on each sub-request - * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with - * @param {<>} params.index - Default index for items which don't provide one - */ -api.bulk = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - type: { - type: 'string' - }, - fields: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - pipeline: { - type: 'string' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_bulk', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_bulk', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_bulk' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -api.cat = namespace(); - -/** - * Perform a [cat.aliases](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.name - A comma-separated list of alias names to return - */ -api.cat.prototype.aliases = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/aliases/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/_cat/aliases' - } - ] -}); - -/** - * Perform a [cat.allocation](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-allocation.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information - */ -api.cat.prototype.allocation = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'kb', - 'm', - 'mb', - 'g', - 'gb', - 't', - 'tb', - 'p', - 'pb' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/allocation/<%=nodeId%>', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_cat/allocation' - } - ] -}); - -/** - * Perform a [cat.count](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-count.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.count = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/count/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/count' - } - ] -}); - -/** - * Perform a [cat.fielddata](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-fielddata.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return the fielddata size - */ -api.cat.prototype.fielddata = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'kb', - 'm', - 'mb', - 'g', - 'gb', - 't', - 'tb', - 'p', - 'pb' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - }, - fields: { - type: 'list' - } - }, - urls: [ - { - fmt: '/_cat/fielddata/<%=fields%>', - req: { - fields: { - type: 'list' - } - } - }, - { - fmt: '/_cat/fielddata' - } - ] -}); - -/** - * Perform a [cat.health](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-health.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} [params.ts=true] - Set to false to disable timestamping - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.health = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - ts: { - type: 'boolean', - 'default': true - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/health' - } -}); - -/** - * Perform a [cat.help](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - */ -api.cat.prototype.help = ca({ - params: { - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - } - }, - url: { - fmt: '/_cat' - } -}); - -/** - * Perform a [cat.indices](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-indices.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.health - A health status ("green", "yellow", or "red" to filter only indices matching the specified health status - * @param {<>} params.help - Return help information - * @param {<>} params.pri - Set to true to return stats only for primary shards - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.indices = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'm', - 'g' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - health: { - type: 'enum', - 'default': null, - options: [ - 'green', - 'yellow', - 'red' - ] - }, - help: { - type: 'boolean', - 'default': false - }, - pri: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/indices/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/indices' - } - ] -}); - -/** - * Perform a [cat.master](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-master.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.master = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/master' - } -}); - -/** - * Perform a [cat.nodeattrs](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-nodeattrs.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.nodeattrs = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/nodeattrs' - } -}); - -/** - * Perform a [cat.nodes](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-nodes.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.fullId - Return the full node ID instead of the shortened version (default: false) - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.nodes = ca({ - params: { - format: { - type: 'string' - }, - fullId: { - type: 'boolean', - name: 'full_id' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/nodes' - } -}); - -/** - * Perform a [cat.pendingTasks](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-pending-tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.pendingTasks = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/pending_tasks' - } -}); - -/** - * Perform a [cat.plugins](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-plugins.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.plugins = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/plugins' - } -}); - -/** - * Perform a [cat.recovery](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-recovery.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.recovery = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'kb', - 'm', - 'mb', - 'g', - 'gb', - 't', - 'tb', - 'p', - 'pb' - ] - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/recovery/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/recovery' - } - ] -}); - -/** - * Perform a [cat.repositories](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-repositories.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.repositories = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean', - 'default': false - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/repositories' - } -}); - -/** - * Perform a [cat.segments](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-segments.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.segments = ca({ - params: { - format: { - type: 'string' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/segments/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/segments' - } - ] -}); - -/** - * Perform a [cat.shards](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-shards.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.shards = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/shards/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/shards' - } - ] -}); - -/** - * Perform a [cat.snapshots](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.ignoreUnavailable - Set to true to ignore unavailable snapshots - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.repository - Name of repository from which to fetch the snapshot information - */ -api.cat.prototype.snapshots = ca({ - params: { - format: { - type: 'string' - }, - ignoreUnavailable: { - type: 'boolean', - 'default': false, - name: 'ignore_unavailable' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/snapshots/<%=repository%>', - req: { - repository: { - type: 'list' - } - } - }, - { - fmt: '/_cat/snapshots' - } - ] -}); - -/** - * Perform a [cat.tasks](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.actions - A comma-separated list of actions that should be returned. Leave empty to return all. - * @param {<>} params.detailed - Return detailed task information (default: false) - * @param {<>} params.parentNode - Return tasks with specified parent node. - * @param {<>} params.parentTask - Return tasks with specified parent task id. Set to -1 to return all. - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.tasks = ca({ - params: { - format: { - type: 'string' - }, - nodeId: { - type: 'list', - name: 'node_id' - }, - actions: { - type: 'list' - }, - detailed: { - type: 'boolean' - }, - parentNode: { - type: 'string', - name: 'parent_node' - }, - parentTask: { - type: 'number', - name: 'parent_task' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/tasks' - } -}); - -/** - * Perform a [cat.templates](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>} params.name - A pattern that returned template names must match - */ -api.cat.prototype.templates = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/templates/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - { - fmt: '/_cat/templates' - } - ] -}); - -/** - * Perform a [cat.threadPool](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cat-thread-pool.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.size - The multiplier in which to display values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.threadPoolPatterns - A comma-separated list of regular-expressions to filter the thread pools in the output - */ -api.cat.prototype.threadPool = ca({ - params: { - format: { - type: 'string' - }, - size: { - type: 'enum', - options: [ - '', - 'k', - 'm', - 'g', - 't', - 'p' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/thread_pool/<%=threadPoolPatterns%>', - req: { - threadPoolPatterns: { - type: 'list' - } - } - }, - { - fmt: '/_cat/thread_pool' - } - ] -}); - -/** - * Perform a [clearScroll](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-request-scroll.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.scrollId - A comma-separated list of scroll IDs to clear - */ -api.clearScroll = ca({ - urls: [ - { - fmt: '/_search/scroll/<%=scrollId%>', - req: { - scrollId: { - type: 'list' - } - } - }, - { - fmt: '/_search/scroll' - } - ], - paramAsBody: { - param: 'scrollId', - body: 'scroll_id', - castToArray: true - }, - method: 'DELETE' -}); - -api.cluster = namespace(); - -/** - * Perform a [cluster.allocationExplain](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cluster-allocation-explain.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.includeYesDecisions - Return 'YES' decisions in explanation (default: false) - * @param {<>} params.includeDiskInfo - Return information about disk usage and shard sizes (default: false) - */ -api.cluster.prototype.allocationExplain = ca({ - params: { - includeYesDecisions: { - type: 'boolean', - name: 'include_yes_decisions' - }, - includeDiskInfo: { - type: 'boolean', - name: 'include_disk_info' - } - }, - url: { - fmt: '/_cluster/allocation/explain' - }, - method: 'POST' -}); - -/** - * Perform a [cluster.getSettings](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cluster-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.includeDefaults - Whether to return all default clusters setting. - */ -api.cluster.prototype.getSettings = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - }, - includeDefaults: { - type: 'boolean', - 'default': false, - name: 'include_defaults' - } - }, - url: { - fmt: '/_cluster/settings' - } -}); - -/** - * Perform a [cluster.health](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cluster-health.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} [params.level=cluster] - Specify the level of detail for returned information - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.waitForActiveShards - Wait until the specified number of shards is active - * @param {<>} params.waitForNodes - Wait until the specified number of nodes is available - * @param {<>} params.waitForEvents - Wait until all currently queued events with the given priority are processed - * @param {<>} params.waitForNoRelocatingShards - Whether to wait until there are no relocating shards in the cluster - * @param {<>} params.waitForStatus - Wait until cluster is in a specific state - * @param {<>, <>, <>} params.index - Limit the information returned to a specific index - */ -api.cluster.prototype.health = ca({ - params: { - level: { - type: 'enum', - 'default': 'cluster', - options: [ - 'cluster', - 'indices', - 'shards' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - waitForNodes: { - type: 'string', - name: 'wait_for_nodes' - }, - waitForEvents: { - type: 'enum', - options: [ - 'immediate', - 'urgent', - 'high', - 'normal', - 'low', - 'languid' - ], - name: 'wait_for_events' - }, - waitForNoRelocatingShards: { - type: 'boolean', - name: 'wait_for_no_relocating_shards' - }, - waitForStatus: { - type: 'enum', - 'default': null, - options: [ - 'green', - 'yellow', - 'red' - ], - name: 'wait_for_status' - } - }, - urls: [ - { - fmt: '/_cluster/health/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cluster/health' - } - ] -}); - -/** - * Perform a [cluster.pendingTasks](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cluster-pending.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Specify timeout for connection to master - */ -api.cluster.prototype.pendingTasks = ca({ - params: { - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_cluster/pending_tasks' - } -}); - -/** - * Perform a [cluster.putSettings](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cluster-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - */ -api.cluster.prototype.putSettings = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_cluster/settings' - }, - method: 'PUT' -}); - -/** - * Perform a [cluster.reroute](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cluster-reroute.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.dryRun - Simulate the operation only and return the resulting state - * @param {<>} params.explain - Return an explanation of why the commands can or cannot be executed - * @param {<>} params.retryFailed - Retries allocation of shards that are blocked due to too many subsequent allocation failures - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics. Defaults to all but metadata - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - */ -api.cluster.prototype.reroute = ca({ - params: { - dryRun: { - type: 'boolean', - name: 'dry_run' - }, - explain: { - type: 'boolean' - }, - retryFailed: { - type: 'boolean', - name: 'retry_failed' - }, - metric: { - type: 'list', - options: [ - '_all', - 'blocks', - 'metadata', - 'nodes', - 'routing_table', - 'master_node', - 'version' - ] - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_cluster/reroute' - }, - method: 'POST' -}); - -/** - * Perform a [cluster.state](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cluster-state.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics - */ -api.cluster.prototype.state = ca({ - params: { - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/_cluster/state/<%=metric%>/<%=index%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'blocks', - 'metadata', - 'nodes', - 'routing_table', - 'routing_nodes', - 'master_node', - 'version' - ] - }, - index: { - type: 'list' - } - } - }, - { - fmt: '/_cluster/state/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'blocks', - 'metadata', - 'nodes', - 'routing_table', - 'routing_nodes', - 'master_node', - 'version' - ] - } - } - }, - { - fmt: '/_cluster/state' - } - ] -}); - -/** - * Perform a [cluster.stats](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cluster-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - */ -api.cluster.prototype.stats = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_cluster/stats/nodes/<%=nodeId%>', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_cluster/stats' - } - ] -}); - -/** - * Perform a [count](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-count.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.minScore - Include only documents with a specific `_score` value in the result - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>, <>, <>} params.index - A comma-separated list of indices to restrict the results - * @param {<>, <>, <>} params.type - A comma-separated list of types to restrict the results - */ -api.count = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - minScore: { - type: 'number', - name: 'min_score' - }, - preference: { - type: 'string' - }, - routing: { - type: 'string' - }, - q: { - type: 'string' - }, - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - lenient: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_count', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_count', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_count' - } - ], - method: 'POST' -}); - -/** - * Perform a [countPercolate](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-percolate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.percolateIndex - The index to count percolate the document into. Defaults to index. - * @param {<>} params.percolateType - The type to count percolate document into. Defaults to type. - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index of the document being count percolated. - * @param {<>} params.type - The type of the document being count percolated. - * @param {<>} params.id - Substitute the document in the request body with a document that is known by the specified id. On top of the id, the index and type parameter will be used to retrieve the document from within the cluster. - */ -api.countPercolate = ca({ - params: { - routing: { - type: 'list' - }, - preference: { - type: 'string' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - percolateIndex: { - type: 'string', - name: 'percolate_index' - }, - percolateType: { - type: 'string', - name: 'percolate_type' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_percolate/count', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/<%=type%>/_percolate/count', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - } - ], - method: 'POST' -}); - -/** - * Perform a [create](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-index_.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.parent - ID of the parent document - * @param {<>} params.refresh - If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.create = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - timestamp: { - type: 'time' - }, - ttl: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - }, - pipeline: { - type: 'string' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_create', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [delete](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-delete.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the delete operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.parent - ID of parent document - * @param {<>} params.refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api['delete'] = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [deleteByQuery](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-delete-by-query.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.conflicts=abort] - What to do when the delete-by-query hits version conflicts? - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.searchTimeout - Explicit timeout for each search request. Defaults to no timeout. - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the delete by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.scrollSize - Size on the scroll request powering the update_by_query - * @param {<>} [params.waitForCompletion=true] - Should the request should block until the delete-by-query is complete. - * @param {<>} params.requestsPerSecond - The throttle for this request in sub-requests per second. -1 means no throttle. - * @param {<>} [params.slices=1] - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.deleteByQuery = ca({ - params: { - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - from: { - type: 'number' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - conflicts: { - type: 'enum', - 'default': 'abort', - options: [ - 'abort', - 'proceed' - ] - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - lenient: { - type: 'boolean' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'dfs_query_then_fetch' - ], - name: 'search_type' - }, - searchTimeout: { - type: 'time', - name: 'search_timeout' - }, - size: { - type: 'number' - }, - sort: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - terminateAfter: { - type: 'number', - name: 'terminate_after' - }, - stats: { - type: 'list' - }, - version: { - type: 'boolean' - }, - requestCache: { - type: 'boolean', - name: 'request_cache' - }, - refresh: { - type: 'boolean' - }, - timeout: { - type: 'time', - 'default': '1m' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - scrollSize: { - type: 'number', - name: 'scroll_size' - }, - waitForCompletion: { - type: 'boolean', - 'default': true, - name: 'wait_for_completion' - }, - requestsPerSecond: { - type: 'number', - 'default': 0, - name: 'requests_per_second' - }, - slices: { - type: 'number', - 'default': 1 - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_delete_by_query', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_delete_by_query', - req: { - index: { - type: 'list' - } - } - } - ], - needBody: true, - method: 'POST' -}); - -/** - * Perform a [deleteScript](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Script ID - * @param {<>} params.lang - Script language - */ -api.deleteScript = ca({ - urls: [ - { - fmt: '/_scripts/<%=lang%>/<%=id%>', - req: { - lang: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/_scripts/<%=lang%>', - req: { - lang: { - type: 'string' - } - } - } - ], - method: 'DELETE' -}); - -/** - * Perform a [deleteTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Template ID - */ -api.deleteTemplate = ca({ - url: { - fmt: '/_search/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [exists](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document (use `_all` to fetch the first document matching the ID across all types) - */ -api.exists = ca({ - params: { - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [explain](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-explain.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzeWildcard - Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false) - * @param {<>} params.analyzer - The analyzer for the query string query - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The default field for query string query (default: _all) - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.explain = ca({ - params: { - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - analyzer: { - type: 'string' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - storedFields: { - type: 'list', - name: 'stored_fields' - }, - lenient: { - type: 'boolean' - }, - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_explain', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [fieldStats](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-field-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for to get field statistics for (min value, max value, and more) - * @param {<>} [params.level=cluster] - Defines if field stats should be returned on a per index level or on a cluster wide level - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.fieldStats = ca({ - params: { - fields: { - type: 'list' - }, - level: { - type: 'enum', - 'default': 'cluster', - options: [ - 'indices', - 'cluster' - ] - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_field_stats', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_field_stats' - } - ], - method: 'POST' -}); - -/** - * Perform a [get](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document (use `_all` to fetch the first document matching the ID across all types) - */ -api.get = ca({ - params: { - storedFields: { - type: 'list', - name: 'stored_fields' - }, - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [getScript](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Script ID - * @param {<>} params.lang - Script language - */ -api.getScript = ca({ - urls: [ - { - fmt: '/_scripts/<%=lang%>/<%=id%>', - req: { - lang: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/_scripts/<%=lang%>', - req: { - lang: { - type: 'string' - } - } - } - ] -}); - -/** - * Perform a [getSource](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document; use `_all` to fetch the first document matching the ID across all types - */ -api.getSource = ca({ - params: { - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_source', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [getTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Template ID - */ -api.getTemplate = ca({ - url: { - fmt: '/_search/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [index](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-index_.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} [params.opType=index] - Explicit operation type - * @param {<>} params.parent - ID of the parent document - * @param {<>} params.refresh - If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.index = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - opType: { - type: 'enum', - 'default': 'index', - options: [ - 'index', - 'create' - ], - name: 'op_type' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - timestamp: { - type: 'time' - }, - ttl: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - }, - pipeline: { - type: 'string' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/<%=type%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - } - ], - needBody: true, - method: 'POST' -}); - -api.indices = namespace(); - -/** - * Perform a [indices.analyze](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-analyze.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The name of the analyzer to use - * @param {<>, <>, <>} params.charFilter - A comma-separated list of character filters to use for the analysis - * @param {<>} params.field - Use the analyzer configured for this field (instead of passing the analyzer name) - * @param {<>, <>, <>} params.filter - A comma-separated list of filters to use for the analysis - * @param {<>} params.index - The name of the index to scope the operation - * @param {<>} params.preferLocal - With `true`, specify that a local shard should be used if available, with `false`, use a random shard (default: true) - * @param {<>, <>, <>} params.text - The text on which the analysis should be performed (when request body is not used) - * @param {<>} params.tokenizer - The name of the tokenizer to use for the analysis - * @param {<>} params.explain - With `true`, outputs more advanced details. (default: false) - * @param {<>, <>, <>} params.attributes - A comma-separated list of token attributes to output, this parameter works only with `explain=true` - * @param {<>} [params.format=detailed] - Format of the output - */ -api.indices.prototype.analyze = ca({ - params: { - analyzer: { - type: 'string' - }, - charFilter: { - type: 'list', - name: 'char_filter' - }, - field: { - type: 'string' - }, - filter: { - type: 'list' - }, - index: { - type: 'string' - }, - preferLocal: { - type: 'boolean', - name: 'prefer_local' - }, - text: { - type: 'list' - }, - tokenizer: { - type: 'string' - }, - explain: { - type: 'boolean' - }, - attributes: { - type: 'list' - }, - format: { - type: 'enum', - 'default': 'detailed', - options: [ - 'detailed', - 'text' - ] - } - }, - urls: [ - { - fmt: '/<%=index%>/_analyze', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_analyze' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.clearCache](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-clearcache.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.fieldData - Clear field data - * @param {<>} params.fielddata - Clear field data - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to clear when using the `field_data` parameter (default: all) - * @param {<>} params.query - Clear query caches - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index name to limit the operation - * @param {<>} params.recycler - Clear the recycler cache - * @param {<>} params.request - Clear request cache - */ -api.indices.prototype.clearCache = ca({ - params: { - fieldData: { - type: 'boolean', - name: 'field_data' - }, - fielddata: { - type: 'boolean' - }, - fields: { - type: 'list' - }, - query: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - index: { - type: 'list' - }, - recycler: { - type: 'boolean' - }, - request: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_cache/clear', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cache/clear' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.close](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-open-close.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma separated list of indices to close - */ -api.indices.prototype.close = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - url: { - fmt: '/<%=index%>/_close', - req: { - index: { - type: 'list' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [indices.create](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-create-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for before the operation returns. - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.updateAllTypes - Whether to update the mapping for all fields with the same name across all types or not - * @param {<>} params.index - The name of the index - */ -api.indices.prototype.create = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - updateAllTypes: { - type: 'boolean', - name: 'update_all_types' - } - }, - url: { - fmt: '/<%=index%>', - req: { - index: { - type: 'string' - } - } - }, - method: 'PUT' -}); - -/** - * Perform a [indices.delete](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-delete-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices - */ -api.indices.prototype['delete'] = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [indices.deleteAlias](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit timestamp for the document - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of index names (supports wildcards); use `_all` for all indices - * @param {<>, <>, <>} params.name - A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices. - */ -api.indices.prototype.deleteAlias = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [indices.deleteTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.name - The name of the template - */ -api.indices.prototype.deleteTemplate = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [indices.exists](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-exists.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of indices to check - */ -api.indices.prototype.exists = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - url: { - fmt: '/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [indices.existsAlias](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open,closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names to filter aliases - * @param {<>, <>, <>} params.name - A comma-separated list of alias names to return - */ -api.indices.prototype.existsAlias = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': [ - 'open', - 'closed' - ], - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/_alias/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_alias', - req: { - index: { - type: 'list' - } - } - } - ], - method: 'HEAD' -}); - -/** - * Perform a [indices.existsTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.name - The name of the template - */ -api.indices.prototype.existsTemplate = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - local: { - type: 'boolean' - } - }, - url: { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [indices.existsType](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-types-exists.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` to check the types across all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to check - */ -api.indices.prototype.existsType = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - url: { - fmt: '/<%=index%>/_mapping/<%=type%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [indices.flush](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-flush.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.force - Whether a flush should be forced even if it is not necessarily needed ie. if no changes will be committed to the index. This is useful if transaction log IDs should be incremented even if no uncommitted changes are present. (This setting can be considered as internal) - * @param {<>} params.waitIfOngoing - If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. The default is true. If set to false the flush will be skipped iff if another flush operation is already running. - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string for all indices - */ -api.indices.prototype.flush = ca({ - params: { - force: { - type: 'boolean' - }, - waitIfOngoing: { - type: 'boolean', - name: 'wait_if_ongoing' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_flush', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_flush' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.flushSynced](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-synced-flush.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string for all indices - */ -api.indices.prototype.flushSynced = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_flush/synced', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_flush/synced' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.forcemerge](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-forcemerge.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flush - Specify whether the index should be flushed after performing the operation (default: true) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.maxNumSegments - The number of segments the index should be merged into (default: dynamic) - * @param {<>} params.onlyExpungeDeletes - Specify whether the operation should only expunge deleted documents - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.waitForMerge - Specify whether the request should block until the merge process is finished (default: true) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.forcemerge = ca({ - params: { - flush: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - maxNumSegments: { - type: 'number', - name: 'max_num_segments' - }, - onlyExpungeDeletes: { - type: 'boolean', - name: 'only_expunge_deletes' - }, - operationThreading: { - name: 'operation_threading' - }, - waitForMerge: { - type: 'boolean', - name: 'wait_for_merge' - } - }, - urls: [ - { - fmt: '/<%=index%>/_forcemerge', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_forcemerge' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.get](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-get-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.ignoreUnavailable - Ignore unavailable indexes (default: false) - * @param {<>} params.allowNoIndices - Ignore if a wildcard expression resolves to no concrete indices (default: false) - * @param {<>} [params.expandWildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (default: open) - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.includeDefaults - Whether to return all default setting for each of the indices. - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} params.feature - A comma-separated list of features - */ -api.indices.prototype.get = ca({ - params: { - local: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - includeDefaults: { - type: 'boolean', - 'default': false, - name: 'include_defaults' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=feature%>', - req: { - index: { - type: 'list' - }, - feature: { - type: 'list', - options: [ - '_settings', - '_mappings', - '_aliases' - ] - } - } - }, - { - fmt: '/<%=index%>', - req: { - index: { - type: 'list' - } - } - } - ] -}); - -/** - * Perform a [indices.getAlias](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=all] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names to filter aliases - * @param {<>, <>, <>} params.name - A comma-separated list of alias names to return - */ -api.indices.prototype.getAlias = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'all', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/_alias/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_alias', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_alias' - } - ] -}); - -/** - * Perform a [indices.getFieldMapping](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-get-field-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.includeDefaults - Whether the default mapping values should be returned as well - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} params.type - A comma-separated list of document types - * @param {<>, <>, <>} params.fields - A comma-separated list of fields - */ -api.indices.prototype.getFieldMapping = ca({ - params: { - includeDefaults: { - type: 'boolean', - name: 'include_defaults' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_mapping/<%=type%>/field/<%=fields%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - }, - fields: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_mapping/field/<%=fields%>', - req: { - index: { - type: 'list' - }, - fields: { - type: 'list' - } - } - }, - { - fmt: '/_mapping/<%=type%>/field/<%=fields%>', - req: { - type: { - type: 'list' - }, - fields: { - type: 'list' - } - } - }, - { - fmt: '/_mapping/field/<%=fields%>', - req: { - fields: { - type: 'list' - } - } - } - ] -}); - -/** - * Perform a [indices.getMapping](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-get-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} params.type - A comma-separated list of document types - */ -api.indices.prototype.getMapping = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_mapping/<%=type%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_mapping', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_mapping/<%=type%>', - req: { - type: { - type: 'list' - } - } - }, - { - fmt: '/_mapping' - } - ] -}); - -/** - * Perform a [indices.getSettings](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-get-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open,closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.includeDefaults - Whether to return all default setting for each of the indices. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.name - The name of the settings that should be included - */ -api.indices.prototype.getSettings = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': [ - 'open', - 'closed' - ], - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - local: { - type: 'boolean' - }, - includeDefaults: { - type: 'boolean', - 'default': false, - name: 'include_defaults' - } - }, - urls: [ - { - fmt: '/<%=index%>/_settings/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_settings', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_settings/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/_settings' - } - ] -}); - -/** - * Perform a [indices.getTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.name - The comma separated names of the index templates - */ -api.indices.prototype.getTemplate = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/_template' - } - ] -}); - -/** - * Perform a [indices.getUpgrade](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-upgrade.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.getUpgrade = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_upgrade', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_upgrade' - } - ] -}); - -/** - * Perform a [indices.open](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-open-close.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma separated list of indices to open - */ -api.indices.prototype.open = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'closed', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - url: { - fmt: '/<%=index%>/_open', - req: { - index: { - type: 'list' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [indices.putAlias](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit timestamp for the document - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices. - * @param {<>} params.name - The name of the alias to be created or updated - */ -api.indices.prototype.putAlias = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'string' - } - } - }, - method: 'PUT' -}); - -/** - * Perform a [indices.putMapping](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-put-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.updateAllTypes - Whether to update the mapping for all fields with the same name across all types or not - * @param {<>, <>, <>} params.index - A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices. - * @param {<>} params.type - The name of the document type - */ -api.indices.prototype.putMapping = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - updateAllTypes: { - type: 'boolean', - name: 'update_all_types' - } - }, - urls: [ - { - fmt: '/<%=index%>/_mapping/<%=type%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/_mapping/<%=type%>', - req: { - type: { - type: 'string' - } - } - } - ], - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [indices.putSettings](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.preserveExisting - Whether to update existing settings. If set to `true` existing settings on an index remain unchanged, the default is `false` - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.putSettings = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - preserveExisting: { - type: 'boolean', - name: 'preserve_existing' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - } - }, - urls: [ - { - fmt: '/<%=index%>/_settings', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_settings' - } - ], - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [indices.putTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.order - The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers) - * @param {<>} params.create - Whether the index template should only be added if new or can also replace an existing one - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.name - The name of the template - */ -api.indices.prototype.putTemplate = ca({ - params: { - order: { - type: 'number' - }, - create: { - type: 'boolean', - 'default': false - }, - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - } - }, - url: { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [indices.recovery](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-recovery.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.detailed - Whether to display detailed information about shard recovery - * @param {<>} params.activeOnly - Display only those recoveries that are currently on-going - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.recovery = ca({ - params: { - detailed: { - type: 'boolean', - 'default': false - }, - activeOnly: { - type: 'boolean', - 'default': false, - name: 'active_only' - } - }, - urls: [ - { - fmt: '/<%=index%>/_recovery', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_recovery' - } - ] -}); - -/** - * Perform a [indices.refresh](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-refresh.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.refresh = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_refresh', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_refresh' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.rollover](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-rollover-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.dryRun - If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for on the newly created rollover index before the operation returns. - * @param {<>} params.alias - The name of the alias to rollover - * @param {<>} params.newIndex - The name of the rollover index - */ -api.indices.prototype.rollover = ca({ - params: { - timeout: { - type: 'time' - }, - dryRun: { - type: 'boolean', - name: 'dry_run' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - } - }, - urls: [ - { - fmt: '/<%=alias%>/_rollover/<%=newIndex%>', - req: { - alias: { - type: 'string' - }, - newIndex: { - type: 'string' - } - } - }, - { - fmt: '/<%=alias%>/_rollover', - req: { - alias: { - type: 'string' - } - } - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.segments](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-segments.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.verbose - Includes detailed memory usage by Lucene. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.segments = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - operationThreading: { - name: 'operation_threading' - }, - verbose: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/<%=index%>/_segments', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_segments' - } - ] -}); - -/** - * Perform a [indices.shardStores](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-shards-stores.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.status - A comma-separated list of statuses used to filter on shards to get store information for - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {anything} params.operationThreading - TODO: ? - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.shardStores = ca({ - params: { - status: { - type: 'list', - options: [ - 'green', - 'yellow', - 'red', - 'all' - ] - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - operationThreading: { - name: 'operation_threading' - } - }, - urls: [ - { - fmt: '/<%=index%>/_shard_stores', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_shard_stores' - } - ] -}); - -/** - * Perform a [indices.shrink](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-shrink-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for on the shrunken index before the operation returns. - * @param {<>} params.index - The name of the source index to shrink - * @param {<>} params.target - The name of the target index to shrink into - */ -api.indices.prototype.shrink = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - } - }, - url: { - fmt: '/<%=index%>/_shrink/<%=target%>', - req: { - index: { - type: 'string' - }, - target: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [indices.stats](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.completionFields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields for `fielddata` index metric (supports wildcards) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) - * @param {<>, <>, <>} params.groups - A comma-separated list of search groups for `search` index metric - * @param {<>} [params.level=indices] - Return stats aggregated at cluster, index or shard level - * @param {<>, <>, <>} params.types - A comma-separated list of document types for the `indexing` index metric - * @param {<>} params.includeSegmentFileSizes - Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.metric - Limit the information returned the specific metrics. - */ -api.indices.prototype.stats = ca({ - params: { - completionFields: { - type: 'list', - name: 'completion_fields' - }, - fielddataFields: { - type: 'list', - name: 'fielddata_fields' - }, - fields: { - type: 'list' - }, - groups: { - type: 'list' - }, - level: { - type: 'enum', - 'default': 'indices', - options: [ - 'cluster', - 'indices', - 'shards' - ] - }, - types: { - type: 'list' - }, - includeSegmentFileSizes: { - type: 'boolean', - 'default': false, - name: 'include_segment_file_sizes' - } - }, - urls: [ - { - fmt: '/<%=index%>/_stats/<%=metric%>', - req: { - index: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'percolate', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/_stats/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'percolate', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/<%=index%>/_stats', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_stats' - } - ] -}); - -/** - * Perform a [indices.updateAliases](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Request timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - */ -api.indices.prototype.updateAliases = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_aliases' - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [indices.upgrade](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-upgrade.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.waitForCompletion - Specify whether the request should block until the all segments are upgraded (default: false) - * @param {<>} params.onlyAncientSegments - If true, only ancient (an older Lucene major release) segments will be upgraded - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.upgrade = ca({ - params: { - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - waitForCompletion: { - type: 'boolean', - name: 'wait_for_completion' - }, - onlyAncientSegments: { - type: 'boolean', - name: 'only_ancient_segments' - } - }, - urls: [ - { - fmt: '/<%=index%>/_upgrade', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_upgrade' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.validateQuery](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-validate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.explain - Return detailed information about the error - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.rewrite - Provide a more detailed explanation showing the actual Lucene query that will be executed. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to restrict the operation; leave empty to perform the operation on all types - */ -api.indices.prototype.validateQuery = ca({ - params: { - explain: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - operationThreading: { - name: 'operation_threading' - }, - q: { - type: 'string' - }, - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - lenient: { - type: 'boolean' - }, - rewrite: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_validate/query', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_validate/query', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_validate/query' - } - ], - method: 'POST' -}); - -/** - * Perform a [info](https://www.elastic.co/guide/) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.info = ca({ - url: { - fmt: '/' - } -}); - -api.ingest = namespace(); - -/** - * Perform a [ingest.deletePipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/5.3/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.id - Pipeline ID - */ -api.ingest.prototype.deletePipeline = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_ingest/pipeline/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [ingest.getPipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/5.3/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.id - Comma separated list of pipeline ids. Wildcards supported - */ -api.ingest.prototype.getPipeline = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - urls: [ - { - fmt: '/_ingest/pipeline/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - { - fmt: '/_ingest/pipeline' - } - ] -}); - -/** - * Perform a [ingest.putPipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/5.3/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.id - Pipeline ID - */ -api.ingest.prototype.putPipeline = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_ingest/pipeline/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [ingest.simulate](https://www.elastic.co/guide/en/elasticsearch/plugins/5.3/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.verbose - Verbose mode. Display data output for each processor in executed pipeline - * @param {<>} params.id - Pipeline ID - */ -api.ingest.prototype.simulate = ca({ - params: { - verbose: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_ingest/pipeline/<%=id%>/_simulate', - req: { - id: { - type: 'string' - } - } - }, - { - fmt: '/_ingest/pipeline/_simulate' - } - ], - needBody: true, - method: 'POST' -}); - -/** - * Perform a [mget](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-multi-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.mget = ca({ - params: { - storedFields: { - type: 'list', - name: 'stored_fields' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_mget', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_mget', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_mget' - } - ], - needBody: true, - method: 'POST' -}); - -/** - * Perform a [mpercolate](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-percolate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.index - The index of the document being count percolated to use as default - * @param {<>} params.type - The type of the document being percolated to use as default. - */ -api.mpercolate = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_mpercolate', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_mpercolate', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_mpercolate' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -/** - * Perform a [msearch](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-multi-search.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.searchType - Search operation type - * @param {<>} params.maxConcurrentSearches - Controls the maximum number of concurrent searches the multi search api will execute - * @param {<>, <>, <>} params.index - A comma-separated list of index names to use as default - * @param {<>, <>, <>} params.type - A comma-separated list of document types to use as default - */ -api.msearch = ca({ - params: { - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'query_and_fetch', - 'dfs_query_then_fetch', - 'dfs_query_and_fetch' - ], - name: 'search_type' - }, - maxConcurrentSearches: { - type: 'number', - name: 'max_concurrent_searches' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_msearch', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_msearch', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_msearch' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -/** - * Perform a [msearchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.searchType - Search operation type - * @param {<>, <>, <>} params.index - A comma-separated list of index names to use as default - * @param {<>, <>, <>} params.type - A comma-separated list of document types to use as default - */ -api.msearchTemplate = ca({ - params: { - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'query_and_fetch', - 'dfs_query_then_fetch', - 'dfs_query_and_fetch' - ], - name: 'search_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_msearch/template', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_msearch/template', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_msearch/template' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -/** - * Perform a [mtermvectors](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-multi-termvectors.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.ids - A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body - * @param {<>} params.termStatistics - Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.fieldStatistics=true] - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.offsets=true] - Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.positions=true] - Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.payloads=true] - Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) .Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.routing - Specific routing value. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.parent - Parent id of documents. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.realtime - Specifies if requests are real-time as opposed to near-real-time (default: true). - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index in which the document resides. - * @param {<>} params.type - The type of the document. - */ -api.mtermvectors = ca({ - params: { - ids: { - type: 'list', - required: false - }, - termStatistics: { - type: 'boolean', - 'default': false, - required: false, - name: 'term_statistics' - }, - fieldStatistics: { - type: 'boolean', - 'default': true, - required: false, - name: 'field_statistics' - }, - fields: { - type: 'list', - required: false - }, - offsets: { - type: 'boolean', - 'default': true, - required: false - }, - positions: { - type: 'boolean', - 'default': true, - required: false - }, - payloads: { - type: 'boolean', - 'default': true, - required: false - }, - preference: { - type: 'string', - required: false - }, - routing: { - type: 'string', - required: false - }, - parent: { - type: 'string', - required: false - }, - realtime: { - type: 'boolean', - required: false - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_mtermvectors', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_mtermvectors', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_mtermvectors' - } - ], - method: 'POST' -}); - -api.nodes = namespace(); - -/** - * Perform a [nodes.hotThreads](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cluster-nodes-hot-threads.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.interval - The interval for the second sampling of threads - * @param {<>} params.snapshots - Number of samples of thread stacktrace (default: 10) - * @param {<>} params.threads - Specify the number of threads to provide information for (default: 3) - * @param {<>} params.ignoreIdleThreads - Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue (default: true) - * @param {<>} params.type - The type to sample (default: cpu) - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - */ -api.nodes.prototype.hotThreads = ca({ - params: { - interval: { - type: 'time' - }, - snapshots: { - type: 'number' - }, - threads: { - type: 'number' - }, - ignoreIdleThreads: { - type: 'boolean', - name: 'ignore_idle_threads' - }, - type: { - type: 'enum', - options: [ - 'cpu', - 'wait', - 'block' - ] - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_nodes/<%=nodeId%>/hotthreads', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_nodes/hotthreads' - } - ] -}); - -/** - * Perform a [nodes.info](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cluster-nodes-info.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.metric - A comma-separated list of metrics you wish returned. Leave empty to return all. - */ -api.nodes.prototype.info = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_nodes/<%=nodeId%>/<%=metric%>', - req: { - nodeId: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - 'settings', - 'os', - 'process', - 'jvm', - 'thread_pool', - 'transport', - 'http', - 'plugins', - 'ingest' - ] - } - } - }, - { - fmt: '/_nodes/<%=nodeId%>', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_nodes/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - 'settings', - 'os', - 'process', - 'jvm', - 'thread_pool', - 'transport', - 'http', - 'plugins', - 'ingest' - ] - } - } - }, - { - fmt: '/_nodes' - } - ] -}); - -/** - * Perform a [nodes.stats](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/cluster-nodes-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.completionFields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields for `fielddata` index metric (supports wildcards) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) - * @param {<>} params.groups - A comma-separated list of search groups for `search` index metric - * @param {<>} [params.level=node] - Return indices stats aggregated at index, node or shard level - * @param {<>, <>, <>} params.types - A comma-separated list of document types for the `indexing` index metric - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.includeSegmentFileSizes - Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics - * @param {<>, <>, <>} params.indexMetric - Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified. - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - */ -api.nodes.prototype.stats = ca({ - params: { - completionFields: { - type: 'list', - name: 'completion_fields' - }, - fielddataFields: { - type: 'list', - name: 'fielddata_fields' - }, - fields: { - type: 'list' - }, - groups: { - type: 'boolean' - }, - level: { - type: 'enum', - 'default': 'node', - options: [ - 'indices', - 'node', - 'shards' - ] - }, - types: { - type: 'list' - }, - timeout: { - type: 'time' - }, - includeSegmentFileSizes: { - type: 'boolean', - 'default': false, - name: 'include_segment_file_sizes' - } - }, - urls: [ - { - fmt: '/_nodes/<%=nodeId%>/stats/<%=metric%>/<%=indexMetric%>', - req: { - nodeId: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport', - 'discovery' - ] - }, - indexMetric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'percolate', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/_nodes/<%=nodeId%>/stats/<%=metric%>', - req: { - nodeId: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport', - 'discovery' - ] - } - } - }, - { - fmt: '/_nodes/stats/<%=metric%>/<%=indexMetric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport', - 'discovery' - ] - }, - indexMetric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'percolate', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/_nodes/<%=nodeId%>/stats', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_nodes/stats/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport', - 'discovery' - ] - } - } - }, - { - fmt: '/_nodes/stats' - } - ] -}); - -/** - * Perform a [percolate](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-percolate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.percolateIndex - The index to percolate the document into. Defaults to index. - * @param {<>} params.percolateType - The type to percolate document into. Defaults to type. - * @param {<>} params.percolateRouting - The routing value to use when percolating the existing document. - * @param {<>} params.percolatePreference - Which shard to prefer when executing the percolate request. - * @param {<>} params.percolateFormat - Return an array of matching query IDs instead of objects - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index of the document being percolated. - * @param {<>} params.type - The type of the document being percolated. - * @param {<>} params.id - Substitute the document in the request body with a document that is known by the specified id. On top of the id, the index and type parameter will be used to retrieve the document from within the cluster. - */ -api.percolate = ca({ - params: { - routing: { - type: 'list' - }, - preference: { - type: 'string' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - percolateIndex: { - type: 'string', - name: 'percolate_index' - }, - percolateType: { - type: 'string', - name: 'percolate_type' - }, - percolateRouting: { - type: 'string', - name: 'percolate_routing' - }, - percolatePreference: { - type: 'string', - name: 'percolate_preference' - }, - percolateFormat: { - type: 'enum', - options: [ - 'ids' - ], - name: 'percolate_format' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_percolate', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/<%=type%>/_percolate', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - } - ], - method: 'POST' -}); - -/** - * Perform a [ping](https://www.elastic.co/guide/) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.ping = ca({ - url: { - fmt: '/' - }, - requestTimeout: 3000, - method: 'HEAD' -}); - -/** - * Perform a [putScript](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Script ID - * @param {<>} params.lang - Script language - */ -api.putScript = ca({ - urls: [ - { - fmt: '/_scripts/<%=lang%>/<%=id%>', - req: { - lang: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/_scripts/<%=lang%>', - req: { - lang: { - type: 'string' - } - } - } - ], - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [putTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Template ID - */ -api.putTemplate = ca({ - url: { - fmt: '/_search/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [reindex](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-reindex.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the reindex operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} [params.waitForCompletion=true] - Should the request should block until the reindex is complete. - * @param {<>} params.requestsPerSecond - The throttle to set on this request in sub-requests per second. -1 means no throttle. - * @param {<>} [params.slices=1] - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. - */ -api.reindex = ca({ - params: { - refresh: { - type: 'boolean' - }, - timeout: { - type: 'time', - 'default': '1m' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - waitForCompletion: { - type: 'boolean', - 'default': true, - name: 'wait_for_completion' - }, - requestsPerSecond: { - type: 'number', - 'default': 0, - name: 'requests_per_second' - }, - slices: { - type: 'number', - 'default': 1 - } - }, - url: { - fmt: '/_reindex' - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [reindexRethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-reindex.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.requestsPerSecond - The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. - * @param {<>} params.taskId - The task id to rethrottle - */ -api.reindexRethrottle = ca({ - params: { - requestsPerSecond: { - type: 'number', - required: true, - name: 'requests_per_second' - } - }, - url: { - fmt: '/_reindex/<%=taskId%>/_rethrottle', - req: { - taskId: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [renderSearchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - The id of the stored search template - */ -api.renderSearchTemplate = ca({ - urls: [ - { - fmt: '/_render/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - { - fmt: '/_render/template' - } - ], - method: 'POST' -}); - -/** - * Perform a [scroll](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-request-scroll.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.scrollId - The scroll ID - */ -api.scroll = ca({ - params: { - scroll: { - type: 'time' - }, - scrollId: { - type: 'string', - name: 'scroll_id' - } - }, - urls: [ - { - fmt: '/_search/scroll/<%=scrollId%>', - req: { - scrollId: { - type: 'string' - } - } - }, - { - fmt: '/_search/scroll' - } - ], - paramAsBody: { - param: 'scrollId', - body: 'scroll_id' - }, - method: 'POST' -}); - -/** - * Perform a [search](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-search.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.explain - Specify whether to return detailed information about score computation as part of a hit - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return as part of a hit - * @param {<>, <>, <>} params.docvalueFields - A comma-separated list of fields to return as the docvalue representation of a field for each hit - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields to return as the docvalue representation of a field for each hit - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.suggestField - Specify which field to use for suggestions - * @param {<>} [params.suggestMode=missing] - Specify suggest mode - * @param {<>} params.suggestSize - How many suggestions to return in response - * @param {<>} params.suggestText - The source text for which the suggestions should be returned - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.trackScores - Whether to calculate and return scores even if they are not used for sorting - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.search = ca({ - params: { - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - explain: { - type: 'boolean' - }, - storedFields: { - type: 'list', - name: 'stored_fields' - }, - docvalueFields: { - type: 'list', - name: 'docvalue_fields' - }, - fielddataFields: { - type: 'list', - name: 'fielddata_fields' - }, - from: { - type: 'number' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - lenient: { - type: 'boolean' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'dfs_query_then_fetch' - ], - name: 'search_type' - }, - size: { - type: 'number' - }, - sort: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - terminateAfter: { - type: 'number', - name: 'terminate_after' - }, - stats: { - type: 'list' - }, - suggestField: { - type: 'string', - name: 'suggest_field' - }, - suggestMode: { - type: 'enum', - 'default': 'missing', - options: [ - 'missing', - 'popular', - 'always' - ], - name: 'suggest_mode' - }, - suggestSize: { - type: 'number', - name: 'suggest_size' - }, - suggestText: { - type: 'string', - name: 'suggest_text' - }, - timeout: { - type: 'time' - }, - trackScores: { - type: 'boolean', - name: 'track_scores' - }, - version: { - type: 'boolean' - }, - requestCache: { - type: 'boolean', - name: 'request_cache' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_search', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_search', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_search' - } - ], - method: 'POST' -}); - -/** - * Perform a [searchShards](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-shards.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.searchShards = ca({ - params: { - preference: { - type: 'string' - }, - routing: { - type: 'string' - }, - local: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_search_shards', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_search_shards', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_search_shards' - } - ], - method: 'POST' -}); - -/** - * Perform a [searchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.explain - Specify whether to return detailed information about score computation as part of a hit - * @param {<>} params.profile - Specify whether to profile the query execution - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.searchTemplate = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - preference: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'query_and_fetch', - 'dfs_query_then_fetch', - 'dfs_query_and_fetch' - ], - name: 'search_type' - }, - explain: { - type: 'boolean' - }, - profile: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_search/template', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_search/template', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_search/template' - } - ], - method: 'POST' -}); - -api.snapshot = namespace(); - -/** - * Perform a [snapshot.create](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.waitForCompletion - Should this request wait until the operation has completed before returning - * @param {<>} params.repository - A repository name - * @param {<>} params.snapshot - A snapshot name - */ -api.snapshot.prototype.create = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForCompletion: { - type: 'boolean', - 'default': false, - name: 'wait_for_completion' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [snapshot.createRepository](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.verify - Whether to verify the repository after creation - * @param {<>} params.repository - A repository name - */ -api.snapshot.prototype.createRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - }, - verify: { - type: 'boolean' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>', - req: { - repository: { - type: 'string' - } - } - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [snapshot.delete](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.repository - A repository name - * @param {<>} params.snapshot - A snapshot name - */ -api.snapshot.prototype['delete'] = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [snapshot.deleteRepository](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.repository - A comma-separated list of repository names - */ -api.snapshot.prototype.deleteRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>', - req: { - repository: { - type: 'list' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [snapshot.get](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.ignoreUnavailable - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown - * @param {<>} params.repository - A repository name - * @param {<>, <>, <>} params.snapshot - A comma-separated list of snapshot names - */ -api.snapshot.prototype.get = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'list' - } - } - } -}); - -/** - * Perform a [snapshot.getRepository](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.repository - A comma-separated list of repository names - */ -api.snapshot.prototype.getRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/_snapshot/<%=repository%>', - req: { - repository: { - type: 'list' - } - } - }, - { - fmt: '/_snapshot' - } - ] -}); - -/** - * Perform a [snapshot.restore](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.waitForCompletion - Should this request wait until the operation has completed before returning - * @param {<>} params.repository - A repository name - * @param {<>} params.snapshot - A snapshot name - */ -api.snapshot.prototype.restore = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForCompletion: { - type: 'boolean', - 'default': false, - name: 'wait_for_completion' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>/_restore', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [snapshot.status](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.ignoreUnavailable - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown - * @param {<>} params.repository - A repository name - * @param {<>, <>, <>} params.snapshot - A comma-separated list of snapshot names - */ -api.snapshot.prototype.status = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - } - }, - urls: [ - { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>/_status', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'list' - } - } - }, - { - fmt: '/_snapshot/<%=repository%>/_status', - req: { - repository: { - type: 'string' - } - } - }, - { - fmt: '/_snapshot/_status' - } - ] -}); - -/** - * Perform a [snapshot.verifyRepository](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.repository - A repository name - */ -api.snapshot.prototype.verifyRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/_verify', - req: { - repository: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [suggest](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-suggesters.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params.index - A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices - */ -api.suggest = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - preference: { - type: 'string' - }, - routing: { - type: 'string' - } - }, - urls: [ - { - fmt: '/<%=index%>/_suggest', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_suggest' - } - ], - needBody: true, - method: 'POST' -}); - -api.tasks = namespace(); - -/** - * Perform a [tasks.cancel](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.actions - A comma-separated list of actions that should be cancelled. Leave empty to cancel all. - * @param {<>} params.parentNode - Cancel tasks with specified parent node. - * @param {<>} params.parentTask - Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all. - * @param {<>} params.taskId - Cancel the task with specified task id (node_id:task_number) - */ -api.tasks.prototype.cancel = ca({ - params: { - nodeId: { - type: 'list', - name: 'node_id' - }, - actions: { - type: 'list' - }, - parentNode: { - type: 'string', - name: 'parent_node' - }, - parentTask: { - type: 'string', - name: 'parent_task' - } - }, - urls: [ - { - fmt: '/_tasks/<%=taskId%>/_cancel', - req: { - taskId: { - type: 'string' - } - } - }, - { - fmt: '/_tasks/_cancel' - } - ], - method: 'POST' -}); - -/** - * Perform a [tasks.get](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForCompletion - Wait for the matching tasks to complete (default: false) - * @param {<>} params.taskId - Return the task with specified id (node_id:task_number) - */ -api.tasks.prototype.get = ca({ - params: { - waitForCompletion: { - type: 'boolean', - name: 'wait_for_completion' - } - }, - url: { - fmt: '/_tasks/<%=taskId%>', - req: { - taskId: { - type: 'string' - } - } - } -}); - -/** - * Perform a [tasks.list](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.actions - A comma-separated list of actions that should be returned. Leave empty to return all. - * @param {<>} params.detailed - Return detailed task information (default: false) - * @param {<>} params.parentNode - Return tasks with specified parent node. - * @param {<>} params.parentTask - Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all. - * @param {<>} params.waitForCompletion - Wait for the matching tasks to complete (default: false) - * @param {<>} [params.groupBy=nodes] - Group tasks by nodes or parent/child relationships - */ -api.tasks.prototype.list = ca({ - params: { - nodeId: { - type: 'list', - name: 'node_id' - }, - actions: { - type: 'list' - }, - detailed: { - type: 'boolean' - }, - parentNode: { - type: 'string', - name: 'parent_node' - }, - parentTask: { - type: 'string', - name: 'parent_task' - }, - waitForCompletion: { - type: 'boolean', - name: 'wait_for_completion' - }, - groupBy: { - type: 'enum', - 'default': 'nodes', - options: [ - 'nodes', - 'parents' - ], - name: 'group_by' - } - }, - url: { - fmt: '/_tasks' - } -}); - -/** - * Perform a [termvectors](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-termvectors.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.termStatistics - Specifies if total term frequency and document frequency should be returned. - * @param {<>} [params.fieldStatistics=true] - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return. - * @param {<>} [params.offsets=true] - Specifies if term offsets should be returned. - * @param {<>} [params.positions=true] - Specifies if term positions should be returned. - * @param {<>} [params.payloads=true] - Specifies if term payloads should be returned. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random). - * @param {<>} params.routing - Specific routing value. - * @param {<>} params.parent - Parent id of documents. - * @param {<>} params.realtime - Specifies if request is real-time as opposed to near-real-time (default: true). - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index in which the document resides. - * @param {<>} params.type - The type of the document. - * @param {<>} params.id - The id of the document, when not specified a doc param should be supplied. - */ -api.termvectors = ca({ - params: { - termStatistics: { - type: 'boolean', - 'default': false, - required: false, - name: 'term_statistics' - }, - fieldStatistics: { - type: 'boolean', - 'default': true, - required: false, - name: 'field_statistics' - }, - fields: { - type: 'list', - required: false - }, - offsets: { - type: 'boolean', - 'default': true, - required: false - }, - positions: { - type: 'boolean', - 'default': true, - required: false - }, - payloads: { - type: 'boolean', - 'default': true, - required: false - }, - preference: { - type: 'string', - required: false - }, - routing: { - type: 'string', - required: false - }, - parent: { - type: 'string', - required: false - }, - realtime: { - type: 'boolean', - required: false - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_termvectors', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/<%=type%>/_termvectors', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - } - ], - method: 'POST' -}); - -/** - * Perform a [update](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-update.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the update operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return in the response - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.lang - The script language (default: painless) - * @param {<>} params.parent - ID of the parent document. Is is only used for routing and when for the upsert request - * @param {<>} params.refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.retryOnConflict - Specify how many times should the operation be retried when a conflict occurs (default: 0) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.update = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - fields: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - lang: { - type: 'string' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - retryOnConflict: { - type: 'number', - name: 'retry_on_conflict' - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - timestamp: { - type: 'time' - }, - ttl: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_update', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [updateByQuery](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-update-by-query.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.conflicts=abort] - What to do when the update by query hits version conflicts? - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.pipeline - Ingest pipeline to set on index requests made by this action. (default: none) - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.searchTimeout - Explicit timeout for each search request. Defaults to no timeout. - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.versionType - Should the document increment the version number (internal) on hit or not (reindex) - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the update by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.scrollSize - Size on the scroll request powering the update_by_query - * @param {<>} [params.waitForCompletion=true] - Should the request should block until the update by query operation is complete. - * @param {<>} params.requestsPerSecond - The throttle to set on this request in sub-requests per second. -1 means no throttle. - * @param {<>} [params.slices=1] - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.updateByQuery = ca({ - params: { - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - from: { - type: 'number' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - conflicts: { - type: 'enum', - 'default': 'abort', - options: [ - 'abort', - 'proceed' - ] - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - lenient: { - type: 'boolean' - }, - pipeline: { - type: 'string' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'dfs_query_then_fetch' - ], - name: 'search_type' - }, - searchTimeout: { - type: 'time', - name: 'search_timeout' - }, - size: { - type: 'number' - }, - sort: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - terminateAfter: { - type: 'number', - name: 'terminate_after' - }, - stats: { - type: 'list' - }, - version: { - type: 'boolean' - }, - versionType: { - type: 'boolean', - name: 'version_type' - }, - requestCache: { - type: 'boolean', - name: 'request_cache' - }, - refresh: { - type: 'boolean' - }, - timeout: { - type: 'time', - 'default': '1m' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - scrollSize: { - type: 'number', - name: 'scroll_size' - }, - waitForCompletion: { - type: 'boolean', - 'default': true, - name: 'wait_for_completion' - }, - requestsPerSecond: { - type: 'number', - 'default': 0, - name: 'requests_per_second' - }, - slices: { - type: 'number', - 'default': 1 - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_update_by_query', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_update_by_query', - req: { - index: { - type: 'list' - } - } - } - ], - method: 'POST' -}); diff --git a/src/lib/apis/5_4.js b/src/lib/apis/5_4.js deleted file mode 100644 index 15db9d71f..000000000 --- a/src/lib/apis/5_4.js +++ /dev/null @@ -1,7351 +0,0 @@ -var ca = require('../client_action').makeFactoryWithModifier(function (spec) { - return require('../utils').merge(spec, { - params: { - filterPath: { - type: 'list', - name: 'filter_path' - } - } - }); -}); -var namespace = require('../client_action').namespaceFactory; -var api = module.exports = {}; - -api._namespaces = ['cat', 'cluster', 'indices', 'ingest', 'nodes', 'remote', 'snapshot', 'tasks']; - -/** - * Perform a [bulk](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-bulk.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the bulk operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.type - Default document type for items which don't provide one - * @param {<>, <>, <>} params.fields - Default comma-separated list of fields to return in the response for updates, can be overridden on each sub-request - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request - * @param {<>, <>, <>} params._sourceExclude - Default list of fields to exclude from the returned _source field, can be overridden on each sub-request - * @param {<>, <>, <>} params._sourceInclude - Default list of fields to extract and return from the _source field, can be overridden on each sub-request - * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with - * @param {<>} params.index - Default index for items which don't provide one - */ -api.bulk = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - type: { - type: 'string' - }, - fields: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - pipeline: { - type: 'string' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_bulk', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_bulk', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_bulk' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -api.cat = namespace(); - -/** - * Perform a [cat.aliases](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.name - A comma-separated list of alias names to return - */ -api.cat.prototype.aliases = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/aliases/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/_cat/aliases' - } - ] -}); - -/** - * Perform a [cat.allocation](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-allocation.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information - */ -api.cat.prototype.allocation = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'kb', - 'm', - 'mb', - 'g', - 'gb', - 't', - 'tb', - 'p', - 'pb' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/allocation/<%=nodeId%>', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_cat/allocation' - } - ] -}); - -/** - * Perform a [cat.count](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-count.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.count = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/count/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/count' - } - ] -}); - -/** - * Perform a [cat.fielddata](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-fielddata.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return the fielddata size - */ -api.cat.prototype.fielddata = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'kb', - 'm', - 'mb', - 'g', - 'gb', - 't', - 'tb', - 'p', - 'pb' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - }, - fields: { - type: 'list' - } - }, - urls: [ - { - fmt: '/_cat/fielddata/<%=fields%>', - req: { - fields: { - type: 'list' - } - } - }, - { - fmt: '/_cat/fielddata' - } - ] -}); - -/** - * Perform a [cat.health](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-health.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} [params.ts=true] - Set to false to disable timestamping - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.health = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - ts: { - type: 'boolean', - 'default': true - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/health' - } -}); - -/** - * Perform a [cat.help](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - */ -api.cat.prototype.help = ca({ - params: { - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - } - }, - url: { - fmt: '/_cat' - } -}); - -/** - * Perform a [cat.indices](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-indices.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.health - A health status ("green", "yellow", or "red" to filter only indices matching the specified health status - * @param {<>} params.help - Return help information - * @param {<>} params.pri - Set to true to return stats only for primary shards - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.indices = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'm', - 'g' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - health: { - type: 'enum', - 'default': null, - options: [ - 'green', - 'yellow', - 'red' - ] - }, - help: { - type: 'boolean', - 'default': false - }, - pri: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/indices/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/indices' - } - ] -}); - -/** - * Perform a [cat.master](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-master.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.master = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/master' - } -}); - -/** - * Perform a [cat.nodeattrs](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-nodeattrs.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.nodeattrs = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/nodeattrs' - } -}); - -/** - * Perform a [cat.nodes](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-nodes.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.fullId - Return the full node ID instead of the shortened version (default: false) - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.nodes = ca({ - params: { - format: { - type: 'string' - }, - fullId: { - type: 'boolean', - name: 'full_id' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/nodes' - } -}); - -/** - * Perform a [cat.pendingTasks](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-pending-tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.pendingTasks = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/pending_tasks' - } -}); - -/** - * Perform a [cat.plugins](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-plugins.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.plugins = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/plugins' - } -}); - -/** - * Perform a [cat.recovery](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-recovery.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.recovery = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'kb', - 'm', - 'mb', - 'g', - 'gb', - 't', - 'tb', - 'p', - 'pb' - ] - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/recovery/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/recovery' - } - ] -}); - -/** - * Perform a [cat.repositories](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-repositories.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.repositories = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean', - 'default': false - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/repositories' - } -}); - -/** - * Perform a [cat.segments](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-segments.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.segments = ca({ - params: { - format: { - type: 'string' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/segments/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/segments' - } - ] -}); - -/** - * Perform a [cat.shards](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-shards.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.shards = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/shards/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/shards' - } - ] -}); - -/** - * Perform a [cat.snapshots](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.ignoreUnavailable - Set to true to ignore unavailable snapshots - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.repository - Name of repository from which to fetch the snapshot information - */ -api.cat.prototype.snapshots = ca({ - params: { - format: { - type: 'string' - }, - ignoreUnavailable: { - type: 'boolean', - 'default': false, - name: 'ignore_unavailable' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/snapshots/<%=repository%>', - req: { - repository: { - type: 'list' - } - } - }, - { - fmt: '/_cat/snapshots' - } - ] -}); - -/** - * Perform a [cat.tasks](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.actions - A comma-separated list of actions that should be returned. Leave empty to return all. - * @param {<>} params.detailed - Return detailed task information (default: false) - * @param {<>} params.parentNode - Return tasks with specified parent node. - * @param {<>} params.parentTask - Return tasks with specified parent task id. Set to -1 to return all. - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.tasks = ca({ - params: { - format: { - type: 'string' - }, - nodeId: { - type: 'list', - name: 'node_id' - }, - actions: { - type: 'list' - }, - detailed: { - type: 'boolean' - }, - parentNode: { - type: 'string', - name: 'parent_node' - }, - parentTask: { - type: 'number', - name: 'parent_task' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/tasks' - } -}); - -/** - * Perform a [cat.templates](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>} params.name - A pattern that returned template names must match - */ -api.cat.prototype.templates = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/templates/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - { - fmt: '/_cat/templates' - } - ] -}); - -/** - * Perform a [cat.threadPool](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cat-thread-pool.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.size - The multiplier in which to display values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.threadPoolPatterns - A comma-separated list of regular-expressions to filter the thread pools in the output - */ -api.cat.prototype.threadPool = ca({ - params: { - format: { - type: 'string' - }, - size: { - type: 'enum', - options: [ - '', - 'k', - 'm', - 'g', - 't', - 'p' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/thread_pool/<%=threadPoolPatterns%>', - req: { - threadPoolPatterns: { - type: 'list' - } - } - }, - { - fmt: '/_cat/thread_pool' - } - ] -}); - -/** - * Perform a [clearScroll](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-request-scroll.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.scrollId - A comma-separated list of scroll IDs to clear - */ -api.clearScroll = ca({ - urls: [ - { - fmt: '/_search/scroll/<%=scrollId%>', - req: { - scrollId: { - type: 'list' - } - } - }, - { - fmt: '/_search/scroll' - } - ], - paramAsBody: { - param: 'scrollId', - body: 'scroll_id', - castToArray: true - }, - method: 'DELETE' -}); - -api.cluster = namespace(); - -/** - * Perform a [cluster.allocationExplain](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cluster-allocation-explain.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.includeYesDecisions - Return 'YES' decisions in explanation (default: false) - * @param {<>} params.includeDiskInfo - Return information about disk usage and shard sizes (default: false) - */ -api.cluster.prototype.allocationExplain = ca({ - params: { - includeYesDecisions: { - type: 'boolean', - name: 'include_yes_decisions' - }, - includeDiskInfo: { - type: 'boolean', - name: 'include_disk_info' - } - }, - url: { - fmt: '/_cluster/allocation/explain' - }, - method: 'POST' -}); - -/** - * Perform a [cluster.getSettings](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cluster-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.includeDefaults - Whether to return all default clusters setting. - */ -api.cluster.prototype.getSettings = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - }, - includeDefaults: { - type: 'boolean', - 'default': false, - name: 'include_defaults' - } - }, - url: { - fmt: '/_cluster/settings' - } -}); - -/** - * Perform a [cluster.health](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cluster-health.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} [params.level=cluster] - Specify the level of detail for returned information - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.waitForActiveShards - Wait until the specified number of shards is active - * @param {<>} params.waitForNodes - Wait until the specified number of nodes is available - * @param {<>} params.waitForEvents - Wait until all currently queued events with the given priority are processed - * @param {<>} params.waitForNoRelocatingShards - Whether to wait until there are no relocating shards in the cluster - * @param {<>} params.waitForStatus - Wait until cluster is in a specific state - * @param {<>, <>, <>} params.index - Limit the information returned to a specific index - */ -api.cluster.prototype.health = ca({ - params: { - level: { - type: 'enum', - 'default': 'cluster', - options: [ - 'cluster', - 'indices', - 'shards' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - waitForNodes: { - type: 'string', - name: 'wait_for_nodes' - }, - waitForEvents: { - type: 'enum', - options: [ - 'immediate', - 'urgent', - 'high', - 'normal', - 'low', - 'languid' - ], - name: 'wait_for_events' - }, - waitForNoRelocatingShards: { - type: 'boolean', - name: 'wait_for_no_relocating_shards' - }, - waitForStatus: { - type: 'enum', - 'default': null, - options: [ - 'green', - 'yellow', - 'red' - ], - name: 'wait_for_status' - } - }, - urls: [ - { - fmt: '/_cluster/health/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cluster/health' - } - ] -}); - -/** - * Perform a [cluster.pendingTasks](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cluster-pending.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Specify timeout for connection to master - */ -api.cluster.prototype.pendingTasks = ca({ - params: { - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_cluster/pending_tasks' - } -}); - -/** - * Perform a [cluster.putSettings](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cluster-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - */ -api.cluster.prototype.putSettings = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_cluster/settings' - }, - method: 'PUT' -}); - -/** - * Perform a [cluster.reroute](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cluster-reroute.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.dryRun - Simulate the operation only and return the resulting state - * @param {<>} params.explain - Return an explanation of why the commands can or cannot be executed - * @param {<>} params.retryFailed - Retries allocation of shards that are blocked due to too many subsequent allocation failures - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics. Defaults to all but metadata - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - */ -api.cluster.prototype.reroute = ca({ - params: { - dryRun: { - type: 'boolean', - name: 'dry_run' - }, - explain: { - type: 'boolean' - }, - retryFailed: { - type: 'boolean', - name: 'retry_failed' - }, - metric: { - type: 'list', - options: [ - '_all', - 'blocks', - 'metadata', - 'nodes', - 'routing_table', - 'master_node', - 'version' - ] - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_cluster/reroute' - }, - method: 'POST' -}); - -/** - * Perform a [cluster.state](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cluster-state.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics - */ -api.cluster.prototype.state = ca({ - params: { - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/_cluster/state/<%=metric%>/<%=index%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'blocks', - 'metadata', - 'nodes', - 'routing_table', - 'routing_nodes', - 'master_node', - 'version' - ] - }, - index: { - type: 'list' - } - } - }, - { - fmt: '/_cluster/state/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'blocks', - 'metadata', - 'nodes', - 'routing_table', - 'routing_nodes', - 'master_node', - 'version' - ] - } - } - }, - { - fmt: '/_cluster/state' - } - ] -}); - -/** - * Perform a [cluster.stats](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cluster-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - */ -api.cluster.prototype.stats = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_cluster/stats/nodes/<%=nodeId%>', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_cluster/stats' - } - ] -}); - -/** - * Perform a [count](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-count.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.minScore - Include only documents with a specific `_score` value in the result - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>, <>, <>} params.index - A comma-separated list of indices to restrict the results - * @param {<>, <>, <>} params.type - A comma-separated list of types to restrict the results - */ -api.count = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - minScore: { - type: 'number', - name: 'min_score' - }, - preference: { - type: 'string' - }, - routing: { - type: 'string' - }, - q: { - type: 'string' - }, - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - lenient: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_count', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_count', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_count' - } - ], - method: 'POST' -}); - -/** - * Perform a [countPercolate](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-percolate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.percolateIndex - The index to count percolate the document into. Defaults to index. - * @param {<>} params.percolateType - The type to count percolate document into. Defaults to type. - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index of the document being count percolated. - * @param {<>} params.type - The type of the document being count percolated. - * @param {<>} params.id - Substitute the document in the request body with a document that is known by the specified id. On top of the id, the index and type parameter will be used to retrieve the document from within the cluster. - */ -api.countPercolate = ca({ - params: { - routing: { - type: 'list' - }, - preference: { - type: 'string' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - percolateIndex: { - type: 'string', - name: 'percolate_index' - }, - percolateType: { - type: 'string', - name: 'percolate_type' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_percolate/count', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/<%=type%>/_percolate/count', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - } - ], - method: 'POST' -}); - -/** - * Perform a [create](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-index_.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.parent - ID of the parent document - * @param {<>} params.refresh - If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.create = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - timestamp: { - type: 'time' - }, - ttl: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - }, - pipeline: { - type: 'string' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_create', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [delete](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-delete.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the delete operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.parent - ID of parent document - * @param {<>} params.refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api['delete'] = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [deleteByQuery](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-delete-by-query.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.conflicts=abort] - What to do when the delete-by-query hits version conflicts? - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.searchTimeout - Explicit timeout for each search request. Defaults to no timeout. - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the delete by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.scrollSize - Size on the scroll request powering the update_by_query - * @param {<>} [params.waitForCompletion=true] - Should the request should block until the delete-by-query is complete. - * @param {<>} params.requestsPerSecond - The throttle for this request in sub-requests per second. -1 means no throttle. - * @param {<>} [params.slices=1] - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.deleteByQuery = ca({ - params: { - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - from: { - type: 'number' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - conflicts: { - type: 'enum', - 'default': 'abort', - options: [ - 'abort', - 'proceed' - ] - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - lenient: { - type: 'boolean' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'dfs_query_then_fetch' - ], - name: 'search_type' - }, - searchTimeout: { - type: 'time', - name: 'search_timeout' - }, - size: { - type: 'number' - }, - sort: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - terminateAfter: { - type: 'number', - name: 'terminate_after' - }, - stats: { - type: 'list' - }, - version: { - type: 'boolean' - }, - requestCache: { - type: 'boolean', - name: 'request_cache' - }, - refresh: { - type: 'boolean' - }, - timeout: { - type: 'time', - 'default': '1m' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - scrollSize: { - type: 'number', - name: 'scroll_size' - }, - waitForCompletion: { - type: 'boolean', - 'default': true, - name: 'wait_for_completion' - }, - requestsPerSecond: { - type: 'number', - 'default': 0, - name: 'requests_per_second' - }, - slices: { - type: 'number', - 'default': 1 - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_delete_by_query', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_delete_by_query', - req: { - index: { - type: 'list' - } - } - } - ], - needBody: true, - method: 'POST' -}); - -/** - * Perform a [deleteScript](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Script ID - * @param {<>} params.lang - Script language - */ -api.deleteScript = ca({ - urls: [ - { - fmt: '/_scripts/<%=lang%>/<%=id%>', - req: { - lang: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/_scripts/<%=lang%>', - req: { - lang: { - type: 'string' - } - } - } - ], - method: 'DELETE' -}); - -/** - * Perform a [deleteTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Template ID - */ -api.deleteTemplate = ca({ - url: { - fmt: '/_search/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [exists](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document (use `_all` to fetch the first document matching the ID across all types) - */ -api.exists = ca({ - params: { - storedFields: { - type: 'list', - name: 'stored_fields' - }, - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [existsSource](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document; use `_all` to fetch the first document matching the ID across all types - */ -api.existsSource = ca({ - params: { - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_source', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [explain](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-explain.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzeWildcard - Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false) - * @param {<>} params.analyzer - The analyzer for the query string query - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The default field for query string query (default: _all) - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.explain = ca({ - params: { - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - analyzer: { - type: 'string' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - storedFields: { - type: 'list', - name: 'stored_fields' - }, - lenient: { - type: 'boolean' - }, - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_explain', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [fieldCaps](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-field-caps.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.fields - A comma-separated list of field names - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.fieldCaps = ca({ - params: { - fields: { - type: 'list' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_field_caps', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_field_caps' - } - ], - method: 'POST' -}); - -/** - * Perform a [fieldStats](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-field-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for to get field statistics for (min value, max value, and more) - * @param {<>} [params.level=cluster] - Defines if field stats should be returned on a per index level or on a cluster wide level - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.fieldStats = ca({ - params: { - fields: { - type: 'list' - }, - level: { - type: 'enum', - 'default': 'cluster', - options: [ - 'indices', - 'cluster' - ] - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_field_stats', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_field_stats' - } - ], - method: 'POST' -}); - -/** - * Perform a [get](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document (use `_all` to fetch the first document matching the ID across all types) - */ -api.get = ca({ - params: { - storedFields: { - type: 'list', - name: 'stored_fields' - }, - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [getScript](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Script ID - * @param {<>} params.lang - Script language - */ -api.getScript = ca({ - urls: [ - { - fmt: '/_scripts/<%=lang%>/<%=id%>', - req: { - lang: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/_scripts/<%=lang%>', - req: { - lang: { - type: 'string' - } - } - } - ] -}); - -/** - * Perform a [getSource](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document; use `_all` to fetch the first document matching the ID across all types - */ -api.getSource = ca({ - params: { - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_source', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [getTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Template ID - */ -api.getTemplate = ca({ - url: { - fmt: '/_search/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [index](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-index_.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} [params.opType=index] - Explicit operation type - * @param {<>} params.parent - ID of the parent document - * @param {<>} params.refresh - If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.index = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - opType: { - type: 'enum', - 'default': 'index', - options: [ - 'index', - 'create' - ], - name: 'op_type' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - timestamp: { - type: 'time' - }, - ttl: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - }, - pipeline: { - type: 'string' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/<%=type%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - } - ], - needBody: true, - method: 'POST' -}); - -api.indices = namespace(); - -/** - * Perform a [indices.analyze](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-analyze.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The name of the analyzer to use - * @param {<>, <>, <>} params.charFilter - A comma-separated list of character filters to use for the analysis - * @param {<>} params.field - Use the analyzer configured for this field (instead of passing the analyzer name) - * @param {<>, <>, <>} params.filter - A comma-separated list of filters to use for the analysis - * @param {<>} params.index - The name of the index to scope the operation - * @param {<>} params.preferLocal - With `true`, specify that a local shard should be used if available, with `false`, use a random shard (default: true) - * @param {<>, <>, <>} params.text - The text on which the analysis should be performed (when request body is not used) - * @param {<>} params.tokenizer - The name of the tokenizer to use for the analysis - * @param {<>} params.explain - With `true`, outputs more advanced details. (default: false) - * @param {<>, <>, <>} params.attributes - A comma-separated list of token attributes to output, this parameter works only with `explain=true` - * @param {<>} [params.format=detailed] - Format of the output - */ -api.indices.prototype.analyze = ca({ - params: { - analyzer: { - type: 'string' - }, - charFilter: { - type: 'list', - name: 'char_filter' - }, - field: { - type: 'string' - }, - filter: { - type: 'list' - }, - index: { - type: 'string' - }, - preferLocal: { - type: 'boolean', - name: 'prefer_local' - }, - text: { - type: 'list' - }, - tokenizer: { - type: 'string' - }, - explain: { - type: 'boolean' - }, - attributes: { - type: 'list' - }, - format: { - type: 'enum', - 'default': 'detailed', - options: [ - 'detailed', - 'text' - ] - } - }, - urls: [ - { - fmt: '/<%=index%>/_analyze', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_analyze' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.clearCache](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-clearcache.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.fieldData - Clear field data - * @param {<>} params.fielddata - Clear field data - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to clear when using the `field_data` parameter (default: all) - * @param {<>} params.query - Clear query caches - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index name to limit the operation - * @param {<>} params.recycler - Clear the recycler cache - * @param {<>} params.requestCache - Clear request cache - * @param {<>} params.request - Clear request cache - */ -api.indices.prototype.clearCache = ca({ - params: { - fieldData: { - type: 'boolean', - name: 'field_data' - }, - fielddata: { - type: 'boolean' - }, - fields: { - type: 'list' - }, - query: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - index: { - type: 'list' - }, - recycler: { - type: 'boolean' - }, - requestCache: { - type: 'boolean', - name: 'request_cache' - }, - request: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_cache/clear', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cache/clear' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.close](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-open-close.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma separated list of indices to close - */ -api.indices.prototype.close = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - url: { - fmt: '/<%=index%>/_close', - req: { - index: { - type: 'list' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [indices.create](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-create-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for before the operation returns. - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.updateAllTypes - Whether to update the mapping for all fields with the same name across all types or not - * @param {<>} params.index - The name of the index - */ -api.indices.prototype.create = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - updateAllTypes: { - type: 'boolean', - name: 'update_all_types' - } - }, - url: { - fmt: '/<%=index%>', - req: { - index: { - type: 'string' - } - } - }, - method: 'PUT' -}); - -/** - * Perform a [indices.delete](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-delete-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices - */ -api.indices.prototype['delete'] = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [indices.deleteAlias](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit timestamp for the document - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of index names (supports wildcards); use `_all` for all indices - * @param {<>, <>, <>} params.name - A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices. - */ -api.indices.prototype.deleteAlias = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [indices.deleteTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.name - The name of the template - */ -api.indices.prototype.deleteTemplate = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [indices.exists](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-exists.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.ignoreUnavailable - Ignore unavailable indexes (default: false) - * @param {<>} params.allowNoIndices - Ignore if a wildcard expression resolves to no concrete indices (default: false) - * @param {<>} [params.expandWildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (default: open) - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.includeDefaults - Whether to return all default setting for each of the indices. - * @param {<>, <>, <>} params.index - A comma-separated list of index names - */ -api.indices.prototype.exists = ca({ - params: { - local: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - includeDefaults: { - type: 'boolean', - 'default': false, - name: 'include_defaults' - } - }, - url: { - fmt: '/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [indices.existsAlias](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=all] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names to filter aliases - * @param {<>, <>, <>} params.name - A comma-separated list of alias names to return - */ -api.indices.prototype.existsAlias = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'all', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/_alias/<%=name%>', - req: { - name: { - type: 'list' - } - } - } - ], - method: 'HEAD' -}); - -/** - * Perform a [indices.existsTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.name - The comma separated names of the index templates - */ -api.indices.prototype.existsTemplate = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - local: { - type: 'boolean' - } - }, - url: { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [indices.existsType](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-types-exists.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` to check the types across all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to check - */ -api.indices.prototype.existsType = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - url: { - fmt: '/<%=index%>/_mapping/<%=type%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [indices.flush](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-flush.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.force - Whether a flush should be forced even if it is not necessarily needed ie. if no changes will be committed to the index. This is useful if transaction log IDs should be incremented even if no uncommitted changes are present. (This setting can be considered as internal) - * @param {<>} params.waitIfOngoing - If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. The default is true. If set to false the flush will be skipped iff if another flush operation is already running. - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string for all indices - */ -api.indices.prototype.flush = ca({ - params: { - force: { - type: 'boolean' - }, - waitIfOngoing: { - type: 'boolean', - name: 'wait_if_ongoing' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_flush', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_flush' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.flushSynced](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-synced-flush.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string for all indices - */ -api.indices.prototype.flushSynced = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_flush/synced', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_flush/synced' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.forcemerge](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-forcemerge.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flush - Specify whether the index should be flushed after performing the operation (default: true) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.maxNumSegments - The number of segments the index should be merged into (default: dynamic) - * @param {<>} params.onlyExpungeDeletes - Specify whether the operation should only expunge deleted documents - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.waitForMerge - Specify whether the request should block until the merge process is finished (default: true) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.forcemerge = ca({ - params: { - flush: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - maxNumSegments: { - type: 'number', - name: 'max_num_segments' - }, - onlyExpungeDeletes: { - type: 'boolean', - name: 'only_expunge_deletes' - }, - operationThreading: { - name: 'operation_threading' - }, - waitForMerge: { - type: 'boolean', - name: 'wait_for_merge' - } - }, - urls: [ - { - fmt: '/<%=index%>/_forcemerge', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_forcemerge' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.get](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-get-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.ignoreUnavailable - Ignore unavailable indexes (default: false) - * @param {<>} params.allowNoIndices - Ignore if a wildcard expression resolves to no concrete indices (default: false) - * @param {<>} [params.expandWildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (default: open) - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.includeDefaults - Whether to return all default setting for each of the indices. - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} params.feature - A comma-separated list of features - */ -api.indices.prototype.get = ca({ - params: { - local: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - includeDefaults: { - type: 'boolean', - 'default': false, - name: 'include_defaults' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=feature%>', - req: { - index: { - type: 'list' - }, - feature: { - type: 'list', - options: [ - '_settings', - '_mappings', - '_aliases' - ] - } - } - }, - { - fmt: '/<%=index%>', - req: { - index: { - type: 'list' - } - } - } - ] -}); - -/** - * Perform a [indices.getAlias](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=all] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names to filter aliases - * @param {<>, <>, <>} params.name - A comma-separated list of alias names to return - */ -api.indices.prototype.getAlias = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'all', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/_alias/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_alias', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_alias' - } - ] -}); - -/** - * Perform a [indices.getFieldMapping](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-get-field-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.includeDefaults - Whether the default mapping values should be returned as well - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} params.type - A comma-separated list of document types - * @param {<>, <>, <>} params.fields - A comma-separated list of fields - */ -api.indices.prototype.getFieldMapping = ca({ - params: { - includeDefaults: { - type: 'boolean', - name: 'include_defaults' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_mapping/<%=type%>/field/<%=fields%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - }, - fields: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_mapping/field/<%=fields%>', - req: { - index: { - type: 'list' - }, - fields: { - type: 'list' - } - } - }, - { - fmt: '/_mapping/<%=type%>/field/<%=fields%>', - req: { - type: { - type: 'list' - }, - fields: { - type: 'list' - } - } - }, - { - fmt: '/_mapping/field/<%=fields%>', - req: { - fields: { - type: 'list' - } - } - } - ] -}); - -/** - * Perform a [indices.getMapping](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-get-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} params.type - A comma-separated list of document types - */ -api.indices.prototype.getMapping = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_mapping/<%=type%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_mapping', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_mapping/<%=type%>', - req: { - type: { - type: 'list' - } - } - }, - { - fmt: '/_mapping' - } - ] -}); - -/** - * Perform a [indices.getSettings](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-get-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open,closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.includeDefaults - Whether to return all default setting for each of the indices. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.name - The name of the settings that should be included - */ -api.indices.prototype.getSettings = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': [ - 'open', - 'closed' - ], - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - local: { - type: 'boolean' - }, - includeDefaults: { - type: 'boolean', - 'default': false, - name: 'include_defaults' - } - }, - urls: [ - { - fmt: '/<%=index%>/_settings/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_settings', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_settings/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/_settings' - } - ] -}); - -/** - * Perform a [indices.getTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.name - The comma separated names of the index templates - */ -api.indices.prototype.getTemplate = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/_template' - } - ] -}); - -/** - * Perform a [indices.getUpgrade](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-upgrade.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.getUpgrade = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_upgrade', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_upgrade' - } - ] -}); - -/** - * Perform a [indices.open](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-open-close.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma separated list of indices to open - */ -api.indices.prototype.open = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'closed', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - url: { - fmt: '/<%=index%>/_open', - req: { - index: { - type: 'list' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [indices.putAlias](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit timestamp for the document - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices. - * @param {<>} params.name - The name of the alias to be created or updated - */ -api.indices.prototype.putAlias = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'string' - } - } - }, - method: 'PUT' -}); - -/** - * Perform a [indices.putMapping](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-put-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.updateAllTypes - Whether to update the mapping for all fields with the same name across all types or not - * @param {<>, <>, <>} params.index - A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices. - * @param {<>} params.type - The name of the document type - */ -api.indices.prototype.putMapping = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - updateAllTypes: { - type: 'boolean', - name: 'update_all_types' - } - }, - urls: [ - { - fmt: '/<%=index%>/_mapping/<%=type%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/_mapping/<%=type%>', - req: { - type: { - type: 'string' - } - } - } - ], - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [indices.putSettings](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.preserveExisting - Whether to update existing settings. If set to `true` existing settings on an index remain unchanged, the default is `false` - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.putSettings = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - preserveExisting: { - type: 'boolean', - name: 'preserve_existing' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - } - }, - urls: [ - { - fmt: '/<%=index%>/_settings', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_settings' - } - ], - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [indices.putTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.order - The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers) - * @param {<>} params.create - Whether the index template should only be added if new or can also replace an existing one - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.name - The name of the template - */ -api.indices.prototype.putTemplate = ca({ - params: { - order: { - type: 'number' - }, - create: { - type: 'boolean', - 'default': false - }, - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - } - }, - url: { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [indices.recovery](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-recovery.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.detailed - Whether to display detailed information about shard recovery - * @param {<>} params.activeOnly - Display only those recoveries that are currently on-going - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.recovery = ca({ - params: { - detailed: { - type: 'boolean', - 'default': false - }, - activeOnly: { - type: 'boolean', - 'default': false, - name: 'active_only' - } - }, - urls: [ - { - fmt: '/<%=index%>/_recovery', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_recovery' - } - ] -}); - -/** - * Perform a [indices.refresh](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-refresh.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.refresh = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_refresh', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_refresh' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.rollover](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-rollover-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.dryRun - If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for on the newly created rollover index before the operation returns. - * @param {<>} params.alias - The name of the alias to rollover - * @param {<>} params.newIndex - The name of the rollover index - */ -api.indices.prototype.rollover = ca({ - params: { - timeout: { - type: 'time' - }, - dryRun: { - type: 'boolean', - name: 'dry_run' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - } - }, - urls: [ - { - fmt: '/<%=alias%>/_rollover/<%=newIndex%>', - req: { - alias: { - type: 'string' - }, - newIndex: { - type: 'string' - } - } - }, - { - fmt: '/<%=alias%>/_rollover', - req: { - alias: { - type: 'string' - } - } - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.segments](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-segments.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.verbose - Includes detailed memory usage by Lucene. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.segments = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - operationThreading: { - name: 'operation_threading' - }, - verbose: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/<%=index%>/_segments', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_segments' - } - ] -}); - -/** - * Perform a [indices.shardStores](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-shards-stores.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.status - A comma-separated list of statuses used to filter on shards to get store information for - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {anything} params.operationThreading - TODO: ? - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.shardStores = ca({ - params: { - status: { - type: 'list', - options: [ - 'green', - 'yellow', - 'red', - 'all' - ] - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - operationThreading: { - name: 'operation_threading' - } - }, - urls: [ - { - fmt: '/<%=index%>/_shard_stores', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_shard_stores' - } - ] -}); - -/** - * Perform a [indices.shrink](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-shrink-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for on the shrunken index before the operation returns. - * @param {<>} params.index - The name of the source index to shrink - * @param {<>} params.target - The name of the target index to shrink into - */ -api.indices.prototype.shrink = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - } - }, - url: { - fmt: '/<%=index%>/_shrink/<%=target%>', - req: { - index: { - type: 'string' - }, - target: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [indices.stats](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.completionFields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields for `fielddata` index metric (supports wildcards) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) - * @param {<>, <>, <>} params.groups - A comma-separated list of search groups for `search` index metric - * @param {<>} [params.level=indices] - Return stats aggregated at cluster, index or shard level - * @param {<>, <>, <>} params.types - A comma-separated list of document types for the `indexing` index metric - * @param {<>} params.includeSegmentFileSizes - Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.metric - Limit the information returned the specific metrics. - */ -api.indices.prototype.stats = ca({ - params: { - completionFields: { - type: 'list', - name: 'completion_fields' - }, - fielddataFields: { - type: 'list', - name: 'fielddata_fields' - }, - fields: { - type: 'list' - }, - groups: { - type: 'list' - }, - level: { - type: 'enum', - 'default': 'indices', - options: [ - 'cluster', - 'indices', - 'shards' - ] - }, - types: { - type: 'list' - }, - includeSegmentFileSizes: { - type: 'boolean', - 'default': false, - name: 'include_segment_file_sizes' - } - }, - urls: [ - { - fmt: '/<%=index%>/_stats/<%=metric%>', - req: { - index: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'percolate', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/_stats/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'percolate', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/<%=index%>/_stats', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_stats' - } - ] -}); - -/** - * Perform a [indices.updateAliases](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Request timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - */ -api.indices.prototype.updateAliases = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_aliases' - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [indices.upgrade](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/indices-upgrade.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.waitForCompletion - Specify whether the request should block until the all segments are upgraded (default: false) - * @param {<>} params.onlyAncientSegments - If true, only ancient (an older Lucene major release) segments will be upgraded - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.upgrade = ca({ - params: { - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - waitForCompletion: { - type: 'boolean', - name: 'wait_for_completion' - }, - onlyAncientSegments: { - type: 'boolean', - name: 'only_ancient_segments' - } - }, - urls: [ - { - fmt: '/<%=index%>/_upgrade', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_upgrade' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.validateQuery](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-validate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.explain - Return detailed information about the error - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.rewrite - Provide a more detailed explanation showing the actual Lucene query that will be executed. - * @param {<>} params.allShards - Execute validation on all shards instead of one random shard per index - * @param {<>, <>, <>} params.index - A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to restrict the operation; leave empty to perform the operation on all types - */ -api.indices.prototype.validateQuery = ca({ - params: { - explain: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - operationThreading: { - name: 'operation_threading' - }, - q: { - type: 'string' - }, - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - lenient: { - type: 'boolean' - }, - rewrite: { - type: 'boolean' - }, - allShards: { - type: 'boolean', - name: 'all_shards' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_validate/query', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_validate/query', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_validate/query' - } - ], - method: 'POST' -}); - -/** - * Perform a [info](https://www.elastic.co/guide/) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.info = ca({ - url: { - fmt: '/' - } -}); - -api.ingest = namespace(); - -/** - * Perform a [ingest.deletePipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/5.4/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.id - Pipeline ID - */ -api.ingest.prototype.deletePipeline = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_ingest/pipeline/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [ingest.getPipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/5.4/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.id - Comma separated list of pipeline ids. Wildcards supported - */ -api.ingest.prototype.getPipeline = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - urls: [ - { - fmt: '/_ingest/pipeline/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - { - fmt: '/_ingest/pipeline' - } - ] -}); - -/** - * Perform a [ingest.putPipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/5.4/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.id - Pipeline ID - */ -api.ingest.prototype.putPipeline = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_ingest/pipeline/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [ingest.simulate](https://www.elastic.co/guide/en/elasticsearch/plugins/5.4/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.verbose - Verbose mode. Display data output for each processor in executed pipeline - * @param {<>} params.id - Pipeline ID - */ -api.ingest.prototype.simulate = ca({ - params: { - verbose: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_ingest/pipeline/<%=id%>/_simulate', - req: { - id: { - type: 'string' - } - } - }, - { - fmt: '/_ingest/pipeline/_simulate' - } - ], - needBody: true, - method: 'POST' -}); - -/** - * Perform a [mget](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-multi-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.mget = ca({ - params: { - storedFields: { - type: 'list', - name: 'stored_fields' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_mget', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_mget', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_mget' - } - ], - needBody: true, - method: 'POST' -}); - -/** - * Perform a [mpercolate](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-percolate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.index - The index of the document being count percolated to use as default - * @param {<>} params.type - The type of the document being percolated to use as default. - */ -api.mpercolate = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_mpercolate', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_mpercolate', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_mpercolate' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -/** - * Perform a [msearch](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-multi-search.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.searchType - Search operation type - * @param {<>} params.maxConcurrentSearches - Controls the maximum number of concurrent searches the multi search api will execute - * @param {<>} params.typedKeys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response - * @param {<>, <>, <>} params.index - A comma-separated list of index names to use as default - * @param {<>, <>, <>} params.type - A comma-separated list of document types to use as default - */ -api.msearch = ca({ - params: { - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'query_and_fetch', - 'dfs_query_then_fetch', - 'dfs_query_and_fetch' - ], - name: 'search_type' - }, - maxConcurrentSearches: { - type: 'number', - name: 'max_concurrent_searches' - }, - typedKeys: { - type: 'boolean', - name: 'typed_keys' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_msearch', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_msearch', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_msearch' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -/** - * Perform a [msearchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.searchType - Search operation type - * @param {<>} params.typedKeys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response - * @param {<>, <>, <>} params.index - A comma-separated list of index names to use as default - * @param {<>, <>, <>} params.type - A comma-separated list of document types to use as default - */ -api.msearchTemplate = ca({ - params: { - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'query_and_fetch', - 'dfs_query_then_fetch', - 'dfs_query_and_fetch' - ], - name: 'search_type' - }, - typedKeys: { - type: 'boolean', - name: 'typed_keys' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_msearch/template', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_msearch/template', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_msearch/template' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -/** - * Perform a [mtermvectors](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-multi-termvectors.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.ids - A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body - * @param {<>} params.termStatistics - Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.fieldStatistics=true] - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.offsets=true] - Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.positions=true] - Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.payloads=true] - Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) .Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.routing - Specific routing value. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.parent - Parent id of documents. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.realtime - Specifies if requests are real-time as opposed to near-real-time (default: true). - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index in which the document resides. - * @param {<>} params.type - The type of the document. - */ -api.mtermvectors = ca({ - params: { - ids: { - type: 'list', - required: false - }, - termStatistics: { - type: 'boolean', - 'default': false, - required: false, - name: 'term_statistics' - }, - fieldStatistics: { - type: 'boolean', - 'default': true, - required: false, - name: 'field_statistics' - }, - fields: { - type: 'list', - required: false - }, - offsets: { - type: 'boolean', - 'default': true, - required: false - }, - positions: { - type: 'boolean', - 'default': true, - required: false - }, - payloads: { - type: 'boolean', - 'default': true, - required: false - }, - preference: { - type: 'string', - required: false - }, - routing: { - type: 'string', - required: false - }, - parent: { - type: 'string', - required: false - }, - realtime: { - type: 'boolean', - required: false - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_mtermvectors', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_mtermvectors', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_mtermvectors' - } - ], - method: 'POST' -}); - -api.nodes = namespace(); - -/** - * Perform a [nodes.hotThreads](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cluster-nodes-hot-threads.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.interval - The interval for the second sampling of threads - * @param {<>} params.snapshots - Number of samples of thread stacktrace (default: 10) - * @param {<>} params.threads - Specify the number of threads to provide information for (default: 3) - * @param {<>} params.ignoreIdleThreads - Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue (default: true) - * @param {<>} params.type - The type to sample (default: cpu) - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - */ -api.nodes.prototype.hotThreads = ca({ - params: { - interval: { - type: 'time' - }, - snapshots: { - type: 'number' - }, - threads: { - type: 'number' - }, - ignoreIdleThreads: { - type: 'boolean', - name: 'ignore_idle_threads' - }, - type: { - type: 'enum', - options: [ - 'cpu', - 'wait', - 'block' - ] - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_nodes/<%=nodeId%>/hotthreads', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_nodes/hotthreads' - } - ] -}); - -/** - * Perform a [nodes.info](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cluster-nodes-info.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.metric - A comma-separated list of metrics you wish returned. Leave empty to return all. - */ -api.nodes.prototype.info = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_nodes/<%=nodeId%>/<%=metric%>', - req: { - nodeId: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - 'settings', - 'os', - 'process', - 'jvm', - 'thread_pool', - 'transport', - 'http', - 'plugins', - 'ingest' - ] - } - } - }, - { - fmt: '/_nodes/<%=nodeId%>', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_nodes/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - 'settings', - 'os', - 'process', - 'jvm', - 'thread_pool', - 'transport', - 'http', - 'plugins', - 'ingest' - ] - } - } - }, - { - fmt: '/_nodes' - } - ] -}); - -/** - * Perform a [nodes.stats](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cluster-nodes-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.completionFields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields for `fielddata` index metric (supports wildcards) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) - * @param {<>} params.groups - A comma-separated list of search groups for `search` index metric - * @param {<>} [params.level=node] - Return indices stats aggregated at index, node or shard level - * @param {<>, <>, <>} params.types - A comma-separated list of document types for the `indexing` index metric - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.includeSegmentFileSizes - Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics - * @param {<>, <>, <>} params.indexMetric - Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified. - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - */ -api.nodes.prototype.stats = ca({ - params: { - completionFields: { - type: 'list', - name: 'completion_fields' - }, - fielddataFields: { - type: 'list', - name: 'fielddata_fields' - }, - fields: { - type: 'list' - }, - groups: { - type: 'boolean' - }, - level: { - type: 'enum', - 'default': 'node', - options: [ - 'indices', - 'node', - 'shards' - ] - }, - types: { - type: 'list' - }, - timeout: { - type: 'time' - }, - includeSegmentFileSizes: { - type: 'boolean', - 'default': false, - name: 'include_segment_file_sizes' - } - }, - urls: [ - { - fmt: '/_nodes/<%=nodeId%>/stats/<%=metric%>/<%=indexMetric%>', - req: { - nodeId: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport', - 'discovery' - ] - }, - indexMetric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'percolate', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/_nodes/<%=nodeId%>/stats/<%=metric%>', - req: { - nodeId: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport', - 'discovery' - ] - } - } - }, - { - fmt: '/_nodes/stats/<%=metric%>/<%=indexMetric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport', - 'discovery' - ] - }, - indexMetric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'percolate', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/_nodes/<%=nodeId%>/stats', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_nodes/stats/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport', - 'discovery' - ] - } - } - }, - { - fmt: '/_nodes/stats' - } - ] -}); - -/** - * Perform a [percolate](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-percolate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.percolateIndex - The index to percolate the document into. Defaults to index. - * @param {<>} params.percolateType - The type to percolate document into. Defaults to type. - * @param {<>} params.percolateRouting - The routing value to use when percolating the existing document. - * @param {<>} params.percolatePreference - Which shard to prefer when executing the percolate request. - * @param {<>} params.percolateFormat - Return an array of matching query IDs instead of objects - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index of the document being percolated. - * @param {<>} params.type - The type of the document being percolated. - * @param {<>} params.id - Substitute the document in the request body with a document that is known by the specified id. On top of the id, the index and type parameter will be used to retrieve the document from within the cluster. - */ -api.percolate = ca({ - params: { - routing: { - type: 'list' - }, - preference: { - type: 'string' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - percolateIndex: { - type: 'string', - name: 'percolate_index' - }, - percolateType: { - type: 'string', - name: 'percolate_type' - }, - percolateRouting: { - type: 'string', - name: 'percolate_routing' - }, - percolatePreference: { - type: 'string', - name: 'percolate_preference' - }, - percolateFormat: { - type: 'enum', - options: [ - 'ids' - ], - name: 'percolate_format' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_percolate', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/<%=type%>/_percolate', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - } - ], - method: 'POST' -}); - -/** - * Perform a [ping](https://www.elastic.co/guide/) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.ping = ca({ - url: { - fmt: '/' - }, - requestTimeout: 3000, - method: 'HEAD' -}); - -/** - * Perform a [putScript](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Script ID - * @param {<>} params.lang - Script language - */ -api.putScript = ca({ - urls: [ - { - fmt: '/_scripts/<%=lang%>/<%=id%>', - req: { - lang: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/_scripts/<%=lang%>', - req: { - lang: { - type: 'string' - } - } - } - ], - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [putTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Template ID - */ -api.putTemplate = ca({ - url: { - fmt: '/_search/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [reindex](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-reindex.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the reindex operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} [params.waitForCompletion=true] - Should the request should block until the reindex is complete. - * @param {<>} params.requestsPerSecond - The throttle to set on this request in sub-requests per second. -1 means no throttle. - * @param {<>} [params.slices=1] - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. - */ -api.reindex = ca({ - params: { - refresh: { - type: 'boolean' - }, - timeout: { - type: 'time', - 'default': '1m' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - waitForCompletion: { - type: 'boolean', - 'default': true, - name: 'wait_for_completion' - }, - requestsPerSecond: { - type: 'number', - 'default': 0, - name: 'requests_per_second' - }, - slices: { - type: 'number', - 'default': 1 - } - }, - url: { - fmt: '/_reindex' - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [reindexRethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-reindex.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.requestsPerSecond - The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. - * @param {<>} params.taskId - The task id to rethrottle - */ -api.reindexRethrottle = ca({ - params: { - requestsPerSecond: { - type: 'number', - required: true, - name: 'requests_per_second' - } - }, - url: { - fmt: '/_reindex/<%=taskId%>/_rethrottle', - req: { - taskId: { - type: 'string' - } - } - }, - method: 'POST' -}); - -api.remote = namespace(); - -/** - * Perform a [remote.info](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cluster-remote-info.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.remote.prototype.info = ca({ - url: { - fmt: '/_remote/info' - } -}); - -/** - * Perform a [renderSearchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - The id of the stored search template - */ -api.renderSearchTemplate = ca({ - urls: [ - { - fmt: '/_render/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - { - fmt: '/_render/template' - } - ], - method: 'POST' -}); - -/** - * Perform a [scroll](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-request-scroll.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.scrollId - The scroll ID - */ -api.scroll = ca({ - params: { - scroll: { - type: 'time' - }, - scrollId: { - type: 'string', - name: 'scroll_id' - } - }, - urls: [ - { - fmt: '/_search/scroll/<%=scrollId%>', - req: { - scrollId: { - type: 'string' - } - } - }, - { - fmt: '/_search/scroll' - } - ], - paramAsBody: { - param: 'scrollId', - body: 'scroll_id' - }, - method: 'POST' -}); - -/** - * Perform a [search](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-search.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.explain - Specify whether to return detailed information about score computation as part of a hit - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return as part of a hit - * @param {<>, <>, <>} params.docvalueFields - A comma-separated list of fields to return as the docvalue representation of a field for each hit - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields to return as the docvalue representation of a field for each hit - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.suggestField - Specify which field to use for suggestions - * @param {<>} [params.suggestMode=missing] - Specify suggest mode - * @param {<>} params.suggestSize - How many suggestions to return in response - * @param {<>} params.suggestText - The source text for which the suggestions should be returned - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.trackScores - Whether to calculate and return scores even if they are not used for sorting - * @param {<>} params.typedKeys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>} [params.batchedReduceSize=512] - The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.search = ca({ - params: { - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - explain: { - type: 'boolean' - }, - storedFields: { - type: 'list', - name: 'stored_fields' - }, - docvalueFields: { - type: 'list', - name: 'docvalue_fields' - }, - fielddataFields: { - type: 'list', - name: 'fielddata_fields' - }, - from: { - type: 'number' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - lenient: { - type: 'boolean' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'dfs_query_then_fetch' - ], - name: 'search_type' - }, - size: { - type: 'number' - }, - sort: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - terminateAfter: { - type: 'number', - name: 'terminate_after' - }, - stats: { - type: 'list' - }, - suggestField: { - type: 'string', - name: 'suggest_field' - }, - suggestMode: { - type: 'enum', - 'default': 'missing', - options: [ - 'missing', - 'popular', - 'always' - ], - name: 'suggest_mode' - }, - suggestSize: { - type: 'number', - name: 'suggest_size' - }, - suggestText: { - type: 'string', - name: 'suggest_text' - }, - timeout: { - type: 'time' - }, - trackScores: { - type: 'boolean', - name: 'track_scores' - }, - typedKeys: { - type: 'boolean', - name: 'typed_keys' - }, - version: { - type: 'boolean' - }, - requestCache: { - type: 'boolean', - name: 'request_cache' - }, - batchedReduceSize: { - type: 'number', - 'default': 512, - name: 'batched_reduce_size' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_search', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_search', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_search' - } - ], - method: 'POST' -}); - -/** - * Perform a [searchShards](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-shards.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.searchShards = ca({ - params: { - preference: { - type: 'string' - }, - routing: { - type: 'string' - }, - local: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_search_shards', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_search_shards', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_search_shards' - } - ], - method: 'POST' -}); - -/** - * Perform a [searchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.explain - Specify whether to return detailed information about score computation as part of a hit - * @param {<>} params.profile - Specify whether to profile the query execution - * @param {<>} params.typedKeys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.searchTemplate = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - preference: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'query_and_fetch', - 'dfs_query_then_fetch', - 'dfs_query_and_fetch' - ], - name: 'search_type' - }, - explain: { - type: 'boolean' - }, - profile: { - type: 'boolean' - }, - typedKeys: { - type: 'boolean', - name: 'typed_keys' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_search/template', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_search/template', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_search/template' - } - ], - method: 'POST' -}); - -api.snapshot = namespace(); - -/** - * Perform a [snapshot.create](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.waitForCompletion - Should this request wait until the operation has completed before returning - * @param {<>} params.repository - A repository name - * @param {<>} params.snapshot - A snapshot name - */ -api.snapshot.prototype.create = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForCompletion: { - type: 'boolean', - 'default': false, - name: 'wait_for_completion' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [snapshot.createRepository](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.verify - Whether to verify the repository after creation - * @param {<>} params.repository - A repository name - */ -api.snapshot.prototype.createRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - }, - verify: { - type: 'boolean' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>', - req: { - repository: { - type: 'string' - } - } - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [snapshot.delete](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.repository - A repository name - * @param {<>} params.snapshot - A snapshot name - */ -api.snapshot.prototype['delete'] = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [snapshot.deleteRepository](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.repository - A comma-separated list of repository names - */ -api.snapshot.prototype.deleteRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>', - req: { - repository: { - type: 'list' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [snapshot.get](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.ignoreUnavailable - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown - * @param {<>} params.repository - A repository name - * @param {<>, <>, <>} params.snapshot - A comma-separated list of snapshot names - */ -api.snapshot.prototype.get = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'list' - } - } - } -}); - -/** - * Perform a [snapshot.getRepository](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.repository - A comma-separated list of repository names - */ -api.snapshot.prototype.getRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/_snapshot/<%=repository%>', - req: { - repository: { - type: 'list' - } - } - }, - { - fmt: '/_snapshot' - } - ] -}); - -/** - * Perform a [snapshot.restore](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.waitForCompletion - Should this request wait until the operation has completed before returning - * @param {<>} params.repository - A repository name - * @param {<>} params.snapshot - A snapshot name - */ -api.snapshot.prototype.restore = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForCompletion: { - type: 'boolean', - 'default': false, - name: 'wait_for_completion' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>/_restore', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [snapshot.status](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.ignoreUnavailable - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown - * @param {<>} params.repository - A repository name - * @param {<>, <>, <>} params.snapshot - A comma-separated list of snapshot names - */ -api.snapshot.prototype.status = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - } - }, - urls: [ - { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>/_status', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'list' - } - } - }, - { - fmt: '/_snapshot/<%=repository%>/_status', - req: { - repository: { - type: 'string' - } - } - }, - { - fmt: '/_snapshot/_status' - } - ] -}); - -/** - * Perform a [snapshot.verifyRepository](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.repository - A repository name - */ -api.snapshot.prototype.verifyRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/_verify', - req: { - repository: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [suggest](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/search-suggesters.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params.index - A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices - */ -api.suggest = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - preference: { - type: 'string' - }, - routing: { - type: 'string' - } - }, - urls: [ - { - fmt: '/<%=index%>/_suggest', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_suggest' - } - ], - needBody: true, - method: 'POST' -}); - -api.tasks = namespace(); - -/** - * Perform a [tasks.cancel](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.actions - A comma-separated list of actions that should be cancelled. Leave empty to cancel all. - * @param {<>} params.parentNode - Cancel tasks with specified parent node. - * @param {<>} params.parentTask - Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all. - * @param {<>} params.taskId - Cancel the task with specified task id (node_id:task_number) - */ -api.tasks.prototype.cancel = ca({ - params: { - nodeId: { - type: 'list', - name: 'node_id' - }, - actions: { - type: 'list' - }, - parentNode: { - type: 'string', - name: 'parent_node' - }, - parentTask: { - type: 'string', - name: 'parent_task' - } - }, - urls: [ - { - fmt: '/_tasks/<%=taskId%>/_cancel', - req: { - taskId: { - type: 'string' - } - } - }, - { - fmt: '/_tasks/_cancel' - } - ], - method: 'POST' -}); - -/** - * Perform a [tasks.get](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForCompletion - Wait for the matching tasks to complete (default: false) - * @param {<>} params.taskId - Return the task with specified id (node_id:task_number) - */ -api.tasks.prototype.get = ca({ - params: { - waitForCompletion: { - type: 'boolean', - name: 'wait_for_completion' - } - }, - url: { - fmt: '/_tasks/<%=taskId%>', - req: { - taskId: { - type: 'string' - } - } - } -}); - -/** - * Perform a [tasks.list](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.actions - A comma-separated list of actions that should be returned. Leave empty to return all. - * @param {<>} params.detailed - Return detailed task information (default: false) - * @param {<>} params.parentNode - Return tasks with specified parent node. - * @param {<>} params.parentTask - Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all. - * @param {<>} params.waitForCompletion - Wait for the matching tasks to complete (default: false) - * @param {<>} [params.groupBy=nodes] - Group tasks by nodes or parent/child relationships - */ -api.tasks.prototype.list = ca({ - params: { - nodeId: { - type: 'list', - name: 'node_id' - }, - actions: { - type: 'list' - }, - detailed: { - type: 'boolean' - }, - parentNode: { - type: 'string', - name: 'parent_node' - }, - parentTask: { - type: 'string', - name: 'parent_task' - }, - waitForCompletion: { - type: 'boolean', - name: 'wait_for_completion' - }, - groupBy: { - type: 'enum', - 'default': 'nodes', - options: [ - 'nodes', - 'parents' - ], - name: 'group_by' - } - }, - url: { - fmt: '/_tasks' - } -}); - -/** - * Perform a [termvectors](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-termvectors.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.termStatistics - Specifies if total term frequency and document frequency should be returned. - * @param {<>} [params.fieldStatistics=true] - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return. - * @param {<>} [params.offsets=true] - Specifies if term offsets should be returned. - * @param {<>} [params.positions=true] - Specifies if term positions should be returned. - * @param {<>} [params.payloads=true] - Specifies if term payloads should be returned. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random). - * @param {<>} params.routing - Specific routing value. - * @param {<>} params.parent - Parent id of documents. - * @param {<>} params.realtime - Specifies if request is real-time as opposed to near-real-time (default: true). - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index in which the document resides. - * @param {<>} params.type - The type of the document. - * @param {<>} params.id - The id of the document, when not specified a doc param should be supplied. - */ -api.termvectors = ca({ - params: { - termStatistics: { - type: 'boolean', - 'default': false, - required: false, - name: 'term_statistics' - }, - fieldStatistics: { - type: 'boolean', - 'default': true, - required: false, - name: 'field_statistics' - }, - fields: { - type: 'list', - required: false - }, - offsets: { - type: 'boolean', - 'default': true, - required: false - }, - positions: { - type: 'boolean', - 'default': true, - required: false - }, - payloads: { - type: 'boolean', - 'default': true, - required: false - }, - preference: { - type: 'string', - required: false - }, - routing: { - type: 'string', - required: false - }, - parent: { - type: 'string', - required: false - }, - realtime: { - type: 'boolean', - required: false - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_termvectors', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/<%=type%>/_termvectors', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - } - ], - method: 'POST' -}); - -/** - * Perform a [update](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-update.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the update operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return in the response - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.lang - The script language (default: painless) - * @param {<>} params.parent - ID of the parent document. Is is only used for routing and when for the upsert request - * @param {<>} params.refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.retryOnConflict - Specify how many times should the operation be retried when a conflict occurs (default: 0) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.update = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - fields: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - lang: { - type: 'string' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - retryOnConflict: { - type: 'number', - name: 'retry_on_conflict' - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - timestamp: { - type: 'time' - }, - ttl: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_update', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [updateByQuery](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/docs-update-by-query.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.conflicts=abort] - What to do when the update by query hits version conflicts? - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.pipeline - Ingest pipeline to set on index requests made by this action. (default: none) - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.searchTimeout - Explicit timeout for each search request. Defaults to no timeout. - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.versionType - Should the document increment the version number (internal) on hit or not (reindex) - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the update by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.scrollSize - Size on the scroll request powering the update_by_query - * @param {<>} [params.waitForCompletion=true] - Should the request should block until the update by query operation is complete. - * @param {<>} params.requestsPerSecond - The throttle to set on this request in sub-requests per second. -1 means no throttle. - * @param {<>} [params.slices=1] - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.updateByQuery = ca({ - params: { - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - from: { - type: 'number' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - conflicts: { - type: 'enum', - 'default': 'abort', - options: [ - 'abort', - 'proceed' - ] - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - lenient: { - type: 'boolean' - }, - pipeline: { - type: 'string' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'dfs_query_then_fetch' - ], - name: 'search_type' - }, - searchTimeout: { - type: 'time', - name: 'search_timeout' - }, - size: { - type: 'number' - }, - sort: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - terminateAfter: { - type: 'number', - name: 'terminate_after' - }, - stats: { - type: 'list' - }, - version: { - type: 'boolean' - }, - versionType: { - type: 'boolean', - name: 'version_type' - }, - requestCache: { - type: 'boolean', - name: 'request_cache' - }, - refresh: { - type: 'boolean' - }, - timeout: { - type: 'time', - 'default': '1m' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - scrollSize: { - type: 'number', - name: 'scroll_size' - }, - waitForCompletion: { - type: 'boolean', - 'default': true, - name: 'wait_for_completion' - }, - requestsPerSecond: { - type: 'number', - 'default': 0, - name: 'requests_per_second' - }, - slices: { - type: 'number', - 'default': 1 - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_update_by_query', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_update_by_query', - req: { - index: { - type: 'list' - } - } - } - ], - method: 'POST' -}); diff --git a/src/lib/apis/5_5.js b/src/lib/apis/5_5.js deleted file mode 100644 index 1cddf586b..000000000 --- a/src/lib/apis/5_5.js +++ /dev/null @@ -1,7359 +0,0 @@ -var ca = require('../client_action').makeFactoryWithModifier(function (spec) { - return require('../utils').merge(spec, { - params: { - filterPath: { - type: 'list', - name: 'filter_path' - } - } - }); -}); -var namespace = require('../client_action').namespaceFactory; -var api = module.exports = {}; - -api._namespaces = ['cat', 'cluster', 'indices', 'ingest', 'nodes', 'remote', 'snapshot', 'tasks']; - -/** - * Perform a [bulk](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-bulk.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the bulk operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.type - Default document type for items which don't provide one - * @param {<>, <>, <>} params.fields - Default comma-separated list of fields to return in the response for updates, can be overridden on each sub-request - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request - * @param {<>, <>, <>} params._sourceExclude - Default list of fields to exclude from the returned _source field, can be overridden on each sub-request - * @param {<>, <>, <>} params._sourceInclude - Default list of fields to extract and return from the _source field, can be overridden on each sub-request - * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with - * @param {<>} params.index - Default index for items which don't provide one - */ -api.bulk = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - type: { - type: 'string' - }, - fields: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - pipeline: { - type: 'string' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_bulk', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_bulk', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_bulk' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -api.cat = namespace(); - -/** - * Perform a [cat.aliases](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.name - A comma-separated list of alias names to return - */ -api.cat.prototype.aliases = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/aliases/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/_cat/aliases' - } - ] -}); - -/** - * Perform a [cat.allocation](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-allocation.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information - */ -api.cat.prototype.allocation = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'kb', - 'm', - 'mb', - 'g', - 'gb', - 't', - 'tb', - 'p', - 'pb' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/allocation/<%=nodeId%>', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_cat/allocation' - } - ] -}); - -/** - * Perform a [cat.count](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-count.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.count = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/count/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/count' - } - ] -}); - -/** - * Perform a [cat.fielddata](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-fielddata.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return the fielddata size - */ -api.cat.prototype.fielddata = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'kb', - 'm', - 'mb', - 'g', - 'gb', - 't', - 'tb', - 'p', - 'pb' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - }, - fields: { - type: 'list' - } - }, - urls: [ - { - fmt: '/_cat/fielddata/<%=fields%>', - req: { - fields: { - type: 'list' - } - } - }, - { - fmt: '/_cat/fielddata' - } - ] -}); - -/** - * Perform a [cat.health](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-health.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} [params.ts=true] - Set to false to disable timestamping - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.health = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - ts: { - type: 'boolean', - 'default': true - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/health' - } -}); - -/** - * Perform a [cat.help](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - */ -api.cat.prototype.help = ca({ - params: { - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - } - }, - url: { - fmt: '/_cat' - } -}); - -/** - * Perform a [cat.indices](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-indices.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.health - A health status ("green", "yellow", or "red" to filter only indices matching the specified health status - * @param {<>} params.help - Return help information - * @param {<>} params.pri - Set to true to return stats only for primary shards - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.indices = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'm', - 'g' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - health: { - type: 'enum', - 'default': null, - options: [ - 'green', - 'yellow', - 'red' - ] - }, - help: { - type: 'boolean', - 'default': false - }, - pri: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/indices/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/indices' - } - ] -}); - -/** - * Perform a [cat.master](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-master.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.master = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/master' - } -}); - -/** - * Perform a [cat.nodeattrs](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-nodeattrs.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.nodeattrs = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/nodeattrs' - } -}); - -/** - * Perform a [cat.nodes](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-nodes.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.fullId - Return the full node ID instead of the shortened version (default: false) - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.nodes = ca({ - params: { - format: { - type: 'string' - }, - fullId: { - type: 'boolean', - name: 'full_id' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/nodes' - } -}); - -/** - * Perform a [cat.pendingTasks](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-pending-tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.pendingTasks = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/pending_tasks' - } -}); - -/** - * Perform a [cat.plugins](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-plugins.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.plugins = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/plugins' - } -}); - -/** - * Perform a [cat.recovery](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-recovery.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.recovery = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'kb', - 'm', - 'mb', - 'g', - 'gb', - 't', - 'tb', - 'p', - 'pb' - ] - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/recovery/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/recovery' - } - ] -}); - -/** - * Perform a [cat.repositories](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-repositories.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.repositories = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean', - 'default': false - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/repositories' - } -}); - -/** - * Perform a [cat.segments](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-segments.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.segments = ca({ - params: { - format: { - type: 'string' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/segments/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/segments' - } - ] -}); - -/** - * Perform a [cat.shards](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-shards.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.shards = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/shards/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/shards' - } - ] -}); - -/** - * Perform a [cat.snapshots](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.ignoreUnavailable - Set to true to ignore unavailable snapshots - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.repository - Name of repository from which to fetch the snapshot information - */ -api.cat.prototype.snapshots = ca({ - params: { - format: { - type: 'string' - }, - ignoreUnavailable: { - type: 'boolean', - 'default': false, - name: 'ignore_unavailable' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/snapshots/<%=repository%>', - req: { - repository: { - type: 'list' - } - } - }, - { - fmt: '/_cat/snapshots' - } - ] -}); - -/** - * Perform a [cat.tasks](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.actions - A comma-separated list of actions that should be returned. Leave empty to return all. - * @param {<>} params.detailed - Return detailed task information (default: false) - * @param {<>} params.parentNode - Return tasks with specified parent node. - * @param {<>} params.parentTask - Return tasks with specified parent task id. Set to -1 to return all. - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.tasks = ca({ - params: { - format: { - type: 'string' - }, - nodeId: { - type: 'list', - name: 'node_id' - }, - actions: { - type: 'list' - }, - detailed: { - type: 'boolean' - }, - parentNode: { - type: 'string', - name: 'parent_node' - }, - parentTask: { - type: 'number', - name: 'parent_task' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/tasks' - } -}); - -/** - * Perform a [cat.templates](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>} params.name - A pattern that returned template names must match - */ -api.cat.prototype.templates = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/templates/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - { - fmt: '/_cat/templates' - } - ] -}); - -/** - * Perform a [cat.threadPool](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cat-thread-pool.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.size - The multiplier in which to display values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.threadPoolPatterns - A comma-separated list of regular-expressions to filter the thread pools in the output - */ -api.cat.prototype.threadPool = ca({ - params: { - format: { - type: 'string' - }, - size: { - type: 'enum', - options: [ - '', - 'k', - 'm', - 'g', - 't', - 'p' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/thread_pool/<%=threadPoolPatterns%>', - req: { - threadPoolPatterns: { - type: 'list' - } - } - }, - { - fmt: '/_cat/thread_pool' - } - ] -}); - -/** - * Perform a [clearScroll](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-request-scroll.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.scrollId - A comma-separated list of scroll IDs to clear - */ -api.clearScroll = ca({ - urls: [ - { - fmt: '/_search/scroll/<%=scrollId%>', - req: { - scrollId: { - type: 'list' - } - } - }, - { - fmt: '/_search/scroll' - } - ], - paramAsBody: { - param: 'scrollId', - body: 'scroll_id' - }, - method: 'DELETE' -}); - -api.cluster = namespace(); - -/** - * Perform a [cluster.allocationExplain](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cluster-allocation-explain.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.includeYesDecisions - Return 'YES' decisions in explanation (default: false) - * @param {<>} params.includeDiskInfo - Return information about disk usage and shard sizes (default: false) - */ -api.cluster.prototype.allocationExplain = ca({ - params: { - includeYesDecisions: { - type: 'boolean', - name: 'include_yes_decisions' - }, - includeDiskInfo: { - type: 'boolean', - name: 'include_disk_info' - } - }, - url: { - fmt: '/_cluster/allocation/explain' - }, - method: 'POST' -}); - -/** - * Perform a [cluster.getSettings](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cluster-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.includeDefaults - Whether to return all default clusters setting. - */ -api.cluster.prototype.getSettings = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - }, - includeDefaults: { - type: 'boolean', - 'default': false, - name: 'include_defaults' - } - }, - url: { - fmt: '/_cluster/settings' - } -}); - -/** - * Perform a [cluster.health](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cluster-health.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} [params.level=cluster] - Specify the level of detail for returned information - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.waitForActiveShards - Wait until the specified number of shards is active - * @param {<>} params.waitForNodes - Wait until the specified number of nodes is available - * @param {<>} params.waitForEvents - Wait until all currently queued events with the given priority are processed - * @param {<>} params.waitForNoRelocatingShards - Whether to wait until there are no relocating shards in the cluster - * @param {<>} params.waitForStatus - Wait until cluster is in a specific state - * @param {<>, <>, <>} params.index - Limit the information returned to a specific index - */ -api.cluster.prototype.health = ca({ - params: { - level: { - type: 'enum', - 'default': 'cluster', - options: [ - 'cluster', - 'indices', - 'shards' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - waitForNodes: { - type: 'string', - name: 'wait_for_nodes' - }, - waitForEvents: { - type: 'enum', - options: [ - 'immediate', - 'urgent', - 'high', - 'normal', - 'low', - 'languid' - ], - name: 'wait_for_events' - }, - waitForNoRelocatingShards: { - type: 'boolean', - name: 'wait_for_no_relocating_shards' - }, - waitForStatus: { - type: 'enum', - 'default': null, - options: [ - 'green', - 'yellow', - 'red' - ], - name: 'wait_for_status' - } - }, - urls: [ - { - fmt: '/_cluster/health/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cluster/health' - } - ] -}); - -/** - * Perform a [cluster.pendingTasks](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cluster-pending.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Specify timeout for connection to master - */ -api.cluster.prototype.pendingTasks = ca({ - params: { - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_cluster/pending_tasks' - } -}); - -/** - * Perform a [cluster.putSettings](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cluster-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - */ -api.cluster.prototype.putSettings = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_cluster/settings' - }, - method: 'PUT' -}); - -/** - * Perform a [cluster.reroute](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cluster-reroute.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.dryRun - Simulate the operation only and return the resulting state - * @param {<>} params.explain - Return an explanation of why the commands can or cannot be executed - * @param {<>} params.retryFailed - Retries allocation of shards that are blocked due to too many subsequent allocation failures - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics. Defaults to all but metadata - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - */ -api.cluster.prototype.reroute = ca({ - params: { - dryRun: { - type: 'boolean', - name: 'dry_run' - }, - explain: { - type: 'boolean' - }, - retryFailed: { - type: 'boolean', - name: 'retry_failed' - }, - metric: { - type: 'list', - options: [ - '_all', - 'blocks', - 'metadata', - 'nodes', - 'routing_table', - 'master_node', - 'version' - ] - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_cluster/reroute' - }, - method: 'POST' -}); - -/** - * Perform a [cluster.state](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cluster-state.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics - */ -api.cluster.prototype.state = ca({ - params: { - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/_cluster/state/<%=metric%>/<%=index%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'blocks', - 'metadata', - 'nodes', - 'routing_table', - 'routing_nodes', - 'master_node', - 'version' - ] - }, - index: { - type: 'list' - } - } - }, - { - fmt: '/_cluster/state/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'blocks', - 'metadata', - 'nodes', - 'routing_table', - 'routing_nodes', - 'master_node', - 'version' - ] - } - } - }, - { - fmt: '/_cluster/state' - } - ] -}); - -/** - * Perform a [cluster.stats](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cluster-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - */ -api.cluster.prototype.stats = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_cluster/stats/nodes/<%=nodeId%>', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_cluster/stats' - } - ] -}); - -/** - * Perform a [count](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-count.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.minScore - Include only documents with a specific `_score` value in the result - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>, <>, <>} params.index - A comma-separated list of indices to restrict the results - * @param {<>, <>, <>} params.type - A comma-separated list of types to restrict the results - */ -api.count = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - minScore: { - type: 'number', - name: 'min_score' - }, - preference: { - type: 'string' - }, - routing: { - type: 'string' - }, - q: { - type: 'string' - }, - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - lenient: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_count', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_count', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_count' - } - ], - method: 'POST' -}); - -/** - * Perform a [countPercolate](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-percolate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.percolateIndex - The index to count percolate the document into. Defaults to index. - * @param {<>} params.percolateType - The type to count percolate document into. Defaults to type. - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index of the document being count percolated. - * @param {<>} params.type - The type of the document being count percolated. - * @param {<>} params.id - Substitute the document in the request body with a document that is known by the specified id. On top of the id, the index and type parameter will be used to retrieve the document from within the cluster. - */ -api.countPercolate = ca({ - params: { - routing: { - type: 'list' - }, - preference: { - type: 'string' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - percolateIndex: { - type: 'string', - name: 'percolate_index' - }, - percolateType: { - type: 'string', - name: 'percolate_type' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_percolate/count', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/<%=type%>/_percolate/count', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - } - ], - method: 'POST' -}); - -/** - * Perform a [create](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-index_.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.parent - ID of the parent document - * @param {<>} params.refresh - If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.create = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - timestamp: { - type: 'time' - }, - ttl: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - }, - pipeline: { - type: 'string' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_create', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [delete](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-delete.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the delete operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.parent - ID of parent document - * @param {<>} params.refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api['delete'] = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [deleteByQuery](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-delete-by-query.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.conflicts=abort] - What to do when the delete-by-query hits version conflicts? - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.searchTimeout - Explicit timeout for each search request. Defaults to no timeout. - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the delete by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.scrollSize - Size on the scroll request powering the update_by_query - * @param {<>} [params.waitForCompletion=true] - Should the request should block until the delete-by-query is complete. - * @param {<>} params.requestsPerSecond - The throttle for this request in sub-requests per second. -1 means no throttle. - * @param {<>} [params.slices=1] - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.deleteByQuery = ca({ - params: { - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - from: { - type: 'number' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - conflicts: { - type: 'enum', - 'default': 'abort', - options: [ - 'abort', - 'proceed' - ] - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - lenient: { - type: 'boolean' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'dfs_query_then_fetch' - ], - name: 'search_type' - }, - searchTimeout: { - type: 'time', - name: 'search_timeout' - }, - size: { - type: 'number' - }, - sort: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - terminateAfter: { - type: 'number', - name: 'terminate_after' - }, - stats: { - type: 'list' - }, - version: { - type: 'boolean' - }, - requestCache: { - type: 'boolean', - name: 'request_cache' - }, - refresh: { - type: 'boolean' - }, - timeout: { - type: 'time', - 'default': '1m' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - scrollSize: { - type: 'number', - name: 'scroll_size' - }, - waitForCompletion: { - type: 'boolean', - 'default': true, - name: 'wait_for_completion' - }, - requestsPerSecond: { - type: 'number', - 'default': 0, - name: 'requests_per_second' - }, - slices: { - type: 'number', - 'default': 1 - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_delete_by_query', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_delete_by_query', - req: { - index: { - type: 'list' - } - } - } - ], - needBody: true, - method: 'POST' -}); - -/** - * Perform a [deleteScript](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Script ID - * @param {<>} params.lang - Script language - */ -api.deleteScript = ca({ - urls: [ - { - fmt: '/_scripts/<%=lang%>/<%=id%>', - req: { - lang: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/_scripts/<%=lang%>', - req: { - lang: { - type: 'string' - } - } - } - ], - method: 'DELETE' -}); - -/** - * Perform a [deleteTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Template ID - */ -api.deleteTemplate = ca({ - url: { - fmt: '/_search/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [exists](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document (use `_all` to fetch the first document matching the ID across all types) - */ -api.exists = ca({ - params: { - storedFields: { - type: 'list', - name: 'stored_fields' - }, - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [existsSource](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document; use `_all` to fetch the first document matching the ID across all types - */ -api.existsSource = ca({ - params: { - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_source', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [explain](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-explain.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzeWildcard - Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false) - * @param {<>} params.analyzer - The analyzer for the query string query - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The default field for query string query (default: _all) - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.explain = ca({ - params: { - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - analyzer: { - type: 'string' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - storedFields: { - type: 'list', - name: 'stored_fields' - }, - lenient: { - type: 'boolean' - }, - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_explain', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [fieldCaps](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-field-caps.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.fields - A comma-separated list of field names - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.fieldCaps = ca({ - params: { - fields: { - type: 'list' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_field_caps', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_field_caps' - } - ], - method: 'POST' -}); - -/** - * Perform a [fieldStats](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-field-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for to get field statistics for (min value, max value, and more) - * @param {<>} [params.level=cluster] - Defines if field stats should be returned on a per index level or on a cluster wide level - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.fieldStats = ca({ - params: { - fields: { - type: 'list' - }, - level: { - type: 'enum', - 'default': 'cluster', - options: [ - 'indices', - 'cluster' - ] - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_field_stats', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_field_stats' - } - ], - method: 'POST' -}); - -/** - * Perform a [get](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document (use `_all` to fetch the first document matching the ID across all types) - */ -api.get = ca({ - params: { - storedFields: { - type: 'list', - name: 'stored_fields' - }, - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [getScript](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Script ID - * @param {<>} params.lang - Script language - */ -api.getScript = ca({ - urls: [ - { - fmt: '/_scripts/<%=lang%>/<%=id%>', - req: { - lang: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/_scripts/<%=lang%>', - req: { - lang: { - type: 'string' - } - } - } - ] -}); - -/** - * Perform a [getSource](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document; use `_all` to fetch the first document matching the ID across all types - */ -api.getSource = ca({ - params: { - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_source', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [getTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Template ID - */ -api.getTemplate = ca({ - url: { - fmt: '/_search/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [index](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-index_.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} [params.opType=index] - Explicit operation type - * @param {<>} params.parent - ID of the parent document - * @param {<>} params.refresh - If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.index = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - opType: { - type: 'enum', - 'default': 'index', - options: [ - 'index', - 'create' - ], - name: 'op_type' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - timestamp: { - type: 'time' - }, - ttl: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - }, - pipeline: { - type: 'string' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/<%=type%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - } - ], - needBody: true, - method: 'POST' -}); - -api.indices = namespace(); - -/** - * Perform a [indices.analyze](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-analyze.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The name of the analyzer to use - * @param {<>, <>, <>} params.charFilter - A comma-separated list of character filters to use for the analysis - * @param {<>} params.field - Use the analyzer configured for this field (instead of passing the analyzer name) - * @param {<>, <>, <>} params.filter - A comma-separated list of filters to use for the analysis - * @param {<>} params.index - The name of the index to scope the operation - * @param {<>} params.preferLocal - With `true`, specify that a local shard should be used if available, with `false`, use a random shard (default: true) - * @param {<>, <>, <>} params.text - The text on which the analysis should be performed (when request body is not used) - * @param {<>} params.tokenizer - The name of the tokenizer to use for the analysis - * @param {<>} params.explain - With `true`, outputs more advanced details. (default: false) - * @param {<>, <>, <>} params.attributes - A comma-separated list of token attributes to output, this parameter works only with `explain=true` - * @param {<>} [params.format=detailed] - Format of the output - */ -api.indices.prototype.analyze = ca({ - params: { - analyzer: { - type: 'string' - }, - charFilter: { - type: 'list', - name: 'char_filter' - }, - field: { - type: 'string' - }, - filter: { - type: 'list' - }, - index: { - type: 'string' - }, - preferLocal: { - type: 'boolean', - name: 'prefer_local' - }, - text: { - type: 'list' - }, - tokenizer: { - type: 'string' - }, - explain: { - type: 'boolean' - }, - attributes: { - type: 'list' - }, - format: { - type: 'enum', - 'default': 'detailed', - options: [ - 'detailed', - 'text' - ] - } - }, - urls: [ - { - fmt: '/<%=index%>/_analyze', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_analyze' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.clearCache](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-clearcache.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.fieldData - Clear field data - * @param {<>} params.fielddata - Clear field data - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to clear when using the `field_data` parameter (default: all) - * @param {<>} params.query - Clear query caches - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index name to limit the operation - * @param {<>} params.recycler - Clear the recycler cache - * @param {<>} params.requestCache - Clear request cache - * @param {<>} params.request - Clear request cache - */ -api.indices.prototype.clearCache = ca({ - params: { - fieldData: { - type: 'boolean', - name: 'field_data' - }, - fielddata: { - type: 'boolean' - }, - fields: { - type: 'list' - }, - query: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - index: { - type: 'list' - }, - recycler: { - type: 'boolean' - }, - requestCache: { - type: 'boolean', - name: 'request_cache' - }, - request: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_cache/clear', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cache/clear' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.close](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-open-close.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma separated list of indices to close - */ -api.indices.prototype.close = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - url: { - fmt: '/<%=index%>/_close', - req: { - index: { - type: 'list' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [indices.create](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-create-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for before the operation returns. - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.updateAllTypes - Whether to update the mapping for all fields with the same name across all types or not - * @param {<>} params.index - The name of the index - */ -api.indices.prototype.create = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - updateAllTypes: { - type: 'boolean', - name: 'update_all_types' - } - }, - url: { - fmt: '/<%=index%>', - req: { - index: { - type: 'string' - } - } - }, - method: 'PUT' -}); - -/** - * Perform a [indices.delete](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-delete-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices - */ -api.indices.prototype['delete'] = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [indices.deleteAlias](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit timestamp for the document - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of index names (supports wildcards); use `_all` for all indices - * @param {<>, <>, <>} params.name - A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices. - */ -api.indices.prototype.deleteAlias = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [indices.deleteTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.name - The name of the template - */ -api.indices.prototype.deleteTemplate = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [indices.exists](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-exists.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.ignoreUnavailable - Ignore unavailable indexes (default: false) - * @param {<>} params.allowNoIndices - Ignore if a wildcard expression resolves to no concrete indices (default: false) - * @param {<>} [params.expandWildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (default: open) - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.includeDefaults - Whether to return all default setting for each of the indices. - * @param {<>, <>, <>} params.index - A comma-separated list of index names - */ -api.indices.prototype.exists = ca({ - params: { - local: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - includeDefaults: { - type: 'boolean', - 'default': false, - name: 'include_defaults' - } - }, - url: { - fmt: '/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [indices.existsAlias](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=all] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names to filter aliases - * @param {<>, <>, <>} params.name - A comma-separated list of alias names to return - */ -api.indices.prototype.existsAlias = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'all', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/_alias/<%=name%>', - req: { - name: { - type: 'list' - } - } - } - ], - method: 'HEAD' -}); - -/** - * Perform a [indices.existsTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.name - The comma separated names of the index templates - */ -api.indices.prototype.existsTemplate = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - local: { - type: 'boolean' - } - }, - url: { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [indices.existsType](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-types-exists.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` to check the types across all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to check - */ -api.indices.prototype.existsType = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - url: { - fmt: '/<%=index%>/_mapping/<%=type%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [indices.flush](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-flush.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.force - Whether a flush should be forced even if it is not necessarily needed ie. if no changes will be committed to the index. This is useful if transaction log IDs should be incremented even if no uncommitted changes are present. (This setting can be considered as internal) - * @param {<>} params.waitIfOngoing - If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. The default is true. If set to false the flush will be skipped iff if another flush operation is already running. - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string for all indices - */ -api.indices.prototype.flush = ca({ - params: { - force: { - type: 'boolean' - }, - waitIfOngoing: { - type: 'boolean', - name: 'wait_if_ongoing' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_flush', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_flush' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.flushSynced](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-synced-flush.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string for all indices - */ -api.indices.prototype.flushSynced = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_flush/synced', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_flush/synced' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.forcemerge](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-forcemerge.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flush - Specify whether the index should be flushed after performing the operation (default: true) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.maxNumSegments - The number of segments the index should be merged into (default: dynamic) - * @param {<>} params.onlyExpungeDeletes - Specify whether the operation should only expunge deleted documents - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.waitForMerge - Specify whether the request should block until the merge process is finished (default: true) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.forcemerge = ca({ - params: { - flush: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - maxNumSegments: { - type: 'number', - name: 'max_num_segments' - }, - onlyExpungeDeletes: { - type: 'boolean', - name: 'only_expunge_deletes' - }, - operationThreading: { - name: 'operation_threading' - }, - waitForMerge: { - type: 'boolean', - name: 'wait_for_merge' - } - }, - urls: [ - { - fmt: '/<%=index%>/_forcemerge', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_forcemerge' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.get](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-get-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.ignoreUnavailable - Ignore unavailable indexes (default: false) - * @param {<>} params.allowNoIndices - Ignore if a wildcard expression resolves to no concrete indices (default: false) - * @param {<>} [params.expandWildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (default: open) - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.includeDefaults - Whether to return all default setting for each of the indices. - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} params.feature - A comma-separated list of features - */ -api.indices.prototype.get = ca({ - params: { - local: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - includeDefaults: { - type: 'boolean', - 'default': false, - name: 'include_defaults' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=feature%>', - req: { - index: { - type: 'list' - }, - feature: { - type: 'list', - options: [ - '_settings', - '_mappings', - '_aliases' - ] - } - } - }, - { - fmt: '/<%=index%>', - req: { - index: { - type: 'list' - } - } - } - ] -}); - -/** - * Perform a [indices.getAlias](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=all] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names to filter aliases - * @param {<>, <>, <>} params.name - A comma-separated list of alias names to return - */ -api.indices.prototype.getAlias = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'all', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/_alias/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_alias', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_alias' - } - ] -}); - -/** - * Perform a [indices.getFieldMapping](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-get-field-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.includeDefaults - Whether the default mapping values should be returned as well - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} params.type - A comma-separated list of document types - * @param {<>, <>, <>} params.fields - A comma-separated list of fields - */ -api.indices.prototype.getFieldMapping = ca({ - params: { - includeDefaults: { - type: 'boolean', - name: 'include_defaults' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_mapping/<%=type%>/field/<%=fields%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - }, - fields: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_mapping/field/<%=fields%>', - req: { - index: { - type: 'list' - }, - fields: { - type: 'list' - } - } - }, - { - fmt: '/_mapping/<%=type%>/field/<%=fields%>', - req: { - type: { - type: 'list' - }, - fields: { - type: 'list' - } - } - }, - { - fmt: '/_mapping/field/<%=fields%>', - req: { - fields: { - type: 'list' - } - } - } - ] -}); - -/** - * Perform a [indices.getMapping](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-get-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} params.type - A comma-separated list of document types - */ -api.indices.prototype.getMapping = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_mapping/<%=type%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_mapping', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_mapping/<%=type%>', - req: { - type: { - type: 'list' - } - } - }, - { - fmt: '/_mapping' - } - ] -}); - -/** - * Perform a [indices.getSettings](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-get-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open,closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.includeDefaults - Whether to return all default setting for each of the indices. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.name - The name of the settings that should be included - */ -api.indices.prototype.getSettings = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': [ - 'open', - 'closed' - ], - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - local: { - type: 'boolean' - }, - includeDefaults: { - type: 'boolean', - 'default': false, - name: 'include_defaults' - } - }, - urls: [ - { - fmt: '/<%=index%>/_settings/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_settings', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_settings/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/_settings' - } - ] -}); - -/** - * Perform a [indices.getTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.name - The comma separated names of the index templates - */ -api.indices.prototype.getTemplate = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/_template' - } - ] -}); - -/** - * Perform a [indices.getUpgrade](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-upgrade.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.getUpgrade = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_upgrade', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_upgrade' - } - ] -}); - -/** - * Perform a [indices.open](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-open-close.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma separated list of indices to open - */ -api.indices.prototype.open = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'closed', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - url: { - fmt: '/<%=index%>/_open', - req: { - index: { - type: 'list' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [indices.putAlias](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit timestamp for the document - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices. - * @param {<>} params.name - The name of the alias to be created or updated - */ -api.indices.prototype.putAlias = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'string' - } - } - }, - method: 'PUT' -}); - -/** - * Perform a [indices.putMapping](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-put-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.updateAllTypes - Whether to update the mapping for all fields with the same name across all types or not - * @param {<>, <>, <>} params.index - A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices. - * @param {<>} params.type - The name of the document type - */ -api.indices.prototype.putMapping = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - updateAllTypes: { - type: 'boolean', - name: 'update_all_types' - } - }, - urls: [ - { - fmt: '/<%=index%>/_mapping/<%=type%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/_mapping/<%=type%>', - req: { - type: { - type: 'string' - } - } - } - ], - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [indices.putSettings](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.preserveExisting - Whether to update existing settings. If set to `true` existing settings on an index remain unchanged, the default is `false` - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.putSettings = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - preserveExisting: { - type: 'boolean', - name: 'preserve_existing' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - } - }, - urls: [ - { - fmt: '/<%=index%>/_settings', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_settings' - } - ], - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [indices.putTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.order - The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers) - * @param {<>} params.create - Whether the index template should only be added if new or can also replace an existing one - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.name - The name of the template - */ -api.indices.prototype.putTemplate = ca({ - params: { - order: { - type: 'number' - }, - create: { - type: 'boolean', - 'default': false - }, - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - } - }, - url: { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [indices.recovery](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-recovery.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.detailed - Whether to display detailed information about shard recovery - * @param {<>} params.activeOnly - Display only those recoveries that are currently on-going - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.recovery = ca({ - params: { - detailed: { - type: 'boolean', - 'default': false - }, - activeOnly: { - type: 'boolean', - 'default': false, - name: 'active_only' - } - }, - urls: [ - { - fmt: '/<%=index%>/_recovery', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_recovery' - } - ] -}); - -/** - * Perform a [indices.refresh](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-refresh.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.refresh = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_refresh', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_refresh' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.rollover](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-rollover-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.dryRun - If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for on the newly created rollover index before the operation returns. - * @param {<>} params.alias - The name of the alias to rollover - * @param {<>} params.newIndex - The name of the rollover index - */ -api.indices.prototype.rollover = ca({ - params: { - timeout: { - type: 'time' - }, - dryRun: { - type: 'boolean', - name: 'dry_run' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - } - }, - urls: [ - { - fmt: '/<%=alias%>/_rollover/<%=newIndex%>', - req: { - alias: { - type: 'string' - }, - newIndex: { - type: 'string' - } - } - }, - { - fmt: '/<%=alias%>/_rollover', - req: { - alias: { - type: 'string' - } - } - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.segments](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-segments.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.verbose - Includes detailed memory usage by Lucene. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.segments = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - operationThreading: { - name: 'operation_threading' - }, - verbose: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/<%=index%>/_segments', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_segments' - } - ] -}); - -/** - * Perform a [indices.shardStores](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-shards-stores.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.status - A comma-separated list of statuses used to filter on shards to get store information for - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {anything} params.operationThreading - TODO: ? - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.shardStores = ca({ - params: { - status: { - type: 'list', - options: [ - 'green', - 'yellow', - 'red', - 'all' - ] - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - operationThreading: { - name: 'operation_threading' - } - }, - urls: [ - { - fmt: '/<%=index%>/_shard_stores', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_shard_stores' - } - ] -}); - -/** - * Perform a [indices.shrink](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-shrink-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for on the shrunken index before the operation returns. - * @param {<>} params.index - The name of the source index to shrink - * @param {<>} params.target - The name of the target index to shrink into - */ -api.indices.prototype.shrink = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - } - }, - url: { - fmt: '/<%=index%>/_shrink/<%=target%>', - req: { - index: { - type: 'string' - }, - target: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [indices.stats](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.completionFields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields for `fielddata` index metric (supports wildcards) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) - * @param {<>, <>, <>} params.groups - A comma-separated list of search groups for `search` index metric - * @param {<>} [params.level=indices] - Return stats aggregated at cluster, index or shard level - * @param {<>, <>, <>} params.types - A comma-separated list of document types for the `indexing` index metric - * @param {<>} params.includeSegmentFileSizes - Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.metric - Limit the information returned the specific metrics. - */ -api.indices.prototype.stats = ca({ - params: { - completionFields: { - type: 'list', - name: 'completion_fields' - }, - fielddataFields: { - type: 'list', - name: 'fielddata_fields' - }, - fields: { - type: 'list' - }, - groups: { - type: 'list' - }, - level: { - type: 'enum', - 'default': 'indices', - options: [ - 'cluster', - 'indices', - 'shards' - ] - }, - types: { - type: 'list' - }, - includeSegmentFileSizes: { - type: 'boolean', - 'default': false, - name: 'include_segment_file_sizes' - } - }, - urls: [ - { - fmt: '/<%=index%>/_stats/<%=metric%>', - req: { - index: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'percolate', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/_stats/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'percolate', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/<%=index%>/_stats', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_stats' - } - ] -}); - -/** - * Perform a [indices.updateAliases](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Request timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - */ -api.indices.prototype.updateAliases = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_aliases' - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [indices.upgrade](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-upgrade.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.waitForCompletion - Specify whether the request should block until the all segments are upgraded (default: false) - * @param {<>} params.onlyAncientSegments - If true, only ancient (an older Lucene major release) segments will be upgraded - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.upgrade = ca({ - params: { - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - waitForCompletion: { - type: 'boolean', - name: 'wait_for_completion' - }, - onlyAncientSegments: { - type: 'boolean', - name: 'only_ancient_segments' - } - }, - urls: [ - { - fmt: '/<%=index%>/_upgrade', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_upgrade' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.validateQuery](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-validate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.explain - Return detailed information about the error - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.rewrite - Provide a more detailed explanation showing the actual Lucene query that will be executed. - * @param {<>} params.allShards - Execute validation on all shards instead of one random shard per index - * @param {<>, <>, <>} params.index - A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to restrict the operation; leave empty to perform the operation on all types - */ -api.indices.prototype.validateQuery = ca({ - params: { - explain: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - operationThreading: { - name: 'operation_threading' - }, - q: { - type: 'string' - }, - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - lenient: { - type: 'boolean' - }, - rewrite: { - type: 'boolean' - }, - allShards: { - type: 'boolean', - name: 'all_shards' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_validate/query', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_validate/query', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_validate/query' - } - ], - method: 'POST' -}); - -/** - * Perform a [info](https://www.elastic.co/guide/) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.info = ca({ - url: { - fmt: '/' - } -}); - -api.ingest = namespace(); - -/** - * Perform a [ingest.deletePipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/5.5/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.id - Pipeline ID - */ -api.ingest.prototype.deletePipeline = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_ingest/pipeline/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [ingest.getPipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/5.5/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.id - Comma separated list of pipeline ids. Wildcards supported - */ -api.ingest.prototype.getPipeline = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - urls: [ - { - fmt: '/_ingest/pipeline/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - { - fmt: '/_ingest/pipeline' - } - ] -}); - -/** - * Perform a [ingest.putPipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/5.5/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.id - Pipeline ID - */ -api.ingest.prototype.putPipeline = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_ingest/pipeline/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [ingest.simulate](https://www.elastic.co/guide/en/elasticsearch/plugins/5.5/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.verbose - Verbose mode. Display data output for each processor in executed pipeline - * @param {<>} params.id - Pipeline ID - */ -api.ingest.prototype.simulate = ca({ - params: { - verbose: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_ingest/pipeline/<%=id%>/_simulate', - req: { - id: { - type: 'string' - } - } - }, - { - fmt: '/_ingest/pipeline/_simulate' - } - ], - needBody: true, - method: 'POST' -}); - -/** - * Perform a [mget](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-multi-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.mget = ca({ - params: { - storedFields: { - type: 'list', - name: 'stored_fields' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_mget', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_mget', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_mget' - } - ], - needBody: true, - method: 'POST' -}); - -/** - * Perform a [mpercolate](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-percolate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.index - The index of the document being count percolated to use as default - * @param {<>} params.type - The type of the document being percolated to use as default. - */ -api.mpercolate = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_mpercolate', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_mpercolate', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_mpercolate' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -/** - * Perform a [msearch](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-multi-search.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.searchType - Search operation type - * @param {<>} params.maxConcurrentSearches - Controls the maximum number of concurrent searches the multi search api will execute - * @param {<>} params.typedKeys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response - * @param {<>, <>, <>} params.index - A comma-separated list of index names to use as default - * @param {<>, <>, <>} params.type - A comma-separated list of document types to use as default - */ -api.msearch = ca({ - params: { - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'query_and_fetch', - 'dfs_query_then_fetch', - 'dfs_query_and_fetch' - ], - name: 'search_type' - }, - maxConcurrentSearches: { - type: 'number', - name: 'max_concurrent_searches' - }, - typedKeys: { - type: 'boolean', - name: 'typed_keys' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_msearch', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_msearch', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_msearch' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -/** - * Perform a [msearchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.searchType - Search operation type - * @param {<>} params.typedKeys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response - * @param {<>} params.maxConcurrentSearches - Controls the maximum number of concurrent searches the multi search api will execute - * @param {<>, <>, <>} params.index - A comma-separated list of index names to use as default - * @param {<>, <>, <>} params.type - A comma-separated list of document types to use as default - */ -api.msearchTemplate = ca({ - params: { - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'query_and_fetch', - 'dfs_query_then_fetch', - 'dfs_query_and_fetch' - ], - name: 'search_type' - }, - typedKeys: { - type: 'boolean', - name: 'typed_keys' - }, - maxConcurrentSearches: { - type: 'number', - name: 'max_concurrent_searches' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_msearch/template', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_msearch/template', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_msearch/template' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -/** - * Perform a [mtermvectors](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-multi-termvectors.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.ids - A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body - * @param {<>} params.termStatistics - Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.fieldStatistics=true] - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.offsets=true] - Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.positions=true] - Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.payloads=true] - Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) .Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.routing - Specific routing value. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.parent - Parent id of documents. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.realtime - Specifies if requests are real-time as opposed to near-real-time (default: true). - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index in which the document resides. - * @param {<>} params.type - The type of the document. - */ -api.mtermvectors = ca({ - params: { - ids: { - type: 'list', - required: false - }, - termStatistics: { - type: 'boolean', - 'default': false, - required: false, - name: 'term_statistics' - }, - fieldStatistics: { - type: 'boolean', - 'default': true, - required: false, - name: 'field_statistics' - }, - fields: { - type: 'list', - required: false - }, - offsets: { - type: 'boolean', - 'default': true, - required: false - }, - positions: { - type: 'boolean', - 'default': true, - required: false - }, - payloads: { - type: 'boolean', - 'default': true, - required: false - }, - preference: { - type: 'string', - required: false - }, - routing: { - type: 'string', - required: false - }, - parent: { - type: 'string', - required: false - }, - realtime: { - type: 'boolean', - required: false - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_mtermvectors', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_mtermvectors', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_mtermvectors' - } - ], - method: 'POST' -}); - -api.nodes = namespace(); - -/** - * Perform a [nodes.hotThreads](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cluster-nodes-hot-threads.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.interval - The interval for the second sampling of threads - * @param {<>} params.snapshots - Number of samples of thread stacktrace (default: 10) - * @param {<>} params.threads - Specify the number of threads to provide information for (default: 3) - * @param {<>} params.ignoreIdleThreads - Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue (default: true) - * @param {<>} params.type - The type to sample (default: cpu) - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - */ -api.nodes.prototype.hotThreads = ca({ - params: { - interval: { - type: 'time' - }, - snapshots: { - type: 'number' - }, - threads: { - type: 'number' - }, - ignoreIdleThreads: { - type: 'boolean', - name: 'ignore_idle_threads' - }, - type: { - type: 'enum', - options: [ - 'cpu', - 'wait', - 'block' - ] - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_nodes/<%=nodeId%>/hotthreads', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_nodes/hotthreads' - } - ] -}); - -/** - * Perform a [nodes.info](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cluster-nodes-info.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.metric - A comma-separated list of metrics you wish returned. Leave empty to return all. - */ -api.nodes.prototype.info = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_nodes/<%=nodeId%>/<%=metric%>', - req: { - nodeId: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - 'settings', - 'os', - 'process', - 'jvm', - 'thread_pool', - 'transport', - 'http', - 'plugins', - 'ingest' - ] - } - } - }, - { - fmt: '/_nodes/<%=nodeId%>', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_nodes/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - 'settings', - 'os', - 'process', - 'jvm', - 'thread_pool', - 'transport', - 'http', - 'plugins', - 'ingest' - ] - } - } - }, - { - fmt: '/_nodes' - } - ] -}); - -/** - * Perform a [nodes.stats](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cluster-nodes-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.completionFields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields for `fielddata` index metric (supports wildcards) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) - * @param {<>} params.groups - A comma-separated list of search groups for `search` index metric - * @param {<>} [params.level=node] - Return indices stats aggregated at index, node or shard level - * @param {<>, <>, <>} params.types - A comma-separated list of document types for the `indexing` index metric - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.includeSegmentFileSizes - Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics - * @param {<>, <>, <>} params.indexMetric - Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified. - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - */ -api.nodes.prototype.stats = ca({ - params: { - completionFields: { - type: 'list', - name: 'completion_fields' - }, - fielddataFields: { - type: 'list', - name: 'fielddata_fields' - }, - fields: { - type: 'list' - }, - groups: { - type: 'boolean' - }, - level: { - type: 'enum', - 'default': 'node', - options: [ - 'indices', - 'node', - 'shards' - ] - }, - types: { - type: 'list' - }, - timeout: { - type: 'time' - }, - includeSegmentFileSizes: { - type: 'boolean', - 'default': false, - name: 'include_segment_file_sizes' - } - }, - urls: [ - { - fmt: '/_nodes/<%=nodeId%>/stats/<%=metric%>/<%=indexMetric%>', - req: { - nodeId: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport', - 'discovery' - ] - }, - indexMetric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'percolate', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/_nodes/<%=nodeId%>/stats/<%=metric%>', - req: { - nodeId: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport', - 'discovery' - ] - } - } - }, - { - fmt: '/_nodes/stats/<%=metric%>/<%=indexMetric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport', - 'discovery' - ] - }, - indexMetric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'percolate', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/_nodes/<%=nodeId%>/stats', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_nodes/stats/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport', - 'discovery' - ] - } - } - }, - { - fmt: '/_nodes/stats' - } - ] -}); - -/** - * Perform a [percolate](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-percolate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.percolateIndex - The index to percolate the document into. Defaults to index. - * @param {<>} params.percolateType - The type to percolate document into. Defaults to type. - * @param {<>} params.percolateRouting - The routing value to use when percolating the existing document. - * @param {<>} params.percolatePreference - Which shard to prefer when executing the percolate request. - * @param {<>} params.percolateFormat - Return an array of matching query IDs instead of objects - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index of the document being percolated. - * @param {<>} params.type - The type of the document being percolated. - * @param {<>} params.id - Substitute the document in the request body with a document that is known by the specified id. On top of the id, the index and type parameter will be used to retrieve the document from within the cluster. - */ -api.percolate = ca({ - params: { - routing: { - type: 'list' - }, - preference: { - type: 'string' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - percolateIndex: { - type: 'string', - name: 'percolate_index' - }, - percolateType: { - type: 'string', - name: 'percolate_type' - }, - percolateRouting: { - type: 'string', - name: 'percolate_routing' - }, - percolatePreference: { - type: 'string', - name: 'percolate_preference' - }, - percolateFormat: { - type: 'enum', - options: [ - 'ids' - ], - name: 'percolate_format' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_percolate', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/<%=type%>/_percolate', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - } - ], - method: 'POST' -}); - -/** - * Perform a [ping](https://www.elastic.co/guide/) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.ping = ca({ - url: { - fmt: '/' - }, - requestTimeout: 3000, - method: 'HEAD' -}); - -/** - * Perform a [putScript](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Script ID - * @param {<>} params.lang - Script language - */ -api.putScript = ca({ - urls: [ - { - fmt: '/_scripts/<%=lang%>/<%=id%>', - req: { - lang: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/_scripts/<%=lang%>', - req: { - lang: { - type: 'string' - } - } - } - ], - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [putTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Template ID - */ -api.putTemplate = ca({ - url: { - fmt: '/_search/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [reindex](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-reindex.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the reindex operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} [params.waitForCompletion=true] - Should the request should block until the reindex is complete. - * @param {<>} params.requestsPerSecond - The throttle to set on this request in sub-requests per second. -1 means no throttle. - * @param {<>} [params.slices=1] - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. - */ -api.reindex = ca({ - params: { - refresh: { - type: 'boolean' - }, - timeout: { - type: 'time', - 'default': '1m' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - waitForCompletion: { - type: 'boolean', - 'default': true, - name: 'wait_for_completion' - }, - requestsPerSecond: { - type: 'number', - 'default': 0, - name: 'requests_per_second' - }, - slices: { - type: 'number', - 'default': 1 - } - }, - url: { - fmt: '/_reindex' - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [reindexRethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-reindex.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.requestsPerSecond - The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. - * @param {<>} params.taskId - The task id to rethrottle - */ -api.reindexRethrottle = ca({ - params: { - requestsPerSecond: { - type: 'number', - required: true, - name: 'requests_per_second' - } - }, - url: { - fmt: '/_reindex/<%=taskId%>/_rethrottle', - req: { - taskId: { - type: 'string' - } - } - }, - method: 'POST' -}); - -api.remote = namespace(); - -/** - * Perform a [remote.info](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/cluster-remote-info.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.remote.prototype.info = ca({ - url: { - fmt: '/_remote/info' - } -}); - -/** - * Perform a [renderSearchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - The id of the stored search template - */ -api.renderSearchTemplate = ca({ - urls: [ - { - fmt: '/_render/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - { - fmt: '/_render/template' - } - ], - method: 'POST' -}); - -/** - * Perform a [scroll](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-request-scroll.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.scrollId - The scroll ID - */ -api.scroll = ca({ - params: { - scroll: { - type: 'time' - }, - scrollId: { - type: 'string', - name: 'scroll_id' - } - }, - urls: [ - { - fmt: '/_search/scroll/<%=scrollId%>', - req: { - scrollId: { - type: 'string' - } - } - }, - { - fmt: '/_search/scroll' - } - ], - paramAsBody: { - param: 'scrollId', - body: 'scroll_id' - }, - method: 'POST' -}); - -/** - * Perform a [search](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-search.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.explain - Specify whether to return detailed information about score computation as part of a hit - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return as part of a hit - * @param {<>, <>, <>} params.docvalueFields - A comma-separated list of fields to return as the docvalue representation of a field for each hit - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields to return as the docvalue representation of a field for each hit - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.suggestField - Specify which field to use for suggestions - * @param {<>} [params.suggestMode=missing] - Specify suggest mode - * @param {<>} params.suggestSize - How many suggestions to return in response - * @param {<>} params.suggestText - The source text for which the suggestions should be returned - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.trackScores - Whether to calculate and return scores even if they are not used for sorting - * @param {<>} params.typedKeys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>} [params.batchedReduceSize=512] - The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.search = ca({ - params: { - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - explain: { - type: 'boolean' - }, - storedFields: { - type: 'list', - name: 'stored_fields' - }, - docvalueFields: { - type: 'list', - name: 'docvalue_fields' - }, - fielddataFields: { - type: 'list', - name: 'fielddata_fields' - }, - from: { - type: 'number' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - lenient: { - type: 'boolean' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'dfs_query_then_fetch' - ], - name: 'search_type' - }, - size: { - type: 'number' - }, - sort: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - terminateAfter: { - type: 'number', - name: 'terminate_after' - }, - stats: { - type: 'list' - }, - suggestField: { - type: 'string', - name: 'suggest_field' - }, - suggestMode: { - type: 'enum', - 'default': 'missing', - options: [ - 'missing', - 'popular', - 'always' - ], - name: 'suggest_mode' - }, - suggestSize: { - type: 'number', - name: 'suggest_size' - }, - suggestText: { - type: 'string', - name: 'suggest_text' - }, - timeout: { - type: 'time' - }, - trackScores: { - type: 'boolean', - name: 'track_scores' - }, - typedKeys: { - type: 'boolean', - name: 'typed_keys' - }, - version: { - type: 'boolean' - }, - requestCache: { - type: 'boolean', - name: 'request_cache' - }, - batchedReduceSize: { - type: 'number', - 'default': 512, - name: 'batched_reduce_size' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_search', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_search', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_search' - } - ], - method: 'POST' -}); - -/** - * Perform a [searchShards](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-shards.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.searchShards = ca({ - params: { - preference: { - type: 'string' - }, - routing: { - type: 'string' - }, - local: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_search_shards', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_search_shards', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_search_shards' - } - ], - method: 'POST' -}); - -/** - * Perform a [searchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.explain - Specify whether to return detailed information about score computation as part of a hit - * @param {<>} params.profile - Specify whether to profile the query execution - * @param {<>} params.typedKeys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.searchTemplate = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - preference: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'query_and_fetch', - 'dfs_query_then_fetch', - 'dfs_query_and_fetch' - ], - name: 'search_type' - }, - explain: { - type: 'boolean' - }, - profile: { - type: 'boolean' - }, - typedKeys: { - type: 'boolean', - name: 'typed_keys' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_search/template', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_search/template', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_search/template' - } - ], - method: 'POST' -}); - -api.snapshot = namespace(); - -/** - * Perform a [snapshot.create](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.waitForCompletion - Should this request wait until the operation has completed before returning - * @param {<>} params.repository - A repository name - * @param {<>} params.snapshot - A snapshot name - */ -api.snapshot.prototype.create = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForCompletion: { - type: 'boolean', - 'default': false, - name: 'wait_for_completion' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [snapshot.createRepository](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.verify - Whether to verify the repository after creation - * @param {<>} params.repository - A repository name - */ -api.snapshot.prototype.createRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - }, - verify: { - type: 'boolean' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>', - req: { - repository: { - type: 'string' - } - } - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [snapshot.delete](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.repository - A repository name - * @param {<>} params.snapshot - A snapshot name - */ -api.snapshot.prototype['delete'] = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [snapshot.deleteRepository](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.repository - A comma-separated list of repository names - */ -api.snapshot.prototype.deleteRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>', - req: { - repository: { - type: 'list' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [snapshot.get](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.ignoreUnavailable - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown - * @param {<>} params.verbose - Whether to show verbose snapshot info or only show the basic info found in the repository index blob - * @param {<>} params.repository - A repository name - * @param {<>, <>, <>} params.snapshot - A comma-separated list of snapshot names - */ -api.snapshot.prototype.get = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - verbose: { - type: 'boolean' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'list' - } - } - } -}); - -/** - * Perform a [snapshot.getRepository](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.repository - A comma-separated list of repository names - */ -api.snapshot.prototype.getRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/_snapshot/<%=repository%>', - req: { - repository: { - type: 'list' - } - } - }, - { - fmt: '/_snapshot' - } - ] -}); - -/** - * Perform a [snapshot.restore](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.waitForCompletion - Should this request wait until the operation has completed before returning - * @param {<>} params.repository - A repository name - * @param {<>} params.snapshot - A snapshot name - */ -api.snapshot.prototype.restore = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForCompletion: { - type: 'boolean', - 'default': false, - name: 'wait_for_completion' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>/_restore', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [snapshot.status](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.ignoreUnavailable - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown - * @param {<>} params.repository - A repository name - * @param {<>, <>, <>} params.snapshot - A comma-separated list of snapshot names - */ -api.snapshot.prototype.status = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - } - }, - urls: [ - { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>/_status', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'list' - } - } - }, - { - fmt: '/_snapshot/<%=repository%>/_status', - req: { - repository: { - type: 'string' - } - } - }, - { - fmt: '/_snapshot/_status' - } - ] -}); - -/** - * Perform a [snapshot.verifyRepository](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.repository - A repository name - */ -api.snapshot.prototype.verifyRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/_verify', - req: { - repository: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [suggest](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-suggesters.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params.index - A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices - */ -api.suggest = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - preference: { - type: 'string' - }, - routing: { - type: 'string' - } - }, - urls: [ - { - fmt: '/<%=index%>/_suggest', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_suggest' - } - ], - needBody: true, - method: 'POST' -}); - -api.tasks = namespace(); - -/** - * Perform a [tasks.cancel](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.actions - A comma-separated list of actions that should be cancelled. Leave empty to cancel all. - * @param {<>} params.parentNode - Cancel tasks with specified parent node. - * @param {<>} params.parentTask - Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all. - * @param {<>} params.taskId - Cancel the task with specified task id (node_id:task_number) - */ -api.tasks.prototype.cancel = ca({ - params: { - nodeId: { - type: 'list', - name: 'node_id' - }, - actions: { - type: 'list' - }, - parentNode: { - type: 'string', - name: 'parent_node' - }, - parentTask: { - type: 'string', - name: 'parent_task' - } - }, - urls: [ - { - fmt: '/_tasks/<%=taskId%>/_cancel', - req: { - taskId: { - type: 'string' - } - } - }, - { - fmt: '/_tasks/_cancel' - } - ], - method: 'POST' -}); - -/** - * Perform a [tasks.get](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForCompletion - Wait for the matching tasks to complete (default: false) - * @param {<>} params.taskId - Return the task with specified id (node_id:task_number) - */ -api.tasks.prototype.get = ca({ - params: { - waitForCompletion: { - type: 'boolean', - name: 'wait_for_completion' - } - }, - url: { - fmt: '/_tasks/<%=taskId%>', - req: { - taskId: { - type: 'string' - } - } - } -}); - -/** - * Perform a [tasks.list](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.actions - A comma-separated list of actions that should be returned. Leave empty to return all. - * @param {<>} params.detailed - Return detailed task information (default: false) - * @param {<>} params.parentNode - Return tasks with specified parent node. - * @param {<>} params.parentTask - Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all. - * @param {<>} params.waitForCompletion - Wait for the matching tasks to complete (default: false) - * @param {<>} [params.groupBy=nodes] - Group tasks by nodes or parent/child relationships - */ -api.tasks.prototype.list = ca({ - params: { - nodeId: { - type: 'list', - name: 'node_id' - }, - actions: { - type: 'list' - }, - detailed: { - type: 'boolean' - }, - parentNode: { - type: 'string', - name: 'parent_node' - }, - parentTask: { - type: 'string', - name: 'parent_task' - }, - waitForCompletion: { - type: 'boolean', - name: 'wait_for_completion' - }, - groupBy: { - type: 'enum', - 'default': 'nodes', - options: [ - 'nodes', - 'parents' - ], - name: 'group_by' - } - }, - url: { - fmt: '/_tasks' - } -}); - -/** - * Perform a [termvectors](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-termvectors.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.termStatistics - Specifies if total term frequency and document frequency should be returned. - * @param {<>} [params.fieldStatistics=true] - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return. - * @param {<>} [params.offsets=true] - Specifies if term offsets should be returned. - * @param {<>} [params.positions=true] - Specifies if term positions should be returned. - * @param {<>} [params.payloads=true] - Specifies if term payloads should be returned. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random). - * @param {<>} params.routing - Specific routing value. - * @param {<>} params.parent - Parent id of documents. - * @param {<>} params.realtime - Specifies if request is real-time as opposed to near-real-time (default: true). - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index in which the document resides. - * @param {<>} params.type - The type of the document. - * @param {<>} params.id - The id of the document, when not specified a doc param should be supplied. - */ -api.termvectors = ca({ - params: { - termStatistics: { - type: 'boolean', - 'default': false, - required: false, - name: 'term_statistics' - }, - fieldStatistics: { - type: 'boolean', - 'default': true, - required: false, - name: 'field_statistics' - }, - fields: { - type: 'list', - required: false - }, - offsets: { - type: 'boolean', - 'default': true, - required: false - }, - positions: { - type: 'boolean', - 'default': true, - required: false - }, - payloads: { - type: 'boolean', - 'default': true, - required: false - }, - preference: { - type: 'string', - required: false - }, - routing: { - type: 'string', - required: false - }, - parent: { - type: 'string', - required: false - }, - realtime: { - type: 'boolean', - required: false - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_termvectors', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/<%=type%>/_termvectors', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - } - ], - method: 'POST' -}); - -/** - * Perform a [update](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-update.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the update operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return in the response - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.lang - The script language (default: painless) - * @param {<>} params.parent - ID of the parent document. Is is only used for routing and when for the upsert request - * @param {<>} params.refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.retryOnConflict - Specify how many times should the operation be retried when a conflict occurs (default: 0) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.update = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - fields: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - lang: { - type: 'string' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - retryOnConflict: { - type: 'number', - name: 'retry_on_conflict' - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - timestamp: { - type: 'time' - }, - ttl: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_update', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [updateByQuery](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/docs-update-by-query.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.conflicts=abort] - What to do when the update by query hits version conflicts? - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.pipeline - Ingest pipeline to set on index requests made by this action. (default: none) - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.searchTimeout - Explicit timeout for each search request. Defaults to no timeout. - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.versionType - Should the document increment the version number (internal) on hit or not (reindex) - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the update by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.scrollSize - Size on the scroll request powering the update_by_query - * @param {<>} [params.waitForCompletion=true] - Should the request should block until the update by query operation is complete. - * @param {<>} params.requestsPerSecond - The throttle to set on this request in sub-requests per second. -1 means no throttle. - * @param {<>} [params.slices=1] - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.updateByQuery = ca({ - params: { - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - from: { - type: 'number' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - conflicts: { - type: 'enum', - 'default': 'abort', - options: [ - 'abort', - 'proceed' - ] - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - lenient: { - type: 'boolean' - }, - pipeline: { - type: 'string' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'dfs_query_then_fetch' - ], - name: 'search_type' - }, - searchTimeout: { - type: 'time', - name: 'search_timeout' - }, - size: { - type: 'number' - }, - sort: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - terminateAfter: { - type: 'number', - name: 'terminate_after' - }, - stats: { - type: 'list' - }, - version: { - type: 'boolean' - }, - versionType: { - type: 'boolean', - name: 'version_type' - }, - requestCache: { - type: 'boolean', - name: 'request_cache' - }, - refresh: { - type: 'boolean' - }, - timeout: { - type: 'time', - 'default': '1m' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - scrollSize: { - type: 'number', - name: 'scroll_size' - }, - waitForCompletion: { - type: 'boolean', - 'default': true, - name: 'wait_for_completion' - }, - requestsPerSecond: { - type: 'number', - 'default': 0, - name: 'requests_per_second' - }, - slices: { - type: 'number', - 'default': 1 - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_update_by_query', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_update_by_query', - req: { - index: { - type: 'list' - } - } - } - ], - method: 'POST' -}); diff --git a/src/lib/apis/5_6.js b/src/lib/apis/5_6.js deleted file mode 100644 index 2bf813a3a..000000000 --- a/src/lib/apis/5_6.js +++ /dev/null @@ -1,7445 +0,0 @@ -var ca = require('../client_action').makeFactoryWithModifier(function (spec) { - return require('../utils').merge(spec, { - params: { - filterPath: { - type: 'list', - name: 'filter_path' - } - } - }); -}); -var namespace = require('../client_action').namespaceFactory; -var api = module.exports = {}; - -api._namespaces = ['cat', 'cluster', 'indices', 'ingest', 'nodes', 'snapshot', 'tasks']; - -/** - * Perform a [bulk](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/docs-bulk.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the bulk operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.type - Default document type for items which don't provide one - * @param {<>, <>, <>} params.fields - Default comma-separated list of fields to return in the response for updates, can be overridden on each sub-request - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request - * @param {<>, <>, <>} params._sourceExclude - Default list of fields to exclude from the returned _source field, can be overridden on each sub-request - * @param {<>, <>, <>} params._sourceInclude - Default list of fields to extract and return from the _source field, can be overridden on each sub-request - * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with - * @param {<>} params.index - Default index for items which don't provide one - */ -api.bulk = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - type: { - type: 'string' - }, - fields: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - pipeline: { - type: 'string' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_bulk', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_bulk', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_bulk' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -api.cat = namespace(); - -/** - * Perform a [cat.aliases](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/cat.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.name - A comma-separated list of alias names to return - */ -api.cat.prototype.aliases = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/aliases/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/_cat/aliases' - } - ] -}); - -/** - * Perform a [cat.allocation](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/cat-allocation.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information - */ -api.cat.prototype.allocation = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'kb', - 'm', - 'mb', - 'g', - 'gb', - 't', - 'tb', - 'p', - 'pb' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/allocation/<%=nodeId%>', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_cat/allocation' - } - ] -}); - -/** - * Perform a [cat.count](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/cat-count.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.count = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/count/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/count' - } - ] -}); - -/** - * Perform a [cat.fielddata](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/cat-fielddata.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return the fielddata size - */ -api.cat.prototype.fielddata = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'kb', - 'm', - 'mb', - 'g', - 'gb', - 't', - 'tb', - 'p', - 'pb' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - }, - fields: { - type: 'list' - } - }, - urls: [ - { - fmt: '/_cat/fielddata/<%=fields%>', - req: { - fields: { - type: 'list' - } - } - }, - { - fmt: '/_cat/fielddata' - } - ] -}); - -/** - * Perform a [cat.health](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/cat-health.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} [params.ts=true] - Set to false to disable timestamping - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.health = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - ts: { - type: 'boolean', - 'default': true - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/health' - } -}); - -/** - * Perform a [cat.help](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/cat.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - */ -api.cat.prototype.help = ca({ - params: { - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - } - }, - url: { - fmt: '/_cat' - } -}); - -/** - * Perform a [cat.indices](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/cat-indices.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.health - A health status ("green", "yellow", or "red" to filter only indices matching the specified health status - * @param {<>} params.help - Return help information - * @param {<>} params.pri - Set to true to return stats only for primary shards - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.indices = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'm', - 'g' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - health: { - type: 'enum', - 'default': null, - options: [ - 'green', - 'yellow', - 'red' - ] - }, - help: { - type: 'boolean', - 'default': false - }, - pri: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/indices/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/indices' - } - ] -}); - -/** - * Perform a [cat.master](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/cat-master.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.master = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/master' - } -}); - -/** - * Perform a [cat.nodeattrs](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/cat-nodeattrs.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.nodeattrs = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/nodeattrs' - } -}); - -/** - * Perform a [cat.nodes](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/cat-nodes.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.fullId - Return the full node ID instead of the shortened version (default: false) - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.nodes = ca({ - params: { - format: { - type: 'string' - }, - fullId: { - type: 'boolean', - name: 'full_id' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/nodes' - } -}); - -/** - * Perform a [cat.pendingTasks](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/cat-pending-tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.pendingTasks = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/pending_tasks' - } -}); - -/** - * Perform a [cat.plugins](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/cat-plugins.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.plugins = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/plugins' - } -}); - -/** - * Perform a [cat.recovery](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/cat-recovery.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.recovery = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'kb', - 'm', - 'mb', - 'g', - 'gb', - 't', - 'tb', - 'p', - 'pb' - ] - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/recovery/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/recovery' - } - ] -}); - -/** - * Perform a [cat.repositories](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/cat-repositories.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.repositories = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean', - 'default': false - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/repositories' - } -}); - -/** - * Perform a [cat.segments](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/cat-segments.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.segments = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'kb', - 'm', - 'mb', - 'g', - 'gb', - 't', - 'tb', - 'p', - 'pb' - ] - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/segments/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/segments' - } - ] -}); - -/** - * Perform a [cat.shards](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/cat-shards.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.shards = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'kb', - 'm', - 'mb', - 'g', - 'gb', - 't', - 'tb', - 'p', - 'pb' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/shards/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/shards' - } - ] -}); - -/** - * Perform a [cat.snapshots](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/cat-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.ignoreUnavailable - Set to true to ignore unavailable snapshots - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.repository - Name of repository from which to fetch the snapshot information - */ -api.cat.prototype.snapshots = ca({ - params: { - format: { - type: 'string' - }, - ignoreUnavailable: { - type: 'boolean', - 'default': false, - name: 'ignore_unavailable' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/snapshots/<%=repository%>', - req: { - repository: { - type: 'list' - } - } - }, - { - fmt: '/_cat/snapshots' - } - ] -}); - -/** - * Perform a [cat.tasks](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.actions - A comma-separated list of actions that should be returned. Leave empty to return all. - * @param {<>} params.detailed - Return detailed task information (default: false) - * @param {<>} params.parentNode - Return tasks with specified parent node. - * @param {<>} params.parentTask - Return tasks with specified parent task id. Set to -1 to return all. - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.tasks = ca({ - params: { - format: { - type: 'string' - }, - nodeId: { - type: 'list', - name: 'node_id' - }, - actions: { - type: 'list' - }, - detailed: { - type: 'boolean' - }, - parentNode: { - type: 'string', - name: 'parent_node' - }, - parentTask: { - type: 'number', - name: 'parent_task' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/tasks' - } -}); - -/** - * Perform a [cat.templates](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/cat-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>} params.name - A pattern that returned template names must match - */ -api.cat.prototype.templates = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/templates/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - { - fmt: '/_cat/templates' - } - ] -}); - -/** - * Perform a [cat.threadPool](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/cat-thread-pool.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.size - The multiplier in which to display values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.threadPoolPatterns - A comma-separated list of regular-expressions to filter the thread pools in the output - */ -api.cat.prototype.threadPool = ca({ - params: { - format: { - type: 'string' - }, - size: { - type: 'enum', - options: [ - '', - 'k', - 'm', - 'g', - 't', - 'p' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/thread_pool/<%=threadPoolPatterns%>', - req: { - threadPoolPatterns: { - type: 'list' - } - } - }, - { - fmt: '/_cat/thread_pool' - } - ] -}); - -/** - * Perform a [clearScroll](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/search-request-scroll.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.scrollId - A comma-separated list of scroll IDs to clear - */ -api.clearScroll = ca({ - urls: [ - { - fmt: '/_search/scroll/<%=scrollId%>', - req: { - scrollId: { - type: 'list' - } - } - }, - { - fmt: '/_search/scroll' - } - ], - paramAsBody: { - param: 'scrollId', - body: 'scroll_id' - }, - method: 'DELETE' -}); - -api.cluster = namespace(); - -/** - * Perform a [cluster.allocationExplain](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/cluster-allocation-explain.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.includeYesDecisions - Return 'YES' decisions in explanation (default: false) - * @param {<>} params.includeDiskInfo - Return information about disk usage and shard sizes (default: false) - */ -api.cluster.prototype.allocationExplain = ca({ - params: { - includeYesDecisions: { - type: 'boolean', - name: 'include_yes_decisions' - }, - includeDiskInfo: { - type: 'boolean', - name: 'include_disk_info' - } - }, - url: { - fmt: '/_cluster/allocation/explain' - }, - method: 'POST' -}); - -/** - * Perform a [cluster.getSettings](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/cluster-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.includeDefaults - Whether to return all default clusters setting. - */ -api.cluster.prototype.getSettings = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - }, - includeDefaults: { - type: 'boolean', - 'default': false, - name: 'include_defaults' - } - }, - url: { - fmt: '/_cluster/settings' - } -}); - -/** - * Perform a [cluster.health](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/cluster-health.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} [params.level=cluster] - Specify the level of detail for returned information - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.waitForActiveShards - Wait until the specified number of shards is active - * @param {<>} params.waitForNodes - Wait until the specified number of nodes is available - * @param {<>} params.waitForEvents - Wait until all currently queued events with the given priority are processed - * @param {<>} params.waitForNoRelocatingShards - Whether to wait until there are no relocating shards in the cluster - * @param {<>} params.waitForStatus - Wait until cluster is in a specific state - * @param {<>, <>, <>} params.index - Limit the information returned to a specific index - */ -api.cluster.prototype.health = ca({ - params: { - level: { - type: 'enum', - 'default': 'cluster', - options: [ - 'cluster', - 'indices', - 'shards' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - waitForNodes: { - type: 'string', - name: 'wait_for_nodes' - }, - waitForEvents: { - type: 'enum', - options: [ - 'immediate', - 'urgent', - 'high', - 'normal', - 'low', - 'languid' - ], - name: 'wait_for_events' - }, - waitForNoRelocatingShards: { - type: 'boolean', - name: 'wait_for_no_relocating_shards' - }, - waitForStatus: { - type: 'enum', - 'default': null, - options: [ - 'green', - 'yellow', - 'red' - ], - name: 'wait_for_status' - } - }, - urls: [ - { - fmt: '/_cluster/health/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cluster/health' - } - ] -}); - -/** - * Perform a [cluster.pendingTasks](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/cluster-pending.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Specify timeout for connection to master - */ -api.cluster.prototype.pendingTasks = ca({ - params: { - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_cluster/pending_tasks' - } -}); - -/** - * Perform a [cluster.putSettings](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/cluster-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - */ -api.cluster.prototype.putSettings = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_cluster/settings' - }, - method: 'PUT' -}); - -/** - * Perform a [cluster.remoteInfo](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/cluster-remote-info.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.cluster.prototype.remoteInfo = ca({ - url: { - fmt: '/_remote/info' - } -}); - -/** - * Perform a [cluster.reroute](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/cluster-reroute.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.dryRun - Simulate the operation only and return the resulting state - * @param {<>} params.explain - Return an explanation of why the commands can or cannot be executed - * @param {<>} params.retryFailed - Retries allocation of shards that are blocked due to too many subsequent allocation failures - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics. Defaults to all but metadata - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - */ -api.cluster.prototype.reroute = ca({ - params: { - dryRun: { - type: 'boolean', - name: 'dry_run' - }, - explain: { - type: 'boolean' - }, - retryFailed: { - type: 'boolean', - name: 'retry_failed' - }, - metric: { - type: 'list', - options: [ - '_all', - 'blocks', - 'metadata', - 'nodes', - 'routing_table', - 'master_node', - 'version' - ] - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_cluster/reroute' - }, - method: 'POST' -}); - -/** - * Perform a [cluster.state](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/cluster-state.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics - */ -api.cluster.prototype.state = ca({ - params: { - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/_cluster/state/<%=metric%>/<%=index%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'blocks', - 'metadata', - 'nodes', - 'routing_table', - 'routing_nodes', - 'master_node', - 'version' - ] - }, - index: { - type: 'list' - } - } - }, - { - fmt: '/_cluster/state/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'blocks', - 'metadata', - 'nodes', - 'routing_table', - 'routing_nodes', - 'master_node', - 'version' - ] - } - } - }, - { - fmt: '/_cluster/state' - } - ] -}); - -/** - * Perform a [cluster.stats](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/cluster-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - */ -api.cluster.prototype.stats = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_cluster/stats/nodes/<%=nodeId%>', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_cluster/stats' - } - ] -}); - -/** - * Perform a [count](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/search-count.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.minScore - Include only documents with a specific `_score` value in the result - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.terminateAfter - The maximum count for each shard, upon reaching which the query execution will terminate early - * @param {<>, <>, <>} params.index - A comma-separated list of indices to restrict the results - * @param {<>, <>, <>} params.type - A comma-separated list of types to restrict the results - */ -api.count = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - minScore: { - type: 'number', - name: 'min_score' - }, - preference: { - type: 'string' - }, - routing: { - type: 'list' - }, - q: { - type: 'string' - }, - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - lenient: { - type: 'boolean' - }, - terminateAfter: { - type: 'number', - name: 'terminate_after' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_count', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_count', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_count' - } - ], - method: 'POST' -}); - -/** - * Perform a [countPercolate](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/search-percolate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.percolateIndex - The index to count percolate the document into. Defaults to index. - * @param {<>} params.percolateType - The type to count percolate document into. Defaults to type. - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index of the document being count percolated. - * @param {<>} params.type - The type of the document being count percolated. - * @param {<>} params.id - Substitute the document in the request body with a document that is known by the specified id. On top of the id, the index and type parameter will be used to retrieve the document from within the cluster. - */ -api.countPercolate = ca({ - params: { - routing: { - type: 'list' - }, - preference: { - type: 'string' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - percolateIndex: { - type: 'string', - name: 'percolate_index' - }, - percolateType: { - type: 'string', - name: 'percolate_type' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_percolate/count', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/<%=type%>/_percolate/count', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - } - ], - method: 'POST' -}); - -/** - * Perform a [create](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/docs-index_.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.parent - ID of the parent document - * @param {<>} params.refresh - If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.create = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - timestamp: { - type: 'time' - }, - ttl: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - }, - pipeline: { - type: 'string' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_create', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [delete](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/docs-delete.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the delete operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.parent - ID of parent document - * @param {<>} params.refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api['delete'] = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [deleteByQuery](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/docs-delete-by-query.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.conflicts=abort] - What to do when the delete-by-query hits version conflicts? - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.searchTimeout - Explicit timeout for each search request. Defaults to no timeout. - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the delete by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.scrollSize - Size on the scroll request powering the update_by_query - * @param {<>} [params.waitForCompletion=true] - Should the request should block until the delete-by-query is complete. - * @param {<>} params.requestsPerSecond - The throttle for this request in sub-requests per second. -1 means no throttle. - * @param {<>} [params.slices=1] - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.deleteByQuery = ca({ - params: { - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - from: { - type: 'number' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - conflicts: { - type: 'enum', - 'default': 'abort', - options: [ - 'abort', - 'proceed' - ] - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - lenient: { - type: 'boolean' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'dfs_query_then_fetch' - ], - name: 'search_type' - }, - searchTimeout: { - type: 'time', - name: 'search_timeout' - }, - size: { - type: 'number' - }, - sort: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - terminateAfter: { - type: 'number', - name: 'terminate_after' - }, - stats: { - type: 'list' - }, - version: { - type: 'boolean' - }, - requestCache: { - type: 'boolean', - name: 'request_cache' - }, - refresh: { - type: 'boolean' - }, - timeout: { - type: 'time', - 'default': '1m' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - scrollSize: { - type: 'number', - name: 'scroll_size' - }, - waitForCompletion: { - type: 'boolean', - 'default': true, - name: 'wait_for_completion' - }, - requestsPerSecond: { - type: 'number', - 'default': 0, - name: 'requests_per_second' - }, - slices: { - type: 'number', - 'default': 1 - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_delete_by_query', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_delete_by_query', - req: { - index: { - type: 'list' - } - } - } - ], - needBody: true, - method: 'POST' -}); - -/** - * Perform a [deleteScript](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.id - Script ID - * @param {<>} params.lang - Script language - */ -api.deleteScript = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - urls: [ - { - fmt: '/_scripts/<%=lang%>/<%=id%>', - req: { - lang: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/_scripts/<%=lang%>', - req: { - lang: { - type: 'string' - } - } - } - ], - method: 'DELETE' -}); - -/** - * Perform a [deleteTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Template ID - */ -api.deleteTemplate = ca({ - url: { - fmt: '/_search/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [exists](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document (use `_all` to fetch the first document matching the ID across all types) - */ -api.exists = ca({ - params: { - storedFields: { - type: 'list', - name: 'stored_fields' - }, - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [existsSource](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document; use `_all` to fetch the first document matching the ID across all types - */ -api.existsSource = ca({ - params: { - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_source', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [explain](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/search-explain.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzeWildcard - Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false) - * @param {<>} params.analyzer - The analyzer for the query string query - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The default field for query string query (default: _all) - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.explain = ca({ - params: { - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - analyzer: { - type: 'string' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - storedFields: { - type: 'list', - name: 'stored_fields' - }, - lenient: { - type: 'boolean' - }, - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_explain', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [fieldCaps](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/search-field-caps.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.fields - A comma-separated list of field names - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.fieldCaps = ca({ - params: { - fields: { - type: 'list' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_field_caps', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_field_caps' - } - ], - method: 'POST' -}); - -/** - * Perform a [fieldStats](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/search-field-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for to get field statistics for (min value, max value, and more) - * @param {<>} [params.level=cluster] - Defines if field stats should be returned on a per index level or on a cluster wide level - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.fieldStats = ca({ - params: { - fields: { - type: 'list' - }, - level: { - type: 'enum', - 'default': 'cluster', - options: [ - 'indices', - 'cluster' - ] - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_field_stats', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_field_stats' - } - ], - method: 'POST' -}); - -/** - * Perform a [get](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document (use `_all` to fetch the first document matching the ID across all types) - */ -api.get = ca({ - params: { - storedFields: { - type: 'list', - name: 'stored_fields' - }, - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [getScript](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Script ID - * @param {<>} params.lang - Script language - */ -api.getScript = ca({ - urls: [ - { - fmt: '/_scripts/<%=lang%>/<%=id%>', - req: { - lang: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/_scripts/<%=lang%>', - req: { - lang: { - type: 'string' - } - } - } - ] -}); - -/** - * Perform a [getSource](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document; use `_all` to fetch the first document matching the ID across all types - */ -api.getSource = ca({ - params: { - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_source', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [getTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Template ID - */ -api.getTemplate = ca({ - url: { - fmt: '/_search/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [index](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/docs-index_.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} [params.opType=index] - Explicit operation type - * @param {<>} params.parent - ID of the parent document - * @param {<>} params.refresh - If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.index = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - opType: { - type: 'enum', - 'default': 'index', - options: [ - 'index', - 'create' - ], - name: 'op_type' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - timestamp: { - type: 'time' - }, - ttl: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - }, - pipeline: { - type: 'string' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/<%=type%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - } - ], - needBody: true, - method: 'POST' -}); - -api.indices = namespace(); - -/** - * Perform a [indices.analyze](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/indices-analyze.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The name of the analyzer to use - * @param {<>, <>, <>} params.charFilter - A comma-separated list of character filters to use for the analysis - * @param {<>} params.field - Use the analyzer configured for this field (instead of passing the analyzer name) - * @param {<>, <>, <>} params.filter - A comma-separated list of filters to use for the analysis - * @param {<>} params.index - The name of the index to scope the operation - * @param {<>} params.preferLocal - With `true`, specify that a local shard should be used if available, with `false`, use a random shard (default: true) - * @param {<>, <>, <>} params.text - The text on which the analysis should be performed (when request body is not used) - * @param {<>} params.tokenizer - The name of the tokenizer to use for the analysis - * @param {<>} params.explain - With `true`, outputs more advanced details. (default: false) - * @param {<>, <>, <>} params.attributes - A comma-separated list of token attributes to output, this parameter works only with `explain=true` - * @param {<>} [params.format=detailed] - Format of the output - */ -api.indices.prototype.analyze = ca({ - params: { - analyzer: { - type: 'string' - }, - charFilter: { - type: 'list', - name: 'char_filter' - }, - field: { - type: 'string' - }, - filter: { - type: 'list' - }, - index: { - type: 'string' - }, - preferLocal: { - type: 'boolean', - name: 'prefer_local' - }, - text: { - type: 'list' - }, - tokenizer: { - type: 'string' - }, - explain: { - type: 'boolean' - }, - attributes: { - type: 'list' - }, - format: { - type: 'enum', - 'default': 'detailed', - options: [ - 'detailed', - 'text' - ] - } - }, - urls: [ - { - fmt: '/<%=index%>/_analyze', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_analyze' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.clearCache](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/indices-clearcache.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.fieldData - Clear field data - * @param {<>} params.fielddata - Clear field data - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to clear when using the `field_data` parameter (default: all) - * @param {<>} params.query - Clear query caches - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index name to limit the operation - * @param {<>} params.recycler - Clear the recycler cache - * @param {<>} params.requestCache - Clear request cache - * @param {<>} params.request - Clear request cache - */ -api.indices.prototype.clearCache = ca({ - params: { - fieldData: { - type: 'boolean', - name: 'field_data' - }, - fielddata: { - type: 'boolean' - }, - fields: { - type: 'list' - }, - query: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - index: { - type: 'list' - }, - recycler: { - type: 'boolean' - }, - requestCache: { - type: 'boolean', - name: 'request_cache' - }, - request: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_cache/clear', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cache/clear' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.close](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/indices-open-close.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma separated list of indices to close - */ -api.indices.prototype.close = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - url: { - fmt: '/<%=index%>/_close', - req: { - index: { - type: 'list' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [indices.create](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/indices-create-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for before the operation returns. - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.updateAllTypes - Whether to update the mapping for all fields with the same name across all types or not - * @param {<>} params.index - The name of the index - */ -api.indices.prototype.create = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - updateAllTypes: { - type: 'boolean', - name: 'update_all_types' - } - }, - url: { - fmt: '/<%=index%>', - req: { - index: { - type: 'string' - } - } - }, - method: 'PUT' -}); - -/** - * Perform a [indices.delete](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/indices-delete-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices - */ -api.indices.prototype['delete'] = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [indices.deleteAlias](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit timestamp for the document - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of index names (supports wildcards); use `_all` for all indices - * @param {<>, <>, <>} params.name - A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices. - */ -api.indices.prototype.deleteAlias = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [indices.deleteTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.name - The name of the template - */ -api.indices.prototype.deleteTemplate = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [indices.exists](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/indices-exists.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.ignoreUnavailable - Ignore unavailable indexes (default: false) - * @param {<>} params.allowNoIndices - Ignore if a wildcard expression resolves to no concrete indices (default: false) - * @param {<>} [params.expandWildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (default: open) - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.includeDefaults - Whether to return all default setting for each of the indices. - * @param {<>, <>, <>} params.index - A comma-separated list of index names - */ -api.indices.prototype.exists = ca({ - params: { - local: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - includeDefaults: { - type: 'boolean', - 'default': false, - name: 'include_defaults' - } - }, - url: { - fmt: '/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [indices.existsAlias](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=all] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names to filter aliases - * @param {<>, <>, <>} params.name - A comma-separated list of alias names to return - */ -api.indices.prototype.existsAlias = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'all', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/_alias/<%=name%>', - req: { - name: { - type: 'list' - } - } - } - ], - method: 'HEAD' -}); - -/** - * Perform a [indices.existsTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.name - The comma separated names of the index templates - */ -api.indices.prototype.existsTemplate = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - local: { - type: 'boolean' - } - }, - url: { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [indices.existsType](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/indices-types-exists.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` to check the types across all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to check - */ -api.indices.prototype.existsType = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - url: { - fmt: '/<%=index%>/_mapping/<%=type%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [indices.flush](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/indices-flush.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.force - Whether a flush should be forced even if it is not necessarily needed ie. if no changes will be committed to the index. This is useful if transaction log IDs should be incremented even if no uncommitted changes are present. (This setting can be considered as internal) - * @param {<>} params.waitIfOngoing - If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. The default is true. If set to false the flush will be skipped iff if another flush operation is already running. - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string for all indices - */ -api.indices.prototype.flush = ca({ - params: { - force: { - type: 'boolean' - }, - waitIfOngoing: { - type: 'boolean', - name: 'wait_if_ongoing' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_flush', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_flush' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.flushSynced](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/indices-synced-flush.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string for all indices - */ -api.indices.prototype.flushSynced = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_flush/synced', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_flush/synced' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.forcemerge](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/indices-forcemerge.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flush - Specify whether the index should be flushed after performing the operation (default: true) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.maxNumSegments - The number of segments the index should be merged into (default: dynamic) - * @param {<>} params.onlyExpungeDeletes - Specify whether the operation should only expunge deleted documents - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.waitForMerge - Specify whether the request should block until the merge process is finished (default: true) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.forcemerge = ca({ - params: { - flush: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - maxNumSegments: { - type: 'number', - name: 'max_num_segments' - }, - onlyExpungeDeletes: { - type: 'boolean', - name: 'only_expunge_deletes' - }, - operationThreading: { - name: 'operation_threading' - }, - waitForMerge: { - type: 'boolean', - name: 'wait_for_merge' - } - }, - urls: [ - { - fmt: '/<%=index%>/_forcemerge', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_forcemerge' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.get](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/indices-get-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.ignoreUnavailable - Ignore unavailable indexes (default: false) - * @param {<>} params.allowNoIndices - Ignore if a wildcard expression resolves to no concrete indices (default: false) - * @param {<>} [params.expandWildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (default: open) - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.includeDefaults - Whether to return all default setting for each of the indices. - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} params.feature - A comma-separated list of features - */ -api.indices.prototype.get = ca({ - params: { - local: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - includeDefaults: { - type: 'boolean', - 'default': false, - name: 'include_defaults' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=feature%>', - req: { - index: { - type: 'list' - }, - feature: { - type: 'list', - options: [ - '_settings', - '_mappings', - '_aliases' - ] - } - } - }, - { - fmt: '/<%=index%>', - req: { - index: { - type: 'list' - } - } - } - ] -}); - -/** - * Perform a [indices.getAlias](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=all] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names to filter aliases - * @param {<>, <>, <>} params.name - A comma-separated list of alias names to return - */ -api.indices.prototype.getAlias = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'all', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/_alias/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_alias', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_alias' - } - ] -}); - -/** - * Perform a [indices.getFieldMapping](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/indices-get-field-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.includeDefaults - Whether the default mapping values should be returned as well - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} params.type - A comma-separated list of document types - * @param {<>, <>, <>} params.fields - A comma-separated list of fields - */ -api.indices.prototype.getFieldMapping = ca({ - params: { - includeDefaults: { - type: 'boolean', - name: 'include_defaults' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_mapping/<%=type%>/field/<%=fields%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - }, - fields: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_mapping/field/<%=fields%>', - req: { - index: { - type: 'list' - }, - fields: { - type: 'list' - } - } - }, - { - fmt: '/_mapping/<%=type%>/field/<%=fields%>', - req: { - type: { - type: 'list' - }, - fields: { - type: 'list' - } - } - }, - { - fmt: '/_mapping/field/<%=fields%>', - req: { - fields: { - type: 'list' - } - } - } - ] -}); - -/** - * Perform a [indices.getMapping](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/indices-get-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} params.type - A comma-separated list of document types - */ -api.indices.prototype.getMapping = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_mapping/<%=type%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_mapping', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_mapping/<%=type%>', - req: { - type: { - type: 'list' - } - } - }, - { - fmt: '/_mapping' - } - ] -}); - -/** - * Perform a [indices.getSettings](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/indices-get-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open,closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.includeDefaults - Whether to return all default setting for each of the indices. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.name - The name of the settings that should be included - */ -api.indices.prototype.getSettings = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': [ - 'open', - 'closed' - ], - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - local: { - type: 'boolean' - }, - includeDefaults: { - type: 'boolean', - 'default': false, - name: 'include_defaults' - } - }, - urls: [ - { - fmt: '/<%=index%>/_settings/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_settings', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_settings/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/_settings' - } - ] -}); - -/** - * Perform a [indices.getTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.name - The comma separated names of the index templates - */ -api.indices.prototype.getTemplate = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/_template' - } - ] -}); - -/** - * Perform a [indices.getUpgrade](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/indices-upgrade.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.getUpgrade = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_upgrade', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_upgrade' - } - ] -}); - -/** - * Perform a [indices.open](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/indices-open-close.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma separated list of indices to open - */ -api.indices.prototype.open = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'closed', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - url: { - fmt: '/<%=index%>/_open', - req: { - index: { - type: 'list' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [indices.putAlias](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit timestamp for the document - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices. - * @param {<>} params.name - The name of the alias to be created or updated - */ -api.indices.prototype.putAlias = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'string' - } - } - }, - method: 'PUT' -}); - -/** - * Perform a [indices.putMapping](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/indices-put-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.updateAllTypes - Whether to update the mapping for all fields with the same name across all types or not - * @param {<>, <>, <>} params.index - A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices. - * @param {<>} params.type - The name of the document type - */ -api.indices.prototype.putMapping = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - updateAllTypes: { - type: 'boolean', - name: 'update_all_types' - } - }, - urls: [ - { - fmt: '/<%=index%>/_mapping/<%=type%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/_mapping/<%=type%>', - req: { - type: { - type: 'string' - } - } - } - ], - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [indices.putSettings](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/indices-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.preserveExisting - Whether to update existing settings. If set to `true` existing settings on an index remain unchanged, the default is `false` - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.putSettings = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - preserveExisting: { - type: 'boolean', - name: 'preserve_existing' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - } - }, - urls: [ - { - fmt: '/<%=index%>/_settings', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_settings' - } - ], - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [indices.putTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.order - The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers) - * @param {<>} params.create - Whether the index template should only be added if new or can also replace an existing one - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.name - The name of the template - */ -api.indices.prototype.putTemplate = ca({ - params: { - order: { - type: 'number' - }, - create: { - type: 'boolean', - 'default': false - }, - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - } - }, - url: { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [indices.recovery](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/indices-recovery.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.detailed - Whether to display detailed information about shard recovery - * @param {<>} params.activeOnly - Display only those recoveries that are currently on-going - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.recovery = ca({ - params: { - detailed: { - type: 'boolean', - 'default': false - }, - activeOnly: { - type: 'boolean', - 'default': false, - name: 'active_only' - } - }, - urls: [ - { - fmt: '/<%=index%>/_recovery', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_recovery' - } - ] -}); - -/** - * Perform a [indices.refresh](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/indices-refresh.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.refresh = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_refresh', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_refresh' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.rollover](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/indices-rollover-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.dryRun - If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for on the newly created rollover index before the operation returns. - * @param {<>} params.alias - The name of the alias to rollover - * @param {<>} params.newIndex - The name of the rollover index - */ -api.indices.prototype.rollover = ca({ - params: { - timeout: { - type: 'time' - }, - dryRun: { - type: 'boolean', - name: 'dry_run' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - } - }, - urls: [ - { - fmt: '/<%=alias%>/_rollover/<%=newIndex%>', - req: { - alias: { - type: 'string' - }, - newIndex: { - type: 'string' - } - } - }, - { - fmt: '/<%=alias%>/_rollover', - req: { - alias: { - type: 'string' - } - } - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.segments](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/indices-segments.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.verbose - Includes detailed memory usage by Lucene. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.segments = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - operationThreading: { - name: 'operation_threading' - }, - verbose: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/<%=index%>/_segments', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_segments' - } - ] -}); - -/** - * Perform a [indices.shardStores](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/indices-shards-stores.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.status - A comma-separated list of statuses used to filter on shards to get store information for - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {anything} params.operationThreading - TODO: ? - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.shardStores = ca({ - params: { - status: { - type: 'list', - options: [ - 'green', - 'yellow', - 'red', - 'all' - ] - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - operationThreading: { - name: 'operation_threading' - } - }, - urls: [ - { - fmt: '/<%=index%>/_shard_stores', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_shard_stores' - } - ] -}); - -/** - * Perform a [indices.shrink](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/indices-shrink-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for on the shrunken index before the operation returns. - * @param {<>} params.index - The name of the source index to shrink - * @param {<>} params.target - The name of the target index to shrink into - */ -api.indices.prototype.shrink = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - } - }, - url: { - fmt: '/<%=index%>/_shrink/<%=target%>', - req: { - index: { - type: 'string' - }, - target: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [indices.stats](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/indices-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.completionFields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields for `fielddata` index metric (supports wildcards) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) - * @param {<>, <>, <>} params.groups - A comma-separated list of search groups for `search` index metric - * @param {<>} [params.level=indices] - Return stats aggregated at cluster, index or shard level - * @param {<>, <>, <>} params.types - A comma-separated list of document types for the `indexing` index metric - * @param {<>} params.includeSegmentFileSizes - Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.metric - Limit the information returned the specific metrics. - */ -api.indices.prototype.stats = ca({ - params: { - completionFields: { - type: 'list', - name: 'completion_fields' - }, - fielddataFields: { - type: 'list', - name: 'fielddata_fields' - }, - fields: { - type: 'list' - }, - groups: { - type: 'list' - }, - level: { - type: 'enum', - 'default': 'indices', - options: [ - 'cluster', - 'indices', - 'shards' - ] - }, - types: { - type: 'list' - }, - includeSegmentFileSizes: { - type: 'boolean', - 'default': false, - name: 'include_segment_file_sizes' - } - }, - urls: [ - { - fmt: '/<%=index%>/_stats/<%=metric%>', - req: { - index: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'percolate', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/_stats/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'percolate', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/<%=index%>/_stats', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_stats' - } - ] -}); - -/** - * Perform a [indices.updateAliases](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Request timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - */ -api.indices.prototype.updateAliases = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_aliases' - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [indices.upgrade](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/indices-upgrade.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.waitForCompletion - Specify whether the request should block until the all segments are upgraded (default: false) - * @param {<>} params.onlyAncientSegments - If true, only ancient (an older Lucene major release) segments will be upgraded - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.upgrade = ca({ - params: { - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - waitForCompletion: { - type: 'boolean', - name: 'wait_for_completion' - }, - onlyAncientSegments: { - type: 'boolean', - name: 'only_ancient_segments' - } - }, - urls: [ - { - fmt: '/<%=index%>/_upgrade', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_upgrade' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.validateQuery](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/search-validate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.explain - Return detailed information about the error - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.rewrite - Provide a more detailed explanation showing the actual Lucene query that will be executed. - * @param {<>} params.allShards - Execute validation on all shards instead of one random shard per index - * @param {<>, <>, <>} params.index - A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to restrict the operation; leave empty to perform the operation on all types - */ -api.indices.prototype.validateQuery = ca({ - params: { - explain: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - operationThreading: { - name: 'operation_threading' - }, - q: { - type: 'string' - }, - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - lenient: { - type: 'boolean' - }, - rewrite: { - type: 'boolean' - }, - allShards: { - type: 'boolean', - name: 'all_shards' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_validate/query', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_validate/query', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_validate/query' - } - ], - method: 'POST' -}); - -/** - * Perform a [info](https://www.elastic.co/guide/) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.info = ca({ - url: { - fmt: '/' - } -}); - -api.ingest = namespace(); - -/** - * Perform a [ingest.deletePipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/5.6/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.id - Pipeline ID - */ -api.ingest.prototype.deletePipeline = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_ingest/pipeline/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [ingest.getPipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/5.6/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.id - Comma separated list of pipeline ids. Wildcards supported - */ -api.ingest.prototype.getPipeline = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - urls: [ - { - fmt: '/_ingest/pipeline/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - { - fmt: '/_ingest/pipeline' - } - ] -}); - -/** - * Perform a [ingest.processorGrok](https://www.elastic.co/guide/en/elasticsearch/plugins/5.6/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.ingest.prototype.processorGrok = ca({ - url: { - fmt: '/_ingest/processor/grok' - } -}); - -/** - * Perform a [ingest.putPipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/5.6/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.id - Pipeline ID - */ -api.ingest.prototype.putPipeline = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_ingest/pipeline/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [ingest.simulate](https://www.elastic.co/guide/en/elasticsearch/plugins/5.6/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.verbose - Verbose mode. Display data output for each processor in executed pipeline - * @param {<>} params.id - Pipeline ID - */ -api.ingest.prototype.simulate = ca({ - params: { - verbose: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_ingest/pipeline/<%=id%>/_simulate', - req: { - id: { - type: 'string' - } - } - }, - { - fmt: '/_ingest/pipeline/_simulate' - } - ], - needBody: true, - method: 'POST' -}); - -/** - * Perform a [mget](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/docs-multi-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.mget = ca({ - params: { - storedFields: { - type: 'list', - name: 'stored_fields' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_mget', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_mget', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_mget' - } - ], - needBody: true, - method: 'POST' -}); - -/** - * Perform a [mpercolate](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/search-percolate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.index - The index of the document being count percolated to use as default - * @param {<>} params.type - The type of the document being percolated to use as default. - */ -api.mpercolate = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_mpercolate', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_mpercolate', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_mpercolate' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -/** - * Perform a [msearch](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/search-multi-search.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.searchType - Search operation type - * @param {<>} params.maxConcurrentSearches - Controls the maximum number of concurrent searches the multi search api will execute - * @param {<>} params.typedKeys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response - * @param {<>} [params.preFilterShardSize=128] - A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on it's rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to use as default - * @param {<>, <>, <>} params.type - A comma-separated list of document types to use as default - */ -api.msearch = ca({ - params: { - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'query_and_fetch', - 'dfs_query_then_fetch', - 'dfs_query_and_fetch' - ], - name: 'search_type' - }, - maxConcurrentSearches: { - type: 'number', - name: 'max_concurrent_searches' - }, - typedKeys: { - type: 'boolean', - name: 'typed_keys' - }, - preFilterShardSize: { - type: 'number', - 'default': 128, - name: 'pre_filter_shard_size' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_msearch', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_msearch', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_msearch' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -/** - * Perform a [msearchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.searchType - Search operation type - * @param {<>} params.typedKeys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response - * @param {<>} params.maxConcurrentSearches - Controls the maximum number of concurrent searches the multi search api will execute - * @param {<>, <>, <>} params.index - A comma-separated list of index names to use as default - * @param {<>, <>, <>} params.type - A comma-separated list of document types to use as default - */ -api.msearchTemplate = ca({ - params: { - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'query_and_fetch', - 'dfs_query_then_fetch', - 'dfs_query_and_fetch' - ], - name: 'search_type' - }, - typedKeys: { - type: 'boolean', - name: 'typed_keys' - }, - maxConcurrentSearches: { - type: 'number', - name: 'max_concurrent_searches' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_msearch/template', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_msearch/template', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_msearch/template' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -/** - * Perform a [mtermvectors](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/docs-multi-termvectors.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.ids - A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body - * @param {<>} params.termStatistics - Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.fieldStatistics=true] - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.offsets=true] - Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.positions=true] - Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.payloads=true] - Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) .Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.routing - Specific routing value. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.parent - Parent id of documents. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.realtime - Specifies if requests are real-time as opposed to near-real-time (default: true). - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index in which the document resides. - * @param {<>} params.type - The type of the document. - */ -api.mtermvectors = ca({ - params: { - ids: { - type: 'list', - required: false - }, - termStatistics: { - type: 'boolean', - 'default': false, - required: false, - name: 'term_statistics' - }, - fieldStatistics: { - type: 'boolean', - 'default': true, - required: false, - name: 'field_statistics' - }, - fields: { - type: 'list', - required: false - }, - offsets: { - type: 'boolean', - 'default': true, - required: false - }, - positions: { - type: 'boolean', - 'default': true, - required: false - }, - payloads: { - type: 'boolean', - 'default': true, - required: false - }, - preference: { - type: 'string', - required: false - }, - routing: { - type: 'string', - required: false - }, - parent: { - type: 'string', - required: false - }, - realtime: { - type: 'boolean', - required: false - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_mtermvectors', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_mtermvectors', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_mtermvectors' - } - ], - method: 'POST' -}); - -api.nodes = namespace(); - -/** - * Perform a [nodes.hotThreads](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/cluster-nodes-hot-threads.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.interval - The interval for the second sampling of threads - * @param {<>} params.snapshots - Number of samples of thread stacktrace (default: 10) - * @param {<>} params.threads - Specify the number of threads to provide information for (default: 3) - * @param {<>} params.ignoreIdleThreads - Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue (default: true) - * @param {<>} params.type - The type to sample (default: cpu) - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - */ -api.nodes.prototype.hotThreads = ca({ - params: { - interval: { - type: 'time' - }, - snapshots: { - type: 'number' - }, - threads: { - type: 'number' - }, - ignoreIdleThreads: { - type: 'boolean', - name: 'ignore_idle_threads' - }, - type: { - type: 'enum', - options: [ - 'cpu', - 'wait', - 'block' - ] - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_nodes/<%=nodeId%>/hotthreads', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_nodes/hotthreads' - } - ] -}); - -/** - * Perform a [nodes.info](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/cluster-nodes-info.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.metric - A comma-separated list of metrics you wish returned. Leave empty to return all. - */ -api.nodes.prototype.info = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_nodes/<%=nodeId%>/<%=metric%>', - req: { - nodeId: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - 'settings', - 'os', - 'process', - 'jvm', - 'thread_pool', - 'transport', - 'http', - 'plugins', - 'ingest' - ] - } - } - }, - { - fmt: '/_nodes/<%=nodeId%>', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_nodes/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - 'settings', - 'os', - 'process', - 'jvm', - 'thread_pool', - 'transport', - 'http', - 'plugins', - 'ingest' - ] - } - } - }, - { - fmt: '/_nodes' - } - ] -}); - -/** - * Perform a [nodes.stats](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/cluster-nodes-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.completionFields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields for `fielddata` index metric (supports wildcards) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) - * @param {<>} params.groups - A comma-separated list of search groups for `search` index metric - * @param {<>} [params.level=node] - Return indices stats aggregated at index, node or shard level - * @param {<>, <>, <>} params.types - A comma-separated list of document types for the `indexing` index metric - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.includeSegmentFileSizes - Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics - * @param {<>, <>, <>} params.indexMetric - Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified. - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - */ -api.nodes.prototype.stats = ca({ - params: { - completionFields: { - type: 'list', - name: 'completion_fields' - }, - fielddataFields: { - type: 'list', - name: 'fielddata_fields' - }, - fields: { - type: 'list' - }, - groups: { - type: 'boolean' - }, - level: { - type: 'enum', - 'default': 'node', - options: [ - 'indices', - 'node', - 'shards' - ] - }, - types: { - type: 'list' - }, - timeout: { - type: 'time' - }, - includeSegmentFileSizes: { - type: 'boolean', - 'default': false, - name: 'include_segment_file_sizes' - } - }, - urls: [ - { - fmt: '/_nodes/<%=nodeId%>/stats/<%=metric%>/<%=indexMetric%>', - req: { - nodeId: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport', - 'discovery' - ] - }, - indexMetric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'percolate', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/_nodes/<%=nodeId%>/stats/<%=metric%>', - req: { - nodeId: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport', - 'discovery' - ] - } - } - }, - { - fmt: '/_nodes/stats/<%=metric%>/<%=indexMetric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport', - 'discovery' - ] - }, - indexMetric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'percolate', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/_nodes/<%=nodeId%>/stats', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_nodes/stats/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport', - 'discovery' - ] - } - } - }, - { - fmt: '/_nodes/stats' - } - ] -}); - -/** - * Perform a [percolate](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/search-percolate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.percolateIndex - The index to percolate the document into. Defaults to index. - * @param {<>} params.percolateType - The type to percolate document into. Defaults to type. - * @param {<>} params.percolateRouting - The routing value to use when percolating the existing document. - * @param {<>} params.percolatePreference - Which shard to prefer when executing the percolate request. - * @param {<>} params.percolateFormat - Return an array of matching query IDs instead of objects - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index of the document being percolated. - * @param {<>} params.type - The type of the document being percolated. - * @param {<>} params.id - Substitute the document in the request body with a document that is known by the specified id. On top of the id, the index and type parameter will be used to retrieve the document from within the cluster. - */ -api.percolate = ca({ - params: { - routing: { - type: 'list' - }, - preference: { - type: 'string' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - percolateIndex: { - type: 'string', - name: 'percolate_index' - }, - percolateType: { - type: 'string', - name: 'percolate_type' - }, - percolateRouting: { - type: 'string', - name: 'percolate_routing' - }, - percolatePreference: { - type: 'string', - name: 'percolate_preference' - }, - percolateFormat: { - type: 'enum', - options: [ - 'ids' - ], - name: 'percolate_format' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_percolate', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/<%=type%>/_percolate', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - } - ], - method: 'POST' -}); - -/** - * Perform a [ping](https://www.elastic.co/guide/) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.ping = ca({ - url: { - fmt: '/' - }, - requestTimeout: 3000, - method: 'HEAD' -}); - -/** - * Perform a [putScript](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.id - Script ID - * @param {<>} params.lang - Script language - */ -api.putScript = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - urls: [ - { - fmt: '/_scripts/<%=lang%>/<%=id%>', - req: { - lang: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/_scripts/<%=lang%>', - req: { - lang: { - type: 'string' - } - } - } - ], - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [putTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Template ID - */ -api.putTemplate = ca({ - url: { - fmt: '/_search/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [reindex](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/docs-reindex.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the reindex operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} [params.waitForCompletion=true] - Should the request should block until the reindex is complete. - * @param {<>} params.requestsPerSecond - The throttle to set on this request in sub-requests per second. -1 means no throttle. - * @param {<>} [params.slices=1] - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. - */ -api.reindex = ca({ - params: { - refresh: { - type: 'boolean' - }, - timeout: { - type: 'time', - 'default': '1m' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - waitForCompletion: { - type: 'boolean', - 'default': true, - name: 'wait_for_completion' - }, - requestsPerSecond: { - type: 'number', - 'default': 0, - name: 'requests_per_second' - }, - slices: { - type: 'number', - 'default': 1 - } - }, - url: { - fmt: '/_reindex' - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [reindexRethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/docs-reindex.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.requestsPerSecond - The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. - * @param {<>} params.taskId - The task id to rethrottle - */ -api.reindexRethrottle = ca({ - params: { - requestsPerSecond: { - type: 'number', - required: true, - name: 'requests_per_second' - } - }, - url: { - fmt: '/_reindex/<%=taskId%>/_rethrottle', - req: { - taskId: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [renderSearchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - The id of the stored search template - */ -api.renderSearchTemplate = ca({ - urls: [ - { - fmt: '/_render/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - { - fmt: '/_render/template' - } - ], - method: 'POST' -}); - -/** - * Perform a [scroll](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/search-request-scroll.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.scrollId - The scroll ID - */ -api.scroll = ca({ - params: { - scroll: { - type: 'time' - }, - scrollId: { - type: 'string', - name: 'scroll_id' - } - }, - urls: [ - { - fmt: '/_search/scroll/<%=scrollId%>', - req: { - scrollId: { - type: 'string' - } - } - }, - { - fmt: '/_search/scroll' - } - ], - paramAsBody: { - param: 'scrollId', - body: 'scroll_id' - }, - method: 'POST' -}); - -/** - * Perform a [search](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/search-search.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.explain - Specify whether to return detailed information about score computation as part of a hit - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return as part of a hit - * @param {<>, <>, <>} params.docvalueFields - A comma-separated list of fields to return as the docvalue representation of a field for each hit - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields to return as the docvalue representation of a field for each hit - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.suggestField - Specify which field to use for suggestions - * @param {<>} [params.suggestMode=missing] - Specify suggest mode - * @param {<>} params.suggestSize - How many suggestions to return in response - * @param {<>} params.suggestText - The source text for which the suggestions should be returned - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.trackScores - Whether to calculate and return scores even if they are not used for sorting - * @param {<>} params.typedKeys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>} [params.batchedReduceSize=512] - The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large. - * @param {<>} [params.maxConcurrentShardRequests=The default grows with the number of nodes in the cluster but is at most 256.] - The number of concurrent shard requests this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests - * @param {<>} [params.preFilterShardSize=128] - A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on it's rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.search = ca({ - params: { - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - explain: { - type: 'boolean' - }, - storedFields: { - type: 'list', - name: 'stored_fields' - }, - docvalueFields: { - type: 'list', - name: 'docvalue_fields' - }, - fielddataFields: { - type: 'list', - name: 'fielddata_fields' - }, - from: { - type: 'number' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - lenient: { - type: 'boolean' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'dfs_query_then_fetch' - ], - name: 'search_type' - }, - size: { - type: 'number' - }, - sort: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - terminateAfter: { - type: 'number', - name: 'terminate_after' - }, - stats: { - type: 'list' - }, - suggestField: { - type: 'string', - name: 'suggest_field' - }, - suggestMode: { - type: 'enum', - 'default': 'missing', - options: [ - 'missing', - 'popular', - 'always' - ], - name: 'suggest_mode' - }, - suggestSize: { - type: 'number', - name: 'suggest_size' - }, - suggestText: { - type: 'string', - name: 'suggest_text' - }, - timeout: { - type: 'time' - }, - trackScores: { - type: 'boolean', - name: 'track_scores' - }, - typedKeys: { - type: 'boolean', - name: 'typed_keys' - }, - version: { - type: 'boolean' - }, - requestCache: { - type: 'boolean', - name: 'request_cache' - }, - batchedReduceSize: { - type: 'number', - 'default': 512, - name: 'batched_reduce_size' - }, - maxConcurrentShardRequests: { - type: 'number', - 'default': 'The default grows with the number of nodes in the cluster but is at most 256.', - name: 'max_concurrent_shard_requests' - }, - preFilterShardSize: { - type: 'number', - 'default': 128, - name: 'pre_filter_shard_size' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_search', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_search', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_search' - } - ], - method: 'POST' -}); - -/** - * Perform a [searchShards](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/search-shards.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.searchShards = ca({ - params: { - preference: { - type: 'string' - }, - routing: { - type: 'string' - }, - local: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_search_shards', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_search_shards', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_search_shards' - } - ], - method: 'POST' -}); - -/** - * Perform a [searchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.explain - Specify whether to return detailed information about score computation as part of a hit - * @param {<>} params.profile - Specify whether to profile the query execution - * @param {<>} params.typedKeys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.searchTemplate = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - preference: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'query_and_fetch', - 'dfs_query_then_fetch', - 'dfs_query_and_fetch' - ], - name: 'search_type' - }, - explain: { - type: 'boolean' - }, - profile: { - type: 'boolean' - }, - typedKeys: { - type: 'boolean', - name: 'typed_keys' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_search/template', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_search/template', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_search/template' - } - ], - method: 'POST' -}); - -api.snapshot = namespace(); - -/** - * Perform a [snapshot.create](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.waitForCompletion - Should this request wait until the operation has completed before returning - * @param {<>} params.repository - A repository name - * @param {<>} params.snapshot - A snapshot name - */ -api.snapshot.prototype.create = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForCompletion: { - type: 'boolean', - 'default': false, - name: 'wait_for_completion' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [snapshot.createRepository](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.verify - Whether to verify the repository after creation - * @param {<>} params.repository - A repository name - */ -api.snapshot.prototype.createRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - }, - verify: { - type: 'boolean' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>', - req: { - repository: { - type: 'string' - } - } - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [snapshot.delete](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.repository - A repository name - * @param {<>} params.snapshot - A snapshot name - */ -api.snapshot.prototype['delete'] = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [snapshot.deleteRepository](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.repository - A comma-separated list of repository names - */ -api.snapshot.prototype.deleteRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>', - req: { - repository: { - type: 'list' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [snapshot.get](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.ignoreUnavailable - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown - * @param {<>} params.verbose - Whether to show verbose snapshot info or only show the basic info found in the repository index blob - * @param {<>} params.repository - A repository name - * @param {<>, <>, <>} params.snapshot - A comma-separated list of snapshot names - */ -api.snapshot.prototype.get = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - verbose: { - type: 'boolean' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'list' - } - } - } -}); - -/** - * Perform a [snapshot.getRepository](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.repository - A comma-separated list of repository names - */ -api.snapshot.prototype.getRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/_snapshot/<%=repository%>', - req: { - repository: { - type: 'list' - } - } - }, - { - fmt: '/_snapshot' - } - ] -}); - -/** - * Perform a [snapshot.restore](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.waitForCompletion - Should this request wait until the operation has completed before returning - * @param {<>} params.repository - A repository name - * @param {<>} params.snapshot - A snapshot name - */ -api.snapshot.prototype.restore = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForCompletion: { - type: 'boolean', - 'default': false, - name: 'wait_for_completion' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>/_restore', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [snapshot.status](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.ignoreUnavailable - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown - * @param {<>} params.repository - A repository name - * @param {<>, <>, <>} params.snapshot - A comma-separated list of snapshot names - */ -api.snapshot.prototype.status = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - } - }, - urls: [ - { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>/_status', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'list' - } - } - }, - { - fmt: '/_snapshot/<%=repository%>/_status', - req: { - repository: { - type: 'string' - } - } - }, - { - fmt: '/_snapshot/_status' - } - ] -}); - -/** - * Perform a [snapshot.verifyRepository](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.repository - A repository name - */ -api.snapshot.prototype.verifyRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/_verify', - req: { - repository: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [suggest](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/search-suggesters.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params.index - A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices - */ -api.suggest = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - preference: { - type: 'string' - }, - routing: { - type: 'string' - } - }, - urls: [ - { - fmt: '/<%=index%>/_suggest', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_suggest' - } - ], - needBody: true, - method: 'POST' -}); - -api.tasks = namespace(); - -/** - * Perform a [tasks.cancel](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.nodes - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.actions - A comma-separated list of actions that should be cancelled. Leave empty to cancel all. - * @param {<>} params.parentNode - Cancel tasks with specified parent node. - * @param {<>} params.parentTaskId - Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all. - * @param {<>} params.taskId - Cancel the task with specified task id (node_id:task_number) - */ -api.tasks.prototype.cancel = ca({ - params: { - nodes: { - type: 'list' - }, - actions: { - type: 'list' - }, - parentNode: { - type: 'string', - name: 'parent_node' - }, - parentTaskId: { - type: 'string', - name: 'parent_task_id' - } - }, - urls: [ - { - fmt: '/_tasks/<%=taskId%>/_cancel', - req: { - taskId: { - type: 'string' - } - } - }, - { - fmt: '/_tasks/_cancel' - } - ], - method: 'POST' -}); - -/** - * Perform a [tasks.get](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForCompletion - Wait for the matching tasks to complete (default: false) - * @param {<>} params.taskId - Return the task with specified id (node_id:task_number) - */ -api.tasks.prototype.get = ca({ - params: { - waitForCompletion: { - type: 'boolean', - name: 'wait_for_completion' - } - }, - url: { - fmt: '/_tasks/<%=taskId%>', - req: { - taskId: { - type: 'string' - } - } - } -}); - -/** - * Perform a [tasks.list](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.nodes - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.actions - A comma-separated list of actions that should be returned. Leave empty to return all. - * @param {<>} params.detailed - Return detailed task information (default: false) - * @param {<>} params.parentNode - Return tasks with specified parent node. - * @param {<>} params.parentTaskId - Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all. - * @param {<>} params.waitForCompletion - Wait for the matching tasks to complete (default: false) - * @param {<>} [params.groupBy=nodes] - Group tasks by nodes or parent/child relationships - */ -api.tasks.prototype.list = ca({ - params: { - nodes: { - type: 'list' - }, - actions: { - type: 'list' - }, - detailed: { - type: 'boolean' - }, - parentNode: { - type: 'string', - name: 'parent_node' - }, - parentTaskId: { - type: 'string', - name: 'parent_task_id' - }, - waitForCompletion: { - type: 'boolean', - name: 'wait_for_completion' - }, - groupBy: { - type: 'enum', - 'default': 'nodes', - options: [ - 'nodes', - 'parents' - ], - name: 'group_by' - } - }, - url: { - fmt: '/_tasks' - } -}); - -/** - * Perform a [termvectors](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/docs-termvectors.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.termStatistics - Specifies if total term frequency and document frequency should be returned. - * @param {<>} [params.fieldStatistics=true] - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return. - * @param {<>} [params.offsets=true] - Specifies if term offsets should be returned. - * @param {<>} [params.positions=true] - Specifies if term positions should be returned. - * @param {<>} [params.payloads=true] - Specifies if term payloads should be returned. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random). - * @param {<>} params.routing - Specific routing value. - * @param {<>} params.parent - Parent id of documents. - * @param {<>} params.realtime - Specifies if request is real-time as opposed to near-real-time (default: true). - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index in which the document resides. - * @param {<>} params.type - The type of the document. - * @param {<>} params.id - The id of the document, when not specified a doc param should be supplied. - */ -api.termvectors = ca({ - params: { - termStatistics: { - type: 'boolean', - 'default': false, - required: false, - name: 'term_statistics' - }, - fieldStatistics: { - type: 'boolean', - 'default': true, - required: false, - name: 'field_statistics' - }, - fields: { - type: 'list', - required: false - }, - offsets: { - type: 'boolean', - 'default': true, - required: false - }, - positions: { - type: 'boolean', - 'default': true, - required: false - }, - payloads: { - type: 'boolean', - 'default': true, - required: false - }, - preference: { - type: 'string', - required: false - }, - routing: { - type: 'string', - required: false - }, - parent: { - type: 'string', - required: false - }, - realtime: { - type: 'boolean', - required: false - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_termvectors', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/<%=type%>/_termvectors', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - } - ], - method: 'POST' -}); - -/** - * Perform a [update](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/docs-update.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the update operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return in the response - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.lang - The script language (default: painless) - * @param {<>} params.parent - ID of the parent document. Is is only used for routing and when for the upsert request - * @param {<>} params.refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.retryOnConflict - Specify how many times should the operation be retried when a conflict occurs (default: 0) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.timestamp - Explicit timestamp for the document - * @param {<>} params.ttl - Expiration time for the document - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.update = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - fields: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - lang: { - type: 'string' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - retryOnConflict: { - type: 'number', - name: 'retry_on_conflict' - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - timestamp: { - type: 'time' - }, - ttl: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_update', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [updateByQuery](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/docs-update-by-query.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.conflicts=abort] - What to do when the update by query hits version conflicts? - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.pipeline - Ingest pipeline to set on index requests made by this action. (default: none) - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.searchTimeout - Explicit timeout for each search request. Defaults to no timeout. - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.versionType - Should the document increment the version number (internal) on hit or not (reindex) - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the update by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.scrollSize - Size on the scroll request powering the update_by_query - * @param {<>} [params.waitForCompletion=true] - Should the request should block until the update by query operation is complete. - * @param {<>} params.requestsPerSecond - The throttle to set on this request in sub-requests per second. -1 means no throttle. - * @param {<>} [params.slices=1] - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.updateByQuery = ca({ - params: { - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - from: { - type: 'number' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - conflicts: { - type: 'enum', - 'default': 'abort', - options: [ - 'abort', - 'proceed' - ] - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - lenient: { - type: 'boolean' - }, - pipeline: { - type: 'string' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'dfs_query_then_fetch' - ], - name: 'search_type' - }, - searchTimeout: { - type: 'time', - name: 'search_timeout' - }, - size: { - type: 'number' - }, - sort: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - terminateAfter: { - type: 'number', - name: 'terminate_after' - }, - stats: { - type: 'list' - }, - version: { - type: 'boolean' - }, - versionType: { - type: 'boolean', - name: 'version_type' - }, - requestCache: { - type: 'boolean', - name: 'request_cache' - }, - refresh: { - type: 'boolean' - }, - timeout: { - type: 'time', - 'default': '1m' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - scrollSize: { - type: 'number', - name: 'scroll_size' - }, - waitForCompletion: { - type: 'boolean', - 'default': true, - name: 'wait_for_completion' - }, - requestsPerSecond: { - type: 'number', - 'default': 0, - name: 'requests_per_second' - }, - slices: { - type: 'number', - 'default': 1 - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_update_by_query', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_update_by_query', - req: { - index: { - type: 'list' - } - } - } - ], - method: 'POST' -}); diff --git a/src/lib/apis/6_0.js b/src/lib/apis/6_0.js deleted file mode 100644 index 05b578d89..000000000 --- a/src/lib/apis/6_0.js +++ /dev/null @@ -1,6970 +0,0 @@ -var ca = require('../client_action').makeFactoryWithModifier(function (spec) { - return require('../utils').merge(spec, { - params: { - filterPath: { - type: 'list', - name: 'filter_path' - } - } - }); -}); -var namespace = require('../client_action').namespaceFactory; -var api = module.exports = {}; - -api._namespaces = ['cat', 'cluster', 'indices', 'ingest', 'nodes', 'snapshot', 'tasks']; - -/** - * Perform a [bulk](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-bulk.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the bulk operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.type - Default document type for items which don't provide one - * @param {<>, <>, <>} params.fields - Default comma-separated list of fields to return in the response for updates, can be overridden on each sub-request - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request - * @param {<>, <>, <>} params._sourceExclude - Default list of fields to exclude from the returned _source field, can be overridden on each sub-request - * @param {<>, <>, <>} params._sourceInclude - Default list of fields to extract and return from the _source field, can be overridden on each sub-request - * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with - * @param {<>} params.index - Default index for items which don't provide one - */ -api.bulk = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - type: { - type: 'string' - }, - fields: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - pipeline: { - type: 'string' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_bulk', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_bulk', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_bulk' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -api.cat = namespace(); - -/** - * Perform a [cat.aliases](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cat.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.name - A comma-separated list of alias names to return - */ -api.cat.prototype.aliases = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/aliases/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/_cat/aliases' - } - ] -}); - -/** - * Perform a [cat.allocation](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cat-allocation.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information - */ -api.cat.prototype.allocation = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'kb', - 'm', - 'mb', - 'g', - 'gb', - 't', - 'tb', - 'p', - 'pb' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/allocation/<%=nodeId%>', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_cat/allocation' - } - ] -}); - -/** - * Perform a [cat.count](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cat-count.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.count = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/count/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/count' - } - ] -}); - -/** - * Perform a [cat.fielddata](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cat-fielddata.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return the fielddata size - */ -api.cat.prototype.fielddata = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'kb', - 'm', - 'mb', - 'g', - 'gb', - 't', - 'tb', - 'p', - 'pb' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - }, - fields: { - type: 'list' - } - }, - urls: [ - { - fmt: '/_cat/fielddata/<%=fields%>', - req: { - fields: { - type: 'list' - } - } - }, - { - fmt: '/_cat/fielddata' - } - ] -}); - -/** - * Perform a [cat.health](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cat-health.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} [params.ts=true] - Set to false to disable timestamping - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.health = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - ts: { - type: 'boolean', - 'default': true - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/health' - } -}); - -/** - * Perform a [cat.help](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cat.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - */ -api.cat.prototype.help = ca({ - params: { - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - } - }, - url: { - fmt: '/_cat' - } -}); - -/** - * Perform a [cat.indices](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cat-indices.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.health - A health status ("green", "yellow", or "red" to filter only indices matching the specified health status - * @param {<>} params.help - Return help information - * @param {<>} params.pri - Set to true to return stats only for primary shards - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.indices = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'm', - 'g' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - health: { - type: 'enum', - 'default': null, - options: [ - 'green', - 'yellow', - 'red' - ] - }, - help: { - type: 'boolean', - 'default': false - }, - pri: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/indices/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/indices' - } - ] -}); - -/** - * Perform a [cat.master](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cat-master.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.master = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/master' - } -}); - -/** - * Perform a [cat.nodeattrs](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cat-nodeattrs.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.nodeattrs = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/nodeattrs' - } -}); - -/** - * Perform a [cat.nodes](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cat-nodes.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.fullId - Return the full node ID instead of the shortened version (default: false) - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.nodes = ca({ - params: { - format: { - type: 'string' - }, - fullId: { - type: 'boolean', - name: 'full_id' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/nodes' - } -}); - -/** - * Perform a [cat.pendingTasks](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cat-pending-tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.pendingTasks = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/pending_tasks' - } -}); - -/** - * Perform a [cat.plugins](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cat-plugins.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.plugins = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/plugins' - } -}); - -/** - * Perform a [cat.recovery](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cat-recovery.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.recovery = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'kb', - 'm', - 'mb', - 'g', - 'gb', - 't', - 'tb', - 'p', - 'pb' - ] - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/recovery/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/recovery' - } - ] -}); - -/** - * Perform a [cat.repositories](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cat-repositories.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.repositories = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean', - 'default': false - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/repositories' - } -}); - -/** - * Perform a [cat.segments](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cat-segments.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.segments = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'kb', - 'm', - 'mb', - 'g', - 'gb', - 't', - 'tb', - 'p', - 'pb' - ] - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/segments/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/segments' - } - ] -}); - -/** - * Perform a [cat.shards](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cat-shards.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.shards = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'kb', - 'm', - 'mb', - 'g', - 'gb', - 't', - 'tb', - 'p', - 'pb' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/shards/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/shards' - } - ] -}); - -/** - * Perform a [cat.snapshots](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cat-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.ignoreUnavailable - Set to true to ignore unavailable snapshots - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.repository - Name of repository from which to fetch the snapshot information - */ -api.cat.prototype.snapshots = ca({ - params: { - format: { - type: 'string' - }, - ignoreUnavailable: { - type: 'boolean', - 'default': false, - name: 'ignore_unavailable' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/snapshots/<%=repository%>', - req: { - repository: { - type: 'list' - } - } - }, - { - fmt: '/_cat/snapshots' - } - ] -}); - -/** - * Perform a [cat.tasks](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.actions - A comma-separated list of actions that should be returned. Leave empty to return all. - * @param {<>} params.detailed - Return detailed task information (default: false) - * @param {<>} params.parentNode - Return tasks with specified parent node. - * @param {<>} params.parentTask - Return tasks with specified parent task id. Set to -1 to return all. - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.tasks = ca({ - params: { - format: { - type: 'string' - }, - nodeId: { - type: 'list', - name: 'node_id' - }, - actions: { - type: 'list' - }, - detailed: { - type: 'boolean' - }, - parentNode: { - type: 'string', - name: 'parent_node' - }, - parentTask: { - type: 'number', - name: 'parent_task' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/tasks' - } -}); - -/** - * Perform a [cat.templates](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cat-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>} params.name - A pattern that returned template names must match - */ -api.cat.prototype.templates = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/templates/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - { - fmt: '/_cat/templates' - } - ] -}); - -/** - * Perform a [cat.threadPool](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cat-thread-pool.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.size - The multiplier in which to display values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.threadPoolPatterns - A comma-separated list of regular-expressions to filter the thread pools in the output - */ -api.cat.prototype.threadPool = ca({ - params: { - format: { - type: 'string' - }, - size: { - type: 'enum', - options: [ - '', - 'k', - 'm', - 'g', - 't', - 'p' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/thread_pool/<%=threadPoolPatterns%>', - req: { - threadPoolPatterns: { - type: 'list' - } - } - }, - { - fmt: '/_cat/thread_pool' - } - ] -}); - -/** - * Perform a [clearScroll](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-request-scroll.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.scrollId - A comma-separated list of scroll IDs to clear - */ -api.clearScroll = ca({ - urls: [ - { - fmt: '/_search/scroll/<%=scrollId%>', - req: { - scrollId: { - type: 'list' - } - } - }, - { - fmt: '/_search/scroll' - } - ], - paramAsBody: { - param: 'scrollId', - body: 'scroll_id' - }, - method: 'DELETE' -}); - -api.cluster = namespace(); - -/** - * Perform a [cluster.allocationExplain](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cluster-allocation-explain.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.includeYesDecisions - Return 'YES' decisions in explanation (default: false) - * @param {<>} params.includeDiskInfo - Return information about disk usage and shard sizes (default: false) - */ -api.cluster.prototype.allocationExplain = ca({ - params: { - includeYesDecisions: { - type: 'boolean', - name: 'include_yes_decisions' - }, - includeDiskInfo: { - type: 'boolean', - name: 'include_disk_info' - } - }, - url: { - fmt: '/_cluster/allocation/explain' - }, - method: 'POST' -}); - -/** - * Perform a [cluster.getSettings](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cluster-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.includeDefaults - Whether to return all default clusters setting. - */ -api.cluster.prototype.getSettings = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - }, - includeDefaults: { - type: 'boolean', - 'default': false, - name: 'include_defaults' - } - }, - url: { - fmt: '/_cluster/settings' - } -}); - -/** - * Perform a [cluster.health](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cluster-health.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} [params.level=cluster] - Specify the level of detail for returned information - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.waitForActiveShards - Wait until the specified number of shards is active - * @param {<>} params.waitForNodes - Wait until the specified number of nodes is available - * @param {<>} params.waitForEvents - Wait until all currently queued events with the given priority are processed - * @param {<>} params.waitForNoRelocatingShards - Whether to wait until there are no relocating shards in the cluster - * @param {<>} params.waitForStatus - Wait until cluster is in a specific state - * @param {<>, <>, <>} params.index - Limit the information returned to a specific index - */ -api.cluster.prototype.health = ca({ - params: { - level: { - type: 'enum', - 'default': 'cluster', - options: [ - 'cluster', - 'indices', - 'shards' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - waitForNodes: { - type: 'string', - name: 'wait_for_nodes' - }, - waitForEvents: { - type: 'enum', - options: [ - 'immediate', - 'urgent', - 'high', - 'normal', - 'low', - 'languid' - ], - name: 'wait_for_events' - }, - waitForNoRelocatingShards: { - type: 'boolean', - name: 'wait_for_no_relocating_shards' - }, - waitForStatus: { - type: 'enum', - 'default': null, - options: [ - 'green', - 'yellow', - 'red' - ], - name: 'wait_for_status' - } - }, - urls: [ - { - fmt: '/_cluster/health/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cluster/health' - } - ] -}); - -/** - * Perform a [cluster.pendingTasks](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cluster-pending.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Specify timeout for connection to master - */ -api.cluster.prototype.pendingTasks = ca({ - params: { - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_cluster/pending_tasks' - } -}); - -/** - * Perform a [cluster.putSettings](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cluster-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - */ -api.cluster.prototype.putSettings = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_cluster/settings' - }, - method: 'PUT' -}); - -/** - * Perform a [cluster.remoteInfo](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cluster-remote-info.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.cluster.prototype.remoteInfo = ca({ - url: { - fmt: '/_remote/info' - } -}); - -/** - * Perform a [cluster.reroute](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cluster-reroute.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.dryRun - Simulate the operation only and return the resulting state - * @param {<>} params.explain - Return an explanation of why the commands can or cannot be executed - * @param {<>} params.retryFailed - Retries allocation of shards that are blocked due to too many subsequent allocation failures - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics. Defaults to all but metadata - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - */ -api.cluster.prototype.reroute = ca({ - params: { - dryRun: { - type: 'boolean', - name: 'dry_run' - }, - explain: { - type: 'boolean' - }, - retryFailed: { - type: 'boolean', - name: 'retry_failed' - }, - metric: { - type: 'list', - options: [ - '_all', - 'blocks', - 'metadata', - 'nodes', - 'routing_table', - 'master_node', - 'version' - ] - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_cluster/reroute' - }, - method: 'POST' -}); - -/** - * Perform a [cluster.state](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cluster-state.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics - */ -api.cluster.prototype.state = ca({ - params: { - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/_cluster/state/<%=metric%>/<%=index%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'blocks', - 'metadata', - 'nodes', - 'routing_table', - 'routing_nodes', - 'master_node', - 'version' - ] - }, - index: { - type: 'list' - } - } - }, - { - fmt: '/_cluster/state/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'blocks', - 'metadata', - 'nodes', - 'routing_table', - 'routing_nodes', - 'master_node', - 'version' - ] - } - } - }, - { - fmt: '/_cluster/state' - } - ] -}); - -/** - * Perform a [cluster.stats](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cluster-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - */ -api.cluster.prototype.stats = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_cluster/stats/nodes/<%=nodeId%>', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_cluster/stats' - } - ] -}); - -/** - * Perform a [count](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-count.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.minScore - Include only documents with a specific `_score` value in the result - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.terminateAfter - The maximum count for each shard, upon reaching which the query execution will terminate early - * @param {<>, <>, <>} params.index - A comma-separated list of indices to restrict the results - * @param {<>, <>, <>} params.type - A comma-separated list of types to restrict the results - */ -api.count = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - minScore: { - type: 'number', - name: 'min_score' - }, - preference: { - type: 'string' - }, - routing: { - type: 'list' - }, - q: { - type: 'string' - }, - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - lenient: { - type: 'boolean' - }, - terminateAfter: { - type: 'number', - name: 'terminate_after' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_count', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_count', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_count' - } - ], - method: 'POST' -}); - -/** - * Perform a [create](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-index_.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.parent - ID of the parent document - * @param {<>} params.refresh - If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.create = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - }, - pipeline: { - type: 'string' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_create', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [delete](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-delete.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the delete operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.parent - ID of parent document - * @param {<>} params.refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api['delete'] = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [deleteByQuery](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-delete-by-query.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.conflicts=abort] - What to do when the delete-by-query hits version conflicts? - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.searchTimeout - Explicit timeout for each search request. Defaults to no timeout. - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the delete by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.scrollSize - Size on the scroll request powering the update_by_query - * @param {<>} [params.waitForCompletion=true] - Should the request should block until the delete-by-query is complete. - * @param {<>} params.requestsPerSecond - The throttle for this request in sub-requests per second. -1 means no throttle. - * @param {<>} [params.slices=1] - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.deleteByQuery = ca({ - params: { - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - from: { - type: 'number' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - conflicts: { - type: 'enum', - 'default': 'abort', - options: [ - 'abort', - 'proceed' - ] - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - lenient: { - type: 'boolean' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'dfs_query_then_fetch' - ], - name: 'search_type' - }, - searchTimeout: { - type: 'time', - name: 'search_timeout' - }, - size: { - type: 'number' - }, - sort: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - terminateAfter: { - type: 'number', - name: 'terminate_after' - }, - stats: { - type: 'list' - }, - version: { - type: 'boolean' - }, - requestCache: { - type: 'boolean', - name: 'request_cache' - }, - refresh: { - type: 'boolean' - }, - timeout: { - type: 'time', - 'default': '1m' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - scrollSize: { - type: 'number', - name: 'scroll_size' - }, - waitForCompletion: { - type: 'boolean', - 'default': true, - name: 'wait_for_completion' - }, - requestsPerSecond: { - type: 'number', - 'default': 0, - name: 'requests_per_second' - }, - slices: { - type: 'number', - 'default': 1 - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_delete_by_query', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_delete_by_query', - req: { - index: { - type: 'list' - } - } - } - ], - needBody: true, - method: 'POST' -}); - -/** - * Perform a [deleteScript](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.id - Script ID - */ -api.deleteScript = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_scripts/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [exists](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document (use `_all` to fetch the first document matching the ID across all types) - */ -api.exists = ca({ - params: { - storedFields: { - type: 'list', - name: 'stored_fields' - }, - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [existsSource](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document; use `_all` to fetch the first document matching the ID across all types - */ -api.existsSource = ca({ - params: { - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_source', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [explain](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-explain.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzeWildcard - Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false) - * @param {<>} params.analyzer - The analyzer for the query string query - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The default field for query string query (default: _all) - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.explain = ca({ - params: { - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - analyzer: { - type: 'string' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - storedFields: { - type: 'list', - name: 'stored_fields' - }, - lenient: { - type: 'boolean' - }, - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_explain', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [fieldCaps](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-field-caps.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.fields - A comma-separated list of field names - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.fieldCaps = ca({ - params: { - fields: { - type: 'list' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_field_caps', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_field_caps' - } - ], - method: 'POST' -}); - -/** - * Perform a [get](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document (use `_all` to fetch the first document matching the ID across all types) - */ -api.get = ca({ - params: { - storedFields: { - type: 'list', - name: 'stored_fields' - }, - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [getScript](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Script ID - */ -api.getScript = ca({ - url: { - fmt: '/_scripts/<%=id%>', - req: { - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [getSource](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document; use `_all` to fetch the first document matching the ID across all types - */ -api.getSource = ca({ - params: { - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_source', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [index](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-index_.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} [params.opType=index] - Explicit operation type - * @param {<>} params.parent - ID of the parent document - * @param {<>} params.refresh - If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.index = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - opType: { - type: 'enum', - 'default': 'index', - options: [ - 'index', - 'create' - ], - name: 'op_type' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - }, - pipeline: { - type: 'string' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/<%=type%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - } - ], - needBody: true, - method: 'POST' -}); - -api.indices = namespace(); - -/** - * Perform a [indices.analyze](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-analyze.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.index - The name of the index to scope the operation - * @param {<>} params.preferLocal - With `true`, specify that a local shard should be used if available, with `false`, use a random shard (default: true) - * @param {<>} [params.format=detailed] - Format of the output - */ -api.indices.prototype.analyze = ca({ - params: { - index: { - type: 'string' - }, - preferLocal: { - type: 'boolean', - name: 'prefer_local' - }, - format: { - type: 'enum', - 'default': 'detailed', - options: [ - 'detailed', - 'text' - ] - } - }, - urls: [ - { - fmt: '/<%=index%>/_analyze', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_analyze' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.clearCache](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-clearcache.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.fieldData - Clear field data - * @param {<>} params.fielddata - Clear field data - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to clear when using the `field_data` parameter (default: all) - * @param {<>} params.query - Clear query caches - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index name to limit the operation - * @param {<>} params.recycler - Clear the recycler cache - * @param {<>} params.requestCache - Clear request cache - * @param {<>} params.request - Clear request cache - */ -api.indices.prototype.clearCache = ca({ - params: { - fieldData: { - type: 'boolean', - name: 'field_data' - }, - fielddata: { - type: 'boolean' - }, - fields: { - type: 'list' - }, - query: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - index: { - type: 'list' - }, - recycler: { - type: 'boolean' - }, - requestCache: { - type: 'boolean', - name: 'request_cache' - }, - request: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_cache/clear', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cache/clear' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.close](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-open-close.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma separated list of indices to close - */ -api.indices.prototype.close = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - url: { - fmt: '/<%=index%>/_close', - req: { - index: { - type: 'list' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [indices.create](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-create-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for before the operation returns. - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.updateAllTypes - Whether to update the mapping for all fields with the same name across all types or not - * @param {<>} params.index - The name of the index - */ -api.indices.prototype.create = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - updateAllTypes: { - type: 'boolean', - name: 'update_all_types' - } - }, - url: { - fmt: '/<%=index%>', - req: { - index: { - type: 'string' - } - } - }, - method: 'PUT' -}); - -/** - * Perform a [indices.delete](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-delete-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Ignore unavailable indexes (default: false) - * @param {<>} params.allowNoIndices - Ignore if a wildcard expression resolves to no concrete indices (default: false) - * @param {<>} [params.expandWildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (default: open) - * @param {<>, <>, <>} params.index - A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices - */ -api.indices.prototype['delete'] = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - url: { - fmt: '/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [indices.deleteAlias](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit timestamp for the document - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of index names (supports wildcards); use `_all` for all indices - * @param {<>, <>, <>} params.name - A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices. - */ -api.indices.prototype.deleteAlias = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [indices.deleteTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.name - The name of the template - */ -api.indices.prototype.deleteTemplate = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [indices.exists](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-exists.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.ignoreUnavailable - Ignore unavailable indexes (default: false) - * @param {<>} params.allowNoIndices - Ignore if a wildcard expression resolves to no concrete indices (default: false) - * @param {<>} [params.expandWildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (default: open) - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.includeDefaults - Whether to return all default setting for each of the indices. - * @param {<>, <>, <>} params.index - A comma-separated list of index names - */ -api.indices.prototype.exists = ca({ - params: { - local: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - includeDefaults: { - type: 'boolean', - 'default': false, - name: 'include_defaults' - } - }, - url: { - fmt: '/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [indices.existsAlias](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=all] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names to filter aliases - * @param {<>, <>, <>} params.name - A comma-separated list of alias names to return - */ -api.indices.prototype.existsAlias = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'all', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/_alias/<%=name%>', - req: { - name: { - type: 'list' - } - } - } - ], - method: 'HEAD' -}); - -/** - * Perform a [indices.existsTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.name - The comma separated names of the index templates - */ -api.indices.prototype.existsTemplate = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - local: { - type: 'boolean' - } - }, - url: { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [indices.existsType](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-types-exists.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` to check the types across all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to check - */ -api.indices.prototype.existsType = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - url: { - fmt: '/<%=index%>/_mapping/<%=type%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [indices.flush](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-flush.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.force - Whether a flush should be forced even if it is not necessarily needed ie. if no changes will be committed to the index. This is useful if transaction log IDs should be incremented even if no uncommitted changes are present. (This setting can be considered as internal) - * @param {<>} params.waitIfOngoing - If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. The default is true. If set to false the flush will be skipped iff if another flush operation is already running. - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string for all indices - */ -api.indices.prototype.flush = ca({ - params: { - force: { - type: 'boolean' - }, - waitIfOngoing: { - type: 'boolean', - name: 'wait_if_ongoing' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_flush', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_flush' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.flushSynced](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-synced-flush.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string for all indices - */ -api.indices.prototype.flushSynced = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_flush/synced', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_flush/synced' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.forcemerge](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-forcemerge.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flush - Specify whether the index should be flushed after performing the operation (default: true) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.maxNumSegments - The number of segments the index should be merged into (default: dynamic) - * @param {<>} params.onlyExpungeDeletes - Specify whether the operation should only expunge deleted documents - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.waitForMerge - Specify whether the request should block until the merge process is finished (default: true) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.forcemerge = ca({ - params: { - flush: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - maxNumSegments: { - type: 'number', - name: 'max_num_segments' - }, - onlyExpungeDeletes: { - type: 'boolean', - name: 'only_expunge_deletes' - }, - operationThreading: { - name: 'operation_threading' - }, - waitForMerge: { - type: 'boolean', - name: 'wait_for_merge' - } - }, - urls: [ - { - fmt: '/<%=index%>/_forcemerge', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_forcemerge' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.get](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-get-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.ignoreUnavailable - Ignore unavailable indexes (default: false) - * @param {<>} params.allowNoIndices - Ignore if a wildcard expression resolves to no concrete indices (default: false) - * @param {<>} [params.expandWildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (default: open) - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.includeDefaults - Whether to return all default setting for each of the indices. - * @param {<>, <>, <>} params.index - A comma-separated list of index names - */ -api.indices.prototype.get = ca({ - params: { - local: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - includeDefaults: { - type: 'boolean', - 'default': false, - name: 'include_defaults' - } - }, - url: { - fmt: '/<%=index%>', - req: { - index: { - type: 'list' - } - } - } -}); - -/** - * Perform a [indices.getAlias](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=all] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names to filter aliases - * @param {<>, <>, <>} params.name - A comma-separated list of alias names to return - */ -api.indices.prototype.getAlias = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'all', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/_alias/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_alias', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_alias' - } - ] -}); - -/** - * Perform a [indices.getFieldMapping](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-get-field-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.includeDefaults - Whether the default mapping values should be returned as well - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} params.type - A comma-separated list of document types - * @param {<>, <>, <>} params.fields - A comma-separated list of fields - */ -api.indices.prototype.getFieldMapping = ca({ - params: { - includeDefaults: { - type: 'boolean', - name: 'include_defaults' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_mapping/<%=type%>/field/<%=fields%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - }, - fields: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_mapping/field/<%=fields%>', - req: { - index: { - type: 'list' - }, - fields: { - type: 'list' - } - } - }, - { - fmt: '/_mapping/<%=type%>/field/<%=fields%>', - req: { - type: { - type: 'list' - }, - fields: { - type: 'list' - } - } - }, - { - fmt: '/_mapping/field/<%=fields%>', - req: { - fields: { - type: 'list' - } - } - } - ] -}); - -/** - * Perform a [indices.getMapping](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-get-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} params.type - A comma-separated list of document types - */ -api.indices.prototype.getMapping = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_mapping/<%=type%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_mapping', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_mapping/<%=type%>', - req: { - type: { - type: 'list' - } - } - }, - { - fmt: '/_mapping' - } - ] -}); - -/** - * Perform a [indices.getSettings](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-get-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open,closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.includeDefaults - Whether to return all default setting for each of the indices. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.name - The name of the settings that should be included - */ -api.indices.prototype.getSettings = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': [ - 'open', - 'closed' - ], - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - local: { - type: 'boolean' - }, - includeDefaults: { - type: 'boolean', - 'default': false, - name: 'include_defaults' - } - }, - urls: [ - { - fmt: '/<%=index%>/_settings/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_settings', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_settings/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/_settings' - } - ] -}); - -/** - * Perform a [indices.getTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.name - The comma separated names of the index templates - */ -api.indices.prototype.getTemplate = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/_template' - } - ] -}); - -/** - * Perform a [indices.getUpgrade](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-upgrade.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.getUpgrade = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_upgrade', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_upgrade' - } - ] -}); - -/** - * Perform a [indices.open](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-open-close.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma separated list of indices to open - */ -api.indices.prototype.open = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'closed', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - url: { - fmt: '/<%=index%>/_open', - req: { - index: { - type: 'list' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [indices.putAlias](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit timestamp for the document - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices. - * @param {<>} params.name - The name of the alias to be created or updated - */ -api.indices.prototype.putAlias = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'string' - } - } - }, - method: 'PUT' -}); - -/** - * Perform a [indices.putMapping](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-put-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.updateAllTypes - Whether to update the mapping for all fields with the same name across all types or not - * @param {<>, <>, <>} params.index - A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices. - * @param {<>} params.type - The name of the document type - */ -api.indices.prototype.putMapping = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - updateAllTypes: { - type: 'boolean', - name: 'update_all_types' - } - }, - urls: [ - { - fmt: '/<%=index%>/_mapping/<%=type%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/_mapping/<%=type%>', - req: { - type: { - type: 'string' - } - } - } - ], - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [indices.putSettings](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.preserveExisting - Whether to update existing settings. If set to `true` existing settings on an index remain unchanged, the default is `false` - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.putSettings = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - preserveExisting: { - type: 'boolean', - name: 'preserve_existing' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - } - }, - urls: [ - { - fmt: '/<%=index%>/_settings', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_settings' - } - ], - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [indices.putTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.order - The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers) - * @param {<>} params.create - Whether the index template should only be added if new or can also replace an existing one - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.name - The name of the template - */ -api.indices.prototype.putTemplate = ca({ - params: { - order: { - type: 'number' - }, - create: { - type: 'boolean', - 'default': false - }, - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - } - }, - url: { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [indices.recovery](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-recovery.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.detailed - Whether to display detailed information about shard recovery - * @param {<>} params.activeOnly - Display only those recoveries that are currently on-going - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.recovery = ca({ - params: { - detailed: { - type: 'boolean', - 'default': false - }, - activeOnly: { - type: 'boolean', - 'default': false, - name: 'active_only' - } - }, - urls: [ - { - fmt: '/<%=index%>/_recovery', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_recovery' - } - ] -}); - -/** - * Perform a [indices.refresh](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-refresh.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.refresh = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_refresh', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_refresh' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.rollover](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-rollover-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.dryRun - If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for on the newly created rollover index before the operation returns. - * @param {<>} params.alias - The name of the alias to rollover - * @param {<>} params.newIndex - The name of the rollover index - */ -api.indices.prototype.rollover = ca({ - params: { - timeout: { - type: 'time' - }, - dryRun: { - type: 'boolean', - name: 'dry_run' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - } - }, - urls: [ - { - fmt: '/<%=alias%>/_rollover/<%=newIndex%>', - req: { - alias: { - type: 'string' - }, - newIndex: { - type: 'string' - } - } - }, - { - fmt: '/<%=alias%>/_rollover', - req: { - alias: { - type: 'string' - } - } - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.segments](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-segments.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.verbose - Includes detailed memory usage by Lucene. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.segments = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - operationThreading: { - name: 'operation_threading' - }, - verbose: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/<%=index%>/_segments', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_segments' - } - ] -}); - -/** - * Perform a [indices.shardStores](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-shards-stores.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.status - A comma-separated list of statuses used to filter on shards to get store information for - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {anything} params.operationThreading - TODO: ? - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.shardStores = ca({ - params: { - status: { - type: 'list', - options: [ - 'green', - 'yellow', - 'red', - 'all' - ] - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - operationThreading: { - name: 'operation_threading' - } - }, - urls: [ - { - fmt: '/<%=index%>/_shard_stores', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_shard_stores' - } - ] -}); - -/** - * Perform a [indices.shrink](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-shrink-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for on the shrunken index before the operation returns. - * @param {<>} params.index - The name of the source index to shrink - * @param {<>} params.target - The name of the target index to shrink into - */ -api.indices.prototype.shrink = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - } - }, - url: { - fmt: '/<%=index%>/_shrink/<%=target%>', - req: { - index: { - type: 'string' - }, - target: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [indices.stats](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.completionFields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields for `fielddata` index metric (supports wildcards) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) - * @param {<>, <>, <>} params.groups - A comma-separated list of search groups for `search` index metric - * @param {<>} [params.level=indices] - Return stats aggregated at cluster, index or shard level - * @param {<>, <>, <>} params.types - A comma-separated list of document types for the `indexing` index metric - * @param {<>} params.includeSegmentFileSizes - Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.metric - Limit the information returned the specific metrics. - */ -api.indices.prototype.stats = ca({ - params: { - completionFields: { - type: 'list', - name: 'completion_fields' - }, - fielddataFields: { - type: 'list', - name: 'fielddata_fields' - }, - fields: { - type: 'list' - }, - groups: { - type: 'list' - }, - level: { - type: 'enum', - 'default': 'indices', - options: [ - 'cluster', - 'indices', - 'shards' - ] - }, - types: { - type: 'list' - }, - includeSegmentFileSizes: { - type: 'boolean', - 'default': false, - name: 'include_segment_file_sizes' - } - }, - urls: [ - { - fmt: '/<%=index%>/_stats/<%=metric%>', - req: { - index: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/_stats/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/<%=index%>/_stats', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_stats' - } - ] -}); - -/** - * Perform a [indices.updateAliases](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Request timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - */ -api.indices.prototype.updateAliases = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_aliases' - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [indices.upgrade](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/indices-upgrade.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.waitForCompletion - Specify whether the request should block until the all segments are upgraded (default: false) - * @param {<>} params.onlyAncientSegments - If true, only ancient (an older Lucene major release) segments will be upgraded - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.upgrade = ca({ - params: { - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - waitForCompletion: { - type: 'boolean', - name: 'wait_for_completion' - }, - onlyAncientSegments: { - type: 'boolean', - name: 'only_ancient_segments' - } - }, - urls: [ - { - fmt: '/<%=index%>/_upgrade', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_upgrade' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.validateQuery](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-validate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.explain - Return detailed information about the error - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.rewrite - Provide a more detailed explanation showing the actual Lucene query that will be executed. - * @param {<>} params.allShards - Execute validation on all shards instead of one random shard per index - * @param {<>, <>, <>} params.index - A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to restrict the operation; leave empty to perform the operation on all types - */ -api.indices.prototype.validateQuery = ca({ - params: { - explain: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - operationThreading: { - name: 'operation_threading' - }, - q: { - type: 'string' - }, - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - lenient: { - type: 'boolean' - }, - rewrite: { - type: 'boolean' - }, - allShards: { - type: 'boolean', - name: 'all_shards' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_validate/query', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_validate/query', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_validate/query' - } - ], - method: 'POST' -}); - -/** - * Perform a [info](http://www.elastic.co/guide/) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.info = ca({ - url: { - fmt: '/' - } -}); - -api.ingest = namespace(); - -/** - * Perform a [ingest.deletePipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/6.0/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.id - Pipeline ID - */ -api.ingest.prototype.deletePipeline = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_ingest/pipeline/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [ingest.getPipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/6.0/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.id - Comma separated list of pipeline ids. Wildcards supported - */ -api.ingest.prototype.getPipeline = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - urls: [ - { - fmt: '/_ingest/pipeline/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - { - fmt: '/_ingest/pipeline' - } - ] -}); - -/** - * Perform a [ingest.processorGrok](https://www.elastic.co/guide/en/elasticsearch/plugins/6.0/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.ingest.prototype.processorGrok = ca({ - url: { - fmt: '/_ingest/processor/grok' - } -}); - -/** - * Perform a [ingest.putPipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/6.0/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.id - Pipeline ID - */ -api.ingest.prototype.putPipeline = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_ingest/pipeline/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [ingest.simulate](https://www.elastic.co/guide/en/elasticsearch/plugins/6.0/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.verbose - Verbose mode. Display data output for each processor in executed pipeline - * @param {<>} params.id - Pipeline ID - */ -api.ingest.prototype.simulate = ca({ - params: { - verbose: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_ingest/pipeline/<%=id%>/_simulate', - req: { - id: { - type: 'string' - } - } - }, - { - fmt: '/_ingest/pipeline/_simulate' - } - ], - needBody: true, - method: 'POST' -}); - -/** - * Perform a [mget](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-multi-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.mget = ca({ - params: { - storedFields: { - type: 'list', - name: 'stored_fields' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_mget', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_mget', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_mget' - } - ], - needBody: true, - method: 'POST' -}); - -/** - * Perform a [msearch](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-multi-search.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.searchType - Search operation type - * @param {<>} params.maxConcurrentSearches - Controls the maximum number of concurrent searches the multi search api will execute - * @param {<>} params.typedKeys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response - * @param {<>} [params.preFilterShardSize=128] - A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on it's rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to use as default - * @param {<>, <>, <>} params.type - A comma-separated list of document types to use as default - */ -api.msearch = ca({ - params: { - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'query_and_fetch', - 'dfs_query_then_fetch', - 'dfs_query_and_fetch' - ], - name: 'search_type' - }, - maxConcurrentSearches: { - type: 'number', - name: 'max_concurrent_searches' - }, - typedKeys: { - type: 'boolean', - name: 'typed_keys' - }, - preFilterShardSize: { - type: 'number', - 'default': 128, - name: 'pre_filter_shard_size' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_msearch', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_msearch', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_msearch' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -/** - * Perform a [msearchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-multi-search.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.searchType - Search operation type - * @param {<>} params.typedKeys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response - * @param {<>} params.maxConcurrentSearches - Controls the maximum number of concurrent searches the multi search api will execute - * @param {<>, <>, <>} params.index - A comma-separated list of index names to use as default - * @param {<>, <>, <>} params.type - A comma-separated list of document types to use as default - */ -api.msearchTemplate = ca({ - params: { - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'query_and_fetch', - 'dfs_query_then_fetch', - 'dfs_query_and_fetch' - ], - name: 'search_type' - }, - typedKeys: { - type: 'boolean', - name: 'typed_keys' - }, - maxConcurrentSearches: { - type: 'number', - name: 'max_concurrent_searches' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_msearch/template', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_msearch/template', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_msearch/template' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -/** - * Perform a [mtermvectors](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-multi-termvectors.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.ids - A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body - * @param {<>} params.termStatistics - Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.fieldStatistics=true] - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.offsets=true] - Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.positions=true] - Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.payloads=true] - Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) .Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.routing - Specific routing value. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.parent - Parent id of documents. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.realtime - Specifies if requests are real-time as opposed to near-real-time (default: true). - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index in which the document resides. - * @param {<>} params.type - The type of the document. - */ -api.mtermvectors = ca({ - params: { - ids: { - type: 'list', - required: false - }, - termStatistics: { - type: 'boolean', - 'default': false, - required: false, - name: 'term_statistics' - }, - fieldStatistics: { - type: 'boolean', - 'default': true, - required: false, - name: 'field_statistics' - }, - fields: { - type: 'list', - required: false - }, - offsets: { - type: 'boolean', - 'default': true, - required: false - }, - positions: { - type: 'boolean', - 'default': true, - required: false - }, - payloads: { - type: 'boolean', - 'default': true, - required: false - }, - preference: { - type: 'string', - required: false - }, - routing: { - type: 'string', - required: false - }, - parent: { - type: 'string', - required: false - }, - realtime: { - type: 'boolean', - required: false - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_mtermvectors', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_mtermvectors', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_mtermvectors' - } - ], - method: 'POST' -}); - -api.nodes = namespace(); - -/** - * Perform a [nodes.hotThreads](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cluster-nodes-hot-threads.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.interval - The interval for the second sampling of threads - * @param {<>} params.snapshots - Number of samples of thread stacktrace (default: 10) - * @param {<>} params.threads - Specify the number of threads to provide information for (default: 3) - * @param {<>} params.ignoreIdleThreads - Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue (default: true) - * @param {<>} params.type - The type to sample (default: cpu) - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - */ -api.nodes.prototype.hotThreads = ca({ - params: { - interval: { - type: 'time' - }, - snapshots: { - type: 'number' - }, - threads: { - type: 'number' - }, - ignoreIdleThreads: { - type: 'boolean', - name: 'ignore_idle_threads' - }, - type: { - type: 'enum', - options: [ - 'cpu', - 'wait', - 'block' - ] - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_nodes/<%=nodeId%>/hotthreads', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_nodes/hotthreads' - } - ] -}); - -/** - * Perform a [nodes.info](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cluster-nodes-info.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.metric - A comma-separated list of metrics you wish returned. Leave empty to return all. - */ -api.nodes.prototype.info = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_nodes/<%=nodeId%>/<%=metric%>', - req: { - nodeId: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - 'settings', - 'os', - 'process', - 'jvm', - 'thread_pool', - 'transport', - 'http', - 'plugins', - 'ingest' - ] - } - } - }, - { - fmt: '/_nodes/<%=nodeId%>', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_nodes/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - 'settings', - 'os', - 'process', - 'jvm', - 'thread_pool', - 'transport', - 'http', - 'plugins', - 'ingest' - ] - } - } - }, - { - fmt: '/_nodes' - } - ] -}); - -/** - * Perform a [nodes.stats](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cluster-nodes-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.completionFields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields for `fielddata` index metric (supports wildcards) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) - * @param {<>} params.groups - A comma-separated list of search groups for `search` index metric - * @param {<>} [params.level=node] - Return indices stats aggregated at index, node or shard level - * @param {<>, <>, <>} params.types - A comma-separated list of document types for the `indexing` index metric - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.includeSegmentFileSizes - Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics - * @param {<>, <>, <>} params.indexMetric - Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified. - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - */ -api.nodes.prototype.stats = ca({ - params: { - completionFields: { - type: 'list', - name: 'completion_fields' - }, - fielddataFields: { - type: 'list', - name: 'fielddata_fields' - }, - fields: { - type: 'list' - }, - groups: { - type: 'boolean' - }, - level: { - type: 'enum', - 'default': 'node', - options: [ - 'indices', - 'node', - 'shards' - ] - }, - types: { - type: 'list' - }, - timeout: { - type: 'time' - }, - includeSegmentFileSizes: { - type: 'boolean', - 'default': false, - name: 'include_segment_file_sizes' - } - }, - urls: [ - { - fmt: '/_nodes/<%=nodeId%>/stats/<%=metric%>/<%=indexMetric%>', - req: { - nodeId: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport', - 'discovery' - ] - }, - indexMetric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/_nodes/<%=nodeId%>/stats/<%=metric%>', - req: { - nodeId: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport', - 'discovery' - ] - } - } - }, - { - fmt: '/_nodes/stats/<%=metric%>/<%=indexMetric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport', - 'discovery' - ] - }, - indexMetric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/_nodes/<%=nodeId%>/stats', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_nodes/stats/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport', - 'discovery' - ] - } - } - }, - { - fmt: '/_nodes/stats' - } - ] -}); - -/** - * Perform a [nodes.usage](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/cluster-nodes-usage.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - */ -api.nodes.prototype.usage = ca({ - params: { - human: { - type: 'boolean', - 'default': false - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_nodes/<%=nodeId%>/usage/<%=metric%>', - req: { - nodeId: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - '_all', - 'rest_actions' - ] - } - } - }, - { - fmt: '/_nodes/<%=nodeId%>/usage', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_nodes/usage/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'rest_actions' - ] - } - } - }, - { - fmt: '/_nodes/usage' - } - ] -}); - -/** - * Perform a [ping](http://www.elastic.co/guide/) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.ping = ca({ - url: { - fmt: '/' - }, - requestTimeout: 3000, - method: 'HEAD' -}); - -/** - * Perform a [putScript](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.context - Script context - * @param {<>} params.id - Script ID - */ -api.putScript = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - context: { - type: 'string' - } - }, - urls: [ - { - fmt: '/_scripts/<%=id%>/<%=context%>', - req: { - id: { - type: 'string' - }, - context: { - type: 'string' - } - } - }, - { - fmt: '/_scripts/<%=id%>', - req: { - id: { - type: 'string' - } - } - } - ], - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [reindex](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-reindex.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the reindex operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} [params.waitForCompletion=true] - Should the request should block until the reindex is complete. - * @param {<>} params.requestsPerSecond - The throttle to set on this request in sub-requests per second. -1 means no throttle. - * @param {<>} [params.slices=1] - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. - */ -api.reindex = ca({ - params: { - refresh: { - type: 'boolean' - }, - timeout: { - type: 'time', - 'default': '1m' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - waitForCompletion: { - type: 'boolean', - 'default': true, - name: 'wait_for_completion' - }, - requestsPerSecond: { - type: 'number', - 'default': 0, - name: 'requests_per_second' - }, - slices: { - type: 'number', - 'default': 1 - } - }, - url: { - fmt: '/_reindex' - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [reindexRethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-reindex.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.requestsPerSecond - The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. - * @param {<>} params.taskId - The task id to rethrottle - */ -api.reindexRethrottle = ca({ - params: { - requestsPerSecond: { - type: 'number', - required: true, - name: 'requests_per_second' - } - }, - url: { - fmt: '/_reindex/<%=taskId%>/_rethrottle', - req: { - taskId: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [renderSearchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - The id of the stored search template - */ -api.renderSearchTemplate = ca({ - urls: [ - { - fmt: '/_render/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - { - fmt: '/_render/template' - } - ], - method: 'POST' -}); - -/** - * Perform a [scroll](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-request-scroll.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.scrollId - The scroll ID - */ -api.scroll = ca({ - params: { - scroll: { - type: 'time' - }, - scrollId: { - type: 'string', - name: 'scroll_id' - } - }, - urls: [ - { - fmt: '/_search/scroll/<%=scrollId%>', - req: { - scrollId: { - type: 'string' - } - } - }, - { - fmt: '/_search/scroll' - } - ], - paramAsBody: { - param: 'scrollId', - body: 'scroll_id' - }, - method: 'POST' -}); - -/** - * Perform a [search](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-search.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.explain - Specify whether to return detailed information about score computation as part of a hit - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return as part of a hit - * @param {<>, <>, <>} params.docvalueFields - A comma-separated list of fields to return as the docvalue representation of a field for each hit - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.suggestField - Specify which field to use for suggestions - * @param {<>} [params.suggestMode=missing] - Specify suggest mode - * @param {<>} params.suggestSize - How many suggestions to return in response - * @param {<>} params.suggestText - The source text for which the suggestions should be returned - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.trackScores - Whether to calculate and return scores even if they are not used for sorting - * @param {<>} params.trackTotalHits - Indicate if the number of documents that match the query should be tracked - * @param {<>} params.typedKeys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>} [params.batchedReduceSize=512] - The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large. - * @param {<>} [params.maxConcurrentShardRequests=The default grows with the number of nodes in the cluster but is at most 256.] - The number of concurrent shard requests this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests - * @param {<>} [params.preFilterShardSize=128] - A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on it's rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.search = ca({ - params: { - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - explain: { - type: 'boolean' - }, - storedFields: { - type: 'list', - name: 'stored_fields' - }, - docvalueFields: { - type: 'list', - name: 'docvalue_fields' - }, - from: { - type: 'number' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - lenient: { - type: 'boolean' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'dfs_query_then_fetch' - ], - name: 'search_type' - }, - size: { - type: 'number' - }, - sort: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - terminateAfter: { - type: 'number', - name: 'terminate_after' - }, - stats: { - type: 'list' - }, - suggestField: { - type: 'string', - name: 'suggest_field' - }, - suggestMode: { - type: 'enum', - 'default': 'missing', - options: [ - 'missing', - 'popular', - 'always' - ], - name: 'suggest_mode' - }, - suggestSize: { - type: 'number', - name: 'suggest_size' - }, - suggestText: { - type: 'string', - name: 'suggest_text' - }, - timeout: { - type: 'time' - }, - trackScores: { - type: 'boolean', - name: 'track_scores' - }, - trackTotalHits: { - type: 'boolean', - name: 'track_total_hits' - }, - typedKeys: { - type: 'boolean', - name: 'typed_keys' - }, - version: { - type: 'boolean' - }, - requestCache: { - type: 'boolean', - name: 'request_cache' - }, - batchedReduceSize: { - type: 'number', - 'default': 512, - name: 'batched_reduce_size' - }, - maxConcurrentShardRequests: { - type: 'number', - 'default': 'The default grows with the number of nodes in the cluster but is at most 256.', - name: 'max_concurrent_shard_requests' - }, - preFilterShardSize: { - type: 'number', - 'default': 128, - name: 'pre_filter_shard_size' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_search', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_search', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_search' - } - ], - method: 'POST' -}); - -/** - * Perform a [searchShards](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-shards.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - */ -api.searchShards = ca({ - params: { - preference: { - type: 'string' - }, - routing: { - type: 'string' - }, - local: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_search_shards', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_search_shards' - } - ], - method: 'POST' -}); - -/** - * Perform a [searchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.explain - Specify whether to return detailed information about score computation as part of a hit - * @param {<>} params.profile - Specify whether to profile the query execution - * @param {<>} params.typedKeys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.searchTemplate = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - preference: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'query_and_fetch', - 'dfs_query_then_fetch', - 'dfs_query_and_fetch' - ], - name: 'search_type' - }, - explain: { - type: 'boolean' - }, - profile: { - type: 'boolean' - }, - typedKeys: { - type: 'boolean', - name: 'typed_keys' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_search/template', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_search/template', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_search/template' - } - ], - method: 'POST' -}); - -api.snapshot = namespace(); - -/** - * Perform a [snapshot.create](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.waitForCompletion - Should this request wait until the operation has completed before returning - * @param {<>} params.repository - A repository name - * @param {<>} params.snapshot - A snapshot name - */ -api.snapshot.prototype.create = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForCompletion: { - type: 'boolean', - 'default': false, - name: 'wait_for_completion' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [snapshot.createRepository](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.verify - Whether to verify the repository after creation - * @param {<>} params.repository - A repository name - */ -api.snapshot.prototype.createRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - }, - verify: { - type: 'boolean' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>', - req: { - repository: { - type: 'string' - } - } - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [snapshot.delete](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.repository - A repository name - * @param {<>} params.snapshot - A snapshot name - */ -api.snapshot.prototype['delete'] = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [snapshot.deleteRepository](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.repository - A comma-separated list of repository names - */ -api.snapshot.prototype.deleteRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>', - req: { - repository: { - type: 'list' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [snapshot.get](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.ignoreUnavailable - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown - * @param {<>} params.verbose - Whether to show verbose snapshot info or only show the basic info found in the repository index blob - * @param {<>} params.repository - A repository name - * @param {<>, <>, <>} params.snapshot - A comma-separated list of snapshot names - */ -api.snapshot.prototype.get = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - verbose: { - type: 'boolean' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'list' - } - } - } -}); - -/** - * Perform a [snapshot.getRepository](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.repository - A comma-separated list of repository names - */ -api.snapshot.prototype.getRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/_snapshot/<%=repository%>', - req: { - repository: { - type: 'list' - } - } - }, - { - fmt: '/_snapshot' - } - ] -}); - -/** - * Perform a [snapshot.restore](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.waitForCompletion - Should this request wait until the operation has completed before returning - * @param {<>} params.repository - A repository name - * @param {<>} params.snapshot - A snapshot name - */ -api.snapshot.prototype.restore = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForCompletion: { - type: 'boolean', - 'default': false, - name: 'wait_for_completion' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>/_restore', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [snapshot.status](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.ignoreUnavailable - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown - * @param {<>} params.repository - A repository name - * @param {<>, <>, <>} params.snapshot - A comma-separated list of snapshot names - */ -api.snapshot.prototype.status = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - } - }, - urls: [ - { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>/_status', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'list' - } - } - }, - { - fmt: '/_snapshot/<%=repository%>/_status', - req: { - repository: { - type: 'string' - } - } - }, - { - fmt: '/_snapshot/_status' - } - ] -}); - -/** - * Perform a [snapshot.verifyRepository](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.repository - A repository name - */ -api.snapshot.prototype.verifyRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/_verify', - req: { - repository: { - type: 'string' - } - } - }, - method: 'POST' -}); - -api.tasks = namespace(); - -/** - * Perform a [tasks.cancel](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.nodes - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.actions - A comma-separated list of actions that should be cancelled. Leave empty to cancel all. - * @param {<>} params.parentNode - Cancel tasks with specified parent node. - * @param {<>} params.parentTaskId - Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all. - * @param {<>} params.taskId - Cancel the task with specified task id (node_id:task_number) - */ -api.tasks.prototype.cancel = ca({ - params: { - nodes: { - type: 'list' - }, - actions: { - type: 'list' - }, - parentNode: { - type: 'string', - name: 'parent_node' - }, - parentTaskId: { - type: 'string', - name: 'parent_task_id' - } - }, - urls: [ - { - fmt: '/_tasks/<%=taskId%>/_cancel', - req: { - taskId: { - type: 'string' - } - } - }, - { - fmt: '/_tasks/_cancel' - } - ], - method: 'POST' -}); - -/** - * Perform a [tasks.get](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForCompletion - Wait for the matching tasks to complete (default: false) - * @param {<>} params.taskId - Return the task with specified id (node_id:task_number) - */ -api.tasks.prototype.get = ca({ - params: { - waitForCompletion: { - type: 'boolean', - name: 'wait_for_completion' - } - }, - url: { - fmt: '/_tasks/<%=taskId%>', - req: { - taskId: { - type: 'string' - } - } - } -}); - -/** - * Perform a [tasks.list](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.nodes - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.actions - A comma-separated list of actions that should be returned. Leave empty to return all. - * @param {<>} params.detailed - Return detailed task information (default: false) - * @param {<>} params.parentNode - Return tasks with specified parent node. - * @param {<>} params.parentTaskId - Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all. - * @param {<>} params.waitForCompletion - Wait for the matching tasks to complete (default: false) - * @param {<>} [params.groupBy=nodes] - Group tasks by nodes or parent/child relationships - */ -api.tasks.prototype.list = ca({ - params: { - nodes: { - type: 'list' - }, - actions: { - type: 'list' - }, - detailed: { - type: 'boolean' - }, - parentNode: { - type: 'string', - name: 'parent_node' - }, - parentTaskId: { - type: 'string', - name: 'parent_task_id' - }, - waitForCompletion: { - type: 'boolean', - name: 'wait_for_completion' - }, - groupBy: { - type: 'enum', - 'default': 'nodes', - options: [ - 'nodes', - 'parents' - ], - name: 'group_by' - } - }, - url: { - fmt: '/_tasks' - } -}); - -/** - * Perform a [termvectors](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-termvectors.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.termStatistics - Specifies if total term frequency and document frequency should be returned. - * @param {<>} [params.fieldStatistics=true] - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return. - * @param {<>} [params.offsets=true] - Specifies if term offsets should be returned. - * @param {<>} [params.positions=true] - Specifies if term positions should be returned. - * @param {<>} [params.payloads=true] - Specifies if term payloads should be returned. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random). - * @param {<>} params.routing - Specific routing value. - * @param {<>} params.parent - Parent id of documents. - * @param {<>} params.realtime - Specifies if request is real-time as opposed to near-real-time (default: true). - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index in which the document resides. - * @param {<>} params.type - The type of the document. - * @param {<>} params.id - The id of the document, when not specified a doc param should be supplied. - */ -api.termvectors = ca({ - params: { - termStatistics: { - type: 'boolean', - 'default': false, - required: false, - name: 'term_statistics' - }, - fieldStatistics: { - type: 'boolean', - 'default': true, - required: false, - name: 'field_statistics' - }, - fields: { - type: 'list', - required: false - }, - offsets: { - type: 'boolean', - 'default': true, - required: false - }, - positions: { - type: 'boolean', - 'default': true, - required: false - }, - payloads: { - type: 'boolean', - 'default': true, - required: false - }, - preference: { - type: 'string', - required: false - }, - routing: { - type: 'string', - required: false - }, - parent: { - type: 'string', - required: false - }, - realtime: { - type: 'boolean', - required: false - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_termvectors', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/<%=type%>/_termvectors', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - } - ], - method: 'POST' -}); - -/** - * Perform a [update](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-update.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the update operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return in the response - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.lang - The script language (default: painless) - * @param {<>} params.parent - ID of the parent document. Is is only used for routing and when for the upsert request - * @param {<>} params.refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.retryOnConflict - Specify how many times should the operation be retried when a conflict occurs (default: 0) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.update = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - fields: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - lang: { - type: 'string' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - retryOnConflict: { - type: 'number', - name: 'retry_on_conflict' - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_update', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [updateByQuery](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docs-update-by-query.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.conflicts=abort] - What to do when the update by query hits version conflicts? - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.pipeline - Ingest pipeline to set on index requests made by this action. (default: none) - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.searchTimeout - Explicit timeout for each search request. Defaults to no timeout. - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.versionType - Should the document increment the version number (internal) on hit or not (reindex) - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the update by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.scrollSize - Size on the scroll request powering the update_by_query - * @param {<>} [params.waitForCompletion=true] - Should the request should block until the update by query operation is complete. - * @param {<>} params.requestsPerSecond - The throttle to set on this request in sub-requests per second. -1 means no throttle. - * @param {<>} [params.slices=1] - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.updateByQuery = ca({ - params: { - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - from: { - type: 'number' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - conflicts: { - type: 'enum', - 'default': 'abort', - options: [ - 'abort', - 'proceed' - ] - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - lenient: { - type: 'boolean' - }, - pipeline: { - type: 'string' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'dfs_query_then_fetch' - ], - name: 'search_type' - }, - searchTimeout: { - type: 'time', - name: 'search_timeout' - }, - size: { - type: 'number' - }, - sort: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - terminateAfter: { - type: 'number', - name: 'terminate_after' - }, - stats: { - type: 'list' - }, - version: { - type: 'boolean' - }, - versionType: { - type: 'boolean', - name: 'version_type' - }, - requestCache: { - type: 'boolean', - name: 'request_cache' - }, - refresh: { - type: 'boolean' - }, - timeout: { - type: 'time', - 'default': '1m' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - scrollSize: { - type: 'number', - name: 'scroll_size' - }, - waitForCompletion: { - type: 'boolean', - 'default': true, - name: 'wait_for_completion' - }, - requestsPerSecond: { - type: 'number', - 'default': 0, - name: 'requests_per_second' - }, - slices: { - type: 'number', - 'default': 1 - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_update_by_query', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_update_by_query', - req: { - index: { - type: 'list' - } - } - } - ], - method: 'POST' -}); diff --git a/src/lib/apis/6_1.js b/src/lib/apis/6_1.js deleted file mode 100644 index c4ec74f7c..000000000 --- a/src/lib/apis/6_1.js +++ /dev/null @@ -1,7016 +0,0 @@ -var ca = require('../client_action').makeFactoryWithModifier(function (spec) { - return require('../utils').merge(spec, { - params: { - filterPath: { - type: 'list', - name: 'filter_path' - } - } - }); -}); -var namespace = require('../client_action').namespaceFactory; -var api = module.exports = {}; - -api._namespaces = ['cat', 'cluster', 'indices', 'ingest', 'nodes', 'snapshot', 'tasks']; - -/** - * Perform a [bulk](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/docs-bulk.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the bulk operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.type - Default document type for items which don't provide one - * @param {<>, <>, <>} params.fields - Default comma-separated list of fields to return in the response for updates, can be overridden on each sub-request - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request - * @param {<>, <>, <>} params._sourceExclude - Default list of fields to exclude from the returned _source field, can be overridden on each sub-request - * @param {<>, <>, <>} params._sourceInclude - Default list of fields to extract and return from the _source field, can be overridden on each sub-request - * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with - * @param {<>} params.index - Default index for items which don't provide one - */ -api.bulk = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - type: { - type: 'string' - }, - fields: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - pipeline: { - type: 'string' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_bulk', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_bulk', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_bulk' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -api.cat = namespace(); - -/** - * Perform a [cat.aliases](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/cat.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.name - A comma-separated list of alias names to return - */ -api.cat.prototype.aliases = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/aliases/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/_cat/aliases' - } - ] -}); - -/** - * Perform a [cat.allocation](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/cat-allocation.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information - */ -api.cat.prototype.allocation = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'kb', - 'm', - 'mb', - 'g', - 'gb', - 't', - 'tb', - 'p', - 'pb' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/allocation/<%=nodeId%>', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_cat/allocation' - } - ] -}); - -/** - * Perform a [cat.count](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/cat-count.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.count = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/count/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/count' - } - ] -}); - -/** - * Perform a [cat.fielddata](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/cat-fielddata.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return the fielddata size - */ -api.cat.prototype.fielddata = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'kb', - 'm', - 'mb', - 'g', - 'gb', - 't', - 'tb', - 'p', - 'pb' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - }, - fields: { - type: 'list' - } - }, - urls: [ - { - fmt: '/_cat/fielddata/<%=fields%>', - req: { - fields: { - type: 'list' - } - } - }, - { - fmt: '/_cat/fielddata' - } - ] -}); - -/** - * Perform a [cat.health](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/cat-health.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} [params.ts=true] - Set to false to disable timestamping - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.health = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - ts: { - type: 'boolean', - 'default': true - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/health' - } -}); - -/** - * Perform a [cat.help](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/cat.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - */ -api.cat.prototype.help = ca({ - params: { - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - } - }, - url: { - fmt: '/_cat' - } -}); - -/** - * Perform a [cat.indices](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/cat-indices.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.health - A health status ("green", "yellow", or "red" to filter only indices matching the specified health status - * @param {<>} params.help - Return help information - * @param {<>} params.pri - Set to true to return stats only for primary shards - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.indices = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'm', - 'g' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - health: { - type: 'enum', - 'default': null, - options: [ - 'green', - 'yellow', - 'red' - ] - }, - help: { - type: 'boolean', - 'default': false - }, - pri: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/indices/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/indices' - } - ] -}); - -/** - * Perform a [cat.master](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/cat-master.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.master = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/master' - } -}); - -/** - * Perform a [cat.nodeattrs](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/cat-nodeattrs.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.nodeattrs = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/nodeattrs' - } -}); - -/** - * Perform a [cat.nodes](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/cat-nodes.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.fullId - Return the full node ID instead of the shortened version (default: false) - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.nodes = ca({ - params: { - format: { - type: 'string' - }, - fullId: { - type: 'boolean', - name: 'full_id' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/nodes' - } -}); - -/** - * Perform a [cat.pendingTasks](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/cat-pending-tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.pendingTasks = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/pending_tasks' - } -}); - -/** - * Perform a [cat.plugins](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/cat-plugins.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.plugins = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/plugins' - } -}); - -/** - * Perform a [cat.recovery](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/cat-recovery.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.recovery = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'kb', - 'm', - 'mb', - 'g', - 'gb', - 't', - 'tb', - 'p', - 'pb' - ] - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/recovery/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/recovery' - } - ] -}); - -/** - * Perform a [cat.repositories](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/cat-repositories.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.repositories = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean', - 'default': false - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/repositories' - } -}); - -/** - * Perform a [cat.segments](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/cat-segments.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.segments = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'kb', - 'm', - 'mb', - 'g', - 'gb', - 't', - 'tb', - 'p', - 'pb' - ] - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/segments/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/segments' - } - ] -}); - -/** - * Perform a [cat.shards](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/cat-shards.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.shards = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'kb', - 'm', - 'mb', - 'g', - 'gb', - 't', - 'tb', - 'p', - 'pb' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/shards/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/shards' - } - ] -}); - -/** - * Perform a [cat.snapshots](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/cat-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.ignoreUnavailable - Set to true to ignore unavailable snapshots - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.repository - Name of repository from which to fetch the snapshot information - */ -api.cat.prototype.snapshots = ca({ - params: { - format: { - type: 'string' - }, - ignoreUnavailable: { - type: 'boolean', - 'default': false, - name: 'ignore_unavailable' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/snapshots/<%=repository%>', - req: { - repository: { - type: 'list' - } - } - }, - { - fmt: '/_cat/snapshots' - } - ] -}); - -/** - * Perform a [cat.tasks](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.actions - A comma-separated list of actions that should be returned. Leave empty to return all. - * @param {<>} params.detailed - Return detailed task information (default: false) - * @param {<>} params.parentNode - Return tasks with specified parent node. - * @param {<>} params.parentTask - Return tasks with specified parent task id. Set to -1 to return all. - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.tasks = ca({ - params: { - format: { - type: 'string' - }, - nodeId: { - type: 'list', - name: 'node_id' - }, - actions: { - type: 'list' - }, - detailed: { - type: 'boolean' - }, - parentNode: { - type: 'string', - name: 'parent_node' - }, - parentTask: { - type: 'number', - name: 'parent_task' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/tasks' - } -}); - -/** - * Perform a [cat.templates](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/cat-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>} params.name - A pattern that returned template names must match - */ -api.cat.prototype.templates = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/templates/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - { - fmt: '/_cat/templates' - } - ] -}); - -/** - * Perform a [cat.threadPool](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/cat-thread-pool.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.size - The multiplier in which to display values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.threadPoolPatterns - A comma-separated list of regular-expressions to filter the thread pools in the output - */ -api.cat.prototype.threadPool = ca({ - params: { - format: { - type: 'string' - }, - size: { - type: 'enum', - options: [ - '', - 'k', - 'm', - 'g', - 't', - 'p' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/thread_pool/<%=threadPoolPatterns%>', - req: { - threadPoolPatterns: { - type: 'list' - } - } - }, - { - fmt: '/_cat/thread_pool' - } - ] -}); - -/** - * Perform a [clearScroll](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/search-request-scroll.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.scrollId - A comma-separated list of scroll IDs to clear - */ -api.clearScroll = ca({ - urls: [ - { - fmt: '/_search/scroll/<%=scrollId%>', - req: { - scrollId: { - type: 'list' - } - } - }, - { - fmt: '/_search/scroll' - } - ], - paramAsBody: { - param: 'scrollId', - body: 'scroll_id' - }, - method: 'DELETE' -}); - -api.cluster = namespace(); - -/** - * Perform a [cluster.allocationExplain](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/cluster-allocation-explain.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.includeYesDecisions - Return 'YES' decisions in explanation (default: false) - * @param {<>} params.includeDiskInfo - Return information about disk usage and shard sizes (default: false) - */ -api.cluster.prototype.allocationExplain = ca({ - params: { - includeYesDecisions: { - type: 'boolean', - name: 'include_yes_decisions' - }, - includeDiskInfo: { - type: 'boolean', - name: 'include_disk_info' - } - }, - url: { - fmt: '/_cluster/allocation/explain' - }, - method: 'POST' -}); - -/** - * Perform a [cluster.getSettings](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/cluster-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.includeDefaults - Whether to return all default clusters setting. - */ -api.cluster.prototype.getSettings = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - }, - includeDefaults: { - type: 'boolean', - 'default': false, - name: 'include_defaults' - } - }, - url: { - fmt: '/_cluster/settings' - } -}); - -/** - * Perform a [cluster.health](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/cluster-health.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} [params.level=cluster] - Specify the level of detail for returned information - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.waitForActiveShards - Wait until the specified number of shards is active - * @param {<>} params.waitForNodes - Wait until the specified number of nodes is available - * @param {<>} params.waitForEvents - Wait until all currently queued events with the given priority are processed - * @param {<>} params.waitForNoRelocatingShards - Whether to wait until there are no relocating shards in the cluster - * @param {<>} params.waitForStatus - Wait until cluster is in a specific state - * @param {<>, <>, <>} params.index - Limit the information returned to a specific index - */ -api.cluster.prototype.health = ca({ - params: { - level: { - type: 'enum', - 'default': 'cluster', - options: [ - 'cluster', - 'indices', - 'shards' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - waitForNodes: { - type: 'string', - name: 'wait_for_nodes' - }, - waitForEvents: { - type: 'enum', - options: [ - 'immediate', - 'urgent', - 'high', - 'normal', - 'low', - 'languid' - ], - name: 'wait_for_events' - }, - waitForNoRelocatingShards: { - type: 'boolean', - name: 'wait_for_no_relocating_shards' - }, - waitForStatus: { - type: 'enum', - 'default': null, - options: [ - 'green', - 'yellow', - 'red' - ], - name: 'wait_for_status' - } - }, - urls: [ - { - fmt: '/_cluster/health/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cluster/health' - } - ] -}); - -/** - * Perform a [cluster.pendingTasks](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/cluster-pending.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Specify timeout for connection to master - */ -api.cluster.prototype.pendingTasks = ca({ - params: { - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_cluster/pending_tasks' - } -}); - -/** - * Perform a [cluster.putSettings](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/cluster-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - */ -api.cluster.prototype.putSettings = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_cluster/settings' - }, - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [cluster.remoteInfo](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/cluster-remote-info.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.cluster.prototype.remoteInfo = ca({ - url: { - fmt: '/_remote/info' - } -}); - -/** - * Perform a [cluster.reroute](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/cluster-reroute.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.dryRun - Simulate the operation only and return the resulting state - * @param {<>} params.explain - Return an explanation of why the commands can or cannot be executed - * @param {<>} params.retryFailed - Retries allocation of shards that are blocked due to too many subsequent allocation failures - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics. Defaults to all but metadata - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - */ -api.cluster.prototype.reroute = ca({ - params: { - dryRun: { - type: 'boolean', - name: 'dry_run' - }, - explain: { - type: 'boolean' - }, - retryFailed: { - type: 'boolean', - name: 'retry_failed' - }, - metric: { - type: 'list', - options: [ - '_all', - 'blocks', - 'metadata', - 'nodes', - 'routing_table', - 'master_node', - 'version' - ] - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_cluster/reroute' - }, - method: 'POST' -}); - -/** - * Perform a [cluster.state](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/cluster-state.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics - */ -api.cluster.prototype.state = ca({ - params: { - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/_cluster/state/<%=metric%>/<%=index%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'blocks', - 'metadata', - 'nodes', - 'routing_table', - 'routing_nodes', - 'master_node', - 'version' - ] - }, - index: { - type: 'list' - } - } - }, - { - fmt: '/_cluster/state/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'blocks', - 'metadata', - 'nodes', - 'routing_table', - 'routing_nodes', - 'master_node', - 'version' - ] - } - } - }, - { - fmt: '/_cluster/state' - } - ] -}); - -/** - * Perform a [cluster.stats](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/cluster-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - */ -api.cluster.prototype.stats = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_cluster/stats/nodes/<%=nodeId%>', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_cluster/stats' - } - ] -}); - -/** - * Perform a [count](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/search-count.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.minScore - Include only documents with a specific `_score` value in the result - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.terminateAfter - The maximum count for each shard, upon reaching which the query execution will terminate early - * @param {<>, <>, <>} params.index - A comma-separated list of indices to restrict the results - * @param {<>, <>, <>} params.type - A comma-separated list of types to restrict the results - */ -api.count = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - minScore: { - type: 'number', - name: 'min_score' - }, - preference: { - type: 'string' - }, - routing: { - type: 'list' - }, - q: { - type: 'string' - }, - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - lenient: { - type: 'boolean' - }, - terminateAfter: { - type: 'number', - name: 'terminate_after' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_count', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_count', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_count' - } - ], - method: 'POST' -}); - -/** - * Perform a [create](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/docs-index_.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.parent - ID of the parent document - * @param {<>} params.refresh - If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.create = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - }, - pipeline: { - type: 'string' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_create', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [delete](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/docs-delete.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the delete operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.parent - ID of parent document - * @param {<>} params.refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api['delete'] = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [deleteByQuery](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/docs-delete-by-query.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.conflicts=abort] - What to do when the delete-by-query hits version conflicts? - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.searchTimeout - Explicit timeout for each search request. Defaults to no timeout. - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the delete by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.scrollSize - Size on the scroll request powering the update_by_query - * @param {<>} [params.waitForCompletion=true] - Should the request should block until the delete-by-query is complete. - * @param {<>} params.requestsPerSecond - The throttle for this request in sub-requests per second. -1 means no throttle. - * @param {<>} [params.slices=1] - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.deleteByQuery = ca({ - params: { - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - from: { - type: 'number' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - conflicts: { - type: 'enum', - 'default': 'abort', - options: [ - 'abort', - 'proceed' - ] - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - lenient: { - type: 'boolean' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'dfs_query_then_fetch' - ], - name: 'search_type' - }, - searchTimeout: { - type: 'time', - name: 'search_timeout' - }, - size: { - type: 'number' - }, - sort: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - terminateAfter: { - type: 'number', - name: 'terminate_after' - }, - stats: { - type: 'list' - }, - version: { - type: 'boolean' - }, - requestCache: { - type: 'boolean', - name: 'request_cache' - }, - refresh: { - type: 'boolean' - }, - timeout: { - type: 'time', - 'default': '1m' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - scrollSize: { - type: 'number', - name: 'scroll_size' - }, - waitForCompletion: { - type: 'boolean', - 'default': true, - name: 'wait_for_completion' - }, - requestsPerSecond: { - type: 'number', - 'default': 0, - name: 'requests_per_second' - }, - slices: { - type: 'number', - 'default': 1 - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_delete_by_query', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_delete_by_query', - req: { - index: { - type: 'list' - } - } - } - ], - needBody: true, - method: 'POST' -}); - -/** - * Perform a [deleteScript](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.id - Script ID - */ -api.deleteScript = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_scripts/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [exists](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document (use `_all` to fetch the first document matching the ID across all types) - */ -api.exists = ca({ - params: { - storedFields: { - type: 'list', - name: 'stored_fields' - }, - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [existsSource](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document; use `_all` to fetch the first document matching the ID across all types - */ -api.existsSource = ca({ - params: { - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_source', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [explain](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/search-explain.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzeWildcard - Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false) - * @param {<>} params.analyzer - The analyzer for the query string query - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The default field for query string query (default: _all) - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.explain = ca({ - params: { - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - analyzer: { - type: 'string' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - storedFields: { - type: 'list', - name: 'stored_fields' - }, - lenient: { - type: 'boolean' - }, - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_explain', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [fieldCaps](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/search-field-caps.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.fields - A comma-separated list of field names - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.fieldCaps = ca({ - params: { - fields: { - type: 'list' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_field_caps', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_field_caps' - } - ], - method: 'POST' -}); - -/** - * Perform a [get](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document (use `_all` to fetch the first document matching the ID across all types) - */ -api.get = ca({ - params: { - storedFields: { - type: 'list', - name: 'stored_fields' - }, - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [getScript](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Script ID - */ -api.getScript = ca({ - url: { - fmt: '/_scripts/<%=id%>', - req: { - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [getSource](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document; use `_all` to fetch the first document matching the ID across all types - */ -api.getSource = ca({ - params: { - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_source', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [index](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/docs-index_.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} [params.opType=index] - Explicit operation type - * @param {<>} params.parent - ID of the parent document - * @param {<>} params.refresh - If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.index = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - opType: { - type: 'enum', - 'default': 'index', - options: [ - 'index', - 'create' - ], - name: 'op_type' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - }, - pipeline: { - type: 'string' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/<%=type%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - } - ], - needBody: true, - method: 'POST' -}); - -api.indices = namespace(); - -/** - * Perform a [indices.analyze](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/indices-analyze.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.index - The name of the index to scope the operation - * @param {<>} params.preferLocal - With `true`, specify that a local shard should be used if available, with `false`, use a random shard (default: true) - * @param {<>} [params.format=detailed] - Format of the output - */ -api.indices.prototype.analyze = ca({ - params: { - index: { - type: 'string' - }, - preferLocal: { - type: 'boolean', - name: 'prefer_local' - }, - format: { - type: 'enum', - 'default': 'detailed', - options: [ - 'detailed', - 'text' - ] - } - }, - urls: [ - { - fmt: '/<%=index%>/_analyze', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_analyze' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.clearCache](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/indices-clearcache.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.fieldData - Clear field data - * @param {<>} params.fielddata - Clear field data - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to clear when using the `field_data` parameter (default: all) - * @param {<>} params.query - Clear query caches - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index name to limit the operation - * @param {<>} params.recycler - Clear the recycler cache - * @param {<>} params.requestCache - Clear request cache - * @param {<>} params.request - Clear request cache - */ -api.indices.prototype.clearCache = ca({ - params: { - fieldData: { - type: 'boolean', - name: 'field_data' - }, - fielddata: { - type: 'boolean' - }, - fields: { - type: 'list' - }, - query: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - index: { - type: 'list' - }, - recycler: { - type: 'boolean' - }, - requestCache: { - type: 'boolean', - name: 'request_cache' - }, - request: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_cache/clear', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cache/clear' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.close](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/indices-open-close.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma separated list of indices to close - */ -api.indices.prototype.close = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - url: { - fmt: '/<%=index%>/_close', - req: { - index: { - type: 'list' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [indices.create](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/indices-create-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for before the operation returns. - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.updateAllTypes - Whether to update the mapping for all fields with the same name across all types or not - * @param {<>} params.index - The name of the index - */ -api.indices.prototype.create = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - updateAllTypes: { - type: 'boolean', - name: 'update_all_types' - } - }, - url: { - fmt: '/<%=index%>', - req: { - index: { - type: 'string' - } - } - }, - method: 'PUT' -}); - -/** - * Perform a [indices.delete](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/indices-delete-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Ignore unavailable indexes (default: false) - * @param {<>} params.allowNoIndices - Ignore if a wildcard expression resolves to no concrete indices (default: false) - * @param {<>} [params.expandWildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (default: open) - * @param {<>, <>, <>} params.index - A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices - */ -api.indices.prototype['delete'] = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - url: { - fmt: '/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [indices.deleteAlias](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit timestamp for the document - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of index names (supports wildcards); use `_all` for all indices - * @param {<>, <>, <>} params.name - A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices. - */ -api.indices.prototype.deleteAlias = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [indices.deleteTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.name - The name of the template - */ -api.indices.prototype.deleteTemplate = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [indices.exists](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/indices-exists.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.ignoreUnavailable - Ignore unavailable indexes (default: false) - * @param {<>} params.allowNoIndices - Ignore if a wildcard expression resolves to no concrete indices (default: false) - * @param {<>} [params.expandWildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (default: open) - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.includeDefaults - Whether to return all default setting for each of the indices. - * @param {<>, <>, <>} params.index - A comma-separated list of index names - */ -api.indices.prototype.exists = ca({ - params: { - local: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - includeDefaults: { - type: 'boolean', - 'default': false, - name: 'include_defaults' - } - }, - url: { - fmt: '/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [indices.existsAlias](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=all] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names to filter aliases - * @param {<>, <>, <>} params.name - A comma-separated list of alias names to return - */ -api.indices.prototype.existsAlias = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'all', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/_alias/<%=name%>', - req: { - name: { - type: 'list' - } - } - } - ], - method: 'HEAD' -}); - -/** - * Perform a [indices.existsTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.name - The comma separated names of the index templates - */ -api.indices.prototype.existsTemplate = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - local: { - type: 'boolean' - } - }, - url: { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [indices.existsType](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/indices-types-exists.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` to check the types across all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to check - */ -api.indices.prototype.existsType = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - url: { - fmt: '/<%=index%>/_mapping/<%=type%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [indices.flush](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/indices-flush.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.force - Whether a flush should be forced even if it is not necessarily needed ie. if no changes will be committed to the index. This is useful if transaction log IDs should be incremented even if no uncommitted changes are present. (This setting can be considered as internal) - * @param {<>} params.waitIfOngoing - If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. The default is true. If set to false the flush will be skipped iff if another flush operation is already running. - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string for all indices - */ -api.indices.prototype.flush = ca({ - params: { - force: { - type: 'boolean' - }, - waitIfOngoing: { - type: 'boolean', - name: 'wait_if_ongoing' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_flush', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_flush' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.flushSynced](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/indices-synced-flush.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string for all indices - */ -api.indices.prototype.flushSynced = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_flush/synced', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_flush/synced' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.forcemerge](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/indices-forcemerge.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flush - Specify whether the index should be flushed after performing the operation (default: true) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.maxNumSegments - The number of segments the index should be merged into (default: dynamic) - * @param {<>} params.onlyExpungeDeletes - Specify whether the operation should only expunge deleted documents - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.waitForMerge - Specify whether the request should block until the merge process is finished (default: true) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.forcemerge = ca({ - params: { - flush: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - maxNumSegments: { - type: 'number', - name: 'max_num_segments' - }, - onlyExpungeDeletes: { - type: 'boolean', - name: 'only_expunge_deletes' - }, - operationThreading: { - name: 'operation_threading' - }, - waitForMerge: { - type: 'boolean', - name: 'wait_for_merge' - } - }, - urls: [ - { - fmt: '/<%=index%>/_forcemerge', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_forcemerge' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.get](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/indices-get-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.ignoreUnavailable - Ignore unavailable indexes (default: false) - * @param {<>} params.allowNoIndices - Ignore if a wildcard expression resolves to no concrete indices (default: false) - * @param {<>} [params.expandWildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (default: open) - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.includeDefaults - Whether to return all default setting for each of the indices. - * @param {<>, <>, <>} params.index - A comma-separated list of index names - */ -api.indices.prototype.get = ca({ - params: { - local: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - includeDefaults: { - type: 'boolean', - 'default': false, - name: 'include_defaults' - } - }, - url: { - fmt: '/<%=index%>', - req: { - index: { - type: 'list' - } - } - } -}); - -/** - * Perform a [indices.getAlias](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=all] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names to filter aliases - * @param {<>, <>, <>} params.name - A comma-separated list of alias names to return - */ -api.indices.prototype.getAlias = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'all', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/_alias/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_alias', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_alias' - } - ] -}); - -/** - * Perform a [indices.getFieldMapping](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/indices-get-field-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.includeDefaults - Whether the default mapping values should be returned as well - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} params.type - A comma-separated list of document types - * @param {<>, <>, <>} params.fields - A comma-separated list of fields - */ -api.indices.prototype.getFieldMapping = ca({ - params: { - includeDefaults: { - type: 'boolean', - name: 'include_defaults' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_mapping/<%=type%>/field/<%=fields%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - }, - fields: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_mapping/field/<%=fields%>', - req: { - index: { - type: 'list' - }, - fields: { - type: 'list' - } - } - }, - { - fmt: '/_mapping/<%=type%>/field/<%=fields%>', - req: { - type: { - type: 'list' - }, - fields: { - type: 'list' - } - } - }, - { - fmt: '/_mapping/field/<%=fields%>', - req: { - fields: { - type: 'list' - } - } - } - ] -}); - -/** - * Perform a [indices.getMapping](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/indices-get-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} params.type - A comma-separated list of document types - */ -api.indices.prototype.getMapping = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_mapping/<%=type%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_mapping', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_mapping/<%=type%>', - req: { - type: { - type: 'list' - } - } - }, - { - fmt: '/_mapping' - } - ] -}); - -/** - * Perform a [indices.getSettings](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/indices-get-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open,closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.includeDefaults - Whether to return all default setting for each of the indices. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.name - The name of the settings that should be included - */ -api.indices.prototype.getSettings = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': [ - 'open', - 'closed' - ], - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - local: { - type: 'boolean' - }, - includeDefaults: { - type: 'boolean', - 'default': false, - name: 'include_defaults' - } - }, - urls: [ - { - fmt: '/<%=index%>/_settings/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_settings', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_settings/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/_settings' - } - ] -}); - -/** - * Perform a [indices.getTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.name - The comma separated names of the index templates - */ -api.indices.prototype.getTemplate = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/_template' - } - ] -}); - -/** - * Perform a [indices.getUpgrade](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/indices-upgrade.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.getUpgrade = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_upgrade', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_upgrade' - } - ] -}); - -/** - * Perform a [indices.open](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/indices-open-close.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.waitForActiveShards - Sets the number of active shards to wait for before the operation returns. - * @param {<>, <>, <>} params.index - A comma separated list of indices to open - */ -api.indices.prototype.open = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'closed', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - } - }, - url: { - fmt: '/<%=index%>/_open', - req: { - index: { - type: 'list' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [indices.putAlias](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit timestamp for the document - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices. - * @param {<>} params.name - The name of the alias to be created or updated - */ -api.indices.prototype.putAlias = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'string' - } - } - }, - method: 'PUT' -}); - -/** - * Perform a [indices.putMapping](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/indices-put-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.updateAllTypes - Whether to update the mapping for all fields with the same name across all types or not - * @param {<>, <>, <>} params.index - A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices. - * @param {<>} params.type - The name of the document type - */ -api.indices.prototype.putMapping = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - updateAllTypes: { - type: 'boolean', - name: 'update_all_types' - } - }, - urls: [ - { - fmt: '/<%=index%>/_mapping/<%=type%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/_mapping/<%=type%>', - req: { - type: { - type: 'string' - } - } - } - ], - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [indices.putSettings](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/indices-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.preserveExisting - Whether to update existing settings. If set to `true` existing settings on an index remain unchanged, the default is `false` - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.putSettings = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - preserveExisting: { - type: 'boolean', - name: 'preserve_existing' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - } - }, - urls: [ - { - fmt: '/<%=index%>/_settings', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_settings' - } - ], - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [indices.putTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.order - The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers) - * @param {<>} params.create - Whether the index template should only be added if new or can also replace an existing one - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.name - The name of the template - */ -api.indices.prototype.putTemplate = ca({ - params: { - order: { - type: 'number' - }, - create: { - type: 'boolean', - 'default': false - }, - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - } - }, - url: { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [indices.recovery](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/indices-recovery.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.detailed - Whether to display detailed information about shard recovery - * @param {<>} params.activeOnly - Display only those recoveries that are currently on-going - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.recovery = ca({ - params: { - detailed: { - type: 'boolean', - 'default': false - }, - activeOnly: { - type: 'boolean', - 'default': false, - name: 'active_only' - } - }, - urls: [ - { - fmt: '/<%=index%>/_recovery', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_recovery' - } - ] -}); - -/** - * Perform a [indices.refresh](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/indices-refresh.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.refresh = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_refresh', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_refresh' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.rollover](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/indices-rollover-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.dryRun - If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for on the newly created rollover index before the operation returns. - * @param {<>} params.alias - The name of the alias to rollover - * @param {<>} params.newIndex - The name of the rollover index - */ -api.indices.prototype.rollover = ca({ - params: { - timeout: { - type: 'time' - }, - dryRun: { - type: 'boolean', - name: 'dry_run' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - } - }, - urls: [ - { - fmt: '/<%=alias%>/_rollover/<%=newIndex%>', - req: { - alias: { - type: 'string' - }, - newIndex: { - type: 'string' - } - } - }, - { - fmt: '/<%=alias%>/_rollover', - req: { - alias: { - type: 'string' - } - } - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.segments](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/indices-segments.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.verbose - Includes detailed memory usage by Lucene. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.segments = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - operationThreading: { - name: 'operation_threading' - }, - verbose: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/<%=index%>/_segments', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_segments' - } - ] -}); - -/** - * Perform a [indices.shardStores](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/indices-shards-stores.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.status - A comma-separated list of statuses used to filter on shards to get store information for - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {anything} params.operationThreading - TODO: ? - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.shardStores = ca({ - params: { - status: { - type: 'list', - options: [ - 'green', - 'yellow', - 'red', - 'all' - ] - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - operationThreading: { - name: 'operation_threading' - } - }, - urls: [ - { - fmt: '/<%=index%>/_shard_stores', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_shard_stores' - } - ] -}); - -/** - * Perform a [indices.shrink](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/indices-shrink-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for on the shrunken index before the operation returns. - * @param {<>} params.index - The name of the source index to shrink - * @param {<>} params.target - The name of the target index to shrink into - */ -api.indices.prototype.shrink = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - } - }, - url: { - fmt: '/<%=index%>/_shrink/<%=target%>', - req: { - index: { - type: 'string' - }, - target: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [indices.split](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/indices-split-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for on the shrunken index before the operation returns. - * @param {<>} params.index - The name of the source index to split - * @param {<>} params.target - The name of the target index to split into - */ -api.indices.prototype.split = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - } - }, - url: { - fmt: '/<%=index%>/_split/<%=target%>', - req: { - index: { - type: 'string' - }, - target: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [indices.stats](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/indices-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.completionFields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields for `fielddata` index metric (supports wildcards) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) - * @param {<>, <>, <>} params.groups - A comma-separated list of search groups for `search` index metric - * @param {<>} [params.level=indices] - Return stats aggregated at cluster, index or shard level - * @param {<>, <>, <>} params.types - A comma-separated list of document types for the `indexing` index metric - * @param {<>} params.includeSegmentFileSizes - Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.metric - Limit the information returned the specific metrics. - */ -api.indices.prototype.stats = ca({ - params: { - completionFields: { - type: 'list', - name: 'completion_fields' - }, - fielddataFields: { - type: 'list', - name: 'fielddata_fields' - }, - fields: { - type: 'list' - }, - groups: { - type: 'list' - }, - level: { - type: 'enum', - 'default': 'indices', - options: [ - 'cluster', - 'indices', - 'shards' - ] - }, - types: { - type: 'list' - }, - includeSegmentFileSizes: { - type: 'boolean', - 'default': false, - name: 'include_segment_file_sizes' - } - }, - urls: [ - { - fmt: '/<%=index%>/_stats/<%=metric%>', - req: { - index: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/_stats/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/<%=index%>/_stats', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_stats' - } - ] -}); - -/** - * Perform a [indices.updateAliases](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Request timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - */ -api.indices.prototype.updateAliases = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_aliases' - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [indices.upgrade](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/indices-upgrade.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.waitForCompletion - Specify whether the request should block until the all segments are upgraded (default: false) - * @param {<>} params.onlyAncientSegments - If true, only ancient (an older Lucene major release) segments will be upgraded - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.upgrade = ca({ - params: { - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - waitForCompletion: { - type: 'boolean', - name: 'wait_for_completion' - }, - onlyAncientSegments: { - type: 'boolean', - name: 'only_ancient_segments' - } - }, - urls: [ - { - fmt: '/<%=index%>/_upgrade', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_upgrade' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.validateQuery](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/search-validate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.explain - Return detailed information about the error - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {anything} params.operationThreading - TODO: ? - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.rewrite - Provide a more detailed explanation showing the actual Lucene query that will be executed. - * @param {<>} params.allShards - Execute validation on all shards instead of one random shard per index - * @param {<>, <>, <>} params.index - A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to restrict the operation; leave empty to perform the operation on all types - */ -api.indices.prototype.validateQuery = ca({ - params: { - explain: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - operationThreading: { - name: 'operation_threading' - }, - q: { - type: 'string' - }, - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - lenient: { - type: 'boolean' - }, - rewrite: { - type: 'boolean' - }, - allShards: { - type: 'boolean', - name: 'all_shards' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_validate/query', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_validate/query', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_validate/query' - } - ], - method: 'POST' -}); - -/** - * Perform a [info](http://www.elastic.co/guide/) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.info = ca({ - url: { - fmt: '/' - } -}); - -api.ingest = namespace(); - -/** - * Perform a [ingest.deletePipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/6.1/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.id - Pipeline ID - */ -api.ingest.prototype.deletePipeline = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_ingest/pipeline/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [ingest.getPipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/6.1/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.id - Comma separated list of pipeline ids. Wildcards supported - */ -api.ingest.prototype.getPipeline = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - urls: [ - { - fmt: '/_ingest/pipeline/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - { - fmt: '/_ingest/pipeline' - } - ] -}); - -/** - * Perform a [ingest.processorGrok](https://www.elastic.co/guide/en/elasticsearch/plugins/6.1/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.ingest.prototype.processorGrok = ca({ - url: { - fmt: '/_ingest/processor/grok' - } -}); - -/** - * Perform a [ingest.putPipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/6.1/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.id - Pipeline ID - */ -api.ingest.prototype.putPipeline = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_ingest/pipeline/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [ingest.simulate](https://www.elastic.co/guide/en/elasticsearch/plugins/6.1/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.verbose - Verbose mode. Display data output for each processor in executed pipeline - * @param {<>} params.id - Pipeline ID - */ -api.ingest.prototype.simulate = ca({ - params: { - verbose: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_ingest/pipeline/<%=id%>/_simulate', - req: { - id: { - type: 'string' - } - } - }, - { - fmt: '/_ingest/pipeline/_simulate' - } - ], - needBody: true, - method: 'POST' -}); - -/** - * Perform a [mget](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/docs-multi-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.mget = ca({ - params: { - storedFields: { - type: 'list', - name: 'stored_fields' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_mget', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_mget', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_mget' - } - ], - needBody: true, - method: 'POST' -}); - -/** - * Perform a [msearch](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/search-multi-search.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.searchType - Search operation type - * @param {<>} params.maxConcurrentSearches - Controls the maximum number of concurrent searches the multi search api will execute - * @param {<>} params.typedKeys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response - * @param {<>} [params.preFilterShardSize=128] - A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on it's rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to use as default - * @param {<>, <>, <>} params.type - A comma-separated list of document types to use as default - */ -api.msearch = ca({ - params: { - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'query_and_fetch', - 'dfs_query_then_fetch', - 'dfs_query_and_fetch' - ], - name: 'search_type' - }, - maxConcurrentSearches: { - type: 'number', - name: 'max_concurrent_searches' - }, - typedKeys: { - type: 'boolean', - name: 'typed_keys' - }, - preFilterShardSize: { - type: 'number', - 'default': 128, - name: 'pre_filter_shard_size' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_msearch', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_msearch', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_msearch' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -/** - * Perform a [msearchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/search-multi-search.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.searchType - Search operation type - * @param {<>} params.typedKeys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response - * @param {<>} params.maxConcurrentSearches - Controls the maximum number of concurrent searches the multi search api will execute - * @param {<>, <>, <>} params.index - A comma-separated list of index names to use as default - * @param {<>, <>, <>} params.type - A comma-separated list of document types to use as default - */ -api.msearchTemplate = ca({ - params: { - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'query_and_fetch', - 'dfs_query_then_fetch', - 'dfs_query_and_fetch' - ], - name: 'search_type' - }, - typedKeys: { - type: 'boolean', - name: 'typed_keys' - }, - maxConcurrentSearches: { - type: 'number', - name: 'max_concurrent_searches' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_msearch/template', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_msearch/template', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_msearch/template' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -/** - * Perform a [mtermvectors](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/docs-multi-termvectors.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.ids - A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body - * @param {<>} params.termStatistics - Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.fieldStatistics=true] - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.offsets=true] - Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.positions=true] - Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.payloads=true] - Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) .Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.routing - Specific routing value. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.parent - Parent id of documents. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.realtime - Specifies if requests are real-time as opposed to near-real-time (default: true). - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index in which the document resides. - * @param {<>} params.type - The type of the document. - */ -api.mtermvectors = ca({ - params: { - ids: { - type: 'list', - required: false - }, - termStatistics: { - type: 'boolean', - 'default': false, - required: false, - name: 'term_statistics' - }, - fieldStatistics: { - type: 'boolean', - 'default': true, - required: false, - name: 'field_statistics' - }, - fields: { - type: 'list', - required: false - }, - offsets: { - type: 'boolean', - 'default': true, - required: false - }, - positions: { - type: 'boolean', - 'default': true, - required: false - }, - payloads: { - type: 'boolean', - 'default': true, - required: false - }, - preference: { - type: 'string', - required: false - }, - routing: { - type: 'string', - required: false - }, - parent: { - type: 'string', - required: false - }, - realtime: { - type: 'boolean', - required: false - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_mtermvectors', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_mtermvectors', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_mtermvectors' - } - ], - method: 'POST' -}); - -api.nodes = namespace(); - -/** - * Perform a [nodes.hotThreads](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/cluster-nodes-hot-threads.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.interval - The interval for the second sampling of threads - * @param {<>} params.snapshots - Number of samples of thread stacktrace (default: 10) - * @param {<>} params.threads - Specify the number of threads to provide information for (default: 3) - * @param {<>} params.ignoreIdleThreads - Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue (default: true) - * @param {<>} params.type - The type to sample (default: cpu) - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - */ -api.nodes.prototype.hotThreads = ca({ - params: { - interval: { - type: 'time' - }, - snapshots: { - type: 'number' - }, - threads: { - type: 'number' - }, - ignoreIdleThreads: { - type: 'boolean', - name: 'ignore_idle_threads' - }, - type: { - type: 'enum', - options: [ - 'cpu', - 'wait', - 'block' - ] - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_nodes/<%=nodeId%>/hotthreads', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_nodes/hotthreads' - } - ] -}); - -/** - * Perform a [nodes.info](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/cluster-nodes-info.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.metric - A comma-separated list of metrics you wish returned. Leave empty to return all. - */ -api.nodes.prototype.info = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_nodes/<%=nodeId%>/<%=metric%>', - req: { - nodeId: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - 'settings', - 'os', - 'process', - 'jvm', - 'thread_pool', - 'transport', - 'http', - 'plugins', - 'ingest' - ] - } - } - }, - { - fmt: '/_nodes/<%=nodeId%>', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_nodes/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - 'settings', - 'os', - 'process', - 'jvm', - 'thread_pool', - 'transport', - 'http', - 'plugins', - 'ingest' - ] - } - } - }, - { - fmt: '/_nodes' - } - ] -}); - -/** - * Perform a [nodes.stats](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/cluster-nodes-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.completionFields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields for `fielddata` index metric (supports wildcards) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) - * @param {<>} params.groups - A comma-separated list of search groups for `search` index metric - * @param {<>} [params.level=node] - Return indices stats aggregated at index, node or shard level - * @param {<>, <>, <>} params.types - A comma-separated list of document types for the `indexing` index metric - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.includeSegmentFileSizes - Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics - * @param {<>, <>, <>} params.indexMetric - Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified. - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - */ -api.nodes.prototype.stats = ca({ - params: { - completionFields: { - type: 'list', - name: 'completion_fields' - }, - fielddataFields: { - type: 'list', - name: 'fielddata_fields' - }, - fields: { - type: 'list' - }, - groups: { - type: 'boolean' - }, - level: { - type: 'enum', - 'default': 'node', - options: [ - 'indices', - 'node', - 'shards' - ] - }, - types: { - type: 'list' - }, - timeout: { - type: 'time' - }, - includeSegmentFileSizes: { - type: 'boolean', - 'default': false, - name: 'include_segment_file_sizes' - } - }, - urls: [ - { - fmt: '/_nodes/<%=nodeId%>/stats/<%=metric%>/<%=indexMetric%>', - req: { - nodeId: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport', - 'discovery' - ] - }, - indexMetric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/_nodes/<%=nodeId%>/stats/<%=metric%>', - req: { - nodeId: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport', - 'discovery' - ] - } - } - }, - { - fmt: '/_nodes/stats/<%=metric%>/<%=indexMetric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport', - 'discovery' - ] - }, - indexMetric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/_nodes/<%=nodeId%>/stats', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_nodes/stats/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport', - 'discovery' - ] - } - } - }, - { - fmt: '/_nodes/stats' - } - ] -}); - -/** - * Perform a [nodes.usage](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/cluster-nodes-usage.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.human - Whether to return time and byte values in human-readable format. - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - */ -api.nodes.prototype.usage = ca({ - params: { - human: { - type: 'boolean', - 'default': false - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_nodes/<%=nodeId%>/usage/<%=metric%>', - req: { - nodeId: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - '_all', - 'rest_actions' - ] - } - } - }, - { - fmt: '/_nodes/<%=nodeId%>/usage', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_nodes/usage/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'rest_actions' - ] - } - } - }, - { - fmt: '/_nodes/usage' - } - ] -}); - -/** - * Perform a [ping](http://www.elastic.co/guide/) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.ping = ca({ - url: { - fmt: '/' - }, - requestTimeout: 3000, - method: 'HEAD' -}); - -/** - * Perform a [putScript](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.context - Script context - * @param {<>} params.id - Script ID - */ -api.putScript = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - context: { - type: 'string' - } - }, - urls: [ - { - fmt: '/_scripts/<%=id%>/<%=context%>', - req: { - id: { - type: 'string' - }, - context: { - type: 'string' - } - } - }, - { - fmt: '/_scripts/<%=id%>', - req: { - id: { - type: 'string' - } - } - } - ], - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [reindex](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/docs-reindex.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the reindex operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} [params.waitForCompletion=true] - Should the request should block until the reindex is complete. - * @param {<>} params.requestsPerSecond - The throttle to set on this request in sub-requests per second. -1 means no throttle. - * @param {<>} [params.slices=1] - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. - */ -api.reindex = ca({ - params: { - refresh: { - type: 'boolean' - }, - timeout: { - type: 'time', - 'default': '1m' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - waitForCompletion: { - type: 'boolean', - 'default': true, - name: 'wait_for_completion' - }, - requestsPerSecond: { - type: 'number', - 'default': 0, - name: 'requests_per_second' - }, - slices: { - type: 'number', - 'default': 1 - } - }, - url: { - fmt: '/_reindex' - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [reindexRethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/docs-reindex.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.requestsPerSecond - The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. - * @param {<>} params.taskId - The task id to rethrottle - */ -api.reindexRethrottle = ca({ - params: { - requestsPerSecond: { - type: 'number', - required: true, - name: 'requests_per_second' - } - }, - url: { - fmt: '/_reindex/<%=taskId%>/_rethrottle', - req: { - taskId: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [renderSearchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - The id of the stored search template - */ -api.renderSearchTemplate = ca({ - urls: [ - { - fmt: '/_render/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - { - fmt: '/_render/template' - } - ], - method: 'POST' -}); - -/** - * Perform a [scroll](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/search-request-scroll.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.scrollId - The scroll ID - */ -api.scroll = ca({ - params: { - scroll: { - type: 'time' - }, - scrollId: { - type: 'string', - name: 'scroll_id' - } - }, - urls: [ - { - fmt: '/_search/scroll/<%=scrollId%>', - req: { - scrollId: { - type: 'string' - } - } - }, - { - fmt: '/_search/scroll' - } - ], - paramAsBody: { - param: 'scrollId', - body: 'scroll_id' - }, - method: 'POST' -}); - -/** - * Perform a [search](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/search-search.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.explain - Specify whether to return detailed information about score computation as part of a hit - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return as part of a hit - * @param {<>, <>, <>} params.docvalueFields - A comma-separated list of fields to return as the docvalue representation of a field for each hit - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.suggestField - Specify which field to use for suggestions - * @param {<>} [params.suggestMode=missing] - Specify suggest mode - * @param {<>} params.suggestSize - How many suggestions to return in response - * @param {<>} params.suggestText - The source text for which the suggestions should be returned - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.trackScores - Whether to calculate and return scores even if they are not used for sorting - * @param {<>} params.trackTotalHits - Indicate if the number of documents that match the query should be tracked - * @param {<>} params.typedKeys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>} [params.batchedReduceSize=512] - The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large. - * @param {<>} [params.maxConcurrentShardRequests=The default grows with the number of nodes in the cluster but is at most 256.] - The number of concurrent shard requests this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests - * @param {<>} [params.preFilterShardSize=128] - A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on it's rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.search = ca({ - params: { - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - explain: { - type: 'boolean' - }, - storedFields: { - type: 'list', - name: 'stored_fields' - }, - docvalueFields: { - type: 'list', - name: 'docvalue_fields' - }, - from: { - type: 'number' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - lenient: { - type: 'boolean' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'dfs_query_then_fetch' - ], - name: 'search_type' - }, - size: { - type: 'number' - }, - sort: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - terminateAfter: { - type: 'number', - name: 'terminate_after' - }, - stats: { - type: 'list' - }, - suggestField: { - type: 'string', - name: 'suggest_field' - }, - suggestMode: { - type: 'enum', - 'default': 'missing', - options: [ - 'missing', - 'popular', - 'always' - ], - name: 'suggest_mode' - }, - suggestSize: { - type: 'number', - name: 'suggest_size' - }, - suggestText: { - type: 'string', - name: 'suggest_text' - }, - timeout: { - type: 'time' - }, - trackScores: { - type: 'boolean', - name: 'track_scores' - }, - trackTotalHits: { - type: 'boolean', - name: 'track_total_hits' - }, - typedKeys: { - type: 'boolean', - name: 'typed_keys' - }, - version: { - type: 'boolean' - }, - requestCache: { - type: 'boolean', - name: 'request_cache' - }, - batchedReduceSize: { - type: 'number', - 'default': 512, - name: 'batched_reduce_size' - }, - maxConcurrentShardRequests: { - type: 'number', - 'default': 'The default grows with the number of nodes in the cluster but is at most 256.', - name: 'max_concurrent_shard_requests' - }, - preFilterShardSize: { - type: 'number', - 'default': 128, - name: 'pre_filter_shard_size' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_search', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_search', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_search' - } - ], - method: 'POST' -}); - -/** - * Perform a [searchShards](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/search-shards.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - */ -api.searchShards = ca({ - params: { - preference: { - type: 'string' - }, - routing: { - type: 'string' - }, - local: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_search_shards', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_search_shards' - } - ], - method: 'POST' -}); - -/** - * Perform a [searchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.explain - Specify whether to return detailed information about score computation as part of a hit - * @param {<>} params.profile - Specify whether to profile the query execution - * @param {<>} params.typedKeys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.searchTemplate = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - preference: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'query_and_fetch', - 'dfs_query_then_fetch', - 'dfs_query_and_fetch' - ], - name: 'search_type' - }, - explain: { - type: 'boolean' - }, - profile: { - type: 'boolean' - }, - typedKeys: { - type: 'boolean', - name: 'typed_keys' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_search/template', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_search/template', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_search/template' - } - ], - needBody: true, - method: 'POST' -}); - -api.snapshot = namespace(); - -/** - * Perform a [snapshot.create](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.waitForCompletion - Should this request wait until the operation has completed before returning - * @param {<>} params.repository - A repository name - * @param {<>} params.snapshot - A snapshot name - */ -api.snapshot.prototype.create = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForCompletion: { - type: 'boolean', - 'default': false, - name: 'wait_for_completion' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [snapshot.createRepository](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.verify - Whether to verify the repository after creation - * @param {<>} params.repository - A repository name - */ -api.snapshot.prototype.createRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - }, - verify: { - type: 'boolean' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>', - req: { - repository: { - type: 'string' - } - } - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [snapshot.delete](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.repository - A repository name - * @param {<>} params.snapshot - A snapshot name - */ -api.snapshot.prototype['delete'] = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [snapshot.deleteRepository](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.repository - A comma-separated list of repository names - */ -api.snapshot.prototype.deleteRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>', - req: { - repository: { - type: 'list' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [snapshot.get](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.ignoreUnavailable - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown - * @param {<>} params.verbose - Whether to show verbose snapshot info or only show the basic info found in the repository index blob - * @param {<>} params.repository - A repository name - * @param {<>, <>, <>} params.snapshot - A comma-separated list of snapshot names - */ -api.snapshot.prototype.get = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - verbose: { - type: 'boolean' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'list' - } - } - } -}); - -/** - * Perform a [snapshot.getRepository](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.repository - A comma-separated list of repository names - */ -api.snapshot.prototype.getRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/_snapshot/<%=repository%>', - req: { - repository: { - type: 'list' - } - } - }, - { - fmt: '/_snapshot' - } - ] -}); - -/** - * Perform a [snapshot.restore](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.waitForCompletion - Should this request wait until the operation has completed before returning - * @param {<>} params.repository - A repository name - * @param {<>} params.snapshot - A snapshot name - */ -api.snapshot.prototype.restore = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForCompletion: { - type: 'boolean', - 'default': false, - name: 'wait_for_completion' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>/_restore', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [snapshot.status](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.ignoreUnavailable - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown - * @param {<>} params.repository - A repository name - * @param {<>, <>, <>} params.snapshot - A comma-separated list of snapshot names - */ -api.snapshot.prototype.status = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - } - }, - urls: [ - { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>/_status', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'list' - } - } - }, - { - fmt: '/_snapshot/<%=repository%>/_status', - req: { - repository: { - type: 'string' - } - } - }, - { - fmt: '/_snapshot/_status' - } - ] -}); - -/** - * Perform a [snapshot.verifyRepository](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.repository - A repository name - */ -api.snapshot.prototype.verifyRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/_verify', - req: { - repository: { - type: 'string' - } - } - }, - method: 'POST' -}); - -api.tasks = namespace(); - -/** - * Perform a [tasks.cancel](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.nodes - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.actions - A comma-separated list of actions that should be cancelled. Leave empty to cancel all. - * @param {<>} params.parentNode - Cancel tasks with specified parent node. - * @param {<>} params.parentTaskId - Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all. - * @param {<>} params.taskId - Cancel the task with specified task id (node_id:task_number) - */ -api.tasks.prototype.cancel = ca({ - params: { - nodes: { - type: 'list' - }, - actions: { - type: 'list' - }, - parentNode: { - type: 'string', - name: 'parent_node' - }, - parentTaskId: { - type: 'string', - name: 'parent_task_id' - } - }, - urls: [ - { - fmt: '/_tasks/<%=taskId%>/_cancel', - req: { - taskId: { - type: 'string' - } - } - }, - { - fmt: '/_tasks/_cancel' - } - ], - method: 'POST' -}); - -/** - * Perform a [tasks.get](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForCompletion - Wait for the matching tasks to complete (default: false) - * @param {<>} params.taskId - Return the task with specified id (node_id:task_number) - */ -api.tasks.prototype.get = ca({ - params: { - waitForCompletion: { - type: 'boolean', - name: 'wait_for_completion' - } - }, - url: { - fmt: '/_tasks/<%=taskId%>', - req: { - taskId: { - type: 'string' - } - } - } -}); - -/** - * Perform a [tasks.list](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.nodes - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.actions - A comma-separated list of actions that should be returned. Leave empty to return all. - * @param {<>} params.detailed - Return detailed task information (default: false) - * @param {<>} params.parentNode - Return tasks with specified parent node. - * @param {<>} params.parentTaskId - Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all. - * @param {<>} params.waitForCompletion - Wait for the matching tasks to complete (default: false) - * @param {<>} [params.groupBy=nodes] - Group tasks by nodes or parent/child relationships - */ -api.tasks.prototype.list = ca({ - params: { - nodes: { - type: 'list' - }, - actions: { - type: 'list' - }, - detailed: { - type: 'boolean' - }, - parentNode: { - type: 'string', - name: 'parent_node' - }, - parentTaskId: { - type: 'string', - name: 'parent_task_id' - }, - waitForCompletion: { - type: 'boolean', - name: 'wait_for_completion' - }, - groupBy: { - type: 'enum', - 'default': 'nodes', - options: [ - 'nodes', - 'parents' - ], - name: 'group_by' - } - }, - url: { - fmt: '/_tasks' - } -}); - -/** - * Perform a [termvectors](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/docs-termvectors.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.termStatistics - Specifies if total term frequency and document frequency should be returned. - * @param {<>} [params.fieldStatistics=true] - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return. - * @param {<>} [params.offsets=true] - Specifies if term offsets should be returned. - * @param {<>} [params.positions=true] - Specifies if term positions should be returned. - * @param {<>} [params.payloads=true] - Specifies if term payloads should be returned. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random). - * @param {<>} params.routing - Specific routing value. - * @param {<>} params.parent - Parent id of documents. - * @param {<>} params.realtime - Specifies if request is real-time as opposed to near-real-time (default: true). - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index in which the document resides. - * @param {<>} params.type - The type of the document. - * @param {<>} params.id - The id of the document, when not specified a doc param should be supplied. - */ -api.termvectors = ca({ - params: { - termStatistics: { - type: 'boolean', - 'default': false, - required: false, - name: 'term_statistics' - }, - fieldStatistics: { - type: 'boolean', - 'default': true, - required: false, - name: 'field_statistics' - }, - fields: { - type: 'list', - required: false - }, - offsets: { - type: 'boolean', - 'default': true, - required: false - }, - positions: { - type: 'boolean', - 'default': true, - required: false - }, - payloads: { - type: 'boolean', - 'default': true, - required: false - }, - preference: { - type: 'string', - required: false - }, - routing: { - type: 'string', - required: false - }, - parent: { - type: 'string', - required: false - }, - realtime: { - type: 'boolean', - required: false - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_termvectors', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/<%=type%>/_termvectors', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - } - ], - method: 'POST' -}); - -/** - * Perform a [update](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/docs-update.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the update operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return in the response - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.lang - The script language (default: painless) - * @param {<>} params.parent - ID of the parent document. Is is only used for routing and when for the upsert request - * @param {<>} params.refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.retryOnConflict - Specify how many times should the operation be retried when a conflict occurs (default: 0) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.update = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - fields: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - lang: { - type: 'string' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - retryOnConflict: { - type: 'number', - name: 'retry_on_conflict' - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_update', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [updateByQuery](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/docs-update-by-query.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.conflicts=abort] - What to do when the update by query hits version conflicts? - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.pipeline - Ingest pipeline to set on index requests made by this action. (default: none) - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.searchTimeout - Explicit timeout for each search request. Defaults to no timeout. - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.versionType - Should the document increment the version number (internal) on hit or not (reindex) - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the update by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.scrollSize - Size on the scroll request powering the update_by_query - * @param {<>} [params.waitForCompletion=true] - Should the request should block until the update by query operation is complete. - * @param {<>} params.requestsPerSecond - The throttle to set on this request in sub-requests per second. -1 means no throttle. - * @param {<>} [params.slices=1] - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.updateByQuery = ca({ - params: { - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - from: { - type: 'number' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - conflicts: { - type: 'enum', - 'default': 'abort', - options: [ - 'abort', - 'proceed' - ] - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - lenient: { - type: 'boolean' - }, - pipeline: { - type: 'string' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'dfs_query_then_fetch' - ], - name: 'search_type' - }, - searchTimeout: { - type: 'time', - name: 'search_timeout' - }, - size: { - type: 'number' - }, - sort: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - terminateAfter: { - type: 'number', - name: 'terminate_after' - }, - stats: { - type: 'list' - }, - version: { - type: 'boolean' - }, - versionType: { - type: 'boolean', - name: 'version_type' - }, - requestCache: { - type: 'boolean', - name: 'request_cache' - }, - refresh: { - type: 'boolean' - }, - timeout: { - type: 'time', - 'default': '1m' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - scrollSize: { - type: 'number', - name: 'scroll_size' - }, - waitForCompletion: { - type: 'boolean', - 'default': true, - name: 'wait_for_completion' - }, - requestsPerSecond: { - type: 'number', - 'default': 0, - name: 'requests_per_second' - }, - slices: { - type: 'number', - 'default': 1 - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_update_by_query', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_update_by_query', - req: { - index: { - type: 'list' - } - } - } - ], - method: 'POST' -}); diff --git a/src/lib/apis/6_x.js b/src/lib/apis/6_x.js deleted file mode 100644 index 2a2e75f3b..000000000 --- a/src/lib/apis/6_x.js +++ /dev/null @@ -1,7027 +0,0 @@ -var ca = require('../client_action').makeFactoryWithModifier(function (spec) { - return require('../utils').merge(spec, { - params: { - filterPath: { - type: 'list', - name: 'filter_path' - } - } - }); -}); -var namespace = require('../client_action').namespaceFactory; -var api = module.exports = {}; - -api._namespaces = ['cat', 'cluster', 'indices', 'ingest', 'nodes', 'snapshot', 'tasks']; - -/** - * Perform a [bulk](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/docs-bulk.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the bulk operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.type - Default document type for items which don't provide one - * @param {<>, <>, <>} params.fields - Default comma-separated list of fields to return in the response for updates, can be overridden on each sub-request - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request - * @param {<>, <>, <>} params._sourceExclude - Default list of fields to exclude from the returned _source field, can be overridden on each sub-request - * @param {<>, <>, <>} params._sourceInclude - Default list of fields to extract and return from the _source field, can be overridden on each sub-request - * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with - * @param {<>} params.index - Default index for items which don't provide one - */ -api.bulk = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - type: { - type: 'string' - }, - fields: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - pipeline: { - type: 'string' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_bulk', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_bulk', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_bulk' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -api.cat = namespace(); - -/** - * Perform a [cat.aliases](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cat.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.name - A comma-separated list of alias names to return - */ -api.cat.prototype.aliases = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/aliases/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/_cat/aliases' - } - ] -}); - -/** - * Perform a [cat.allocation](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cat-allocation.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information - */ -api.cat.prototype.allocation = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'kb', - 'm', - 'mb', - 'g', - 'gb', - 't', - 'tb', - 'p', - 'pb' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/allocation/<%=nodeId%>', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_cat/allocation' - } - ] -}); - -/** - * Perform a [cat.count](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cat-count.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.count = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/count/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/count' - } - ] -}); - -/** - * Perform a [cat.fielddata](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cat-fielddata.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return the fielddata size - */ -api.cat.prototype.fielddata = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'kb', - 'm', - 'mb', - 'g', - 'gb', - 't', - 'tb', - 'p', - 'pb' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - }, - fields: { - type: 'list' - } - }, - urls: [ - { - fmt: '/_cat/fielddata/<%=fields%>', - req: { - fields: { - type: 'list' - } - } - }, - { - fmt: '/_cat/fielddata' - } - ] -}); - -/** - * Perform a [cat.health](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cat-health.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} [params.ts=true] - Set to false to disable timestamping - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.health = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - ts: { - type: 'boolean', - 'default': true - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/health' - } -}); - -/** - * Perform a [cat.help](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cat.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - */ -api.cat.prototype.help = ca({ - params: { - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - } - }, - url: { - fmt: '/_cat' - } -}); - -/** - * Perform a [cat.indices](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cat-indices.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.health - A health status ("green", "yellow", or "red" to filter only indices matching the specified health status - * @param {<>} params.help - Return help information - * @param {<>} params.pri - Set to true to return stats only for primary shards - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.indices = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'm', - 'g' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - health: { - type: 'enum', - 'default': null, - options: [ - 'green', - 'yellow', - 'red' - ] - }, - help: { - type: 'boolean', - 'default': false - }, - pri: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/indices/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/indices' - } - ] -}); - -/** - * Perform a [cat.master](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cat-master.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.master = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/master' - } -}); - -/** - * Perform a [cat.nodeattrs](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cat-nodeattrs.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.nodeattrs = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/nodeattrs' - } -}); - -/** - * Perform a [cat.nodes](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cat-nodes.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.fullId - Return the full node ID instead of the shortened version (default: false) - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.nodes = ca({ - params: { - format: { - type: 'string' - }, - fullId: { - type: 'boolean', - name: 'full_id' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/nodes' - } -}); - -/** - * Perform a [cat.pendingTasks](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cat-pending-tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.pendingTasks = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/pending_tasks' - } -}); - -/** - * Perform a [cat.plugins](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cat-plugins.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.plugins = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/plugins' - } -}); - -/** - * Perform a [cat.recovery](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cat-recovery.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.recovery = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'kb', - 'm', - 'mb', - 'g', - 'gb', - 't', - 'tb', - 'p', - 'pb' - ] - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/recovery/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/recovery' - } - ] -}); - -/** - * Perform a [cat.repositories](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cat-repositories.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.repositories = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean', - 'default': false - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/repositories' - } -}); - -/** - * Perform a [cat.segments](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cat-segments.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.segments = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'kb', - 'm', - 'mb', - 'g', - 'gb', - 't', - 'tb', - 'p', - 'pb' - ] - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/segments/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/segments' - } - ] -}); - -/** - * Perform a [cat.shards](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cat-shards.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.shards = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'kb', - 'm', - 'mb', - 'g', - 'gb', - 't', - 'tb', - 'p', - 'pb' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/shards/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/shards' - } - ] -}); - -/** - * Perform a [cat.snapshots](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cat-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.ignoreUnavailable - Set to true to ignore unavailable snapshots - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.repository - Name of repository from which to fetch the snapshot information - */ -api.cat.prototype.snapshots = ca({ - params: { - format: { - type: 'string' - }, - ignoreUnavailable: { - type: 'boolean', - 'default': false, - name: 'ignore_unavailable' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/snapshots/<%=repository%>', - req: { - repository: { - type: 'list' - } - } - }, - { - fmt: '/_cat/snapshots' - } - ] -}); - -/** - * Perform a [cat.tasks](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.actions - A comma-separated list of actions that should be returned. Leave empty to return all. - * @param {<>} params.detailed - Return detailed task information (default: false) - * @param {<>} params.parentTask - Return tasks with specified parent task id. Set to -1 to return all. - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.tasks = ca({ - params: { - format: { - type: 'string' - }, - nodeId: { - type: 'list', - name: 'node_id' - }, - actions: { - type: 'list' - }, - detailed: { - type: 'boolean' - }, - parentTask: { - type: 'number', - name: 'parent_task' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/tasks' - } -}); - -/** - * Perform a [cat.templates](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cat-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>} params.name - A pattern that returned template names must match - */ -api.cat.prototype.templates = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/templates/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - { - fmt: '/_cat/templates' - } - ] -}); - -/** - * Perform a [cat.threadPool](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cat-thread-pool.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.size - The multiplier in which to display values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.threadPoolPatterns - A comma-separated list of regular-expressions to filter the thread pools in the output - */ -api.cat.prototype.threadPool = ca({ - params: { - format: { - type: 'string' - }, - size: { - type: 'enum', - options: [ - '', - 'k', - 'm', - 'g', - 't', - 'p' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/thread_pool/<%=threadPoolPatterns%>', - req: { - threadPoolPatterns: { - type: 'list' - } - } - }, - { - fmt: '/_cat/thread_pool' - } - ] -}); - -/** - * Perform a [clearScroll](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/search-request-scroll.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.scrollId - A comma-separated list of scroll IDs to clear - */ -api.clearScroll = ca({ - urls: [ - { - fmt: '/_search/scroll/<%=scrollId%>', - req: { - scrollId: { - type: 'list' - } - } - }, - { - fmt: '/_search/scroll' - } - ], - paramAsBody: { - param: 'scrollId', - body: 'scroll_id' - }, - method: 'DELETE' -}); - -api.cluster = namespace(); - -/** - * Perform a [cluster.allocationExplain](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cluster-allocation-explain.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.includeYesDecisions - Return 'YES' decisions in explanation (default: false) - * @param {<>} params.includeDiskInfo - Return information about disk usage and shard sizes (default: false) - */ -api.cluster.prototype.allocationExplain = ca({ - params: { - includeYesDecisions: { - type: 'boolean', - name: 'include_yes_decisions' - }, - includeDiskInfo: { - type: 'boolean', - name: 'include_disk_info' - } - }, - url: { - fmt: '/_cluster/allocation/explain' - }, - method: 'POST' -}); - -/** - * Perform a [cluster.getSettings](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cluster-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.includeDefaults - Whether to return all default clusters setting. - */ -api.cluster.prototype.getSettings = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - }, - includeDefaults: { - type: 'boolean', - 'default': false, - name: 'include_defaults' - } - }, - url: { - fmt: '/_cluster/settings' - } -}); - -/** - * Perform a [cluster.health](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cluster-health.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} [params.level=cluster] - Specify the level of detail for returned information - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.waitForActiveShards - Wait until the specified number of shards is active - * @param {<>} params.waitForNodes - Wait until the specified number of nodes is available - * @param {<>} params.waitForEvents - Wait until all currently queued events with the given priority are processed - * @param {<>} params.waitForNoRelocatingShards - Whether to wait until there are no relocating shards in the cluster - * @param {<>} params.waitForNoInitializingShards - Whether to wait until there are no initializing shards in the cluster - * @param {<>} params.waitForStatus - Wait until cluster is in a specific state - * @param {<>, <>, <>} params.index - Limit the information returned to a specific index - */ -api.cluster.prototype.health = ca({ - params: { - level: { - type: 'enum', - 'default': 'cluster', - options: [ - 'cluster', - 'indices', - 'shards' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - waitForNodes: { - type: 'string', - name: 'wait_for_nodes' - }, - waitForEvents: { - type: 'enum', - options: [ - 'immediate', - 'urgent', - 'high', - 'normal', - 'low', - 'languid' - ], - name: 'wait_for_events' - }, - waitForNoRelocatingShards: { - type: 'boolean', - name: 'wait_for_no_relocating_shards' - }, - waitForNoInitializingShards: { - type: 'boolean', - name: 'wait_for_no_initializing_shards' - }, - waitForStatus: { - type: 'enum', - 'default': null, - options: [ - 'green', - 'yellow', - 'red' - ], - name: 'wait_for_status' - } - }, - urls: [ - { - fmt: '/_cluster/health/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cluster/health' - } - ] -}); - -/** - * Perform a [cluster.pendingTasks](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cluster-pending.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Specify timeout for connection to master - */ -api.cluster.prototype.pendingTasks = ca({ - params: { - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_cluster/pending_tasks' - } -}); - -/** - * Perform a [cluster.putSettings](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cluster-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - */ -api.cluster.prototype.putSettings = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_cluster/settings' - }, - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [cluster.remoteInfo](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cluster-remote-info.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.cluster.prototype.remoteInfo = ca({ - url: { - fmt: '/_remote/info' - } -}); - -/** - * Perform a [cluster.reroute](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cluster-reroute.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.dryRun - Simulate the operation only and return the resulting state - * @param {<>} params.explain - Return an explanation of why the commands can or cannot be executed - * @param {<>} params.retryFailed - Retries allocation of shards that are blocked due to too many subsequent allocation failures - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics. Defaults to all but metadata - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - */ -api.cluster.prototype.reroute = ca({ - params: { - dryRun: { - type: 'boolean', - name: 'dry_run' - }, - explain: { - type: 'boolean' - }, - retryFailed: { - type: 'boolean', - name: 'retry_failed' - }, - metric: { - type: 'list', - options: [ - '_all', - 'blocks', - 'metadata', - 'nodes', - 'routing_table', - 'master_node', - 'version' - ] - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_cluster/reroute' - }, - method: 'POST' -}); - -/** - * Perform a [cluster.state](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cluster-state.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics - */ -api.cluster.prototype.state = ca({ - params: { - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/_cluster/state/<%=metric%>/<%=index%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'blocks', - 'metadata', - 'nodes', - 'routing_table', - 'routing_nodes', - 'master_node', - 'version' - ] - }, - index: { - type: 'list' - } - } - }, - { - fmt: '/_cluster/state/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'blocks', - 'metadata', - 'nodes', - 'routing_table', - 'routing_nodes', - 'master_node', - 'version' - ] - } - } - }, - { - fmt: '/_cluster/state' - } - ] -}); - -/** - * Perform a [cluster.stats](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cluster-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - */ -api.cluster.prototype.stats = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_cluster/stats/nodes/<%=nodeId%>', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_cluster/stats' - } - ] -}); - -/** - * Perform a [count](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/search-count.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.minScore - Include only documents with a specific `_score` value in the result - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.terminateAfter - The maximum count for each shard, upon reaching which the query execution will terminate early - * @param {<>, <>, <>} params.index - A comma-separated list of indices to restrict the results - * @param {<>, <>, <>} params.type - A comma-separated list of types to restrict the results - */ -api.count = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - minScore: { - type: 'number', - name: 'min_score' - }, - preference: { - type: 'string' - }, - routing: { - type: 'list' - }, - q: { - type: 'string' - }, - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - lenient: { - type: 'boolean' - }, - terminateAfter: { - type: 'number', - name: 'terminate_after' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_count', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_count', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_count' - } - ], - method: 'POST' -}); - -/** - * Perform a [create](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/docs-index_.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.parent - ID of the parent document - * @param {<>} params.refresh - If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.create = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - }, - pipeline: { - type: 'string' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_create', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [delete](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/docs-delete.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the delete operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.parent - ID of parent document - * @param {<>} params.refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api['delete'] = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [deleteByQuery](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/docs-delete-by-query.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.conflicts=abort] - What to do when the delete by query hits version conflicts? - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.searchTimeout - Explicit timeout for each search request. Defaults to no timeout. - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the delete by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.scrollSize - Size on the scroll request powering the delete by query - * @param {<>} [params.waitForCompletion=true] - Should the request should block until the delete by query is complete. - * @param {<>} params.requestsPerSecond - The throttle for this request in sub-requests per second. -1 means no throttle. - * @param {<>} [params.slices=1] - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.deleteByQuery = ca({ - params: { - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - from: { - type: 'number' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - conflicts: { - type: 'enum', - 'default': 'abort', - options: [ - 'abort', - 'proceed' - ] - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - lenient: { - type: 'boolean' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'dfs_query_then_fetch' - ], - name: 'search_type' - }, - searchTimeout: { - type: 'time', - name: 'search_timeout' - }, - size: { - type: 'number' - }, - sort: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - terminateAfter: { - type: 'number', - name: 'terminate_after' - }, - stats: { - type: 'list' - }, - version: { - type: 'boolean' - }, - requestCache: { - type: 'boolean', - name: 'request_cache' - }, - refresh: { - type: 'boolean' - }, - timeout: { - type: 'time', - 'default': '1m' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - scrollSize: { - type: 'number', - name: 'scroll_size' - }, - waitForCompletion: { - type: 'boolean', - 'default': true, - name: 'wait_for_completion' - }, - requestsPerSecond: { - type: 'number', - 'default': 0, - name: 'requests_per_second' - }, - slices: { - type: 'number', - 'default': 1 - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_delete_by_query', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_delete_by_query', - req: { - index: { - type: 'list' - } - } - } - ], - needBody: true, - method: 'POST' -}); - -/** - * Perform a [deleteScript](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.id - Script ID - */ -api.deleteScript = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_scripts/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [exists](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document (use `_all` to fetch the first document matching the ID across all types) - */ -api.exists = ca({ - params: { - storedFields: { - type: 'list', - name: 'stored_fields' - }, - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [existsSource](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document; use `_all` to fetch the first document matching the ID across all types - */ -api.existsSource = ca({ - params: { - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_source', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [explain](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/search-explain.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzeWildcard - Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false) - * @param {<>} params.analyzer - The analyzer for the query string query - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The default field for query string query (default: _all) - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.explain = ca({ - params: { - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - analyzer: { - type: 'string' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - storedFields: { - type: 'list', - name: 'stored_fields' - }, - lenient: { - type: 'boolean' - }, - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_explain', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [fieldCaps](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/search-field-caps.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.fields - A comma-separated list of field names - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.fieldCaps = ca({ - params: { - fields: { - type: 'list' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_field_caps', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_field_caps' - } - ], - method: 'POST' -}); - -/** - * Perform a [get](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document (use `_all` to fetch the first document matching the ID across all types) - */ -api.get = ca({ - params: { - storedFields: { - type: 'list', - name: 'stored_fields' - }, - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [getScript](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Script ID - */ -api.getScript = ca({ - url: { - fmt: '/_scripts/<%=id%>', - req: { - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [getSource](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document; use `_all` to fetch the first document matching the ID across all types - */ -api.getSource = ca({ - params: { - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_source', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [index](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/docs-index_.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} [params.opType=index] - Explicit operation type - * @param {<>} params.parent - ID of the parent document - * @param {<>} params.refresh - If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.index = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - opType: { - type: 'enum', - 'default': 'index', - options: [ - 'index', - 'create' - ], - name: 'op_type' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - }, - pipeline: { - type: 'string' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/<%=type%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - } - ], - needBody: true, - method: 'POST' -}); - -api.indices = namespace(); - -/** - * Perform a [indices.analyze](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-analyze.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.index - The name of the index to scope the operation - * @param {<>} params.preferLocal - With `true`, specify that a local shard should be used if available, with `false`, use a random shard (default: true) - * @param {<>} [params.format=detailed] - Format of the output - */ -api.indices.prototype.analyze = ca({ - params: { - index: { - type: 'string' - }, - preferLocal: { - type: 'boolean', - name: 'prefer_local' - }, - format: { - type: 'enum', - 'default': 'detailed', - options: [ - 'detailed', - 'text' - ] - } - }, - urls: [ - { - fmt: '/<%=index%>/_analyze', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_analyze' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.clearCache](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-clearcache.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.fieldData - Clear field data. This is deprecated. Prefer `fielddata`. - * @param {<>} params.fielddata - Clear field data - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to clear when using the `fielddata` parameter (default: all) - * @param {<>} params.query - Clear query caches - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index name to limit the operation - * @param {<>} params.requestCache - Clear request cache - * @param {<>} params.request - Clear request cache - */ -api.indices.prototype.clearCache = ca({ - params: { - fieldData: { - type: 'boolean', - name: 'field_data' - }, - fielddata: { - type: 'boolean' - }, - fields: { - type: 'list' - }, - query: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - index: { - type: 'list' - }, - requestCache: { - type: 'boolean', - name: 'request_cache' - }, - request: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_cache/clear', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cache/clear' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.close](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-open-close.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma separated list of indices to close - */ -api.indices.prototype.close = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - url: { - fmt: '/<%=index%>/_close', - req: { - index: { - type: 'list' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [indices.create](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-create-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for before the operation returns. - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.updateAllTypes - Whether to update the mapping for all fields with the same name across all types or not - * @param {<>} params.index - The name of the index - */ -api.indices.prototype.create = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - updateAllTypes: { - type: 'boolean', - name: 'update_all_types' - } - }, - url: { - fmt: '/<%=index%>', - req: { - index: { - type: 'string' - } - } - }, - method: 'PUT' -}); - -/** - * Perform a [indices.delete](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-delete-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Ignore unavailable indexes (default: false) - * @param {<>} params.allowNoIndices - Ignore if a wildcard expression resolves to no concrete indices (default: false) - * @param {<>} [params.expandWildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (default: open) - * @param {<>, <>, <>} params.index - A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices - */ -api.indices.prototype['delete'] = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - url: { - fmt: '/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [indices.deleteAlias](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit timestamp for the document - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of index names (supports wildcards); use `_all` for all indices - * @param {<>, <>, <>} params.name - A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices. - */ -api.indices.prototype.deleteAlias = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [indices.deleteTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.name - The name of the template - */ -api.indices.prototype.deleteTemplate = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [indices.exists](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-exists.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.ignoreUnavailable - Ignore unavailable indexes (default: false) - * @param {<>} params.allowNoIndices - Ignore if a wildcard expression resolves to no concrete indices (default: false) - * @param {<>} [params.expandWildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (default: open) - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.includeDefaults - Whether to return all default setting for each of the indices. - * @param {<>, <>, <>} params.index - A comma-separated list of index names - */ -api.indices.prototype.exists = ca({ - params: { - local: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - includeDefaults: { - type: 'boolean', - 'default': false, - name: 'include_defaults' - } - }, - url: { - fmt: '/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [indices.existsAlias](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=all] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names to filter aliases - * @param {<>, <>, <>} params.name - A comma-separated list of alias names to return - */ -api.indices.prototype.existsAlias = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'all', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/_alias/<%=name%>', - req: { - name: { - type: 'list' - } - } - } - ], - method: 'HEAD' -}); - -/** - * Perform a [indices.existsTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.name - The comma separated names of the index templates - */ -api.indices.prototype.existsTemplate = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - local: { - type: 'boolean' - } - }, - url: { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [indices.existsType](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-types-exists.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` to check the types across all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to check - */ -api.indices.prototype.existsType = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - url: { - fmt: '/<%=index%>/_mapping/<%=type%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [indices.flush](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-flush.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.force - Whether a flush should be forced even if it is not necessarily needed ie. if no changes will be committed to the index. This is useful if transaction log IDs should be incremented even if no uncommitted changes are present. (This setting can be considered as internal) - * @param {<>} params.waitIfOngoing - If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. The default is true. If set to false the flush will be skipped iff if another flush operation is already running. - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string for all indices - */ -api.indices.prototype.flush = ca({ - params: { - force: { - type: 'boolean' - }, - waitIfOngoing: { - type: 'boolean', - name: 'wait_if_ongoing' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_flush', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_flush' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.flushSynced](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-synced-flush.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string for all indices - */ -api.indices.prototype.flushSynced = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_flush/synced', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_flush/synced' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.forcemerge](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-forcemerge.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flush - Specify whether the index should be flushed after performing the operation (default: true) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.maxNumSegments - The number of segments the index should be merged into (default: dynamic) - * @param {<>} params.onlyExpungeDeletes - Specify whether the operation should only expunge deleted documents - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.forcemerge = ca({ - params: { - flush: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - maxNumSegments: { - type: 'number', - name: 'max_num_segments' - }, - onlyExpungeDeletes: { - type: 'boolean', - name: 'only_expunge_deletes' - } - }, - urls: [ - { - fmt: '/<%=index%>/_forcemerge', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_forcemerge' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.get](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-get-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.ignoreUnavailable - Ignore unavailable indexes (default: false) - * @param {<>} params.allowNoIndices - Ignore if a wildcard expression resolves to no concrete indices (default: false) - * @param {<>} [params.expandWildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (default: open) - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.includeDefaults - Whether to return all default setting for each of the indices. - * @param {<>, <>, <>} params.index - A comma-separated list of index names - */ -api.indices.prototype.get = ca({ - params: { - local: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - includeDefaults: { - type: 'boolean', - 'default': false, - name: 'include_defaults' - } - }, - url: { - fmt: '/<%=index%>', - req: { - index: { - type: 'list' - } - } - } -}); - -/** - * Perform a [indices.getAlias](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=all] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names to filter aliases - * @param {<>, <>, <>} params.name - A comma-separated list of alias names to return - */ -api.indices.prototype.getAlias = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'all', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/_alias/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_alias', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_alias' - } - ] -}); - -/** - * Perform a [indices.getFieldMapping](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-get-field-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.includeDefaults - Whether the default mapping values should be returned as well - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} params.type - A comma-separated list of document types - * @param {<>, <>, <>} params.fields - A comma-separated list of fields - */ -api.indices.prototype.getFieldMapping = ca({ - params: { - includeDefaults: { - type: 'boolean', - name: 'include_defaults' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_mapping/<%=type%>/field/<%=fields%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - }, - fields: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_mapping/field/<%=fields%>', - req: { - index: { - type: 'list' - }, - fields: { - type: 'list' - } - } - }, - { - fmt: '/_mapping/<%=type%>/field/<%=fields%>', - req: { - type: { - type: 'list' - }, - fields: { - type: 'list' - } - } - }, - { - fmt: '/_mapping/field/<%=fields%>', - req: { - fields: { - type: 'list' - } - } - } - ] -}); - -/** - * Perform a [indices.getMapping](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-get-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} params.type - A comma-separated list of document types - */ -api.indices.prototype.getMapping = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_mapping/<%=type%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_mapping', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_mapping/<%=type%>', - req: { - type: { - type: 'list' - } - } - }, - { - fmt: '/_mapping' - } - ] -}); - -/** - * Perform a [indices.getSettings](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-get-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open,closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.includeDefaults - Whether to return all default setting for each of the indices. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.name - The name of the settings that should be included - */ -api.indices.prototype.getSettings = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': [ - 'open', - 'closed' - ], - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - local: { - type: 'boolean' - }, - includeDefaults: { - type: 'boolean', - 'default': false, - name: 'include_defaults' - } - }, - urls: [ - { - fmt: '/<%=index%>/_settings/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_settings', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_settings/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/_settings' - } - ] -}); - -/** - * Perform a [indices.getTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.name - The comma separated names of the index templates - */ -api.indices.prototype.getTemplate = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/_template' - } - ] -}); - -/** - * Perform a [indices.getUpgrade](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-upgrade.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.getUpgrade = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_upgrade', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_upgrade' - } - ] -}); - -/** - * Perform a [indices.open](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-open-close.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.waitForActiveShards - Sets the number of active shards to wait for before the operation returns. - * @param {<>, <>, <>} params.index - A comma separated list of indices to open - */ -api.indices.prototype.open = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'closed', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - } - }, - url: { - fmt: '/<%=index%>/_open', - req: { - index: { - type: 'list' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [indices.putAlias](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit timestamp for the document - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices. - * @param {<>} params.name - The name of the alias to be created or updated - */ -api.indices.prototype.putAlias = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'string' - } - } - }, - method: 'PUT' -}); - -/** - * Perform a [indices.putMapping](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-put-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.updateAllTypes - Whether to update the mapping for all fields with the same name across all types or not - * @param {<>, <>, <>} params.index - A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices. - * @param {<>} params.type - The name of the document type - */ -api.indices.prototype.putMapping = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - updateAllTypes: { - type: 'boolean', - name: 'update_all_types' - } - }, - urls: [ - { - fmt: '/<%=index%>/_mapping/<%=type%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/_mapping/<%=type%>', - req: { - type: { - type: 'string' - } - } - } - ], - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [indices.putSettings](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.preserveExisting - Whether to update existing settings. If set to `true` existing settings on an index remain unchanged, the default is `false` - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.putSettings = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - preserveExisting: { - type: 'boolean', - name: 'preserve_existing' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - } - }, - urls: [ - { - fmt: '/<%=index%>/_settings', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_settings' - } - ], - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [indices.putTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.order - The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers) - * @param {<>} params.create - Whether the index template should only be added if new or can also replace an existing one - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.name - The name of the template - */ -api.indices.prototype.putTemplate = ca({ - params: { - order: { - type: 'number' - }, - create: { - type: 'boolean', - 'default': false - }, - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - } - }, - url: { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [indices.recovery](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-recovery.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.detailed - Whether to display detailed information about shard recovery - * @param {<>} params.activeOnly - Display only those recoveries that are currently on-going - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.recovery = ca({ - params: { - detailed: { - type: 'boolean', - 'default': false - }, - activeOnly: { - type: 'boolean', - 'default': false, - name: 'active_only' - } - }, - urls: [ - { - fmt: '/<%=index%>/_recovery', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_recovery' - } - ] -}); - -/** - * Perform a [indices.refresh](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-refresh.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.refresh = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_refresh', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_refresh' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.rollover](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-rollover-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.dryRun - If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for on the newly created rollover index before the operation returns. - * @param {<>} params.alias - The name of the alias to rollover - * @param {<>} params.newIndex - The name of the rollover index - */ -api.indices.prototype.rollover = ca({ - params: { - timeout: { - type: 'time' - }, - dryRun: { - type: 'boolean', - name: 'dry_run' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - } - }, - urls: [ - { - fmt: '/<%=alias%>/_rollover/<%=newIndex%>', - req: { - alias: { - type: 'string' - }, - newIndex: { - type: 'string' - } - } - }, - { - fmt: '/<%=alias%>/_rollover', - req: { - alias: { - type: 'string' - } - } - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.segments](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-segments.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.verbose - Includes detailed memory usage by Lucene. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.segments = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - verbose: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/<%=index%>/_segments', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_segments' - } - ] -}); - -/** - * Perform a [indices.shardStores](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-shards-stores.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.status - A comma-separated list of statuses used to filter on shards to get store information for - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.shardStores = ca({ - params: { - status: { - type: 'list', - options: [ - 'green', - 'yellow', - 'red', - 'all' - ] - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_shard_stores', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_shard_stores' - } - ] -}); - -/** - * Perform a [indices.shrink](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-shrink-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for on the shrunken index before the operation returns. - * @param {<>} params.index - The name of the source index to shrink - * @param {<>} params.target - The name of the target index to shrink into - */ -api.indices.prototype.shrink = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - } - }, - url: { - fmt: '/<%=index%>/_shrink/<%=target%>', - req: { - index: { - type: 'string' - }, - target: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [indices.split](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-split-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for on the shrunken index before the operation returns. - * @param {<>} params.index - The name of the source index to split - * @param {<>} params.target - The name of the target index to split into - */ -api.indices.prototype.split = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - } - }, - url: { - fmt: '/<%=index%>/_split/<%=target%>', - req: { - index: { - type: 'string' - }, - target: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [indices.stats](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.completionFields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields for `fielddata` index metric (supports wildcards) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) - * @param {<>, <>, <>} params.groups - A comma-separated list of search groups for `search` index metric - * @param {<>} [params.level=indices] - Return stats aggregated at cluster, index or shard level - * @param {<>, <>, <>} params.types - A comma-separated list of document types for the `indexing` index metric - * @param {<>} params.includeSegmentFileSizes - Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.metric - Limit the information returned the specific metrics. - */ -api.indices.prototype.stats = ca({ - params: { - completionFields: { - type: 'list', - name: 'completion_fields' - }, - fielddataFields: { - type: 'list', - name: 'fielddata_fields' - }, - fields: { - type: 'list' - }, - groups: { - type: 'list' - }, - level: { - type: 'enum', - 'default': 'indices', - options: [ - 'cluster', - 'indices', - 'shards' - ] - }, - types: { - type: 'list' - }, - includeSegmentFileSizes: { - type: 'boolean', - 'default': false, - name: 'include_segment_file_sizes' - } - }, - urls: [ - { - fmt: '/<%=index%>/_stats/<%=metric%>', - req: { - index: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/_stats/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/<%=index%>/_stats', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_stats' - } - ] -}); - -/** - * Perform a [indices.updateAliases](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Request timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - */ -api.indices.prototype.updateAliases = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_aliases' - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [indices.upgrade](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-upgrade.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.waitForCompletion - Specify whether the request should block until the all segments are upgraded (default: false) - * @param {<>} params.onlyAncientSegments - If true, only ancient (an older Lucene major release) segments will be upgraded - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.upgrade = ca({ - params: { - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - waitForCompletion: { - type: 'boolean', - name: 'wait_for_completion' - }, - onlyAncientSegments: { - type: 'boolean', - name: 'only_ancient_segments' - } - }, - urls: [ - { - fmt: '/<%=index%>/_upgrade', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_upgrade' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.validateQuery](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/search-validate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.explain - Return detailed information about the error - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.rewrite - Provide a more detailed explanation showing the actual Lucene query that will be executed. - * @param {<>} params.allShards - Execute validation on all shards instead of one random shard per index - * @param {<>, <>, <>} params.index - A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to restrict the operation; leave empty to perform the operation on all types - */ -api.indices.prototype.validateQuery = ca({ - params: { - explain: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - q: { - type: 'string' - }, - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - lenient: { - type: 'boolean' - }, - rewrite: { - type: 'boolean' - }, - allShards: { - type: 'boolean', - name: 'all_shards' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_validate/query', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_validate/query', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_validate/query' - } - ], - method: 'POST' -}); - -/** - * Perform a [info](http://www.elastic.co/guide/) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.info = ca({ - url: { - fmt: '/' - } -}); - -api.ingest = namespace(); - -/** - * Perform a [ingest.deletePipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/6.x/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.id - Pipeline ID - */ -api.ingest.prototype.deletePipeline = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_ingest/pipeline/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [ingest.getPipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/6.x/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.id - Comma separated list of pipeline ids. Wildcards supported - */ -api.ingest.prototype.getPipeline = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - urls: [ - { - fmt: '/_ingest/pipeline/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - { - fmt: '/_ingest/pipeline' - } - ] -}); - -/** - * Perform a [ingest.processorGrok](https://www.elastic.co/guide/en/elasticsearch/plugins/6.x/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.ingest.prototype.processorGrok = ca({ - url: { - fmt: '/_ingest/processor/grok' - } -}); - -/** - * Perform a [ingest.putPipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/6.x/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.id - Pipeline ID - */ -api.ingest.prototype.putPipeline = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_ingest/pipeline/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [ingest.simulate](https://www.elastic.co/guide/en/elasticsearch/plugins/6.x/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.verbose - Verbose mode. Display data output for each processor in executed pipeline - * @param {<>} params.id - Pipeline ID - */ -api.ingest.prototype.simulate = ca({ - params: { - verbose: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_ingest/pipeline/<%=id%>/_simulate', - req: { - id: { - type: 'string' - } - } - }, - { - fmt: '/_ingest/pipeline/_simulate' - } - ], - needBody: true, - method: 'POST' -}); - -/** - * Perform a [mget](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/docs-multi-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.mget = ca({ - params: { - storedFields: { - type: 'list', - name: 'stored_fields' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_mget', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_mget', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_mget' - } - ], - needBody: true, - method: 'POST' -}); - -/** - * Perform a [msearch](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/search-multi-search.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.searchType - Search operation type - * @param {<>} params.maxConcurrentSearches - Controls the maximum number of concurrent searches the multi search api will execute - * @param {<>} params.typedKeys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response - * @param {<>} [params.preFilterShardSize=128] - A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on it's rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to use as default - * @param {<>, <>, <>} params.type - A comma-separated list of document types to use as default - */ -api.msearch = ca({ - params: { - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'query_and_fetch', - 'dfs_query_then_fetch', - 'dfs_query_and_fetch' - ], - name: 'search_type' - }, - maxConcurrentSearches: { - type: 'number', - name: 'max_concurrent_searches' - }, - typedKeys: { - type: 'boolean', - name: 'typed_keys' - }, - preFilterShardSize: { - type: 'number', - 'default': 128, - name: 'pre_filter_shard_size' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_msearch', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_msearch', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_msearch' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -/** - * Perform a [msearchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/search-multi-search.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.searchType - Search operation type - * @param {<>} params.typedKeys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response - * @param {<>} params.maxConcurrentSearches - Controls the maximum number of concurrent searches the multi search api will execute - * @param {<>, <>, <>} params.index - A comma-separated list of index names to use as default - * @param {<>, <>, <>} params.type - A comma-separated list of document types to use as default - */ -api.msearchTemplate = ca({ - params: { - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'query_and_fetch', - 'dfs_query_then_fetch', - 'dfs_query_and_fetch' - ], - name: 'search_type' - }, - typedKeys: { - type: 'boolean', - name: 'typed_keys' - }, - maxConcurrentSearches: { - type: 'number', - name: 'max_concurrent_searches' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_msearch/template', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_msearch/template', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_msearch/template' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -/** - * Perform a [mtermvectors](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/docs-multi-termvectors.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.ids - A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body - * @param {<>} params.termStatistics - Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.fieldStatistics=true] - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.offsets=true] - Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.positions=true] - Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.payloads=true] - Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) .Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.routing - Specific routing value. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.parent - Parent id of documents. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.realtime - Specifies if requests are real-time as opposed to near-real-time (default: true). - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index in which the document resides. - * @param {<>} params.type - The type of the document. - */ -api.mtermvectors = ca({ - params: { - ids: { - type: 'list', - required: false - }, - termStatistics: { - type: 'boolean', - 'default': false, - required: false, - name: 'term_statistics' - }, - fieldStatistics: { - type: 'boolean', - 'default': true, - required: false, - name: 'field_statistics' - }, - fields: { - type: 'list', - required: false - }, - offsets: { - type: 'boolean', - 'default': true, - required: false - }, - positions: { - type: 'boolean', - 'default': true, - required: false - }, - payloads: { - type: 'boolean', - 'default': true, - required: false - }, - preference: { - type: 'string', - required: false - }, - routing: { - type: 'string', - required: false - }, - parent: { - type: 'string', - required: false - }, - realtime: { - type: 'boolean', - required: false - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_mtermvectors', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_mtermvectors', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_mtermvectors' - } - ], - method: 'POST' -}); - -api.nodes = namespace(); - -/** - * Perform a [nodes.hotThreads](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cluster-nodes-hot-threads.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.interval - The interval for the second sampling of threads - * @param {<>} params.snapshots - Number of samples of thread stacktrace (default: 10) - * @param {<>} params.threads - Specify the number of threads to provide information for (default: 3) - * @param {<>} params.ignoreIdleThreads - Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue (default: true) - * @param {<>} params.type - The type to sample (default: cpu) - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - */ -api.nodes.prototype.hotThreads = ca({ - params: { - interval: { - type: 'time' - }, - snapshots: { - type: 'number' - }, - threads: { - type: 'number' - }, - ignoreIdleThreads: { - type: 'boolean', - name: 'ignore_idle_threads' - }, - type: { - type: 'enum', - options: [ - 'cpu', - 'wait', - 'block' - ] - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_nodes/<%=nodeId%>/hotthreads', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_nodes/hotthreads' - } - ] -}); - -/** - * Perform a [nodes.info](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cluster-nodes-info.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.metric - A comma-separated list of metrics you wish returned. Leave empty to return all. - */ -api.nodes.prototype.info = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_nodes/<%=nodeId%>/<%=metric%>', - req: { - nodeId: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - 'settings', - 'os', - 'process', - 'jvm', - 'thread_pool', - 'transport', - 'http', - 'plugins', - 'ingest' - ] - } - } - }, - { - fmt: '/_nodes/<%=nodeId%>', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_nodes/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - 'settings', - 'os', - 'process', - 'jvm', - 'thread_pool', - 'transport', - 'http', - 'plugins', - 'ingest' - ] - } - } - }, - { - fmt: '/_nodes' - } - ] -}); - -/** - * Perform a [nodes.stats](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cluster-nodes-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.completionFields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields for `fielddata` index metric (supports wildcards) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) - * @param {<>} params.groups - A comma-separated list of search groups for `search` index metric - * @param {<>} [params.level=node] - Return indices stats aggregated at index, node or shard level - * @param {<>, <>, <>} params.types - A comma-separated list of document types for the `indexing` index metric - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.includeSegmentFileSizes - Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics - * @param {<>, <>, <>} params.indexMetric - Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified. - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - */ -api.nodes.prototype.stats = ca({ - params: { - completionFields: { - type: 'list', - name: 'completion_fields' - }, - fielddataFields: { - type: 'list', - name: 'fielddata_fields' - }, - fields: { - type: 'list' - }, - groups: { - type: 'boolean' - }, - level: { - type: 'enum', - 'default': 'node', - options: [ - 'indices', - 'node', - 'shards' - ] - }, - types: { - type: 'list' - }, - timeout: { - type: 'time' - }, - includeSegmentFileSizes: { - type: 'boolean', - 'default': false, - name: 'include_segment_file_sizes' - } - }, - urls: [ - { - fmt: '/_nodes/<%=nodeId%>/stats/<%=metric%>/<%=indexMetric%>', - req: { - nodeId: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport', - 'discovery' - ] - }, - indexMetric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/_nodes/<%=nodeId%>/stats/<%=metric%>', - req: { - nodeId: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport', - 'discovery' - ] - } - } - }, - { - fmt: '/_nodes/stats/<%=metric%>/<%=indexMetric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport', - 'discovery' - ] - }, - indexMetric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/_nodes/<%=nodeId%>/stats', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_nodes/stats/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport', - 'discovery' - ] - } - } - }, - { - fmt: '/_nodes/stats' - } - ] -}); - -/** - * Perform a [nodes.usage](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/cluster-nodes-usage.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - */ -api.nodes.prototype.usage = ca({ - params: { - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_nodes/<%=nodeId%>/usage/<%=metric%>', - req: { - nodeId: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - '_all', - 'rest_actions' - ] - } - } - }, - { - fmt: '/_nodes/<%=nodeId%>/usage', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_nodes/usage/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'rest_actions' - ] - } - } - }, - { - fmt: '/_nodes/usage' - } - ] -}); - -/** - * Perform a [ping](http://www.elastic.co/guide/) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.ping = ca({ - url: { - fmt: '/' - }, - requestTimeout: 3000, - method: 'HEAD' -}); - -/** - * Perform a [putScript](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.context - Script context - * @param {<>} params.id - Script ID - */ -api.putScript = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - context: { - type: 'string' - } - }, - urls: [ - { - fmt: '/_scripts/<%=id%>/<%=context%>', - req: { - id: { - type: 'string' - }, - context: { - type: 'string' - } - } - }, - { - fmt: '/_scripts/<%=id%>', - req: { - id: { - type: 'string' - } - } - } - ], - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [rankEval](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/search-rank-eval.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.rankEval = ca({ - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_rank_eval', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_rank_eval', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_rank_eval' - } - ], - needBody: true, - method: 'POST' -}); - -/** - * Perform a [reindex](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/docs-reindex.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the reindex operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} [params.waitForCompletion=true] - Should the request should block until the reindex is complete. - * @param {<>} params.requestsPerSecond - The throttle to set on this request in sub-requests per second. -1 means no throttle. - * @param {<>} [params.slices=1] - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. - */ -api.reindex = ca({ - params: { - refresh: { - type: 'boolean' - }, - timeout: { - type: 'time', - 'default': '1m' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - waitForCompletion: { - type: 'boolean', - 'default': true, - name: 'wait_for_completion' - }, - requestsPerSecond: { - type: 'number', - 'default': 0, - name: 'requests_per_second' - }, - slices: { - type: 'number', - 'default': 1 - } - }, - url: { - fmt: '/_reindex' - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [reindexRethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/docs-reindex.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.requestsPerSecond - The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. - * @param {<>} params.taskId - The task id to rethrottle - */ -api.reindexRethrottle = ca({ - params: { - requestsPerSecond: { - type: 'number', - required: true, - name: 'requests_per_second' - } - }, - url: { - fmt: '/_reindex/<%=taskId%>/_rethrottle', - req: { - taskId: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [renderSearchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - The id of the stored search template - */ -api.renderSearchTemplate = ca({ - urls: [ - { - fmt: '/_render/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - { - fmt: '/_render/template' - } - ], - method: 'POST' -}); - -/** - * Perform a [scroll](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/search-request-scroll.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.scrollId - The scroll ID - */ -api.scroll = ca({ - params: { - scroll: { - type: 'time' - }, - scrollId: { - type: 'string', - name: 'scroll_id' - } - }, - urls: [ - { - fmt: '/_search/scroll/<%=scrollId%>', - req: { - scrollId: { - type: 'string' - } - } - }, - { - fmt: '/_search/scroll' - } - ], - paramAsBody: { - param: 'scrollId', - body: 'scroll_id' - }, - method: 'POST' -}); - -/** - * Perform a [search](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/search-search.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.explain - Specify whether to return detailed information about score computation as part of a hit - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return as part of a hit - * @param {<>, <>, <>} params.docvalueFields - A comma-separated list of fields to return as the docvalue representation of a field for each hit - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.suggestField - Specify which field to use for suggestions - * @param {<>} [params.suggestMode=missing] - Specify suggest mode - * @param {<>} params.suggestSize - How many suggestions to return in response - * @param {<>} params.suggestText - The source text for which the suggestions should be returned - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.trackScores - Whether to calculate and return scores even if they are not used for sorting - * @param {<>} params.trackTotalHits - Indicate if the number of documents that match the query should be tracked - * @param {<>} [params.allowPartialSearchResults=true] - Indicate if an error should be returned if there is a partial search failure or timeout - * @param {<>} params.typedKeys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>} [params.batchedReduceSize=512] - The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large. - * @param {<>} [params.maxConcurrentShardRequests=The default grows with the number of nodes in the cluster but is at most 256.] - The number of concurrent shard requests this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests - * @param {<>} [params.preFilterShardSize=128] - A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on it's rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.search = ca({ - params: { - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - explain: { - type: 'boolean' - }, - storedFields: { - type: 'list', - name: 'stored_fields' - }, - docvalueFields: { - type: 'list', - name: 'docvalue_fields' - }, - from: { - type: 'number' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - lenient: { - type: 'boolean' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'dfs_query_then_fetch' - ], - name: 'search_type' - }, - size: { - type: 'number' - }, - sort: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - terminateAfter: { - type: 'number', - name: 'terminate_after' - }, - stats: { - type: 'list' - }, - suggestField: { - type: 'string', - name: 'suggest_field' - }, - suggestMode: { - type: 'enum', - 'default': 'missing', - options: [ - 'missing', - 'popular', - 'always' - ], - name: 'suggest_mode' - }, - suggestSize: { - type: 'number', - name: 'suggest_size' - }, - suggestText: { - type: 'string', - name: 'suggest_text' - }, - timeout: { - type: 'time' - }, - trackScores: { - type: 'boolean', - name: 'track_scores' - }, - trackTotalHits: { - type: 'boolean', - name: 'track_total_hits' - }, - allowPartialSearchResults: { - type: 'boolean', - 'default': true, - name: 'allow_partial_search_results' - }, - typedKeys: { - type: 'boolean', - name: 'typed_keys' - }, - version: { - type: 'boolean' - }, - requestCache: { - type: 'boolean', - name: 'request_cache' - }, - batchedReduceSize: { - type: 'number', - 'default': 512, - name: 'batched_reduce_size' - }, - maxConcurrentShardRequests: { - type: 'number', - 'default': 'The default grows with the number of nodes in the cluster but is at most 256.', - name: 'max_concurrent_shard_requests' - }, - preFilterShardSize: { - type: 'number', - 'default': 128, - name: 'pre_filter_shard_size' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_search', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_search', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_search' - } - ], - method: 'POST' -}); - -/** - * Perform a [searchShards](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/search-shards.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - */ -api.searchShards = ca({ - params: { - preference: { - type: 'string' - }, - routing: { - type: 'string' - }, - local: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_search_shards', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_search_shards' - } - ], - method: 'POST' -}); - -/** - * Perform a [searchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.explain - Specify whether to return detailed information about score computation as part of a hit - * @param {<>} params.profile - Specify whether to profile the query execution - * @param {<>} params.typedKeys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.searchTemplate = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - preference: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'query_and_fetch', - 'dfs_query_then_fetch', - 'dfs_query_and_fetch' - ], - name: 'search_type' - }, - explain: { - type: 'boolean' - }, - profile: { - type: 'boolean' - }, - typedKeys: { - type: 'boolean', - name: 'typed_keys' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_search/template', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_search/template', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_search/template' - } - ], - needBody: true, - method: 'POST' -}); - -api.snapshot = namespace(); - -/** - * Perform a [snapshot.create](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.waitForCompletion - Should this request wait until the operation has completed before returning - * @param {<>} params.repository - A repository name - * @param {<>} params.snapshot - A snapshot name - */ -api.snapshot.prototype.create = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForCompletion: { - type: 'boolean', - 'default': false, - name: 'wait_for_completion' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [snapshot.createRepository](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.verify - Whether to verify the repository after creation - * @param {<>} params.repository - A repository name - */ -api.snapshot.prototype.createRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - }, - verify: { - type: 'boolean' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>', - req: { - repository: { - type: 'string' - } - } - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [snapshot.delete](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.repository - A repository name - * @param {<>} params.snapshot - A snapshot name - */ -api.snapshot.prototype['delete'] = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [snapshot.deleteRepository](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.repository - A comma-separated list of repository names - */ -api.snapshot.prototype.deleteRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>', - req: { - repository: { - type: 'list' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [snapshot.get](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.ignoreUnavailable - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown - * @param {<>} params.verbose - Whether to show verbose snapshot info or only show the basic info found in the repository index blob - * @param {<>} params.repository - A repository name - * @param {<>, <>, <>} params.snapshot - A comma-separated list of snapshot names - */ -api.snapshot.prototype.get = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - verbose: { - type: 'boolean' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'list' - } - } - } -}); - -/** - * Perform a [snapshot.getRepository](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.repository - A comma-separated list of repository names - */ -api.snapshot.prototype.getRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/_snapshot/<%=repository%>', - req: { - repository: { - type: 'list' - } - } - }, - { - fmt: '/_snapshot' - } - ] -}); - -/** - * Perform a [snapshot.restore](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.waitForCompletion - Should this request wait until the operation has completed before returning - * @param {<>} params.repository - A repository name - * @param {<>} params.snapshot - A snapshot name - */ -api.snapshot.prototype.restore = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForCompletion: { - type: 'boolean', - 'default': false, - name: 'wait_for_completion' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>/_restore', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [snapshot.status](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.ignoreUnavailable - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown - * @param {<>} params.repository - A repository name - * @param {<>, <>, <>} params.snapshot - A comma-separated list of snapshot names - */ -api.snapshot.prototype.status = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - } - }, - urls: [ - { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>/_status', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'list' - } - } - }, - { - fmt: '/_snapshot/<%=repository%>/_status', - req: { - repository: { - type: 'string' - } - } - }, - { - fmt: '/_snapshot/_status' - } - ] -}); - -/** - * Perform a [snapshot.verifyRepository](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.repository - A repository name - */ -api.snapshot.prototype.verifyRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/_verify', - req: { - repository: { - type: 'string' - } - } - }, - method: 'POST' -}); - -api.tasks = namespace(); - -/** - * Perform a [tasks.cancel](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.nodes - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.actions - A comma-separated list of actions that should be cancelled. Leave empty to cancel all. - * @param {<>} params.parentTaskId - Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all. - * @param {<>} params.taskId - Cancel the task with specified task id (node_id:task_number) - */ -api.tasks.prototype.cancel = ca({ - params: { - nodes: { - type: 'list' - }, - actions: { - type: 'list' - }, - parentTaskId: { - type: 'string', - name: 'parent_task_id' - } - }, - urls: [ - { - fmt: '/_tasks/<%=taskId%>/_cancel', - req: { - taskId: { - type: 'string' - } - } - }, - { - fmt: '/_tasks/_cancel' - } - ], - method: 'POST' -}); - -/** - * Perform a [tasks.get](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForCompletion - Wait for the matching tasks to complete (default: false) - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.taskId - Return the task with specified id (node_id:task_number) - */ -api.tasks.prototype.get = ca({ - params: { - waitForCompletion: { - type: 'boolean', - name: 'wait_for_completion' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_tasks/<%=taskId%>', - req: { - taskId: { - type: 'string' - } - } - } -}); - -/** - * Perform a [tasks.list](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.nodes - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.actions - A comma-separated list of actions that should be returned. Leave empty to return all. - * @param {<>} params.detailed - Return detailed task information (default: false) - * @param {<>} params.parentTaskId - Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all. - * @param {<>} params.waitForCompletion - Wait for the matching tasks to complete (default: false) - * @param {<>} [params.groupBy=nodes] - Group tasks by nodes or parent/child relationships - * @param {<>} params.timeout - Explicit operation timeout - */ -api.tasks.prototype.list = ca({ - params: { - nodes: { - type: 'list' - }, - actions: { - type: 'list' - }, - detailed: { - type: 'boolean' - }, - parentTaskId: { - type: 'string', - name: 'parent_task_id' - }, - waitForCompletion: { - type: 'boolean', - name: 'wait_for_completion' - }, - groupBy: { - type: 'enum', - 'default': 'nodes', - options: [ - 'nodes', - 'parents', - 'none' - ], - name: 'group_by' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_tasks' - } -}); - -/** - * Perform a [termvectors](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/docs-termvectors.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.termStatistics - Specifies if total term frequency and document frequency should be returned. - * @param {<>} [params.fieldStatistics=true] - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return. - * @param {<>} [params.offsets=true] - Specifies if term offsets should be returned. - * @param {<>} [params.positions=true] - Specifies if term positions should be returned. - * @param {<>} [params.payloads=true] - Specifies if term payloads should be returned. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random). - * @param {<>} params.routing - Specific routing value. - * @param {<>} params.parent - Parent id of documents. - * @param {<>} params.realtime - Specifies if request is real-time as opposed to near-real-time (default: true). - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index in which the document resides. - * @param {<>} params.type - The type of the document. - * @param {<>} params.id - The id of the document, when not specified a doc param should be supplied. - */ -api.termvectors = ca({ - params: { - termStatistics: { - type: 'boolean', - 'default': false, - required: false, - name: 'term_statistics' - }, - fieldStatistics: { - type: 'boolean', - 'default': true, - required: false, - name: 'field_statistics' - }, - fields: { - type: 'list', - required: false - }, - offsets: { - type: 'boolean', - 'default': true, - required: false - }, - positions: { - type: 'boolean', - 'default': true, - required: false - }, - payloads: { - type: 'boolean', - 'default': true, - required: false - }, - preference: { - type: 'string', - required: false - }, - routing: { - type: 'string', - required: false - }, - parent: { - type: 'string', - required: false - }, - realtime: { - type: 'boolean', - required: false - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_termvectors', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/<%=type%>/_termvectors', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - } - ], - method: 'POST' -}); - -/** - * Perform a [update](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/docs-update.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the update operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return in the response - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.lang - The script language (default: painless) - * @param {<>} params.parent - ID of the parent document. Is is only used for routing and when for the upsert request - * @param {<>} params.refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.retryOnConflict - Specify how many times should the operation be retried when a conflict occurs (default: 0) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.update = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - fields: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - lang: { - type: 'string' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - retryOnConflict: { - type: 'number', - name: 'retry_on_conflict' - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_update', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [updateByQuery](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/docs-update-by-query.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.conflicts=abort] - What to do when the update by query hits version conflicts? - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.pipeline - Ingest pipeline to set on index requests made by this action. (default: none) - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.searchTimeout - Explicit timeout for each search request. Defaults to no timeout. - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.versionType - Should the document increment the version number (internal) on hit or not (reindex) - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the update by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.scrollSize - Size on the scroll request powering the update by query - * @param {<>} [params.waitForCompletion=true] - Should the request should block until the update by query operation is complete. - * @param {<>} params.requestsPerSecond - The throttle to set on this request in sub-requests per second. -1 means no throttle. - * @param {<>} [params.slices=1] - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.updateByQuery = ca({ - params: { - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - from: { - type: 'number' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - conflicts: { - type: 'enum', - 'default': 'abort', - options: [ - 'abort', - 'proceed' - ] - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - lenient: { - type: 'boolean' - }, - pipeline: { - type: 'string' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'dfs_query_then_fetch' - ], - name: 'search_type' - }, - searchTimeout: { - type: 'time', - name: 'search_timeout' - }, - size: { - type: 'number' - }, - sort: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - terminateAfter: { - type: 'number', - name: 'terminate_after' - }, - stats: { - type: 'list' - }, - version: { - type: 'boolean' - }, - versionType: { - type: 'boolean', - name: 'version_type' - }, - requestCache: { - type: 'boolean', - name: 'request_cache' - }, - refresh: { - type: 'boolean' - }, - timeout: { - type: 'time', - 'default': '1m' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - scrollSize: { - type: 'number', - name: 'scroll_size' - }, - waitForCompletion: { - type: 'boolean', - 'default': true, - name: 'wait_for_completion' - }, - requestsPerSecond: { - type: 'number', - 'default': 0, - name: 'requests_per_second' - }, - slices: { - type: 'number', - 'default': 1 - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_update_by_query', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_update_by_query', - req: { - index: { - type: 'list' - } - } - } - ], - method: 'POST' -}); diff --git a/src/lib/apis/browser_index.js b/src/lib/apis/browser_index.js index 1a5b325a0..c91175423 100644 --- a/src/lib/apis/browser_index.js +++ b/src/lib/apis/browser_index.js @@ -1,10 +1,4 @@ module.exports = { '_default': require('./6_2'), '6.2': require('./6_2'), - '6.1': require('./6_1'), - '6.0': require('./6_0'), - '5.6': require('./5_6'), - '5.5': require('./5_5'), - '6.x': require('./6_x'), - 'master': require('./master') }; diff --git a/src/lib/apis/master.js b/src/lib/apis/master.js deleted file mode 100644 index 705d5c3c5..000000000 --- a/src/lib/apis/master.js +++ /dev/null @@ -1,7007 +0,0 @@ -var ca = require('../client_action').makeFactoryWithModifier(function (spec) { - return require('../utils').merge(spec, { - params: { - filterPath: { - type: 'list', - name: 'filter_path' - } - } - }); -}); -var namespace = require('../client_action').namespaceFactory; -var api = module.exports = {}; - -api._namespaces = ['cat', 'cluster', 'indices', 'ingest', 'nodes', 'snapshot', 'tasks']; - -/** - * Perform a [bulk](https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the bulk operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.type - Default document type for items which don't provide one - * @param {<>, <>, <>} params.fields - Default comma-separated list of fields to return in the response for updates, can be overridden on each sub-request - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request - * @param {<>, <>, <>} params._sourceExclude - Default list of fields to exclude from the returned _source field, can be overridden on each sub-request - * @param {<>, <>, <>} params._sourceInclude - Default list of fields to extract and return from the _source field, can be overridden on each sub-request - * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with - * @param {<>} params.index - Default index for items which don't provide one - */ -api.bulk = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - type: { - type: 'string' - }, - fields: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - pipeline: { - type: 'string' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_bulk', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_bulk', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_bulk' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -api.cat = namespace(); - -/** - * Perform a [cat.aliases](https://www.elastic.co/guide/en/elasticsearch/reference/master/cat.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.name - A comma-separated list of alias names to return - */ -api.cat.prototype.aliases = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/aliases/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/_cat/aliases' - } - ] -}); - -/** - * Perform a [cat.allocation](https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-allocation.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information - */ -api.cat.prototype.allocation = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'kb', - 'm', - 'mb', - 'g', - 'gb', - 't', - 'tb', - 'p', - 'pb' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/allocation/<%=nodeId%>', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_cat/allocation' - } - ] -}); - -/** - * Perform a [cat.count](https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-count.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.count = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/count/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/count' - } - ] -}); - -/** - * Perform a [cat.fielddata](https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-fielddata.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return the fielddata size - */ -api.cat.prototype.fielddata = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'kb', - 'm', - 'mb', - 'g', - 'gb', - 't', - 'tb', - 'p', - 'pb' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - }, - fields: { - type: 'list' - } - }, - urls: [ - { - fmt: '/_cat/fielddata/<%=fields%>', - req: { - fields: { - type: 'list' - } - } - }, - { - fmt: '/_cat/fielddata' - } - ] -}); - -/** - * Perform a [cat.health](https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-health.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} [params.ts=true] - Set to false to disable timestamping - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.health = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - ts: { - type: 'boolean', - 'default': true - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/health' - } -}); - -/** - * Perform a [cat.help](https://www.elastic.co/guide/en/elasticsearch/reference/master/cat.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - */ -api.cat.prototype.help = ca({ - params: { - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - } - }, - url: { - fmt: '/_cat' - } -}); - -/** - * Perform a [cat.indices](https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-indices.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.health - A health status ("green", "yellow", or "red" to filter only indices matching the specified health status - * @param {<>} params.help - Return help information - * @param {<>} params.pri - Set to true to return stats only for primary shards - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.indices = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'm', - 'g' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - health: { - type: 'enum', - 'default': null, - options: [ - 'green', - 'yellow', - 'red' - ] - }, - help: { - type: 'boolean', - 'default': false - }, - pri: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/indices/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/indices' - } - ] -}); - -/** - * Perform a [cat.master](https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-master.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.master = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/master' - } -}); - -/** - * Perform a [cat.nodeattrs](https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodeattrs.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.nodeattrs = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/nodeattrs' - } -}); - -/** - * Perform a [cat.nodes](https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodes.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.fullId - Return the full node ID instead of the shortened version (default: false) - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.nodes = ca({ - params: { - format: { - type: 'string' - }, - fullId: { - type: 'boolean', - name: 'full_id' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/nodes' - } -}); - -/** - * Perform a [cat.pendingTasks](https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-pending-tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.pendingTasks = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/pending_tasks' - } -}); - -/** - * Perform a [cat.plugins](https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-plugins.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.plugins = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/plugins' - } -}); - -/** - * Perform a [cat.recovery](https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-recovery.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.recovery = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'kb', - 'm', - 'mb', - 'g', - 'gb', - 't', - 'tb', - 'p', - 'pb' - ] - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/recovery/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/recovery' - } - ] -}); - -/** - * Perform a [cat.repositories](https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-repositories.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.repositories = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean', - 'default': false - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/repositories' - } -}); - -/** - * Perform a [cat.segments](https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-segments.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.segments = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'kb', - 'm', - 'mb', - 'g', - 'gb', - 't', - 'tb', - 'p', - 'pb' - ] - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/segments/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/segments' - } - ] -}); - -/** - * Perform a [cat.shards](https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-shards.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.bytes - The unit in which to display byte values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.index - A comma-separated list of index names to limit the returned information - */ -api.cat.prototype.shards = ca({ - params: { - format: { - type: 'string' - }, - bytes: { - type: 'enum', - options: [ - 'b', - 'k', - 'kb', - 'm', - 'mb', - 'g', - 'gb', - 't', - 'tb', - 'p', - 'pb' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/shards/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cat/shards' - } - ] -}); - -/** - * Perform a [cat.snapshots](https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.ignoreUnavailable - Set to true to ignore unavailable snapshots - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.repository - Name of repository from which to fetch the snapshot information - */ -api.cat.prototype.snapshots = ca({ - params: { - format: { - type: 'string' - }, - ignoreUnavailable: { - type: 'boolean', - 'default': false, - name: 'ignore_unavailable' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/snapshots/<%=repository%>', - req: { - repository: { - type: 'list' - } - } - }, - { - fmt: '/_cat/snapshots' - } - ] -}); - -/** - * Perform a [cat.tasks](https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.actions - A comma-separated list of actions that should be returned. Leave empty to return all. - * @param {<>} params.detailed - Return detailed task information (default: false) - * @param {<>} params.parentTask - Return tasks with specified parent task id. Set to -1 to return all. - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - */ -api.cat.prototype.tasks = ca({ - params: { - format: { - type: 'string' - }, - nodeId: { - type: 'list', - name: 'node_id' - }, - actions: { - type: 'list' - }, - detailed: { - type: 'boolean' - }, - parentTask: { - type: 'number', - name: 'parent_task' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - url: { - fmt: '/_cat/tasks' - } -}); - -/** - * Perform a [cat.templates](https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>} params.name - A pattern that returned template names must match - */ -api.cat.prototype.templates = ca({ - params: { - format: { - type: 'string' - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/templates/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - { - fmt: '/_cat/templates' - } - ] -}); - -/** - * Perform a [cat.threadPool](https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-thread-pool.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.format - a short version of the Accept header, e.g. json, yaml - * @param {<>} params.size - The multiplier in which to display values - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>, <>, <>} params.h - Comma-separated list of column names to display - * @param {<>} params.help - Return help information - * @param {<>, <>, <>} params.s - Comma-separated list of column names or column aliases to sort by - * @param {<>} params.v - Verbose mode. Display column headers - * @param {<>, <>, <>} params.threadPoolPatterns - A comma-separated list of regular-expressions to filter the thread pools in the output - */ -api.cat.prototype.threadPool = ca({ - params: { - format: { - type: 'string' - }, - size: { - type: 'enum', - options: [ - '', - 'k', - 'm', - 'g', - 't', - 'p' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - h: { - type: 'list' - }, - help: { - type: 'boolean', - 'default': false - }, - s: { - type: 'list' - }, - v: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_cat/thread_pool/<%=threadPoolPatterns%>', - req: { - threadPoolPatterns: { - type: 'list' - } - } - }, - { - fmt: '/_cat/thread_pool' - } - ] -}); - -/** - * Perform a [clearScroll](https://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-scroll.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.scrollId - A comma-separated list of scroll IDs to clear - */ -api.clearScroll = ca({ - urls: [ - { - fmt: '/_search/scroll/<%=scrollId%>', - req: { - scrollId: { - type: 'list' - } - } - }, - { - fmt: '/_search/scroll' - } - ], - paramAsBody: { - param: 'scrollId', - body: 'scroll_id' - }, - method: 'DELETE' -}); - -api.cluster = namespace(); - -/** - * Perform a [cluster.allocationExplain](https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-allocation-explain.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.includeYesDecisions - Return 'YES' decisions in explanation (default: false) - * @param {<>} params.includeDiskInfo - Return information about disk usage and shard sizes (default: false) - */ -api.cluster.prototype.allocationExplain = ca({ - params: { - includeYesDecisions: { - type: 'boolean', - name: 'include_yes_decisions' - }, - includeDiskInfo: { - type: 'boolean', - name: 'include_disk_info' - } - }, - url: { - fmt: '/_cluster/allocation/explain' - }, - method: 'POST' -}); - -/** - * Perform a [cluster.getSettings](https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.includeDefaults - Whether to return all default clusters setting. - */ -api.cluster.prototype.getSettings = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - }, - includeDefaults: { - type: 'boolean', - 'default': false, - name: 'include_defaults' - } - }, - url: { - fmt: '/_cluster/settings' - } -}); - -/** - * Perform a [cluster.health](https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-health.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} [params.level=cluster] - Specify the level of detail for returned information - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.waitForActiveShards - Wait until the specified number of shards is active - * @param {<>} params.waitForNodes - Wait until the specified number of nodes is available - * @param {<>} params.waitForEvents - Wait until all currently queued events with the given priority are processed - * @param {<>} params.waitForNoRelocatingShards - Whether to wait until there are no relocating shards in the cluster - * @param {<>} params.waitForNoInitializingShards - Whether to wait until there are no initializing shards in the cluster - * @param {<>} params.waitForStatus - Wait until cluster is in a specific state - * @param {<>, <>, <>} params.index - Limit the information returned to a specific index - */ -api.cluster.prototype.health = ca({ - params: { - level: { - type: 'enum', - 'default': 'cluster', - options: [ - 'cluster', - 'indices', - 'shards' - ] - }, - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - waitForNodes: { - type: 'string', - name: 'wait_for_nodes' - }, - waitForEvents: { - type: 'enum', - options: [ - 'immediate', - 'urgent', - 'high', - 'normal', - 'low', - 'languid' - ], - name: 'wait_for_events' - }, - waitForNoRelocatingShards: { - type: 'boolean', - name: 'wait_for_no_relocating_shards' - }, - waitForNoInitializingShards: { - type: 'boolean', - name: 'wait_for_no_initializing_shards' - }, - waitForStatus: { - type: 'enum', - 'default': null, - options: [ - 'green', - 'yellow', - 'red' - ], - name: 'wait_for_status' - } - }, - urls: [ - { - fmt: '/_cluster/health/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cluster/health' - } - ] -}); - -/** - * Perform a [cluster.pendingTasks](https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-pending.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Specify timeout for connection to master - */ -api.cluster.prototype.pendingTasks = ca({ - params: { - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_cluster/pending_tasks' - } -}); - -/** - * Perform a [cluster.putSettings](https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - */ -api.cluster.prototype.putSettings = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_cluster/settings' - }, - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [cluster.remoteInfo](https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-remote-info.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.cluster.prototype.remoteInfo = ca({ - url: { - fmt: '/_remote/info' - } -}); - -/** - * Perform a [cluster.reroute](https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-reroute.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.dryRun - Simulate the operation only and return the resulting state - * @param {<>} params.explain - Return an explanation of why the commands can or cannot be executed - * @param {<>} params.retryFailed - Retries allocation of shards that are blocked due to too many subsequent allocation failures - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics. Defaults to all but metadata - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - */ -api.cluster.prototype.reroute = ca({ - params: { - dryRun: { - type: 'boolean', - name: 'dry_run' - }, - explain: { - type: 'boolean' - }, - retryFailed: { - type: 'boolean', - name: 'retry_failed' - }, - metric: { - type: 'list', - options: [ - '_all', - 'blocks', - 'metadata', - 'nodes', - 'routing_table', - 'master_node', - 'version' - ] - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_cluster/reroute' - }, - method: 'POST' -}); - -/** - * Perform a [cluster.state](https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-state.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics - */ -api.cluster.prototype.state = ca({ - params: { - local: { - type: 'boolean' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/_cluster/state/<%=metric%>/<%=index%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'blocks', - 'metadata', - 'nodes', - 'routing_table', - 'routing_nodes', - 'master_node', - 'version' - ] - }, - index: { - type: 'list' - } - } - }, - { - fmt: '/_cluster/state/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'blocks', - 'metadata', - 'nodes', - 'routing_table', - 'routing_nodes', - 'master_node', - 'version' - ] - } - } - }, - { - fmt: '/_cluster/state' - } - ] -}); - -/** - * Perform a [cluster.stats](https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - */ -api.cluster.prototype.stats = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_cluster/stats/nodes/<%=nodeId%>', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_cluster/stats' - } - ] -}); - -/** - * Perform a [count](https://www.elastic.co/guide/en/elasticsearch/reference/master/search-count.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.minScore - Include only documents with a specific `_score` value in the result - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.terminateAfter - The maximum count for each shard, upon reaching which the query execution will terminate early - * @param {<>, <>, <>} params.index - A comma-separated list of indices to restrict the results - * @param {<>, <>, <>} params.type - A comma-separated list of types to restrict the results - */ -api.count = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - minScore: { - type: 'number', - name: 'min_score' - }, - preference: { - type: 'string' - }, - routing: { - type: 'list' - }, - q: { - type: 'string' - }, - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - lenient: { - type: 'boolean' - }, - terminateAfter: { - type: 'number', - name: 'terminate_after' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_count', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_count', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_count' - } - ], - method: 'POST' -}); - -/** - * Perform a [create](https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.parent - ID of the parent document - * @param {<>} params.refresh - If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.create = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - }, - pipeline: { - type: 'string' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_create', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [delete](https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the delete operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.parent - ID of parent document - * @param {<>} params.refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api['delete'] = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [deleteByQuery](https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete-by-query.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.conflicts=abort] - What to do when the delete by query hits version conflicts? - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.searchTimeout - Explicit timeout for each search request. Defaults to no timeout. - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the delete by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.scrollSize - Size on the scroll request powering the delete by query - * @param {<>} [params.waitForCompletion=true] - Should the request should block until the delete by query is complete. - * @param {<>} params.requestsPerSecond - The throttle for this request in sub-requests per second. -1 means no throttle. - * @param {<>} [params.slices=1] - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.deleteByQuery = ca({ - params: { - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - from: { - type: 'number' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - conflicts: { - type: 'enum', - 'default': 'abort', - options: [ - 'abort', - 'proceed' - ] - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - lenient: { - type: 'boolean' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'dfs_query_then_fetch' - ], - name: 'search_type' - }, - searchTimeout: { - type: 'time', - name: 'search_timeout' - }, - size: { - type: 'number' - }, - sort: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - terminateAfter: { - type: 'number', - name: 'terminate_after' - }, - stats: { - type: 'list' - }, - version: { - type: 'boolean' - }, - requestCache: { - type: 'boolean', - name: 'request_cache' - }, - refresh: { - type: 'boolean' - }, - timeout: { - type: 'time', - 'default': '1m' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - scrollSize: { - type: 'number', - name: 'scroll_size' - }, - waitForCompletion: { - type: 'boolean', - 'default': true, - name: 'wait_for_completion' - }, - requestsPerSecond: { - type: 'number', - 'default': 0, - name: 'requests_per_second' - }, - slices: { - type: 'number', - 'default': 1 - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_delete_by_query', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_delete_by_query', - req: { - index: { - type: 'list' - } - } - } - ], - needBody: true, - method: 'POST' -}); - -/** - * Perform a [deleteScript](https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.id - Script ID - */ -api.deleteScript = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_scripts/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [exists](https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document (use `_all` to fetch the first document matching the ID across all types) - */ -api.exists = ca({ - params: { - storedFields: { - type: 'list', - name: 'stored_fields' - }, - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [existsSource](https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document; use `_all` to fetch the first document matching the ID across all types - */ -api.existsSource = ca({ - params: { - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_source', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [explain](https://www.elastic.co/guide/en/elasticsearch/reference/master/search-explain.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzeWildcard - Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false) - * @param {<>} params.analyzer - The analyzer for the query string query - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The default field for query string query (default: _all) - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.explain = ca({ - params: { - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - analyzer: { - type: 'string' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - storedFields: { - type: 'list', - name: 'stored_fields' - }, - lenient: { - type: 'boolean' - }, - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_explain', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [fieldCaps](https://www.elastic.co/guide/en/elasticsearch/reference/master/search-field-caps.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.fields - A comma-separated list of field names - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.fieldCaps = ca({ - params: { - fields: { - type: 'list' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_field_caps', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_field_caps' - } - ], - method: 'POST' -}); - -/** - * Perform a [get](https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document (use `_all` to fetch the first document matching the ID across all types) - */ -api.get = ca({ - params: { - storedFields: { - type: 'list', - name: 'stored_fields' - }, - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [getScript](https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - Script ID - */ -api.getScript = ca({ - url: { - fmt: '/_scripts/<%=id%>', - req: { - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [getSource](https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.parent - The ID of the parent document - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - The document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document; use `_all` to fetch the first document matching the ID across all types - */ -api.getSource = ca({ - params: { - parent: { - type: 'string' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_source', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - } -}); - -/** - * Perform a [index](https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} [params.opType=index] - Explicit operation type - * @param {<>} params.parent - ID of the parent document - * @param {<>} params.refresh - If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.pipeline - The pipeline id to preprocess incoming documents with - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.index = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - opType: { - type: 'enum', - 'default': 'index', - options: [ - 'index', - 'create' - ], - name: 'op_type' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - }, - pipeline: { - type: 'string' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/<%=id%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/<%=type%>', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - } - ], - needBody: true, - method: 'POST' -}); - -api.indices = namespace(); - -/** - * Perform a [indices.analyze](https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-analyze.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.index - The name of the index to scope the operation - * @param {<>} params.preferLocal - With `true`, specify that a local shard should be used if available, with `false`, use a random shard (default: true) - * @param {<>} [params.format=detailed] - Format of the output - */ -api.indices.prototype.analyze = ca({ - params: { - index: { - type: 'string' - }, - preferLocal: { - type: 'boolean', - name: 'prefer_local' - }, - format: { - type: 'enum', - 'default': 'detailed', - options: [ - 'detailed', - 'text' - ] - } - }, - urls: [ - { - fmt: '/<%=index%>/_analyze', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_analyze' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.clearCache](https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-clearcache.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.fielddata - Clear field data - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to clear when using the `fielddata` parameter (default: all) - * @param {<>} params.query - Clear query caches - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index name to limit the operation - * @param {<>} params.request - Clear request cache - */ -api.indices.prototype.clearCache = ca({ - params: { - fielddata: { - type: 'boolean' - }, - fields: { - type: 'list' - }, - query: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - index: { - type: 'list' - }, - request: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_cache/clear', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_cache/clear' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.close](https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma separated list of indices to close - */ -api.indices.prototype.close = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - url: { - fmt: '/<%=index%>/_close', - req: { - index: { - type: 'list' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [indices.create](https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-create-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for before the operation returns. - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.index - The name of the index - */ -api.indices.prototype.create = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/<%=index%>', - req: { - index: { - type: 'string' - } - } - }, - method: 'PUT' -}); - -/** - * Perform a [indices.delete](https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-delete-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Ignore unavailable indexes (default: false) - * @param {<>} params.allowNoIndices - Ignore if a wildcard expression resolves to no concrete indices (default: false) - * @param {<>} [params.expandWildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (default: open) - * @param {<>, <>, <>} params.index - A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices - */ -api.indices.prototype['delete'] = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - url: { - fmt: '/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [indices.deleteAlias](https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit timestamp for the document - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of index names (supports wildcards); use `_all` for all indices - * @param {<>, <>, <>} params.name - A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices. - */ -api.indices.prototype.deleteAlias = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [indices.deleteTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.name - The name of the template - */ -api.indices.prototype.deleteTemplate = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [indices.exists](https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-exists.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.ignoreUnavailable - Ignore unavailable indexes (default: false) - * @param {<>} params.allowNoIndices - Ignore if a wildcard expression resolves to no concrete indices (default: false) - * @param {<>} [params.expandWildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (default: open) - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.includeDefaults - Whether to return all default setting for each of the indices. - * @param {<>, <>, <>} params.index - A comma-separated list of index names - */ -api.indices.prototype.exists = ca({ - params: { - local: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - includeDefaults: { - type: 'boolean', - 'default': false, - name: 'include_defaults' - } - }, - url: { - fmt: '/<%=index%>', - req: { - index: { - type: 'list' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [indices.existsAlias](https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=all] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names to filter aliases - * @param {<>, <>, <>} params.name - A comma-separated list of alias names to return - */ -api.indices.prototype.existsAlias = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'all', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/_alias/<%=name%>', - req: { - name: { - type: 'list' - } - } - } - ], - method: 'HEAD' -}); - -/** - * Perform a [indices.existsTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.name - The comma separated names of the index templates - */ -api.indices.prototype.existsTemplate = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - local: { - type: 'boolean' - } - }, - url: { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [indices.existsType](https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-types-exists.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` to check the types across all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to check - */ -api.indices.prototype.existsType = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - url: { - fmt: '/<%=index%>/_mapping/<%=type%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - method: 'HEAD' -}); - -/** - * Perform a [indices.flush](https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-flush.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.force - Whether a flush should be forced even if it is not necessarily needed ie. if no changes will be committed to the index. This is useful if transaction log IDs should be incremented even if no uncommitted changes are present. (This setting can be considered as internal) - * @param {<>} params.waitIfOngoing - If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. The default is true. If set to false the flush will be skipped iff if another flush operation is already running. - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string for all indices - */ -api.indices.prototype.flush = ca({ - params: { - force: { - type: 'boolean' - }, - waitIfOngoing: { - type: 'boolean', - name: 'wait_if_ongoing' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_flush', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_flush' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.flushSynced](https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-synced-flush.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string for all indices - */ -api.indices.prototype.flushSynced = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_flush/synced', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_flush/synced' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.forcemerge](https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-forcemerge.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flush - Specify whether the index should be flushed after performing the operation (default: true) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.maxNumSegments - The number of segments the index should be merged into (default: dynamic) - * @param {<>} params.onlyExpungeDeletes - Specify whether the operation should only expunge deleted documents - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.forcemerge = ca({ - params: { - flush: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - maxNumSegments: { - type: 'number', - name: 'max_num_segments' - }, - onlyExpungeDeletes: { - type: 'boolean', - name: 'only_expunge_deletes' - } - }, - urls: [ - { - fmt: '/<%=index%>/_forcemerge', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_forcemerge' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.get](https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.ignoreUnavailable - Ignore unavailable indexes (default: false) - * @param {<>} params.allowNoIndices - Ignore if a wildcard expression resolves to no concrete indices (default: false) - * @param {<>} [params.expandWildcards=open] - Whether wildcard expressions should get expanded to open or closed indices (default: open) - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.includeDefaults - Whether to return all default setting for each of the indices. - * @param {<>, <>, <>} params.index - A comma-separated list of index names - */ -api.indices.prototype.get = ca({ - params: { - local: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - includeDefaults: { - type: 'boolean', - 'default': false, - name: 'include_defaults' - } - }, - url: { - fmt: '/<%=index%>', - req: { - index: { - type: 'list' - } - } - } -}); - -/** - * Perform a [indices.getAlias](https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=all] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names to filter aliases - * @param {<>, <>, <>} params.name - A comma-separated list of alias names to return - */ -api.indices.prototype.getAlias = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'all', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/_alias/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_alias', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_alias' - } - ] -}); - -/** - * Perform a [indices.getFieldMapping](https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-field-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.includeDefaults - Whether the default mapping values should be returned as well - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} params.type - A comma-separated list of document types - * @param {<>, <>, <>} params.fields - A comma-separated list of fields - */ -api.indices.prototype.getFieldMapping = ca({ - params: { - includeDefaults: { - type: 'boolean', - name: 'include_defaults' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_mapping/<%=type%>/field/<%=fields%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - }, - fields: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_mapping/field/<%=fields%>', - req: { - index: { - type: 'list' - }, - fields: { - type: 'list' - } - } - }, - { - fmt: '/_mapping/<%=type%>/field/<%=fields%>', - req: { - type: { - type: 'list' - }, - fields: { - type: 'list' - } - } - }, - { - fmt: '/_mapping/field/<%=fields%>', - req: { - fields: { - type: 'list' - } - } - } - ] -}); - -/** - * Perform a [indices.getMapping](https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names - * @param {<>, <>, <>} params.type - A comma-separated list of document types - */ -api.indices.prototype.getMapping = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/<%=index%>/_mapping/<%=type%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_mapping', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_mapping/<%=type%>', - req: { - type: { - type: 'list' - } - } - }, - { - fmt: '/_mapping' - } - ] -}); - -/** - * Perform a [indices.getSettings](https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open,closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.includeDefaults - Whether to return all default setting for each of the indices. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.name - The name of the settings that should be included - */ -api.indices.prototype.getSettings = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': [ - 'open', - 'closed' - ], - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - local: { - type: 'boolean' - }, - includeDefaults: { - type: 'boolean', - 'default': false, - name: 'include_defaults' - } - }, - urls: [ - { - fmt: '/<%=index%>/_settings/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_settings', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_settings/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/_settings' - } - ] -}); - -/** - * Perform a [indices.getTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.name - The comma separated names of the index templates - */ -api.indices.prototype.getTemplate = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'list' - } - } - }, - { - fmt: '/_template' - } - ] -}); - -/** - * Perform a [indices.getUpgrade](https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.getUpgrade = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_upgrade', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_upgrade' - } - ] -}); - -/** - * Perform a [indices.open](https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=closed] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.waitForActiveShards - Sets the number of active shards to wait for before the operation returns. - * @param {<>, <>, <>} params.index - A comma separated list of indices to open - */ -api.indices.prototype.open = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'closed', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - } - }, - url: { - fmt: '/<%=index%>/_open', - req: { - index: { - type: 'list' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [indices.putAlias](https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit timestamp for the document - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>, <>, <>} params.index - A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices. - * @param {<>} params.name - The name of the alias to be created or updated - */ -api.indices.prototype.putAlias = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/<%=index%>/_alias/<%=name%>', - req: { - index: { - type: 'list' - }, - name: { - type: 'string' - } - } - }, - method: 'PUT' -}); - -/** - * Perform a [indices.putMapping](https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-put-mapping.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices. - * @param {<>} params.type - The name of the document type - */ -api.indices.prototype.putMapping = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_mapping/<%=type%>', - req: { - index: { - type: 'list' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/_mapping/<%=type%>', - req: { - type: { - type: 'string' - } - } - } - ], - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [indices.putSettings](https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-update-settings.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.preserveExisting - Whether to update existing settings. If set to `true` existing settings on an index remain unchanged, the default is `false` - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.putSettings = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - preserveExisting: { - type: 'boolean', - name: 'preserve_existing' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - } - }, - urls: [ - { - fmt: '/<%=index%>/_settings', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_settings' - } - ], - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [indices.putTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.order - The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers) - * @param {<>} params.create - Whether the index template should only be added if new or can also replace an existing one - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.name - The name of the template - */ -api.indices.prototype.putTemplate = ca({ - params: { - order: { - type: 'number' - }, - create: { - type: 'boolean', - 'default': false - }, - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - flatSettings: { - type: 'boolean', - name: 'flat_settings' - } - }, - url: { - fmt: '/_template/<%=name%>', - req: { - name: { - type: 'string' - } - } - }, - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [indices.recovery](https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-recovery.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.detailed - Whether to display detailed information about shard recovery - * @param {<>} params.activeOnly - Display only those recoveries that are currently on-going - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.recovery = ca({ - params: { - detailed: { - type: 'boolean', - 'default': false - }, - activeOnly: { - type: 'boolean', - 'default': false, - name: 'active_only' - } - }, - urls: [ - { - fmt: '/<%=index%>/_recovery', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_recovery' - } - ] -}); - -/** - * Perform a [indices.refresh](https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-refresh.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.refresh = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_refresh', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_refresh' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.rollover](https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-rollover-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.dryRun - If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for on the newly created rollover index before the operation returns. - * @param {<>} params.alias - The name of the alias to rollover - * @param {<>} params.newIndex - The name of the rollover index - */ -api.indices.prototype.rollover = ca({ - params: { - timeout: { - type: 'time' - }, - dryRun: { - type: 'boolean', - name: 'dry_run' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - } - }, - urls: [ - { - fmt: '/<%=alias%>/_rollover/<%=newIndex%>', - req: { - alias: { - type: 'string' - }, - newIndex: { - type: 'string' - } - } - }, - { - fmt: '/<%=alias%>/_rollover', - req: { - alias: { - type: 'string' - } - } - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.segments](https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-segments.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.verbose - Includes detailed memory usage by Lucene. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.segments = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - verbose: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/<%=index%>/_segments', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_segments' - } - ] -}); - -/** - * Perform a [indices.shardStores](https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shards-stores.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.status - A comma-separated list of statuses used to filter on shards to get store information for - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.shardStores = ca({ - params: { - status: { - type: 'list', - options: [ - 'green', - 'yellow', - 'red', - 'all' - ] - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_shard_stores', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_shard_stores' - } - ] -}); - -/** - * Perform a [indices.shrink](https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shrink-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for on the shrunken index before the operation returns. - * @param {<>} params.index - The name of the source index to shrink - * @param {<>} params.target - The name of the target index to shrink into - */ -api.indices.prototype.shrink = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - } - }, - url: { - fmt: '/<%=index%>/_shrink/<%=target%>', - req: { - index: { - type: 'string' - }, - target: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [indices.split](https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-split-index.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.waitForActiveShards - Set the number of active shards to wait for on the shrunken index before the operation returns. - * @param {<>} params.index - The name of the source index to split - * @param {<>} params.target - The name of the target index to split into - */ -api.indices.prototype.split = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - } - }, - url: { - fmt: '/<%=index%>/_split/<%=target%>', - req: { - index: { - type: 'string' - }, - target: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [indices.stats](https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.completionFields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields for `fielddata` index metric (supports wildcards) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) - * @param {<>, <>, <>} params.groups - A comma-separated list of search groups for `search` index metric - * @param {<>} [params.level=indices] - Return stats aggregated at cluster, index or shard level - * @param {<>, <>, <>} params.types - A comma-separated list of document types for the `indexing` index metric - * @param {<>} params.includeSegmentFileSizes - Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.metric - Limit the information returned the specific metrics. - */ -api.indices.prototype.stats = ca({ - params: { - completionFields: { - type: 'list', - name: 'completion_fields' - }, - fielddataFields: { - type: 'list', - name: 'fielddata_fields' - }, - fields: { - type: 'list' - }, - groups: { - type: 'list' - }, - level: { - type: 'enum', - 'default': 'indices', - options: [ - 'cluster', - 'indices', - 'shards' - ] - }, - types: { - type: 'list' - }, - includeSegmentFileSizes: { - type: 'boolean', - 'default': false, - name: 'include_segment_file_sizes' - } - }, - urls: [ - { - fmt: '/<%=index%>/_stats/<%=metric%>', - req: { - index: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/_stats/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/<%=index%>/_stats', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_stats' - } - ] -}); - -/** - * Perform a [indices.updateAliases](https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Request timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - */ -api.indices.prototype.updateAliases = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_aliases' - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [indices.upgrade](https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.waitForCompletion - Specify whether the request should block until the all segments are upgraded (default: false) - * @param {<>} params.onlyAncientSegments - If true, only ancient (an older Lucene major release) segments will be upgraded - * @param {<>, <>, <>} params.index - A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - */ -api.indices.prototype.upgrade = ca({ - params: { - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - waitForCompletion: { - type: 'boolean', - name: 'wait_for_completion' - }, - onlyAncientSegments: { - type: 'boolean', - name: 'only_ancient_segments' - } - }, - urls: [ - { - fmt: '/<%=index%>/_upgrade', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_upgrade' - } - ], - method: 'POST' -}); - -/** - * Perform a [indices.validateQuery](https://www.elastic.co/guide/en/elasticsearch/reference/master/search-validate.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.explain - Return detailed information about the error - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.rewrite - Provide a more detailed explanation showing the actual Lucene query that will be executed. - * @param {<>} params.allShards - Execute validation on all shards instead of one random shard per index - * @param {<>, <>, <>} params.index - A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to restrict the operation; leave empty to perform the operation on all types - */ -api.indices.prototype.validateQuery = ca({ - params: { - explain: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - q: { - type: 'string' - }, - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - lenient: { - type: 'boolean' - }, - rewrite: { - type: 'boolean' - }, - allShards: { - type: 'boolean', - name: 'all_shards' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_validate/query', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_validate/query', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_validate/query' - } - ], - method: 'POST' -}); - -/** - * Perform a [info](http://www.elastic.co/guide/) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.info = ca({ - url: { - fmt: '/' - } -}); - -api.ingest = namespace(); - -/** - * Perform a [ingest.deletePipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/master/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.id - Pipeline ID - */ -api.ingest.prototype.deletePipeline = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_ingest/pipeline/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [ingest.getPipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/master/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.id - Comma separated list of pipeline ids. Wildcards supported - */ -api.ingest.prototype.getPipeline = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - urls: [ - { - fmt: '/_ingest/pipeline/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - { - fmt: '/_ingest/pipeline' - } - ] -}); - -/** - * Perform a [ingest.processorGrok](https://www.elastic.co/guide/en/elasticsearch/plugins/master/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.ingest.prototype.processorGrok = ca({ - url: { - fmt: '/_ingest/processor/grok' - } -}); - -/** - * Perform a [ingest.putPipeline](https://www.elastic.co/guide/en/elasticsearch/plugins/master/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.id - Pipeline ID - */ -api.ingest.prototype.putPipeline = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_ingest/pipeline/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [ingest.simulate](https://www.elastic.co/guide/en/elasticsearch/plugins/master/ingest.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.verbose - Verbose mode. Display data output for each processor in executed pipeline - * @param {<>} params.id - Pipeline ID - */ -api.ingest.prototype.simulate = ca({ - params: { - verbose: { - type: 'boolean', - 'default': false - } - }, - urls: [ - { - fmt: '/_ingest/pipeline/<%=id%>/_simulate', - req: { - id: { - type: 'string' - } - } - }, - { - fmt: '/_ingest/pipeline/_simulate' - } - ], - needBody: true, - method: 'POST' -}); - -/** - * Perform a [mget](https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-get.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return in the response - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.realtime - Specify whether to perform the operation in realtime or search mode - * @param {<>} params.refresh - Refresh the shard containing the document before performing the operation - * @param {<>} params.routing - Specific routing value - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.mget = ca({ - params: { - storedFields: { - type: 'list', - name: 'stored_fields' - }, - preference: { - type: 'string' - }, - realtime: { - type: 'boolean' - }, - refresh: { - type: 'boolean' - }, - routing: { - type: 'string' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_mget', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_mget', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_mget' - } - ], - needBody: true, - method: 'POST' -}); - -/** - * Perform a [msearch](https://www.elastic.co/guide/en/elasticsearch/reference/master/search-multi-search.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.searchType - Search operation type - * @param {<>} params.maxConcurrentSearches - Controls the maximum number of concurrent searches the multi search api will execute - * @param {<>} params.typedKeys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response - * @param {<>} [params.preFilterShardSize=128] - A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on it's rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to use as default - * @param {<>, <>, <>} params.type - A comma-separated list of document types to use as default - */ -api.msearch = ca({ - params: { - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'query_and_fetch', - 'dfs_query_then_fetch', - 'dfs_query_and_fetch' - ], - name: 'search_type' - }, - maxConcurrentSearches: { - type: 'number', - name: 'max_concurrent_searches' - }, - typedKeys: { - type: 'boolean', - name: 'typed_keys' - }, - preFilterShardSize: { - type: 'number', - 'default': 128, - name: 'pre_filter_shard_size' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_msearch', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_msearch', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_msearch' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -/** - * Perform a [msearchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/master/search-multi-search.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.searchType - Search operation type - * @param {<>} params.typedKeys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response - * @param {<>} params.maxConcurrentSearches - Controls the maximum number of concurrent searches the multi search api will execute - * @param {<>, <>, <>} params.index - A comma-separated list of index names to use as default - * @param {<>, <>, <>} params.type - A comma-separated list of document types to use as default - */ -api.msearchTemplate = ca({ - params: { - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'query_and_fetch', - 'dfs_query_then_fetch', - 'dfs_query_and_fetch' - ], - name: 'search_type' - }, - typedKeys: { - type: 'boolean', - name: 'typed_keys' - }, - maxConcurrentSearches: { - type: 'number', - name: 'max_concurrent_searches' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_msearch/template', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_msearch/template', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_msearch/template' - } - ], - needBody: true, - bulkBody: true, - method: 'POST' -}); - -/** - * Perform a [mtermvectors](https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-multi-termvectors.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.ids - A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body - * @param {<>} params.termStatistics - Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.fieldStatistics=true] - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.offsets=true] - Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.positions=true] - Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} [params.payloads=true] - Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) .Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.routing - Specific routing value. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.parent - Parent id of documents. Applies to all returned documents unless otherwise specified in body "params" or "docs". - * @param {<>} params.realtime - Specifies if requests are real-time as opposed to near-real-time (default: true). - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index in which the document resides. - * @param {<>} params.type - The type of the document. - */ -api.mtermvectors = ca({ - params: { - ids: { - type: 'list', - required: false - }, - termStatistics: { - type: 'boolean', - 'default': false, - required: false, - name: 'term_statistics' - }, - fieldStatistics: { - type: 'boolean', - 'default': true, - required: false, - name: 'field_statistics' - }, - fields: { - type: 'list', - required: false - }, - offsets: { - type: 'boolean', - 'default': true, - required: false - }, - positions: { - type: 'boolean', - 'default': true, - required: false - }, - payloads: { - type: 'boolean', - 'default': true, - required: false - }, - preference: { - type: 'string', - required: false - }, - routing: { - type: 'string', - required: false - }, - parent: { - type: 'string', - required: false - }, - realtime: { - type: 'boolean', - required: false - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_mtermvectors', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/_mtermvectors', - req: { - index: { - type: 'string' - } - } - }, - { - fmt: '/_mtermvectors' - } - ], - method: 'POST' -}); - -api.nodes = namespace(); - -/** - * Perform a [nodes.hotThreads](https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-hot-threads.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.interval - The interval for the second sampling of threads - * @param {<>} params.snapshots - Number of samples of thread stacktrace (default: 10) - * @param {<>} params.threads - Specify the number of threads to provide information for (default: 3) - * @param {<>} params.ignoreIdleThreads - Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue (default: true) - * @param {<>} params.type - The type to sample (default: cpu) - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - */ -api.nodes.prototype.hotThreads = ca({ - params: { - interval: { - type: 'time' - }, - snapshots: { - type: 'number' - }, - threads: { - type: 'number' - }, - ignoreIdleThreads: { - type: 'boolean', - name: 'ignore_idle_threads' - }, - type: { - type: 'enum', - options: [ - 'cpu', - 'wait', - 'block' - ] - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_nodes/<%=nodeId%>/hotthreads', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_nodes/hotthreads' - } - ] -}); - -/** - * Perform a [nodes.info](https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-info.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.flatSettings - Return settings in flat format (default: false) - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.metric - A comma-separated list of metrics you wish returned. Leave empty to return all. - */ -api.nodes.prototype.info = ca({ - params: { - flatSettings: { - type: 'boolean', - name: 'flat_settings' - }, - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_nodes/<%=nodeId%>/<%=metric%>', - req: { - nodeId: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - 'settings', - 'os', - 'process', - 'jvm', - 'thread_pool', - 'transport', - 'http', - 'plugins', - 'ingest' - ] - } - } - }, - { - fmt: '/_nodes/<%=nodeId%>', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_nodes/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - 'settings', - 'os', - 'process', - 'jvm', - 'thread_pool', - 'transport', - 'http', - 'plugins', - 'ingest' - ] - } - } - }, - { - fmt: '/_nodes' - } - ] -}); - -/** - * Perform a [nodes.stats](https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-stats.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.completionFields - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards) - * @param {<>, <>, <>} params.fielddataFields - A comma-separated list of fields for `fielddata` index metric (supports wildcards) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) - * @param {<>} params.groups - A comma-separated list of search groups for `search` index metric - * @param {<>} [params.level=node] - Return indices stats aggregated at index, node or shard level - * @param {<>, <>, <>} params.types - A comma-separated list of document types for the `indexing` index metric - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.includeSegmentFileSizes - Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics - * @param {<>, <>, <>} params.indexMetric - Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified. - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - */ -api.nodes.prototype.stats = ca({ - params: { - completionFields: { - type: 'list', - name: 'completion_fields' - }, - fielddataFields: { - type: 'list', - name: 'fielddata_fields' - }, - fields: { - type: 'list' - }, - groups: { - type: 'boolean' - }, - level: { - type: 'enum', - 'default': 'node', - options: [ - 'indices', - 'node', - 'shards' - ] - }, - types: { - type: 'list' - }, - timeout: { - type: 'time' - }, - includeSegmentFileSizes: { - type: 'boolean', - 'default': false, - name: 'include_segment_file_sizes' - } - }, - urls: [ - { - fmt: '/_nodes/<%=nodeId%>/stats/<%=metric%>/<%=indexMetric%>', - req: { - nodeId: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport', - 'discovery' - ] - }, - indexMetric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/_nodes/<%=nodeId%>/stats/<%=metric%>', - req: { - nodeId: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport', - 'discovery' - ] - } - } - }, - { - fmt: '/_nodes/stats/<%=metric%>/<%=indexMetric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport', - 'discovery' - ] - }, - indexMetric: { - type: 'list', - options: [ - '_all', - 'completion', - 'docs', - 'fielddata', - 'query_cache', - 'flush', - 'get', - 'indexing', - 'merge', - 'request_cache', - 'refresh', - 'search', - 'segments', - 'store', - 'warmer', - 'suggest' - ] - } - } - }, - { - fmt: '/_nodes/<%=nodeId%>/stats', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_nodes/stats/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'breaker', - 'fs', - 'http', - 'indices', - 'jvm', - 'os', - 'process', - 'thread_pool', - 'transport', - 'discovery' - ] - } - } - }, - { - fmt: '/_nodes/stats' - } - ] -}); - -/** - * Perform a [nodes.usage](https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-usage.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.metric - Limit the information returned to the specified metrics - * @param {<>, <>, <>} params.nodeId - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - */ -api.nodes.prototype.usage = ca({ - params: { - timeout: { - type: 'time' - } - }, - urls: [ - { - fmt: '/_nodes/<%=nodeId%>/usage/<%=metric%>', - req: { - nodeId: { - type: 'list' - }, - metric: { - type: 'list', - options: [ - '_all', - 'rest_actions' - ] - } - } - }, - { - fmt: '/_nodes/<%=nodeId%>/usage', - req: { - nodeId: { - type: 'list' - } - } - }, - { - fmt: '/_nodes/usage/<%=metric%>', - req: { - metric: { - type: 'list', - options: [ - '_all', - 'rest_actions' - ] - } - } - }, - { - fmt: '/_nodes/usage' - } - ] -}); - -/** - * Perform a [ping](http://www.elastic.co/guide/) request - * - * @param {Object} params - An object with parameters used to carry out this action - */ -api.ping = ca({ - url: { - fmt: '/' - }, - requestTimeout: 3000, - method: 'HEAD' -}); - -/** - * Perform a [putScript](https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.masterTimeout - Specify timeout for connection to master - * @param {<>} params.context - Script context - * @param {<>} params.id - Script ID - */ -api.putScript = ca({ - params: { - timeout: { - type: 'time' - }, - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - context: { - type: 'string' - } - }, - urls: [ - { - fmt: '/_scripts/<%=id%>/<%=context%>', - req: { - id: { - type: 'string' - }, - context: { - type: 'string' - } - } - }, - { - fmt: '/_scripts/<%=id%>', - req: { - id: { - type: 'string' - } - } - } - ], - needBody: true, - method: 'PUT' -}); - -/** - * Perform a [rankEval](https://www.elastic.co/guide/en/elasticsearch/reference/master/search-rank-eval.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.rankEval = ca({ - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_rank_eval', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_rank_eval', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_rank_eval' - } - ], - needBody: true, - method: 'POST' -}); - -/** - * Perform a [reindex](https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the reindex operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} [params.waitForCompletion=true] - Should the request should block until the reindex is complete. - * @param {<>} params.requestsPerSecond - The throttle to set on this request in sub-requests per second. -1 means no throttle. - * @param {<>} [params.slices=1] - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. - */ -api.reindex = ca({ - params: { - refresh: { - type: 'boolean' - }, - timeout: { - type: 'time', - 'default': '1m' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - waitForCompletion: { - type: 'boolean', - 'default': true, - name: 'wait_for_completion' - }, - requestsPerSecond: { - type: 'number', - 'default': 0, - name: 'requests_per_second' - }, - slices: { - type: 'number', - 'default': 1 - } - }, - url: { - fmt: '/_reindex' - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [reindexRethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.requestsPerSecond - The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. - * @param {<>} params.taskId - The task id to rethrottle - */ -api.reindexRethrottle = ca({ - params: { - requestsPerSecond: { - type: 'number', - required: true, - name: 'requests_per_second' - } - }, - url: { - fmt: '/_reindex/<%=taskId%>/_rethrottle', - req: { - taskId: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [renderSearchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/master/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.id - The id of the stored search template - */ -api.renderSearchTemplate = ca({ - urls: [ - { - fmt: '/_render/template/<%=id%>', - req: { - id: { - type: 'string' - } - } - }, - { - fmt: '/_render/template' - } - ], - method: 'POST' -}); - -/** - * Perform a [scroll](https://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-scroll.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.scrollId - The scroll ID - */ -api.scroll = ca({ - params: { - scroll: { - type: 'time' - }, - scrollId: { - type: 'string', - name: 'scroll_id' - } - }, - urls: [ - { - fmt: '/_search/scroll/<%=scrollId%>', - req: { - scrollId: { - type: 'string' - } - } - }, - { - fmt: '/_search/scroll' - } - ], - paramAsBody: { - param: 'scrollId', - body: 'scroll_id' - }, - method: 'POST' -}); - -/** - * Perform a [search](https://www.elastic.co/guide/en/elasticsearch/reference/master/search-search.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.explain - Specify whether to return detailed information about score computation as part of a hit - * @param {<>, <>, <>} params.storedFields - A comma-separated list of stored fields to return as part of a hit - * @param {<>, <>, <>} params.docvalueFields - A comma-separated list of fields to return as the docvalue representation of a field for each hit - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.suggestField - Specify which field to use for suggestions - * @param {<>} [params.suggestMode=missing] - Specify suggest mode - * @param {<>} params.suggestSize - How many suggestions to return in response - * @param {<>} params.suggestText - The source text for which the suggestions should be returned - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.trackScores - Whether to calculate and return scores even if they are not used for sorting - * @param {<>} params.trackTotalHits - Indicate if the number of documents that match the query should be tracked - * @param {<>} [params.allowPartialSearchResults=true] - Indicate if an error should be returned if there is a partial search failure or timeout - * @param {<>} params.typedKeys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>} [params.batchedReduceSize=512] - The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large. - * @param {<>} [params.maxConcurrentShardRequests=The default grows with the number of nodes in the cluster but is at most 256.] - The number of concurrent shard requests this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests - * @param {<>} [params.preFilterShardSize=128] - A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on it's rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.search = ca({ - params: { - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - explain: { - type: 'boolean' - }, - storedFields: { - type: 'list', - name: 'stored_fields' - }, - docvalueFields: { - type: 'list', - name: 'docvalue_fields' - }, - from: { - type: 'number' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - lenient: { - type: 'boolean' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'dfs_query_then_fetch' - ], - name: 'search_type' - }, - size: { - type: 'number' - }, - sort: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - terminateAfter: { - type: 'number', - name: 'terminate_after' - }, - stats: { - type: 'list' - }, - suggestField: { - type: 'string', - name: 'suggest_field' - }, - suggestMode: { - type: 'enum', - 'default': 'missing', - options: [ - 'missing', - 'popular', - 'always' - ], - name: 'suggest_mode' - }, - suggestSize: { - type: 'number', - name: 'suggest_size' - }, - suggestText: { - type: 'string', - name: 'suggest_text' - }, - timeout: { - type: 'time' - }, - trackScores: { - type: 'boolean', - name: 'track_scores' - }, - trackTotalHits: { - type: 'boolean', - name: 'track_total_hits' - }, - allowPartialSearchResults: { - type: 'boolean', - 'default': true, - name: 'allow_partial_search_results' - }, - typedKeys: { - type: 'boolean', - name: 'typed_keys' - }, - version: { - type: 'boolean' - }, - requestCache: { - type: 'boolean', - name: 'request_cache' - }, - batchedReduceSize: { - type: 'number', - 'default': 512, - name: 'batched_reduce_size' - }, - maxConcurrentShardRequests: { - type: 'number', - 'default': 'The default grows with the number of nodes in the cluster but is at most 256.', - name: 'max_concurrent_shard_requests' - }, - preFilterShardSize: { - type: 'number', - 'default': 128, - name: 'pre_filter_shard_size' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_search', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_search', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_search' - } - ], - method: 'POST' -}); - -/** - * Perform a [searchShards](https://www.elastic.co/guide/en/elasticsearch/reference/master/search-shards.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - */ -api.searchShards = ca({ - params: { - preference: { - type: 'string' - }, - routing: { - type: 'string' - }, - local: { - type: 'boolean' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - } - }, - urls: [ - { - fmt: '/<%=index%>/_search_shards', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_search_shards' - } - ], - method: 'POST' -}); - -/** - * Perform a [searchTemplate](https://www.elastic.co/guide/en/elasticsearch/reference/master/search-template.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.explain - Specify whether to return detailed information about score computation as part of a hit - * @param {<>} params.profile - Specify whether to profile the query execution - * @param {<>} params.typedKeys - Specify whether aggregation and suggester names should be prefixed by their respective types in the response - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.searchTemplate = ca({ - params: { - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - preference: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'query_and_fetch', - 'dfs_query_then_fetch', - 'dfs_query_and_fetch' - ], - name: 'search_type' - }, - explain: { - type: 'boolean' - }, - profile: { - type: 'boolean' - }, - typedKeys: { - type: 'boolean', - name: 'typed_keys' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_search/template', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_search/template', - req: { - index: { - type: 'list' - } - } - }, - { - fmt: '/_search/template' - } - ], - needBody: true, - method: 'POST' -}); - -api.snapshot = namespace(); - -/** - * Perform a [snapshot.create](https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.waitForCompletion - Should this request wait until the operation has completed before returning - * @param {<>} params.repository - A repository name - * @param {<>} params.snapshot - A snapshot name - */ -api.snapshot.prototype.create = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForCompletion: { - type: 'boolean', - 'default': false, - name: 'wait_for_completion' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [snapshot.createRepository](https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.verify - Whether to verify the repository after creation - * @param {<>} params.repository - A repository name - */ -api.snapshot.prototype.createRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - }, - verify: { - type: 'boolean' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>', - req: { - repository: { - type: 'string' - } - } - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [snapshot.delete](https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.repository - A repository name - * @param {<>} params.snapshot - A snapshot name - */ -api.snapshot.prototype['delete'] = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'string' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [snapshot.deleteRepository](https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>, <>, <>} params.repository - A comma-separated list of repository names - */ -api.snapshot.prototype.deleteRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>', - req: { - repository: { - type: 'list' - } - } - }, - method: 'DELETE' -}); - -/** - * Perform a [snapshot.get](https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.ignoreUnavailable - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown - * @param {<>} params.verbose - Whether to show verbose snapshot info or only show the basic info found in the repository index blob - * @param {<>} params.repository - A repository name - * @param {<>, <>, <>} params.snapshot - A comma-separated list of snapshot names - */ -api.snapshot.prototype.get = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - verbose: { - type: 'boolean' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'list' - } - } - } -}); - -/** - * Perform a [snapshot.getRepository](https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.local - Return local information, do not retrieve the state from master node (default: false) - * @param {<>, <>, <>} params.repository - A comma-separated list of repository names - */ -api.snapshot.prototype.getRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - local: { - type: 'boolean' - } - }, - urls: [ - { - fmt: '/_snapshot/<%=repository%>', - req: { - repository: { - type: 'list' - } - } - }, - { - fmt: '/_snapshot' - } - ] -}); - -/** - * Perform a [snapshot.restore](https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.waitForCompletion - Should this request wait until the operation has completed before returning - * @param {<>} params.repository - A repository name - * @param {<>} params.snapshot - A snapshot name - */ -api.snapshot.prototype.restore = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - waitForCompletion: { - type: 'boolean', - 'default': false, - name: 'wait_for_completion' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>/_restore', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'string' - } - } - }, - method: 'POST' -}); - -/** - * Perform a [snapshot.status](https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.ignoreUnavailable - Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown - * @param {<>} params.repository - A repository name - * @param {<>, <>, <>} params.snapshot - A comma-separated list of snapshot names - */ -api.snapshot.prototype.status = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - } - }, - urls: [ - { - fmt: '/_snapshot/<%=repository%>/<%=snapshot%>/_status', - req: { - repository: { - type: 'string' - }, - snapshot: { - type: 'list' - } - } - }, - { - fmt: '/_snapshot/<%=repository%>/_status', - req: { - repository: { - type: 'string' - } - } - }, - { - fmt: '/_snapshot/_status' - } - ] -}); - -/** - * Perform a [snapshot.verifyRepository](https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.masterTimeout - Explicit operation timeout for connection to master node - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.repository - A repository name - */ -api.snapshot.prototype.verifyRepository = ca({ - params: { - masterTimeout: { - type: 'time', - name: 'master_timeout' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_snapshot/<%=repository%>/_verify', - req: { - repository: { - type: 'string' - } - } - }, - method: 'POST' -}); - -api.tasks = namespace(); - -/** - * Perform a [tasks.cancel](https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.nodes - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.actions - A comma-separated list of actions that should be cancelled. Leave empty to cancel all. - * @param {<>} params.parentTaskId - Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all. - * @param {<>} params.taskId - Cancel the task with specified task id (node_id:task_number) - */ -api.tasks.prototype.cancel = ca({ - params: { - nodes: { - type: 'list' - }, - actions: { - type: 'list' - }, - parentTaskId: { - type: 'string', - name: 'parent_task_id' - } - }, - urls: [ - { - fmt: '/_tasks/<%=taskId%>/_cancel', - req: { - taskId: { - type: 'string' - } - } - }, - { - fmt: '/_tasks/_cancel' - } - ], - method: 'POST' -}); - -/** - * Perform a [tasks.get](https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForCompletion - Wait for the matching tasks to complete (default: false) - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.taskId - Return the task with specified id (node_id:task_number) - */ -api.tasks.prototype.get = ca({ - params: { - waitForCompletion: { - type: 'boolean', - name: 'wait_for_completion' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_tasks/<%=taskId%>', - req: { - taskId: { - type: 'string' - } - } - } -}); - -/** - * Perform a [tasks.list](https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>, <>, <>} params.nodes - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - * @param {<>, <>, <>} params.actions - A comma-separated list of actions that should be returned. Leave empty to return all. - * @param {<>} params.detailed - Return detailed task information (default: false) - * @param {<>} params.parentTaskId - Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all. - * @param {<>} params.waitForCompletion - Wait for the matching tasks to complete (default: false) - * @param {<>} [params.groupBy=nodes] - Group tasks by nodes or parent/child relationships - * @param {<>} params.timeout - Explicit operation timeout - */ -api.tasks.prototype.list = ca({ - params: { - nodes: { - type: 'list' - }, - actions: { - type: 'list' - }, - detailed: { - type: 'boolean' - }, - parentTaskId: { - type: 'string', - name: 'parent_task_id' - }, - waitForCompletion: { - type: 'boolean', - name: 'wait_for_completion' - }, - groupBy: { - type: 'enum', - 'default': 'nodes', - options: [ - 'nodes', - 'parents', - 'none' - ], - name: 'group_by' - }, - timeout: { - type: 'time' - } - }, - url: { - fmt: '/_tasks' - } -}); - -/** - * Perform a [termvectors](https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-termvectors.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.termStatistics - Specifies if total term frequency and document frequency should be returned. - * @param {<>} [params.fieldStatistics=true] - Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return. - * @param {<>} [params.offsets=true] - Specifies if term offsets should be returned. - * @param {<>} [params.positions=true] - Specifies if term positions should be returned. - * @param {<>} [params.payloads=true] - Specifies if term payloads should be returned. - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random). - * @param {<>} params.routing - Specific routing value. - * @param {<>} params.parent - Parent id of documents. - * @param {<>} params.realtime - Specifies if request is real-time as opposed to near-real-time (default: true). - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.index - The index in which the document resides. - * @param {<>} params.type - The type of the document. - * @param {<>} params.id - The id of the document, when not specified a doc param should be supplied. - */ -api.termvectors = ca({ - params: { - termStatistics: { - type: 'boolean', - 'default': false, - required: false, - name: 'term_statistics' - }, - fieldStatistics: { - type: 'boolean', - 'default': true, - required: false, - name: 'field_statistics' - }, - fields: { - type: 'list', - required: false - }, - offsets: { - type: 'boolean', - 'default': true, - required: false - }, - positions: { - type: 'boolean', - 'default': true, - required: false - }, - payloads: { - type: 'boolean', - 'default': true, - required: false - }, - preference: { - type: 'string', - required: false - }, - routing: { - type: 'string', - required: false - }, - parent: { - type: 'string', - required: false - }, - realtime: { - type: 'boolean', - required: false - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'external', - 'external_gte', - 'force' - ], - name: 'version_type' - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_termvectors', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - { - fmt: '/<%=index%>/<%=type%>/_termvectors', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - } - } - } - ], - method: 'POST' -}); - -/** - * Perform a [update](https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the update operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>, <>, <>} params.fields - A comma-separated list of fields to return in the response - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.lang - The script language (default: painless) - * @param {<>} params.parent - ID of the parent document. Is is only used for routing and when for the upsert request - * @param {<>} params.refresh - If `true` then refresh the effected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. - * @param {<>} params.retryOnConflict - Specify how many times should the operation be retried when a conflict occurs (default: 0) - * @param {<>} params.routing - Specific routing value - * @param {<>} params.timeout - Explicit operation timeout - * @param {<>} params.version - Explicit version number for concurrency control - * @param {<>} params.versionType - Specific version type - * @param {<>} params.id - Document ID - * @param {<>} params.index - The name of the index - * @param {<>} params.type - The type of the document - */ -api.update = ca({ - params: { - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - fields: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - lang: { - type: 'string' - }, - parent: { - type: 'string' - }, - refresh: { - type: 'enum', - options: [ - 'true', - 'false', - 'wait_for', - '' - ] - }, - retryOnConflict: { - type: 'number', - name: 'retry_on_conflict' - }, - routing: { - type: 'string' - }, - timeout: { - type: 'time' - }, - version: { - type: 'number' - }, - versionType: { - type: 'enum', - options: [ - 'internal', - 'force' - ], - name: 'version_type' - } - }, - url: { - fmt: '/<%=index%>/<%=type%>/<%=id%>/_update', - req: { - index: { - type: 'string' - }, - type: { - type: 'string' - }, - id: { - type: 'string' - } - } - }, - needBody: true, - method: 'POST' -}); - -/** - * Perform a [updateByQuery](https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update-by-query.html) request - * - * @param {Object} params - An object with parameters used to carry out this action - * @param {<>} params.analyzer - The analyzer to use for the query string - * @param {<>} params.analyzeWildcard - Specify whether wildcard and prefix queries should be analyzed (default: false) - * @param {<>} [params.defaultOperator=OR] - The default operator for query string query (AND or OR) - * @param {<>} params.df - The field to use as default where no field prefix is given in the query string - * @param {<>} params.from - Starting offset (default: 0) - * @param {<>} params.ignoreUnavailable - Whether specified concrete indices should be ignored when unavailable (missing or closed) - * @param {<>} params.allowNoIndices - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - * @param {<>} [params.conflicts=abort] - What to do when the update by query hits version conflicts? - * @param {<>} [params.expandWildcards=open] - Whether to expand wildcard expression to concrete indices that are open, closed or both. - * @param {<>} params.lenient - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - * @param {<>} params.pipeline - Ingest pipeline to set on index requests made by this action. (default: none) - * @param {<>} params.preference - Specify the node or shard the operation should be performed on (default: random) - * @param {<>} params.q - Query in the Lucene query string syntax - * @param {<>, <>, <>} params.routing - A comma-separated list of specific routing values - * @param {<>} params.scroll - Specify how long a consistent view of the index should be maintained for scrolled search - * @param {<>} params.searchType - Search operation type - * @param {<>} params.searchTimeout - Explicit timeout for each search request. Defaults to no timeout. - * @param {<>} params.size - Number of hits to return (default: 10) - * @param {<>, <>, <>} params.sort - A comma-separated list of : pairs - * @param {<>, <>, <>} params._source - True or false to return the _source field or not, or a list of fields to return - * @param {<>, <>, <>} params._sourceExclude - A list of fields to exclude from the returned _source field - * @param {<>, <>, <>} params._sourceInclude - A list of fields to extract and return from the _source field - * @param {<>} params.terminateAfter - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - * @param {<>, <>, <>} params.stats - Specific 'tag' of the request for logging and statistical purposes - * @param {<>} params.version - Specify whether to return document version as part of a hit - * @param {<>} params.versionType - Should the document increment the version number (internal) on hit or not (reindex) - * @param {<>} params.requestCache - Specify if request cache should be used for this request or not, defaults to index level setting - * @param {<>} params.refresh - Should the effected indexes be refreshed? - * @param {<>} [params.timeout=1m] - Time each individual bulk request should wait for shards that are unavailable. - * @param {<>} params.waitForActiveShards - Sets the number of shard copies that must be active before proceeding with the update by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - * @param {<>} params.scrollSize - Size on the scroll request powering the update by query - * @param {<>} [params.waitForCompletion=true] - Should the request should block until the update by query operation is complete. - * @param {<>} params.requestsPerSecond - The throttle to set on this request in sub-requests per second. -1 means no throttle. - * @param {<>} [params.slices=1] - The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. - * @param {<>, <>, <>} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - * @param {<>, <>, <>} params.type - A comma-separated list of document types to search; leave empty to perform the operation on all types - */ -api.updateByQuery = ca({ - params: { - analyzer: { - type: 'string' - }, - analyzeWildcard: { - type: 'boolean', - name: 'analyze_wildcard' - }, - defaultOperator: { - type: 'enum', - 'default': 'OR', - options: [ - 'AND', - 'OR' - ], - name: 'default_operator' - }, - df: { - type: 'string' - }, - from: { - type: 'number' - }, - ignoreUnavailable: { - type: 'boolean', - name: 'ignore_unavailable' - }, - allowNoIndices: { - type: 'boolean', - name: 'allow_no_indices' - }, - conflicts: { - type: 'enum', - 'default': 'abort', - options: [ - 'abort', - 'proceed' - ] - }, - expandWildcards: { - type: 'enum', - 'default': 'open', - options: [ - 'open', - 'closed', - 'none', - 'all' - ], - name: 'expand_wildcards' - }, - lenient: { - type: 'boolean' - }, - pipeline: { - type: 'string' - }, - preference: { - type: 'string' - }, - q: { - type: 'string' - }, - routing: { - type: 'list' - }, - scroll: { - type: 'time' - }, - searchType: { - type: 'enum', - options: [ - 'query_then_fetch', - 'dfs_query_then_fetch' - ], - name: 'search_type' - }, - searchTimeout: { - type: 'time', - name: 'search_timeout' - }, - size: { - type: 'number' - }, - sort: { - type: 'list' - }, - _source: { - type: 'list' - }, - _sourceExclude: { - type: 'list', - name: '_source_exclude' - }, - _sourceInclude: { - type: 'list', - name: '_source_include' - }, - terminateAfter: { - type: 'number', - name: 'terminate_after' - }, - stats: { - type: 'list' - }, - version: { - type: 'boolean' - }, - versionType: { - type: 'boolean', - name: 'version_type' - }, - requestCache: { - type: 'boolean', - name: 'request_cache' - }, - refresh: { - type: 'boolean' - }, - timeout: { - type: 'time', - 'default': '1m' - }, - waitForActiveShards: { - type: 'string', - name: 'wait_for_active_shards' - }, - scrollSize: { - type: 'number', - name: 'scroll_size' - }, - waitForCompletion: { - type: 'boolean', - 'default': true, - name: 'wait_for_completion' - }, - requestsPerSecond: { - type: 'number', - 'default': 0, - name: 'requests_per_second' - }, - slices: { - type: 'number', - 'default': 1 - } - }, - urls: [ - { - fmt: '/<%=index%>/<%=type%>/_update_by_query', - req: { - index: { - type: 'list' - }, - type: { - type: 'list' - } - } - }, - { - fmt: '/<%=index%>/_update_by_query', - req: { - index: { - type: 'list' - } - } - } - ], - method: 'POST' -}); diff --git a/src/lib/connectors/xhr.js b/src/lib/connectors/xhr.js index 2b21539a6..1fd10aa35 100644 --- a/src/lib/connectors/xhr.js +++ b/src/lib/connectors/xhr.js @@ -61,7 +61,8 @@ XhrConnector.prototype.request = function (params, cb) { var async = params.async === false ? false : asyncDefault; xhr.open(params.method || 'GET', url, async); - + xhr.withCredentials = true; + xhr.crossDomain = true; if (headers) { for (var key in headers) { if (headers[key] !== void 0) {