Class DatabaseClient

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

public class DatabaseClient extends AbstractApiClient
Devops API Client working with a Database.
  • Constructor Details

    • DatabaseClient

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

      public DatabaseClient(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

    • find

      public Optional<Database> find()
      Retrieve a DB by its id.
      Returns:
      the database if present,
    • get

      public Database get()
      Retrieve database or throw error.
      Returns:
      current db or error
    • exist

      public boolean exist()
      Evaluate if a database exists using the findById method.
      Returns:
      database existence
    • isActive

      public boolean isActive()
      If the app is active.
      Returns:
      tells if database is ACTIVE
    • downloadDefaultSecureConnectBundle

      public void downloadDefaultSecureConnectBundle(String destination)
      Download SecureBundle for a specific data center
      Parameters:
      destination - file to save the secure bundle
    • downloadSecureConnectBundle

      public void downloadSecureConnectBundle(String region, String destination)
      Download SecureBundle for a specific data center
      Parameters:
      destination - file to save the secure bundle
      region - download for a target region
    • downloadAllSecureConnectBundles

      public void downloadAllSecureConnectBundles(String destination)
      Download all SecureBundle.
      Parameters:
      destination - file to save the secured bundle
    • buildScbFileName

      public String buildScbFileName(String dId, String dbRegion)
      Build filename for the secure connect bundle.
      Parameters:
      dId - databaseId
      dbRegion - databaseRegion
      Returns:
      file name for the secure bundled
    • park

      public void park()
      Parks a database (classic)
    • unpark

      public void unpark()
      unpark a database.

      https://docs.datastax.com/en/astra/docs/_attachments/devopsv1.html#operation/unparkDatabase

    • delete

      public void delete()
      Terminates a database.

      https://docs.datastax.com/en/astra/docs/_attachments/devopsv1.html#operation/terminateDatabase

    • resize

      public void resize(int capacityUnits)
      Resizes a database.
      Parameters:
      capacityUnits - sizing of a 'classic' db in Astra

      https://docs.datastax.com/en/astra/docs/_attachments/devopsv1.html#operation/resizeDatabase

    • resetPassword

      public void resetPassword(String username, String password)
      Resets Password.
      Parameters:
      username - username
      password - password

      https://docs.datastax.com/en/astra/docs/_attachments/devopsv1.html#operation/resetPassword

    • keyspaces

      public DbKeyspacesClient keyspaces()
      Work with keyspaces.
      Returns:
      keyspaces client
    • datacenters

      public DbDatacentersClient datacenters()
      Delegate datacenters operation in a dedicated class
      Returns:
      cdc client
    • accessLists

      public DbAccessListsClient accessLists()
      Delegate access lists operation in a dedicated class
      Returns:
      access list client
    • cdc

      public DbCdcsClient cdc()
      Delegate cdc operation in a dedicated class
      Returns:
      cdc client
    • telemetry

      public DbTelemetryClient telemetry()
      Delegate Telemetry operation in a dedicated class
      Returns:
      telemetry client
    • privateLink

      public DbPrivateLinksClient privateLink()
      Delegate privateLink operation in a dedicated class
      Returns:
      privateLink client
    • getDatabaseId

      public String getDatabaseId()
      Gets databaseId
      Returns:
      value of databaseId
    • getEndpointDatabase

      public String getEndpointDatabase()
      Endpoint to access dbs.
      Returns:
      database endpoint
    • getEndpointDatabase

      public String getEndpointDatabase(String dbId)
      Endpoint to access dbs (static)
      Parameters:
      dbId - database identifier
      Returns:
      database endpoint