Cloud Filestore API v1 - Package cloud.google.com/go/filestore/apiv1 (v0.1.0)

Package filestore is an auto-generated package for the Cloud Filestore API.

The Cloud Filestore API is used for creating and managing cloud file servers.

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

Example usage

To get started with this package, create a client.

ctx := context.Background()
c, err := filestore.NewCloudFilestoreManagerClient(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()
c, err := filestore.NewCloudFilestoreManagerClient(ctx)
if err != nil {
    // TODO: Handle error.
}
defer c.Close()

req := &filestorepb.ListInstancesRequest{
    // TODO: Fill request struct fields.
    // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/filestore/v1#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
}

Use of Context

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

For information about setting deadlines, reusing contexts, and more please visit https://pkg.go.dev/cloud.google.com/go.

Functions

func DefaultAuthScopes

func DefaultAuthScopes() []string

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

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

BackupIterator manages a stream of *filestorepb.Backup.

func (*BackupIterator) Next

func (it *BackupIterator) Next() (*filestorepb.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.

CloudFilestoreManagerCallOptions

type CloudFilestoreManagerCallOptions struct {
	ListInstances   []gax.CallOption
	GetInstance     []gax.CallOption
	CreateInstance  []gax.CallOption
	UpdateInstance  []gax.CallOption
	RestoreInstance []gax.CallOption
	DeleteInstance  []gax.CallOption
	ListBackups     []gax.CallOption
	GetBackup       []gax.CallOption
	CreateBackup    []gax.CallOption
	DeleteBackup    []gax.CallOption
	UpdateBackup    []gax.CallOption
}

CloudFilestoreManagerCallOptions contains the retry settings for each method of CloudFilestoreManagerClient.

CloudFilestoreManagerClient

type CloudFilestoreManagerClient struct {

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

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

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

Configures and manages Cloud Filestore resources.

Cloud Filestore Manager v1.

The file.googleapis.com service implements the Cloud Filestore API and defines the following resource model for managing instances:

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 instances and backups, named: /instances/* and /backups/* respectively.

As such, Cloud Filestore instances are resources of the form: /projects/{project_number}/locations/{location_id}/instances/{instance_id} and backups are resources of the form: /projects/{project_number}/locations/{location_id}/backup/{backup_id}

Note that location_id must be a GCP zone for instances and but to a GCP region for backups; for example:

projects/12345/locations/us-central1-c/instances/my-filestore

projects/12345/locations/us-central1/backups/my-backup

func NewCloudFilestoreManagerClient

func NewCloudFilestoreManagerClient(ctx context.Context, opts ...option.ClientOption) (*CloudFilestoreManagerClient, error)

NewCloudFilestoreManagerClient creates a new cloud filestore manager 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 Filestore resources.

Cloud Filestore Manager v1.

The file.googleapis.com service implements the Cloud Filestore API and defines the following resource model for managing instances:

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 instances and backups, named: /instances/* and /backups/* respectively.

As such, Cloud Filestore instances are resources of the form: /projects/{project_number}/locations/{location_id}/instances/{instance_id} and backups are resources of the form: /projects/{project_number}/locations/{location_id}/backup/{backup_id}

Note that location_id must be a GCP zone for instances and but to a GCP region for backups; for example:

projects/12345/locations/us-central1-c/instances/my-filestore

projects/12345/locations/us-central1/backups/my-backup

Example

package main

import (
	"context"

	filestore "cloud.google.com/go/filestore/apiv1"
)

func main() {
	ctx := context.Background()
	c, err := filestore.NewCloudFilestoreManagerClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func (*CloudFilestoreManagerClient) Close

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

func (*CloudFilestoreManagerClient) Connection

func (c *CloudFilestoreManagerClient) Connection() *grpc.ClientConn

Connection returns a connection to the API service.

Deprecated.

func (*CloudFilestoreManagerClient) CreateBackup

CreateBackup creates a backup.

Example

package main

import (
	"context"

	filestore "cloud.google.com/go/filestore/apiv1"

	filestorepb "google.golang.org/genproto/googleapis/cloud/filestore/v1"
)

func main() {
	ctx := context.Background()
	c, err := filestore.NewCloudFilestoreManagerClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &filestorepb.CreateBackupRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/filestore/v1#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 (*CloudFilestoreManagerClient) CreateBackupOperation

func (c *CloudFilestoreManagerClient) 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 (*CloudFilestoreManagerClient) CreateInstance

CreateInstance creates an instance. When creating from a backup, the capacity of the new instance needs to be equal to or larger than the capacity of the backup (and also equal to or larger than the minimum capacity of the tier).

Example

package main

import (
	"context"

	filestore "cloud.google.com/go/filestore/apiv1"

	filestorepb "google.golang.org/genproto/googleapis/cloud/filestore/v1"
)

func main() {
	ctx := context.Background()
	c, err := filestore.NewCloudFilestoreManagerClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &filestorepb.CreateInstanceRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/filestore/v1#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 (*CloudFilestoreManagerClient) CreateInstanceOperation

func (c *CloudFilestoreManagerClient) 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 (*CloudFilestoreManagerClient) DeleteBackup

DeleteBackup deletes a backup.

Example

package main

import (
	"context"

	filestore "cloud.google.com/go/filestore/apiv1"

	filestorepb "google.golang.org/genproto/googleapis/cloud/filestore/v1"
)

func main() {
	ctx := context.Background()
	c, err := filestore.NewCloudFilestoreManagerClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &filestorepb.DeleteBackupRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/filestore/v1#DeleteBackupRequest.
	}
	op, err := c.DeleteBackup(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*CloudFilestoreManagerClient) DeleteBackupOperation

func (c *CloudFilestoreManagerClient) 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 (*CloudFilestoreManagerClient) DeleteInstance

DeleteInstance deletes an instance.

Example

package main

import (
	"context"

	filestore "cloud.google.com/go/filestore/apiv1"

	filestorepb "google.golang.org/genproto/googleapis/cloud/filestore/v1"
)

func main() {
	ctx := context.Background()
	c, err := filestore.NewCloudFilestoreManagerClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &filestorepb.DeleteInstanceRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/filestore/v1#DeleteInstanceRequest.
	}
	op, err := c.DeleteInstance(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*CloudFilestoreManagerClient) DeleteInstanceOperation

func (c *CloudFilestoreManagerClient) 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 (*CloudFilestoreManagerClient) GetBackup

GetBackup gets the details of a specific backup.

Example

package main

import (
	"context"

	filestore "cloud.google.com/go/filestore/apiv1"

	filestorepb "google.golang.org/genproto/googleapis/cloud/filestore/v1"
)

func main() {
	ctx := context.Background()
	c, err := filestore.NewCloudFilestoreManagerClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &filestorepb.GetBackupRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/filestore/v1#GetBackupRequest.
	}
	resp, err := c.GetBackup(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*CloudFilestoreManagerClient) GetInstance

GetInstance gets the details of a specific instance.

Example

package main

import (
	"context"

	filestore "cloud.google.com/go/filestore/apiv1"

	filestorepb "google.golang.org/genproto/googleapis/cloud/filestore/v1"
)

func main() {
	ctx := context.Background()
	c, err := filestore.NewCloudFilestoreManagerClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &filestorepb.GetInstanceRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/filestore/v1#GetInstanceRequest.
	}
	resp, err := c.GetInstance(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*CloudFilestoreManagerClient) ListBackups

ListBackups lists all backups in a project for either a specified location or for all locations.

Example

package main

import (
	"context"

	filestore "cloud.google.com/go/filestore/apiv1"
	"google.golang.org/api/iterator"

	filestorepb "google.golang.org/genproto/googleapis/cloud/filestore/v1"
)

func main() {
	ctx := context.Background()
	c, err := filestore.NewCloudFilestoreManagerClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &filestorepb.ListBackupsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/filestore/v1#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 (*CloudFilestoreManagerClient) ListInstances

ListInstances lists all instances in a project for either a specified location or for all locations.

Example

package main

import (
	"context"

	filestore "cloud.google.com/go/filestore/apiv1"
	"google.golang.org/api/iterator"

	filestorepb "google.golang.org/genproto/googleapis/cloud/filestore/v1"
)

func main() {
	ctx := context.Background()
	c, err := filestore.NewCloudFilestoreManagerClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &filestorepb.ListInstancesRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/filestore/v1#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 (*CloudFilestoreManagerClient) RestoreInstance

RestoreInstance restores an existing instance’s file share from a backup.

The capacity of the instance needs to be equal to or larger than the capacity of the backup (and also equal to or larger than the minimum capacity of the tier).

Example

package main

import (
	"context"

	filestore "cloud.google.com/go/filestore/apiv1"

	filestorepb "google.golang.org/genproto/googleapis/cloud/filestore/v1"
)

func main() {
	ctx := context.Background()
	c, err := filestore.NewCloudFilestoreManagerClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &filestorepb.RestoreInstanceRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/filestore/v1#RestoreInstanceRequest.
	}
	op, err := c.RestoreInstance(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

	resp, err := op.Wait(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*CloudFilestoreManagerClient) RestoreInstanceOperation

func (c *CloudFilestoreManagerClient) RestoreInstanceOperation(name string) *RestoreInstanceOperation

RestoreInstanceOperation returns a new RestoreInstanceOperation from a given name. The name must be that of a previously created RestoreInstanceOperation, possibly from a different process.

func (*CloudFilestoreManagerClient) UpdateBackup

UpdateBackup updates the settings of a specific backup.

Example

package main

import (
	"context"

	filestore "cloud.google.com/go/filestore/apiv1"

	filestorepb "google.golang.org/genproto/googleapis/cloud/filestore/v1"
)

func main() {
	ctx := context.Background()
	c, err := filestore.NewCloudFilestoreManagerClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &filestorepb.UpdateBackupRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/filestore/v1#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 (*CloudFilestoreManagerClient) UpdateBackupOperation

func (c *CloudFilestoreManagerClient) 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 (*CloudFilestoreManagerClient) UpdateInstance

UpdateInstance updates the settings of a specific instance.

Example

package main

import (
	"context"

	filestore "cloud.google.com/go/filestore/apiv1"

	filestorepb "google.golang.org/genproto/googleapis/cloud/filestore/v1"
)

func main() {
	ctx := context.Background()
	c, err := filestore.NewCloudFilestoreManagerClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &filestorepb.UpdateInstanceRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/filestore/v1#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 (*CloudFilestoreManagerClient) UpdateInstanceOperation

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

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.

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.

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.

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.

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

InstanceIterator manages a stream of *filestorepb.Instance.

func (*InstanceIterator) Next

func (it *InstanceIterator) Next() (*filestorepb.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.

RestoreInstanceOperation

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

RestoreInstanceOperation manages a long-running operation from RestoreInstance.

func (*RestoreInstanceOperation) Done

func (op *RestoreInstanceOperation) Done() bool

Done reports whether the long-running operation has completed.

func (*RestoreInstanceOperation) 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 (*RestoreInstanceOperation) Name

func (op *RestoreInstanceOperation) 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 (*RestoreInstanceOperation) 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 (*RestoreInstanceOperation) 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.

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.

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.