a _bm;@s,ddlmZmZmZmZGdddeZdS)) SKIP_IN_PATHNamespacedClient _make_path query_paramsc @sbeZdZeddddddddd d d d;d dZedddddZeddddddd?ddZedd ddd@d!d"Z eddddAd#d$Z edBd%d&Z ed'd(dCd)d*Z edddDd+d,Z edddEd-d.Zed/dddFd0d1ZedddGd2d3Zed4dHd5d6Zed7d8ddId9d:Zd S)J ClusterClientZexpand_wildcardslevellocalZmaster_timeouttimeoutZwait_for_active_shardsZwait_for_eventsZwait_for_no_initializing_shardsZwait_for_no_relocating_shardsZwait_for_nodesZwait_for_statusNcs"|jjdtdd|||dIdHS)a Returns basic information about the health of the cluster. :arg index: Limit the information returned to a specific index :arg expand_wildcards: Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choices: open, closed, hidden, none, all Default: all :arg level: Specify the level of detail for returned information Valid choices: cluster, indices, shards Default: cluster :arg local: Return local information, do not retrieve the state from master node (default: false) :arg master_timeout: Explicit operation timeout for connection to master node :arg timeout: Explicit operation timeout :arg wait_for_active_shards: Wait until the specified number of shards is active :arg wait_for_events: Wait until all currently queued events with the given priority are processed Valid choices: immediate, urgent, high, normal, low, languid :arg wait_for_no_initializing_shards: Whether to wait until there are no initializing shards in the cluster :arg wait_for_no_relocating_shards: Whether to wait until there are no relocating shards in the cluster :arg wait_for_nodes: Wait until the specified number of nodes is available :arg wait_for_status: Wait until cluster is in a specific state Valid choices: green, yellow, red GET_clusterhealthparamsheadersN transportperform_requestr)selfindexrrrI/tmp/pip-target-4jja1joz/lib/python/opensearchpy/_async/client/cluster.pyr s + zClusterClient.healthcs|jjdd||dIdHS)aa Returns a list of any cluster-level changes (e.g. create index, update mapping, allocate or fail shard) which have not yet been executed. :arg local: Return local information, do not retrieve the state from master node (default: false) :arg master_timeout: Specify timeout for connection to master r z/_cluster/pending_tasksr Nrrrrrrrr pending_tasksQs zClusterClient.pending_tasksZallow_no_indicesZ flat_settingsZignore_unavailableZwait_for_metadata_versionZwait_for_timeoutcs4|r|tvrd}|jjdtdd||||dIdHS)a Returns a comprehensive information about the state of the cluster. :arg metric: Limit the information returned to the specified metrics Valid choices: _all, blocks, metadata, nodes, routing_table, routing_nodes, master_node, version :arg index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) :arg expand_wildcards: Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choices: open, closed, hidden, none, all Default: open :arg flat_settings: Return settings in flat format (default: false) :arg ignore_unavailable: Whether specified concrete indices should be ignored when unavailable (missing or closed) :arg local: Return local information, do not retrieve the state from master node (default: false) :arg master_timeout: Specify timeout for connection to master :arg wait_for_metadata_version: Wait for the metadata version to be equal or greater than the specified metadata version :arg wait_for_timeout: The maximum time to wait for wait_for_metadata_version before timing out Z_allr r stater N)rrrr)rmetricrrrrrrr`s&  zClusterClient.statecs0|jjd|tvrdn tddd|||dIdHS)a Returns high-level overview of cluster statistics. :arg node_id: 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 :arg flat_settings: Return settings in flat format (default: false) :arg timeout: Explicit operation timeout r z/_cluster/statsr statsnodesr N)rrrr)rZnode_idrrrrrrs zClusterClient.statsdry_runexplainrZ retry_failedcs|jjdd|||dIdHS)aw Allows to manually change the allocation of individual shards in the cluster. :arg body: The definition of `commands` to perform (`move`, `cancel`, `allocate`) :arg dry_run: Simulate the operation only and return the resulting state :arg explain: Return an explanation of why the commands can or cannot be executed :arg master_timeout: Explicit operation timeout for connection to master node :arg metric: Limit the information returned to the specified metrics. Defaults to all but metadata Valid choices: _all, blocks, metadata, nodes, routing_table, master_node, version :arg retry_failed: Retries allocation of shards that are blocked due to too many subsequent allocation failures :arg timeout: Explicit operation timeout POSTz/_cluster/rerouterrbodyNrrr"rrrrrreroutes zClusterClient.rerouteZinclude_defaultscs|jjdd||dIdHS)as Returns cluster settings. :arg flat_settings: Return settings in flat format (default: false) :arg include_defaults: Whether to return all default clusters setting. :arg master_timeout: Explicit operation timeout for connection to master node :arg timeout: Explicit operation timeout r /_cluster/settingsr Nrrrrr get_settingsszClusterClient.get_settingscs,|tvrtd|jjdd|||dIdHS)a Updates the cluster settings. :arg body: The settings to be updated. Can be either `transient` or `persistent` (survives cluster restart). :arg flat_settings: Return settings in flat format (default: false) :arg master_timeout: Explicit operation timeout for connection to master node :arg timeout: Explicit operation timeout z2Empty value passed for a required argument 'body'.PUTr%r!N)r ValueErrorrrr#rrr put_settingss  zClusterClient.put_settingscs|jjdd||dIdHS)zL Returns the information about configured remote clusters. r z /_remote/infor Nrrrrr remote_infoszClusterClient.remote_infoZinclude_disk_infoZinclude_yes_decisionscs|jjdd|||dIdHS)a Provides explanations for shard allocations in the cluster. :arg body: The index, shard, and primary flag to explain. Empty means 'explain the first unassigned shard' :arg include_disk_info: Return information about disk usage and shard sizes (default: false) :arg include_yes_decisions: Return 'YES' decisions in explanation (default: false) r z/_cluster/allocation/explainr!Nrr#rrrallocation_explains z ClusterClient.allocation_explaincs0|tvrtd|jjdtd|||dIdHS)z Deletes a component template :arg name: The name of the template :arg master_timeout: Specify timeout for connection to master :arg timeout: Explicit operation timeout 2Empty value passed for a required argument 'name'.DELETE_component_templater Nrr(rrrrnamerrrrrdelete_component_templates z'ClusterClient.delete_component_templatecs |jjdtd|||dIdHS)a[ Returns one or more component templates :arg name: The comma separated names of the component templates :arg local: Return local information, do not retrieve the state from master node (default: false) :arg master_timeout: Explicit operation timeout for connection to master node r r.r Nrr0rrrget_component_templates z$ClusterClient.get_component_templatecreatecs@||fD]}|tvrtdq|jjdtd||||dIdHS)a Creates or updates a component template :arg name: The name of the template :arg body: The template definition :arg create: Whether the index template should only be added if new or can also replace an existing one :arg master_timeout: Specify timeout for connection to master :arg timeout: Explicit operation timeout z+Empty value passed for a required argument.r'r.r!Nr/)rr1r"rrparamrrrput_component_template/s  z$ClusterClient.put_component_templatecs0|tvrtd|jjdtd|||dIdHS)a_ Returns information about whether a particular component template exist :arg name: The name of the template :arg local: Return local information, do not retrieve the state from master node (default: false) :arg master_timeout: Explicit operation timeout for connection to master node r,HEADr.r Nr/r0rrrexists_component_templateHs z'ClusterClient.exists_component_templateZwait_for_removalcs|jjdd||dIdHS)a  Clears cluster voting config exclusions. :arg wait_for_removal: Specifies whether to wait for all excluded nodes to be removed from the cluster before clearing the voting configuration exclusions list. Default: True r-"/_cluster/voting_config_exclusionsr Nrrrrrdelete_voting_config_exclusions^s z-ClusterClient.delete_voting_config_exclusionsZnode_idsZ node_namescs|jjdd||dIdHS)a Updates the cluster voting config exclusions by node ids or node names. :arg node_ids: A comma-separated list of the persistent ids of the nodes to exclude from the voting configuration. If specified, you may not also specify ?node_names. :arg node_names: A comma-separated list of the names of the nodes to exclude from the voting configuration. If specified, you may not also specify ?node_ids. :arg timeout: Explicit operation timeout Default: 30s r r9r Nrrrrrpost_voting_config_exclusionsosz+ClusterClient.post_voting_config_exclusions)NNN)NN)NNNN)NNN)NNN)NN)NN)NN)NNN)NN)NNN)NN)NN)NN)NN)__name__ __module__ __qualname__rr rrrr$r&r)r*r+r2r3r6r8r:r;rrrrrsj %  &                rN)utilsrrrrrrrrrs