Class AstraDbClient

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

public class AstraDbClient extends AbstractApiClient
Devops API Client working with Databases.
  • Constructor Details

    • AstraDbClient

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

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

    • regions

      public DbRegionsClient regions()
      Access Astra Db region topology.
      Returns:
      work with regions
    • findAllAccessLists

      public Stream<AccessList> findAllAccessLists()
      Find All Access List.
      Returns:
      access list
    • findAll

      public Stream<Database> findAll()
      Returns list of databases with default filter. (include=non terminated, provider=ALL,limit=25)
      Returns:
      matching db
    • findAllNonTerminated

      public Stream<Database> findAllNonTerminated()
      Default Filter to find databases.
      Returns:
      list of non terminated db
    • findByName

      public Stream<Database> findByName(String name)
      Retrieve list of all Databases of the account and filter on name
      Parameters:
      name - a database name
      Returns:
      list of db matching the criteria
    • findFirstByName

      public Optional<Database> findFirstByName(String name)
      Retrieve frist DB from its name.
      Parameters:
      name - name
      Returns:
      if the db exists or not
    • findById

      public Optional<Database> findById(String id)
      Find a database from its id.
      Parameters:
      id - a database name
      Returns:
      list of db matching the criteria
    • search

      public Stream<Database> search(DatabaseFilter filter)
      Find Databases matching the provided filter. https://docs.datastax.com/en/astra/docs/_attachments/devopsv1.html#operation/listDatabases
      Parameters:
      filter - filter to search for db
      Returns:
      list of db
    • create

      public String create(DatabaseCreationRequest dbCreationRequest)
      Create a database base on some parameters.
      Parameters:
      dbCreationRequest - creation request with tier and capacity unit
      Returns:
      the new instance id. https://docs.datastax.com/en/astra/docs/_attachments/devopsv1.html#operation/createDatabase
    • database

      public DatabaseClient database(String dbId)
      Use the database part of the API.
      Parameters:
      dbId - unique identifier id
      Returns:
      client specialized for this db
    • databaseByName

      public DatabaseClient databaseByName(String dbName)
      Use the database part of the API from its name.
      Parameters:
      dbName - name for a database
      Returns:
      DatabaseClient
    • getEndpointDatabases

      public String getEndpointDatabases()
      Endpoint to access schema for namespace.
      Returns:
      endpoint
    • getEndpointAccessLists

      public String getEndpointAccessLists()
      Endpoint to access schema for namespace.
      Returns:
      endpoint