VM Migration API v1 - Package cloud.google.com/go/vmmigration/apiv1 (v1.8.1)

Package vmmigration is an auto-generated package for the VM Migration API.

Use the Migrate to Virtual Machines API to programmatically migrate workloads.

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:

Example usage

To get started with this package, create a client.

ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := vmmigration.NewClient(ctx)
if err != nil {
    // TODO: Handle error.
}
defer c.Close()

The client will use your default application credentials. Clients should be reused instead of created as needed. The methods of Client are safe for concurrent use by multiple goroutines. The returned client must be Closed when it is done being used.

Using the Client

The following is an example of making an API call with the newly created client.

ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := vmmigration.NewClient(ctx)
if err != nil {
    // TODO: Handle error.
}
defer c.Close()

req := &vmmigrationpb.AddGroupMigrationRequest{
    // TODO: Fill request struct fields.
    // See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#AddGroupMigrationRequest.
}
op, err := c.AddGroupMigration(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.

Functions

func DefaultAuthScopes

func DefaultAuthScopes() []string

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

AddGroupMigrationOperation

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

AddGroupMigrationOperation manages a long-running operation from AddGroupMigration.

func (*AddGroupMigrationOperation) Done

func (op *AddGroupMigrationOperation) Done() bool

Done reports whether the long-running operation has completed.

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

CallOptions

type CallOptions struct {
	ListSources               []gax.CallOption
	GetSource                 []gax.CallOption
	CreateSource              []gax.CallOption
	UpdateSource              []gax.CallOption
	DeleteSource              []gax.CallOption
	FetchInventory            []gax.CallOption
	ListUtilizationReports    []gax.CallOption
	GetUtilizationReport      []gax.CallOption
	CreateUtilizationReport   []gax.CallOption
	DeleteUtilizationReport   []gax.CallOption
	ListDatacenterConnectors  []gax.CallOption
	GetDatacenterConnector    []gax.CallOption
	CreateDatacenterConnector []gax.CallOption
	DeleteDatacenterConnector []gax.CallOption
	UpgradeAppliance          []gax.CallOption
	CreateMigratingVm         []gax.CallOption
	ListMigratingVms          []gax.CallOption
	GetMigratingVm            []gax.CallOption
	UpdateMigratingVm         []gax.CallOption
	DeleteMigratingVm         []gax.CallOption
	StartMigration            []gax.CallOption
	ResumeMigration           []gax.CallOption
	PauseMigration            []gax.CallOption
	FinalizeMigration         []gax.CallOption
	CreateCloneJob            []gax.CallOption
	CancelCloneJob            []gax.CallOption
	ListCloneJobs             []gax.CallOption
	GetCloneJob               []gax.CallOption
	CreateCutoverJob          []gax.CallOption
	CancelCutoverJob          []gax.CallOption
	ListCutoverJobs           []gax.CallOption
	GetCutoverJob             []gax.CallOption
	ListGroups                []gax.CallOption
	GetGroup                  []gax.CallOption
	CreateGroup               []gax.CallOption
	UpdateGroup               []gax.CallOption
	DeleteGroup               []gax.CallOption
	AddGroupMigration         []gax.CallOption
	RemoveGroupMigration      []gax.CallOption
	ListTargetProjects        []gax.CallOption
	GetTargetProject          []gax.CallOption
	CreateTargetProject       []gax.CallOption
	UpdateTargetProject       []gax.CallOption
	DeleteTargetProject       []gax.CallOption
	ListReplicationCycles     []gax.CallOption
	GetReplicationCycle       []gax.CallOption
	GetLocation               []gax.CallOption
	ListLocations             []gax.CallOption
	CancelOperation           []gax.CallOption
	DeleteOperation           []gax.CallOption
	GetOperation              []gax.CallOption
	ListOperations            []gax.CallOption
}

CallOptions contains the retry settings for each method of Client.

CancelCloneJobOperation

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

CancelCloneJobOperation manages a long-running operation from CancelCloneJob.

func (*CancelCloneJobOperation) Done

func (op *CancelCloneJobOperation) Done() bool

Done reports whether the long-running operation has completed.

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

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

CancelCutoverJobOperation

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

CancelCutoverJobOperation manages a long-running operation from CancelCutoverJob.

func (*CancelCutoverJobOperation) Done

func (op *CancelCutoverJobOperation) Done() bool

Done reports whether the long-running operation has completed.

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

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

Client

type Client struct {

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

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

Client is a client for interacting with VM Migration API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

VM Migration Service

func NewClient

func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error)

NewClient creates a new vm migration client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.

VM Migration Service

Example

package main

import (
	"context"

	vmmigration "cloud.google.com/go/vmmigration/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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func NewRESTClient

func NewRESTClient(ctx context.Context, opts ...option.ClientOption) (*Client, error)

NewRESTClient creates a new vm migration rest client.

VM Migration Service

Example

package main

import (
	"context"

	vmmigration "cloud.google.com/go/vmmigration/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 := vmmigration.NewRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func (*Client) AddGroupMigration

AddGroupMigration adds a MigratingVm to a Group.

Example

package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
)

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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.AddGroupMigrationRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#AddGroupMigrationRequest.
	}
	op, err := c.AddGroupMigration(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*Client) AddGroupMigrationOperation

func (c *Client) AddGroupMigrationOperation(name string) *AddGroupMigrationOperation

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

func (*Client) CancelCloneJob

CancelCloneJob initiates the cancellation of a running clone job.

Example

package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
)

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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.CancelCloneJobRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#CancelCloneJobRequest.
	}
	op, err := c.CancelCloneJob(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*Client) CancelCloneJobOperation

