Package s2.client

Class Client

All Implemented Interfaces:
AutoCloseable

public class Client extends BaseClient
Client for account-level operations.
  • Constructor Details

    • Client

      public Client(Config config)
      Instantiates a new Client, using default settings for creating a channel, as well as an executor service.
      Parameters:
      config - the config
    • Client

      public Client(Config config, io.grpc.ManagedChannel channel, ScheduledExecutorService executor)
      Instantiates a new Client.

      Note that the executor is not the same as that used internally by netty for grpc (which, for the moment, is not controllable by clients). This executor is used for other async calls initiated by the SDK, such as application-level retries, timeouts, and transformations.

      The executor used by this Client class will be shared with any BasinClient constructed from it (and, similarly, will be used for any StreamClient constructed from the BasinClient).

      Parameters:
      config - the config
      channel - the channel
      executor - the executor
  • Method Details

    • listBasins

      public com.google.common.util.concurrent.ListenableFuture<Paginated<BasinInfo>> listBasins(ListBasinsRequest request)
      List basins.
      Parameters:
      request - the request
      Returns:
      future of a paginated list of basin infos
    • createBasin

      public com.google.common.util.concurrent.ListenableFuture<BasinInfo> createBasin(CreateBasinRequest request)
      Create a new basin.
      Parameters:
      request - the creation request
      Returns:
      future of the resulting basin's info
    • deleteBasin

      public com.google.common.util.concurrent.ListenableFuture<Void> deleteBasin(String basin)
      Delete a basin.

      Basin deletion is asynchronous, and may take a few minutes to complete.

      Parameters:
      basin - the basin
      Returns:
      future representing the completion of the delete call
    • reconfigureBasin

      public com.google.common.util.concurrent.ListenableFuture<BasinConfig> reconfigureBasin(ReconfigureBasinRequest reconfigure)
      Update configuration of an existing basin.
      Parameters:
      reconfigure - the reconfigure request
      Returns:
      future of the updated configuration
    • getBasinConfig

      public com.google.common.util.concurrent.ListenableFuture<BasinConfig> getBasinConfig(String basin)
      Get a basin's config.
      Parameters:
      basin - the basin
      Returns:
      future of the basin configuration
    • basinClient

      public BasinClient basinClient(String basin)
      Create a BasinClient for interacting with basin-level RPCs.

      The generated client will use the same channel if possible.

      Parameters:
      basin - the basin
      Returns:
      the basin client