Optional
additionalAdditional headers to include in the HTTP requests to the DevOps API.
There are more than likely more official/structured ways to set any desired headers, such as through TokenProviders or EmbeddingHeadersProviders. This is more of a last-resort option, such as for enabling feature-flags or other non-standard headers.
Optional
adminThe access token for the DevOps API, typically of the format 'AstraCS:...'
.
If never provided, this will default to the token provided when creating the DataAPIClient.
May be useful for if you want to use a stronger token for the DevOps API than the Data API.
const client = new DataAPIClient('weak-token');
// Using 'weak-token' as the token
const db = client.db();
// Using 'strong-token' instead of 'weak-token'
const admin = client.admin({ adminToken: 'strong-token' });
Optional
astraThe Astra environment to use when interacting with the DevOps API.
In the case of AstraDbAdmin, if a database endpoint is provided, and its environment does NOT match this value (if it is set), it will throw an error.
In the case of DataAPIDbAdmin, it will simply ignore this value.
Optional
endpointThe base URL for the devops API, which is typically always going to be the following:
https://api.astra.datastax.com/v2
Optional
loggingThe configuration for logging events emitted by the DataAPIClient.
This can be set at any level of the major class hierarchy, and will be inherited by all child classes.
See DataAPILoggingConfig for much more information on configuration, outputs, and inheritance.
Optional
timeoutThe default timeout options for any operation on this admin instance.
See TimeoutDescriptor for much more information about timeouts.
// The request timeout for all operations is set to 1000ms.
const client = new DataAPIClient('...', {
timeoutDefaults: { requestTimeoutMs: 1000 },
});
// The request timeout for all operations borne from this Db is set to 2000ms.
const db = client.db('...', {
timeoutDefaults: { requestTimeoutMs: 2000 },
});
The timeout options are inherited by all child classes, and can be overridden at any level, including the individual method level.
Individual-method-level overrides can vary in behavior depending on the method; again, see TimeoutDescriptor.
The default timeout options are as follows:
requestTimeoutMs
: 10000generalMethodTimeoutMs
: 30000collectionAdminTimeoutMs
: 60000tableAdminTimeoutMs
: 30000databaseAdminTimeoutMs
: 600000keyspaceAdminTimeoutMs
: 30000TimeoutDescriptor
The options available spawning a new AstraAdmin instance.
Note that this is only available when using Astra as the underlying database.
If any of these options are not provided, the client will use the default options provided by the DataAPIClient.