Find available regions
Gets a list of available regions for database creation.
The clients only return regions that support vector databases.
To return other regions, use direct HTTP requests, as demonstrated in the curl tab, 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 an AstraDBAvailableRegionInfo object that contains information about the available regions.
Returns a promise that resolves to an AstraDBAvailableRegionInfo object that contains information about the available regions.
Returns an AstraAvailableRegionInfo object that contains information about the available regions.
Returns 200 Success and an object that contains information about the available regions.
Example response:
[
{
"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
Use the find_available_regions method, which belongs to the AstraDBAdmin class.
Method signature
find_available_regions(
*,
only_org_enabled_regions: bool,
database_admin_timeout_ms: int,
request_timeout_ms: int,
timeout_ms: int,
) -> list[AstraDBAvailableRegionInfo]
| 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, to impose on the underlying API request.
If not provided, the This parameter is aliased as |
Use the findAvailableRegions method, which belongs to the AstraAdmin class.
Method signature
async findAvailableRegions(
options?: {
onlyOrgEnabledRegions?: boolean,
timeout: number | TimeoutDescriptor,
}
): AstraAvailableRegionInfo[];
| 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 |
Use the findAvailableRegions method, which belongs to the com.datastax.astra.client.admin.AstraDBAdmin class.
Method signature
List<AstraAvailableRegionInfo> findAvailableRegions(AstraFindAvailableRegionsOptions options)
| 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.
Command signature
curl -sS -L -X GET "https://api.astra.datastax.com/v2/regions/serverless?region-type=REGION_TYPE&filter-by-org=FILTER_BY_ORG" \
--header "Authorization: Bearer APPLICATION_TOKEN" \
--header "Content-Type: application/json"
| Name | Type | Summary |
|---|---|---|
|
|
Optional. Only return regions that support specific database types. Can be one of:
Default: "" |
|
|
Optional. Whether to only return regions that can be used by the caller’s organization. Can be one of: Default: |
Examples
The following examples demonstrate how to find available regions.
-
Python
-
TypeScript
-
Java
-
curl
from astrapy import DataAPIClient
client = DataAPIClient("APPLICATION_TOKEN")
admin = client.get_admin()
regions = admin.find_available_regions()
print(regions)
import { DataAPIClient } from "@datastax/astra-db-ts";
const client = new DataAPIClient("APPLICATION_TOKEN");
const admin = client.admin();
(async function () {
const regions = await admin.findAvailableRegions();
console.log(regions);
})();
import com.datastax.astra.client.DataAPIClient;
import com.datastax.astra.client.admin.AstraDBAdmin;
import com.datastax.astra.client.admin.commands.AstraAvailableRegionInfo;
import java.util.List;
public class Example {
public static void main(String[] args) {
DataAPIClient client = new DataAPIClient("APPLICATION_TOKEN");
AstraDBAdmin admin = client.getAdmin();
List<AstraAvailableRegionInfo> regions = admin.findAvailableRegions(null);
System.out.println(regions);
}
}
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.