Class SnapshotClient

java.lang.Object
org.kiwiproject.consul.SnapshotClient

public class SnapshotClient extends Object
HTTP Client for /v1/snapshot/ endpoints.
See Also:
  • Field Details

    • http

      protected final Http http
  • Method Details

    • save

      public void save(File destinationFile, QueryOptions queryOptions, Callback<BigInteger> callback)
      Requests a new snapshot and save it in a file. Only a subset of the QueryOptions is supported: datacenter, consistency mode, 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, consistency mode, and token.
      callback - callback called once the operation is over. It the save operation is successful, the X-Consul-Index is sent.
    • restore

      public void restore(File sourceFile, QueryOptions queryOptions, Callback<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()