3 ]@s,ddlmZmZmZmZGdddeZdS))NamespacedClient query_params _make_path SKIP_IN_PATHc@seZdZedddddZeddddZeddd dd d Zedd dd dZedddddZedd dd ddZ eddd!ddZ eddd"ddZ edd d#ddZ dS)$SnapshotClientZmaster_timeoutZwait_for_completionNcCs>x ||fD]}|tkr tdq W|jjdtd||||dS)a Create a snapshot in 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, default False z+Empty value passed for a required argument.PUT _snapshot)paramsbody)r ValueError transportperform_requestr)self repositorysnapshotr r paramrF/tmp/pip-build-z81i1n8o/elasticsearch/elasticsearch/client/snapshot.pycreates  zSnapshotClient.createcCs<x ||fD]}|tkr tdq W|jjdtd|||dS)aO Deletes a snapshot from a repository. ``_ :arg repository: A repository name :arg snapshot: A snapshot name :arg master_timeout: Explicit operation timeout for connection to master node z+Empty value passed for a required argument.DELETEr)r )rr r r r)rrrr rrrrdeletes  zSnapshotClient.deleteZignore_unavailableverbosecCs<x ||fD]}|tkr tdq W|jjdtd|||dS)a Retrieve 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 NotFoundError `snapshot_missing_exception` is thrown :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 z+Empty value passed for a required argument.GETr)r )rr r r r)rrrr rrrrget/s  zSnapshotClient.gettimeoutcCs(|tkrtd|jjdtd||dS)au Removes a shared file system repository. ``_ :arg repository: A comma-separated list of repository names :arg master_timeout: Explicit operation timeout for connection to master node :arg timeout: Explicit operation timeout z8Empty value passed for a required argument 'repository'.rr)r )rr r r r)rrr rrrdelete_repositoryEs z SnapshotClient.delete_repositorylocalcCs|jjdtd||dS)a Return information about registered repositories. ``_ :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)r )r r r)rrr rrrget_repositoryVs zSnapshotClient.get_repositoryverifycCs<x ||fD]}|tkr tdq W|jjdtd|||dS)a Registers a shared file system 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 z+Empty value passed for a required argument.rr)r r )rr r r r)rrr r rrrrcreate_repositoryfs  z SnapshotClient.create_repositorycCs@x ||fD]}|tkr tdq W|jjdtd||d||dS)a Restore 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, default False z+Empty value passed for a required argument.POSTrZ_restore)r r )rr r r r)rrrr r rrrrrestorezs  zSnapshotClient.restorecCs|jjdtd||d|dS)a Return information about all currently running snapshots. By specifying a repository name, it's possible to limit the results to a particular repository. ``_ :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 NotFoundError `snapshot_missing_exception` is thrown :arg master_timeout: Explicit operation timeout for connection to master node rrZ_status)r )r r r)rrrr rrrstatuss zSnapshotClient.statuscCs*|tkrtd|jjdtd|d|dS)a Returns a list of nodes where repository was successfully verified or an error message if verification process failed. ``_ :arg repository: A repository name :arg master_timeout: Explicit operation timeout for connection to master node :arg timeout: Explicit operation timeout z8Empty value passed for a required argument 'repository'.r rZ_verify)r )rr r r r)rrr rrrverify_repositorys z SnapshotClient.verify_repository)NN)N)N)N)NN)N)NN)NNN)N) __name__ __module__ __qualname__rrrrrrrr!r"r#rrrrrs$          rN)utilsrrrrrrrrrs