func (c *Client) CancelCloneJobOperation(name string) *CancelCloneJobOperation

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

func (*Client) CancelCutoverJob

CancelCutoverJob initiates the cancellation of a running cutover job.

Example

package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
)

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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.CancelCutoverJobRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#CancelCutoverJobRequest.
	}
	op, err := c.CancelCutoverJob(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*Client) CancelCutoverJobOperation

func (c *Client) CancelCutoverJobOperation(name string) *CancelCutoverJobOperation

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

func (*Client) CancelOperation

func (c *Client) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error

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

Example

package main

import (
	"context"

	longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
	vmmigration "cloud.google.com/go/vmmigration/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 := vmmigration.NewClient(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 (*Client) Close

func (c *Client) Close() error

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

func (*Client) Connection (deprecated)

func (c *Client) 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 (*Client) CreateCloneJob

CreateCloneJob initiates a Clone of a specific migrating VM.

Example

package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
)

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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.CreateCloneJobRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#CreateCloneJobRequest.
	}
	op, err := c.CreateCloneJob(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*Client) CreateCloneJobOperation

func (c *Client) CreateCloneJobOperation(name string) *CreateCloneJobOperation

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

func (*Client) CreateCutoverJob

CreateCutoverJob initiates a Cutover of a specific migrating VM. The returned LRO is completed when the cutover job resource is created and the job is initiated.

Example

package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
)

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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.CreateCutoverJobRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#CreateCutoverJobRequest.
	}
	op, err := c.CreateCutoverJob(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*Client) CreateCutoverJobOperation

func (c *Client) CreateCutoverJobOperation(name string) *CreateCutoverJobOperation

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

func (*Client) CreateDatacenterConnector

CreateDatacenterConnector creates a new DatacenterConnector in a given Source.

Example

package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
)

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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.CreateDatacenterConnectorRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#CreateDatacenterConnectorRequest.
	}
	op, err := c.CreateDatacenterConnector(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*Client) CreateDatacenterConnectorOperation

func (c *Client) CreateDatacenterConnectorOperation(name string) *CreateDatacenterConnectorOperation

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

func (*Client) CreateGroup

CreateGroup creates a new Group in a given project and location.

Example

package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
)

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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.CreateGroupRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#CreateGroupRequest.
	}
	op, err := c.CreateGroup(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*Client) CreateGroupOperation

func (c *Client) CreateGroupOperation(name string) *CreateGroupOperation

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

func (*Client) CreateMigratingVm

CreateMigratingVm creates a new MigratingVm in a given Source.

Example

package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
)

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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.CreateMigratingVmRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#CreateMigratingVmRequest.
	}
	op, err := c.CreateMigratingVm(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*Client) CreateMigratingVmOperation

func (c *Client) CreateMigratingVmOperation(name string) *CreateMigratingVmOperation

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

func (*Client) CreateSource

CreateSource creates a new Source in a given project and location.

Example

package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
)

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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.CreateSourceRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#CreateSourceRequest.
	}
	op, err := c.CreateSource(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*Client) CreateSourceOperation

func (c *Client) CreateSourceOperation(name string) *CreateSourceOperation

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

func (*Client) CreateTargetProject

CreateTargetProject creates a new TargetProject in a given project.

