_YGã@s<ddlmZmZmZmZGdd„deƒZdS)é)ÚNamespacedClientÚ query_paramsÚ _make_pathÚ SKIP_IN_PATHc@s-eZdZeddƒdddd„ƒZedƒddd„ƒZeddƒdd d „ƒZedd ƒdd d „ƒZeddƒdddd„ƒZedd dƒddd„ƒZ eddƒdddd„ƒZ eddƒddddd„ƒZ edd ƒddd„ƒZ dS)ÚSnapshotClientZmaster_timeoutZwait_for_completionNcCsZx,||fD]}|tkr tdƒ‚q W|jjdtd||ƒd|d|ƒS)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ÚparamsÚbody)rÚ ValueErrorÚ transportÚperform_requestr)ÚselfÚ repositoryÚsnapshotr r Úparam©rúF/tmp/pip-build-66pc0izb/elasticsearch/elasticsearch/client/snapshot.pyÚcreates  zSnapshotClient.createcCsTx,||fD]}|tkr tdƒ‚q W|jjdtd||ƒd|ƒS)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.ÚDELETErr )rr r r r)rrrr rrrrÚdeletes   zSnapshotClient.deleteZignore_unavailablecCsTx,||fD]}|tkr tdƒ‚q W|jjdtd||ƒd|ƒS)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 SnapshotMissingException is thrown :arg master_timeout: Explicit operation timeout for connection to master node z+Empty value passed for a required argument.ÚGETrr )rr r r r)rrrr rrrrÚget)s  zSnapshotClient.getÚtimeoutcCs:|tkrtdƒ‚|jjdtd|ƒd|ƒS)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'.rrr )rr r r r)rrr rrrÚdelete_repository<s   z SnapshotClient.delete_repositoryÚlocalcCs"|jjdtd|ƒd|ƒS)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 rrr )r r r)rrr rrrÚget_repositoryLs zSnapshotClient.get_repositoryÚverifycCsWx,||fD]}|tkr tdƒ‚q W|jjdtd|ƒd|d|ƒS)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.rrr r )rr r r r)rrr r rrrrÚcreate_repository[s  z SnapshotClient.create_repositorycCs]x,||fD]}|tkr tdƒ‚q W|jjdtd||dƒd|d|ƒS)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_restorer r )rr r r r)rrrr r rrrrÚrestorens  zSnapshotClient.restorecCs(|jjdtd||dƒd|ƒS)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 SnapshotMissingException is thrown :arg master_timeout: Explicit operation timeout for connection to master node rrZ_statusr )r r r)rrrr rrrÚstatus‚szSnapshotClient.statuscCs=|tkrtdƒ‚|jjdtd|dƒd|ƒS)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'.rrZ_verifyr )rr r r r)rrr rrrÚverify_repository”s  z SnapshotClient.verify_repository) Ú__name__Ú __module__Ú __qualname__rrrrrrrr r!r"rrrrrs$         rN)ÚutilsrrrrrrrrrÚs"