Package alloydb is an auto-generated package for the AlloyDB API.
AlloyDB for PostgreSQL is an open source-compatible database service that provides a powerful option for migrating, modernizing, or building commercial-grade applications. It offers full compatibility with standard PostgreSQL, and is more than 4x faster for transactional workloads and up to 100x faster for analytical queries than standard PostgreSQL in our performance tests. AlloyDB for PostgreSQL offers a 99.99 percent availability SLA inclusive of maintenance. AlloyDB is optimized for the most demanding use cases, allowing you to build new applications that require high transaction throughput, large database sizes, or multiple read resources; scale existing PostgreSQL workloads with no application changes; and modernize legacy proprietary databases.
NOTE: This package is in beta. It is not stable, and may be subject to changes.
General documentation
For information that is relevant for all client libraries please reference https://pkg.go.dev/cloud.google.com/go#pkg-overview. Some information on this page includes:
- Authentication and Authorization
- Timeouts and Cancellation
- Testing against Client Libraries
- Debugging Client Libraries
- Inspecting errors
Example usage
To get started with this package, create a client.
// go get cloud.google.com/go/alloydb/apiv1beta@latest ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := alloydb.NewAlloyDBAdminClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close()
The client will use your default application credentials. Clients should be reused instead of created as needed. The methods of Client are safe for concurrent use by multiple goroutines. The returned client must be Closed when it is done being used.
Using the Client
The following is an example of making an API call with the newly created client, mentioned above.
req := &alloydbpb.BatchCreateInstancesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/alloydb/apiv1beta/alloydbpb#BatchCreateInstancesRequest. } op, err := c.BatchCreateInstances(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp
Use of Context
The ctx passed to NewAlloyDBAdminClient is used for authentication requests and for creating the underlying connection, but is not used for subsequent calls. Individual methods on the client use the ctx given to them.
To close the open connection, use the Close() method.
Functions
func DefaultAuthScopes
func DefaultAuthScopes() []string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
AlloyDBAdminCallOptions
type AlloyDBAdminCallOptions struct {
ListClusters []gax.CallOption
GetCluster []gax.CallOption
CreateCluster []gax.CallOption
UpdateCluster []gax.CallOption
UpgradeCluster []gax.CallOption
DeleteCluster []gax.CallOption
PromoteCluster []gax.CallOption
SwitchoverCluster []gax.CallOption
RestoreCluster []gax.CallOption
CreateSecondaryCluster []gax.CallOption
ListInstances []gax.CallOption
GetInstance []gax.CallOption
CreateInstance []gax.CallOption
CreateSecondaryInstance []gax.CallOption
BatchCreateInstances []gax.CallOption
UpdateInstance []gax.CallOption
DeleteInstance []gax.CallOption
FailoverInstance []gax.CallOption
InjectFault []gax.CallOption
RestartInstance []gax.CallOption
ExecuteSql []gax.CallOption
ListBackups []gax.CallOption
GetBackup []gax.CallOption
CreateBackup []gax.CallOption
UpdateBackup []gax.CallOption
DeleteBackup []gax.CallOption
ListSupportedDatabaseFlags []gax.CallOption
GenerateClientCertificate []gax.CallOption
GetConnectionInfo []gax.CallOption
ListUsers []gax.CallOption
GetUser []gax.CallOption
CreateUser []gax.CallOption
UpdateUser []gax.CallOption
DeleteUser []gax.CallOption
ListDatabases []gax.CallOption
GetLocation []gax.CallOption
ListLocations []gax.CallOption
CancelOperation []gax.CallOption
DeleteOperation []gax.CallOption
GetOperation []gax.CallOption
ListOperations []gax.CallOption
}
AlloyDBAdminCallOptions contains the retry settings for each method of AlloyDBAdminClient.
AlloyDBAdminClient
type AlloyDBAdminClient struct {
// The call options for this service.
CallOptions *AlloyDBAdminCallOptions
// LROClient is used internally to handle long-running operations.
// It is exposed so that its CallOptions can be modified if required.
// Users should not Close this client.
LROClient *lroauto.OperationsClient
// contains filtered or unexported fields
}
AlloyDBAdminClient is a client for interacting with AlloyDB API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service describing handlers for resources
func NewAlloyDBAdminClient
func NewAlloyDBAdminClient(ctx context.Context, opts ...option.ClientOption) (*AlloyDBAdminClient, error)
NewAlloyDBAdminClient creates a new alloydb admin client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Service describing handlers for resources
Example
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewAlloyDBAdminRESTClient
func NewAlloyDBAdminRESTClient(ctx context.Context, opts ...option.ClientOption) (*AlloyDBAdminClient, error)
NewAlloyDBAdminRESTClient creates a new alloydb admin rest client.
Service describing handlers for resources
Example
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*AlloyDBAdminClient) BatchCreateInstances
func (c *AlloyDBAdminClient) BatchCreateInstances(ctx context.Context, req *alloydbpb.BatchCreateInstancesRequest, opts ...gax.CallOption) (*BatchCreateInstancesOperation, error)
BatchCreateInstances creates new instances under the given project, location and cluster. There can be only one primary instance in a cluster. If the primary instance exists in the cluster as well as this request, then API will throw an error. The primary instance should exist before any read pool instance is created. If the primary instance is a part of the request payload, then the API will take care of creating instances in the correct order. This method is here to support Google-internal use cases, and is not meant for external customers to consume. Please do not start relying on it; its behavior is subject to change without notice.
Example
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
alloydbpb "cloud.google.com/go/alloydb/apiv1beta/alloydbpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &alloydbpb.BatchCreateInstancesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/alloydb/apiv1beta/alloydbpb#BatchCreateInstancesRequest.
}
op, err := c.BatchCreateInstances(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AlloyDBAdminClient) BatchCreateInstancesOperation
func (c *AlloyDBAdminClient) BatchCreateInstancesOperation(name string) *BatchCreateInstancesOperation
BatchCreateInstancesOperation returns a new BatchCreateInstancesOperation from a given name. The name must be that of a previously created BatchCreateInstancesOperation, possibly from a different process.
func (*AlloyDBAdminClient) CancelOperation
func (c *AlloyDBAdminClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*AlloyDBAdminClient) Close
func (c *AlloyDBAdminClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*AlloyDBAdminClient) Connection (deprecated)
func (c *AlloyDBAdminClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*AlloyDBAdminClient) CreateBackup
func (c *AlloyDBAdminClient) CreateBackup(ctx context.Context, req *alloydbpb.CreateBackupRequest, opts ...gax.CallOption) (*CreateBackupOperation, error)
CreateBackup creates a new Backup in a given project and location.
Example
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
alloydbpb "cloud.google.com/go/alloydb/apiv1beta/alloydbpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &alloydbpb.CreateBackupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/alloydb/apiv1beta/alloydbpb#CreateBackupRequest.
}
op, err := c.CreateBackup(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AlloyDBAdminClient) CreateBackupOperation
func (c *AlloyDBAdminClient) CreateBackupOperation(name string) *CreateBackupOperation
CreateBackupOperation returns a new CreateBackupOperation from a given name. The name must be that of a previously created CreateBackupOperation, possibly from a different process.
func (*AlloyDBAdminClient) CreateCluster
func (c *AlloyDBAdminClient) CreateCluster(ctx context.Context, req *alloydbpb.CreateClusterRequest, opts ...gax.CallOption) (*CreateClusterOperation, error)
CreateCluster creates a new Cluster in a given project and location.
Example
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
alloydbpb "cloud.google.com/go/alloydb/apiv1beta/alloydbpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &alloydbpb.CreateClusterRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/alloydb/apiv1beta/alloydbpb#CreateClusterRequest.
}
op, err := c.CreateCluster(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AlloyDBAdminClient) CreateClusterOperation
func (c *AlloyDBAdminClient) CreateClusterOperation(name string) *CreateClusterOperation
CreateClusterOperation returns a new CreateClusterOperation from a given name. The name must be that of a previously created CreateClusterOperation, possibly from a different process.
func (*AlloyDBAdminClient) CreateInstance
func (c *AlloyDBAdminClient) CreateInstance(ctx context.Context, req *alloydbpb.CreateInstanceRequest, opts ...gax.CallOption) (*CreateInstanceOperation, error)
CreateInstance creates a new Instance in a given project and location.
Example
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
alloydbpb "cloud.google.com/go/alloydb/apiv1beta/alloydbpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &alloydbpb.CreateInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/alloydb/apiv1beta/alloydbpb#CreateInstanceRequest.
}
op, err := c.CreateInstance(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AlloyDBAdminClient) CreateInstanceOperation
func (c *AlloyDBAdminClient) CreateInstanceOperation(name string) *CreateInstanceOperation
CreateInstanceOperation returns a new CreateInstanceOperation from a given name. The name must be that of a previously created CreateInstanceOperation, possibly from a different process.
func (*AlloyDBAdminClient) CreateSecondaryCluster
func (c *AlloyDBAdminClient) CreateSecondaryCluster(ctx context.Context, req *alloydbpb.CreateSecondaryClusterRequest, opts ...gax.CallOption) (*CreateSecondaryClusterOperation, error)
CreateSecondaryCluster creates a cluster of type SECONDARY in the given location using the primary cluster as the source.
Example
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
alloydbpb "cloud.google.com/go/alloydb/apiv1beta/alloydbpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &alloydbpb.CreateSecondaryClusterRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/alloydb/apiv1beta/alloydbpb#CreateSecondaryClusterRequest.
}
op, err := c.CreateSecondaryCluster(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AlloyDBAdminClient) CreateSecondaryClusterOperation
func (c *AlloyDBAdminClient) CreateSecondaryClusterOperation(name string) *CreateSecondaryClusterOperation
CreateSecondaryClusterOperation returns a new CreateSecondaryClusterOperation from a given name. The name must be that of a previously created CreateSecondaryClusterOperation, possibly from a different process.
func (*AlloyDBAdminClient) CreateSecondaryInstance
func (c *AlloyDBAdminClient) CreateSecondaryInstance(ctx context.Context, req *alloydbpb.CreateSecondaryInstanceRequest, opts ...gax.CallOption) (*CreateSecondaryInstanceOperation, error)
CreateSecondaryInstance creates a new SECONDARY Instance in a given project and location.
Example
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
alloydbpb "cloud.google.com/go/alloydb/apiv1beta/alloydbpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &alloydbpb.CreateSecondaryInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/alloydb/apiv1beta/alloydbpb#CreateSecondaryInstanceRequest.
}
op, err := c.CreateSecondaryInstance(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AlloyDBAdminClient) CreateSecondaryInstanceOperation
func (c *AlloyDBAdminClient) CreateSecondaryInstanceOperation(name string) *CreateSecondaryInstanceOperation
CreateSecondaryInstanceOperation returns a new CreateSecondaryInstanceOperation from a given name. The name must be that of a previously created CreateSecondaryInstanceOperation, possibly from a different process.
func (*AlloyDBAdminClient) CreateUser
func (c *AlloyDBAdminClient) CreateUser(ctx context.Context, req *alloydbpb.CreateUserRequest, opts ...gax.CallOption) (*alloydbpb.User, error)
CreateUser creates a new User in a given project, location, and cluster.
Example
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
alloydbpb "cloud.google.com/go/alloydb/apiv1beta/alloydbpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &alloydbpb.CreateUserRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/alloydb/apiv1beta/alloydbpb#CreateUserRequest.
}
resp, err := c.CreateUser(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AlloyDBAdminClient) DeleteBackup
func (c *AlloyDBAdminClient) DeleteBackup(ctx context.Context, req *alloydbpb.DeleteBackupRequest, opts ...gax.CallOption) (*DeleteBackupOperation, error)
DeleteBackup deletes a single Backup.
Example
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
alloydbpb "cloud.google.com/go/alloydb/apiv1beta/alloydbpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &alloydbpb.DeleteBackupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/alloydb/apiv1beta/alloydbpb#DeleteBackupRequest.
}
op, err := c.DeleteBackup(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*AlloyDBAdminClient) DeleteBackupOperation
func (c *AlloyDBAdminClient) DeleteBackupOperation(name string) *DeleteBackupOperation
DeleteBackupOperation returns a new DeleteBackupOperation from a given name. The name must be that of a previously created DeleteBackupOperation, possibly from a different process.
func (*AlloyDBAdminClient) DeleteCluster
func (c *AlloyDBAdminClient) DeleteCluster(ctx context.Context, req *alloydbpb.DeleteClusterRequest, opts ...gax.CallOption) (*DeleteClusterOperation, error)
DeleteCluster deletes a single Cluster.
Example
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
alloydbpb "cloud.google.com/go/alloydb/apiv1beta/alloydbpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &alloydbpb.DeleteClusterRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/alloydb/apiv1beta/alloydbpb#DeleteClusterRequest.
}
op, err := c.DeleteCluster(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*AlloyDBAdminClient) DeleteClusterOperation
func (c *AlloyDBAdminClient) DeleteClusterOperation(name string) *DeleteClusterOperation
DeleteClusterOperation returns a new DeleteClusterOperation from a given name. The name must be that of a previously created DeleteClusterOperation, possibly from a different process.
func (*AlloyDBAdminClient) DeleteInstance
func (c *AlloyDBAdminClient) DeleteInstance(ctx context.Context, req *alloydbpb.DeleteInstanceRequest, opts ...gax.CallOption) (*DeleteInstanceOperation, error)
DeleteInstance deletes a single Instance.
Example
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
alloydbpb "cloud.google.com/go/alloydb/apiv1beta/alloydbpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &alloydbpb.DeleteInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/alloydb/apiv1beta/alloydbpb#DeleteInstanceRequest.
}
op, err := c.DeleteInstance(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*AlloyDBAdminClient) DeleteInstanceOperation
func (c *AlloyDBAdminClient) DeleteInstanceOperation(name string) *DeleteInstanceOperation
DeleteInstanceOperation returns a new DeleteInstanceOperation from a given name. The name must be that of a previously created DeleteInstanceOperation, possibly from a different process.
func (*AlloyDBAdminClient) DeleteOperation
func (c *AlloyDBAdminClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error
DeleteOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.DeleteOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.
}
err = c.DeleteOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*AlloyDBAdminClient) DeleteUser
func (c *AlloyDBAdminClient) DeleteUser(ctx context.Context, req *alloydbpb.DeleteUserRequest, opts ...gax.CallOption) error
DeleteUser deletes a single User.
Example
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
alloydbpb "cloud.google.com/go/alloydb/apiv1beta/alloydbpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &alloydbpb.DeleteUserRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/alloydb/apiv1beta/alloydbpb#DeleteUserRequest.
}
err = c.DeleteUser(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*AlloyDBAdminClient) ExecuteSql
func (c *AlloyDBAdminClient) ExecuteSql(ctx context.Context, req *alloydbpb.ExecuteSqlRequest, opts ...gax.CallOption) (*alloydbpb.ExecuteSqlResponse, error)
ExecuteSql executes a SQL statement in a database inside an AlloyDB instance.
Example
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
alloydbpb "cloud.google.com/go/alloydb/apiv1beta/alloydbpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &alloydbpb.ExecuteSqlRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/alloydb/apiv1beta/alloydbpb#ExecuteSqlRequest.
}
resp, err := c.ExecuteSql(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AlloyDBAdminClient) FailoverInstance
func (c *AlloyDBAdminClient) FailoverInstance(ctx context.Context, req *alloydbpb.FailoverInstanceRequest, opts ...gax.CallOption) (*FailoverInstanceOperation, error)
FailoverInstance forces a Failover for a highly available instance. Failover promotes the HA standby instance as the new primary. Imperative only.
Example
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
alloydbpb "cloud.google.com/go/alloydb/apiv1beta/alloydbpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &alloydbpb.FailoverInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/alloydb/apiv1beta/alloydbpb#FailoverInstanceRequest.
}
op, err := c.FailoverInstance(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AlloyDBAdminClient) FailoverInstanceOperation
func (c *AlloyDBAdminClient) FailoverInstanceOperation(name string) *FailoverInstanceOperation
FailoverInstanceOperation returns a new FailoverInstanceOperation from a given name. The name must be that of a previously created FailoverInstanceOperation, possibly from a different process.
func (*AlloyDBAdminClient) GenerateClientCertificate
func (c *AlloyDBAdminClient) GenerateClientCertificate(ctx context.Context, req *alloydbpb.GenerateClientCertificateRequest, opts ...gax.CallOption) (*alloydbpb.GenerateClientCertificateResponse, error)
GenerateClientCertificate generate a client certificate signed by a Cluster CA. The sole purpose of this endpoint is to support AlloyDB connectors and the Auth Proxy client. The endpoint’s behavior is subject to change without notice, so do not rely on its behavior remaining constant. Future changes will not break AlloyDB connectors or the Auth Proxy client.
Example
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
alloydbpb "cloud.google.com/go/alloydb/apiv1beta/alloydbpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &alloydbpb.GenerateClientCertificateRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/alloydb/apiv1beta/alloydbpb#GenerateClientCertificateRequest.
}
resp, err := c.GenerateClientCertificate(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AlloyDBAdminClient) GetBackup
func (c *AlloyDBAdminClient) GetBackup(ctx context.Context, req *alloydbpb.GetBackupRequest, opts ...gax.CallOption) (*alloydbpb.Backup, error)
GetBackup gets details of a single Backup.
Example
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
alloydbpb "cloud.google.com/go/alloydb/apiv1beta/alloydbpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &alloydbpb.GetBackupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/alloydb/apiv1beta/alloydbpb#GetBackupRequest.
}
resp, err := c.GetBackup(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AlloyDBAdminClient) GetCluster
func (c *AlloyDBAdminClient) GetCluster(ctx context.Context, req *alloydbpb.GetClusterRequest, opts ...gax.CallOption) (*alloydbpb.Cluster, error)
GetCluster gets details of a single Cluster.
Example
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
alloydbpb "cloud.google.com/go/alloydb/apiv1beta/alloydbpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &alloydbpb.GetClusterRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/alloydb/apiv1beta/alloydbpb#GetClusterRequest.
}
resp, err := c.GetCluster(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AlloyDBAdminClient) GetConnectionInfo
func (c *AlloyDBAdminClient) GetConnectionInfo(ctx context.Context, req *alloydbpb.GetConnectionInfoRequest, opts ...gax.CallOption) (*alloydbpb.ConnectionInfo, error)
GetConnectionInfo get instance metadata used for a connection.
Example
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
alloydbpb "cloud.google.com/go/alloydb/apiv1beta/alloydbpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &alloydbpb.GetConnectionInfoRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/alloydb/apiv1beta/alloydbpb#GetConnectionInfoRequest.
}
resp, err := c.GetConnectionInfo(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AlloyDBAdminClient) GetInstance
func (c *AlloyDBAdminClient) GetInstance(ctx context.Context, req *alloydbpb.GetInstanceRequest, opts ...gax.CallOption) (*alloydbpb.Instance, error)
GetInstance gets details of a single Instance.
Example
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
alloydbpb "cloud.google.com/go/alloydb/apiv1beta/alloydbpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &alloydbpb.GetInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/alloydb/apiv1beta/alloydbpb#GetInstanceRequest.
}
resp, err := c.GetInstance(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AlloyDBAdminClient) GetLocation
func (c *AlloyDBAdminClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
GetLocation gets information about a location.
Example
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.GetLocationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#GetLocationRequest.
}
resp, err := c.GetLocation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AlloyDBAdminClient) GetOperation
func (c *AlloyDBAdminClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AlloyDBAdminClient) GetUser
func (c *AlloyDBAdminClient) GetUser(ctx context.Context, req *alloydbpb.GetUserRequest, opts ...gax.CallOption) (*alloydbpb.User, error)
GetUser gets details of a single User.
Example
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
alloydbpb "cloud.google.com/go/alloydb/apiv1beta/alloydbpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &alloydbpb.GetUserRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/alloydb/apiv1beta/alloydbpb#GetUserRequest.
}
resp, err := c.GetUser(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AlloyDBAdminClient) InjectFault
func (c *AlloyDBAdminClient) InjectFault(ctx context.Context, req *alloydbpb.InjectFaultRequest, opts ...gax.CallOption) (*InjectFaultOperation, error)
InjectFault injects fault in an instance. Imperative only.
Example
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
alloydbpb "cloud.google.com/go/alloydb/apiv1beta/alloydbpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &alloydbpb.InjectFaultRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/alloydb/apiv1beta/alloydbpb#InjectFaultRequest.
}
op, err := c.InjectFault(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AlloyDBAdminClient) InjectFaultOperation
func (c *AlloyDBAdminClient) InjectFaultOperation(name string) *InjectFaultOperation
InjectFaultOperation returns a new InjectFaultOperation from a given name. The name must be that of a previously created InjectFaultOperation, possibly from a different process.
func (*AlloyDBAdminClient) ListBackups
func (c *AlloyDBAdminClient) ListBackups(ctx context.Context, req *alloydbpb.ListBackupsRequest, opts ...gax.CallOption) *BackupIterator
ListBackups lists Backups in a given project and location.
Examples
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
alloydbpb "cloud.google.com/go/alloydb/apiv1beta/alloydbpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &alloydbpb.ListBackupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/alloydb/apiv1beta/alloydbpb#ListBackupsRequest.
}
it := c.ListBackups(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*alloydbpb.ListBackupsResponse)
}
}
all
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
alloydbpb "cloud.google.com/go/alloydb/apiv1beta/alloydbpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &alloydbpb.ListBackupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/alloydb/apiv1beta/alloydbpb#ListBackupsRequest.
}
for resp, err := range c.ListBackups(ctx, req).All() {
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func (*AlloyDBAdminClient) ListClusters
func (c *AlloyDBAdminClient) ListClusters(ctx context.Context, req *alloydbpb.ListClustersRequest, opts ...gax.CallOption) *ClusterIterator
ListClusters lists Clusters in a given project and location.
Examples
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
alloydbpb "cloud.google.com/go/alloydb/apiv1beta/alloydbpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &alloydbpb.ListClustersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/alloydb/apiv1beta/alloydbpb#ListClustersRequest.
}
it := c.ListClusters(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*alloydbpb.ListClustersResponse)
}
}
all
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
alloydbpb "cloud.google.com/go/alloydb/apiv1beta/alloydbpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &alloydbpb.ListClustersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/alloydb/apiv1beta/alloydbpb#ListClustersRequest.
}
for resp, err := range c.ListClusters(ctx, req).All() {
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func (*AlloyDBAdminClient) ListDatabases
func (c *AlloyDBAdminClient) ListDatabases(ctx context.Context, req *alloydbpb.ListDatabasesRequest, opts ...gax.CallOption) *DatabaseIterator
ListDatabases lists Databases in a given project and location.
Examples
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
alloydbpb "cloud.google.com/go/alloydb/apiv1beta/alloydbpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &alloydbpb.ListDatabasesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/alloydb/apiv1beta/alloydbpb#ListDatabasesRequest.
}
it := c.ListDatabases(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*alloydbpb.ListDatabasesResponse)
}
}
all
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
alloydbpb "cloud.google.com/go/alloydb/apiv1beta/alloydbpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &alloydbpb.ListDatabasesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/alloydb/apiv1beta/alloydbpb#ListDatabasesRequest.
}
for resp, err := range c.ListDatabases(ctx, req).All() {
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func (*AlloyDBAdminClient) ListInstances
func (c *AlloyDBAdminClient) ListInstances(ctx context.Context, req *alloydbpb.ListInstancesRequest, opts ...gax.CallOption) *InstanceIterator
ListInstances lists Instances in a given project and location.
Examples
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
alloydbpb "cloud.google.com/go/alloydb/apiv1beta/alloydbpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &alloydbpb.ListInstancesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/alloydb/apiv1beta/alloydbpb#ListInstancesRequest.
}
it := c.ListInstances(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*alloydbpb.ListInstancesResponse)
}
}
all
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
alloydbpb "cloud.google.com/go/alloydb/apiv1beta/alloydbpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &alloydbpb.ListInstancesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/alloydb/apiv1beta/alloydbpb#ListInstancesRequest.
}
for resp, err := range c.ListInstances(ctx, req).All() {
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func (*AlloyDBAdminClient) ListLocations
func (c *AlloyDBAdminClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
ListLocations lists information about the supported locations for this service.
Examples
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
"google.golang.org/api/iterator"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
it := c.ListLocations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*locationpb.ListLocationsResponse)
}
}
all
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
for resp, err := range c.ListLocations(ctx, req).All() {
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func (*AlloyDBAdminClient) ListOperations
func (c *AlloyDBAdminClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Examples
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
it := c.ListOperations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*longrunningpb.ListOperationsResponse)
}
}
all
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
for resp, err := range c.ListOperations(ctx, req).All() {
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func (*AlloyDBAdminClient) ListSupportedDatabaseFlags
func (c *AlloyDBAdminClient) ListSupportedDatabaseFlags(ctx context.Context, req *alloydbpb.ListSupportedDatabaseFlagsRequest, opts ...gax.CallOption) *SupportedDatabaseFlagIterator
ListSupportedDatabaseFlags lists SupportedDatabaseFlags for a given project and location.
Examples
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
alloydbpb "cloud.google.com/go/alloydb/apiv1beta/alloydbpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &alloydbpb.ListSupportedDatabaseFlagsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/alloydb/apiv1beta/alloydbpb#ListSupportedDatabaseFlagsRequest.
}
it := c.ListSupportedDatabaseFlags(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*alloydbpb.ListSupportedDatabaseFlagsResponse)
}
}
all
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
alloydbpb "cloud.google.com/go/alloydb/apiv1beta/alloydbpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &alloydbpb.ListSupportedDatabaseFlagsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/alloydb/apiv1beta/alloydbpb#ListSupportedDatabaseFlagsRequest.
}
for resp, err := range c.ListSupportedDatabaseFlags(ctx, req).All() {
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func (*AlloyDBAdminClient) ListUsers
func (c *AlloyDBAdminClient) ListUsers(ctx context.Context, req *alloydbpb.ListUsersRequest, opts ...gax.CallOption) *UserIterator
ListUsers lists Users in a given project and location.
Examples
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
alloydbpb "cloud.google.com/go/alloydb/apiv1beta/alloydbpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &alloydbpb.ListUsersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/alloydb/apiv1beta/alloydbpb#ListUsersRequest.
}
it := c.ListUsers(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*alloydbpb.ListUsersResponse)
}
}
all
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
alloydbpb "cloud.google.com/go/alloydb/apiv1beta/alloydbpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &alloydbpb.ListUsersRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/alloydb/apiv1beta/alloydbpb#ListUsersRequest.
}
for resp, err := range c.ListUsers(ctx, req).All() {
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func (*AlloyDBAdminClient) PromoteCluster
func (c *AlloyDBAdminClient) PromoteCluster(ctx context.Context, req *alloydbpb.PromoteClusterRequest, opts ...gax.CallOption) (*PromoteClusterOperation, error)
PromoteCluster promotes a SECONDARY cluster. This turns down replication from the PRIMARY cluster and promotes a secondary cluster into its own standalone cluster. Imperative only.
Example
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
alloydbpb "cloud.google.com/go/alloydb/apiv1beta/alloydbpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &alloydbpb.PromoteClusterRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/alloydb/apiv1beta/alloydbpb#PromoteClusterRequest.
}
op, err := c.PromoteCluster(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AlloyDBAdminClient) PromoteClusterOperation
func (c *AlloyDBAdminClient) PromoteClusterOperation(name string) *PromoteClusterOperation
PromoteClusterOperation returns a new PromoteClusterOperation from a given name. The name must be that of a previously created PromoteClusterOperation, possibly from a different process.
func (*AlloyDBAdminClient) RestartInstance
func (c *AlloyDBAdminClient) RestartInstance(ctx context.Context, req *alloydbpb.RestartInstanceRequest, opts ...gax.CallOption) (*RestartInstanceOperation, error)
RestartInstance restart an Instance in a cluster. Imperative only.
Example
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
alloydbpb "cloud.google.com/go/alloydb/apiv1beta/alloydbpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &alloydbpb.RestartInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/alloydb/apiv1beta/alloydbpb#RestartInstanceRequest.
}
op, err := c.RestartInstance(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AlloyDBAdminClient) RestartInstanceOperation
func (c *AlloyDBAdminClient) RestartInstanceOperation(name string) *RestartInstanceOperation
RestartInstanceOperation returns a new RestartInstanceOperation from a given name. The name must be that of a previously created RestartInstanceOperation, possibly from a different process.
func (*AlloyDBAdminClient) RestoreCluster
func (c *AlloyDBAdminClient) RestoreCluster(ctx context.Context, req *alloydbpb.RestoreClusterRequest, opts ...gax.CallOption) (*RestoreClusterOperation, error)
RestoreCluster creates a new Cluster in a given project and location, with a volume restored from the provided source, either a backup ID or a point-in-time and a source cluster.
Example
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
alloydbpb "cloud.google.com/go/alloydb/apiv1beta/alloydbpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &alloydbpb.RestoreClusterRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/alloydb/apiv1beta/alloydbpb#RestoreClusterRequest.
}
op, err := c.RestoreCluster(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AlloyDBAdminClient) RestoreClusterOperation
func (c *AlloyDBAdminClient) RestoreClusterOperation(name string) *RestoreClusterOperation
RestoreClusterOperation returns a new RestoreClusterOperation from a given name. The name must be that of a previously created RestoreClusterOperation, possibly from a different process.
func (*AlloyDBAdminClient) SwitchoverCluster
func (c *AlloyDBAdminClient) SwitchoverCluster(ctx context.Context, req *alloydbpb.SwitchoverClusterRequest, opts ...gax.CallOption) (*SwitchoverClusterOperation, error)
SwitchoverCluster switches the roles of PRIMARY and SECONDARY clusters without any data loss. This promotes the SECONDARY cluster to PRIMARY and sets up the original PRIMARY cluster to replicate from this newly promoted cluster.
Example
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
alloydbpb "cloud.google.com/go/alloydb/apiv1beta/alloydbpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &alloydbpb.SwitchoverClusterRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/alloydb/apiv1beta/alloydbpb#SwitchoverClusterRequest.
}
op, err := c.SwitchoverCluster(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AlloyDBAdminClient) SwitchoverClusterOperation
func (c *AlloyDBAdminClient) SwitchoverClusterOperation(name string) *SwitchoverClusterOperation
SwitchoverClusterOperation returns a new SwitchoverClusterOperation from a given name. The name must be that of a previously created SwitchoverClusterOperation, possibly from a different process.
func (*AlloyDBAdminClient) UpdateBackup
func (c *AlloyDBAdminClient) UpdateBackup(ctx context.Context, req *alloydbpb.UpdateBackupRequest, opts ...gax.CallOption) (*UpdateBackupOperation, error)
UpdateBackup updates the parameters of a single Backup.
Example
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
alloydbpb "cloud.google.com/go/alloydb/apiv1beta/alloydbpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &alloydbpb.UpdateBackupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/alloydb/apiv1beta/alloydbpb#UpdateBackupRequest.
}
op, err := c.UpdateBackup(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AlloyDBAdminClient) UpdateBackupOperation
func (c *AlloyDBAdminClient) UpdateBackupOperation(name string) *UpdateBackupOperation
UpdateBackupOperation returns a new UpdateBackupOperation from a given name. The name must be that of a previously created UpdateBackupOperation, possibly from a different process.
func (*AlloyDBAdminClient) UpdateCluster
func (c *AlloyDBAdminClient) UpdateCluster(ctx context.Context, req *alloydbpb.UpdateClusterRequest, opts ...gax.CallOption) (*UpdateClusterOperation, error)
UpdateCluster updates the parameters of a single Cluster.
Example
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
alloydbpb "cloud.google.com/go/alloydb/apiv1beta/alloydbpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &alloydbpb.UpdateClusterRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/alloydb/apiv1beta/alloydbpb#UpdateClusterRequest.
}
op, err := c.UpdateCluster(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AlloyDBAdminClient) UpdateClusterOperation
func (c *AlloyDBAdminClient) UpdateClusterOperation(name string) *UpdateClusterOperation
UpdateClusterOperation returns a new UpdateClusterOperation from a given name. The name must be that of a previously created UpdateClusterOperation, possibly from a different process.
func (*AlloyDBAdminClient) UpdateInstance
func (c *AlloyDBAdminClient) UpdateInstance(ctx context.Context, req *alloydbpb.UpdateInstanceRequest, opts ...gax.CallOption) (*UpdateInstanceOperation, error)
UpdateInstance updates the parameters of a single Instance.
Example
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
alloydbpb "cloud.google.com/go/alloydb/apiv1beta/alloydbpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &alloydbpb.UpdateInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/alloydb/apiv1beta/alloydbpb#UpdateInstanceRequest.
}
op, err := c.UpdateInstance(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AlloyDBAdminClient) UpdateInstanceOperation
func (c *AlloyDBAdminClient) UpdateInstanceOperation(name string) *UpdateInstanceOperation
UpdateInstanceOperation returns a new UpdateInstanceOperation from a given name. The name must be that of a previously created UpdateInstanceOperation, possibly from a different process.
func (*AlloyDBAdminClient) UpdateUser
func (c *AlloyDBAdminClient) UpdateUser(ctx context.Context, req *alloydbpb.UpdateUserRequest, opts ...gax.CallOption) (*alloydbpb.User, error)
UpdateUser updates the parameters of a single User.
Example
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
alloydbpb "cloud.google.com/go/alloydb/apiv1beta/alloydbpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &alloydbpb.UpdateUserRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/alloydb/apiv1beta/alloydbpb#UpdateUserRequest.
}
resp, err := c.UpdateUser(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AlloyDBAdminClient) UpgradeCluster
func (c *AlloyDBAdminClient) UpgradeCluster(ctx context.Context, req *alloydbpb.UpgradeClusterRequest, opts ...gax.CallOption) (*UpgradeClusterOperation, error)
UpgradeCluster upgrades a single Cluster. Imperative only.
Example
package main
import (
"context"
alloydb "cloud.google.com/go/alloydb/apiv1beta"
alloydbpb "cloud.google.com/go/alloydb/apiv1beta/alloydbpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := alloydb.NewAlloyDBAdminClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &alloydbpb.UpgradeClusterRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/alloydb/apiv1beta/alloydbpb#UpgradeClusterRequest.
}
op, err := c.UpgradeCluster(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*AlloyDBAdminClient) UpgradeClusterOperation
func (c *AlloyDBAdminClient) UpgradeClusterOperation(name string) *UpgradeClusterOperation
UpgradeClusterOperation returns a new UpgradeClusterOperation from a given name. The name must be that of a previously created UpgradeClusterOperation, possibly from a different process.
BackupIterator
type BackupIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*alloydbpb.Backup, nextPageToken string, err error)
// contains filtered or unexported fields
}
BackupIterator manages a stream of *alloydbpb.Backup.
func (*BackupIterator) All
func (it *BackupIterator) All() iter.Seq2[*alloydbpb.Backup, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*BackupIterator) Next
func (it *BackupIterator) Next() (*alloydbpb.Backup, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*BackupIterator) PageInfo
func (it *BackupIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
BatchCreateInstancesOperation
type BatchCreateInstancesOperation struct {
// contains filtered or unexported fields
}
BatchCreateInstancesOperation manages a long-running operation from BatchCreateInstances.
func (*BatchCreateInstancesOperation) Done
func (op *BatchCreateInstancesOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*BatchCreateInstancesOperation) Metadata
func (op *BatchCreateInstancesOperation) Metadata() (*alloydbpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*BatchCreateInstancesOperation) Name
func (op *BatchCreateInstancesOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*BatchCreateInstancesOperation) Poll
func (op *BatchCreateInstancesOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*alloydbpb.BatchCreateInstancesResponse, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*BatchCreateInstancesOperation) Wait
func (op *BatchCreateInstancesOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*alloydbpb.BatchCreateInstancesResponse, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
ClusterIterator
type ClusterIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*alloydbpb.Cluster, nextPageToken string, err error)
// contains filtered or unexported fields
}
ClusterIterator manages a stream of *alloydbpb.Cluster.
func (*ClusterIterator) All
func (it *ClusterIterator) All() iter.Seq2[*alloydbpb.Cluster, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ClusterIterator) Next
func (it *ClusterIterator) Next() (*alloydbpb.Cluster, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*ClusterIterator) PageInfo
func (it *ClusterIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
CreateBackupOperation
type CreateBackupOperation struct {
// contains filtered or unexported fields
}
CreateBackupOperation manages a long-running operation from CreateBackup.
func (*CreateBackupOperation) Done
func (op *CreateBackupOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreateBackupOperation) Metadata
func (op *CreateBackupOperation) Metadata() (*alloydbpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*CreateBackupOperation) Name
func (op *CreateBackupOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*CreateBackupOperation) Poll
func (op *CreateBackupOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*alloydbpb.Backup, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*CreateBackupOperation) Wait
func (op *CreateBackupOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*alloydbpb.Backup, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
CreateClusterOperation
type CreateClusterOperation struct {
// contains filtered or unexported fields
}
CreateClusterOperation manages a long-running operation from CreateCluster.
func (*CreateClusterOperation) Done
func (op *CreateClusterOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreateClusterOperation) Metadata
func (op *CreateClusterOperation) Metadata() (*alloydbpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*CreateClusterOperation) Name
func (op *CreateClusterOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*CreateClusterOperation) Poll
func (op *CreateClusterOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*alloydbpb.Cluster, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*CreateClusterOperation) Wait
func (op *CreateClusterOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*alloydbpb.Cluster, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
CreateInstanceOperation
type CreateInstanceOperation struct {
// contains filtered or unexported fields
}
CreateInstanceOperation manages a long-running operation from CreateInstance.
func (*CreateInstanceOperation) Done
func (op *CreateInstanceOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreateInstanceOperation) Metadata
func (op *CreateInstanceOperation) Metadata() (*alloydbpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*CreateInstanceOperation) Name
func (op *CreateInstanceOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*CreateInstanceOperation) Poll
func (op *CreateInstanceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*alloydbpb.Instance, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*CreateInstanceOperation) Wait
func (op *CreateInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*alloydbpb.Instance, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
CreateSecondaryClusterOperation
type CreateSecondaryClusterOperation struct {
// contains filtered or unexported fields
}
CreateSecondaryClusterOperation manages a long-running operation from CreateSecondaryCluster.
func (*CreateSecondaryClusterOperation) Done
func (op *CreateSecondaryClusterOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreateSecondaryClusterOperation) Metadata
func (op *CreateSecondaryClusterOperation) Metadata() (*alloydbpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*CreateSecondaryClusterOperation) Name
func (op *CreateSecondaryClusterOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*CreateSecondaryClusterOperation) Poll
func (op *CreateSecondaryClusterOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*alloydbpb.Cluster, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*CreateSecondaryClusterOperation) Wait
func (op *CreateSecondaryClusterOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*alloydbpb.Cluster, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
CreateSecondaryInstanceOperation
type CreateSecondaryInstanceOperation struct {
// contains filtered or unexported fields
}
CreateSecondaryInstanceOperation manages a long-running operation from CreateSecondaryInstance.
func (*CreateSecondaryInstanceOperation) Done
func (op *CreateSecondaryInstanceOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreateSecondaryInstanceOperation) Metadata
func (op *CreateSecondaryInstanceOperation) Metadata() (*alloydbpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*CreateSecondaryInstanceOperation) Name
func (op *CreateSecondaryInstanceOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*CreateSecondaryInstanceOperation) Poll
func (op *CreateSecondaryInstanceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*alloydbpb.Instance, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*CreateSecondaryInstanceOperation) Wait
func (op *CreateSecondaryInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*alloydbpb.Instance, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
DatabaseIterator
type DatabaseIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*alloydbpb.Database, nextPageToken string, err error)
// contains filtered or unexported fields
}
DatabaseIterator manages a stream of *alloydbpb.Database.
func (*DatabaseIterator) All
func (it *DatabaseIterator) All() iter.Seq2[*alloydbpb.Database, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*DatabaseIterator) Next
func (it *DatabaseIterator) Next() (*alloydbpb.Database, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*DatabaseIterator) PageInfo
func (it *DatabaseIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
DeleteBackupOperation
type DeleteBackupOperation struct {
// contains filtered or unexported fields
}
DeleteBackupOperation manages a long-running operation from DeleteBackup.
func (*DeleteBackupOperation) Done
func (op *DeleteBackupOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*DeleteBackupOperation) Metadata
func (op *DeleteBackupOperation) Metadata() (*alloydbpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*DeleteBackupOperation) Name
func (op *DeleteBackupOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*DeleteBackupOperation) Poll
func (op *DeleteBackupOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*DeleteBackupOperation) Wait
func (op *DeleteBackupOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
DeleteClusterOperation
type DeleteClusterOperation struct {
// contains filtered or unexported fields
}
DeleteClusterOperation manages a long-running operation from DeleteCluster.
func (*DeleteClusterOperation) Done
func (op *DeleteClusterOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*DeleteClusterOperation) Metadata
func (op *DeleteClusterOperation) Metadata() (*alloydbpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*DeleteClusterOperation) Name
func (op *DeleteClusterOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*DeleteClusterOperation) Poll
func (op *DeleteClusterOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*DeleteClusterOperation) Wait
func (op *DeleteClusterOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
DeleteInstanceOperation
type DeleteInstanceOperation struct {
// contains filtered or unexported fields
}
DeleteInstanceOperation manages a long-running operation from DeleteInstance.
func (*DeleteInstanceOperation) Done
func (op *DeleteInstanceOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*DeleteInstanceOperation) Metadata
func (op *DeleteInstanceOperation) Metadata() (*alloydbpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*DeleteInstanceOperation) Name
func (op *DeleteInstanceOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*DeleteInstanceOperation) Poll
func (op *DeleteInstanceOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*DeleteInstanceOperation) Wait
func (op *DeleteInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
FailoverInstanceOperation
type FailoverInstanceOperation struct {
// contains filtered or unexported fields
}
FailoverInstanceOperation manages a long-running operation from FailoverInstance.
func (*FailoverInstanceOperation) Done
func (op *FailoverInstanceOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*FailoverInstanceOperation) Metadata
func (op *FailoverInstanceOperation) Metadata() (*alloydbpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*FailoverInstanceOperation) Name
func (op *FailoverInstanceOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*FailoverInstanceOperation) Poll
func (op *FailoverInstanceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*alloydbpb.Instance, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*FailoverInstanceOperation) Wait
func (op *FailoverInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*alloydbpb.Instance, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
InjectFaultOperation
type InjectFaultOperation struct {
// contains filtered or unexported fields
}
InjectFaultOperation manages a long-running operation from InjectFault.
func (*InjectFaultOperation) Done
func (op *InjectFaultOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*InjectFaultOperation) Metadata
func (op *InjectFaultOperation) Metadata() (*alloydbpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*InjectFaultOperation) Name
func (op *InjectFaultOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*InjectFaultOperation) Poll
func (op *InjectFaultOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*alloydbpb.Instance, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*InjectFaultOperation) Wait
func (op *InjectFaultOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*alloydbpb.Instance, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
InstanceIterator
type InstanceIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*alloydbpb.Instance, nextPageToken string, err error)
// contains filtered or unexported fields
}
InstanceIterator manages a stream of *alloydbpb.Instance.
func (*InstanceIterator) All
func (it *InstanceIterator) All() iter.Seq2[*alloydbpb.Instance, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*InstanceIterator) Next
func (it *InstanceIterator) Next() (*alloydbpb.Instance, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*InstanceIterator) PageInfo
func (it *InstanceIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
LocationIterator
type LocationIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*locationpb.Location, nextPageToken string, err error)
// contains filtered or unexported fields
}
LocationIterator manages a stream of *locationpb.Location.
func (*LocationIterator) All
func (it *LocationIterator) All() iter.Seq2[*locationpb.Location, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*LocationIterator) Next
func (it *LocationIterator) Next() (*locationpb.Location, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*LocationIterator) PageInfo
func (it *LocationIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
OperationIterator
type OperationIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*longrunningpb.Operation, nextPageToken string, err error)
// contains filtered or unexported fields
}
OperationIterator manages a stream of *longrunningpb.Operation.
func (*OperationIterator) All
func (it *OperationIterator) All() iter.Seq2[*longrunningpb.Operation, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*OperationIterator) Next
func (it *OperationIterator) Next() (*longrunningpb.Operation, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*OperationIterator) PageInfo
func (it *OperationIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
PromoteClusterOperation
type PromoteClusterOperation struct {
// contains filtered or unexported fields
}
PromoteClusterOperation manages a long-running operation from PromoteCluster.
func (*PromoteClusterOperation) Done
func (op *PromoteClusterOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*PromoteClusterOperation) Metadata
func (op *PromoteClusterOperation) Metadata() (*alloydbpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*PromoteClusterOperation) Name
func (op *PromoteClusterOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*PromoteClusterOperation) Poll
func (op *PromoteClusterOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*alloydbpb.Cluster, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*PromoteClusterOperation) Wait
func (op *PromoteClusterOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*alloydbpb.Cluster, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
RestartInstanceOperation
type RestartInstanceOperation struct {
// contains filtered or unexported fields
}
RestartInstanceOperation manages a long-running operation from RestartInstance.
func (*RestartInstanceOperation) Done
func (op *RestartInstanceOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*RestartInstanceOperation) Metadata
func (op *RestartInstanceOperation) Metadata() (*alloydbpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*RestartInstanceOperation) Name
func (op *RestartInstanceOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*RestartInstanceOperation) Poll
func (op *RestartInstanceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*alloydbpb.Instance, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*RestartInstanceOperation) Wait
func (op *RestartInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*alloydbpb.Instance, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
RestoreClusterOperation
type RestoreClusterOperation struct {
// contains filtered or unexported fields
}
RestoreClusterOperation manages a long-running operation from RestoreCluster.
func (*RestoreClusterOperation) Done
func (op *RestoreClusterOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*RestoreClusterOperation) Metadata
func (op *RestoreClusterOperation) Metadata() (*alloydbpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*RestoreClusterOperation) Name
func (op *RestoreClusterOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*RestoreClusterOperation) Poll
func (op *RestoreClusterOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*alloydbpb.Cluster, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*RestoreClusterOperation) Wait
func (op *RestoreClusterOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*alloydbpb.Cluster, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
SupportedDatabaseFlagIterator
type SupportedDatabaseFlagIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*alloydbpb.SupportedDatabaseFlag, nextPageToken string, err error)
// contains filtered or unexported fields
}
SupportedDatabaseFlagIterator manages a stream of *alloydbpb.SupportedDatabaseFlag.
func (*SupportedDatabaseFlagIterator) All
func (it *SupportedDatabaseFlagIterator) All() iter.Seq2[*alloydbpb.SupportedDatabaseFlag, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*SupportedDatabaseFlagIterator) Next
func (it *SupportedDatabaseFlagIterator) Next() (*alloydbpb.SupportedDatabaseFlag, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*SupportedDatabaseFlagIterator) PageInfo
func (it *SupportedDatabaseFlagIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
SwitchoverClusterOperation
type SwitchoverClusterOperation struct {
// contains filtered or unexported fields
}
SwitchoverClusterOperation manages a long-running operation from SwitchoverCluster.
func (*SwitchoverClusterOperation) Done
func (op *SwitchoverClusterOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*SwitchoverClusterOperation) Metadata
func (op *SwitchoverClusterOperation) Metadata() (*alloydbpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*SwitchoverClusterOperation) Name
func (op *SwitchoverClusterOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*SwitchoverClusterOperation) Poll
func (op *SwitchoverClusterOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*alloydbpb.Cluster, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*SwitchoverClusterOperation) Wait
func (op *SwitchoverClusterOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*alloydbpb.Cluster, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
UpdateBackupOperation
type UpdateBackupOperation struct {
// contains filtered or unexported fields
}
UpdateBackupOperation manages a long-running operation from UpdateBackup.
func (*UpdateBackupOperation) Done
func (op *UpdateBackupOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*UpdateBackupOperation) Metadata
func (op *UpdateBackupOperation) Metadata() (*alloydbpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*UpdateBackupOperation) Name
func (op *UpdateBackupOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*UpdateBackupOperation) Poll
func (op *UpdateBackupOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*alloydbpb.Backup, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*UpdateBackupOperation) Wait
func (op *UpdateBackupOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*alloydbpb.Backup, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
UpdateClusterOperation
type UpdateClusterOperation struct {
// contains filtered or unexported fields
}
UpdateClusterOperation manages a long-running operation from UpdateCluster.
func (*UpdateClusterOperation) Done
func (op *UpdateClusterOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*UpdateClusterOperation) Metadata
func (op *UpdateClusterOperation) Metadata() (*alloydbpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*UpdateClusterOperation) Name
func (op *UpdateClusterOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*UpdateClusterOperation) Poll
func (op *UpdateClusterOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*alloydbpb.Cluster, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*UpdateClusterOperation) Wait
func (op *UpdateClusterOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*alloydbpb.Cluster, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
UpdateInstanceOperation
type UpdateInstanceOperation struct {
// contains filtered or unexported fields
}
UpdateInstanceOperation manages a long-running operation from UpdateInstance.
func (*UpdateInstanceOperation) Done
func (op *UpdateInstanceOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*UpdateInstanceOperation) Metadata
func (op *UpdateInstanceOperation) Metadata() (*alloydbpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*UpdateInstanceOperation) Name
func (op *UpdateInstanceOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*UpdateInstanceOperation) Poll
func (op *UpdateInstanceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*alloydbpb.Instance, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*UpdateInstanceOperation) Wait
func (op *UpdateInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*alloydbpb.Instance, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
UpgradeClusterOperation
type UpgradeClusterOperation struct {
// contains filtered or unexported fields
}
UpgradeClusterOperation manages a long-running operation from UpgradeCluster.
func (*UpgradeClusterOperation) Done
func (op *UpgradeClusterOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*UpgradeClusterOperation) Metadata
func (op *UpgradeClusterOperation) Metadata() (*alloydbpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*UpgradeClusterOperation) Name
func (op *UpgradeClusterOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*UpgradeClusterOperation) Poll
func (op *UpgradeClusterOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*alloydbpb.UpgradeClusterResponse, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*UpgradeClusterOperation) Wait
func (op *UpgradeClusterOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*alloydbpb.UpgradeClusterResponse, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
UserIterator
type UserIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*alloydbpb.User, nextPageToken string, err error)
// contains filtered or unexported fields
}
UserIterator manages a stream of *alloydbpb.User.
func (*UserIterator) All
func (it *UserIterator) All() iter.Seq2[*alloydbpb.User, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*UserIterator) Next
func (it *UserIterator) Next() (*alloydbpb.User, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*UserIterator) PageInfo
func (it *UserIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.