NOTE: TargetProject is a global resource; hence the only supported value for location is global.

Example

package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
)

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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.CreateTargetProjectRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#CreateTargetProjectRequest.
	}
	op, err := c.CreateTargetProject(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*Client) CreateTargetProjectOperation

func (c *Client) CreateTargetProjectOperation(name string) *CreateTargetProjectOperation

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

func (*Client) CreateUtilizationReport

CreateUtilizationReport creates a new UtilizationReport.

Example

package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
)

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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.CreateUtilizationReportRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#CreateUtilizationReportRequest.
	}
	op, err := c.CreateUtilizationReport(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*Client) CreateUtilizationReportOperation

func (c *Client) CreateUtilizationReportOperation(name string) *CreateUtilizationReportOperation

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

func (*Client) DeleteDatacenterConnector

DeleteDatacenterConnector deletes a single DatacenterConnector.

Example

package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
)

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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.DeleteDatacenterConnectorRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#DeleteDatacenterConnectorRequest.
	}
	op, err := c.DeleteDatacenterConnector(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*Client) DeleteDatacenterConnectorOperation

func (c *Client) DeleteDatacenterConnectorOperation(name string) *DeleteDatacenterConnectorOperation

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

func (*Client) DeleteGroup

DeleteGroup deletes a single Group.

Example

package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
)

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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.DeleteGroupRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#DeleteGroupRequest.
	}
	op, err := c.DeleteGroup(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*Client) DeleteGroupOperation

func (c *Client) DeleteGroupOperation(name string) *DeleteGroupOperation

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

func (*Client) DeleteMigratingVm

DeleteMigratingVm deletes a single MigratingVm.

Example

package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
)

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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.DeleteMigratingVmRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#DeleteMigratingVmRequest.
	}
	op, err := c.DeleteMigratingVm(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*Client) DeleteMigratingVmOperation

func (c *Client) DeleteMigratingVmOperation(name string) *DeleteMigratingVmOperation

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

func (*Client) DeleteOperation

func (c *Client) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error

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

Example

package main

import (
	"context"

	longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
	vmmigration "cloud.google.com/go/vmmigration/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 := vmmigration.NewClient(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 (*Client) DeleteSource

DeleteSource deletes a single Source.

Example

package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
)

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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.DeleteSourceRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#DeleteSourceRequest.
	}
	op, err := c.DeleteSource(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*Client) DeleteSourceOperation

func (c *Client) DeleteSourceOperation(name string) *DeleteSourceOperation

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

func (*Client) DeleteTargetProject

DeleteTargetProject deletes a single TargetProject.

NOTE: TargetProject is a global resource; hence the only supported value for location is global.

Example

package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
)

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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.DeleteTargetProjectRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#DeleteTargetProjectRequest.
	}
	op, err := c.DeleteTargetProject(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*Client) DeleteTargetProjectOperation

func (c *Client) DeleteTargetProjectOperation(name string) *DeleteTargetProjectOperation

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

func (*Client) DeleteUtilizationReport

DeleteUtilizationReport deletes a single Utilization Report.

Example

package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
)

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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.DeleteUtilizationReportRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#DeleteUtilizationReportRequest.
	}
	op, err := c.DeleteUtilizationReport(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*Client) DeleteUtilizationReportOperation

func (c *Client) DeleteUtilizationReportOperation(name string) *DeleteUtilizationReportOperation

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

func (*Client) FetchInventory

FetchInventory list remote source’s inventory of VMs. The remote source is the onprem vCenter (remote in the sense it’s not in Compute Engine). The inventory describes the list of existing VMs in that source. Note that this operation lists the VMs on the remote source, as opposed to listing the MigratingVms resources in the vmmigration service.

Example

package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
)

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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.FetchInventoryRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#FetchInventoryRequest.
	}
	resp, err := c.FetchInventory(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*Client) FinalizeMigration

FinalizeMigration marks a migration as completed, deleting migration resources that are no longer being used. Only applicable after cutover is done.

Example

package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
)

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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.FinalizeMigrationRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#FinalizeMigrationRequest.
	}
	op, err := c.FinalizeMigration(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*Client) FinalizeMigrationOperation

func (c *Client) FinalizeMigrationOperation(name string) *FinalizeMigrationOperation

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

func (*Client) GetCloneJob

GetCloneJob gets details of a single CloneJob.

Example

package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
)

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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.GetCloneJobRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#GetCloneJobRequest.
	}
	resp, err := c.GetCloneJob(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*Client) GetCutoverJob

