Package rapidmigrationassessment is an auto-generated package for the Rapid Migration Assessment API.
The Rapid Migration Assessment service is our first-party migration assessment and planning tool.
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 := rapidmigrationassessment.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 := rapidmigrationassessment.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &rapidmigrationassessmentpb.CreateAnnotationRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/rapidmigrationassessment/apiv1/rapidmigrationassessmentpb#CreateAnnotationRequest. } op, err := c.CreateAnnotation(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.
CallOptions
type CallOptions struct {
CreateCollector []gax.CallOption
CreateAnnotation []gax.CallOption
GetAnnotation []gax.CallOption
ListCollectors []gax.CallOption
GetCollector []gax.CallOption
UpdateCollector []gax.CallOption
DeleteCollector []gax.CallOption
ResumeCollector []gax.CallOption
RegisterCollector []gax.CallOption
PauseCollector []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.
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 Rapid Migration Assessment API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service describing handlers for resources.
func NewClient
NewClient creates a new rapid migration assessment client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Service describing handlers for resources.
Example
package main
import (
"context"
rapidmigrationassessment "cloud.google.com/go/rapidmigrationassessment/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 := rapidmigrationassessment.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewRESTClient
NewRESTClient creates a new rapid migration assessment rest client.
Service describing handlers for resources.
Example
package main
import (
"context"
rapidmigrationassessment "cloud.google.com/go/rapidmigrationassessment/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 := rapidmigrationassessment.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
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"
rapidmigrationassessment "cloud.google.com/go/rapidmigrationassessment/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 := rapidmigrationassessment.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) CreateAnnotation
func (c *Client) CreateAnnotation(ctx context.Context, req *rapidmigrationassessmentpb.CreateAnnotationRequest, opts ...gax.CallOption) (*CreateAnnotationOperation, error)
CreateAnnotation creates an Annotation
Example
package main
import (
"context"
rapidmigrationassessment "cloud.google.com/go/rapidmigrationassessment/apiv1"
rapidmigrationassessmentpb "cloud.google.com/go/rapidmigrationassessment/apiv1/rapidmigrationassessmentpb"
)
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 := rapidmigrationassessment.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &rapidmigrationassessmentpb.CreateAnnotationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/rapidmigrationassessment/apiv1/rapidmigrationassessmentpb#CreateAnnotationRequest.
}
op, err := c.CreateAnnotation(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) CreateAnnotationOperation
func (c *Client) CreateAnnotationOperation(name string) *CreateAnnotationOperation
CreateAnnotationOperation returns a new CreateAnnotationOperation from a given name. The name must be that of a previously created CreateAnnotationOperation, possibly from a different process.
func (*Client) CreateCollector
func (c *Client) CreateCollector(ctx context.Context, req *rapidmigrationassessmentpb.CreateCollectorRequest, opts ...gax.CallOption) (*CreateCollectorOperation, error)
CreateCollector create a Collector to manage the on-prem appliance which collects information about Customer assets.
Example
package main
import (
"context"
rapidmigrationassessment "cloud.google.com/go/rapidmigrationassessment/apiv1"
rapidmigrationassessmentpb "cloud.google.com/go/rapidmigrationassessment/apiv1/rapidmigrationassessmentpb"
)
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 := rapidmigrationassessment.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &rapidmigrationassessmentpb.CreateCollectorRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/rapidmigrationassessment/apiv1/rapidmigrationassessmentpb#CreateCollectorRequest.
}
op, err := c.CreateCollector(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) CreateCollectorOperation
func (c *Client) CreateCollectorOperation(name string) *CreateCollectorOperation
CreateCollectorOperation returns a new CreateCollectorOperation from a given name. The name must be that of a previously created CreateCollectorOperation, possibly from a different process.
func (*Client) DeleteCollector
func (c *Client) DeleteCollector(ctx context.Context, req *rapidmigrationassessmentpb.DeleteCollectorRequest, opts ...gax.CallOption) (*DeleteCollectorOperation, error)
DeleteCollector deletes a single Collector - changes state of collector to “Deleting”. Background jobs does final deletion thorugh producer api.
Example
package main
import (
"context"
rapidmigrationassessment "cloud.google.com/go/rapidmigrationassessment/apiv1"
rapidmigrationassessmentpb "cloud.google.com/go/rapidmigrationassessment/apiv1/rapidmigrationassessmentpb"
)
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 := rapidmigrationassessment.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &rapidmigrationassessmentpb.DeleteCollectorRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/rapidmigrationassessment/apiv1/rapidmigrationassessmentpb#DeleteCollectorRequest.
}
op, err := c.DeleteCollector(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) DeleteCollectorOperation
func (c *Client) DeleteCollectorOperation(name string) *DeleteCollectorOperation
DeleteCollectorOperation returns a new DeleteCollectorOperation from a given name. The name must be that of a previously created DeleteCollectorOperation, 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"
rapidmigrationassessment "cloud.google.com/go/rapidmigrationassessment/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 := rapidmigrationassessment.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) GetAnnotation
func (c *Client) GetAnnotation(ctx context.Context, req *rapidmigrationassessmentpb.GetAnnotationRequest, opts ...gax.CallOption) (*rapidmigrationassessmentpb.Annotation, error)
GetAnnotation gets details of a single Annotation.
Example
package main
import (
"context"
rapidmigrationassessment "cloud.google.com/go/rapidmigrationassessment/apiv1"
rapidmigrationassessmentpb "cloud.google.com/go/rapidmigrationassessment/apiv1/rapidmigrationassessmentpb"
)
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 := rapidmigrationassessment.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &rapidmigrationassessmentpb.GetAnnotationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/rapidmigrationassessment/apiv1/rapidmigrationassessmentpb#GetAnnotationRequest.
}
resp, err := c.GetAnnotation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) GetCollector
func (c *Client) GetCollector(ctx context.Context, req *rapidmigrationassessmentpb.GetCollectorRequest, opts ...gax.CallOption) (*rapidmigrationassessmentpb.Collector, error)
GetCollector gets details of a single Collector.
Example
package main
import (
"context"
rapidmigrationassessment "cloud.google.com/go/rapidmigrationassessment/apiv1"
rapidmigrationassessmentpb "cloud.google.com/go/rapidmigrationassessment/apiv1/rapidmigrationassessmentpb"
)
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 := rapidmigrationassessment.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &rapidmigrationassessmentpb.GetCollectorRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/rapidmigrationassessment/apiv1/rapidmigrationassessmentpb#GetCollectorRequest.
}
resp, err := c.GetCollector(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"
rapidmigrationassessment "cloud.google.com/go/rapidmigrationassessment/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 := rapidmigrationassessment.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) 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"
rapidmigrationassessment "cloud.google.com/go/rapidmigrationassessment/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 := rapidmigrationassessment.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) ListCollectors
func (c *Client) ListCollectors(ctx context.Context, req *rapidmigrationassessmentpb.ListCollectorsRequest, opts ...gax.CallOption) *CollectorIterator
ListCollectors lists Collectors in a given project and location.
Examples
package main
import (
"context"
rapidmigrationassessment "cloud.google.com/go/rapidmigrationassessment/apiv1"
rapidmigrationassessmentpb "cloud.google.com/go/rapidmigrationassessment/apiv1/rapidmigrationassessmentpb"
"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 := rapidmigrationassessment.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &rapidmigrationassessmentpb.ListCollectorsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/rapidmigrationassessment/apiv1/rapidmigrationassessmentpb#ListCollectorsRequest.
}
it := c.ListCollectors(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.(*rapidmigrationassessmentpb.ListCollectorsResponse)
}
}
all
package main
import (
"context"
rapidmigrationassessment "cloud.google.com/go/rapidmigrationassessment/apiv1"
rapidmigrationassessmentpb "cloud.google.com/go/rapidmigrationassessment/apiv1/rapidmigrationassessmentpb"
)
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 := rapidmigrationassessment.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &rapidmigrationassessmentpb.ListCollectorsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/rapidmigrationassessment/apiv1/rapidmigrationassessmentpb#ListCollectorsRequest.
}
for resp, err := range c.ListCollectors(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"
rapidmigrationassessment "cloud.google.com/go/rapidmigrationassessment/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 := rapidmigrationassessment.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"
rapidmigrationassessment "cloud.google.com/go/rapidmigrationassessment/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 := rapidmigrationassessment.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) 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"
rapidmigrationassessment "cloud.google.com/go/rapidmigrationassessment/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 := rapidmigrationassessment.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"
rapidmigrationassessment "cloud.google.com/go/rapidmigrationassessment/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 := rapidmigrationassessment.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) PauseCollector
func (c *Client) PauseCollector(ctx context.Context, req *rapidmigrationassessmentpb.PauseCollectorRequest, opts ...gax.CallOption) (*PauseCollectorOperation, error)
PauseCollector pauses the given collector.
Example
package main
import (
"context"
rapidmigrationassessment "cloud.google.com/go/rapidmigrationassessment/apiv1"
rapidmigrationassessmentpb "cloud.google.com/go/rapidmigrationassessment/apiv1/rapidmigrationassessmentpb"
)
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 := rapidmigrationassessment.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &rapidmigrationassessmentpb.PauseCollectorRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/rapidmigrationassessment/apiv1/rapidmigrationassessmentpb#PauseCollectorRequest.
}
op, err := c.PauseCollector(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) PauseCollectorOperation
func (c *Client) PauseCollectorOperation(name string) *PauseCollectorOperation
PauseCollectorOperation returns a new PauseCollectorOperation from a given name. The name must be that of a previously created PauseCollectorOperation, possibly from a different process.
func (*Client) RegisterCollector
func (c *Client) RegisterCollector(ctx context.Context, req *rapidmigrationassessmentpb.RegisterCollectorRequest, opts ...gax.CallOption) (*RegisterCollectorOperation, error)
RegisterCollector registers the given collector.
Example
package main
import (
"context"
rapidmigrationassessment "cloud.google.com/go/rapidmigrationassessment/apiv1"
rapidmigrationassessmentpb "cloud.google.com/go/rapidmigrationassessment/apiv1/rapidmigrationassessmentpb"
)
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 := rapidmigrationassessment.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &rapidmigrationassessmentpb.RegisterCollectorRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/rapidmigrationassessment/apiv1/rapidmigrationassessmentpb#RegisterCollectorRequest.
}
op, err := c.RegisterCollector(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) RegisterCollectorOperation
func (c *Client) RegisterCollectorOperation(name string) *RegisterCollectorOperation
RegisterCollectorOperation returns a new RegisterCollectorOperation from a given name. The name must be that of a previously created RegisterCollectorOperation, possibly from a different process.
func (*Client) ResumeCollector
func (c *Client) ResumeCollector(ctx context.Context, req *rapidmigrationassessmentpb.ResumeCollectorRequest, opts ...gax.CallOption) (*ResumeCollectorOperation, error)
ResumeCollector resumes the given collector.
Example
package main
import (
"context"
rapidmigrationassessment "cloud.google.com/go/rapidmigrationassessment/apiv1"
rapidmigrationassessmentpb "cloud.google.com/go/rapidmigrationassessment/apiv1/rapidmigrationassessmentpb"
)
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 := rapidmigrationassessment.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &rapidmigrationassessmentpb.ResumeCollectorRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/rapidmigrationassessment/apiv1/rapidmigrationassessmentpb#ResumeCollectorRequest.
}
op, err := c.ResumeCollector(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) ResumeCollectorOperation
func (c *Client) ResumeCollectorOperation(name string) *ResumeCollectorOperation
ResumeCollectorOperation returns a new ResumeCollectorOperation from a given name. The name must be that of a previously created ResumeCollectorOperation, possibly from a different process.
func (*Client) UpdateCollector
func (c *Client) UpdateCollector(ctx context.Context, req *rapidmigrationassessmentpb.UpdateCollectorRequest, opts ...gax.CallOption) (*UpdateCollectorOperation, error)
UpdateCollector updates the parameters of a single Collector.
Example
package main
import (
"context"
rapidmigrationassessment "cloud.google.com/go/rapidmigrationassessment/apiv1"
rapidmigrationassessmentpb "cloud.google.com/go/rapidmigrationassessment/apiv1/rapidmigrationassessmentpb"
)
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 := rapidmigrationassessment.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &rapidmigrationassessmentpb.UpdateCollectorRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/rapidmigrationassessment/apiv1/rapidmigrationassessmentpb#UpdateCollectorRequest.
}
op, err := c.UpdateCollector(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) UpdateCollectorOperation
func (c *Client) UpdateCollectorOperation(name string) *UpdateCollectorOperation
UpdateCollectorOperation returns a new UpdateCollectorOperation from a given name. The name must be that of a previously created UpdateCollectorOperation, possibly from a different process.
CollectorIterator
type CollectorIterator 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 []*rapidmigrationassessmentpb.Collector, nextPageToken string, err error)
// contains filtered or unexported fields
}
CollectorIterator manages a stream of *rapidmigrationassessmentpb.Collector.
func (*CollectorIterator) All
func (it *CollectorIterator) All() iter.Seq2[*rapidmigrationassessmentpb.Collector, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*CollectorIterator) Next
func (it *CollectorIterator) Next() (*rapidmigrationassessmentpb.Collector, 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 (*CollectorIterator) PageInfo
func (it *CollectorIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
CreateAnnotationOperation
type CreateAnnotationOperation struct {
// contains filtered or unexported fields
}
CreateAnnotationOperation manages a long-running operation from CreateAnnotation.
func (*CreateAnnotationOperation) Done
func (op *CreateAnnotationOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreateAnnotationOperation) Metadata
func (op *CreateAnnotationOperation) Metadata() (*rapidmigrationassessmentpb.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 (*CreateAnnotationOperation) Name
func (op *CreateAnnotationOperation) 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 (*CreateAnnotationOperation) Poll
func (op *CreateAnnotationOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*rapidmigrationassessmentpb.Annotation, 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 (*CreateAnnotationOperation) Wait
func (op *CreateAnnotationOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*rapidmigrationassessmentpb.Annotation, 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.
CreateCollectorOperation
type CreateCollectorOperation struct {
// contains filtered or unexported fields
}
CreateCollectorOperation manages a long-running operation from CreateCollector.
func (*CreateCollectorOperation) Done
func (op *CreateCollectorOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreateCollectorOperation) Metadata
func (op *CreateCollectorOperation) Metadata() (*rapidmigrationassessmentpb.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 (*CreateCollectorOperation) Name
func (op *CreateCollectorOperation) 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 (*CreateCollectorOperation) Poll
func (op *CreateCollectorOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*rapidmigrationassessmentpb.Collector, 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 (*CreateCollectorOperation) Wait
func (op *CreateCollectorOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*rapidmigrationassessmentpb.Collector, 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.
DeleteCollectorOperation
type DeleteCollectorOperation struct {
// contains filtered or unexported fields
}
DeleteCollectorOperation manages a long-running operation from DeleteCollector.
func (*DeleteCollectorOperation) Done
func (op *DeleteCollectorOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*DeleteCollectorOperation) Metadata
func (op *DeleteCollectorOperation) Metadata() (*rapidmigrationassessmentpb.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 (*DeleteCollectorOperation) Name
func (op *DeleteCollectorOperation) 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 (*DeleteCollectorOperation) Poll
func (op *DeleteCollectorOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*rapidmigrationassessmentpb.Collector, 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 (*DeleteCollectorOperation) Wait
func (op *DeleteCollectorOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*rapidmigrationassessmentpb.Collector, 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.
LocationIterator
type LocationIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*locationpb.Location, nextPageToken string, err error)
// contains filtered or unexported fields
}
LocationIterator manages a stream of *locationpb.Location.
func (*LocationIterator) All
func (it *LocationIterator) All() iter.Seq2[*locationpb.Location, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*LocationIterator) Next
func (it *LocationIterator) Next() (*locationpb.Location, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*LocationIterator) PageInfo
func (it *LocationIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
OperationIterator
type OperationIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*longrunningpb.Operation, nextPageToken string, err error)
// contains filtered or unexported fields
}
OperationIterator manages a stream of *longrunningpb.Operation.
func (*OperationIterator) All
func (it *OperationIterator) All() iter.Seq2[*longrunningpb.Operation, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*OperationIterator) Next
func (it *OperationIterator) Next() (*longrunningpb.Operation, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*OperationIterator) PageInfo
func (it *OperationIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
PauseCollectorOperation
type PauseCollectorOperation struct {
// contains filtered or unexported fields
}
PauseCollectorOperation manages a long-running operation from PauseCollector.
func (*PauseCollectorOperation) Done
func (op *PauseCollectorOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*PauseCollectorOperation) Metadata
func (op *PauseCollectorOperation) Metadata() (*rapidmigrationassessmentpb.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 (*PauseCollectorOperation) Name
func (op *PauseCollectorOperation) 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 (*PauseCollectorOperation) Poll
func (op *PauseCollectorOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*rapidmigrationassessmentpb.Collector, 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 (*PauseCollectorOperation) Wait
func (op *PauseCollectorOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*rapidmigrationassessmentpb.Collector, 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.
RegisterCollectorOperation
type RegisterCollectorOperation struct {
// contains filtered or unexported fields
}
RegisterCollectorOperation manages a long-running operation from RegisterCollector.
func (*RegisterCollectorOperation) Done
func (op *RegisterCollectorOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*RegisterCollectorOperation) Metadata
func (op *RegisterCollectorOperation) Metadata() (*rapidmigrationassessmentpb.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 (*RegisterCollectorOperation) Name
func (op *RegisterCollectorOperation) 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 (*RegisterCollectorOperation) Poll
func (op *RegisterCollectorOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*rapidmigrationassessmentpb.Collector, 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 (*RegisterCollectorOperation) Wait
func (op *RegisterCollectorOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*rapidmigrationassessmentpb.Collector, 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.
ResumeCollectorOperation
type ResumeCollectorOperation struct {
// contains filtered or unexported fields
}
ResumeCollectorOperation manages a long-running operation from ResumeCollector.
func (*ResumeCollectorOperation) Done
func (op *ResumeCollectorOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*ResumeCollectorOperation) Metadata
func (op *ResumeCollectorOperation) Metadata() (*rapidmigrationassessmentpb.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 (*ResumeCollectorOperation) Name
func (op *ResumeCollectorOperation) 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 (*ResumeCollectorOperation) Poll
func (op *ResumeCollectorOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*rapidmigrationassessmentpb.Collector, 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 (*ResumeCollectorOperation) Wait
func (op *ResumeCollectorOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*rapidmigrationassessmentpb.Collector, 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.
UpdateCollectorOperation
type UpdateCollectorOperation struct {
// contains filtered or unexported fields
}
UpdateCollectorOperation manages a long-running operation from UpdateCollector.
func (*UpdateCollectorOperation) Done
func (op *UpdateCollectorOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*UpdateCollectorOperation) Metadata
func (op *UpdateCollectorOperation) Metadata() (*rapidmigrationassessmentpb.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 (*UpdateCollectorOperation) Name
func (op *UpdateCollectorOperation) 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 (*UpdateCollectorOperation) Poll
func (op *UpdateCollectorOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*rapidmigrationassessmentpb.Collector, 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 (*UpdateCollectorOperation) Wait
func (op *UpdateCollectorOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*rapidmigrationassessmentpb.Collector, 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.