Adding indices.clone
This commit is contained in:
@@ -106,6 +106,32 @@ class IndicesClient(NamespacedClient):
|
|||||||
"PUT", _make_path(index), params=params, body=body
|
"PUT", _make_path(index), params=params, body=body
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@query_params(
|
||||||
|
"master_timeout",
|
||||||
|
"timeout",
|
||||||
|
"wait_for_active_shards"
|
||||||
|
)
|
||||||
|
def clone(self, index, target, body=None, params=None):
|
||||||
|
"""
|
||||||
|
Clones an index
|
||||||
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-clone-index.html>`_
|
||||||
|
|
||||||
|
:arg index: The name of the source index to clone
|
||||||
|
:arg target: The name of the target index to clone into
|
||||||
|
:arg master_timeout: Specify timeout for connection to master
|
||||||
|
:arg timeout: Explicit operation timeout
|
||||||
|
:arg wait_for_active_shards: Set the number of active shards to wait for
|
||||||
|
before the operation returns.
|
||||||
|
"""
|
||||||
|
if index in SKIP_IN_PATH:
|
||||||
|
raise ValueError("Empty value passed for a required argument 'index'.")
|
||||||
|
if target in SKIP_IN_PATH:
|
||||||
|
raise ValueError("Empty value passed for a required argument 'target'.")
|
||||||
|
|
||||||
|
return self.transport.perform_request(
|
||||||
|
"PUT", _make_path(index, '_clone', target), params=params, body=body
|
||||||
|
)
|
||||||
|
|
||||||
@query_params(
|
@query_params(
|
||||||
"allow_no_indices",
|
"allow_no_indices",
|
||||||
"expand_wildcards",
|
"expand_wildcards",
|
||||||
|
|||||||
Reference in New Issue
Block a user