GetCutoverJob gets details of a single CutoverJob.

Example

package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
)

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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.GetCutoverJobRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#GetCutoverJobRequest.
	}
	resp, err := c.GetCutoverJob(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*Client) GetDatacenterConnector

GetDatacenterConnector gets details of a single DatacenterConnector.

Example

package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
)

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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.GetDatacenterConnectorRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#GetDatacenterConnectorRequest.
	}
	resp, err := c.GetDatacenterConnector(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*Client) GetGroup

GetGroup gets details of a single Group.

Example

package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
)

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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.GetGroupRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#GetGroupRequest.
	}
	resp, err := c.GetGroup(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*Client) GetLocation

func (c *Client) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)

GetLocation gets information about a location.

Example

package main

import (
	"context"

	vmmigration "cloud.google.com/go/vmmigration/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 := vmmigration.NewClient(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 (*Client) GetMigratingVm

GetMigratingVm gets details of a single MigratingVm.

Example

package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
)

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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.GetMigratingVmRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#GetMigratingVmRequest.
	}
	resp, err := c.GetMigratingVm(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*Client) GetOperation

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

Example

package main

import (
	"context"

	longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
	vmmigration "cloud.google.com/go/vmmigration/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 := vmmigration.NewClient(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 (*Client) GetReplicationCycle

GetReplicationCycle gets details of a single ReplicationCycle.

Example

package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
)

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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.GetReplicationCycleRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#GetReplicationCycleRequest.
	}
	resp, err := c.GetReplicationCycle(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*Client) GetSource

GetSource gets details of a single Source.

Example

package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
)

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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.GetSourceRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#GetSourceRequest.
	}
	resp, err := c.GetSource(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*Client) GetTargetProject

GetTargetProject gets details of a single TargetProject.

NOTE: TargetProject is a global resource; hence the only supported value for location is global.

Example

package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
)

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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.GetTargetProjectRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#GetTargetProjectRequest.
	}
	resp, err := c.GetTargetProject(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*Client) GetUtilizationReport

GetUtilizationReport gets a single Utilization Report.

Example

package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
)

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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.GetUtilizationReportRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#GetUtilizationReportRequest.
	}
	resp, err := c.GetUtilizationReport(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*Client) ListCloneJobs

ListCloneJobs lists CloneJobs of a given migrating VM.

Examples

package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
	"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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.ListCloneJobsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#ListCloneJobsRequest.
	}
	it := c.ListCloneJobs(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.(*vmmigrationpb.ListCloneJobsResponse)
	}
}
all
package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
)

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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.ListCloneJobsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#ListCloneJobsRequest.
	}
	for resp, err := range c.ListCloneJobs(ctx, req).All() {
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}

func (*Client) ListCutoverJobs

ListCutoverJobs lists CutoverJobs of a given migrating VM.

Examples

package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
	"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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.ListCutoverJobsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#ListCutoverJobsRequest.
	}
	it := c.ListCutoverJobs(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.(*vmmigrationpb.ListCutoverJobsResponse)
	}
}
all
package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
)

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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.ListCutoverJobsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#ListCutoverJobsRequest.
	}
	for resp, err := range c.ListCutoverJobs(ctx, req).All() {
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}

func (*Client) ListDatacenterConnectors

ListDatacenterConnectors lists DatacenterConnectors in a given Source.

Examples

package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
	"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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.ListDatacenterConnectorsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#ListDatacenterConnectorsRequest.
	}
	it := c.ListDatacenterConnectors(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.(*vmmigrationpb.ListDatacenterConnectorsResponse)
	}
}
all
package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
)

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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.ListDatacenterConnectorsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#ListDatacenterConnectorsRequest.
	}
	for resp, err := range c.ListDatacenterConnectors(ctx, req).All() {
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}

func (*Client) ListGroups

func (c *Client) ListGroups(ctx context.Context, req *vmmigrationpb.ListGroupsRequest, opts ...gax.CallOption) *GroupIterator

ListGroups lists Groups in a given project and location.

Examples

package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
	"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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.ListGroupsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#ListGroupsRequest.
	}
	it := c.ListGroups(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.(*vmmigrationpb.ListGroupsResponse)
	}
}
all
package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
)

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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.ListGroupsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#ListGroupsRequest.
	}
	for resp, err := range c.ListGroups(ctx, req).All() {
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}

func (*Client) ListLocations

func (c *Client) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator

ListLocations lists information about the supported locations for this service.

Examples

