AlloyDB API v1alpha - Package cloud.google.com/go/alloydb/apiv1alpha (v1.4.0)

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 about setting deadlines, reusing contexts, and more please visit https://pkg.go.dev/cloud.google.com/go.

Example usage

To get started with this package, create a client.

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.

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/apiv1alpha/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
}

Inspecting errors

To see examples of how to inspect errors returned by this package please reference [Inspecting errors](https://pkg.go.dev/cloud.google.com/go#hdr-Inspecting_errors).

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
	DeleteCluster              []gax.CallOption
	PromoteCluster             []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
	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
	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/apiv1alpha"
)

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/apiv1alpha"
)

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

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/apiv1alpha"
	alloydbpb "cloud.google.com/go/alloydb/apiv1alpha/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/apiv1alpha/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

CancelOperation is a utility method from google.longrunning.Operations.

Example

package main

import (
	"context"

	alloydb "cloud.google.com/go/alloydb/apiv1alpha"

	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

CreateBackup creates a new Backup in a given project and location.

Example

package main

import (
	"context"

	alloydb "cloud.google.com/go/alloydb/apiv1alpha"
	alloydbpb "cloud.google.com/go/alloydb/apiv1alpha/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/apiv1alpha/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

CreateCluster creates a new Cluster in a given project and location.

Example

package main

import (
	"context"

	alloydb "cloud.google.com/go/alloydb/apiv1alpha"
	alloydbpb "cloud.google.com/go/alloydb/apiv1alpha/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/apiv1alpha/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

CreateInstance creates a new Instance in a given project and location.

Example

package main

import (
	"context"

	alloydb "cloud.google.com/go/alloydb/apiv1alpha"
	alloydbpb "cloud.google.com/go/alloydb/apiv1alpha/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/apiv1alpha/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

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/apiv1alpha"
	alloydbpb "cloud.google.com/go/alloydb/apiv1alpha/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/apiv1alpha/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

CreateSecondaryInstance creates a new SECONDARY Instance in a given project and location.

Example

package main

import (
	"context"

	alloydb "cloud.google.com/go/alloydb/apiv1alpha"
	alloydbpb "cloud.google.com/go/alloydb/apiv1alpha/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/apiv1alpha/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

CreateUser creates a new User in a given project, location, and cluster.

Example

package main

import (
	"context"

	alloydb "cloud.google.com/go/alloydb/apiv1alpha"
	alloydbpb "cloud.google.com/go/alloydb/apiv1alpha/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/apiv1alpha/alloydbpb#CreateUserRequest.
	}
	resp, err := c.CreateUser(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*AlloyDBAdminClient) DeleteBackup

DeleteBackup deletes a single Backup.

Example

package main

import (
	"context"

	alloydb "cloud.google.com/go/alloydb/apiv1alpha"
	alloydbpb "cloud.google.com/go/alloydb/apiv1alpha/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/apiv1alpha/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

DeleteCluster deletes a single Cluster.

Example

package main

import (
	"context"

	alloydb "cloud.google.com/go/alloydb/apiv1alpha"
	alloydbpb "cloud.google.com/go/alloydb/apiv1alpha/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/apiv1alpha/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

DeleteInstance deletes a single Instance.

Example

package main

import (
	"context"

	alloydb "cloud.google.com/go/alloydb/apiv1alpha"
	alloydbpb "cloud.google.com/go/alloydb/apiv1alpha/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/apiv1alpha/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

DeleteOperation is a utility method from google.longrunning.Operations.

Example

package main

import (
	"context"

	alloydb "cloud.google.com/go/alloydb/apiv1alpha"

	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

DeleteUser deletes a single User.

Example

package main

import (
	"context"

	alloydb "cloud.google.com/go/alloydb/apiv1alpha"
	alloydbpb "cloud.google.com/go/alloydb/apiv1alpha/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/apiv1alpha/alloydbpb#DeleteUserRequest.
	}
	err = c.DeleteUser(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
}

func (*AlloyDBAdminClient) FailoverInstance

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/apiv1alpha"
	alloydbpb "cloud.google.com/go/alloydb/apiv1alpha/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/apiv1alpha/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

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/apiv1alpha"
	alloydbpb "cloud.google.com/go/alloydb/apiv1alpha/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/apiv1alpha/alloydbpb#GenerateClientCertificateRequest.
	}
	resp, err := c.GenerateClientCertificate(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*AlloyDBAdminClient) GetBackup

GetBackup gets details of a single Backup.

Example

package main

import (
	"context"

	alloydb "cloud.google.com/go/alloydb/apiv1alpha"
	alloydbpb "cloud.google.com/go/alloydb/apiv1alpha/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/apiv1alpha/alloydbpb#GetBackupRequest.
	}
	resp, err := c.GetBackup(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*AlloyDBAdminClient) GetCluster

GetCluster gets details of a single Cluster.

Example

package main

import (
	"context"

	alloydb "cloud.google.com/go/alloydb/apiv1alpha"
	alloydbpb "cloud.google.com/go/alloydb/apiv1alpha/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/apiv1alpha/alloydbpb#GetClusterRequest.
	}
	resp, err := c.GetCluster(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*AlloyDBAdminClient) GetConnectionInfo

GetConnectionInfo get instance metadata used for a connection.

Example

package main

import (
	"context"

	alloydb "cloud.google.com/go/alloydb/apiv1alpha"
	alloydbpb "cloud.google.com/go/alloydb/apiv1alpha/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/apiv1alpha/alloydbpb#GetConnectionInfoRequest.
	}
	resp, err := c.GetConnectionInfo(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*AlloyDBAdminClient) GetInstance

GetInstance gets details of a single Instance.

Example

package main

import (
	"context"

	alloydb "cloud.google.com/go/alloydb/apiv1alpha"
	alloydbpb "cloud.google.com/go/alloydb/apiv1alpha/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/apiv1alpha/alloydbpb#GetInstanceRequest.
	}
	resp, err := c.GetInstance(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*AlloyDBAdminClient) GetLocation

GetLocation gets information about a location.

Example

package main

import (
	"context"

	alloydb "cloud.google.com/go/alloydb/apiv1alpha"

	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

GetOperation is a utility method from google.longrunning.Operations.

Example

package main

import (
	"context"

	alloydb "cloud.google.com/go/alloydb/apiv1alpha"

	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

GetUser gets details of a single User.

Example

package main

import (
	"context"

	alloydb "cloud.google.com/go/alloydb/apiv1alpha"
	alloydbpb "cloud.google.com/go/alloydb/apiv1alpha/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/apiv1alpha/alloydbpb#GetUserRequest.
	}
	resp, err := c.GetUser(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*AlloyDBAdminClient) InjectFault

InjectFault injects fault in an instance. Imperative only.

Example

package main

import (
	"context"

	alloydb "cloud.google.com/go/alloydb/apiv1alpha"
	alloydbpb "cloud.google.com/go/alloydb/apiv1alpha/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/apiv1alpha/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

ListBackups lists Backups in a given project and location.

Example

package main

import (
	"context"

	alloydb "cloud.google.com/go/alloydb/apiv1alpha"
	alloydbpb "cloud.google.com/go/alloydb/apiv1alpha/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/apiv1alpha/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
	}
}

func (*AlloyDBAdminClient) ListClusters

ListClusters lists Clusters in a given project and location.

Example

package main

import (
	"context"

	alloydb "cloud.google.com/go/alloydb/apiv1alpha"
	alloydbpb "cloud.google.com/go/alloydb/apiv1alpha/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/apiv1alpha/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
	}
}

func (*AlloyDBAdminClient) ListInstances

ListInstances lists Instances in a given project and location.

Example

package main

import (
	"context"

	alloydb "cloud.google.com/go/alloydb/apiv1alpha"
	alloydbpb "cloud.google.com/go/alloydb/apiv1alpha/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/apiv1alpha/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
	}
}

func (*AlloyDBAdminClient) ListLocations

ListLocations lists information about the supported locations for this service.

Example

package main

import (
	"context"

	alloydb "cloud.google.com/go/alloydb/apiv1alpha"
	"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
	}
}

func (*AlloyDBAdminClient) ListOperations

ListOperations is a utility method from google.longrunning.Operations.

Example

package main

import (
	"context"

	alloydb "cloud.google.com/go/alloydb/apiv1alpha"

	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
	}
}

func (*AlloyDBAdminClient) ListSupportedDatabaseFlags

ListSupportedDatabaseFlags lists SupportedDatabaseFlags for a given project and location.

Example

package main

import (
	"context"

	alloydb "cloud.google.com/go/alloydb/apiv1alpha"
	alloydbpb "cloud.google.com/go/alloydb/apiv1alpha/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/apiv1alpha/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
	}
}

func (*AlloyDBAdminClient) ListUsers

ListUsers lists Users in a given project and location.

Example

package main

import (
	"context"

	alloydb "cloud.google.com/go/alloydb/apiv1alpha"
	alloydbpb "cloud.google.com/go/alloydb/apiv1alpha/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/apiv1alpha/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
	}
}

func (*AlloyDBAdminClient) PromoteCluster

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/apiv1alpha"
	alloydbpb "cloud.google.com/go/alloydb/apiv1alpha/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/apiv1alpha/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

RestartInstance restart an Instance in a cluster. Imperative only.

Example

package main

import (
	"context"

	alloydb "cloud.google.com/go/alloydb/apiv1alpha"
	alloydbpb "cloud.google.com/go/alloydb/apiv1alpha/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/apiv1alpha/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

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/apiv1alpha"
	alloydbpb "cloud.google.com/go/alloydb/apiv1alpha/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/apiv1alpha/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) UpdateBackup

UpdateBackup updates the parameters of a single Backup.

Example

package main

import (
	"context"

	alloydb "cloud.google.com/go/alloydb/apiv1alpha"
	alloydbpb "cloud.google.com/go/alloydb/apiv1alpha/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/apiv1alpha/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

UpdateCluster updates the parameters of a single Cluster.

Example

package main

import (
	"context"

	alloydb "cloud.google.com/go/alloydb/apiv1alpha"
	alloydbpb "cloud.google.com/go/alloydb/apiv1alpha/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/apiv1alpha/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

UpdateInstance updates the parameters of a single Instance.

Example

package main

import (
	"context"

	alloydb "cloud.google.com/go/alloydb/apiv1alpha"
	alloydbpb "cloud.google.com/go/alloydb/apiv1alpha/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/apiv1alpha/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

UpdateUser updates the parameters of a single User.

Example

package main

import (
	"context"

	alloydb "cloud.google.com/go/alloydb/apiv1alpha"
	alloydbpb "cloud.google.com/go/alloydb/apiv1alpha/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/apiv1alpha/alloydbpb#UpdateUserRequest.
	}
	resp, err := c.UpdateUser(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

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) 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

Done reports whether the long-running operation has completed.

func (*BatchCreateInstancesOperation) Metadata

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

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

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

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) 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

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

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

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

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

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

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

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

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

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

Done reports whether the long-running operation has completed.

func (*CreateSecondaryClusterOperation) Metadata

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

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

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

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

Done reports whether the long-running operation has completed.

func (*CreateSecondaryInstanceOperation) Metadata

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

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

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

Wait blocks until the long-running operation is completed, returning the response and any errors encountered.

See documentation of Poll for error-handling information.

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

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

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

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

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

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

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

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

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

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) 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) 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) Next

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

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

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

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

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

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

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

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

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

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) Next

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.

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

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

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

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

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

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

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

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

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

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) 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.