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
ConstructorsConstructorDescriptionDatabaseClient(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 classvoiddelete()Terminates a database.voiddownloadAllSecureConnectBundles(String destination) Download all SecureBundle.voiddownloadDefaultSecureConnectBundle(String destination) Download SecureBundle for a specific data centervoiddownloadSecureConnectBundle(String region, String destination) Download SecureBundle for a specific data centerbooleanexist()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)booleanisActive()If the app is active.Work with keyspaces.voidpark()Parks a database (classic)Delegate privateLink operation in a dedicated classvoidresetPassword(String username, String password) Resets Password.voidresize(int capacityUnits) Resizes a database.Delegate Telemetry operation in a dedicated classvoidunpark()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 token
-
DatabaseClient
As immutable object use builder to initiate the object.- Parameters:
env- define target environment to be usedtoken- authenticated token
-
-
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
-