package main

import (
	"context"

	vmmigration "cloud.google.com/go/vmmigration/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 := vmmigration.NewClient(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)
	}
}
all
package main

import (
	"context"

	vmmigration "cloud.google.com/go/vmmigration/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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &locationpb.ListLocationsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
	}
	for resp, err := range c.ListLocations(ctx, req).All() {
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}

func (*Client) ListMigratingVms

ListMigratingVms lists MigratingVms in a given Source.

Examples

package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
	"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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.ListMigratingVmsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#ListMigratingVmsRequest.
	}
	it := c.ListMigratingVms(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.(*vmmigrationpb.ListMigratingVmsResponse)
	}
}
all
package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
)

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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.ListMigratingVmsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#ListMigratingVmsRequest.
	}
	for resp, err := range c.ListMigratingVms(ctx, req).All() {
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}

func (*Client) ListOperations

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

Examples

package main

import (
	"context"

	longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
	vmmigration "cloud.google.com/go/vmmigration/apiv1"
	"google.golang.org/api/iterator"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := vmmigration.NewClient(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)
	}
}
all
package main

import (
	"context"

	longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
	vmmigration "cloud.google.com/go/vmmigration/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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &longrunningpb.ListOperationsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
	}
	for resp, err := range c.ListOperations(ctx, req).All() {
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}

func (*Client) ListReplicationCycles

ListReplicationCycles lists ReplicationCycles in a given MigratingVM.

Examples

package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
	"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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.ListReplicationCyclesRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#ListReplicationCyclesRequest.
	}
	it := c.ListReplicationCycles(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.(*vmmigrationpb.ListReplicationCyclesResponse)
	}
}
all
package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
)

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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.ListReplicationCyclesRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#ListReplicationCyclesRequest.
	}
	for resp, err := range c.ListReplicationCycles(ctx, req).All() {
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}

func (*Client) ListSources

func (c *Client) ListSources(ctx context.Context, req *vmmigrationpb.ListSourcesRequest, opts ...gax.CallOption) *SourceIterator

ListSources lists Sources in a given project and location.

Examples

package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
	"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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.ListSourcesRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#ListSourcesRequest.
	}
	it := c.ListSources(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.(*vmmigrationpb.ListSourcesResponse)
	}
}
all
package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
)

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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.ListSourcesRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#ListSourcesRequest.
	}
	for resp, err := range c.ListSources(ctx, req).All() {
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}

func (*Client) ListTargetProjects

ListTargetProjects lists TargetProjects in a given project.

NOTE: TargetProject is a global resource; hence the only supported value for location is global.

Examples

package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
	"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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.ListTargetProjectsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#ListTargetProjectsRequest.
	}
	it := c.ListTargetProjects(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.(*vmmigrationpb.ListTargetProjectsResponse)
	}
}
all
package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
)

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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.ListTargetProjectsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#ListTargetProjectsRequest.
	}
	for resp, err := range c.ListTargetProjects(ctx, req).All() {
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}

func (*Client) ListUtilizationReports

ListUtilizationReports lists Utilization Reports of the given Source.

Examples

package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
	"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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.ListUtilizationReportsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#ListUtilizationReportsRequest.
	}
	it := c.ListUtilizationReports(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.(*vmmigrationpb.ListUtilizationReportsResponse)
	}
}
all
package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
)

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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.ListUtilizationReportsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#ListUtilizationReportsRequest.
	}
	for resp, err := range c.ListUtilizationReports(ctx, req).All() {
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}

func (*Client) PauseMigration

PauseMigration pauses a migration for a VM. If cycle tasks are running they will be cancelled, preserving source task data. Further replication cycles will not be triggered while the VM is paused.

Example

package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
)

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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.PauseMigrationRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#PauseMigrationRequest.
	}
	op, err := c.PauseMigration(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*Client) PauseMigrationOperation

func (c *Client) PauseMigrationOperation(name string) *PauseMigrationOperation

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

func (*Client) RemoveGroupMigration

RemoveGroupMigration removes a MigratingVm from a Group.

Example

package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
)

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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.RemoveGroupMigrationRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#RemoveGroupMigrationRequest.
	}
	op, err := c.RemoveGroupMigration(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*Client) RemoveGroupMigrationOperation

func (c *Client) RemoveGroupMigrationOperation(name string) *RemoveGroupMigrationOperation

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

func (*Client) ResumeMigration

