List PCU groups (C#)
Lists all Provisioned Capacity Units (PCU) groups 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
Returns an unordered list of DataStax.AstraDB.DataApi.Admin.PCUGroup objects.
Each object describes a PCU group in the organization.
Parameters
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 (C#). |
Examples
The following examples demonstrate how to list PCU groups.
List all PCU 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));
}
}
List PCU groups for a cloud provider region
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));
}
}
Client reference
For more information, see the client reference.