| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 | [[java-rest-high-snapshot-delete-repository]]=== Snapshot Delete Repository APIThe Snapshot Delete Repository API allows to delete a registered repository.[[java-rest-high-snapshot-delete-repository-request]]==== Snapshot Delete Repository RequestA `DeleteRepositoryRequest`:["source","java",subs="attributes,callouts,macros"]--------------------------------------------------include-tagged::{doc-tests}/SnapshotClientDocumentationIT.java[delete-repository-request]--------------------------------------------------==== Optional ArgumentsThe following arguments can optionally be provided:["source","java",subs="attributes,callouts,macros"]--------------------------------------------------include-tagged::{doc-tests}/SnapshotClientDocumentationIT.java[create-repository-request-timeout]--------------------------------------------------<1> Timeout to wait for the all the nodes to acknowledge the settings were appliedas a `TimeValue`<2> Timeout to wait for the all the nodes to acknowledge the settings were appliedas a `String`["source","java",subs="attributes,callouts,macros"]--------------------------------------------------include-tagged::{doc-tests}/SnapshotClientDocumentationIT.java[delete-repository-request-masterTimeout]--------------------------------------------------<1> Timeout to connect to the master node as a `TimeValue`<2> Timeout to connect to the master node as a `String`[[java-rest-high-snapshot-delete-repository-sync]]==== Synchronous Execution["source","java",subs="attributes,callouts,macros"]--------------------------------------------------include-tagged::{doc-tests}/SnapshotClientDocumentationIT.java[delete-repository-execute]--------------------------------------------------[[java-rest-high-snapshot-delete-repository-async]]==== Asynchronous ExecutionThe asynchronous execution of a snapshot delete repository requires both the`DeleteRepositoryRequest` instance and an `ActionListener` instance to bepassed to the asynchronous method:["source","java",subs="attributes,callouts,macros"]--------------------------------------------------include-tagged::{doc-tests}/SnapshotClientDocumentationIT.java[delete-repository-execute-async]--------------------------------------------------<1> The `DeleteRepositoryRequest` to execute and the `ActionListener`to use when the execution completesThe asynchronous method does not block and returns immediately. Once it iscompleted the `ActionListener` is called back using the `onResponse` methodif the execution successfully completed or using the `onFailure` method ifit failed.A typical listener for `DeleteRepositoryResponse` looks like:["source","java",subs="attributes,callouts,macros"]--------------------------------------------------include-tagged::{doc-tests}/SnapshotClientDocumentationIT.java[delete-repository-execute-listener]--------------------------------------------------<1> Called when the execution is successfully completed. The response isprovided as an argument<2> Called in case of a failure. The raised exception is provided as an argument[[java-rest-high-cluster-delete-repository-response]]==== Snapshot Delete Repository ResponseThe returned `DeleteRepositoryResponse` allows to retrieve information about theexecuted operation as follows:["source","java",subs="attributes,callouts,macros"]--------------------------------------------------include-tagged::{doc-tests}/SnapshotClientDocumentationIT.java[delete-repository-response]--------------------------------------------------<1> Indicates the node has acknowledged the request
 |