List PCU groups
Lists all Provisioned Capacity Units (PCUs) in an organization.
|
You need an application token with the Organization Administrator or Billing Administrator role. For more information, see Get endpoint and token. |
Result
-
Python
-
TypeScript
-
Go
-
Java
-
C#
-
curl
Returns an unordered list of PCUGroupDescriptor objects.
Each object describes a PCU group in the organization.
Returns a promise that resolves to an unordered list of AstraPCUGroupDescriptor objects.
Each object describes a PCU group in the organization.
|
The Go client is in preview. For more information, see astra-db-go. |
Returns an unordered slice of PCUGroup structs.
Each struct describes a PCU group in the organization.
Returns an unordered list of PCUGroupDefinition objects.
Each object describes a PCU group in the organization.
Returns an unordered list of DataStax.AstraDB.DataApi.Admin.PCUGroup objects.
Each object describes a PCU group in the organization.
Returns an unordered list of JSON objects. Each object describes a PCU group in the organization.
Parameters
-
Python
-
TypeScript
-
Go
-
Java
-
C#
-
curl
Use the list_pcu_groups method, which belongs to the AstraDBAdmin class.
Method signature
list_pcu_groups(
*,
cloud_provider: str,
region: str,
database_admin_timeout_ms: int,
request_timeout_ms: int,
timeout_ms: int
) -> list[PCUGroupDescriptor]
| Name | Type | Summary |
|---|---|---|
|
|
Required if you specify Only returns PCU groups for this cloud provider. Can be one of: |
|
|
Required if you specify Only returns PCU groups in this cloud provider region. The available regions depend on your plan and the database type. To find available regions, see Find available regions. |
|
|
Optional.
A timeout, in milliseconds, to impose on the underlying API request.
If not provided, the This parameter is aliased as |
Use the listPCUGroups method, which belongs to the AstraAdmin class.
Method signature
async listPCUGroups(
options?: {
cloudProvider?: AstraDatabaseCloudProvider,
region?: string,
timeout?: number | TimeoutDescriptor,
}): AstraPCUGroupDescriptor[]
| Name | Type | Summary |
|---|---|---|
|
Optional.
The options for this operation.
See Properties of |
| Name | Type | Summary |
|---|---|---|
|
|
Required if you specify Only returns PCU groups for this cloud provider. |
|
|
Required if you specify Only returns PCU groups in this cloud provider region. The available regions depend on your plan and the database type. To find available regions, see Find available regions. |
|
|
Optional. A timeout to impose on the underlying API request. |
|
The Go client is in preview. For more information, see astra-db-go. |
Use the ListPCUGroups method, which belongs to the AstraAdmin type.
Method signature
func (a *AstraAdmin) ListPCUGroups(
ctx context.Context,
opts ...options.ListPCUGroupsOption
) ([]PCUGroup, error)
| Name | Type | Summary |
|---|---|---|
|
|
The context for the operation. |
|
Optional.
A builder to generate options for this operation.
See Methods of the |
| Method | Summary |
|---|---|
|
Required if you specify Only returns PCU groups for this cloud provider. |
|
Required if you specify Only returns PCU groups in this cloud provider region. The available regions depend on your plan and the database type. To find available regions, see Find available regions. |
|
Optional. General API options for this operation, including the timeout. |
Use the listPCUGroups method, which belongs to the com.datastax.astra.client.admin.AstraDBAdmin class.
Method signature
List<PCUGroupDefinition> listPCUGroups()
List<PCUGroupDefinition> listPCUGroups(
CloudProviderType cloudProvider,
String region
)
| Name | Type | Summary |
|---|---|---|
|
|
Only returns PCU groups for this cloud provider. |
|
|
Only returns PCU groups in this cloud provider region. The available regions depend on your plan and the database type. To find available regions, see Find available regions. |
Use the ListPCUGroupsAsync method, which belongs to the AstraDatabasesAdmin class.
You can also use ListPCUGroups, which is the synchronous version of the method.
Method signature
public Task<List<PCUGroup>> ListPCUGroupsAsync(
ListPCUGroupsOptions options = null
);
| Name | Type | Summary |
|---|---|---|
|
|
Optional.
General API options for this operation, including the timeout.
For more information and examples, see Customize API interaction.
For options specific to this method, see Method-specific properties of the |
| Name | Type | Summary |
|---|---|---|
|
|
Required if you specify Only returns PCU groups for this cloud provider. |
|
|
Required if you specify Only returns PCU groups in this cloud provider region. The available regions depend on your plan and the database type. To find available regions, see Find available regions. |
Use the DevOps API.
The application token must have sufficient permissions to perform the requested operations, such as the Organization Administrator role. Additionally, the application token identifies the organization to query.
Command signature
curl -sS -L -X GET "https://api.astra.datastax.com/v2/pcus/actions/get" \
--header "Authorization: Bearer APPLICATION_TOKEN" \
--header "Content-Type: application/json"
This endpoint does not accept any parameters.
Examples
The following examples demonstrate how to list PCU groups.
List all PCU groups
-
Python
-
TypeScript
-
Go
-
Java
-
C#
-
curl
from astrapy import DataAPIClient
client = DataAPIClient("APPLICATION_TOKEN")
admin = client.get_admin()
groups = admin.list_pcu_groups()
print(groups)
import { DataAPIClient } from "@datastax/astra-db-ts";
const client = new DataAPIClient("APPLICATION_TOKEN");
const admin = client.admin();
(async function () {
const groups = await admin.listPCUGroups();
console.log(groups);
})();
|
The Go client is in preview. For more information, see astra-db-go. |
package main
import (
"context"
"encoding/json"
"fmt"
"log"
"github.com/datastax/astra-db-go/v2/astra"
"github.com/datastax/astra-db-go/v2/astra/options"
)
func main() {
ctx := context.Background()
client := astra.NewClient(
options.API().SetToken("APPLICATION_TOKEN"),
)
admin, err := client.Admin()
if err != nil {
log.Fatal(err)
}
groups, err := admin.ListPCUGroups(ctx)
if err != nil {
log.Fatal(err)
}
output, err := json.Marshal(groups)
if err != nil {
log.Fatal(err)
}
fmt.Println(string(output))
}
import java.util.List;
import com.datastax.astra.client.DataAPIClient;
import com.datastax.astra.client.admin.AstraDBAdmin;
import com.datastax.astra.client.admin.definition.PCUGroupDefinition;
public class Example {
public static void main(String[] args) {
DataAPIClient client = new DataAPIClient("APPLICATION_TOKEN");
AstraDBAdmin admin = client.getAdmin();
List<PCUGroupDefinition> groups = admin.listPCUGroups();
System.out.println(groups);
}
}
using System.Text.Json;
using DataStax.AstraDB.DataApi;
namespace Examples;
public class Program
{
static async Task Main()
{
var client = new DataAPIClient("APPLICATION_TOKEN");
var admin = client.GetAstraDatabasesAdmin();
var groups = await admin.ListPCUGroupsAsync();
Console.WriteLine(JsonSerializer.Serialize(groups));
}
}
curl -sS -L -X GET "https://api.astra.datastax.com/v2/pcus/actions/get" \
--header "Authorization: Bearer APPLICATION_TOKEN" \
--header "Content-Type: application/json"
List PCU groups for a cloud provider region
-
Python
-
TypeScript
-
Go
-
Java
-
C#
-
curl
from astrapy import DataAPIClient
client = DataAPIClient("APPLICATION_TOKEN")
admin = client.get_admin()
groups = admin.list_pcu_groups(cloud_provider="aws", region="us-west-2")
print(groups)
import { DataAPIClient,AstraDatabaseCloudProvider } from "@datastax/astra-db-ts";
const client = new DataAPIClient("APPLICATION_TOKEN");
const admin = client.admin();
(async function () {
const groups = await admin.listPCUGroups({
cloudProvider: "AWS",
region: "us-west-2",
});
console.log(groups);
})();
|
The Go client is in preview. For more information, see astra-db-go. |
package main
import (
"context"
"encoding/json"
"fmt"
"log"
"github.com/datastax/astra-db-go/v2/astra"
"github.com/datastax/astra-db-go/v2/astra/options"
)
func main() {
ctx := context.Background()
client := astra.NewClient(
options.API().SetToken("APPLICATION_TOKEN"),
)
admin, err := client.Admin()
if err != nil {
log.Fatal(err)
}
groups, err := admin.ListPCUGroups(
ctx,
options.ListPCUGroups().
SetCloudProvider(options.CloudProviderAWS).
SetRegion("us-west-2"),
)
if err != nil {
log.Fatal(err)
}
output, err := json.Marshal(groups)
if err != nil {
log.Fatal(err)
}
fmt.Println(string(output))
}
import java.util.List;
import com.datastax.astra.client.DataAPIClient;
import com.datastax.astra.client.admin.AstraDBAdmin;
import com.datastax.astra.client.admin.definition.PCUGroupDefinition;
import com.dtsx.astra.sdk.db.domain.CloudProviderType;
public class Example {
public static void main(String[] args) {
DataAPIClient client = new DataAPIClient("APPLICATION_TOKEN");
AstraDBAdmin admin = client.getAdmin();
List<PCUGroupDefinition> groups = admin.listPCUGroups(CloudProviderType.AWS, "us-east-2");
System.out.println(groups);
}
}
using System.Text.Json;
using DataStax.AstraDB.DataApi;
using DataStax.AstraDB.DataApi.Admin;
namespace Examples;
public class Program
{
static async Task Main()
{
var client = new DataAPIClient("APPLICATION_TOKEN");
var admin = client.GetAstraDatabasesAdmin();
var groups = await admin.ListPCUGroupsAsync(
new ListPCUGroupsOptions
{
CloudProvider = CloudProviderType.AWS,
Region = "us-east-2",
}
);
Console.WriteLine(JsonSerializer.Serialize(groups));
}
}
This endpoint does not accept parameters to limit by cloud provider regions. Instead, you can list all PCU groups, and then extract the desired values from the response.
Client reference
-
Python
-
TypeScript
-
Go
-
Java
-
C#
-
curl
For more information, see the client reference.
For more information, see the client reference.
|
The Go client is in preview. For more information, see astra-db-go. |
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.