Package com.dtsx.astra.sdk.db
Class DatabaseClient
java.lang.Object
com.dtsx.astra.sdk.AbstractApiClient
com.dtsx.astra.sdk.db.DatabaseClient
Devops API Client working with a Database.
-
Field Summary
Fields inherited from class com.dtsx.astra.sdk.AbstractApiClient
environment, token
-
Constructor Summary
ConstructorDescriptionDatabaseClient
(String token, ApiLocator.AstraEnvironment env, String databaseId) As immutable object use builder to initiate the object.DatabaseClient
(String token, String databaseId) As immutable object use builder to initiate the object. -
Method Summary
Modifier and TypeMethodDescriptionDelegate access lists operation in a dedicated classbuildScbFileName
(String dId, String dbRegion) Build filename for the secure connect bundle.cdc()
Delegate cdc operation in a dedicated classDelegate datacenters operation in a dedicated classvoid
delete()
Terminates a database.void
downloadAllSecureConnectBundles
(String destination) Download all SecureBundle.void
downloadDefaultSecureConnectBundle
(String destination) Download SecureBundle for a specific data centervoid
downloadSecureConnectBundle
(String region, String destination) Download SecureBundle for a specific data centerboolean
exist()
Evaluate if a database exists using the findById method.find()
Retrieve a DB by its id.get()
Retrieve database or throw error.Gets databaseIdEndpoint to access dbs.getEndpointDatabase
(String dbId) Endpoint to access dbs (static)boolean
isActive()
If the app is active.Work with keyspaces.void
park()
Parks a database (classic)Delegate privateLink operation in a dedicated classvoid
resetPassword
(String username, String password) Resets Password.void
resize
(int capacityUnits) Resizes a database.Delegate Telemetry operation in a dedicated classvoid
unpark()
unpark a database.Methods inherited from class com.dtsx.astra.sdk.AbstractApiClient
assertHttpCodeAccepted, DELETE, GET, getHttpClient, getToken, HEAD, PATCH, POST, POST, PUT
-
Constructor Details
-
DatabaseClient
As immutable object use builder to initiate the object.- Parameters:
token
- authenticated tokendatabaseId
- database identifier
-
DatabaseClient
As immutable object use builder to initiate the object.- Parameters:
env
- define target environment to be usedtoken
- authenticated tokendatabaseId
- database identifier
-
-
Method Details
-
find
Retrieve a DB by its id.- Returns:
- the database if present,
-
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
Download SecureBundle for a specific data center- Parameters:
destination
- file to save the secure bundle
-
downloadSecureConnectBundle
Download SecureBundle for a specific data center- Parameters:
destination
- file to save the secure bundleregion
- download for a target region
-
downloadAllSecureConnectBundles
Download all SecureBundle.- Parameters:
destination
- file to save the secured bundle
-
buildScbFileName
Build filename for the secure connect bundle.- Parameters:
dId
- databaseIddbRegion
- 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 Astrahttps://docs.datastax.com/en/astra/docs/_attachments/devopsv1.html#operation/resizeDatabase
-
resetPassword
Resets Password.- Parameters:
username
- usernamepassword
- passwordhttps://docs.datastax.com/en/astra/docs/_attachments/devopsv1.html#operation/resetPassword
-
keyspaces
Work with keyspaces.- Returns:
- keyspaces client
-
datacenters
Delegate datacenters operation in a dedicated class- Returns:
- cdc client
-
accessLists
Delegate access lists operation in a dedicated class- Returns:
- access list client
-
cdc
Delegate cdc operation in a dedicated class- Returns:
- cdc client
-
telemetry
Delegate Telemetry operation in a dedicated class- Returns:
- telemetry client
-
privateLink
Delegate privateLink operation in a dedicated class- Returns:
- privateLink client
-
getDatabaseId
Gets databaseId- Returns:
- value of databaseId
-
getEndpointDatabase
Endpoint to access dbs.- Returns:
- database endpoint
-
getEndpointDatabase
Endpoint to access dbs (static)- Parameters:
dbId
- database identifier- Returns:
- database endpoint
-