Get an Astra DB admin (C#)
The Data API clients use the Astra DB Admin class to perform administrative operations like creating and dropping databases.
To perform administrative actions within a specific database, see Get a database admin (C#) instead.
The Astra DB Admin class name varies by client.
The C# client uses AstraDatabasesAdmin.
|
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
Returns an AstraDatabasesAdmin object that can perform administrative actions.
Parameters
Use the GetAstraDatabasesAdmin method from the DataAPIClient class.
Method signature
public AstraDatabasesAdmin GetAstraDatabasesAdmin(
GetAstraDatabasesAdminOptions options = null
);
public AstraDatabasesAdmin GetAstraDatabasesAdmin(
string token, GetAstraDatabasesAdminOptions options = null
);
| Name | Type | Summary |
|---|---|---|
|
|
Optional. The token used by the resulting admin object. The token should have sufficient permissions to perform the desired downstream operations. If not specified, the resulting object will use the token used by the object that called this method. |
|
Optional. A specification of options to override the inherited defaults. Use this to customize the interaction of the client with the admin object. For example, you can change the default timeouts. |
Examples
The following examples demonstrate how to get an Astra DB admin.
using DataStax.AstraDB.DataApi;
namespace Examples;
public class Program
{
static void Main()
{
var client = new DataAPIClient("APPLICATION_TOKEN");
var admin = client.GetAstraDatabasesAdmin();
}
}
Client reference
For more information, see the client reference.