ResumeMigration resumes a migration for a VM. When called on a paused migration, will start the process of uploading data and creating snapshots; when called on a completed cut-over migration, will update the migration to active state and start the process of uploading data and creating snapshots.

Example

package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
)

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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.ResumeMigrationRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#ResumeMigrationRequest.
	}
	op, err := c.ResumeMigration(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*Client) ResumeMigrationOperation

func (c *Client) ResumeMigrationOperation(name string) *ResumeMigrationOperation

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

func (*Client) StartMigration

StartMigration starts migration for a VM. Starts the process of uploading data and creating snapshots, in replication cycles scheduled by the policy.

Example

package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
)

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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.StartMigrationRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#StartMigrationRequest.
	}
	op, err := c.StartMigration(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*Client) StartMigrationOperation

func (c *Client) StartMigrationOperation(name string) *StartMigrationOperation

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

func (*Client) UpdateGroup

UpdateGroup updates the parameters of a single Group.

Example

package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
)

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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.UpdateGroupRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#UpdateGroupRequest.
	}
	op, err := c.UpdateGroup(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*Client) UpdateGroupOperation

func (c *Client) UpdateGroupOperation(name string) *UpdateGroupOperation

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

func (*Client) UpdateMigratingVm

UpdateMigratingVm updates the parameters of a single MigratingVm.

Example

package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
)

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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.UpdateMigratingVmRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#UpdateMigratingVmRequest.
	}
	op, err := c.UpdateMigratingVm(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*Client) UpdateMigratingVmOperation

func (c *Client) UpdateMigratingVmOperation(name string) *UpdateMigratingVmOperation

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

func (*Client) UpdateSource

UpdateSource updates the parameters of a single Source.

Example

package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
)

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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.UpdateSourceRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#UpdateSourceRequest.
	}
	op, err := c.UpdateSource(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*Client) UpdateSourceOperation

func (c *Client) UpdateSourceOperation(name string) *UpdateSourceOperation

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

func (*Client) UpdateTargetProject

UpdateTargetProject updates the parameters of a single TargetProject.

NOTE: TargetProject is a global resource; hence the only supported value for location is global.

Example

package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
)

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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.UpdateTargetProjectRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#UpdateTargetProjectRequest.
	}
	op, err := c.UpdateTargetProject(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*Client) UpdateTargetProjectOperation

func (c *Client) UpdateTargetProjectOperation(name string) *UpdateTargetProjectOperation

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

func (*Client) UpgradeAppliance

UpgradeAppliance upgrades the appliance relate to this DatacenterConnector to the in-place updateable version.

Example

package main

import (
	"context"

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

	vmmigrationpb "cloud.google.com/go/vmmigration/apiv1/vmmigrationpb"
)

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 := vmmigration.NewClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &vmmigrationpb.UpgradeApplianceRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/vmmigration/apiv1/vmmigrationpb#UpgradeApplianceRequest.
	}
	op, err := c.UpgradeAppliance(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*Client) UpgradeApplianceOperation

func (c *Client) UpgradeApplianceOperation(name string) *UpgradeApplianceOperation

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

CloneJobIterator

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

CloneJobIterator manages a stream of *vmmigrationpb.CloneJob.

func (*CloneJobIterator) All

func (it *CloneJobIterator) All() iter.Seq2[*vmmigrationpb.CloneJob, error]

All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.

func (*CloneJobIterator) 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 (*CloneJobIterator) PageInfo

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

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

CreateCloneJobOperation

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

CreateCloneJobOperation manages a long-running operation from CreateCloneJob.

func (*CreateCloneJobOperation) Done

func (op *CreateCloneJobOperation) Done() bool

Done reports whether the long-running operation has completed.

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

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

CreateCutoverJobOperation

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

CreateCutoverJobOperation manages a long-running operation from CreateCutoverJob.

func (*CreateCutoverJobOperation) Done

func (op *CreateCutoverJobOperation) Done() bool

Done reports whether the long-running operation has completed.

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

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

CreateDatacenterConnectorOperation

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

CreateDatacenterConnectorOperation manages a long-running operation from CreateDatacenterConnector.

func (*CreateDatacenterConnectorOperation) Done

Done reports whether the long-running operation has completed.

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

CreateGroupOperation

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

CreateGroupOperation manages a long-running operation from CreateGroup.

func (*CreateGroupOperation) Done

func (op *CreateGroupOperation) Done() bool

Done reports whether the long-running operation has completed.

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

func (op *CreateGroupOperation) 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 (*CreateGroupOperation) Poll

func (op *Creat