a _b3@s,ddlmZmZmZmZGdddeZdS)) SKIP_IN_PATHNamespacedClient _make_path query_paramsc @seZdZeddd-ddZedd.ddZedd d dd d/d d Zeddd0ddZeddd1ddZedddd2ddZ eddd3ddZ eddd4ddZ eddd5ddZ eddd6ddZ edd7dd Zed!d"d#d$d%d&d'd(d)d*d d8d+d,ZdS)9SnapshotClientZmaster_timeoutZwait_for_completionNcsB||fD]}|tvrtdq|jjdtd|||||dIdHS)a Creates a snapshot in a repository. :arg repository: A repository name :arg snapshot: A snapshot name :arg body: The snapshot definition :arg master_timeout: Explicit operation timeout for connection to master node :arg wait_for_completion: Should this request wait until the operation has completed before returning +Empty value passed for a required argument.PUT _snapshotparamsheadersbodyNr ValueError transportperform_requestrself repositorysnapshotr r r paramrJ/tmp/pip-target-4jja1joz/lib/python/opensearchpy/_async/client/snapshot.pycreates   zSnapshotClient.createcs@||fD]}|tvrtdq|jjdtd||||dIdHS)z Deletes a snapshot. :arg repository: A repository name :arg snapshot: A snapshot name :arg master_timeout: Explicit operation timeout for connection to master node rDELETEr r r Nrrrrr r rrrrdelete9s   zSnapshotClient.deleteZignore_unavailableZinclude_repositoryZ index_detailsverbosecs@||fD]}|tvrtdq|jjdtd||||dIdHS)aC Returns information about a snapshot. :arg repository: A repository name :arg snapshot: A comma-separated list of snapshot names :arg ignore_unavailable: Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown :arg include_repository: Whether to include the repository name in the snapshot info. Defaults to true. :arg index_details: Whether to include details of each index in the snapshot, if those details are available. Defaults to false. :arg master_timeout: Explicit operation timeout for connection to master node :arg verbose: Whether to show verbose snapshot info or only show the basic info found in the repository index blob rGETr rNrrrrrgetOs   zSnapshotClient.gettimeoutcs0|tvrtd|jjdtd|||dIdHS)a7 Deletes a repository. :arg repository: Name of the snapshot repository to unregister. Wildcard (`*`) patterns are supported. :arg master_timeout: Explicit operation timeout for connection to master node :arg timeout: Explicit operation timeout 8Empty value passed for a required argument 'repository'.rr rNrrrr r rrrdelete_repositoryts z SnapshotClient.delete_repositorylocalcs |jjdtd|||dIdHS)aW Returns information about a repository. :arg repository: A comma-separated list of repository names :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 rr rNrrrr#rrrget_repositorys zSnapshotClient.get_repositoryverifycs@||fD]}|tvrtdq|jjdtd||||dIdHS)aY Creates a repository. :arg repository: A repository name :arg body: The repository definition :arg master_timeout: Explicit operation timeout for connection to master node :arg timeout: Explicit operation timeout :arg verify: Whether to verify the repository after creation rrr r Nr)rrr r r rrrrcreate_repositorys  z SnapshotClient.create_repositorycsD||fD]}|tvrtdq|jjdtd||d|||dIdHS)a Restores a snapshot. :arg repository: A repository name :arg snapshot: A snapshot name :arg body: Details of what to restore :arg master_timeout: Explicit operation timeout for connection to master node :arg wait_for_completion: Should this request wait until the operation has completed before returning rPOSTr Z_restorer Nrrrrrrestores   zSnapshotClient.restorecs$|jjdtd||d||dIdHS)a Returns information about the status of a snapshot. :arg repository: A repository name :arg snapshot: A comma-separated list of snapshot names :arg ignore_unavailable: Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown :arg master_timeout: Explicit operation timeout for connection to master node rr Z_statusrNr&)rrrr r rrrstatuss  zSnapshotClient.statuscs2|tvrtd|jjdtd|d||dIdHS)z Verifies a repository. :arg repository: A repository name :arg master_timeout: Explicit operation timeout for connection to master node :arg timeout: Explicit operation timeout r"r*r Z_verifyrNrr#rrrverify_repositorys  z SnapshotClient.verify_repositorycs2|tvrtd|jjdtd|d||dIdHS)z Removes stale data from repository. :arg repository: A repository name :arg master_timeout: Explicit operation timeout for connection to master node :arg timeout: Explicit operation timeout r"r*r _cleanuprNrr#rrrcleanup_repositorys  z!SnapshotClient.cleanup_repositorycsJ||||fD]}|tvr tdq |jjdtd||d||||dIdHS)a Clones indices from one snapshot into another snapshot in the same repository. :arg repository: A repository name :arg snapshot: The name of the snapshot to clone from :arg target_snapshot: The name of the cloned snapshot to create :arg body: The snapshot clone definition :arg master_timeout: Explicit operation timeout for connection to master node rrr Z_cloner Nr)rrrZtarget_snapshotr r r rrrrclone s zSnapshotClient.cloneZ blob_countZ concurrencyZdetailedZearly_read_node_countZ max_blob_sizeZmax_total_data_sizeZrare_action_probabilityZrarely_abort_writesZread_node_countseedcs2|tvrtd|jjdtd|d||dIdHS)a8 Analyzes a repository for correctness and performance :arg repository: A repository name :arg blob_count: Number of blobs to create during the test. Defaults to 100. :arg concurrency: Number of operations to run concurrently during the test. Defaults to 10. :arg detailed: Whether to return detailed results or a summary. Defaults to 'false' so that only the summary is returned. :arg early_read_node_count: Number of nodes on which to perform an early read on a blob, i.e. before writing has completed. Early reads are rare actions so the 'rare_action_probability' parameter is also relevant. Defaults to 2. :arg max_blob_size: Maximum size of a blob to create during the test, e.g '1gb' or '100mb'. Defaults to '10mb'. :arg max_total_data_size: Maximum total size of all blobs to create during the test, e.g '1tb' or '100gb'. Defaults to '1gb'. :arg rare_action_probability: Probability of taking a rare action such as an early read or an overwrite. Defaults to 0.02. :arg rarely_abort_writes: Whether to rarely abort writes before they complete. Defaults to 'true'. :arg read_node_count: Number of nodes on which to read a blob after writing. Defaults to 10. :arg seed: Seed for the random number generator used to create the test workload. Defaults to a random value. :arg timeout: Explicit operation timeout. Defaults to '30s'. r"r*r Z_analyzerNrr#rrrrepository_analyze's+ z!SnapshotClient.repository_analyze)NNN)NN)NN)NN)NNN)NN)NNN)NNNN)NN)NN)NN)NN)__name__ __module__ __qualname__rrrr r$r'r)r+r,r-r/r0r2rrrrrsV             rN)utilsrrrrrrrrrs