Package com.orbitz.consul
Class SnapshotClient
- java.lang.Object
-
- com.orbitz.consul.SnapshotClient
-
public class SnapshotClient extends java.lang.ObjectHTTP Client for /v1/snapshot/ endpoints.- See Also:
- The Consul API Docs for Snapshots
-
-
Method Summary
Modifier and Type Method Description ClientConfiggetConfig()ClientEventHandlergetEventHandler()voidrestore(java.io.File sourceFile, QueryOptions queryOptions, Callback<java.lang.Void> callback)Restores a snapshot stored in a file.voidsave(java.io.File destinationFile, QueryOptions queryOptions, Callback<java.math.BigInteger> callback)Requests a new snapshot and save it in a file.
-
-
-
Field Detail
-
http
protected final Http http
-
-
Method Detail
-
save
public void save(java.io.File destinationFile, QueryOptions queryOptions, Callback<java.math.BigInteger> callback)Requests a new snapshot and save it in a file. Only a subset of the QueryOptions is supported: datacenter, consistencymode, and token.- Parameters:
destinationFile- file in which the snapshot is to be saved.queryOptions- query options. Only a subset of the QueryOptions is supported: datacenter, consistencymode, and token.callback- callback called once the operation is over. It the save operation is successful, the X-Consul-Index is send.
-
restore
public void restore(java.io.File sourceFile, QueryOptions queryOptions, Callback<java.lang.Void> callback)Restores a snapshot stored in a file.- Parameters:
sourceFile- source file where the snapshot is stored.queryOptions- query options. Only a subset of the QueryOptions is supported: datacenter, token.callback- callback called once the operation is over.
-
getConfig
public ClientConfig getConfig()
-
getEventHandler
public ClientEventHandler getEventHandler()
-
-