Documentation ¶
Overview ¶
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.
General documentation ¶
For information that is relevant for all client libraries please reference https://pkg.go.dev/cloud.google.com/go#pkg-overview. Some information on this page includes:
- Authentication and Authorization
- Timeouts and Cancellation
- Testing against Client Libraries
- Debugging Client Libraries
- Inspecting errors
Example usage ¶
To get started with this package, create a client.
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 := 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() // 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 := 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/cloud.google.com/go/filestore/apiv1/filestorepb#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
Use of Context ¶
The ctx passed to NewCloudFilestoreManagerClient 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 ¶
- func DefaultAuthScopes() []string
- type BackupIterator
- type CloudFilestoreManagerCallOptions
- type CloudFilestoreManagerClient
- func (c *CloudFilestoreManagerClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, ...) error
- func (c *CloudFilestoreManagerClient) Close() error
- func (c *CloudFilestoreManagerClient) Connection() *grpc.ClientConndeprecated
- func (c *CloudFilestoreManagerClient) CreateBackup(ctx context.Context, req *filestorepb.CreateBackupRequest, ...) (*CreateBackupOperation, error)
- func (c *CloudFilestoreManagerClient) CreateBackupOperation(name string) *CreateBackupOperation
- func (c *CloudFilestoreManagerClient) CreateInstance(ctx context.Context, req *filestorepb.CreateInstanceRequest, ...) (*CreateInstanceOperation, error)
- func (c *CloudFilestoreManagerClient) CreateInstanceOperation(name string) *CreateInstanceOperation
- func (c *CloudFilestoreManagerClient) CreateSnapshot(ctx context.Context, req *filestorepb.CreateSnapshotRequest, ...) (*CreateSnapshotOperation, error)
- func (c *CloudFilestoreManagerClient) CreateSnapshotOperation(name string) *CreateSnapshotOperation
- func (c *CloudFilestoreManagerClient) DeleteBackup(ctx context.Context, req *filestorepb.DeleteBackupRequest, ...) (*DeleteBackupOperation, error)
- func (c *CloudFilestoreManagerClient) DeleteBackupOperation(name string) *DeleteBackupOperation
- func (c *CloudFilestoreManagerClient) DeleteInstance(ctx context.Context, req *filestorepb.DeleteInstanceRequest, ...) (*DeleteInstanceOperation, error)
- func (c *CloudFilestoreManagerClient) DeleteInstanceOperation(name string) *DeleteInstanceOperation
- func (c *CloudFilestoreManagerClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, ...) error
- func (c *CloudFilestoreManagerClient) DeleteSnapshot(ctx context.Context, req *filestorepb.DeleteSnapshotRequest, ...) (*DeleteSnapshotOperation, error)
- func (c *CloudFilestoreManagerClient) DeleteSnapshotOperation(name string) *DeleteSnapshotOperation
- func (c *CloudFilestoreManagerClient) GetBackup(ctx context.Context, req *filestorepb.GetBackupRequest, opts ...gax.CallOption) (*filestorepb.Backup, error)
- func (c *CloudFilestoreManagerClient) GetInstance(ctx context.Context, req *filestorepb.GetInstanceRequest, ...) (*filestorepb.Instance, error)
- func (c *CloudFilestoreManagerClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, ...) (*locationpb.Location, error)
- func (c *CloudFilestoreManagerClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, ...) (*longrunningpb.Operation, error)
- func (c *CloudFilestoreManagerClient) GetSnapshot(ctx context.Context, req *filestorepb.GetSnapshotRequest, ...) (*filestorepb.Snapshot, error)
- func (c *CloudFilestoreManagerClient) ListBackups(ctx context.Context, req *filestorepb.ListBackupsRequest, ...) *BackupIterator
- func (c *CloudFilestoreManagerClient) ListInstances(ctx context.Context, req *filestorepb.ListInstancesRequest, ...) *InstanceIterator
- func (c *CloudFilestoreManagerClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, ...) *LocationIterator
- func (c *CloudFilestoreManagerClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, ...) *OperationIterator
- func (c *CloudFilestoreManagerClient) ListSnapshots(ctx context.Context, req *filestorepb.ListSnapshotsRequest, ...) *SnapshotIterator
- func (c *CloudFilestoreManagerClient) RestoreInstance(ctx context.Context, req *filestorepb.RestoreInstanceRequest, ...) (*RestoreInstanceOperation, error)
- func (c *CloudFilestoreManagerClient) RestoreInstanceOperation(name string) *RestoreInstanceOperation
- func (c *CloudFilestoreManagerClient) RevertInstance(ctx context.Context, req *filestorepb.RevertInstanceRequest, ...) (*RevertInstanceOperation, error)
- func (c *CloudFilestoreManagerClient) RevertInstanceOperation(name string) *RevertInstanceOperation
- func (c *CloudFilestoreManagerClient) UpdateBackup(ctx context.Context, req *filestorepb.UpdateBackupRequest, ...) (*UpdateBackupOperation, error)
- func (c *CloudFilestoreManagerClient) UpdateBackupOperation(name string) *UpdateBackupOperation
- func (c *CloudFilestoreManagerClient) UpdateInstance(ctx context.Context, req *filestorepb.UpdateInstanceRequest, ...) (*UpdateInstanceOperation, error)
- func (c *CloudFilestoreManagerClient) UpdateInstanceOperation(name string) *UpdateInstanceOperation
- func (c *CloudFilestoreManagerClient) UpdateSnapshot(ctx context.Context, req *filestorepb.UpdateSnapshotRequest, ...) (*UpdateSnapshotOperation, error)
- func (c *CloudFilestoreManagerClient) UpdateSnapshotOperation(name string) *UpdateSnapshotOperation
- type CreateBackupOperation
- func (op *CreateBackupOperation) Done() bool
- func (op *CreateBackupOperation) Metadata() (*commonpb.OperationMetadata, error)
- func (op *CreateBackupOperation) Name() string
- func (op *CreateBackupOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*filestorepb.Backup, error)
- func (op *CreateBackupOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*filestorepb.Backup, error)
- type CreateInstanceOperation
- func (op *CreateInstanceOperation) Done() bool
- func (op *CreateInstanceOperation) Metadata() (*commonpb.OperationMetadata, error)
- func (op *CreateInstanceOperation) Name() string
- func (op *CreateInstanceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*filestorepb.Instance, error)
- func (op *CreateInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*filestorepb.Instance, error)
- type CreateSnapshotOperation
- func (op *CreateSnapshotOperation) Done() bool
- func (op *CreateSnapshotOperation) Metadata() (*commonpb.OperationMetadata, error)
- func (op *CreateSnapshotOperation) Name() string
- func (op *CreateSnapshotOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*filestorepb.Snapshot, error)
- func (op *CreateSnapshotOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*filestorepb.Snapshot, error)
- type DeleteBackupOperation
- func (op *DeleteBackupOperation) Done() bool
- func (op *DeleteBackupOperation) Metadata() (*commonpb.OperationMetadata, error)
- func (op *DeleteBackupOperation) Name() string
- func (op *DeleteBackupOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
- func (op *DeleteBackupOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
- type DeleteInstanceOperation
- func (op *DeleteInstanceOperation) Done() bool
- func (op *DeleteInstanceOperation) Metadata() (*commonpb.OperationMetadata, error)
- func (op *DeleteInstanceOperation) Name() string
- func (op *DeleteInstanceOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
- func (op *DeleteInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
- type DeleteSnapshotOperation
- func (op *DeleteSnapshotOperation) Done() bool
- func (op *DeleteSnapshotOperation) Metadata() (*commonpb.OperationMetadata, error)
- func (op *DeleteSnapshotOperation) Name() string
- func (op *DeleteSnapshotOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
- func (op *DeleteSnapshotOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
- type InstanceIterator
- type LocationIterator
- type OperationIterator
- type RestoreInstanceOperation
- func (op *RestoreInstanceOperation) Done() bool
- func (op *RestoreInstanceOperation) Metadata() (*commonpb.OperationMetadata, error)
- func (op *RestoreInstanceOperation) Name() string
- func (op *RestoreInstanceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*filestorepb.Instance, error)
- func (op *RestoreInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*filestorepb.Instance, error)
- type RevertInstanceOperation
- func (op *RevertInstanceOperation) Done() bool
- func (op *RevertInstanceOperation) Metadata() (*commonpb.OperationMetadata, error)
- func (op *RevertInstanceOperation) Name() string
- func (op *RevertInstanceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*filestorepb.Instance, error)
- func (op *RevertInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*filestorepb.Instance, error)
- type SnapshotIterator
- type UpdateBackupOperation
- func (op *UpdateBackupOperation) Done() bool
- func (op *UpdateBackupOperation) Metadata() (*commonpb.OperationMetadata, error)
- func (op *UpdateBackupOperation) Name() string
- func (op *UpdateBackupOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*filestorepb.Backup, error)
- func (op *UpdateBackupOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*filestorepb.Backup, error)
- type UpdateInstanceOperation
- func (op *UpdateInstanceOperation) Done() bool
- func (op *UpdateInstanceOperation) Metadata() (*commonpb.OperationMetadata, error)
- func (op *UpdateInstanceOperation) Name() string
- func (op *UpdateInstanceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*filestorepb.Instance, error)
- func (op *UpdateInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*filestorepb.Instance, error)
- type UpdateSnapshotOperation
- func (op *UpdateSnapshotOperation) Done() bool
- func (op *UpdateSnapshotOperation) Metadata() (*commonpb.OperationMetadata, error)
- func (op *UpdateSnapshotOperation) Name() string
- func (op *UpdateSnapshotOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*filestorepb.Snapshot, error)
- func (op *UpdateSnapshotOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*filestorepb.Snapshot, error)
Examples ¶
- CloudFilestoreManagerClient.CancelOperation
- CloudFilestoreManagerClient.CreateBackup
- CloudFilestoreManagerClient.CreateInstance
- CloudFilestoreManagerClient.CreateSnapshot
- CloudFilestoreManagerClient.DeleteBackup
- CloudFilestoreManagerClient.DeleteInstance
- CloudFilestoreManagerClient.DeleteOperation
- CloudFilestoreManagerClient.DeleteSnapshot
- CloudFilestoreManagerClient.GetBackup
- CloudFilestoreManagerClient.GetInstance
- CloudFilestoreManagerClient.GetLocation
- CloudFilestoreManagerClient.GetOperation
- CloudFilestoreManagerClient.GetSnapshot
- CloudFilestoreManagerClient.ListBackups
- CloudFilestoreManagerClient.ListBackups (All)
- CloudFilestoreManagerClient.ListInstances
- CloudFilestoreManagerClient.ListInstances (All)
- CloudFilestoreManagerClient.ListLocations
- CloudFilestoreManagerClient.ListLocations (All)
- CloudFilestoreManagerClient.ListOperations
- CloudFilestoreManagerClient.ListOperations (All)
- CloudFilestoreManagerClient.ListSnapshots
- CloudFilestoreManagerClient.ListSnapshots (All)
- CloudFilestoreManagerClient.RestoreInstance
- CloudFilestoreManagerClient.RevertInstance
- CloudFilestoreManagerClient.UpdateBackup
- CloudFilestoreManagerClient.UpdateInstance
- CloudFilestoreManagerClient.UpdateSnapshot
- NewCloudFilestoreManagerClient
- NewCloudFilestoreManagerRESTClient
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 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) All ¶ added in v1.9.1
func (it *BackupIterator) All() iter.Seq2[*filestorepb.Backup, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*BackupIterator) Next ¶
func (it *BackupIterator) Next() (*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.
type CloudFilestoreManagerCallOptions ¶
type CloudFilestoreManagerCallOptions struct { ListInstances []gax.CallOption GetInstance []gax.CallOption CreateInstance []gax.CallOption UpdateInstance []gax.CallOption RestoreInstance []gax.CallOption RevertInstance []gax.CallOption DeleteInstance []gax.CallOption ListSnapshots []gax.CallOption GetSnapshot []gax.CallOption CreateSnapshot []gax.CallOption DeleteSnapshot []gax.CallOption UpdateSnapshot []gax.CallOption ListBackups []gax.CallOption GetBackup []gax.CallOption CreateBackup []gax.CallOption DeleteBackup []gax.CallOption UpdateBackup []gax.CallOption GetLocation []gax.CallOption ListLocations []gax.CallOption CancelOperation []gax.CallOption DeleteOperation []gax.CallOption GetOperation []gax.CallOption ListOperations []gax.CallOption }
CloudFilestoreManagerCallOptions contains the retry settings for each method of CloudFilestoreManagerClient.
type 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 Filestore resources.
Filestore Manager v1.
The file.googleapis.com service implements the 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, 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 Google Cloud zone for instances, but a Google Cloud 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 Filestore resources.
Filestore Manager v1.
The file.googleapis.com service implements the 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, 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 Google Cloud zone for instances, but a Google Cloud 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() // 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 := filestore.NewCloudFilestoreManagerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func NewCloudFilestoreManagerRESTClient ¶ added in v1.5.0
func NewCloudFilestoreManagerRESTClient(ctx context.Context, opts ...option.ClientOption) (*CloudFilestoreManagerClient, error)
NewCloudFilestoreManagerRESTClient creates a new cloud filestore manager rest client.
Configures and manages Filestore resources.
Filestore Manager v1.
The file.googleapis.com service implements the 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, 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 Google Cloud zone for instances, but a Google Cloud 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() // 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 := filestore.NewCloudFilestoreManagerRESTClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*CloudFilestoreManagerClient) CancelOperation ¶ added in v1.8.0
func (c *CloudFilestoreManagerClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" filestore "cloud.google.com/go/filestore/apiv1" 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 := filestore.NewCloudFilestoreManagerClient(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. } }
Output:
func (*CloudFilestoreManagerClient) Close ¶
func (c *CloudFilestoreManagerClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*CloudFilestoreManagerClient) Connection
deprecated
func (c *CloudFilestoreManagerClient) 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 (*CloudFilestoreManagerClient) CreateBackup ¶
func (c *CloudFilestoreManagerClient) CreateBackup(ctx context.Context, req *filestorepb.CreateBackupRequest, opts ...gax.CallOption) (*CreateBackupOperation, error)
CreateBackup creates a backup.
Example ¶
package main import ( "context" filestore "cloud.google.com/go/filestore/apiv1" filestorepb "cloud.google.com/go/filestore/apiv1/filestorepb" ) 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 := 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/cloud.google.com/go/filestore/apiv1/filestorepb#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 }
Output:
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 ¶
func (c *CloudFilestoreManagerClient) CreateInstance(ctx context.Context, req *filestorepb.CreateInstanceRequest, opts ...gax.CallOption) (*CreateInstanceOperation, error)
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 "cloud.google.com/go/filestore/apiv1/filestorepb" ) 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 := 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/cloud.google.com/go/filestore/apiv1/filestorepb#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 }
Output:
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) CreateSnapshot ¶ added in v1.6.0
func (c *CloudFilestoreManagerClient) CreateSnapshot(ctx context.Context, req *filestorepb.CreateSnapshotRequest, opts ...gax.CallOption) (*CreateSnapshotOperation, error)
CreateSnapshot creates a snapshot.
Example ¶
package main import ( "context" filestore "cloud.google.com/go/filestore/apiv1" filestorepb "cloud.google.com/go/filestore/apiv1/filestorepb" ) 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 := filestore.NewCloudFilestoreManagerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &filestorepb.CreateSnapshotRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/filestore/apiv1/filestorepb#CreateSnapshotRequest. } op, err := c.CreateSnapshot(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 (*CloudFilestoreManagerClient) CreateSnapshotOperation ¶ added in v1.6.0
func (c *CloudFilestoreManagerClient) CreateSnapshotOperation(name string) *CreateSnapshotOperation
CreateSnapshotOperation returns a new CreateSnapshotOperation from a given name. The name must be that of a previously created CreateSnapshotOperation, possibly from a different process.
func (*CloudFilestoreManagerClient) DeleteBackup ¶
func (c *CloudFilestoreManagerClient) DeleteBackup(ctx context.Context, req *filestorepb.DeleteBackupRequest, opts ...gax.CallOption) (*DeleteBackupOperation, error)
DeleteBackup deletes a backup.
Example ¶
package main import ( "context" filestore "cloud.google.com/go/filestore/apiv1" filestorepb "cloud.google.com/go/filestore/apiv1/filestorepb" ) 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 := 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/cloud.google.com/go/filestore/apiv1/filestorepb#DeleteBackupRequest. } op, err := c.DeleteBackup(ctx, req) if err != nil { // TODO: Handle error. } err = op.Wait(ctx) if err != nil { // TODO: Handle error. } }
Output:
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 ¶
func (c *CloudFilestoreManagerClient) DeleteInstance(ctx context.Context, req *filestorepb.DeleteInstanceRequest, opts ...gax.CallOption) (*DeleteInstanceOperation, error)
DeleteInstance deletes an instance.
Example ¶
package main import ( "context" filestore "cloud.google.com/go/filestore/apiv1" filestorepb "cloud.google.com/go/filestore/apiv1/filestorepb" ) 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 := 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/cloud.google.com/go/filestore/apiv1/filestorepb#DeleteInstanceRequest. } op, err := c.DeleteInstance(ctx, req) if err != nil { // TODO: Handle error. } err = op.Wait(ctx) if err != nil { // TODO: Handle error. } }
Output:
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) DeleteOperation ¶ added in v1.8.0
func (c *CloudFilestoreManagerClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error
DeleteOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" filestore "cloud.google.com/go/filestore/apiv1" 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 := filestore.NewCloudFilestoreManagerClient(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. } }
Output:
func (*CloudFilestoreManagerClient) DeleteSnapshot ¶ added in v1.6.0
func (c *CloudFilestoreManagerClient) DeleteSnapshot(ctx context.Context, req *filestorepb.DeleteSnapshotRequest, opts ...gax.CallOption) (*DeleteSnapshotOperation, error)
DeleteSnapshot deletes a snapshot.
Example ¶
package main import ( "context" filestore "cloud.google.com/go/filestore/apiv1" filestorepb "cloud.google.com/go/filestore/apiv1/filestorepb" ) 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 := filestore.NewCloudFilestoreManagerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &filestorepb.DeleteSnapshotRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/filestore/apiv1/filestorepb#DeleteSnapshotRequest. } op, err := c.DeleteSnapshot(ctx, req) if err != nil { // TODO: Handle error. } err = op.Wait(ctx) if err != nil { // TODO: Handle error. } }
Output:
func (*CloudFilestoreManagerClient) DeleteSnapshotOperation ¶ added in v1.6.0
func (c *CloudFilestoreManagerClient) DeleteSnapshotOperation(name string) *DeleteSnapshotOperation
DeleteSnapshotOperation returns a new DeleteSnapshotOperation from a given name. The name must be that of a previously created DeleteSnapshotOperation, possibly from a different process.
func (*CloudFilestoreManagerClient) GetBackup ¶
func (c *CloudFilestoreManagerClient) GetBackup(ctx context.Context, req *filestorepb.GetBackupRequest, opts ...gax.CallOption) (*filestorepb.Backup, error)
GetBackup gets the details of a specific backup.
Example ¶
package main import ( "context" filestore "cloud.google.com/go/filestore/apiv1" filestorepb "cloud.google.com/go/filestore/apiv1/filestorepb" ) 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 := 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/cloud.google.com/go/filestore/apiv1/filestorepb#GetBackupRequest. } resp, err := c.GetBackup(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*CloudFilestoreManagerClient) GetInstance ¶
func (c *CloudFilestoreManagerClient) GetInstance(ctx context.Context, req *filestorepb.GetInstanceRequest, opts ...gax.CallOption) (*filestorepb.Instance, error)
GetInstance gets the details of a specific instance.
Example ¶
package main import ( "context" filestore "cloud.google.com/go/filestore/apiv1" filestorepb "cloud.google.com/go/filestore/apiv1/filestorepb" ) 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 := 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/cloud.google.com/go/filestore/apiv1/filestorepb#GetInstanceRequest. } resp, err := c.GetInstance(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*CloudFilestoreManagerClient) GetLocation ¶ added in v1.8.0
func (c *CloudFilestoreManagerClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
GetLocation gets information about a location.
Example ¶
package main import ( "context" filestore "cloud.google.com/go/filestore/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.go.dev/cloud.google.com/go#hdr-Client_Options c, err := filestore.NewCloudFilestoreManagerClient(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 }
Output:
func (*CloudFilestoreManagerClient) GetOperation ¶ added in v1.8.0
func (c *CloudFilestoreManagerClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" filestore "cloud.google.com/go/filestore/apiv1" 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 := filestore.NewCloudFilestoreManagerClient(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 }
Output:
func (*CloudFilestoreManagerClient) GetSnapshot ¶ added in v1.6.0
func (c *CloudFilestoreManagerClient) GetSnapshot(ctx context.Context, req *filestorepb.GetSnapshotRequest, opts ...gax.CallOption) (*filestorepb.Snapshot, error)
GetSnapshot gets the details of a specific snapshot.
Example ¶
package main import ( "context" filestore "cloud.google.com/go/filestore/apiv1" filestorepb "cloud.google.com/go/filestore/apiv1/filestorepb" ) 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 := filestore.NewCloudFilestoreManagerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &filestorepb.GetSnapshotRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/filestore/apiv1/filestorepb#GetSnapshotRequest. } resp, err := c.GetSnapshot(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*CloudFilestoreManagerClient) ListBackups ¶
func (c *CloudFilestoreManagerClient) ListBackups(ctx context.Context, req *filestorepb.ListBackupsRequest, opts ...gax.CallOption) *BackupIterator
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" filestorepb "cloud.google.com/go/filestore/apiv1/filestorepb" "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 := 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/cloud.google.com/go/filestore/apiv1/filestorepb#ListBackupsRequest. } it := c.ListBackups(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp // If you need to access the underlying RPC response, // you can do so by casting the `Response` as below. // Otherwise, remove this line. Only populated after // first call to Next(). Not safe for concurrent access. _ = it.Response.(*filestorepb.ListBackupsResponse) } }
Output:
Example (All) ¶
package main import ( "context" filestore "cloud.google.com/go/filestore/apiv1" filestorepb "cloud.google.com/go/filestore/apiv1/filestorepb" ) 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 := 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/cloud.google.com/go/filestore/apiv1/filestorepb#ListBackupsRequest. } for resp, err := range c.ListBackups(ctx, req).All() { if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*CloudFilestoreManagerClient) ListInstances ¶
func (c *CloudFilestoreManagerClient) ListInstances(ctx context.Context, req *filestorepb.ListInstancesRequest, opts ...gax.CallOption) *InstanceIterator
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" filestorepb "cloud.google.com/go/filestore/apiv1/filestorepb" "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 := 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/cloud.google.com/go/filestore/apiv1/filestorepb#ListInstancesRequest. } it := c.ListInstances(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp // If you need to access the underlying RPC response, // you can do so by casting the `Response` as below. // Otherwise, remove this line. Only populated after // first call to Next(). Not safe for concurrent access. _ = it.Response.(*filestorepb.ListInstancesResponse) } }
Output:
Example (All) ¶
package main import ( "context" filestore "cloud.google.com/go/filestore/apiv1" filestorepb "cloud.google.com/go/filestore/apiv1/filestorepb" ) 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 := 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/cloud.google.com/go/filestore/apiv1/filestorepb#ListInstancesRequest. } for resp, err := range c.ListInstances(ctx, req).All() { if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*CloudFilestoreManagerClient) ListLocations ¶ added in v1.8.0
func (c *CloudFilestoreManagerClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
ListLocations lists information about the supported locations for this service.
Example ¶
package main import ( "context" filestore "cloud.google.com/go/filestore/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.go.dev/cloud.google.com/go#hdr-Client_Options c, err := filestore.NewCloudFilestoreManagerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &locationpb.ListLocationsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest. } it := c.ListLocations(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp // If you need to access the underlying RPC response, // you can do so by casting the `Response` as below. // Otherwise, remove this line. Only populated after // first call to Next(). Not safe for concurrent access. _ = it.Response.(*locationpb.ListLocationsResponse) } }
Output:
Example (All) ¶
package main import ( "context" filestore "cloud.google.com/go/filestore/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.go.dev/cloud.google.com/go#hdr-Client_Options c, err := filestore.NewCloudFilestoreManagerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &locationpb.ListLocationsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest. } for resp, err := range c.ListLocations(ctx, req).All() { if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*CloudFilestoreManagerClient) ListOperations ¶ added in v1.8.0
func (c *CloudFilestoreManagerClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" filestore "cloud.google.com/go/filestore/apiv1" 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 := filestore.NewCloudFilestoreManagerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &longrunningpb.ListOperationsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest. } it := c.ListOperations(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp // If you need to access the underlying RPC response, // you can do so by casting the `Response` as below. // Otherwise, remove this line. Only populated after // first call to Next(). Not safe for concurrent access. _ = it.Response.(*longrunningpb.ListOperationsResponse) } }
Output:
Example (All) ¶
package main import ( "context" filestore "cloud.google.com/go/filestore/apiv1" 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 := filestore.NewCloudFilestoreManagerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &longrunningpb.ListOperationsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest. } for resp, err := range c.ListOperations(ctx, req).All() { if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*CloudFilestoreManagerClient) ListSnapshots ¶ added in v1.6.0
func (c *CloudFilestoreManagerClient) ListSnapshots(ctx context.Context, req *filestorepb.ListSnapshotsRequest, opts ...gax.CallOption) *SnapshotIterator
ListSnapshots lists all snapshots in a project for either a specified location or for all locations.
Example ¶
package main import ( "context" filestore "cloud.google.com/go/filestore/apiv1" filestorepb "cloud.google.com/go/filestore/apiv1/filestorepb" "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 := filestore.NewCloudFilestoreManagerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &filestorepb.ListSnapshotsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/filestore/apiv1/filestorepb#ListSnapshotsRequest. } it := c.ListSnapshots(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp // If you need to access the underlying RPC response, // you can do so by casting the `Response` as below. // Otherwise, remove this line. Only populated after // first call to Next(). Not safe for concurrent access. _ = it.Response.(*filestorepb.ListSnapshotsResponse) } }
Output:
Example (All) ¶
package main import ( "context" filestore "cloud.google.com/go/filestore/apiv1" filestorepb "cloud.google.com/go/filestore/apiv1/filestorepb" ) 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 := filestore.NewCloudFilestoreManagerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &filestorepb.ListSnapshotsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/filestore/apiv1/filestorepb#ListSnapshotsRequest. } for resp, err := range c.ListSnapshots(ctx, req).All() { if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*CloudFilestoreManagerClient) RestoreInstance ¶
func (c *CloudFilestoreManagerClient) RestoreInstance(ctx context.Context, req *filestorepb.RestoreInstanceRequest, opts ...gax.CallOption) (*RestoreInstanceOperation, error)
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 "cloud.google.com/go/filestore/apiv1/filestorepb" ) 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 := 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/cloud.google.com/go/filestore/apiv1/filestorepb#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 }
Output:
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) RevertInstance ¶ added in v1.8.0
func (c *CloudFilestoreManagerClient) RevertInstance(ctx context.Context, req *filestorepb.RevertInstanceRequest, opts ...gax.CallOption) (*RevertInstanceOperation, error)
RevertInstance revert an existing instance’s file system to a specified snapshot.
Example ¶
package main import ( "context" filestore "cloud.google.com/go/filestore/apiv1" filestorepb "cloud.google.com/go/filestore/apiv1/filestorepb" ) 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 := filestore.NewCloudFilestoreManagerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &filestorepb.RevertInstanceRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/filestore/apiv1/filestorepb#RevertInstanceRequest. } op, err := c.RevertInstance(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 (*CloudFilestoreManagerClient) RevertInstanceOperation ¶ added in v1.8.0
func (c *CloudFilestoreManagerClient) RevertInstanceOperation(name string) *RevertInstanceOperation
RevertInstanceOperation returns a new RevertInstanceOperation from a given name. The name must be that of a previously created RevertInstanceOperation, possibly from a different process.
func (*CloudFilestoreManagerClient) UpdateBackup ¶
func (c *CloudFilestoreManagerClient) UpdateBackup(ctx context.Context, req *filestorepb.UpdateBackupRequest, opts ...gax.CallOption) (*UpdateBackupOperation, error)
UpdateBackup updates the settings of a specific backup.
Example ¶
package main import ( "context" filestore "cloud.google.com/go/filestore/apiv1" filestorepb "cloud.google.com/go/filestore/apiv1/filestorepb" ) 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 := 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/cloud.google.com/go/filestore/apiv1/filestorepb#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 }
Output:
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 ¶
func (c *CloudFilestoreManagerClient) UpdateInstance(ctx context.Context, req *filestorepb.UpdateInstanceRequest, opts ...gax.CallOption) (*UpdateInstanceOperation, error)
UpdateInstance updates the settings of a specific instance.
Example ¶
package main import ( "context" filestore "cloud.google.com/go/filestore/apiv1" filestorepb "cloud.google.com/go/filestore/apiv1/filestorepb" ) 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 := 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/cloud.google.com/go/filestore/apiv1/filestorepb#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 }
Output:
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.
func (*CloudFilestoreManagerClient) UpdateSnapshot ¶ added in v1.6.0
func (c *CloudFilestoreManagerClient) UpdateSnapshot(ctx context.Context, req *filestorepb.UpdateSnapshotRequest, opts ...gax.CallOption) (*UpdateSnapshotOperation, error)
UpdateSnapshot updates the settings of a specific snapshot.
Example ¶
package main import ( "context" filestore "cloud.google.com/go/filestore/apiv1" filestorepb "cloud.google.com/go/filestore/apiv1/filestorepb" ) 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 := filestore.NewCloudFilestoreManagerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &filestorepb.UpdateSnapshotRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/filestore/apiv1/filestorepb#UpdateSnapshotRequest. } op, err := c.UpdateSnapshot(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 (*CloudFilestoreManagerClient) UpdateSnapshotOperation ¶ added in v1.6.0
func (c *CloudFilestoreManagerClient) UpdateSnapshotOperation(name string) *UpdateSnapshotOperation
UpdateSnapshotOperation returns a new UpdateSnapshotOperation from a given name. The name must be that of a previously created UpdateSnapshotOperation, possibly from a different process.
type CreateBackupOperation ¶
type CreateBackupOperation struct {
// contains filtered or unexported fields
}
CreateBackupOperation manages a long-running operation from CreateBackup.
func (*CreateBackupOperation) Done ¶
func (op *CreateBackupOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreateBackupOperation) Metadata ¶
func (op *CreateBackupOperation) Metadata() (*commonpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*CreateBackupOperation) Name ¶
func (op *CreateBackupOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*CreateBackupOperation) Poll ¶
func (op *CreateBackupOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*filestorepb.Backup, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*CreateBackupOperation) Wait ¶
func (op *CreateBackupOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*filestorepb.Backup, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type CreateInstanceOperation ¶
type CreateInstanceOperation struct {
// contains filtered or unexported fields
}
CreateInstanceOperation manages a long-running operation from CreateInstance.
func (*CreateInstanceOperation) Done ¶
func (op *CreateInstanceOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreateInstanceOperation) Metadata ¶
func (op *CreateInstanceOperation) Metadata() (*commonpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*CreateInstanceOperation) Name ¶
func (op *CreateInstanceOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*CreateInstanceOperation) Poll ¶
func (op *CreateInstanceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*filestorepb.Instance, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*CreateInstanceOperation) Wait ¶
func (op *CreateInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*filestorepb.Instance, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type CreateSnapshotOperation ¶ added in v1.6.0
type CreateSnapshotOperation struct {
// contains filtered or unexported fields
}
CreateSnapshotOperation manages a long-running operation from CreateSnapshot.
func (*CreateSnapshotOperation) Done ¶ added in v1.6.0
func (op *CreateSnapshotOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreateSnapshotOperation) Metadata ¶ added in v1.6.0
func (op *CreateSnapshotOperation) Metadata() (*commonpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*CreateSnapshotOperation) Name ¶ added in v1.6.0
func (op *CreateSnapshotOperation) 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 (*CreateSnapshotOperation) Poll ¶ added in v1.6.0
func (op *CreateSnapshotOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*filestorepb.Snapshot, 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 (*CreateSnapshotOperation) Wait ¶ added in v1.6.0
func (op *CreateSnapshotOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*filestorepb.Snapshot, 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 DeleteBackupOperation ¶
type DeleteBackupOperation struct {
// contains filtered or unexported fields
}
DeleteBackupOperation manages a long-running operation from DeleteBackup.
func (*DeleteBackupOperation) Done ¶
func (op *DeleteBackupOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*DeleteBackupOperation) Metadata ¶
func (op *DeleteBackupOperation) Metadata() (*commonpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*DeleteBackupOperation) Name ¶
func (op *DeleteBackupOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*DeleteBackupOperation) Poll ¶
func (op *DeleteBackupOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*DeleteBackupOperation) Wait ¶
func (op *DeleteBackupOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type DeleteInstanceOperation ¶
type DeleteInstanceOperation struct {
// contains filtered or unexported fields
}
DeleteInstanceOperation manages a long-running operation from DeleteInstance.
func (*DeleteInstanceOperation) Done ¶
func (op *DeleteInstanceOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*DeleteInstanceOperation) Metadata ¶
func (op *DeleteInstanceOperation) Metadata() (*commonpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*DeleteInstanceOperation) Name ¶
func (op *DeleteInstanceOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*DeleteInstanceOperation) Poll ¶
func (op *DeleteInstanceOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*DeleteInstanceOperation) Wait ¶
func (op *DeleteInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type DeleteSnapshotOperation ¶ added in v1.6.0
type DeleteSnapshotOperation struct {
// contains filtered or unexported fields
}
DeleteSnapshotOperation manages a long-running operation from DeleteSnapshot.
func (*DeleteSnapshotOperation) Done ¶ added in v1.6.0
func (op *DeleteSnapshotOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*DeleteSnapshotOperation) Metadata ¶ added in v1.6.0
func (op *DeleteSnapshotOperation) Metadata() (*commonpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*DeleteSnapshotOperation) Name ¶ added in v1.6.0
func (op *DeleteSnapshotOperation) 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 (*DeleteSnapshotOperation) Poll ¶ added in v1.6.0
func (op *DeleteSnapshotOperation) 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 (*DeleteSnapshotOperation) Wait ¶ added in v1.6.0
func (op *DeleteSnapshotOperation) 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 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) All ¶ added in v1.9.1
func (it *InstanceIterator) All() iter.Seq2[*filestorepb.Instance, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*InstanceIterator) Next ¶
func (it *InstanceIterator) Next() (*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.
type LocationIterator ¶ added in v1.8.0
type LocationIterator struct { // Response is the raw response for the current page. // It must be cast to the RPC response type. // Calling Next() or InternalFetch() updates this value. Response interface{} // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*locationpb.Location, nextPageToken string, err error) // contains filtered or unexported fields }
LocationIterator manages a stream of *locationpb.Location.
func (*LocationIterator) All ¶ added in v1.9.1
func (it *LocationIterator) All() iter.Seq2[*locationpb.Location, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*LocationIterator) Next ¶ added in v1.8.0
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 ¶ added in v1.8.0
func (it *LocationIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type OperationIterator ¶ added in v1.8.0
type OperationIterator struct { // Response is the raw response for the current page. // It must be cast to the RPC response type. // Calling Next() or InternalFetch() updates this value. Response interface{} // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*longrunningpb.Operation, nextPageToken string, err error) // contains filtered or unexported fields }
OperationIterator manages a stream of *longrunningpb.Operation.
func (*OperationIterator) All ¶ added in v1.9.1
func (it *OperationIterator) All() iter.Seq2[*longrunningpb.Operation, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*OperationIterator) Next ¶ added in v1.8.0
func (it *OperationIterator) Next() (*longrunningpb.Operation, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*OperationIterator) PageInfo ¶ added in v1.8.0
func (it *OperationIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type 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 ¶
func (op *RestoreInstanceOperation) Metadata() (*commonpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*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 ¶
func (op *RestoreInstanceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*filestorepb.Instance, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*RestoreInstanceOperation) Wait ¶
func (op *RestoreInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*filestorepb.Instance, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type RevertInstanceOperation ¶ added in v1.8.0
type RevertInstanceOperation struct {
// contains filtered or unexported fields
}
RevertInstanceOperation manages a long-running operation from RevertInstance.
func (*RevertInstanceOperation) Done ¶ added in v1.8.0
func (op *RevertInstanceOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*RevertInstanceOperation) Metadata ¶ added in v1.8.0
func (op *RevertInstanceOperation) Metadata() (*commonpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*RevertInstanceOperation) Name ¶ added in v1.8.0
func (op *RevertInstanceOperation) 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 (*RevertInstanceOperation) Poll ¶ added in v1.8.0
func (op *RevertInstanceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*filestorepb.Instance, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*RevertInstanceOperation) Wait ¶ added in v1.8.0
func (op *RevertInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*filestorepb.Instance, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type SnapshotIterator ¶ added in v1.6.0
type SnapshotIterator 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.Snapshot, nextPageToken string, err error) // contains filtered or unexported fields }
SnapshotIterator manages a stream of *filestorepb.Snapshot.
func (*SnapshotIterator) All ¶ added in v1.9.1
func (it *SnapshotIterator) All() iter.Seq2[*filestorepb.Snapshot, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*SnapshotIterator) Next ¶ added in v1.6.0
func (it *SnapshotIterator) Next() (*filestorepb.Snapshot, 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 (*SnapshotIterator) PageInfo ¶ added in v1.6.0
func (it *SnapshotIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type UpdateBackupOperation ¶
type UpdateBackupOperation struct {
// contains filtered or unexported fields
}
UpdateBackupOperation manages a long-running operation from UpdateBackup.
func (*UpdateBackupOperation) Done ¶
func (op *UpdateBackupOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*UpdateBackupOperation) Metadata ¶
func (op *UpdateBackupOperation) Metadata() (*commonpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*UpdateBackupOperation) Name ¶
func (op *UpdateBackupOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*UpdateBackupOperation) Poll ¶
func (op *UpdateBackupOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*filestorepb.Backup, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*UpdateBackupOperation) Wait ¶
func (op *UpdateBackupOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*filestorepb.Backup, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type UpdateInstanceOperation ¶
type UpdateInstanceOperation struct {
// contains filtered or unexported fields
}
UpdateInstanceOperation manages a long-running operation from UpdateInstance.
func (*UpdateInstanceOperation) Done ¶
func (op *UpdateInstanceOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*UpdateInstanceOperation) Metadata ¶
func (op *UpdateInstanceOperation) Metadata() (*commonpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*UpdateInstanceOperation) Name ¶
func (op *UpdateInstanceOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*UpdateInstanceOperation) Poll ¶
func (op *UpdateInstanceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*filestorepb.Instance, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*UpdateInstanceOperation) Wait ¶
func (op *UpdateInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*filestorepb.Instance, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type UpdateSnapshotOperation ¶ added in v1.6.0
type UpdateSnapshotOperation struct {
// contains filtered or unexported fields
}
UpdateSnapshotOperation manages a long-running operation from UpdateSnapshot.
func (*UpdateSnapshotOperation) Done ¶ added in v1.6.0
func (op *UpdateSnapshotOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*UpdateSnapshotOperation) Metadata ¶ added in v1.6.0
func (op *UpdateSnapshotOperation) Metadata() (*commonpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*UpdateSnapshotOperation) Name ¶ added in v1.6.0
func (op *UpdateSnapshotOperation) 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 (*UpdateSnapshotOperation) Poll ¶ added in v1.6.0
func (op *UpdateSnapshotOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*filestorepb.Snapshot, 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 (*UpdateSnapshotOperation) Wait ¶ added in v1.6.0
func (op *UpdateSnapshotOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*filestorepb.Snapshot, 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.