Package cloud.google.com/go/gkebackup/apiv1 (v0.1.0)

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.

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

Example usage

To get started with this package, create a client.

ctx := context.Background()
c, err := 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.

ctx := context.Background()
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/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#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

Use of Context

The ctx passed to NewClient is used for authentication requests and for creating the underlying connection, but is not used for subsequent calls. Individual methods on the client use the ctx given to them.

To close the open connection, use the Close() method.

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

Functions

func DefaultAuthScopes

func DefaultAuthScopes() []string

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

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
}

BackupForGKECallOptions contains the retry settings for each method of BackupForGKEClient.

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.

Example

package main

import (
	gkebackup "cloud.google.com/go/gkebackup/apiv1"
	"context"
)

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

	// TODO: Use client.
	_ = c
}

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.

func (*BackupForGKEClient) CreateBackup

CreateBackup creates a Backup for the given BackupPlan.

Example

package main

import (
	gkebackup "cloud.google.com/go/gkebackup/apiv1"
	"context"
	gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1"
)

func main() {
	ctx := context.Background()
	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/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#CreateBackupRequest.
	}
	op, err := c.CreateBackup(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*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

CreateBackupPlan creates a new BackupPlan in a given location.

Example

package main

import (
	gkebackup "cloud.google.com/go/gkebackup/apiv1"
	"context"
	gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1"
)

func main() {
	ctx := context.Background()
	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/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#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

CreateRestore creates a new Restore for the given RestorePlan.

Example

package main

import (
	gkebackup "cloud.google.com/go/gkebackup/apiv1"
	"context"
	gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1"
)

func main() {
	ctx := context.Background()
	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/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#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

CreateRestorePlan creates a new RestorePlan in a given location.

Example

package main

import (
	gkebackup "cloud.google.com/go/gkebackup/apiv1"
	"context"
	gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1"
)

func main() {
	ctx := context.Background()
	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/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#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

DeleteBackup deletes an existing Backup.

Example

package main

import (
	gkebackup "cloud.google.com/go/gkebackup/apiv1"
	"context"
	gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1"
)

func main() {
	ctx := context.Background()
	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/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#DeleteBackupRequest.
	}
	op, err := c.DeleteBackup(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*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

DeleteBackupPlan deletes an existing BackupPlan.

Example

package main

import (
	gkebackup "cloud.google.com/go/gkebackup/apiv1"
	"context"
	gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1"
)

func main() {
	ctx := context.Background()
	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/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#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) DeleteRestore

DeleteRestore deletes an existing Restore.

Example

package main

import (
	gkebackup "cloud.google.com/go/gkebackup/apiv1"
	"context"
	gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1"
)

func main() {
	ctx := context.Background()
	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/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#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

DeleteRestorePlan deletes an existing RestorePlan.

Example

package main

import (
	gkebackup "cloud.google.com/go/gkebackup/apiv1"
	"context"
	gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1"
)

func main() {
	ctx := context.Background()
	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/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#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

GetBackup retrieve the details of a single Backup.

Example

package main

import (
	gkebackup "cloud.google.com/go/gkebackup/apiv1"
	"context"
	gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1"
)

func main() {
	ctx := context.Background()
	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/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#GetBackupRequest.
	}
	resp, err := c.GetBackup(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*BackupForGKEClient) GetBackupPlan

GetBackupPlan retrieve the details of a single BackupPlan.

Example

package main

import (
	gkebackup "cloud.google.com/go/gkebackup/apiv1"
	"context"
	gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1"
)

func main() {
	ctx := context.Background()
	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/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#GetBackupPlanRequest.
	}
	resp, err := c.GetBackupPlan(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*BackupForGKEClient) GetRestore

GetRestore retrieves the details of a single Restore.

Example

package main

import (
	gkebackup "cloud.google.com/go/gkebackup/apiv1"
	"context"
	gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1"
)

func main() {
	ctx := context.Background()
	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/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#GetRestoreRequest.
	}
	resp, err := c.GetRestore(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*BackupForGKEClient) GetRestorePlan

GetRestorePlan retrieve the details of a single RestorePlan.

Example

package main

import (
	gkebackup "cloud.google.com/go/gkebackup/apiv1"
	"context"
	gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1"
)

func main() {
	ctx := context.Background()
	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/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#GetRestorePlanRequest.
	}
	resp, err := c.GetRestorePlan(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*BackupForGKEClient) GetVolumeBackup

GetVolumeBackup retrieve the details of a single VolumeBackup.

Example

package main

import (
	gkebackup "cloud.google.com/go/gkebackup/apiv1"
	"context"
	gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1"
)

func main() {
	ctx := context.Background()
	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/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#GetVolumeBackupRequest.
	}
	resp, err := c.GetVolumeBackup(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*BackupForGKEClient) GetVolumeRestore

GetVolumeRestore retrieve the details of a single VolumeRestore.

Example

package main

import (
	gkebackup "cloud.google.com/go/gkebackup/apiv1"
	"context"
	gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1"
)

func main() {
	ctx := context.Background()
	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/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#GetVolumeRestoreRequest.
	}
	resp, err := c.GetVolumeRestore(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*BackupForGKEClient) ListBackupPlans

ListBackupPlans lists BackupPlans in a given location.

Example

package main

import (
	gkebackup "cloud.google.com/go/gkebackup/apiv1"
	"context"
	"google.golang.org/api/iterator"
	gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1"
)

func main() {
	ctx := context.Background()
	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/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#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
	}
}

func (*BackupForGKEClient) ListBackups

ListBackups lists the Backups for a given BackupPlan.

Example

package main

import (
	gkebackup "cloud.google.com/go/gkebackup/apiv1"
	"context"
	"google.golang.org/api/iterator"
	gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1"
)

func main() {
	ctx := context.Background()
	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/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#ListBackupsRequest.
	}
	it := c.ListBackups(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}

func (*BackupForGKEClient) ListRestorePlans

ListRestorePlans lists RestorePlans in a given location.

Example

package main

import (
	gkebackup "cloud.google.com/go/gkebackup/apiv1"
	"context"
	"google.golang.org/api/iterator"
	gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1"
)

func main() {
	ctx := context.Background()
	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/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#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
	}
}

func (*BackupForGKEClient) ListRestores

ListRestores lists the Restores for a given RestorePlan.

Example

package main

import (
	gkebackup "cloud.google.com/go/gkebackup/apiv1"
	"context"
	"google.golang.org/api/iterator"
	gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1"
)

func main() {
	ctx := context.Background()
	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/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#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
	}
}

func (*BackupForGKEClient) ListVolumeBackups

ListVolumeBackups lists the VolumeBackups for a given Backup.

Example

package main

import (
	gkebackup "cloud.google.com/go/gkebackup/apiv1"
	"context"
	"google.golang.org/api/iterator"
	gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1"
)

func main() {
	ctx := context.Background()
	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/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#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
	}
}

func (*BackupForGKEClient) ListVolumeRestores

ListVolumeRestores lists the VolumeRestores for a given Restore.

Example

package main

import (
	gkebackup "cloud.google.com/go/gkebackup/apiv1"
	"context"
	"google.golang.org/api/iterator"
	gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1"
)

func main() {
	ctx := context.Background()
	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/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#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
	}
}

func (*BackupForGKEClient) UpdateBackup

UpdateBackup update a Backup.

Example

package main

import (
	gkebackup "cloud.google.com/go/gkebackup/apiv1"
	"context"
	gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1"
)

func main() {
	ctx := context.Background()
	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/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#UpdateBackupRequest.
	}
	op, err := c.UpdateBackup(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*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

UpdateBackupPlan update a BackupPlan.

Example

package main

import (
	gkebackup "cloud.google.com/go/gkebackup/apiv1"
	"context"
	gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1"
)

func main() {
	ctx := context.Background()
	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/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#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

UpdateRestore update a Restore.

Example

package main

import (
	gkebackup "cloud.google.com/go/gkebackup/apiv1"
	"context"
	gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1"
)

func main() {
	ctx := context.Background()
	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/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#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

UpdateRestorePlan update a RestorePlan.

Example

package main

import (
	gkebackup "cloud.google.com/go/gkebackup/apiv1"
	"context"
	gkebackuppb "google.golang.org/genproto/googleapis/cloud/gkebackup/v1"
)

func main() {
	ctx := context.Background()
	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/google.golang.org/genproto/googleapis/cloud/gkebackup/v1#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.

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

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

Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.

func (*BackupPlanIterator) PageInfo

func (it *BackupPlanIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

CreateBackupOperation

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

CreateBackupOperation manages a long-running operation from CreateBackup.

func (*CreateBackupOperation) Done

func (op *CreateBackupOperation) Done() bool

Done reports whether the long-running operation has completed.

func (*CreateBackupOperation) Metadata

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

func (*CreateBackupOperation) Name

func (op *CreateBackupOperation) Name() string

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

func (*CreateBackupOperation) Poll

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

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

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

func (*CreateBackupOperation) Wait

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

See documentation of Poll for error-handling information.

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

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

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

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

See documentation of Poll for error-handling information.

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

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

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

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

See documentation of Poll for error-handling information.

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

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

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

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

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

See documentation of Poll for error-handling information.

DeleteBackupOperation

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

DeleteBackupOperation manages a long-running operation from DeleteBackup.

func (*DeleteBackupOperation) Done

func (op *DeleteBackupOperation) Done() bool

Done reports whether the long-running operation has completed.

func (*DeleteBackupOperation) Metadata

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

func (*DeleteBackupOperation) Name

func (op *DeleteBackupOperation) Name() string

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

func (*DeleteBackupOperation) Poll

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

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

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

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

func (*DeleteBackupOperation) Wait

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

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

See documentation of Poll for error-handling information.

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

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

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

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

See documentation of Poll for error-handling information.

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

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.

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

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

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

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

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

See documentation of Poll for error-handling information.

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

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

Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.

func (*RestorePlanIterator) PageInfo

func (it *RestorePlanIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

UpdateBackupOperation

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

UpdateBackupOperation manages a long-running operation from UpdateBackup.

func (*UpdateBackupOperation) Done

func (op *UpdateBackupOperation) Done() bool

Done reports whether the long-running operation has completed.

func (*UpdateBackupOperation) Metadata

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

func (*UpdateBackupOperation) Name

func (op *UpdateBackupOperation) Name() string

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

func (*UpdateBackupOperation) Poll

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

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

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

func (*UpdateBackupOperation) Wait

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

See documentation of Poll for error-handling information.

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

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

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

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

See documentation of Poll for error-handling information.

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

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

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

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

See documentation of Poll for error-handling information.

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

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

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

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

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

See documentation of Poll for error-handling information.

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

Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.

func (*VolumeBackupIterator) PageInfo

func (it *VolumeBackupIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

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

Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.

func (*VolumeRestoreIterator) PageInfo

func (it *VolumeRestoreIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.