Get an Astra DB admin (Go)

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 (Go) instead.

The Astra DB Admin class name varies by client. The Go client uses AstraAdmin.

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 AstraAdmin struct that can perform administrative actions.

Parameters

Use the Admin method, which belongs to the DataAPIClient type.

Method signature
func (c *DataAPIClient) Admin(
  opts ...options.APIOption
) (*AstraAdmin, error)
Name Type Summary

opts

…​options.APIOption

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 or token.

Examples

The following examples demonstrate how to get an Astra DB admin.

package main

import (
	"log"

	"github.com/datastax/astra-db-go/v2/astra"
	"github.com/datastax/astra-db-go/v2/astra/options"
)

func main() {
	client := astra.NewClient(
		options.API().SetToken("APPLICATION_TOKEN"),
	)

	_, err := client.Admin(options.API())

	if err != nil {
		log.Fatal(err)
	}
}

Client reference

For more information, see the client reference.

Was this helpful?

Give Feedback

How can we improve the documentation?

© Copyright IBM Corporation 2026 | Privacy policy | Terms of use Manage Privacy Choices

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: Contact IBM