Class DbDatacentersClient

java.lang.Object
com.dtsx.astra.sdk.AbstractApiClient
com.dtsx.astra.sdk.db.DbDatacentersClient

public class DbDatacentersClient extends AbstractApiClient
Delegate operation on region/datacenters
  • Constructor Details

    • DbDatacentersClient

      public DbDatacentersClient(String token, String databaseId)
      As immutable object use builder to initiate the object.
      Parameters:
      token - authenticated token
    • DbDatacentersClient

      public DbDatacentersClient(String token, ApiLocator.AstraEnvironment env, String databaseId)
      As immutable object use builder to initiate the object.
      Parameters:
      env - define target environment to be used
      token - authenticated token
  • Method Details

    • findAll

      public Stream<Datacenter> findAll()
      Get Datacenters details for a region
      Returns:
      list of datacenters.
    • findByRegionName

      public Optional<Datacenter> findByRegionName(String regionName)
      Get a region from its name.
      Parameters:
      regionName - region name
      Returns:
      datacenter if exists i
    • exist

      public boolean exist(String regionName)
      Evaluate if a database exists using the findById method.
      Parameters:
      regionName - region name
      Returns:
      if region exist
    • create

      public void create(String tier, CloudProviderType cloudProvider, String regionName)
      Create a Region.
      Parameters:
      tier - tier for the db
      cloudProvider - Cloud provider to add a region
      regionName - name of the region

      https://docs.datastax.com/en/astra/docs/_attachments/devopsv2.html#operation/addDatacenters

    • delete

      public void delete(String regionName)
      Delete a region from its name.
      Parameters:
      regionName - name of the region

      https://docs.datastax.com/en/astra/docs/_attachments/devopsv2.html#operation/terminateDatacenter