cluster

package
v1.14.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package cluster is an auto-generated package for the Google Cloud Memorystore for Redis API.

Creates and manages Redis instances on the Google Cloud Platform.

NOTE: This package is in beta. It is not stable, and may be subject to changes.

General documentation

For information that is relevant for all client libraries please reference https://pkg.golang.ir/cloud.google.com/go#pkg-overview. Some information on this page includes:

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.golang.ir/cloud.google.com/go#hdr-Client_Options
c, err := cluster.NewCloudRedisClusterClient(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.golang.ir/cloud.google.com/go#hdr-Client_Options
c, err := cluster.NewCloudRedisClusterClient(ctx)
if err != nil {
	// TODO: Handle error.
}
defer c.Close()

req := &clusterpb.CreateClusterRequest{
	// TODO: Fill request struct fields.
	// See https://pkg.golang.ir/cloud.google.com/go/redis/cluster/apiv1/clusterpb#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

Use of Context

The ctx passed to NewCloudRedisClusterClient 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.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultAuthScopes

func DefaultAuthScopes() []string

DefaultAuthScopes reports the default set of authentication scopes to use with this package.

Types

type CloudRedisClusterCallOptions

type CloudRedisClusterCallOptions struct {
	ListClusters    []gax.CallOption
	GetCluster      []gax.CallOption
	UpdateCluster   []gax.CallOption
	DeleteCluster   []gax.CallOption
	CreateCluster   []gax.CallOption
	GetLocation     []gax.CallOption
	ListLocations   []gax.CallOption
	CancelOperation []gax.CallOption
	DeleteOperation []gax.CallOption
	GetOperation    []gax.CallOption
	ListOperations  []gax.CallOption
}

CloudRedisClusterCallOptions contains the retry settings for each method of CloudRedisClusterClient.

type CloudRedisClusterClient

type CloudRedisClusterClient struct {

	// The call options for this service.
	CallOptions *CloudRedisClusterCallOptions

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

CloudRedisClusterClient is a client for interacting with Google Cloud Memorystore for Redis API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

Configures and manages Cloud Memorystore for Redis clusters

Google Cloud Memorystore for Redis Cluster

The redis.googleapis.com service implements the Google Cloud Memorystore for Redis API and defines the following resource model for managing Redis clusters:

The service works with a collection of cloud projects, named: /projects/*

Each project has a collection of available locations, named: /locations/*

Each location has a collection of Redis clusters, named: /clusters/*

As such, Redis clusters are resources of the form:
/projects/{project_id}/locations/{location_id}/clusters/{instance_id}

Note that location_id must be a GCP region; for example:

projects/redpepper-1290/locations/us-central1/clusters/my-redis

We use API version selector for Flex APIs

The versioning strategy is release-based versioning

Our backend CLH only deals with the superset version (called v1main)

Existing backend for Redis Gen1 and MRR is not touched.

More details in go/redis-flex-api-versioning

func NewCloudRedisClusterClient

func NewCloudRedisClusterClient(ctx context.Context, opts ...option.ClientOption) (*CloudRedisClusterClient, error)

NewCloudRedisClusterClient creates a new cloud redis cluster client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.

Configures and manages Cloud Memorystore for Redis clusters

Google Cloud Memorystore for Redis Cluster

The redis.googleapis.com service implements the Google Cloud Memorystore for Redis API and defines the following resource model for managing Redis clusters:

The service works with a collection of cloud projects, named: /projects/*

Each project has a collection of available locations, named: /locations/*

Each location has a collection of Redis clusters, named: /clusters/*

As such, Redis clusters are resources of the form:
/projects/{project_id}/locations/{location_id}/clusters/{instance_id}

Note that location_id must be a GCP region; for example:

projects/redpepper-1290/locations/us-central1/clusters/my-redis

We use API version selector for Flex APIs

The versioning strategy is release-based versioning

Our backend CLH only deals with the superset version (called v1main)

Existing backend for Redis Gen1 and MRR is not touched.

More details in go/redis-flex-api-versioning
Example
package main

import (
	"context"

	cluster "cloud.google.com/go/redis/cluster/apiv1"
)

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.golang.ir/cloud.google.com/go#hdr-Client_Options
	c, err := cluster.NewCloudRedisClusterClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}
Output:

func NewCloudRedisClusterRESTClient

func NewCloudRedisClusterRESTClient(ctx context.Context, opts ...option.ClientOption) (*CloudRedisClusterClient, error)

NewCloudRedisClusterRESTClient creates a new cloud redis cluster rest client.

Configures and manages Cloud Memorystore for Redis clusters

Google Cloud Memorystore for Redis Cluster

The redis.googleapis.com service implements the Google Cloud Memorystore for Redis API and defines the following resource model for managing Redis clusters:

The service works with a collection of cloud projects, named: /projects/*

Each project has a collection of available locations, named: /locations/*

Each location has a collection of Redis clusters, named: /clusters/*

As such, Redis clusters are resources of the form:
/projects/{project_id}/locations/{location_id}/clusters/{instance_id}

Note that location_id must be a GCP region; for example:

projects/redpepper-1290/locations/us-central1/clusters/my-redis

We use API version selector for Flex APIs

The versioning strategy is release-based versioning

Our backend CLH only deals with the superset version (called v1main)

Existing backend for Redis Gen1 and MRR is not touched.

More details in go/redis-flex-api-versioning
Example
package main

import (
	"context"

	cluster "cloud.google.com/go/redis/cluster/apiv1"
)

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.golang.ir/cloud.google.com/go#hdr-Client_Options
	c, err := cluster.NewCloudRedisClusterRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}
Output:

func (*CloudRedisClusterClient) CancelOperation

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

Example
package main

import (
	"context"

	longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
	cluster "cloud.google.com/go/redis/cluster/apiv1"
)

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.golang.ir/cloud.google.com/go#hdr-Client_Options
	c, err := cluster.NewCloudRedisClusterClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &longrunningpb.CancelOperationRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.golang.ir/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
	}
	err = c.CancelOperation(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
}
Output:

func (*CloudRedisClusterClient) Close

func (c *CloudRedisClusterClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*CloudRedisClusterClient) Connection deprecated

func (c *CloudRedisClusterClient) 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 (*CloudRedisClusterClient) CreateCluster

CreateCluster creates a Redis cluster based on the specified properties. The creation is executed asynchronously and callers may check the returned operation to track its progress. Once the operation is completed the Redis cluster will be fully functional. The completed longrunning.Operation will contain the new cluster object in the response field.

The returned operation is automatically deleted after a few hours, so there is no need to call DeleteOperation.

Example
package main

import (
	"context"

	cluster "cloud.google.com/go/redis/cluster/apiv1"

	clusterpb "cloud.google.com/go/redis/cluster/apiv1/clusterpb"
)

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.golang.ir/cloud.google.com/go#hdr-Client_Options
	c, err := cluster.NewCloudRedisClusterClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &clusterpb.CreateClusterRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.golang.ir/cloud.google.com/go/redis/cluster/apiv1/clusterpb#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
}
Output:

func (*CloudRedisClusterClient) CreateClusterOperation

func (c *CloudRedisClusterClient) 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 (*CloudRedisClusterClient) DeleteCluster

DeleteCluster deletes a specific Redis cluster. Cluster stops serving and data is deleted.

Example
package main

import (
	"context"

	cluster "cloud.google.com/go/redis/cluster/apiv1"

	clusterpb "cloud.google.com/go/redis/cluster/apiv1/clusterpb"
)

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.golang.ir/cloud.google.com/go#hdr-Client_Options
	c, err := cluster.NewCloudRedisClusterClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &clusterpb.DeleteClusterRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.golang.ir/cloud.google.com/go/redis/cluster/apiv1/clusterpb#DeleteClusterRequest.
	}
	op, err := c.DeleteCluster(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

	err = op.Wait(ctx)
	if err != nil {
		// TODO: Handle error.
	}
}
Output:

func (*CloudRedisClusterClient) DeleteClusterOperation

func (c *CloudRedisClusterClient) 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 (*CloudRedisClusterClient) DeleteOperation

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

Example
package main

import (
	"context"

	longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
	cluster "cloud.google.com/go/redis/cluster/apiv1"
)

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.golang.ir/cloud.google.com/go#hdr-Client_Options
	c, err := cluster.NewCloudRedisClusterClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &longrunningpb.DeleteOperationRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.golang.ir/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.
	}
	err = c.DeleteOperation(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
}
Output:

func (*CloudRedisClusterClient) GetCluster

GetCluster gets the details of a specific Redis cluster.

Example
package main

import (
	"context"

	cluster "cloud.google.com/go/redis/cluster/apiv1"

	clusterpb "cloud.google.com/go/redis/cluster/apiv1/clusterpb"
)

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.golang.ir/cloud.google.com/go#hdr-Client_Options
	c, err := cluster.NewCloudRedisClusterClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &clusterpb.GetClusterRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.golang.ir/cloud.google.com/go/redis/cluster/apiv1/clusterpb#GetClusterRequest.
	}
	resp, err := c.GetCluster(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*CloudRedisClusterClient) GetLocation

GetLocation gets information about a location.

Example
package main

import (
	"context"

	cluster "cloud.google.com/go/redis/cluster/apiv1"

	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.golang.ir/cloud.google.com/go#hdr-Client_Options
	c, err := cluster.NewCloudRedisClusterClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &locationpb.GetLocationRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.golang.ir/google.golang.org/genproto/googleapis/cloud/location#GetLocationRequest.
	}
	resp, err := c.GetLocation(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*CloudRedisClusterClient) GetOperation

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

Example
package main

import (
	"context"

	longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
	cluster "cloud.google.com/go/redis/cluster/apiv1"
)

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.golang.ir/cloud.google.com/go#hdr-Client_Options
	c, err := cluster.NewCloudRedisClusterClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &longrunningpb.GetOperationRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.golang.ir/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
	}
	resp, err := c.GetOperation(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

func (*CloudRedisClusterClient) ListClusters

ListClusters lists all Redis clusters owned by a project in either the specified location (region) or all locations.

The location should have the following format:

projects/{project_id}/locations/{location_id}

If location_id is specified as - (wildcard), then all regions available to the project are queried, and the results are aggregated.

Example
package main

import (
	"context"

	cluster "cloud.google.com/go/redis/cluster/apiv1"

	clusterpb "cloud.google.com/go/redis/cluster/apiv1/clusterpb"
	"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.golang.ir/cloud.google.com/go#hdr-Client_Options
	c, err := cluster.NewCloudRedisClusterClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &clusterpb.ListClustersRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.golang.ir/cloud.google.com/go/redis/cluster/apiv1/clusterpb#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
	}
}
Output:

func (*CloudRedisClusterClient) ListLocations

ListLocations lists information about the supported locations for this service.

Example
package main

import (
	"context"

	cluster "cloud.google.com/go/redis/cluster/apiv1"
	"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.golang.ir/cloud.google.com/go#hdr-Client_Options
	c, err := cluster.NewCloudRedisClusterClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &locationpb.ListLocationsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.golang.ir/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
	}
}
Output:

func (*CloudRedisClusterClient) ListOperations

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

Example
package main

import (
	"context"

	longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
	cluster "cloud.google.com/go/redis/cluster/apiv1"
	"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.golang.ir/cloud.google.com/go#hdr-Client_Options
	c, err := cluster.NewCloudRedisClusterClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &longrunningpb.ListOperationsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.golang.ir/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
	}
}
Output:

func (*CloudRedisClusterClient) UpdateCluster

UpdateCluster updates the metadata and configuration of a specific Redis cluster.

Completed longrunning.Operation will contain the new cluster object in the response field. The returned operation is automatically deleted after a few hours, so there is no need to call DeleteOperation.

Example
package main

import (
	"context"

	cluster "cloud.google.com/go/redis/cluster/apiv1"

	clusterpb "cloud.google.com/go/redis/cluster/apiv1/clusterpb"
)

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.golang.ir/cloud.google.com/go#hdr-Client_Options
	c, err := cluster.NewCloudRedisClusterClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &clusterpb.UpdateClusterRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.golang.ir/cloud.google.com/go/redis/cluster/apiv1/clusterpb#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
}
Output:

func (*CloudRedisClusterClient) UpdateClusterOperation

func (c *CloudRedisClusterClient) 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.

type 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 []*clusterpb.Cluster, nextPageToken string, err error)
	// contains filtered or unexported fields
}

ClusterIterator manages a stream of *clusterpb.Cluster.

func (*ClusterIterator) Next

func (it *ClusterIterator) Next() (*clusterpb.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.

type CreateClusterOperation

type CreateClusterOperation struct {
	// contains filtered or unexported fields
}

CreateClusterOperation manages a long-running operation from CreateCluster.

func (*CreateClusterOperation) Done

func (op *CreateClusterOperation) Done() bool

Done reports whether the long-running operation has completed.

func (*CreateClusterOperation) Metadata

func (op *CreateClusterOperation) Metadata() (*anypb.Any, error)

Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.

func (*CreateClusterOperation) Name

func (op *CreateClusterOperation) Name() string

Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.

func (*CreateClusterOperation) Poll

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.

type DeleteClusterOperation

type DeleteClusterOperation struct {
	// contains filtered or unexported fields
}

DeleteClusterOperation manages a long-running operation from DeleteCluster.

func (*DeleteClusterOperation) Done

func (op *DeleteClusterOperation) Done() bool

Done reports whether the long-running operation has completed.

func (*DeleteClusterOperation) Metadata

func (op *DeleteClusterOperation) Metadata() (*anypb.Any, error)

Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.

func (*DeleteClusterOperation) Name

func (op *DeleteClusterOperation) Name() string

Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.

func (*DeleteClusterOperation) Poll

func (op *DeleteClusterOperation) Poll(ctx context.Context, opts ...gax.CallOption) error

Poll fetches the latest state of the long-running operation.

Poll also fetches the latest metadata, which can be retrieved by Metadata.

If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.

func (*DeleteClusterOperation) Wait

func (op *DeleteClusterOperation) Wait(ctx context.Context, opts ...gax.CallOption) error

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

See documentation of Poll for error-handling information.

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

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

type UpdateClusterOperation

type UpdateClusterOperation struct {
	// contains filtered or unexported fields
}

UpdateClusterOperation manages a long-running operation from UpdateCluster.

func (*UpdateClusterOperation) Done

func (op *UpdateClusterOperation) Done() bool

Done reports whether the long-running operation has completed.

func (*UpdateClusterOperation) Metadata

func (op *UpdateClusterOperation) Metadata() (*anypb.Any, error)

Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.

func (*UpdateClusterOperation) Name

func (op *UpdateClusterOperation) Name() string

Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.

func (*UpdateClusterOperation) Poll

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL