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:
- Authentication and Authorization
- Timeouts and Cancellation
- Testing against Client Libraries
- Debugging Client Libraries
- Inspecting errors
Example usage
To get started with this package, create a client.
ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := 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
func (op *AddGroupMigrationOperation) Metadata() (*vmmigrationpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*AddGroupMigrationOperation) Name
func (op *AddGroupMigrationOperation) 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 (*AddGroupMigrationOperation) Poll
func (op *AddGroupMigrationOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*vmmigrationpb.AddGroupMigrationResponse, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*AddGroupMigrationOperation) Wait
func (op *AddGroupMigrationOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*vmmigrationpb.AddGroupMigrationResponse, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
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
func (op *CancelCloneJobOperation) Metadata() (*vmmigrationpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*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
func (op *CancelCloneJobOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*vmmigrationpb.CancelCloneJobResponse, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*CancelCloneJobOperation) Wait
func (op *CancelCloneJobOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*vmmigrationpb.CancelCloneJobResponse, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
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
func (op *CancelCutoverJobOperation) Metadata() (*vmmigrationpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*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
func (op *CancelCutoverJobOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*vmmigrationpb.CancelCutoverJobResponse, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*CancelCutoverJobOperation) Wait
func (op *CancelCutoverJobOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*vmmigrationpb.CancelCutoverJobResponse, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
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
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
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
func (c *Client) AddGroupMigration(ctx context.Context, req *vmmigrationpb.AddGroupMigrationRequest, opts ...gax.CallOption) (*AddGroupMigrationOperation, error)
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
func (c *Client) CancelCloneJob(ctx context.Context, req *vmmigrationpb.CancelCloneJobRequest, opts ...gax.CallOption) (*CancelCloneJobOperation, error)
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
func (c *Client) CancelCutoverJob(ctx context.Context, req *vmmigrationpb.CancelCutoverJobRequest, opts ...gax.CallOption) (*CancelCutoverJobOperation, error)
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
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
func (c *Client) CreateCloneJob(ctx context.Context, req *vmmigrationpb.CreateCloneJobRequest, opts ...gax.CallOption) (*CreateCloneJobOperation, error)
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
func (c *Client) CreateCutoverJob(ctx context.Context, req *vmmigrationpb.CreateCutoverJobRequest, opts ...gax.CallOption) (*CreateCutoverJobOperation, error)
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
func (c *Client) CreateDatacenterConnector(ctx context.Context, req *vmmigrationpb.CreateDatacenterConnectorRequest, opts ...gax.CallOption) (*CreateDatacenterConnectorOperation, error)
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
func (c *Client) CreateGroup(ctx context.Context, req *vmmigrationpb.CreateGroupRequest, opts ...gax.CallOption) (*CreateGroupOperation, error)
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
func (c *Client) CreateMigratingVm(ctx context.Context, req *vmmigrationpb.CreateMigratingVmRequest, opts ...gax.CallOption) (*CreateMigratingVmOperation, error)
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
func (c *Client) CreateSource(ctx context.Context, req *vmmigrationpb.CreateSourceRequest, opts ...gax.CallOption) (*CreateSourceOperation, error)
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
func (c *Client) CreateTargetProject(ctx context.Context, req *vmmigrationpb.CreateTargetProjectRequest, opts ...gax.CallOption) (*CreateTargetProjectOperation, error)
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
func (c *Client) CreateUtilizationReport(ctx context.Context, req *vmmigrationpb.CreateUtilizationReportRequest, opts ...gax.CallOption) (*CreateUtilizationReportOperation, error)
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
func (c *Client) DeleteDatacenterConnector(ctx context.Context, req *vmmigrationpb.DeleteDatacenterConnectorRequest, opts ...gax.CallOption) (*DeleteDatacenterConnectorOperation, error)
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
func (c *Client) DeleteGroup(ctx context.Context, req *vmmigrationpb.DeleteGroupRequest, opts ...gax.CallOption) (*DeleteGroupOperation, error)
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
func (c *Client) DeleteMigratingVm(ctx context.Context, req *vmmigrationpb.DeleteMigratingVmRequest, opts ...gax.CallOption) (*DeleteMigratingVmOperation, error)
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
func (c *Client) DeleteSource(ctx context.Context, req *vmmigrationpb.DeleteSourceRequest, opts ...gax.CallOption) (*DeleteSourceOperation, error)
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
func (c *Client) DeleteTargetProject(ctx context.Context, req *vmmigrationpb.DeleteTargetProjectRequest, opts ...gax.CallOption) (*DeleteTargetProjectOperation, error)
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
func (c *Client) DeleteUtilizationReport(ctx context.Context, req *vmmigrationpb.DeleteUtilizationReportRequest, opts ...gax.CallOption) (*DeleteUtilizationReportOperation, error)
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
func (c *Client) FetchInventory(ctx context.Context, req *vmmigrationpb.FetchInventoryRequest, opts ...gax.CallOption) (*vmmigrationpb.FetchInventoryResponse, error)
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
func (c *Client) FinalizeMigration(ctx context.Context, req *vmmigrationpb.FinalizeMigrationRequest, opts ...gax.CallOption) (*FinalizeMigrationOperation, error)
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
func (c *Client) GetCloneJob(ctx context.Context, req *vmmigrationpb.GetCloneJobRequest, opts ...gax.CallOption) (*vmmigrationpb.CloneJob, error)
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
func (c *Client) GetCutoverJob(ctx context.Context, req *vmmigrationpb.GetCutoverJobRequest, opts ...gax.CallOption) (*vmmigrationpb.CutoverJob, error)
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
func (c *Client) GetDatacenterConnector(ctx context.Context, req *vmmigrationpb.GetDatacenterConnectorRequest, opts ...gax.CallOption) (*vmmigrationpb.DatacenterConnector, error)
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
func (c *Client) GetGroup(ctx context.Context, req *vmmigrationpb.GetGroupRequest, opts ...gax.CallOption) (*vmmigrationpb.Group, error)
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
func (c *Client) GetMigratingVm(ctx context.Context, req *vmmigrationpb.GetMigratingVmRequest, opts ...gax.CallOption) (*vmmigrationpb.MigratingVm, error)
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
func (c *Client) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
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
func (c *Client) GetReplicationCycle(ctx context.Context, req *vmmigrationpb.GetReplicationCycleRequest, opts ...gax.CallOption) (*vmmigrationpb.ReplicationCycle, error)
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
func (c *Client) GetSource(ctx context.Context, req *vmmigrationpb.GetSourceRequest, opts ...gax.CallOption) (*vmmigrationpb.Source, error)
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
func (c *Client) GetTargetProject(ctx context.Context, req *vmmigrationpb.GetTargetProjectRequest, opts ...gax.CallOption) (*vmmigrationpb.TargetProject, error)
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
func (c *Client) GetUtilizationReport(ctx context.Context, req *vmmigrationpb.GetUtilizationReportRequest, opts ...gax.CallOption) (*vmmigrationpb.UtilizationReport, error)
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
func (c *Client) ListCloneJobs(ctx context.Context, req *vmmigrationpb.ListCloneJobsRequest, opts ...gax.CallOption) *CloneJobIterator
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
func (c *Client) ListCutoverJobs(ctx context.Context, req *vmmigrationpb.ListCutoverJobsRequest, opts ...gax.CallOption) *CutoverJobIterator
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
func (c *Client) ListDatacenterConnectors(ctx context.Context, req *vmmigrationpb.ListDatacenterConnectorsRequest, opts ...gax.CallOption) *DatacenterConnectorIterator
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
func (c *Client) ListMigratingVms(ctx context.Context, req *vmmigrationpb.ListMigratingVmsRequest, opts ...gax.CallOption) *MigratingVmIterator
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
func (c *Client) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
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
func (c *Client) ListReplicationCycles(ctx context.Context, req *vmmigrationpb.ListReplicationCyclesRequest, opts ...gax.CallOption) *ReplicationCycleIterator
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
func (c *Client) ListTargetProjects(ctx context.Context, req *vmmigrationpb.ListTargetProjectsRequest, opts ...gax.CallOption) *TargetProjectIterator
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
func (c *Client) ListUtilizationReports(ctx context.Context, req *vmmigrationpb.ListUtilizationReportsRequest, opts ...gax.CallOption) *UtilizationReportIterator
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
func (c *Client) PauseMigration(ctx context.Context, req *vmmigrationpb.PauseMigrationRequest, opts ...gax.CallOption) (*PauseMigrationOperation, error)
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
func (c *Client) RemoveGroupMigration(ctx context.Context, req *vmmigrationpb.RemoveGroupMigrationRequest, opts ...gax.CallOption) (*RemoveGroupMigrationOperation, error)
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
func (c *Client) ResumeMigration(ctx context.Context, req *vmmigrationpb.ResumeMigrationRequest, opts ...gax.CallOption) (*ResumeMigrationOperation, error)
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
func (c *Client) StartMigration(ctx context.Context, req *vmmigrationpb.StartMigrationRequest, opts ...gax.CallOption) (*StartMigrationOperation, error)
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
func (c *Client) UpdateGroup(ctx context.Context, req *vmmigrationpb.UpdateGroupRequest, opts ...gax.CallOption) (*UpdateGroupOperation, error)
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
func (c *Client) UpdateMigratingVm(ctx context.Context, req *vmmigrationpb.UpdateMigratingVmRequest, opts ...gax.CallOption) (*UpdateMigratingVmOperation, error)
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
func (c *Client) UpdateSource(ctx context.Context, req *vmmigrationpb.UpdateSourceRequest, opts ...gax.CallOption) (*UpdateSourceOperation, error)
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
func (c *Client) UpdateTargetProject(ctx context.Context, req *vmmigrationpb.UpdateTargetProjectRequest, opts ...gax.CallOption) (*UpdateTargetProjectOperation, error)
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
func (c *Client) UpgradeAppliance(ctx context.Context, req *vmmigrationpb.UpgradeApplianceRequest, opts ...gax.CallOption) (*UpgradeApplianceOperation, error)
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
func (it *CloneJobIterator) Next() (*vmmigrationpb.CloneJob, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*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
func (op *CreateCloneJobOperation) Metadata() (*vmmigrationpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*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
func (op *CreateCloneJobOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*vmmigrationpb.CloneJob, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*CreateCloneJobOperation) Wait
func (op *CreateCloneJobOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*vmmigrationpb.CloneJob, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
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
func (op *CreateCutoverJobOperation) Metadata() (*vmmigrationpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*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
func (op *CreateCutoverJobOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*vmmigrationpb.CutoverJob, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*CreateCutoverJobOperation) Wait
func (op *CreateCutoverJobOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*vmmigrationpb.CutoverJob, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
CreateDatacenterConnectorOperation
type CreateDatacenterConnectorOperation struct {
// contains filtered or unexported fields
}
CreateDatacenterConnectorOperation manages a long-running operation from CreateDatacenterConnector.
func (*CreateDatacenterConnectorOperation) Done
func (op *CreateDatacenterConnectorOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreateDatacenterConnectorOperation) Metadata
func (op *CreateDatacenterConnectorOperation) Metadata() (*vmmigrationpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*CreateDatacenterConnectorOperation) Name
func (op *CreateDatacenterConnectorOperation) 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 (*CreateDatacenterConnectorOperation) Poll
func (op *CreateDatacenterConnectorOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*vmmigrationpb.DatacenterConnector, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*CreateDatacenterConnectorOperation) Wait
func (op *CreateDatacenterConnectorOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*vmmigrationpb.DatacenterConnector, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
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
func (op *CreateGroupOperation) Metadata() (*vmmigrationpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*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