Find available regions
Get a list of available regions for database creation.
The clients only return regions that support vector databases.
To return other regions, use HTTP (curl) instead with the region-type query parameter.
|
You need an application token with permission to create and configure databases, such as the Organization Administrator role. For more information, see Get endpoint and token. |
Result
-
Python
-
TypeScript
-
Java
-
curl
Returns:
A list of AstraDBAvailableRegionInfo objects describing the available regions.
Returns:
A promise that resolves to a list of AstraDBAvailableRegionInfo objects describing the available regions.
Returns:
A list of AstraAvailableRegionInfo objects describing the available regions.
Returns:
A successful request returns 200 Success and a list of objects containing information about each region.
Result
[
{
"classification": "standard",
"cloudProvider": "GCP",
"displayName": "Moncks Corner, South Carolina",
"enabled": true,
"name": "us-east1",
"region_type": "serverless",
"reservedForQualifiedUsers": false,
"zone": "na"
},
{
"classification": "standard",
"cloudProvider": "AWS",
"displayName": "Asia Pacific (Mumbai)",
"enabled": true,
"name": "ap-south-1",
"region_type": "serverless",
"reservedForQualifiedUsers": true,
"zone": "apac"
}
]
Parameters
-
Python
-
TypeScript
-
Java
-
curl
This operation is done through an instance of the AstraDBAdmin class.
db_info = admin.find_available_regions()
Parameters:
| Name | Type | Summary |
|---|---|---|
|
|
Optional. Whether to only return regions that can be used by the caller’s organization. Default: True |
|
|
A timeout, in milliseconds, for the API request.
This parameter is aliased as |
This operation is done through an instance of the AstraAdmin class.
const dbInfo = admin.findAvailableRegions();
Parameters:
| Name | Type | Summary |
|---|---|---|
|
|
Optional.
The options for this method.
See Properties of |
| Name | Type | Summary |
|---|---|---|
|
|
Optional. Whether to only return regions that can be used by the caller’s organization. Default: true |
|
|
Optional.
A timeout, in milliseconds, for the API request.
If not provided, the corresponding |
// Given 'admin', a AstraDBAdmin object
admin.findAvailableRegions();
Parameters:
| Name | Type | Summary |
|---|---|---|
|
|
Optional.
The options for this method.
See Properties of |
| Name | Type | Summary |
|---|---|---|
|
|
Optional. Whether to only return regions that can be used by the caller’s organization. Default: true |
Use the DevOps API to get information about available regions programmatically.
The application token must have sufficient permissions to perform the requested operations, such as the Database Administrator role.
Query parameters:
| Name | Type | Summary |
|---|---|---|
|
|
Optional. Only return regions that support specific database types. Can be one of: "all" (return both vector and serverless regions), "vector" (return only vector regions), "" (return only serverless regions). Default: "" |
|
|
Optional. Whether to only return regions that can be used by the caller’s organization. Can be one of: "enabled", "disabled". Default: "disabled" |
Examples
The following examples demonstrate how to find available regions.
-
Python
-
TypeScript
-
Java
-
curl
from astrapy import DataAPIClient
admin = DataAPIClient("APPLICATION_TOKEN").get_admin()
regions = admin.find_available_regions()
import { DataAPIClient } from '@datastax/astra-db-ts'
const admin = new DataAPIClient('APPLICATION_TOKEN').admin();
(async function () {
const regions = await admin.findAvailableRegions();
})();
import java.util.List;
import com.datastax.astra.client.DataAPIClient;
import com.datastax.astra.client.admin.AstraDBAdmin;
import com.datastax.astra.client.admin.commands.AstraAvailableRegionInfo;
import com.datastax.astra.client.admin.options.AstraFindAvailableRegionsOptions;
import com.datastax.astra.client.core.options.DataAPIClientOptions;
public class Example {
public static void main(String[] args) {
DataAPIClient client = new DataAPIClient(new DataAPIClientOptions());
AstraDBAdmin admin = client.getAdmin();
List<AstraAvailableRegionInfo> regions = admin.findAvailableRegions(new AstraFindAvailableRegionsOptions());
}
}
curl -sS -L -X GET "https://api.astra.datastax.com/v2/regions/serverless" \
--header "Authorization: Bearer APPLICATION_TOKEN" \
--header "Content-Type: application/json"
Client reference
-
Python
-
TypeScript
-
Java
-
curl
For more information, see the client reference.
For more information, see the client reference.
For more information, see the client reference.
Client reference documentation is not applicable for HTTP.