package gkebackup
import "cloud.google.com/go/gkebackup/apiv1"
Package gkebackup is an auto-generated package for the Backup for GKE API.
Backup for GKE is a managed Kubernetes workload backup and restore service for GKE clusters.
General documentation
For information that is relevant for all client libraries please reference https://pkg.go.dev/cloud.google.com/go#pkg-overview. Some information on this page includes:
- Authentication and Authorization
- Timeouts and Cancellation
- Testing against Client Libraries
- Debugging Client Libraries
- Inspecting errors
Example usage
To get started with this package, create a client.
// go get cloud.google.com/go/gkebackup/apiv1@latest ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := gkebackup.NewBackupForGKEClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close()
The client will use your default application credentials. Clients should be reused instead of created as needed. The methods of Client are safe for concurrent use by multiple goroutines. The returned client must be Closed when it is done being used.
Using the Client
The following is an example of making an API call with the newly created client, mentioned above.
req := &gkebackuppb.CreateBackupRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/gkebackup/apiv1/gkebackuppb#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 NewBackupForGKEClient 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 BackupForGKECallOptions
- type BackupForGKEClient
- func NewBackupForGKEClient(ctx context.Context, opts ...option.ClientOption) (*BackupForGKEClient, error)
- func NewBackupForGKERESTClient(ctx context.Context, opts ...option.ClientOption) (*BackupForGKEClient, error)
- func (c *BackupForGKEClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
- func (c *BackupForGKEClient) Close() error
- func (c *BackupForGKEClient) Connection() *grpc.ClientConn
- func (c *BackupForGKEClient) CreateBackup(ctx context.Context, req *gkebackuppb.CreateBackupRequest, opts ...gax.CallOption) (*CreateBackupOperation, error)
- func (c *BackupForGKEClient) CreateBackupOperation(name string) *CreateBackupOperation
- func (c *BackupForGKEClient) CreateBackupPlan(ctx context.Context, req *gkebackuppb.CreateBackupPlanRequest, opts ...gax.CallOption) (*CreateBackupPlanOperation, error)
- func (c *BackupForGKEClient) CreateBackupPlanOperation(name string) *CreateBackupPlanOperation
- func (c *BackupForGKEClient) CreateRestore(ctx context.Context, req *gkebackuppb.CreateRestoreRequest, opts ...gax.CallOption) (*CreateRestoreOperation, error)
- func (c *BackupForGKEClient) CreateRestoreOperation(name string) *CreateRestoreOperation
- func (c *BackupForGKEClient) CreateRestorePlan(ctx context.Context, req *gkebackuppb.CreateRestorePlanRequest, opts ...gax.CallOption) (*CreateRestorePlanOperation, error)
- func (c *BackupForGKEClient) CreateRestorePlanOperation(name string) *CreateRestorePlanOperation
- func (c *BackupForGKEClient) DeleteBackup(ctx context.Context, req *gkebackuppb.DeleteBackupRequest, opts ...gax.CallOption) (*DeleteBackupOperation, error)
- func (c *BackupForGKEClient) DeleteBackupOperation(name string) *DeleteBackupOperation
- func (c *BackupForGKEClient) DeleteBackupPlan(ctx context.Context, req *gkebackuppb.DeleteBackupPlanRequest, opts ...gax.CallOption) (*DeleteBackupPlanOperation, error)
- func (c *BackupForGKEClient) DeleteBackupPlanOperation(name string) *DeleteBackupPlanOperation
- func (c *BackupForGKEClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error
- func (c *BackupForGKEClient) DeleteRestore(ctx context.Context, req *gkebackuppb.DeleteRestoreRequest, opts ...gax.CallOption) (*DeleteRestoreOperation, error)
- func (c *BackupForGKEClient) DeleteRestoreOperation(name string) *DeleteRestoreOperation
- func (c *BackupForGKEClient) DeleteRestorePlan(ctx context.Context, req *gkebackuppb.DeleteRestorePlanRequest, opts ...gax.CallOption) (*DeleteRestorePlanOperation, error)
- func (c *BackupForGKEClient) DeleteRestorePlanOperation(name string) *DeleteRestorePlanOperation
- func (c *BackupForGKEClient) GetBackup(ctx context.Context, req *gkebackuppb.GetBackupRequest, opts ...gax.CallOption) (*gkebackuppb.Backup, error)
- func (c *BackupForGKEClient) GetBackupIndexDownloadUrl(ctx context.Context, req *gkebackuppb.GetBackupIndexDownloadUrlRequest, opts ...gax.CallOption) (*gkebackuppb.GetBackupIndexDownloadUrlResponse, error)
- func (c *BackupForGKEClient) GetBackupPlan(ctx context.Context, req *gkebackuppb.GetBackupPlanRequest, opts ...gax.CallOption) (*gkebackuppb.BackupPlan, error)
- func (c *BackupForGKEClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
- func (c *BackupForGKEClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
- func (c *BackupForGKEClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
- func (c *BackupForGKEClient) GetRestore(ctx context.Context, req *gkebackuppb.GetRestoreRequest, opts ...gax.CallOption) (*gkebackuppb.Restore, error)
- func (c *BackupForGKEClient) GetRestorePlan(ctx context.Context, req *gkebackuppb.GetRestorePlanRequest, opts ...gax.CallOption) (*gkebackuppb.RestorePlan, error)
- func (c *BackupForGKEClient) GetVolumeBackup(ctx context.Context, req *gkebackuppb.GetVolumeBackupRequest, opts ...gax.CallOption) (*gkebackuppb.VolumeBackup, error)
- func (c *BackupForGKEClient) GetVolumeRestore(ctx context.Context, req *gkebackuppb.GetVolumeRestoreRequest, opts ...gax.CallOption) (*gkebackuppb.VolumeRestore, error)
- func (c *BackupForGKEClient) ListBackupPlans(ctx context.Context, req *gkebackuppb.ListBackupPlansRequest, opts ...gax.CallOption) *BackupPlanIterator
- func (c *BackupForGKEClient) ListBackups(ctx context.Context, req *gkebackuppb.ListBackupsRequest, opts ...gax.CallOption) *BackupIterator
- func (c *BackupForGKEClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
- func (c *BackupForGKEClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
- func (c *BackupForGKEClient) ListRestorePlans(ctx context.Context, req *gkebackuppb.ListRestorePlansRequest, opts ...gax.CallOption) *RestorePlanIterator
- func (c *BackupForGKEClient) ListRestores(ctx context.Context, req *gkebackuppb.ListRestoresRequest, opts ...gax.CallOption) *RestoreIterator
- func (c *BackupForGKEClient) ListVolumeBackups(ctx context.Context, req *gkebackuppb.ListVolumeBackupsRequest, opts ...gax.CallOption) *VolumeBackupIterator
- func (c *BackupForGKEClient) ListVolumeRestores(ctx context.Context, req *gkebackuppb.ListVolumeRestoresRequest, opts ...gax.CallOption) *VolumeRestoreIterator
- func (c *BackupForGKEClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
- func (c *BackupForGKEClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error)
- func (c *BackupForGKEClient) UpdateBackup(ctx context.Context, req *gkebackuppb.UpdateBackupRequest, opts ...gax.CallOption) (*UpdateBackupOperation, error)
- func (c *BackupForGKEClient) UpdateBackupOperation(name string) *UpdateBackupOperation
- func (c *BackupForGKEClient) UpdateBackupPlan(ctx context.Context, req *gkebackuppb.UpdateBackupPlanRequest, opts ...gax.CallOption) (*UpdateBackupPlanOperation, error)
- func (c *BackupForGKEClient) UpdateBackupPlanOperation(name string) *UpdateBackupPlanOperation
- func (c *BackupForGKEClient) UpdateRestore(ctx context.Context, req *gkebackuppb.UpdateRestoreRequest, opts ...gax.CallOption) (*UpdateRestoreOperation, error)
- func (c *BackupForGKEClient) UpdateRestoreOperation(name string) *UpdateRestoreOperation
- func (c *BackupForGKEClient) UpdateRestorePlan(ctx context.Context, req *gkebackuppb.UpdateRestorePlanRequest, opts ...gax.CallOption) (*UpdateRestorePlanOperation, error)
- func (c *BackupForGKEClient) UpdateRestorePlanOperation(name string) *UpdateRestorePlanOperation
- type BackupIterator
- func (it *BackupIterator) All() iter.Seq2[*gkebackuppb.Backup, error]
- func (it *BackupIterator) Next() (*gkebackuppb.Backup, error)
- func (it *BackupIterator) PageInfo() *iterator.PageInfo
- type BackupPlanIterator
- func (it *BackupPlanIterator) All() iter.Seq2[*gkebackuppb.BackupPlan, error]
- func (it *BackupPlanIterator) Next() (*gkebackuppb.BackupPlan, error)
- func (it *BackupPlanIterator) PageInfo() *iterator.PageInfo
- type CreateBackupOperation
- func (op *CreateBackupOperation) Done() bool
- func (op *CreateBackupOperation) Metadata() (*gkebackuppb.OperationMetadata, error)
- func (op *CreateBackupOperation) Name() string
- func (op *CreateBackupOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*gkebackuppb.Backup, error)
- func (op *CreateBackupOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*gkebackuppb.Backup, error)
- type CreateBackupPlanOperation
- func (op *CreateBackupPlanOperation) Done() bool
- func (op *CreateBackupPlanOperation) Metadata() (*gkebackuppb.OperationMetadata, error)
- func (op *CreateBackupPlanOperation) Name() string
- func (op *CreateBackupPlanOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*gkebackuppb.BackupPlan, error)
- func (op *CreateBackupPlanOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*gkebackuppb.BackupPlan, error)
- type CreateRestoreOperation
- func (op *CreateRestoreOperation) Done() bool
- func (op *CreateRestoreOperation) Metadata() (*gkebackuppb.OperationMetadata, error)
- func (op *CreateRestoreOperation) Name() string
- func (op *CreateRestoreOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*gkebackuppb.Restore, error)
- func (op *CreateRestoreOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*gkebackuppb.Restore, error)
- type CreateRestorePlanOperation
- func (op *CreateRestorePlanOperation) Done() bool
- func (op *CreateRestorePlanOperation) Metadata() (*gkebackuppb.OperationMetadata, error)
- func (op *CreateRestorePlanOperation) Name() string
- func (op *CreateRestorePlanOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*gkebackuppb.RestorePlan, error)
- func (op *CreateRestorePlanOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*gkebackuppb.RestorePlan, error)
- type DeleteBackupOperation
- func (op *DeleteBackupOperation) Done() bool
- func (op *DeleteBackupOperation) Metadata() (*gkebackuppb.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 DeleteBackupPlanOperation
- func (op *DeleteBackupPlanOperation) Done() bool
- func (op *DeleteBackupPlanOperation) Metadata() (*gkebackuppb.OperationMetadata, error)
- func (op *DeleteBackupPlanOperation) Name() string
- func (op *DeleteBackupPlanOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
- func (op *DeleteBackupPlanOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
- type DeleteRestoreOperation
- func (op *DeleteRestoreOperation) Done() bool
- func (op *DeleteRestoreOperation) Metadata() (*gkebackuppb.OperationMetadata, error)
- func (op *DeleteRestoreOperation) Name() string
- func (op *DeleteRestoreOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
- func (op *DeleteRestoreOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
- type DeleteRestorePlanOperation
- func (op *DeleteRestorePlanOperation) Done() bool
- func (op *DeleteRestorePlanOperation) Metadata() (*gkebackuppb.OperationMetadata, error)
- func (op *DeleteRestorePlanOperation) Name() string
- func (op *DeleteRestorePlanOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
- func (op *DeleteRestorePlanOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
- type LocationIterator
- func (it *LocationIterator) All() iter.Seq2[*locationpb.Location, error]
- func (it *LocationIterator) Next() (*locationpb.Location, error)
- func (it *LocationIterator) PageInfo() *iterator.PageInfo
- type OperationIterator
- func (it *OperationIterator) All() iter.Seq2[*longrunningpb.Operation, error]
- func (it *OperationIterator) Next() (*longrunningpb.Operation, error)
- func (it *OperationIterator) PageInfo() *iterator.PageInfo
- type RestoreIterator
- func (it *RestoreIterator) All() iter.Seq2[*gkebackuppb.Restore, error]
- func (it *RestoreIterator) Next() (*gkebackuppb.Restore, error)
- func (it *RestoreIterator) PageInfo() *iterator.PageInfo
- type RestorePlanIterator
- func (it *RestorePlanIterator) All() iter.Seq2[*gkebackuppb.RestorePlan, error]
- func (it *RestorePlanIterator) Next() (*gkebackuppb.RestorePlan, error)
- func (it *RestorePlanIterator) PageInfo() *iterator.PageInfo
- type UpdateBackupOperation
- func (op *UpdateBackupOperation) Done() bool
- func (op *UpdateBackupOperation) Metadata() (*gkebackuppb.OperationMetadata, error)
- func (op *UpdateBackupOperation) Name() string
- func (op *UpdateBackupOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*gkebackuppb.Backup, error)
- func (op *UpdateBackupOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*gkebackuppb.Backup, error)
- type UpdateBackupPlanOperation
- func (op *UpdateBackupPlanOperation) Done() bool
- func (op *UpdateBackupPlanOperation) Metadata() (*gkebackuppb.OperationMetadata, error)
- func (op *UpdateBackupPlanOperation) Name() string
- func (op *UpdateBackupPlanOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*gkebackuppb.BackupPlan, error)
- func (op *UpdateBackupPlanOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*gkebackuppb.BackupPlan, error)
- type UpdateRestoreOperation
- func (op *UpdateRestoreOperation) Done() bool
- func (op *UpdateRestoreOperation) Metadata() (*gkebackuppb.OperationMetadata, error)
- func (op *UpdateRestoreOperation) Name() string
- func (op *UpdateRestoreOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*gkebackuppb.Restore, error)
- func (op *UpdateRestoreOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*gkebackuppb.Restore, error)
- type UpdateRestorePlanOperation
- func (op *UpdateRestorePlanOperation) Done() bool
- func (op *UpdateRestorePlanOperation) Metadata() (*gkebackuppb.OperationMetadata, error)
- func (op *UpdateRestorePlanOperation) Name() string
- func (op *UpdateRestorePlanOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*gkebackuppb.RestorePlan, error)
- func (op *UpdateRestorePlanOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*gkebackuppb.RestorePlan, error)
- type VolumeBackupIterator
- func (it *VolumeBackupIterator) All() iter.Seq2[*gkebackuppb.VolumeBackup, error]
- func (it *VolumeBackupIterator) Next() (*gkebackuppb.VolumeBackup, error)
- func (it *VolumeBackupIterator) PageInfo() *iterator.PageInfo
- type VolumeRestoreIterator
Examples ¶
- BackupForGKEClient.CancelOperation
- BackupForGKEClient.CreateBackup
- BackupForGKEClient.CreateBackupPlan
- BackupForGKEClient.CreateRestore
- BackupForGKEClient.CreateRestorePlan
- BackupForGKEClient.DeleteBackup
- BackupForGKEClient.DeleteBackupPlan
- BackupForGKEClient.DeleteOperation
- BackupForGKEClient.DeleteRestore
- BackupForGKEClient.DeleteRestorePlan
- BackupForGKEClient.GetBackup
- BackupForGKEClient.GetBackupIndexDownloadUrl
- BackupForGKEClient.GetBackupPlan
- BackupForGKEClient.GetIamPolicy
- BackupForGKEClient.GetLocation
- BackupForGKEClient.GetOperation
- BackupForGKEClient.GetRestore
- BackupForGKEClient.GetRestorePlan
- BackupForGKEClient.GetVolumeBackup
- BackupForGKEClient.GetVolumeRestore
- BackupForGKEClient.ListBackupPlans
- BackupForGKEClient.ListBackupPlans (All)
- BackupForGKEClient.ListBackups
- BackupForGKEClient.ListBackups (All)
- BackupForGKEClient.ListLocations
- BackupForGKEClient.ListLocations (All)
- BackupForGKEClient.ListOperations
- BackupForGKEClient.ListOperations (All)
- BackupForGKEClient.ListRestorePlans
- BackupForGKEClient.ListRestorePlans (All)
- BackupForGKEClient.ListRestores
- BackupForGKEClient.ListRestores (All)
- BackupForGKEClient.ListVolumeBackups
- BackupForGKEClient.ListVolumeBackups (All)
- BackupForGKEClient.ListVolumeRestores
- BackupForGKEClient.ListVolumeRestores (All)
- BackupForGKEClient.SetIamPolicy
- BackupForGKEClient.TestIamPermissions
- BackupForGKEClient.UpdateBackup
- BackupForGKEClient.UpdateBackupPlan
- BackupForGKEClient.UpdateRestore
- BackupForGKEClient.UpdateRestorePlan
- NewBackupForGKEClient
- NewBackupForGKERESTClient
Functions ¶
func DefaultAuthScopes ¶
func DefaultAuthScopes() []string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
Types ¶
type BackupForGKECallOptions ¶
type BackupForGKECallOptions struct { CreateBackupPlan []gax.CallOption ListBackupPlans []gax.CallOption GetBackupPlan []gax.CallOption UpdateBackupPlan []gax.CallOption DeleteBackupPlan []gax.CallOption CreateBackup []gax.CallOption ListBackups []gax.CallOption GetBackup []gax.CallOption UpdateBackup []gax.CallOption DeleteBackup []gax.CallOption ListVolumeBackups []gax.CallOption GetVolumeBackup []gax.CallOption CreateRestorePlan []gax.CallOption ListRestorePlans []gax.CallOption GetRestorePlan []gax.CallOption UpdateRestorePlan []gax.CallOption DeleteRestorePlan []gax.CallOption CreateRestore []gax.CallOption ListRestores []gax.CallOption GetRestore []gax.CallOption UpdateRestore []gax.CallOption DeleteRestore []gax.CallOption ListVolumeRestores []gax.CallOption GetVolumeRestore []gax.CallOption GetBackupIndexDownloadUrl []gax.CallOption GetLocation []gax.CallOption ListLocations []gax.CallOption GetIamPolicy []gax.CallOption SetIamPolicy []gax.CallOption TestIamPermissions []gax.CallOption CancelOperation []gax.CallOption DeleteOperation []gax.CallOption GetOperation []gax.CallOption ListOperations []gax.CallOption }
BackupForGKECallOptions contains the retry settings for each method of BackupForGKEClient.
type BackupForGKEClient ¶
type BackupForGKEClient struct { // The call options for this service. CallOptions *BackupForGKECallOptions // 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 }
BackupForGKEClient is a client for interacting with Backup for GKE API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
BackupForGKE allows Kubernetes administrators to configure, execute, and manage backup and restore operations for their GKE clusters.
func NewBackupForGKEClient ¶
func NewBackupForGKEClient(ctx context.Context, opts ...option.ClientOption) (*BackupForGKEClient, error)
NewBackupForGKEClient creates a new backup forgke client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
BackupForGKE allows Kubernetes administrators to configure, execute, and
manage backup and restore operations for their GKE clusters.
Code:play
Example¶
package main
import (
"context"
gkebackup "cloud.google.com/go/gkebackup/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 := gkebackup.NewBackupForGKEClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewBackupForGKERESTClient ¶
func NewBackupForGKERESTClient(ctx context.Context, opts ...option.ClientOption) (*BackupForGKEClient, error)
NewBackupForGKERESTClient creates a new backup forgke rest client.
BackupForGKE allows Kubernetes administrators to configure, execute, and
manage backup and restore operations for their GKE clusters.
Code:play
Example¶
package main
import (
"context"
gkebackup "cloud.google.com/go/gkebackup/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 := gkebackup.NewBackupForGKERESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*BackupForGKEClient) CancelOperation ¶
func (c *BackupForGKEClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
gkebackup "cloud.google.com/go/gkebackup/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 := gkebackup.NewBackupForGKEClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*BackupForGKEClient) Close ¶
func (c *BackupForGKEClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*BackupForGKEClient) Connection ¶
func (c *BackupForGKEClient) 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 (*BackupForGKEClient) CreateBackup ¶
func (c *BackupForGKEClient) CreateBackup(ctx context.Context, req *gkebackuppb.CreateBackupRequest, opts ...gax.CallOption) (*CreateBackupOperation, error)
CreateBackup creates a Backup for the given BackupPlan.
Code:play
Example¶
package main
import (
"context"
gkebackup "cloud.google.com/go/gkebackup/apiv1"
gkebackuppb "cloud.google.com/go/gkebackup/apiv1/gkebackuppb"
)
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 := gkebackup.NewBackupForGKEClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &gkebackuppb.CreateBackupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/gkebackup/apiv1/gkebackuppb#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 (*BackupForGKEClient) CreateBackupOperation ¶
func (c *BackupForGKEClient) 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 (*BackupForGKEClient) CreateBackupPlan ¶
func (c *BackupForGKEClient) CreateBackupPlan(ctx context.Context, req *gkebackuppb.CreateBackupPlanRequest, opts ...gax.CallOption) (*CreateBackupPlanOperation, error)
CreateBackupPlan creates a new BackupPlan in a given location.
Code:play
Example¶
package main
import (
"context"
gkebackup "cloud.google.com/go/gkebackup/apiv1"
gkebackuppb "cloud.google.com/go/gkebackup/apiv1/gkebackuppb"
)
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 := gkebackup.NewBackupForGKEClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &gkebackuppb.CreateBackupPlanRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/gkebackup/apiv1/gkebackuppb#CreateBackupPlanRequest.
}
op, err := c.CreateBackupPlan(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*BackupForGKEClient) CreateBackupPlanOperation ¶
func (c *BackupForGKEClient) CreateBackupPlanOperation(name string) *CreateBackupPlanOperation
CreateBackupPlanOperation returns a new CreateBackupPlanOperation from a given name. The name must be that of a previously created CreateBackupPlanOperation, possibly from a different process.
func (*BackupForGKEClient) CreateRestore ¶
func (c *BackupForGKEClient) CreateRestore(ctx context.Context, req *gkebackuppb.CreateRestoreRequest, opts ...gax.CallOption) (*CreateRestoreOperation, error)
CreateRestore creates a new Restore for the given RestorePlan.
Code:play
Example¶
package main
import (
"context"
gkebackup "cloud.google.com/go/gkebackup/apiv1"
gkebackuppb "cloud.google.com/go/gkebackup/apiv1/gkebackuppb"
)
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 := gkebackup.NewBackupForGKEClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &gkebackuppb.CreateRestoreRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/gkebackup/apiv1/gkebackuppb#CreateRestoreRequest.
}
op, err := c.CreateRestore(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*BackupForGKEClient) CreateRestoreOperation ¶
func (c *BackupForGKEClient) CreateRestoreOperation(name string) *CreateRestoreOperation
CreateRestoreOperation returns a new CreateRestoreOperation from a given name. The name must be that of a previously created CreateRestoreOperation, possibly from a different process.
func (*BackupForGKEClient) CreateRestorePlan ¶
func (c *BackupForGKEClient) CreateRestorePlan(ctx context.Context, req *gkebackuppb.CreateRestorePlanRequest, opts ...gax.CallOption) (*CreateRestorePlanOperation, error)
CreateRestorePlan creates a new RestorePlan in a given location.
Code:play
Example¶
package main
import (
"context"
gkebackup "cloud.google.com/go/gkebackup/apiv1"
gkebackuppb "cloud.google.com/go/gkebackup/apiv1/gkebackuppb"
)
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 := gkebackup.NewBackupForGKEClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &gkebackuppb.CreateRestorePlanRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/gkebackup/apiv1/gkebackuppb#CreateRestorePlanRequest.
}
op, err := c.CreateRestorePlan(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*BackupForGKEClient) CreateRestorePlanOperation ¶
func (c *BackupForGKEClient) CreateRestorePlanOperation(name string) *CreateRestorePlanOperation
CreateRestorePlanOperation returns a new CreateRestorePlanOperation from a given name. The name must be that of a previously created CreateRestorePlanOperation, possibly from a different process.
func (*BackupForGKEClient) DeleteBackup ¶
func (c *BackupForGKEClient) DeleteBackup(ctx context.Context, req *gkebackuppb.DeleteBackupRequest, opts ...gax.CallOption) (*DeleteBackupOperation, error)
DeleteBackup deletes an existing Backup.
Code:play
Example¶
package main
import (
"context"
gkebackup "cloud.google.com/go/gkebackup/apiv1"
gkebackuppb "cloud.google.com/go/gkebackup/apiv1/gkebackuppb"
)
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 := gkebackup.NewBackupForGKEClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &gkebackuppb.DeleteBackupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/gkebackup/apiv1/gkebackuppb#DeleteBackupRequest.
}
op, err := c.DeleteBackup(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*BackupForGKEClient) DeleteBackupOperation ¶
func (c *BackupForGKEClient) 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 (*BackupForGKEClient) DeleteBackupPlan ¶
func (c *BackupForGKEClient) DeleteBackupPlan(ctx context.Context, req *gkebackuppb.DeleteBackupPlanRequest, opts ...gax.CallOption) (*DeleteBackupPlanOperation, error)
DeleteBackupPlan deletes an existing BackupPlan.
Code:play
Example¶
package main
import (
"context"
gkebackup "cloud.google.com/go/gkebackup/apiv1"
gkebackuppb "cloud.google.com/go/gkebackup/apiv1/gkebackuppb"
)
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 := gkebackup.NewBackupForGKEClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &gkebackuppb.DeleteBackupPlanRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/gkebackup/apiv1/gkebackuppb#DeleteBackupPlanRequest.
}
op, err := c.DeleteBackupPlan(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*BackupForGKEClient) DeleteBackupPlanOperation ¶
func (c *BackupForGKEClient) DeleteBackupPlanOperation(name string) *DeleteBackupPlanOperation
DeleteBackupPlanOperation returns a new DeleteBackupPlanOperation from a given name. The name must be that of a previously created DeleteBackupPlanOperation, possibly from a different process.
func (*BackupForGKEClient) DeleteOperation ¶
func (c *BackupForGKEClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error
DeleteOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
gkebackup "cloud.google.com/go/gkebackup/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 := gkebackup.NewBackupForGKEClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.DeleteOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.
}
err = c.DeleteOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*BackupForGKEClient) DeleteRestore ¶
func (c *BackupForGKEClient) DeleteRestore(ctx context.Context, req *gkebackuppb.DeleteRestoreRequest, opts ...gax.CallOption) (*DeleteRestoreOperation, error)
DeleteRestore deletes an existing Restore.
Code:play
Example¶
package main
import (
"context"
gkebackup "cloud.google.com/go/gkebackup/apiv1"
gkebackuppb "cloud.google.com/go/gkebackup/apiv1/gkebackuppb"
)
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 := gkebackup.NewBackupForGKEClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &gkebackuppb.DeleteRestoreRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/gkebackup/apiv1/gkebackuppb#DeleteRestoreRequest.
}
op, err := c.DeleteRestore(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*BackupForGKEClient) DeleteRestoreOperation ¶
func (c *BackupForGKEClient) DeleteRestoreOperation(name string) *DeleteRestoreOperation
DeleteRestoreOperation returns a new DeleteRestoreOperation from a given name. The name must be that of a previously created DeleteRestoreOperation, possibly from a different process.
func (*BackupForGKEClient) DeleteRestorePlan ¶
func (c *BackupForGKEClient) DeleteRestorePlan(ctx context.Context, req *gkebackuppb.DeleteRestorePlanRequest, opts ...gax.CallOption) (*DeleteRestorePlanOperation, error)
DeleteRestorePlan deletes an existing RestorePlan.
Code:play
Example¶
package main
import (
"context"
gkebackup "cloud.google.com/go/gkebackup/apiv1"
gkebackuppb "cloud.google.com/go/gkebackup/apiv1/gkebackuppb"
)
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 := gkebackup.NewBackupForGKEClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &gkebackuppb.DeleteRestorePlanRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/gkebackup/apiv1/gkebackuppb#DeleteRestorePlanRequest.
}
op, err := c.DeleteRestorePlan(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*BackupForGKEClient) DeleteRestorePlanOperation ¶
func (c *BackupForGKEClient) DeleteRestorePlanOperation(name string) *DeleteRestorePlanOperation
DeleteRestorePlanOperation returns a new DeleteRestorePlanOperation from a given name. The name must be that of a previously created DeleteRestorePlanOperation, possibly from a different process.
func (*BackupForGKEClient) GetBackup ¶
func (c *BackupForGKEClient) GetBackup(ctx context.Context, req *gkebackuppb.GetBackupRequest, opts ...gax.CallOption) (*gkebackuppb.Backup, error)
GetBackup retrieve the details of a single Backup.
Code:play
Example¶
package main
import (
"context"
gkebackup "cloud.google.com/go/gkebackup/apiv1"
gkebackuppb "cloud.google.com/go/gkebackup/apiv1/gkebackuppb"
)
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 := gkebackup.NewBackupForGKEClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &gkebackuppb.GetBackupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/gkebackup/apiv1/gkebackuppb#GetBackupRequest.
}
resp, err := c.GetBackup(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*BackupForGKEClient) GetBackupIndexDownloadUrl ¶
func (c *BackupForGKEClient) GetBackupIndexDownloadUrl(ctx context.Context, req *gkebackuppb.GetBackupIndexDownloadUrlRequest, opts ...gax.CallOption) (*gkebackuppb.GetBackupIndexDownloadUrlResponse, error)
GetBackupIndexDownloadUrl retrieve the link to the backupIndex.
Code:play
Example¶
package main
import (
"context"
gkebackup "cloud.google.com/go/gkebackup/apiv1"
gkebackuppb "cloud.google.com/go/gkebackup/apiv1/gkebackuppb"
)
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 := gkebackup.NewBackupForGKEClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &gkebackuppb.GetBackupIndexDownloadUrlRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/gkebackup/apiv1/gkebackuppb#GetBackupIndexDownloadUrlRequest.
}
resp, err := c.GetBackupIndexDownloadUrl(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*BackupForGKEClient) GetBackupPlan ¶
func (c *BackupForGKEClient) GetBackupPlan(ctx context.Context, req *gkebackuppb.GetBackupPlanRequest, opts ...gax.CallOption) (*gkebackuppb.BackupPlan, error)
GetBackupPlan retrieve the details of a single BackupPlan.
Code:play
Example¶
package main
import (
"context"
gkebackup "cloud.google.com/go/gkebackup/apiv1"
gkebackuppb "cloud.google.com/go/gkebackup/apiv1/gkebackuppb"
)
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 := gkebackup.NewBackupForGKEClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &gkebackuppb.GetBackupPlanRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/gkebackup/apiv1/gkebackuppb#GetBackupPlanRequest.
}
resp, err := c.GetBackupPlan(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*BackupForGKEClient) GetIamPolicy ¶
func (c *BackupForGKEClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
GetIamPolicy gets the access control policy for a resource. Returns an empty policy
if the resource exists and does not have a policy set.
Code:play
Example¶
package main
import (
"context"
gkebackup "cloud.google.com/go/gkebackup/apiv1"
iampb "cloud.google.com/go/iam/apiv1/iampb"
)
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 := gkebackup.NewBackupForGKEClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &iampb.GetIamPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#GetIamPolicyRequest.
}
resp, err := c.GetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*BackupForGKEClient) GetLocation ¶
func (c *BackupForGKEClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
GetLocation gets information about a location.
Code:play
Example¶
package main
import (
"context"
gkebackup "cloud.google.com/go/gkebackup/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 := gkebackup.NewBackupForGKEClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.GetLocationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#GetLocationRequest.
}
resp, err := c.GetLocation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*BackupForGKEClient) GetOperation ¶
func (c *BackupForGKEClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Code:play
Example¶
package main
import (
"context"
gkebackup "cloud.google.com/go/gkebackup/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 := gkebackup.NewBackupForGKEClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*BackupForGKEClient) GetRestore ¶
func (c *BackupForGKEClient) GetRestore(ctx context.Context, req *gkebackuppb.GetRestoreRequest, opts ...gax.CallOption) (*gkebackuppb.Restore, error)
GetRestore retrieves the details of a single Restore.
Code:play
Example¶
package main
import (
"context"
gkebackup "cloud.google.com/go/gkebackup/apiv1"
gkebackuppb "cloud.google.com/go/gkebackup/apiv1/gkebackuppb"
)
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 := gkebackup.NewBackupForGKEClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &gkebackuppb.GetRestoreRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/gkebackup/apiv1/gkebackuppb#GetRestoreRequest.
}
resp, err := c.GetRestore(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*BackupForGKEClient) GetRestorePlan ¶
func (c *BackupForGKEClient) GetRestorePlan(ctx context.Context, req *gkebackuppb.GetRestorePlanRequest, opts ...gax.CallOption) (*gkebackuppb.RestorePlan, error)
GetRestorePlan retrieve the details of a single RestorePlan.
Code:play
Example¶
package main
import (
"context"
gkebackup "cloud.google.com/go/gkebackup/apiv1"
gkebackuppb "cloud.google.com/go/gkebackup/apiv1/gkebackuppb"
)
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 := gkebackup.NewBackupForGKEClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &gkebackuppb.GetRestorePlanRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/gkebackup/apiv1/gkebackuppb#GetRestorePlanRequest.
}
resp, err := c.GetRestorePlan(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*BackupForGKEClient) GetVolumeBackup ¶
func (c *BackupForGKEClient) GetVolumeBackup(ctx context.Context, req *gkebackuppb.GetVolumeBackupRequest, opts ...gax.CallOption) (*gkebackuppb.VolumeBackup, error)
GetVolumeBackup retrieve the details of a single VolumeBackup.
Code:play
Example¶
package main
import (
"context"
gkebackup "cloud.google.com/go/gkebackup/apiv1"
gkebackuppb "cloud.google.com/go/gkebackup/apiv1/gkebackuppb"
)
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 := gkebackup.NewBackupForGKEClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &gkebackuppb.GetVolumeBackupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/gkebackup/apiv1/gkebackuppb#GetVolumeBackupRequest.
}
resp, err := c.GetVolumeBackup(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*BackupForGKEClient) GetVolumeRestore ¶
func (c *BackupForGKEClient) GetVolumeRestore(ctx context.Context, req *gkebackuppb.GetVolumeRestoreRequest, opts ...gax.CallOption) (*gkebackuppb.VolumeRestore, error)
GetVolumeRestore retrieve the details of a single VolumeRestore.
Code:play
Example¶
package main
import (
"context"
gkebackup "cloud.google.com/go/gkebackup/apiv1"
gkebackuppb "cloud.google.com/go/gkebackup/apiv1/gkebackuppb"
)
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 := gkebackup.NewBackupForGKEClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &gkebackuppb.GetVolumeRestoreRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/gkebackup/apiv1/gkebackuppb#GetVolumeRestoreRequest.
}
resp, err := c.GetVolumeRestore(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*BackupForGKEClient) ListBackupPlans ¶
func (c *BackupForGKEClient) ListBackupPlans(ctx context.Context, req *gkebackuppb.ListBackupPlansRequest, opts ...gax.CallOption) *BackupPlanIterator
ListBackupPlans lists BackupPlans in a given location.
Code:play
Code:play
Example¶
package main
import (
"context"
gkebackup "cloud.google.com/go/gkebackup/apiv1"
gkebackuppb "cloud.google.com/go/gkebackup/apiv1/gkebackuppb"
"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 := gkebackup.NewBackupForGKEClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &gkebackuppb.ListBackupPlansRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/gkebackup/apiv1/gkebackuppb#ListBackupPlansRequest.
}
it := c.ListBackupPlans(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.(*gkebackuppb.ListBackupPlansResponse)
}
}
Example (All)¶
package main
import (
"context"
gkebackup "cloud.google.com/go/gkebackup/apiv1"
gkebackuppb "cloud.google.com/go/gkebackup/apiv1/gkebackuppb"
)
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 := gkebackup.NewBackupForGKEClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &gkebackuppb.ListBackupPlansRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/gkebackup/apiv1/gkebackuppb#ListBackupPlansRequest.
}
for resp, err := range c.ListBackupPlans(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*BackupForGKEClient) ListBackups ¶
func (c *BackupForGKEClient) ListBackups(ctx context.Context, req *gkebackuppb.ListBackupsRequest, opts ...gax.CallOption) *BackupIterator
ListBackups lists the Backups for a given BackupPlan.
Code:play
Code:play
Example¶
package main
import (
"context"
gkebackup "cloud.google.com/go/gkebackup/apiv1"
gkebackuppb "cloud.google.com/go/gkebackup/apiv1/gkebackuppb"
"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 := gkebackup.NewBackupForGKEClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &gkebackuppb.ListBackupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/gkebackup/apiv1/gkebackuppb#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.(*gkebackuppb.ListBackupsResponse)
}
}
Example (All)¶
package main
import (
"context"
gkebackup "cloud.google.com/go/gkebackup/apiv1"
gkebackuppb "cloud.google.com/go/gkebackup/apiv1/gkebackuppb"
)
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 := gkebackup.NewBackupForGKEClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &gkebackuppb.ListBackupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/gkebackup/apiv1/gkebackuppb#ListBackupsRequest.
}
for resp, err := range c.ListBackups(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*BackupForGKEClient) ListLocations ¶
func (c *BackupForGKEClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
ListLocations lists information about the supported locations for this service.
Code:play
Code:play
Example¶
package main
import (
"context"
gkebackup "cloud.google.com/go/gkebackup/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 := gkebackup.NewBackupForGKEClient(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)
}
}
Example (All)¶
package main
import (
"context"
gkebackup "cloud.google.com/go/gkebackup/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 := gkebackup.NewBackupForGKEClient(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 and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*BackupForGKEClient) ListOperations ¶
func (c *BackupForGKEClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Code:play
Code:play
Example¶
package main
import (
"context"
gkebackup "cloud.google.com/go/gkebackup/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 := gkebackup.NewBackupForGKEClient(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)
}
}
Example (All)¶
package main
import (
"context"
gkebackup "cloud.google.com/go/gkebackup/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 := gkebackup.NewBackupForGKEClient(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 and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*BackupForGKEClient) ListRestorePlans ¶
func (c *BackupForGKEClient) ListRestorePlans(ctx context.Context, req *gkebackuppb.ListRestorePlansRequest, opts ...gax.CallOption) *RestorePlanIterator
ListRestorePlans lists RestorePlans in a given location.
Code:play
Code:play
Example¶
package main
import (
"context"
gkebackup "cloud.google.com/go/gkebackup/apiv1"
gkebackuppb "cloud.google.com/go/gkebackup/apiv1/gkebackuppb"
"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 := gkebackup.NewBackupForGKEClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &gkebackuppb.ListRestorePlansRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/gkebackup/apiv1/gkebackuppb#ListRestorePlansRequest.
}
it := c.ListRestorePlans(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.(*gkebackuppb.ListRestorePlansResponse)
}
}
Example (All)¶
package main
import (
"context"
gkebackup "cloud.google.com/go/gkebackup/apiv1"
gkebackuppb "cloud.google.com/go/gkebackup/apiv1/gkebackuppb"
)
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 := gkebackup.NewBackupForGKEClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &gkebackuppb.ListRestorePlansRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/gkebackup/apiv1/gkebackuppb#ListRestorePlansRequest.
}
for resp, err := range c.ListRestorePlans(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*BackupForGKEClient) ListRestores ¶
func (c *BackupForGKEClient) ListRestores(ctx context.Context, req *gkebackuppb.ListRestoresRequest, opts ...gax.CallOption) *RestoreIterator
ListRestores lists the Restores for a given RestorePlan.
Code:play
Code:play
Example¶
package main
import (
"context"
gkebackup "cloud.google.com/go/gkebackup/apiv1"
gkebackuppb "cloud.google.com/go/gkebackup/apiv1/gkebackuppb"
"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 := gkebackup.NewBackupForGKEClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &gkebackuppb.ListRestoresRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/gkebackup/apiv1/gkebackuppb#ListRestoresRequest.
}
it := c.ListRestores(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.(*gkebackuppb.ListRestoresResponse)
}
}
Example (All)¶
package main
import (
"context"
gkebackup "cloud.google.com/go/gkebackup/apiv1"
gkebackuppb "cloud.google.com/go/gkebackup/apiv1/gkebackuppb"
)
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 := gkebackup.NewBackupForGKEClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &gkebackuppb.ListRestoresRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/gkebackup/apiv1/gkebackuppb#ListRestoresRequest.
}
for resp, err := range c.ListRestores(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*BackupForGKEClient) ListVolumeBackups ¶
func (c *BackupForGKEClient) ListVolumeBackups(ctx context.Context, req *gkebackuppb.ListVolumeBackupsRequest, opts ...gax.CallOption) *VolumeBackupIterator
ListVolumeBackups lists the VolumeBackups for a given Backup.
Code:play
Code:play
Example¶
package main
import (
"context"
gkebackup "cloud.google.com/go/gkebackup/apiv1"
gkebackuppb "cloud.google.com/go/gkebackup/apiv1/gkebackuppb"
"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 := gkebackup.NewBackupForGKEClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &gkebackuppb.ListVolumeBackupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/gkebackup/apiv1/gkebackuppb#ListVolumeBackupsRequest.
}
it := c.ListVolumeBackups(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.(*gkebackuppb.ListVolumeBackupsResponse)
}
}
Example (All)¶
package main
import (
"context"
gkebackup "cloud.google.com/go/gkebackup/apiv1"
gkebackuppb "cloud.google.com/go/gkebackup/apiv1/gkebackuppb"
)
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 := gkebackup.NewBackupForGKEClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &gkebackuppb.ListVolumeBackupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/gkebackup/apiv1/gkebackuppb#ListVolumeBackupsRequest.
}
for resp, err := range c.ListVolumeBackups(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*BackupForGKEClient) ListVolumeRestores ¶
func (c *BackupForGKEClient) ListVolumeRestores(ctx context.Context, req *gkebackuppb.ListVolumeRestoresRequest, opts ...gax.CallOption) *VolumeRestoreIterator
ListVolumeRestores lists the VolumeRestores for a given Restore.
Code:play
Code:play
Example¶
package main
import (
"context"
gkebackup "cloud.google.com/go/gkebackup/apiv1"
gkebackuppb "cloud.google.com/go/gkebackup/apiv1/gkebackuppb"
"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 := gkebackup.NewBackupForGKEClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &gkebackuppb.ListVolumeRestoresRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/gkebackup/apiv1/gkebackuppb#ListVolumeRestoresRequest.
}
it := c.ListVolumeRestores(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.(*gkebackuppb.ListVolumeRestoresResponse)
}
}
Example (All)¶
package main
import (
"context"
gkebackup "cloud.google.com/go/gkebackup/apiv1"
gkebackuppb "cloud.google.com/go/gkebackup/apiv1/gkebackuppb"
)
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 := gkebackup.NewBackupForGKEClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &gkebackuppb.ListVolumeRestoresRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/gkebackup/apiv1/gkebackuppb#ListVolumeRestoresRequest.
}
for resp, err := range c.ListVolumeRestores(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*BackupForGKEClient) SetIamPolicy ¶
func (c *BackupForGKEClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED
errors.
Code:play
Example¶
package main
import (
"context"
gkebackup "cloud.google.com/go/gkebackup/apiv1"
iampb "cloud.google.com/go/iam/apiv1/iampb"
)
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 := gkebackup.NewBackupForGKEClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &iampb.SetIamPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#SetIamPolicyRequest.
}
resp, err := c.SetIamPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*BackupForGKEClient) TestIamPermissions ¶
func (c *BackupForGKEClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error)
TestIamPermissions returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.
Note: This operation is designed to be used for building
permission-aware UIs and command-line tools, not for authorization
checking. This operation may “fail open” without warning.
Code:play
Example¶
package main
import (
"context"
gkebackup "cloud.google.com/go/gkebackup/apiv1"
iampb "cloud.google.com/go/iam/apiv1/iampb"
)
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 := gkebackup.NewBackupForGKEClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &iampb.TestIamPermissionsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#TestIamPermissionsRequest.
}
resp, err := c.TestIamPermissions(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*BackupForGKEClient) UpdateBackup ¶
func (c *BackupForGKEClient) UpdateBackup(ctx context.Context, req *gkebackuppb.UpdateBackupRequest, opts ...gax.CallOption) (*UpdateBackupOperation, error)
UpdateBackup update a Backup.
Code:play
Example¶
package main
import (
"context"
gkebackup "cloud.google.com/go/gkebackup/apiv1"
gkebackuppb "cloud.google.com/go/gkebackup/apiv1/gkebackuppb"
)
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 := gkebackup.NewBackupForGKEClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &gkebackuppb.UpdateBackupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/gkebackup/apiv1/gkebackuppb#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 (*BackupForGKEClient) UpdateBackupOperation ¶
func (c *BackupForGKEClient) 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 (*BackupForGKEClient) UpdateBackupPlan ¶
func (c *BackupForGKEClient) UpdateBackupPlan(ctx context.Context, req *gkebackuppb.UpdateBackupPlanRequest, opts ...gax.CallOption) (*UpdateBackupPlanOperation, error)
UpdateBackupPlan update a BackupPlan.
Code:play
Example¶
package main
import (
"context"
gkebackup "cloud.google.com/go/gkebackup/apiv1"
gkebackuppb "cloud.google.com/go/gkebackup/apiv1/gkebackuppb"
)
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 := gkebackup.NewBackupForGKEClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &gkebackuppb.UpdateBackupPlanRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/gkebackup/apiv1/gkebackuppb#UpdateBackupPlanRequest.
}
op, err := c.UpdateBackupPlan(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*BackupForGKEClient) UpdateBackupPlanOperation ¶
func (c *BackupForGKEClient) UpdateBackupPlanOperation(name string) *UpdateBackupPlanOperation
UpdateBackupPlanOperation returns a new UpdateBackupPlanOperation from a given name. The name must be that of a previously created UpdateBackupPlanOperation, possibly from a different process.
func (*BackupForGKEClient) UpdateRestore ¶
func (c *BackupForGKEClient) UpdateRestore(ctx context.Context, req *gkebackuppb.UpdateRestoreRequest, opts ...gax.CallOption) (*UpdateRestoreOperation, error)
UpdateRestore update a Restore.
Code:play
Example¶
package main
import (
"context"
gkebackup "cloud.google.com/go/gkebackup/apiv1"
gkebackuppb "cloud.google.com/go/gkebackup/apiv1/gkebackuppb"
)
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 := gkebackup.NewBackupForGKEClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &gkebackuppb.UpdateRestoreRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/gkebackup/apiv1/gkebackuppb#UpdateRestoreRequest.
}
op, err := c.UpdateRestore(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*BackupForGKEClient) UpdateRestoreOperation ¶
func (c *BackupForGKEClient) UpdateRestoreOperation(name string) *UpdateRestoreOperation
UpdateRestoreOperation returns a new UpdateRestoreOperation from a given name. The name must be that of a previously created UpdateRestoreOperation, possibly from a different process.
func (*BackupForGKEClient) UpdateRestorePlan ¶
func (c *BackupForGKEClient) UpdateRestorePlan(ctx context.Context, req *gkebackuppb.UpdateRestorePlanRequest, opts ...gax.CallOption) (*UpdateRestorePlanOperation, error)
UpdateRestorePlan update a RestorePlan.
Code:play
Example¶
package main
import (
"context"
gkebackup "cloud.google.com/go/gkebackup/apiv1"
gkebackuppb "cloud.google.com/go/gkebackup/apiv1/gkebackuppb"
)
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 := gkebackup.NewBackupForGKEClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &gkebackuppb.UpdateRestorePlanRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/gkebackup/apiv1/gkebackuppb#UpdateRestorePlanRequest.
}
op, err := c.UpdateRestorePlan(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*BackupForGKEClient) UpdateRestorePlanOperation ¶
func (c *BackupForGKEClient) UpdateRestorePlanOperation(name string) *UpdateRestorePlanOperation
UpdateRestorePlanOperation returns a new UpdateRestorePlanOperation from a given name. The name must be that of a previously created UpdateRestorePlanOperation, possibly from a different process.
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 []*gkebackuppb.Backup, nextPageToken string, err error) // contains filtered or unexported fields }
BackupIterator manages a stream of *gkebackuppb.Backup.
func (*BackupIterator) All ¶
func (it *BackupIterator) All() iter.Seq2[*gkebackuppb.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() (*gkebackuppb.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 BackupPlanIterator ¶
type BackupPlanIterator 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 []*gkebackuppb.BackupPlan, nextPageToken string, err error) // contains filtered or unexported fields }
BackupPlanIterator manages a stream of *gkebackuppb.BackupPlan.
func (*BackupPlanIterator) All ¶
func (it *BackupPlanIterator) All() iter.Seq2[*gkebackuppb.BackupPlan, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*BackupPlanIterator) Next ¶
func (it *BackupPlanIterator) Next() (*gkebackuppb.BackupPlan, 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 (*BackupPlanIterator) PageInfo ¶
func (it *BackupPlanIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
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() (*gkebackuppb.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) (*gkebackuppb.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) (*gkebackuppb.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 CreateBackupPlanOperation ¶
type CreateBackupPlanOperation struct {
// contains filtered or unexported fields
}
CreateBackupPlanOperation manages a long-running operation from CreateBackupPlan.
func (*CreateBackupPlanOperation) Done ¶
func (op *CreateBackupPlanOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreateBackupPlanOperation) Metadata ¶
func (op *CreateBackupPlanOperation) Metadata() (*gkebackuppb.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 (*CreateBackupPlanOperation) Name ¶
func (op *CreateBackupPlanOperation) 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 (*CreateBackupPlanOperation) Poll ¶
func (op *CreateBackupPlanOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*gkebackuppb.BackupPlan, 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 (*CreateBackupPlanOperation) Wait ¶
func (op *CreateBackupPlanOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*gkebackuppb.BackupPlan, 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 CreateRestoreOperation ¶
type CreateRestoreOperation struct {
// contains filtered or unexported fields
}
CreateRestoreOperation manages a long-running operation from CreateRestore.
func (*CreateRestoreOperation) Done ¶
func (op *CreateRestoreOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreateRestoreOperation) Metadata ¶
func (op *CreateRestoreOperation) Metadata() (*gkebackuppb.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 (*CreateRestoreOperation) Name ¶
func (op *CreateRestoreOperation) 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 (*CreateRestoreOperation) Poll ¶
func (op *CreateRestoreOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*gkebackuppb.Restore, 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 (*CreateRestoreOperation) Wait ¶
func (op *CreateRestoreOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*gkebackuppb.Restore, 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 CreateRestorePlanOperation ¶
type CreateRestorePlanOperation struct {
// contains filtered or unexported fields
}
CreateRestorePlanOperation manages a long-running operation from CreateRestorePlan.
func (*CreateRestorePlanOperation) Done ¶
func (op *CreateRestorePlanOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreateRestorePlanOperation) Metadata ¶
func (op *CreateRestorePlanOperation) Metadata() (*gkebackuppb.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 (*CreateRestorePlanOperation) Name ¶
func (op *CreateRestorePlanOperation) 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 (*CreateRestorePlanOperation) Poll ¶
func (op *CreateRestorePlanOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*gkebackuppb.RestorePlan, 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 (*CreateRestorePlanOperation) Wait ¶
func (op *CreateRestorePlanOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*gkebackuppb.RestorePlan, 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() (*gkebackuppb.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 DeleteBackupPlanOperation ¶
type DeleteBackupPlanOperation struct {
// contains filtered or unexported fields
}
DeleteBackupPlanOperation manages a long-running operation from DeleteBackupPlan.
func (*DeleteBackupPlanOperation) Done ¶
func (op *DeleteBackupPlanOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*DeleteBackupPlanOperation) Metadata ¶
func (op *DeleteBackupPlanOperation) Metadata() (*gkebackuppb.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 (*DeleteBackupPlanOperation) Name ¶
func (op *DeleteBackupPlanOperation) 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 (*DeleteBackupPlanOperation) Poll ¶
func (op *DeleteBackupPlanOperation) 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 (*DeleteBackupPlanOperation) Wait ¶
func (op *DeleteBackupPlanOperation) 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 DeleteRestoreOperation ¶
type DeleteRestoreOperation struct {
// contains filtered or unexported fields
}
DeleteRestoreOperation manages a long-running operation from DeleteRestore.
func (*DeleteRestoreOperation) Done ¶
func (op *DeleteRestoreOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*DeleteRestoreOperation) Metadata ¶
func (op *DeleteRestoreOperation) Metadata() (*gkebackuppb.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 (*DeleteRestoreOperation) Name ¶
func (op *DeleteRestoreOperation) 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 (*DeleteRestoreOperation) Poll ¶
func (op *DeleteRestoreOperation) 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 (*DeleteRestoreOperation) Wait ¶
func (op *DeleteRestoreOperation) 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 DeleteRestorePlanOperation ¶
type DeleteRestorePlanOperation struct {
// contains filtered or unexported fields
}
DeleteRestorePlanOperation manages a long-running operation from DeleteRestorePlan.
func (*DeleteRestorePlanOperation) Done ¶
func (op *DeleteRestorePlanOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*DeleteRestorePlanOperation) Metadata ¶
func (op *DeleteRestorePlanOperation) Metadata() (*gkebackuppb.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 (*DeleteRestorePlanOperation) Name ¶
func (op *DeleteRestorePlanOperation) 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 (*DeleteRestorePlanOperation) Poll ¶
func (op *DeleteRestorePlanOperation) 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 (*DeleteRestorePlanOperation) Wait ¶
func (op *DeleteRestorePlanOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type LocationIterator ¶
type LocationIterator struct { // Response is the raw response for the current page. // It must be cast to the RPC response type. // Calling Next() or InternalFetch() updates this value. Response interface{} // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*locationpb.Location, nextPageToken string, err error) // contains filtered or unexported fields }
LocationIterator manages a stream of *locationpb.Location.
func (*LocationIterator) All ¶
func (it *LocationIterator) All() iter.Seq2[*locationpb.Location, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*LocationIterator) Next ¶
func (it *LocationIterator) Next() (*locationpb.Location, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*LocationIterator) PageInfo ¶
func (it *LocationIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type OperationIterator ¶
type OperationIterator struct { // Response is the raw response for the current page. // It must be cast to the RPC response type. // Calling Next() or InternalFetch() updates this value. Response interface{} // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*longrunningpb.Operation, nextPageToken string, err error) // contains filtered or unexported fields }
OperationIterator manages a stream of *longrunningpb.Operation.
func (*OperationIterator) All ¶
func (it *OperationIterator) All() iter.Seq2[*longrunningpb.Operation, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*OperationIterator) Next ¶
func (it *OperationIterator) Next() (*longrunningpb.Operation, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*OperationIterator) PageInfo ¶
func (it *OperationIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type RestoreIterator ¶
type RestoreIterator 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 []*gkebackuppb.Restore, nextPageToken string, err error) // contains filtered or unexported fields }
RestoreIterator manages a stream of *gkebackuppb.Restore.
func (*RestoreIterator) All ¶
func (it *RestoreIterator) All() iter.Seq2[*gkebackuppb.Restore, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*RestoreIterator) Next ¶
func (it *RestoreIterator) Next() (*gkebackuppb.Restore, 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 (*RestoreIterator) PageInfo ¶
func (it *RestoreIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type RestorePlanIterator ¶
type RestorePlanIterator 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 []*gkebackuppb.RestorePlan, nextPageToken string, err error) // contains filtered or unexported fields }
RestorePlanIterator manages a stream of *gkebackuppb.RestorePlan.
func (*RestorePlanIterator) All ¶
func (it *RestorePlanIterator) All() iter.Seq2[*gkebackuppb.RestorePlan, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*RestorePlanIterator) Next ¶
func (it *RestorePlanIterator) Next() (*gkebackuppb.RestorePlan, 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 (*RestorePlanIterator) PageInfo ¶
func (it *RestorePlanIterator) 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() (*gkebackuppb.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) (*gkebackuppb.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) (*gkebackuppb.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 UpdateBackupPlanOperation ¶
type UpdateBackupPlanOperation struct {
// contains filtered or unexported fields
}
UpdateBackupPlanOperation manages a long-running operation from UpdateBackupPlan.
func (*UpdateBackupPlanOperation) Done ¶
func (op *UpdateBackupPlanOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*UpdateBackupPlanOperation) Metadata ¶
func (op *UpdateBackupPlanOperation) Metadata() (*gkebackuppb.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 (*UpdateBackupPlanOperation) Name ¶
func (op *UpdateBackupPlanOperation) 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 (*UpdateBackupPlanOperation) Poll ¶
func (op *UpdateBackupPlanOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*gkebackuppb.BackupPlan, 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 (*UpdateBackupPlanOperation) Wait ¶
func (op *UpdateBackupPlanOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*gkebackuppb.BackupPlan, 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 UpdateRestoreOperation ¶
type UpdateRestoreOperation struct {
// contains filtered or unexported fields
}
UpdateRestoreOperation manages a long-running operation from UpdateRestore.
func (*UpdateRestoreOperation) Done ¶
func (op *UpdateRestoreOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*UpdateRestoreOperation) Metadata ¶
func (op *UpdateRestoreOperation) Metadata() (*gkebackuppb.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 (*UpdateRestoreOperation) Name ¶
func (op *UpdateRestoreOperation) 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 (*UpdateRestoreOperation) Poll ¶
func (op *UpdateRestoreOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*gkebackuppb.Restore, 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 (*UpdateRestoreOperation) Wait ¶
func (op *UpdateRestoreOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*gkebackuppb.Restore, 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 UpdateRestorePlanOperation ¶
type UpdateRestorePlanOperation struct {
// contains filtered or unexported fields
}
UpdateRestorePlanOperation manages a long-running operation from UpdateRestorePlan.
func (*UpdateRestorePlanOperation) Done ¶
func (op *UpdateRestorePlanOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*UpdateRestorePlanOperation) Metadata ¶
func (op *UpdateRestorePlanOperation) Metadata() (*gkebackuppb.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 (*UpdateRestorePlanOperation) Name ¶
func (op *UpdateRestorePlanOperation) 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 (*UpdateRestorePlanOperation) Poll ¶
func (op *UpdateRestorePlanOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*gkebackuppb.RestorePlan, 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 (*UpdateRestorePlanOperation) Wait ¶
func (op *UpdateRestorePlanOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*gkebackuppb.RestorePlan, 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 VolumeBackupIterator ¶
type VolumeBackupIterator 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 []*gkebackuppb.VolumeBackup, nextPageToken string, err error) // contains filtered or unexported fields }
VolumeBackupIterator manages a stream of *gkebackuppb.VolumeBackup.
func (*VolumeBackupIterator) All ¶
func (it *VolumeBackupIterator) All() iter.Seq2[*gkebackuppb.VolumeBackup, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*VolumeBackupIterator) Next ¶
func (it *VolumeBackupIterator) Next() (*gkebackuppb.VolumeBackup, 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 (*VolumeBackupIterator) PageInfo ¶
func (it *VolumeBackupIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type VolumeRestoreIterator ¶
type VolumeRestoreIterator 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 []*gkebackuppb.VolumeRestore, nextPageToken string, err error) // contains filtered or unexported fields }
VolumeRestoreIterator manages a stream of *gkebackuppb.VolumeRestore.
func (*VolumeRestoreIterator) All ¶
func (it *VolumeRestoreIterator) All() iter.Seq2[*gkebackuppb.VolumeRestore, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*VolumeRestoreIterator) Next ¶
func (it *VolumeRestoreIterator) Next() (*gkebackuppb.VolumeRestore, 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 (*VolumeRestoreIterator) PageInfo ¶
func (it *VolumeRestoreIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
Source Files ¶
auxiliary.go auxiliary_go123.go backup_forgke_client.go doc.go helpers.go version.go
Directories ¶
Path | Synopsis |
---|---|
apiv1/gkebackuppb |
- Version
- v1.6.3 (latest)
- Published
- Jan 2, 2025
- Platform
- linux/amd64
- Imports
- 31 packages
- Last checked
- 6 days ago –
Tools for package owners.