Network Connectivity API v1 - Package cloud.google.com/go/networkconnectivity/apiv1 (v1.19.1) Stay organized with collections Save and categorize content based on your preferences.
Package networkconnectivity is an auto-generated package for theNetwork Connectivity API.
This API enables connectivity with and between Google Cloud resources.
General documentation
For information that is relevant for all client libraries please referencehttps://pkg.go.dev/cloud.google.com/go#pkg-overview. Some information on thispage includes:
- Authentication and Authorization
- Timeouts and Cancellation
- Testing against Client Libraries
- Debugging Client Libraries
- Inspecting errors
Example usage
To get started with this package, create a client.
// go get cloud.google.com/go/networkconnectivity/apiv1@latestctx:=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_Optionsc,err:=networkconnectivity.NewCrossNetworkAutomationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()
The client will use your default application credentials. Clients should be reused instead of created as needed.The methods of Client are safe for concurrent use by multiple goroutines.The returned client must be Closed when it is done being used.
Using the Client
The following is an example of making an API call with the newly created client, mentioned above.
req:=&networkconnectivitypb.CreateServiceConnectionMapRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#CreateServiceConnectionMapRequest.}op,err:=c.CreateServiceConnectionMap(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp
Use of Context
The ctx passed to NewCrossNetworkAutomationClient is used for authentication requests andfor 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
funcDefaultAuthScopes()[]stringDefaultAuthScopes reports the default set of authentication scopes to use with this package.
AcceptHubSpokeOperation
typeAcceptHubSpokeOperationstruct{// contains filtered or unexported fields}AcceptHubSpokeOperation manages a long-running operation from AcceptHubSpoke.
func (*AcceptHubSpokeOperation) Done
func(op*AcceptHubSpokeOperation)Done()boolDone reports whether the long-running operation has completed.
func (*AcceptHubSpokeOperation) Metadata
func(op*AcceptHubSpokeOperation)Metadata()(*networkconnectivitypb.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 (*AcceptHubSpokeOperation) Name
func(op*AcceptHubSpokeOperation)Name()stringName 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 (*AcceptHubSpokeOperation) Poll
func(op*AcceptHubSpokeOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*networkconnectivitypb.AcceptHubSpokeResponse,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 andthe 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 (*AcceptHubSpokeOperation) Wait
func(op*AcceptHubSpokeOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*networkconnectivitypb.AcceptHubSpokeResponse,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.
AcceptSpokeUpdateOperation
typeAcceptSpokeUpdateOperationstruct{// contains filtered or unexported fields}AcceptSpokeUpdateOperation manages a long-running operation from AcceptSpokeUpdate.
func (*AcceptSpokeUpdateOperation) Done
func(op*AcceptSpokeUpdateOperation)Done()boolDone reports whether the long-running operation has completed.
func (*AcceptSpokeUpdateOperation) Metadata
func(op*AcceptSpokeUpdateOperation)Metadata()(*networkconnectivitypb.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 (*AcceptSpokeUpdateOperation) Name
func(op*AcceptSpokeUpdateOperation)Name()stringName 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 (*AcceptSpokeUpdateOperation) Poll
func(op*AcceptSpokeUpdateOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*networkconnectivitypb.AcceptSpokeUpdateResponse,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 andthe 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 (*AcceptSpokeUpdateOperation) Wait
func(op*AcceptSpokeUpdateOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*networkconnectivitypb.AcceptSpokeUpdateResponse,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.
CreateDestinationOperation
typeCreateDestinationOperationstruct{// contains filtered or unexported fields}CreateDestinationOperation manages a long-running operation from CreateDestination.
func (*CreateDestinationOperation) Done
func(op*CreateDestinationOperation)Done()boolDone reports whether the long-running operation has completed.
func (*CreateDestinationOperation) Metadata
func(op*CreateDestinationOperation)Metadata()(*networkconnectivitypb.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 (*CreateDestinationOperation) Name
func(op*CreateDestinationOperation)Name()stringName 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 (*CreateDestinationOperation) Poll
func(op*CreateDestinationOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*networkconnectivitypb.Destination,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 andthe 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 (*CreateDestinationOperation) Wait
func(op*CreateDestinationOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*networkconnectivitypb.Destination,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.
CreateHubOperation
typeCreateHubOperationstruct{// contains filtered or unexported fields}CreateHubOperation manages a long-running operation from CreateHub.
func (*CreateHubOperation) Done
func(op*CreateHubOperation)Done()boolDone reports whether the long-running operation has completed.
func (*CreateHubOperation) Metadata
func(op*CreateHubOperation)Metadata()(*networkconnectivitypb.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 (*CreateHubOperation) Name
func(op*CreateHubOperation)Name()stringName 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 (*CreateHubOperation) Poll
func(op*CreateHubOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*networkconnectivitypb.Hub,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 andthe 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 (*CreateHubOperation) Wait
func(op*CreateHubOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*networkconnectivitypb.Hub,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.
CreateInternalRangeOperation
typeCreateInternalRangeOperationstruct{// contains filtered or unexported fields}CreateInternalRangeOperation manages a long-running operation from CreateInternalRange.
func (*CreateInternalRangeOperation) Done
func(op*CreateInternalRangeOperation)Done()boolDone reports whether the long-running operation has completed.
func (*CreateInternalRangeOperation) Metadata
func(op*CreateInternalRangeOperation)Metadata()(*networkconnectivitypb.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 (*CreateInternalRangeOperation) Name
func(op*CreateInternalRangeOperation)Name()stringName 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 (*CreateInternalRangeOperation) Poll
func(op*CreateInternalRangeOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*networkconnectivitypb.InternalRange,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 andthe 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 (*CreateInternalRangeOperation) Wait
func(op*CreateInternalRangeOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*networkconnectivitypb.InternalRange,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.
CreateMulticloudDataTransferConfigOperation
typeCreateMulticloudDataTransferConfigOperationstruct{// contains filtered or unexported fields}CreateMulticloudDataTransferConfigOperation manages a long-running operation from CreateMulticloudDataTransferConfig.
func (*CreateMulticloudDataTransferConfigOperation) Done
func(op*CreateMulticloudDataTransferConfigOperation)Done()boolDone reports whether the long-running operation has completed.
func (*CreateMulticloudDataTransferConfigOperation) Metadata
func(op*CreateMulticloudDataTransferConfigOperation)Metadata()(*networkconnectivitypb.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 (*CreateMulticloudDataTransferConfigOperation) Name
func(op*CreateMulticloudDataTransferConfigOperation)Name()stringName 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 (*CreateMulticloudDataTransferConfigOperation) Poll
func(op*CreateMulticloudDataTransferConfigOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*networkconnectivitypb.MulticloudDataTransferConfig,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 andthe 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 (*CreateMulticloudDataTransferConfigOperation) Wait
func(op*CreateMulticloudDataTransferConfigOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*networkconnectivitypb.MulticloudDataTransferConfig,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.
CreatePolicyBasedRouteOperation
typeCreatePolicyBasedRouteOperationstruct{// contains filtered or unexported fields}CreatePolicyBasedRouteOperation manages a long-running operation from CreatePolicyBasedRoute.
func (*CreatePolicyBasedRouteOperation) Done
func(op*CreatePolicyBasedRouteOperation)Done()boolDone reports whether the long-running operation has completed.
func (*CreatePolicyBasedRouteOperation) Metadata
func(op*CreatePolicyBasedRouteOperation)Metadata()(*networkconnectivitypb.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 (*CreatePolicyBasedRouteOperation) Name
func(op*CreatePolicyBasedRouteOperation)Name()stringName 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 (*CreatePolicyBasedRouteOperation) Poll
func(op*CreatePolicyBasedRouteOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*networkconnectivitypb.PolicyBasedRoute,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 andthe 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 (*CreatePolicyBasedRouteOperation) Wait
func(op*CreatePolicyBasedRouteOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*networkconnectivitypb.PolicyBasedRoute,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.
CreateServiceConnectionMapOperation
typeCreateServiceConnectionMapOperationstruct{// contains filtered or unexported fields}CreateServiceConnectionMapOperation manages a long-running operation from CreateServiceConnectionMap.
func (*CreateServiceConnectionMapOperation) Done
func(op*CreateServiceConnectionMapOperation)Done()boolDone reports whether the long-running operation has completed.
func (*CreateServiceConnectionMapOperation) Metadata
func(op*CreateServiceConnectionMapOperation)Metadata()(*networkconnectivitypb.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 (*CreateServiceConnectionMapOperation) Name
func(op*CreateServiceConnectionMapOperation)Name()stringName 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 (*CreateServiceConnectionMapOperation) Poll
func(op*CreateServiceConnectionMapOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*networkconnectivitypb.ServiceConnectionMap,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 andthe 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 (*CreateServiceConnectionMapOperation) Wait
func(op*CreateServiceConnectionMapOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*networkconnectivitypb.ServiceConnectionMap,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.
CreateServiceConnectionPolicyOperation
typeCreateServiceConnectionPolicyOperationstruct{// contains filtered or unexported fields}CreateServiceConnectionPolicyOperation manages a long-running operation from CreateServiceConnectionPolicy.
func (*CreateServiceConnectionPolicyOperation) Done
func(op*CreateServiceConnectionPolicyOperation)Done()boolDone reports whether the long-running operation has completed.
func (*CreateServiceConnectionPolicyOperation) Metadata
func(op*CreateServiceConnectionPolicyOperation)Metadata()(*networkconnectivitypb.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 (*CreateServiceConnectionPolicyOperation) Name
func(op*CreateServiceConnectionPolicyOperation)Name()stringName 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 (*CreateServiceConnectionPolicyOperation) Poll
func(op*CreateServiceConnectionPolicyOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*networkconnectivitypb.ServiceConnectionPolicy,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 andthe 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 (*CreateServiceConnectionPolicyOperation) Wait
func(op*CreateServiceConnectionPolicyOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*networkconnectivitypb.ServiceConnectionPolicy,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.
CreateServiceConnectionTokenOperation
typeCreateServiceConnectionTokenOperationstruct{// contains filtered or unexported fields}CreateServiceConnectionTokenOperation manages a long-running operation from CreateServiceConnectionToken.
func (*CreateServiceConnectionTokenOperation) Done
func(op*CreateServiceConnectionTokenOperation)Done()boolDone reports whether the long-running operation has completed.
func (*CreateServiceConnectionTokenOperation) Metadata
func(op*CreateServiceConnectionTokenOperation)Metadata()(*networkconnectivitypb.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 (*CreateServiceConnectionTokenOperation) Name
func(op*CreateServiceConnectionTokenOperation)Name()stringName 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 (*CreateServiceConnectionTokenOperation) Poll
func(op*CreateServiceConnectionTokenOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*networkconnectivitypb.ServiceConnectionToken,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 andthe 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 (*CreateServiceConnectionTokenOperation) Wait
func(op*CreateServiceConnectionTokenOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*networkconnectivitypb.ServiceConnectionToken,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.
CreateSpokeOperation
typeCreateSpokeOperationstruct{// contains filtered or unexported fields}CreateSpokeOperation manages a long-running operation from CreateSpoke.
func (*CreateSpokeOperation) Done
func(op*CreateSpokeOperation)Done()boolDone reports whether the long-running operation has completed.
func (*CreateSpokeOperation) Metadata
func(op*CreateSpokeOperation)Metadata()(*networkconnectivitypb.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 (*CreateSpokeOperation) Name
func(op*CreateSpokeOperation)Name()stringName 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 (*CreateSpokeOperation) Poll
func(op*CreateSpokeOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*networkconnectivitypb.Spoke,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 andthe 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 (*CreateSpokeOperation) Wait
func(op*CreateSpokeOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*networkconnectivitypb.Spoke,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.
CrossNetworkAutomationCallOptions
typeCrossNetworkAutomationCallOptionsstruct{ListServiceConnectionMaps[]gax.CallOptionGetServiceConnectionMap[]gax.CallOptionCreateServiceConnectionMap[]gax.CallOptionUpdateServiceConnectionMap[]gax.CallOptionDeleteServiceConnectionMap[]gax.CallOptionListServiceConnectionPolicies[]gax.CallOptionGetServiceConnectionPolicy[]gax.CallOptionCreateServiceConnectionPolicy[]gax.CallOptionUpdateServiceConnectionPolicy[]gax.CallOptionDeleteServiceConnectionPolicy[]gax.CallOptionListServiceClasses[]gax.CallOptionGetServiceClass[]gax.CallOptionUpdateServiceClass[]gax.CallOptionDeleteServiceClass[]gax.CallOptionGetServiceConnectionToken[]gax.CallOptionListServiceConnectionTokens[]gax.CallOptionCreateServiceConnectionToken[]gax.CallOptionDeleteServiceConnectionToken[]gax.CallOptionGetLocation[]gax.CallOptionListLocations[]gax.CallOptionGetIamPolicy[]gax.CallOptionSetIamPolicy[]gax.CallOptionTestIamPermissions[]gax.CallOptionCancelOperation[]gax.CallOptionDeleteOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOption}CrossNetworkAutomationCallOptions contains the retry settings for each method of CrossNetworkAutomationClient.
CrossNetworkAutomationClient
typeCrossNetworkAutomationClientstruct{// The call options for this service.CallOptions*CrossNetworkAutomationCallOptions// 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}CrossNetworkAutomationClient is a client for interacting with Network Connectivity API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The service for CrossNetworkAutomation resources.
func NewCrossNetworkAutomationClient
funcNewCrossNetworkAutomationClient(ctxcontext.Context,opts...option.ClientOption)(*CrossNetworkAutomationClient,error)NewCrossNetworkAutomationClient creates a new cross network automation service client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.
The service for CrossNetworkAutomation resources.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1")funcmain(){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_Optionsc,err:=networkconnectivity.NewCrossNetworkAutomationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func (*CrossNetworkAutomationClient) CancelOperation
func(c*CrossNetworkAutomationClient)CancelOperation(ctxcontext.Context,req*longrunningpb.CancelOperationRequest,opts...gax.CallOption)errorCancelOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1")funcmain(){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_Optionsc,err:=networkconnectivity.NewCrossNetworkAutomationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}}func (*CrossNetworkAutomationClient) Close
func(c*CrossNetworkAutomationClient)Close()errorClose closes the connection to the API service. The user should invoke this whenthe client is no longer required.
func (*CrossNetworkAutomationClient) Connection (deprecated)
func(c*CrossNetworkAutomationClient)Connection()*grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.
func (*CrossNetworkAutomationClient) CreateServiceConnectionMap
func(c*CrossNetworkAutomationClient)CreateServiceConnectionMap(ctxcontext.Context,req*networkconnectivitypb.CreateServiceConnectionMapRequest,opts...gax.CallOption)(*CreateServiceConnectionMapOperation,error)CreateServiceConnectionMap creates a new ServiceConnectionMap in a given project and location.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewCrossNetworkAutomationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.CreateServiceConnectionMapRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#CreateServiceConnectionMapRequest.}op,err:=c.CreateServiceConnectionMap(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*CrossNetworkAutomationClient) CreateServiceConnectionMapOperation
func(c*CrossNetworkAutomationClient)CreateServiceConnectionMapOperation(namestring)*CreateServiceConnectionMapOperationCreateServiceConnectionMapOperation returns a new CreateServiceConnectionMapOperation from a given name.The name must be that of a previously created CreateServiceConnectionMapOperation, possibly from a different process.
func (*CrossNetworkAutomationClient) CreateServiceConnectionPolicy
func(c*CrossNetworkAutomationClient)CreateServiceConnectionPolicy(ctxcontext.Context,req*networkconnectivitypb.CreateServiceConnectionPolicyRequest,opts...gax.CallOption)(*CreateServiceConnectionPolicyOperation,error)CreateServiceConnectionPolicy creates a new ServiceConnectionPolicy in a given project and location.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewCrossNetworkAutomationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.CreateServiceConnectionPolicyRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#CreateServiceConnectionPolicyRequest.}op,err:=c.CreateServiceConnectionPolicy(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*CrossNetworkAutomationClient) CreateServiceConnectionPolicyOperation
func(c*CrossNetworkAutomationClient)CreateServiceConnectionPolicyOperation(namestring)*CreateServiceConnectionPolicyOperationCreateServiceConnectionPolicyOperation returns a new CreateServiceConnectionPolicyOperation from a given name.The name must be that of a previously created CreateServiceConnectionPolicyOperation, possibly from a different process.
func (*CrossNetworkAutomationClient) CreateServiceConnectionToken
func(c*CrossNetworkAutomationClient)CreateServiceConnectionToken(ctxcontext.Context,req*networkconnectivitypb.CreateServiceConnectionTokenRequest,opts...gax.CallOption)(*CreateServiceConnectionTokenOperation,error)CreateServiceConnectionToken creates a new ServiceConnectionToken in a given project and location.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewCrossNetworkAutomationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.CreateServiceConnectionTokenRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#CreateServiceConnectionTokenRequest.}op,err:=c.CreateServiceConnectionToken(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*CrossNetworkAutomationClient) CreateServiceConnectionTokenOperation
func(c*CrossNetworkAutomationClient)CreateServiceConnectionTokenOperation(namestring)*CreateServiceConnectionTokenOperationCreateServiceConnectionTokenOperation returns a new CreateServiceConnectionTokenOperation from a given name.The name must be that of a previously created CreateServiceConnectionTokenOperation, possibly from a different process.
func (*CrossNetworkAutomationClient) DeleteOperation
func(c*CrossNetworkAutomationClient)DeleteOperation(ctxcontext.Context,req*longrunningpb.DeleteOperationRequest,opts...gax.CallOption)errorDeleteOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1")funcmain(){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_Optionsc,err:=networkconnectivity.NewCrossNetworkAutomationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}}func (*CrossNetworkAutomationClient) DeleteServiceClass
func(c*CrossNetworkAutomationClient)DeleteServiceClass(ctxcontext.Context,req*networkconnectivitypb.DeleteServiceClassRequest,opts...gax.CallOption)(*DeleteServiceClassOperation,error)DeleteServiceClass deletes a single ServiceClass.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewCrossNetworkAutomationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.DeleteServiceClassRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#DeleteServiceClassRequest.}op,err:=c.DeleteServiceClass(ctx,req)iferr!=nil{// TODO: Handle error.}err=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}}func (*CrossNetworkAutomationClient) DeleteServiceClassOperation
func(c*CrossNetworkAutomationClient)DeleteServiceClassOperation(namestring)*DeleteServiceClassOperationDeleteServiceClassOperation returns a new DeleteServiceClassOperation from a given name.The name must be that of a previously created DeleteServiceClassOperation, possibly from a different process.
func (*CrossNetworkAutomationClient) DeleteServiceConnectionMap
func(c*CrossNetworkAutomationClient)DeleteServiceConnectionMap(ctxcontext.Context,req*networkconnectivitypb.DeleteServiceConnectionMapRequest,opts...gax.CallOption)(*DeleteServiceConnectionMapOperation,error)DeleteServiceConnectionMap deletes a single ServiceConnectionMap.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewCrossNetworkAutomationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.DeleteServiceConnectionMapRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#DeleteServiceConnectionMapRequest.}op,err:=c.DeleteServiceConnectionMap(ctx,req)iferr!=nil{// TODO: Handle error.}err=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}}func (*CrossNetworkAutomationClient) DeleteServiceConnectionMapOperation
func(c*CrossNetworkAutomationClient)DeleteServiceConnectionMapOperation(namestring)*DeleteServiceConnectionMapOperationDeleteServiceConnectionMapOperation returns a new DeleteServiceConnectionMapOperation from a given name.The name must be that of a previously created DeleteServiceConnectionMapOperation, possibly from a different process.
func (*CrossNetworkAutomationClient) DeleteServiceConnectionPolicy
func(c*CrossNetworkAutomationClient)DeleteServiceConnectionPolicy(ctxcontext.Context,req*networkconnectivitypb.DeleteServiceConnectionPolicyRequest,opts...gax.CallOption)(*DeleteServiceConnectionPolicyOperation,error)DeleteServiceConnectionPolicy deletes a single ServiceConnectionPolicy.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewCrossNetworkAutomationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.DeleteServiceConnectionPolicyRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#DeleteServiceConnectionPolicyRequest.}op,err:=c.DeleteServiceConnectionPolicy(ctx,req)iferr!=nil{// TODO: Handle error.}err=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}}func (*CrossNetworkAutomationClient) DeleteServiceConnectionPolicyOperation
func(c*CrossNetworkAutomationClient)DeleteServiceConnectionPolicyOperation(namestring)*DeleteServiceConnectionPolicyOperationDeleteServiceConnectionPolicyOperation returns a new DeleteServiceConnectionPolicyOperation from a given name.The name must be that of a previously created DeleteServiceConnectionPolicyOperation, possibly from a different process.
func (*CrossNetworkAutomationClient) DeleteServiceConnectionToken
func(c*CrossNetworkAutomationClient)DeleteServiceConnectionToken(ctxcontext.Context,req*networkconnectivitypb.DeleteServiceConnectionTokenRequest,opts...gax.CallOption)(*DeleteServiceConnectionTokenOperation,error)DeleteServiceConnectionToken deletes a single ServiceConnectionToken.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewCrossNetworkAutomationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.DeleteServiceConnectionTokenRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#DeleteServiceConnectionTokenRequest.}op,err:=c.DeleteServiceConnectionToken(ctx,req)iferr!=nil{// TODO: Handle error.}err=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}}func (*CrossNetworkAutomationClient) DeleteServiceConnectionTokenOperation
func(c*CrossNetworkAutomationClient)DeleteServiceConnectionTokenOperation(namestring)*DeleteServiceConnectionTokenOperationDeleteServiceConnectionTokenOperation returns a new DeleteServiceConnectionTokenOperation from a given name.The name must be that of a previously created DeleteServiceConnectionTokenOperation, possibly from a different process.
func (*CrossNetworkAutomationClient) GetIamPolicy
func(c*CrossNetworkAutomationClient)GetIamPolicy(ctxcontext.Context,req*iampb.GetIamPolicyRequest,opts...gax.CallOption)(*iampb.Policy,error)GetIamPolicy gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.
Example
packagemainimport("context"iampb"cloud.google.com/go/iam/apiv1/iampb"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1")funcmain(){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_Optionsc,err:=networkconnectivity.NewCrossNetworkAutomationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&iampb.GetIamPolicyRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#GetIamPolicyRequest.}resp,err:=c.GetIamPolicy(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*CrossNetworkAutomationClient) GetLocation
func(c*CrossNetworkAutomationClient)GetLocation(ctxcontext.Context,req*locationpb.GetLocationRequest,opts...gax.CallOption)(*locationpb.Location,error)GetLocation gets information about a location.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"locationpb"google.golang.org/genproto/googleapis/cloud/location")funcmain(){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_Optionsc,err:=networkconnectivity.NewCrossNetworkAutomationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*CrossNetworkAutomationClient) GetOperation
func(c*CrossNetworkAutomationClient)GetOperation(ctxcontext.Context,req*longrunningpb.GetOperationRequest,opts...gax.CallOption)(*longrunningpb.Operation,error)GetOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1")funcmain(){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_Optionsc,err:=networkconnectivity.NewCrossNetworkAutomationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*CrossNetworkAutomationClient) GetServiceClass
func(c*CrossNetworkAutomationClient)GetServiceClass(ctxcontext.Context,req*networkconnectivitypb.GetServiceClassRequest,opts...gax.CallOption)(*networkconnectivitypb.ServiceClass,error)GetServiceClass gets details of a single ServiceClass.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewCrossNetworkAutomationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.GetServiceClassRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#GetServiceClassRequest.}resp,err:=c.GetServiceClass(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*CrossNetworkAutomationClient) GetServiceConnectionMap
func(c*CrossNetworkAutomationClient)GetServiceConnectionMap(ctxcontext.Context,req*networkconnectivitypb.GetServiceConnectionMapRequest,opts...gax.CallOption)(*networkconnectivitypb.ServiceConnectionMap,error)GetServiceConnectionMap gets details of a single ServiceConnectionMap.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewCrossNetworkAutomationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.GetServiceConnectionMapRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#GetServiceConnectionMapRequest.}resp,err:=c.GetServiceConnectionMap(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*CrossNetworkAutomationClient) GetServiceConnectionPolicy
func(c*CrossNetworkAutomationClient)GetServiceConnectionPolicy(ctxcontext.Context,req*networkconnectivitypb.GetServiceConnectionPolicyRequest,opts...gax.CallOption)(*networkconnectivitypb.ServiceConnectionPolicy,error)GetServiceConnectionPolicy gets details of a single ServiceConnectionPolicy.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewCrossNetworkAutomationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.GetServiceConnectionPolicyRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#GetServiceConnectionPolicyRequest.}resp,err:=c.GetServiceConnectionPolicy(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*CrossNetworkAutomationClient) GetServiceConnectionToken
func(c*CrossNetworkAutomationClient)GetServiceConnectionToken(ctxcontext.Context,req*networkconnectivitypb.GetServiceConnectionTokenRequest,opts...gax.CallOption)(*networkconnectivitypb.ServiceConnectionToken,error)GetServiceConnectionToken gets details of a single ServiceConnectionToken.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewCrossNetworkAutomationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.GetServiceConnectionTokenRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#GetServiceConnectionTokenRequest.}resp,err:=c.GetServiceConnectionToken(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*CrossNetworkAutomationClient) ListLocations
func(c*CrossNetworkAutomationClient)ListLocations(ctxcontext.Context,req*locationpb.ListLocationsRequest,opts...gax.CallOption)*LocationIteratorListLocations lists information about the supported locations for this service.
Examples
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1""google.golang.org/api/iterator"locationpb"google.golang.org/genproto/googleapis/cloud/location")funcmain(){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_Optionsc,err:=networkconnectivity.NewCrossNetworkAutomationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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()iferr==iterator.Done{break}iferr!=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
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"locationpb"google.golang.org/genproto/googleapis/cloud/location")funcmain(){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_Optionsc,err:=networkconnectivity.NewCrossNetworkAutomationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&locationpb.ListLocationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.}forresp,err:=rangec.ListLocations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*CrossNetworkAutomationClient) ListOperations
func(c*CrossNetworkAutomationClient)ListOperations(ctxcontext.Context,req*longrunningpb.ListOperationsRequest,opts...gax.CallOption)*OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1""google.golang.org/api/iterator")funcmain(){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_Optionsc,err:=networkconnectivity.NewCrossNetworkAutomationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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()iferr==iterator.Done{break}iferr!=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
packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1")funcmain(){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_Optionsc,err:=networkconnectivity.NewCrossNetworkAutomationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}forresp,err:=rangec.ListOperations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*CrossNetworkAutomationClient) ListServiceClasses
func(c*CrossNetworkAutomationClient)ListServiceClasses(ctxcontext.Context,req*networkconnectivitypb.ListServiceClassesRequest,opts...gax.CallOption)*ServiceClassIteratorListServiceClasses lists ServiceClasses in a given project and location.
Examples
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb""google.golang.org/api/iterator")funcmain(){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_Optionsc,err:=networkconnectivity.NewCrossNetworkAutomationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.ListServiceClassesRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#ListServiceClassesRequest.}it:=c.ListServiceClasses(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=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.(*networkconnectivitypb.ListServiceClassesResponse)}}all
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewCrossNetworkAutomationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.ListServiceClassesRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#ListServiceClassesRequest.}forresp,err:=rangec.ListServiceClasses(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*CrossNetworkAutomationClient) ListServiceConnectionMaps
func(c*CrossNetworkAutomationClient)ListServiceConnectionMaps(ctxcontext.Context,req*networkconnectivitypb.ListServiceConnectionMapsRequest,opts...gax.CallOption)*ServiceConnectionMapIteratorListServiceConnectionMaps lists ServiceConnectionMaps in a given project and location.
Examples
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb""google.golang.org/api/iterator")funcmain(){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_Optionsc,err:=networkconnectivity.NewCrossNetworkAutomationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.ListServiceConnectionMapsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#ListServiceConnectionMapsRequest.}it:=c.ListServiceConnectionMaps(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=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.(*networkconnectivitypb.ListServiceConnectionMapsResponse)}}all
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewCrossNetworkAutomationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.ListServiceConnectionMapsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#ListServiceConnectionMapsRequest.}forresp,err:=rangec.ListServiceConnectionMaps(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*CrossNetworkAutomationClient) ListServiceConnectionPolicies
func(c*CrossNetworkAutomationClient)ListServiceConnectionPolicies(ctxcontext.Context,req*networkconnectivitypb.ListServiceConnectionPoliciesRequest,opts...gax.CallOption)*ServiceConnectionPolicyIteratorListServiceConnectionPolicies lists ServiceConnectionPolicies in a given project and location.
Examples
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb""google.golang.org/api/iterator")funcmain(){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_Optionsc,err:=networkconnectivity.NewCrossNetworkAutomationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.ListServiceConnectionPoliciesRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#ListServiceConnectionPoliciesRequest.}it:=c.ListServiceConnectionPolicies(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=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.(*networkconnectivitypb.ListServiceConnectionPoliciesResponse)}}all
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewCrossNetworkAutomationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.ListServiceConnectionPoliciesRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#ListServiceConnectionPoliciesRequest.}forresp,err:=rangec.ListServiceConnectionPolicies(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*CrossNetworkAutomationClient) ListServiceConnectionTokens
func(c*CrossNetworkAutomationClient)ListServiceConnectionTokens(ctxcontext.Context,req*networkconnectivitypb.ListServiceConnectionTokensRequest,opts...gax.CallOption)*ServiceConnectionTokenIteratorListServiceConnectionTokens lists ServiceConnectionTokens in a given project and location.
Examples
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb""google.golang.org/api/iterator")funcmain(){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_Optionsc,err:=networkconnectivity.NewCrossNetworkAutomationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.ListServiceConnectionTokensRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#ListServiceConnectionTokensRequest.}it:=c.ListServiceConnectionTokens(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=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.(*networkconnectivitypb.ListServiceConnectionTokensResponse)}}all
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewCrossNetworkAutomationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.ListServiceConnectionTokensRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#ListServiceConnectionTokensRequest.}forresp,err:=rangec.ListServiceConnectionTokens(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*CrossNetworkAutomationClient) SetIamPolicy
func(c*CrossNetworkAutomationClient)SetIamPolicy(ctxcontext.Context,req*iampb.SetIamPolicyRequest,opts...gax.CallOption)(*iampb.Policy,error)SetIamPolicy sets the access control policy on the specified resource. Replacesany existing policy.
Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.
Example
packagemainimport("context"iampb"cloud.google.com/go/iam/apiv1/iampb"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1")funcmain(){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_Optionsc,err:=networkconnectivity.NewCrossNetworkAutomationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&iampb.SetIamPolicyRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#SetIamPolicyRequest.}resp,err:=c.SetIamPolicy(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*CrossNetworkAutomationClient) TestIamPermissions
func(c*CrossNetworkAutomationClient)TestIamPermissions(ctxcontext.Context,req*iampb.TestIamPermissionsRequest,opts...gax.CallOption)(*iampb.TestIamPermissionsResponse,error)TestIamPermissions returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a NOT_FOUND error.
Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may “fail open” without warning.
Example
packagemainimport("context"iampb"cloud.google.com/go/iam/apiv1/iampb"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1")funcmain(){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_Optionsc,err:=networkconnectivity.NewCrossNetworkAutomationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&iampb.TestIamPermissionsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#TestIamPermissionsRequest.}resp,err:=c.TestIamPermissions(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*CrossNetworkAutomationClient) UpdateServiceClass
func(c*CrossNetworkAutomationClient)UpdateServiceClass(ctxcontext.Context,req*networkconnectivitypb.UpdateServiceClassRequest,opts...gax.CallOption)(*UpdateServiceClassOperation,error)UpdateServiceClass updates the parameters of a single ServiceClass.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewCrossNetworkAutomationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.UpdateServiceClassRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#UpdateServiceClassRequest.}op,err:=c.UpdateServiceClass(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*CrossNetworkAutomationClient) UpdateServiceClassOperation
func(c*CrossNetworkAutomationClient)UpdateServiceClassOperation(namestring)*UpdateServiceClassOperationUpdateServiceClassOperation returns a new UpdateServiceClassOperation from a given name.The name must be that of a previously created UpdateServiceClassOperation, possibly from a different process.
func (*CrossNetworkAutomationClient) UpdateServiceConnectionMap
func(c*CrossNetworkAutomationClient)UpdateServiceConnectionMap(ctxcontext.Context,req*networkconnectivitypb.UpdateServiceConnectionMapRequest,opts...gax.CallOption)(*UpdateServiceConnectionMapOperation,error)UpdateServiceConnectionMap updates the parameters of a single ServiceConnectionMap.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewCrossNetworkAutomationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.UpdateServiceConnectionMapRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#UpdateServiceConnectionMapRequest.}op,err:=c.UpdateServiceConnectionMap(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*CrossNetworkAutomationClient) UpdateServiceConnectionMapOperation
func(c*CrossNetworkAutomationClient)UpdateServiceConnectionMapOperation(namestring)*UpdateServiceConnectionMapOperationUpdateServiceConnectionMapOperation returns a new UpdateServiceConnectionMapOperation from a given name.The name must be that of a previously created UpdateServiceConnectionMapOperation, possibly from a different process.
func (*CrossNetworkAutomationClient) UpdateServiceConnectionPolicy
func(c*CrossNetworkAutomationClient)UpdateServiceConnectionPolicy(ctxcontext.Context,req*networkconnectivitypb.UpdateServiceConnectionPolicyRequest,opts...gax.CallOption)(*UpdateServiceConnectionPolicyOperation,error)UpdateServiceConnectionPolicy updates the parameters of a single ServiceConnectionPolicy.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewCrossNetworkAutomationClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.UpdateServiceConnectionPolicyRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#UpdateServiceConnectionPolicyRequest.}op,err:=c.UpdateServiceConnectionPolicy(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*CrossNetworkAutomationClient) UpdateServiceConnectionPolicyOperation
func(c*CrossNetworkAutomationClient)UpdateServiceConnectionPolicyOperation(namestring)*UpdateServiceConnectionPolicyOperationUpdateServiceConnectionPolicyOperation returns a new UpdateServiceConnectionPolicyOperation from a given name.The name must be that of a previously created UpdateServiceConnectionPolicyOperation, possibly from a different process.
DataTransferCallOptions
typeDataTransferCallOptionsstruct{ListMulticloudDataTransferConfigs[]gax.CallOptionGetMulticloudDataTransferConfig[]gax.CallOptionCreateMulticloudDataTransferConfig[]gax.CallOptionUpdateMulticloudDataTransferConfig[]gax.CallOptionDeleteMulticloudDataTransferConfig[]gax.CallOptionListDestinations[]gax.CallOptionGetDestination[]gax.CallOptionCreateDestination[]gax.CallOptionUpdateDestination[]gax.CallOptionDeleteDestination[]gax.CallOptionGetMulticloudDataTransferSupportedService[]gax.CallOptionListMulticloudDataTransferSupportedServices[]gax.CallOptionGetLocation[]gax.CallOptionListLocations[]gax.CallOptionGetIamPolicy[]gax.CallOptionSetIamPolicy[]gax.CallOptionTestIamPermissions[]gax.CallOptionCancelOperation[]gax.CallOptionDeleteOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOption}DataTransferCallOptions contains the retry settings for each method of DataTransferClient.
DataTransferClient
typeDataTransferClientstruct{// The call options for this service.CallOptions*DataTransferCallOptions// 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}DataTransferClient is a client for interacting with Network Connectivity API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
DataTransferService is the service for the Data Transfer API.
func NewDataTransferClient
funcNewDataTransferClient(ctxcontext.Context,opts...option.ClientOption)(*DataTransferClient,error)NewDataTransferClient creates a new data transfer service client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.
DataTransferService is the service for the Data Transfer API.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1")funcmain(){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_Optionsc,err:=networkconnectivity.NewDataTransferClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func (*DataTransferClient) CancelOperation
func(c*DataTransferClient)CancelOperation(ctxcontext.Context,req*longrunningpb.CancelOperationRequest,opts...gax.CallOption)errorCancelOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1")funcmain(){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_Optionsc,err:=networkconnectivity.NewDataTransferClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}}func (*DataTransferClient) Close
func(c*DataTransferClient)Close()errorClose closes the connection to the API service. The user should invoke this whenthe client is no longer required.
func (*DataTransferClient) Connection (deprecated)
func(c*DataTransferClient)Connection()*grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.
func (*DataTransferClient) CreateDestination
func(c*DataTransferClient)CreateDestination(ctxcontext.Context,req*networkconnectivitypb.CreateDestinationRequest,opts...gax.CallOption)(*CreateDestinationOperation,error)CreateDestination creates a Destination resource in a specified project and location.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewDataTransferClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.CreateDestinationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#CreateDestinationRequest.}op,err:=c.CreateDestination(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*DataTransferClient) CreateDestinationOperation
func(c*DataTransferClient)CreateDestinationOperation(namestring)*CreateDestinationOperationCreateDestinationOperation returns a new CreateDestinationOperation from a given name.The name must be that of a previously created CreateDestinationOperation, possibly from a different process.
func (*DataTransferClient) CreateMulticloudDataTransferConfig
func(c*DataTransferClient)CreateMulticloudDataTransferConfig(ctxcontext.Context,req*networkconnectivitypb.CreateMulticloudDataTransferConfigRequest,opts...gax.CallOption)(*CreateMulticloudDataTransferConfigOperation,error)CreateMulticloudDataTransferConfig creates a MulticloudDataTransferConfig resource in a specified projectand location.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewDataTransferClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.CreateMulticloudDataTransferConfigRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#CreateMulticloudDataTransferConfigRequest.}op,err:=c.CreateMulticloudDataTransferConfig(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*DataTransferClient) CreateMulticloudDataTransferConfigOperation
func(c*DataTransferClient)CreateMulticloudDataTransferConfigOperation(namestring)*CreateMulticloudDataTransferConfigOperationCreateMulticloudDataTransferConfigOperation returns a new CreateMulticloudDataTransferConfigOperation from a given name.The name must be that of a previously created CreateMulticloudDataTransferConfigOperation, possibly from a different process.
func (*DataTransferClient) DeleteDestination
func(c*DataTransferClient)DeleteDestination(ctxcontext.Context,req*networkconnectivitypb.DeleteDestinationRequest,opts...gax.CallOption)(*DeleteDestinationOperation,error)DeleteDestination deletes a Destination resource.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewDataTransferClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.DeleteDestinationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#DeleteDestinationRequest.}op,err:=c.DeleteDestination(ctx,req)iferr!=nil{// TODO: Handle error.}err=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}}func (*DataTransferClient) DeleteDestinationOperation
func(c*DataTransferClient)DeleteDestinationOperation(namestring)*DeleteDestinationOperationDeleteDestinationOperation returns a new DeleteDestinationOperation from a given name.The name must be that of a previously created DeleteDestinationOperation, possibly from a different process.
func (*DataTransferClient) DeleteMulticloudDataTransferConfig
func(c*DataTransferClient)DeleteMulticloudDataTransferConfig(ctxcontext.Context,req*networkconnectivitypb.DeleteMulticloudDataTransferConfigRequest,opts...gax.CallOption)(*DeleteMulticloudDataTransferConfigOperation,error)DeleteMulticloudDataTransferConfig deletes a MulticloudDataTransferConfig resource.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewDataTransferClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.DeleteMulticloudDataTransferConfigRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#DeleteMulticloudDataTransferConfigRequest.}op,err:=c.DeleteMulticloudDataTransferConfig(ctx,req)iferr!=nil{// TODO: Handle error.}err=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}}func (*DataTransferClient) DeleteMulticloudDataTransferConfigOperation
func(c*DataTransferClient)DeleteMulticloudDataTransferConfigOperation(namestring)*DeleteMulticloudDataTransferConfigOperationDeleteMulticloudDataTransferConfigOperation returns a new DeleteMulticloudDataTransferConfigOperation from a given name.The name must be that of a previously created DeleteMulticloudDataTransferConfigOperation, possibly from a different process.
func (*DataTransferClient) DeleteOperation
func(c*DataTransferClient)DeleteOperation(ctxcontext.Context,req*longrunningpb.DeleteOperationRequest,opts...gax.CallOption)errorDeleteOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1")funcmain(){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_Optionsc,err:=networkconnectivity.NewDataTransferClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}}func (*DataTransferClient) GetDestination
func(c*DataTransferClient)GetDestination(ctxcontext.Context,req*networkconnectivitypb.GetDestinationRequest,opts...gax.CallOption)(*networkconnectivitypb.Destination,error)GetDestination gets the details of a Destination resource.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewDataTransferClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.GetDestinationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#GetDestinationRequest.}resp,err:=c.GetDestination(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*DataTransferClient) GetIamPolicy
func(c*DataTransferClient)GetIamPolicy(ctxcontext.Context,req*iampb.GetIamPolicyRequest,opts...gax.CallOption)(*iampb.Policy,error)GetIamPolicy gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.
Example
packagemainimport("context"iampb"cloud.google.com/go/iam/apiv1/iampb"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1")funcmain(){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_Optionsc,err:=networkconnectivity.NewDataTransferClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&iampb.GetIamPolicyRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#GetIamPolicyRequest.}resp,err:=c.GetIamPolicy(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*DataTransferClient) GetLocation
func(c*DataTransferClient)GetLocation(ctxcontext.Context,req*locationpb.GetLocationRequest,opts...gax.CallOption)(*locationpb.Location,error)GetLocation gets information about a location.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"locationpb"google.golang.org/genproto/googleapis/cloud/location")funcmain(){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_Optionsc,err:=networkconnectivity.NewDataTransferClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*DataTransferClient) GetMulticloudDataTransferConfig
func(c*DataTransferClient)GetMulticloudDataTransferConfig(ctxcontext.Context,req*networkconnectivitypb.GetMulticloudDataTransferConfigRequest,opts...gax.CallOption)(*networkconnectivitypb.MulticloudDataTransferConfig,error)GetMulticloudDataTransferConfig gets the details of a MulticloudDataTransferConfig resource.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewDataTransferClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.GetMulticloudDataTransferConfigRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#GetMulticloudDataTransferConfigRequest.}resp,err:=c.GetMulticloudDataTransferConfig(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*DataTransferClient) GetMulticloudDataTransferSupportedService
func(c*DataTransferClient)GetMulticloudDataTransferSupportedService(ctxcontext.Context,req*networkconnectivitypb.GetMulticloudDataTransferSupportedServiceRequest,opts...gax.CallOption)(*networkconnectivitypb.MulticloudDataTransferSupportedService,error)GetMulticloudDataTransferSupportedService gets the details of a service that is supported for Data TransferEssentials.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewDataTransferClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.GetMulticloudDataTransferSupportedServiceRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#GetMulticloudDataTransferSupportedServiceRequest.}resp,err:=c.GetMulticloudDataTransferSupportedService(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*DataTransferClient) GetOperation
func(c*DataTransferClient)GetOperation(ctxcontext.Context,req*longrunningpb.GetOperationRequest,opts...gax.CallOption)(*longrunningpb.Operation,error)GetOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1")funcmain(){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_Optionsc,err:=networkconnectivity.NewDataTransferClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*DataTransferClient) ListDestinations
func(c*DataTransferClient)ListDestinations(ctxcontext.Context,req*networkconnectivitypb.ListDestinationsRequest,opts...gax.CallOption)*DestinationIteratorListDestinations lists the Destination resources in a specified project and location.
Examples
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb""google.golang.org/api/iterator")funcmain(){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_Optionsc,err:=networkconnectivity.NewDataTransferClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.ListDestinationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#ListDestinationsRequest.}it:=c.ListDestinations(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=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.(*networkconnectivitypb.ListDestinationsResponse)}}all
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewDataTransferClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.ListDestinationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#ListDestinationsRequest.}forresp,err:=rangec.ListDestinations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*DataTransferClient) ListLocations
func(c*DataTransferClient)ListLocations(ctxcontext.Context,req*locationpb.ListLocationsRequest,opts...gax.CallOption)*LocationIteratorListLocations lists information about the supported locations for this service.
Examples
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1""google.golang.org/api/iterator"locationpb"google.golang.org/genproto/googleapis/cloud/location")funcmain(){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_Optionsc,err:=networkconnectivity.NewDataTransferClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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()iferr==iterator.Done{break}iferr!=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
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"locationpb"google.golang.org/genproto/googleapis/cloud/location")funcmain(){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_Optionsc,err:=networkconnectivity.NewDataTransferClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&locationpb.ListLocationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.}forresp,err:=rangec.ListLocations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*DataTransferClient) ListMulticloudDataTransferConfigs
func(c*DataTransferClient)ListMulticloudDataTransferConfigs(ctxcontext.Context,req*networkconnectivitypb.ListMulticloudDataTransferConfigsRequest,opts...gax.CallOption)*MulticloudDataTransferConfigIteratorListMulticloudDataTransferConfigs lists the MulticloudDataTransferConfig resources in a specified projectand location.
Examples
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb""google.golang.org/api/iterator")funcmain(){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_Optionsc,err:=networkconnectivity.NewDataTransferClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.ListMulticloudDataTransferConfigsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#ListMulticloudDataTransferConfigsRequest.}it:=c.ListMulticloudDataTransferConfigs(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=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.(*networkconnectivitypb.ListMulticloudDataTransferConfigsResponse)}}all
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewDataTransferClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.ListMulticloudDataTransferConfigsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#ListMulticloudDataTransferConfigsRequest.}forresp,err:=rangec.ListMulticloudDataTransferConfigs(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*DataTransferClient) ListMulticloudDataTransferSupportedServices
func(c*DataTransferClient)ListMulticloudDataTransferSupportedServices(ctxcontext.Context,req*networkconnectivitypb.ListMulticloudDataTransferSupportedServicesRequest,opts...gax.CallOption)*MulticloudDataTransferSupportedServiceIteratorListMulticloudDataTransferSupportedServices lists the services in the project for a region that are supported forData Transfer Essentials.
Examples
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb""google.golang.org/api/iterator")funcmain(){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_Optionsc,err:=networkconnectivity.NewDataTransferClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.ListMulticloudDataTransferSupportedServicesRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#ListMulticloudDataTransferSupportedServicesRequest.}it:=c.ListMulticloudDataTransferSupportedServices(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=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.(*networkconnectivitypb.ListMulticloudDataTransferSupportedServicesResponse)}}all
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewDataTransferClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.ListMulticloudDataTransferSupportedServicesRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#ListMulticloudDataTransferSupportedServicesRequest.}forresp,err:=rangec.ListMulticloudDataTransferSupportedServices(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*DataTransferClient) ListOperations
func(c*DataTransferClient)ListOperations(ctxcontext.Context,req*longrunningpb.ListOperationsRequest,opts...gax.CallOption)*OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1""google.golang.org/api/iterator")funcmain(){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_Optionsc,err:=networkconnectivity.NewDataTransferClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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()iferr==iterator.Done{break}iferr!=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
packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1")funcmain(){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_Optionsc,err:=networkconnectivity.NewDataTransferClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}forresp,err:=rangec.ListOperations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*DataTransferClient) SetIamPolicy
func(c*DataTransferClient)SetIamPolicy(ctxcontext.Context,req*iampb.SetIamPolicyRequest,opts...gax.CallOption)(*iampb.Policy,error)SetIamPolicy sets the access control policy on the specified resource. Replacesany existing policy.
Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.
Example
packagemainimport("context"iampb"cloud.google.com/go/iam/apiv1/iampb"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1")funcmain(){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_Optionsc,err:=networkconnectivity.NewDataTransferClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&iampb.SetIamPolicyRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#SetIamPolicyRequest.}resp,err:=c.SetIamPolicy(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*DataTransferClient) TestIamPermissions
func(c*DataTransferClient)TestIamPermissions(ctxcontext.Context,req*iampb.TestIamPermissionsRequest,opts...gax.CallOption)(*iampb.TestIamPermissionsResponse,error)TestIamPermissions returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a NOT_FOUND error.
Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may “fail open” without warning.
Example
packagemainimport("context"iampb"cloud.google.com/go/iam/apiv1/iampb"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1")funcmain(){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_Optionsc,err:=networkconnectivity.NewDataTransferClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&iampb.TestIamPermissionsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#TestIamPermissionsRequest.}resp,err:=c.TestIamPermissions(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*DataTransferClient) UpdateDestination
func(c*DataTransferClient)UpdateDestination(ctxcontext.Context,req*networkconnectivitypb.UpdateDestinationRequest,opts...gax.CallOption)(*UpdateDestinationOperation,error)UpdateDestination updates a Destination resource in a specified project and location.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewDataTransferClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.UpdateDestinationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#UpdateDestinationRequest.}op,err:=c.UpdateDestination(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*DataTransferClient) UpdateDestinationOperation
func(c*DataTransferClient)UpdateDestinationOperation(namestring)*UpdateDestinationOperationUpdateDestinationOperation returns a new UpdateDestinationOperation from a given name.The name must be that of a previously created UpdateDestinationOperation, possibly from a different process.
func (*DataTransferClient) UpdateMulticloudDataTransferConfig
func(c*DataTransferClient)UpdateMulticloudDataTransferConfig(ctxcontext.Context,req*networkconnectivitypb.UpdateMulticloudDataTransferConfigRequest,opts...gax.CallOption)(*UpdateMulticloudDataTransferConfigOperation,error)UpdateMulticloudDataTransferConfig updates a MulticloudDataTransferConfig resource in a specified projectand location.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewDataTransferClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.UpdateMulticloudDataTransferConfigRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#UpdateMulticloudDataTransferConfigRequest.}op,err:=c.UpdateMulticloudDataTransferConfig(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*DataTransferClient) UpdateMulticloudDataTransferConfigOperation
func(c*DataTransferClient)UpdateMulticloudDataTransferConfigOperation(namestring)*UpdateMulticloudDataTransferConfigOperationUpdateMulticloudDataTransferConfigOperation returns a new UpdateMulticloudDataTransferConfigOperation from a given name.The name must be that of a previously created UpdateMulticloudDataTransferConfigOperation, possibly from a different process.
DeleteDestinationOperation
typeDeleteDestinationOperationstruct{// contains filtered or unexported fields}DeleteDestinationOperation manages a long-running operation from DeleteDestination.
func (*DeleteDestinationOperation) Done
func(op*DeleteDestinationOperation)Done()boolDone reports whether the long-running operation has completed.
func (*DeleteDestinationOperation) Metadata
func(op*DeleteDestinationOperation)Metadata()(*networkconnectivitypb.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 (*DeleteDestinationOperation) Name
func(op*DeleteDestinationOperation)Name()stringName 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 (*DeleteDestinationOperation) Poll
func(op*DeleteDestinationOperation)Poll(ctxcontext.Context,opts...gax.CallOption)errorPoll 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 andthe 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 (*DeleteDestinationOperation) Wait
func(op*DeleteDestinationOperation)Wait(ctxcontext.Context,opts...gax.CallOption)errorWait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
DeleteHubOperation
typeDeleteHubOperationstruct{// contains filtered or unexported fields}DeleteHubOperation manages a long-running operation from DeleteHub.
func (*DeleteHubOperation) Done
func(op*DeleteHubOperation)Done()boolDone reports whether the long-running operation has completed.
func (*DeleteHubOperation) Metadata
func(op*DeleteHubOperation)Metadata()(*networkconnectivitypb.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 (*DeleteHubOperation) Name
func(op*DeleteHubOperation)Name()stringName 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 (*DeleteHubOperation) Poll
func(op*DeleteHubOperation)Poll(ctxcontext.Context,opts...gax.CallOption)errorPoll 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 andthe 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 (*DeleteHubOperation) Wait
func(op*DeleteHubOperation)Wait(ctxcontext.Context,opts...gax.CallOption)errorWait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
DeleteInternalRangeOperation
typeDeleteInternalRangeOperationstruct{// contains filtered or unexported fields}DeleteInternalRangeOperation manages a long-running operation from DeleteInternalRange.
func (*DeleteInternalRangeOperation) Done
func(op*DeleteInternalRangeOperation)Done()boolDone reports whether the long-running operation has completed.
func (*DeleteInternalRangeOperation) Metadata
func(op*DeleteInternalRangeOperation)Metadata()(*networkconnectivitypb.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 (*DeleteInternalRangeOperation) Name
func(op*DeleteInternalRangeOperation)Name()stringName 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 (*DeleteInternalRangeOperation) Poll
func(op*DeleteInternalRangeOperation)Poll(ctxcontext.Context,opts...gax.CallOption)errorPoll 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 andthe 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 (*DeleteInternalRangeOperation) Wait
func(op*DeleteInternalRangeOperation)Wait(ctxcontext.Context,opts...gax.CallOption)errorWait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
DeleteMulticloudDataTransferConfigOperation
typeDeleteMulticloudDataTransferConfigOperationstruct{// contains filtered or unexported fields}DeleteMulticloudDataTransferConfigOperation manages a long-running operation from DeleteMulticloudDataTransferConfig.
func (*DeleteMulticloudDataTransferConfigOperation) Done
func(op*DeleteMulticloudDataTransferConfigOperation)Done()boolDone reports whether the long-running operation has completed.
func (*DeleteMulticloudDataTransferConfigOperation) Metadata
func(op*DeleteMulticloudDataTransferConfigOperation)Metadata()(*networkconnectivitypb.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 (*DeleteMulticloudDataTransferConfigOperation) Name
func(op*DeleteMulticloudDataTransferConfigOperation)Name()stringName 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 (*DeleteMulticloudDataTransferConfigOperation) Poll
func(op*DeleteMulticloudDataTransferConfigOperation)Poll(ctxcontext.Context,opts...gax.CallOption)errorPoll 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 andthe 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 (*DeleteMulticloudDataTransferConfigOperation) Wait
func(op*DeleteMulticloudDataTransferConfigOperation)Wait(ctxcontext.Context,opts...gax.CallOption)errorWait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
DeletePolicyBasedRouteOperation
typeDeletePolicyBasedRouteOperationstruct{// contains filtered or unexported fields}DeletePolicyBasedRouteOperation manages a long-running operation from DeletePolicyBasedRoute.
func (*DeletePolicyBasedRouteOperation) Done
func(op*DeletePolicyBasedRouteOperation)Done()boolDone reports whether the long-running operation has completed.
func (*DeletePolicyBasedRouteOperation) Metadata
func(op*DeletePolicyBasedRouteOperation)Metadata()(*networkconnectivitypb.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 (*DeletePolicyBasedRouteOperation) Name
func(op*DeletePolicyBasedRouteOperation)Name()stringName 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 (*DeletePolicyBasedRouteOperation) Poll
func(op*DeletePolicyBasedRouteOperation)Poll(ctxcontext.Context,opts...gax.CallOption)errorPoll 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 andthe 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 (*DeletePolicyBasedRouteOperation) Wait
func(op*DeletePolicyBasedRouteOperation)Wait(ctxcontext.Context,opts...gax.CallOption)errorWait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
DeleteServiceClassOperation
typeDeleteServiceClassOperationstruct{// contains filtered or unexported fields}DeleteServiceClassOperation manages a long-running operation from DeleteServiceClass.
func (*DeleteServiceClassOperation) Done
func(op*DeleteServiceClassOperation)Done()boolDone reports whether the long-running operation has completed.
func (*DeleteServiceClassOperation) Metadata
func(op*DeleteServiceClassOperation)Metadata()(*networkconnectivitypb.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 (*DeleteServiceClassOperation) Name
func(op*DeleteServiceClassOperation)Name()stringName 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 (*DeleteServiceClassOperation) Poll
func(op*DeleteServiceClassOperation)Poll(ctxcontext.Context,opts...gax.CallOption)errorPoll 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 andthe 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 (*DeleteServiceClassOperation) Wait
func(op*DeleteServiceClassOperation)Wait(ctxcontext.Context,opts...gax.CallOption)errorWait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
DeleteServiceConnectionMapOperation
typeDeleteServiceConnectionMapOperationstruct{// contains filtered or unexported fields}DeleteServiceConnectionMapOperation manages a long-running operation from DeleteServiceConnectionMap.
func (*DeleteServiceConnectionMapOperation) Done
func(op*DeleteServiceConnectionMapOperation)Done()boolDone reports whether the long-running operation has completed.
func (*DeleteServiceConnectionMapOperation) Metadata
func(op*DeleteServiceConnectionMapOperation)Metadata()(*networkconnectivitypb.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 (*DeleteServiceConnectionMapOperation) Name
func(op*DeleteServiceConnectionMapOperation)Name()stringName 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 (*DeleteServiceConnectionMapOperation) Poll
func(op*DeleteServiceConnectionMapOperation)Poll(ctxcontext.Context,opts...gax.CallOption)errorPoll 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 andthe 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 (*DeleteServiceConnectionMapOperation) Wait
func(op*DeleteServiceConnectionMapOperation)Wait(ctxcontext.Context,opts...gax.CallOption)errorWait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
DeleteServiceConnectionPolicyOperation
typeDeleteServiceConnectionPolicyOperationstruct{// contains filtered or unexported fields}DeleteServiceConnectionPolicyOperation manages a long-running operation from DeleteServiceConnectionPolicy.
func (*DeleteServiceConnectionPolicyOperation) Done
func(op*DeleteServiceConnectionPolicyOperation)Done()boolDone reports whether the long-running operation has completed.
func (*DeleteServiceConnectionPolicyOperation) Metadata
func(op*DeleteServiceConnectionPolicyOperation)Metadata()(*networkconnectivitypb.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 (*DeleteServiceConnectionPolicyOperation) Name
func(op*DeleteServiceConnectionPolicyOperation)Name()stringName 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 (*DeleteServiceConnectionPolicyOperation) Poll
func(op*DeleteServiceConnectionPolicyOperation)Poll(ctxcontext.Context,opts...gax.CallOption)errorPoll 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 andthe 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 (*DeleteServiceConnectionPolicyOperation) Wait
func(op*DeleteServiceConnectionPolicyOperation)Wait(ctxcontext.Context,opts...gax.CallOption)errorWait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
DeleteServiceConnectionTokenOperation
typeDeleteServiceConnectionTokenOperationstruct{// contains filtered or unexported fields}DeleteServiceConnectionTokenOperation manages a long-running operation from DeleteServiceConnectionToken.
func (*DeleteServiceConnectionTokenOperation) Done
func(op*DeleteServiceConnectionTokenOperation)Done()boolDone reports whether the long-running operation has completed.
func (*DeleteServiceConnectionTokenOperation) Metadata
func(op*DeleteServiceConnectionTokenOperation)Metadata()(*networkconnectivitypb.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 (*DeleteServiceConnectionTokenOperation) Name
func(op*DeleteServiceConnectionTokenOperation)Name()stringName 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 (*DeleteServiceConnectionTokenOperation) Poll
func(op*DeleteServiceConnectionTokenOperation)Poll(ctxcontext.Context,opts...gax.CallOption)errorPoll 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 andthe 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 (*DeleteServiceConnectionTokenOperation) Wait
func(op*DeleteServiceConnectionTokenOperation)Wait(ctxcontext.Context,opts...gax.CallOption)errorWait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
DeleteSpokeOperation
typeDeleteSpokeOperationstruct{// contains filtered or unexported fields}DeleteSpokeOperation manages a long-running operation from DeleteSpoke.
func (*DeleteSpokeOperation) Done
func(op*DeleteSpokeOperation)Done()boolDone reports whether the long-running operation has completed.
func (*DeleteSpokeOperation) Metadata
func(op*DeleteSpokeOperation)Metadata()(*networkconnectivitypb.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 (*DeleteSpokeOperation) Name
func(op*DeleteSpokeOperation)Name()stringName 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 (*DeleteSpokeOperation) Poll
func(op*DeleteSpokeOperation)Poll(ctxcontext.Context,opts...gax.CallOption)errorPoll 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 andthe 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 (*DeleteSpokeOperation) Wait
func(op*DeleteSpokeOperation)Wait(ctxcontext.Context,opts...gax.CallOption)errorWait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
DestinationIterator
typeDestinationIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*networkconnectivitypb.Destination,nextPageTokenstring,errerror)// contains filtered or unexported fields}DestinationIterator manages a stream of *networkconnectivitypb.Destination.
func (*DestinationIterator) All
func(it*DestinationIterator)All()iter.Seq2[*networkconnectivitypb.Destination,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*DestinationIterator) Next
func(it*DestinationIterator)Next()(*networkconnectivitypb.Destination,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*DestinationIterator) PageInfo
func(it*DestinationIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
GroupIterator
typeGroupIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*networkconnectivitypb.Group,nextPageTokenstring,errerror)// contains filtered or unexported fields}GroupIterator manages a stream of *networkconnectivitypb.Group.
func (*GroupIterator) All
func(it*GroupIterator)All()iter.Seq2[*networkconnectivitypb.Group,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*GroupIterator) Next
func(it*GroupIterator)Next()(*networkconnectivitypb.Group,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*GroupIterator) PageInfo
func(it*GroupIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
HubCallOptions
typeHubCallOptionsstruct{ListHubs[]gax.CallOptionGetHub[]gax.CallOptionCreateHub[]gax.CallOptionUpdateHub[]gax.CallOptionDeleteHub[]gax.CallOptionListHubSpokes[]gax.CallOptionQueryHubStatus[]gax.CallOptionListSpokes[]gax.CallOptionGetSpoke[]gax.CallOptionCreateSpoke[]gax.CallOptionUpdateSpoke[]gax.CallOptionRejectHubSpoke[]gax.CallOptionAcceptHubSpoke[]gax.CallOptionAcceptSpokeUpdate[]gax.CallOptionRejectSpokeUpdate[]gax.CallOptionDeleteSpoke[]gax.CallOptionGetRouteTable[]gax.CallOptionGetRoute[]gax.CallOptionListRoutes[]gax.CallOptionListRouteTables[]gax.CallOptionGetGroup[]gax.CallOptionListGroups[]gax.CallOptionUpdateGroup[]gax.CallOptionGetLocation[]gax.CallOptionListLocations[]gax.CallOptionGetIamPolicy[]gax.CallOptionSetIamPolicy[]gax.CallOptionTestIamPermissions[]gax.CallOptionCancelOperation[]gax.CallOptionDeleteOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOption}HubCallOptions contains the retry settings for each method of HubClient.
HubClient
typeHubClientstruct{// The call options for this service.CallOptions*HubCallOptions// 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}HubClient is a client for interacting with Network Connectivity API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Network Connectivity Center is a hub-and-spoke abstraction for networkconnectivity management in Google Cloud. It reduces operational complexitythrough a simple, centralized connectivity management model.
func NewHubClient
NewHubClient creates a new hub service client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.
Network Connectivity Center is a hub-and-spoke abstraction for networkconnectivity management in Google Cloud. It reduces operational complexitythrough a simple, centralized connectivity management model.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1")funcmain(){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_Optionsc,err:=networkconnectivity.NewHubClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func (*HubClient) AcceptHubSpoke
func(c*HubClient)AcceptHubSpoke(ctxcontext.Context,req*networkconnectivitypb.AcceptHubSpokeRequest,opts...gax.CallOption)(*AcceptHubSpokeOperation,error)AcceptHubSpoke accepts a proposal to attach a Network Connectivity Center spoketo a hub.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewHubClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.AcceptHubSpokeRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#AcceptHubSpokeRequest.}op,err:=c.AcceptHubSpoke(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*HubClient) AcceptHubSpokeOperation
func(c*HubClient)AcceptHubSpokeOperation(namestring)*AcceptHubSpokeOperationAcceptHubSpokeOperation returns a new AcceptHubSpokeOperation from a given name.The name must be that of a previously created AcceptHubSpokeOperation, possibly from a different process.
func (*HubClient) AcceptSpokeUpdate
func(c*HubClient)AcceptSpokeUpdate(ctxcontext.Context,req*networkconnectivitypb.AcceptSpokeUpdateRequest,opts...gax.CallOption)(*AcceptSpokeUpdateOperation,error)AcceptSpokeUpdate accepts a proposal to update a Network Connectivity Center spoke in a hub.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewHubClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.AcceptSpokeUpdateRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#AcceptSpokeUpdateRequest.}op,err:=c.AcceptSpokeUpdate(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*HubClient) AcceptSpokeUpdateOperation
func(c*HubClient)AcceptSpokeUpdateOperation(namestring)*AcceptSpokeUpdateOperationAcceptSpokeUpdateOperation returns a new AcceptSpokeUpdateOperation from a given name.The name must be that of a previously created AcceptSpokeUpdateOperation, possibly from a different process.
func (*HubClient) CancelOperation
func(c*HubClient)CancelOperation(ctxcontext.Context,req*longrunningpb.CancelOperationRequest,opts...gax.CallOption)errorCancelOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1")funcmain(){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_Optionsc,err:=networkconnectivity.NewHubClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}}func (*HubClient) Close
Close closes the connection to the API service. The user should invoke this whenthe client is no longer required.
func (*HubClient) Connection (deprecated)
func(c*HubClient)Connection()*grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.
func (*HubClient) CreateHub
func(c*HubClient)CreateHub(ctxcontext.Context,req*networkconnectivitypb.CreateHubRequest,opts...gax.CallOption)(*CreateHubOperation,error)CreateHub creates a new Network Connectivity Center hub in the specified project.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewHubClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.CreateHubRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#CreateHubRequest.}op,err:=c.CreateHub(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*HubClient) CreateHubOperation
func(c*HubClient)CreateHubOperation(namestring)*CreateHubOperationCreateHubOperation returns a new CreateHubOperation from a given name.The name must be that of a previously created CreateHubOperation, possibly from a different process.
func (*HubClient) CreateSpoke
func(c*HubClient)CreateSpoke(ctxcontext.Context,req*networkconnectivitypb.CreateSpokeRequest,opts...gax.CallOption)(*CreateSpokeOperation,error)CreateSpoke creates a Network Connectivity Center spoke.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewHubClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.CreateSpokeRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#CreateSpokeRequest.}op,err:=c.CreateSpoke(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*HubClient) CreateSpokeOperation
func(c*HubClient)CreateSpokeOperation(namestring)*CreateSpokeOperationCreateSpokeOperation returns a new CreateSpokeOperation from a given name.The name must be that of a previously created CreateSpokeOperation, possibly from a different process.
func (*HubClient) DeleteHub
func(c*HubClient)DeleteHub(ctxcontext.Context,req*networkconnectivitypb.DeleteHubRequest,opts...gax.CallOption)(*DeleteHubOperation,error)DeleteHub deletes a Network Connectivity Center hub.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewHubClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.DeleteHubRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#DeleteHubRequest.}op,err:=c.DeleteHub(ctx,req)iferr!=nil{// TODO: Handle error.}err=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}}func (*HubClient) DeleteHubOperation
func(c*HubClient)DeleteHubOperation(namestring)*DeleteHubOperationDeleteHubOperation returns a new DeleteHubOperation from a given name.The name must be that of a previously created DeleteHubOperation, possibly from a different process.
func (*HubClient) DeleteOperation
func(c*HubClient)DeleteOperation(ctxcontext.Context,req*longrunningpb.DeleteOperationRequest,opts...gax.CallOption)errorDeleteOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1")funcmain(){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_Optionsc,err:=networkconnectivity.NewHubClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}}func (*HubClient) DeleteSpoke
func(c*HubClient)DeleteSpoke(ctxcontext.Context,req*networkconnectivitypb.DeleteSpokeRequest,opts...gax.CallOption)(*DeleteSpokeOperation,error)DeleteSpoke deletes a Network Connectivity Center spoke.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewHubClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.DeleteSpokeRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#DeleteSpokeRequest.}op,err:=c.DeleteSpoke(ctx,req)iferr!=nil{// TODO: Handle error.}err=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}}func (*HubClient) DeleteSpokeOperation
func(c*HubClient)DeleteSpokeOperation(namestring)*DeleteSpokeOperationDeleteSpokeOperation returns a new DeleteSpokeOperation from a given name.The name must be that of a previously created DeleteSpokeOperation, possibly from a different process.
func (*HubClient) GetGroup
func(c*HubClient)GetGroup(ctxcontext.Context,req*networkconnectivitypb.GetGroupRequest,opts...gax.CallOption)(*networkconnectivitypb.Group,error)GetGroup gets details about a Network Connectivity Center group.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewHubClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.GetGroupRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#GetGroupRequest.}resp,err:=c.GetGroup(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*HubClient) GetHub
func(c*HubClient)GetHub(ctxcontext.Context,req*networkconnectivitypb.GetHubRequest,opts...gax.CallOption)(*networkconnectivitypb.Hub,error)GetHub gets details about a Network Connectivity Center hub.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewHubClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.GetHubRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#GetHubRequest.}resp,err:=c.GetHub(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*HubClient) GetIamPolicy
func(c*HubClient)GetIamPolicy(ctxcontext.Context,req*iampb.GetIamPolicyRequest,opts...gax.CallOption)(*iampb.Policy,error)GetIamPolicy gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.
Example
packagemainimport("context"iampb"cloud.google.com/go/iam/apiv1/iampb"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1")funcmain(){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_Optionsc,err:=networkconnectivity.NewHubClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&iampb.GetIamPolicyRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#GetIamPolicyRequest.}resp,err:=c.GetIamPolicy(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*HubClient) GetLocation
func(c*HubClient)GetLocation(ctxcontext.Context,req*locationpb.GetLocationRequest,opts...gax.CallOption)(*locationpb.Location,error)GetLocation gets information about a location.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"locationpb"google.golang.org/genproto/googleapis/cloud/location")funcmain(){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_Optionsc,err:=networkconnectivity.NewHubClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*HubClient) GetOperation
func(c*HubClient)GetOperation(ctxcontext.Context,req*longrunningpb.GetOperationRequest,opts...gax.CallOption)(*longrunningpb.Operation,error)GetOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1")funcmain(){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_Optionsc,err:=networkconnectivity.NewHubClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*HubClient) GetRoute
func(c*HubClient)GetRoute(ctxcontext.Context,req*networkconnectivitypb.GetRouteRequest,opts...gax.CallOption)(*networkconnectivitypb.Route,error)GetRoute gets details about the specified route.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewHubClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.GetRouteRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#GetRouteRequest.}resp,err:=c.GetRoute(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*HubClient) GetRouteTable
func(c*HubClient)GetRouteTable(ctxcontext.Context,req*networkconnectivitypb.GetRouteTableRequest,opts...gax.CallOption)(*networkconnectivitypb.RouteTable,error)GetRouteTable gets details about a Network Connectivity Center route table.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewHubClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.GetRouteTableRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#GetRouteTableRequest.}resp,err:=c.GetRouteTable(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*HubClient) GetSpoke
func(c*HubClient)GetSpoke(ctxcontext.Context,req*networkconnectivitypb.GetSpokeRequest,opts...gax.CallOption)(*networkconnectivitypb.Spoke,error)GetSpoke gets details about a Network Connectivity Center spoke.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewHubClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.GetSpokeRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#GetSpokeRequest.}resp,err:=c.GetSpoke(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*HubClient) ListGroups
func(c*HubClient)ListGroups(ctxcontext.Context,req*networkconnectivitypb.ListGroupsRequest,opts...gax.CallOption)*GroupIteratorListGroups lists groups in a given hub.
Examples
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb""google.golang.org/api/iterator")funcmain(){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_Optionsc,err:=networkconnectivity.NewHubClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.ListGroupsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#ListGroupsRequest.}it:=c.ListGroups(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=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.(*networkconnectivitypb.ListGroupsResponse)}}all
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewHubClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.ListGroupsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#ListGroupsRequest.}forresp,err:=rangec.ListGroups(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*HubClient) ListHubSpokes
func(c*HubClient)ListHubSpokes(ctxcontext.Context,req*networkconnectivitypb.ListHubSpokesRequest,opts...gax.CallOption)*SpokeIteratorListHubSpokes lists the Network Connectivity Center spokes associated with aspecified hub and location. The list includes both spokes that are attachedto the hub and spokes that have been proposed but not yet accepted.
Examples
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb""google.golang.org/api/iterator")funcmain(){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_Optionsc,err:=networkconnectivity.NewHubClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.ListHubSpokesRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#ListHubSpokesRequest.}it:=c.ListHubSpokes(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=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.(*networkconnectivitypb.ListHubSpokesResponse)}}all
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewHubClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.ListHubSpokesRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#ListHubSpokesRequest.}forresp,err:=rangec.ListHubSpokes(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*HubClient) ListHubs
func(c*HubClient)ListHubs(ctxcontext.Context,req*networkconnectivitypb.ListHubsRequest,opts...gax.CallOption)*HubIteratorListHubs lists the Network Connectivity Center hubs associated with a given project.
Examples
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb""google.golang.org/api/iterator")funcmain(){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_Optionsc,err:=networkconnectivity.NewHubClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.ListHubsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#ListHubsRequest.}it:=c.ListHubs(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=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.(*networkconnectivitypb.ListHubsResponse)}}all
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewHubClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.ListHubsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#ListHubsRequest.}forresp,err:=rangec.ListHubs(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*HubClient) ListLocations
func(c*HubClient)ListLocations(ctxcontext.Context,req*locationpb.ListLocationsRequest,opts...gax.CallOption)*LocationIteratorListLocations lists information about the supported locations for this service.
Examples
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1""google.golang.org/api/iterator"locationpb"google.golang.org/genproto/googleapis/cloud/location")funcmain(){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_Optionsc,err:=networkconnectivity.NewHubClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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()iferr==iterator.Done{break}iferr!=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
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"locationpb"google.golang.org/genproto/googleapis/cloud/location")funcmain(){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_Optionsc,err:=networkconnectivity.NewHubClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&locationpb.ListLocationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.}forresp,err:=rangec.ListLocations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*HubClient) ListOperations
func(c*HubClient)ListOperations(ctxcontext.Context,req*longrunningpb.ListOperationsRequest,opts...gax.CallOption)*OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1""google.golang.org/api/iterator")funcmain(){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_Optionsc,err:=networkconnectivity.NewHubClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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()iferr==iterator.Done{break}iferr!=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
packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1")funcmain(){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_Optionsc,err:=networkconnectivity.NewHubClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}forresp,err:=rangec.ListOperations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*HubClient) ListRouteTables
func(c*HubClient)ListRouteTables(ctxcontext.Context,req*networkconnectivitypb.ListRouteTablesRequest,opts...gax.CallOption)*RouteTableIteratorListRouteTables lists route tables in a given hub.
Examples
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb""google.golang.org/api/iterator")funcmain(){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_Optionsc,err:=networkconnectivity.NewHubClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.ListRouteTablesRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#ListRouteTablesRequest.}it:=c.ListRouteTables(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=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.(*networkconnectivitypb.ListRouteTablesResponse)}}all
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewHubClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.ListRouteTablesRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#ListRouteTablesRequest.}forresp,err:=rangec.ListRouteTables(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*HubClient) ListRoutes
func(c*HubClient)ListRoutes(ctxcontext.Context,req*networkconnectivitypb.ListRoutesRequest,opts...gax.CallOption)*RouteIteratorListRoutes lists routes in a given route table.
Examples
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb""google.golang.org/api/iterator")funcmain(){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_Optionsc,err:=networkconnectivity.NewHubClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.ListRoutesRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#ListRoutesRequest.}it:=c.ListRoutes(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=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.(*networkconnectivitypb.ListRoutesResponse)}}all
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewHubClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.ListRoutesRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#ListRoutesRequest.}forresp,err:=rangec.ListRoutes(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*HubClient) ListSpokes
func(c*HubClient)ListSpokes(ctxcontext.Context,req*networkconnectivitypb.ListSpokesRequest,opts...gax.CallOption)*SpokeIteratorListSpokes lists the Network Connectivity Center spokes in a specified project andlocation.
Examples
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb""google.golang.org/api/iterator")funcmain(){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_Optionsc,err:=networkconnectivity.NewHubClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.ListSpokesRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#ListSpokesRequest.}it:=c.ListSpokes(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=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.(*networkconnectivitypb.ListSpokesResponse)}}all
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewHubClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.ListSpokesRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#ListSpokesRequest.}forresp,err:=rangec.ListSpokes(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*HubClient) QueryHubStatus
func(c*HubClient)QueryHubStatus(ctxcontext.Context,req*networkconnectivitypb.QueryHubStatusRequest,opts...gax.CallOption)*HubStatusEntryIteratorQueryHubStatus query the Private Service Connect propagation status of a NetworkConnectivity Center hub.
Examples
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb""google.golang.org/api/iterator")funcmain(){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_Optionsc,err:=networkconnectivity.NewHubClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.QueryHubStatusRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#QueryHubStatusRequest.}it:=c.QueryHubStatus(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=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.(*networkconnectivitypb.QueryHubStatusResponse)}}all
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewHubClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.QueryHubStatusRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#QueryHubStatusRequest.}forresp,err:=rangec.QueryHubStatus(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*HubClient) RejectHubSpoke
func(c*HubClient)RejectHubSpoke(ctxcontext.Context,req*networkconnectivitypb.RejectHubSpokeRequest,opts...gax.CallOption)(*RejectHubSpokeOperation,error)RejectHubSpoke rejects a Network Connectivity Center spoke from being attached to a hub.If the spoke was previously in the ACTIVE state, ittransitions to the INACTIVE state and is no longer able toconnect to other spokes that are attached to the hub.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewHubClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.RejectHubSpokeRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#RejectHubSpokeRequest.}op,err:=c.RejectHubSpoke(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*HubClient) RejectHubSpokeOperation
func(c*HubClient)RejectHubSpokeOperation(namestring)*RejectHubSpokeOperationRejectHubSpokeOperation returns a new RejectHubSpokeOperation from a given name.The name must be that of a previously created RejectHubSpokeOperation, possibly from a different process.
func (*HubClient) RejectSpokeUpdate
func(c*HubClient)RejectSpokeUpdate(ctxcontext.Context,req*networkconnectivitypb.RejectSpokeUpdateRequest,opts...gax.CallOption)(*RejectSpokeUpdateOperation,error)RejectSpokeUpdate rejects a proposal to update a Network Connectivity Center spoke in a hub.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewHubClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.RejectSpokeUpdateRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#RejectSpokeUpdateRequest.}op,err:=c.RejectSpokeUpdate(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*HubClient) RejectSpokeUpdateOperation
func(c*HubClient)RejectSpokeUpdateOperation(namestring)*RejectSpokeUpdateOperationRejectSpokeUpdateOperation returns a new RejectSpokeUpdateOperation from a given name.The name must be that of a previously created RejectSpokeUpdateOperation, possibly from a different process.
func (*HubClient) SetIamPolicy
func(c*HubClient)SetIamPolicy(ctxcontext.Context,req*iampb.SetIamPolicyRequest,opts...gax.CallOption)(*iampb.Policy,error)SetIamPolicy sets the access control policy on the specified resource. Replacesany existing policy.
Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.
Example
packagemainimport("context"iampb"cloud.google.com/go/iam/apiv1/iampb"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1")funcmain(){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_Optionsc,err:=networkconnectivity.NewHubClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&iampb.SetIamPolicyRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#SetIamPolicyRequest.}resp,err:=c.SetIamPolicy(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*HubClient) TestIamPermissions
func(c*HubClient)TestIamPermissions(ctxcontext.Context,req*iampb.TestIamPermissionsRequest,opts...gax.CallOption)(*iampb.TestIamPermissionsResponse,error)TestIamPermissions returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a NOT_FOUND error.
Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may “fail open” without warning.
Example
packagemainimport("context"iampb"cloud.google.com/go/iam/apiv1/iampb"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1")funcmain(){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_Optionsc,err:=networkconnectivity.NewHubClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&iampb.TestIamPermissionsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#TestIamPermissionsRequest.}resp,err:=c.TestIamPermissions(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*HubClient) UpdateGroup
func(c*HubClient)UpdateGroup(ctxcontext.Context,req*networkconnectivitypb.UpdateGroupRequest,opts...gax.CallOption)(*UpdateGroupOperation,error)UpdateGroup updates the parameters of a Network Connectivity Center group.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewHubClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.UpdateGroupRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#UpdateGroupRequest.}op,err:=c.UpdateGroup(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*HubClient) UpdateGroupOperation
func(c*HubClient)UpdateGroupOperation(namestring)*UpdateGroupOperationUpdateGroupOperation returns a new UpdateGroupOperation from a given name.The name must be that of a previously created UpdateGroupOperation, possibly from a different process.
func (*HubClient) UpdateHub
func(c*HubClient)UpdateHub(ctxcontext.Context,req*networkconnectivitypb.UpdateHubRequest,opts...gax.CallOption)(*UpdateHubOperation,error)UpdateHub updates the description and/or labels of a Network Connectivity Centerhub.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewHubClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.UpdateHubRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#UpdateHubRequest.}op,err:=c.UpdateHub(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*HubClient) UpdateHubOperation
func(c*HubClient)UpdateHubOperation(namestring)*UpdateHubOperationUpdateHubOperation returns a new UpdateHubOperation from a given name.The name must be that of a previously created UpdateHubOperation, possibly from a different process.
func (*HubClient) UpdateSpoke
func(c*HubClient)UpdateSpoke(ctxcontext.Context,req*networkconnectivitypb.UpdateSpokeRequest,opts...gax.CallOption)(*UpdateSpokeOperation,error)UpdateSpoke updates the parameters of a Network Connectivity Center spoke.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewHubClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.UpdateSpokeRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#UpdateSpokeRequest.}op,err:=c.UpdateSpoke(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*HubClient) UpdateSpokeOperation
func(c*HubClient)UpdateSpokeOperation(namestring)*UpdateSpokeOperationUpdateSpokeOperation returns a new UpdateSpokeOperation from a given name.The name must be that of a previously created UpdateSpokeOperation, possibly from a different process.
HubIterator
typeHubIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*networkconnectivitypb.Hub,nextPageTokenstring,errerror)// contains filtered or unexported fields}HubIterator manages a stream of *networkconnectivitypb.Hub.
func (*HubIterator) All
func(it*HubIterator)All()iter.Seq2[*networkconnectivitypb.Hub,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*HubIterator) Next
func(it*HubIterator)Next()(*networkconnectivitypb.Hub,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*HubIterator) PageInfo
func(it*HubIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
HubStatusEntryIterator
typeHubStatusEntryIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*networkconnectivitypb.HubStatusEntry,nextPageTokenstring,errerror)// contains filtered or unexported fields}HubStatusEntryIterator manages a stream of *networkconnectivitypb.HubStatusEntry.
func (*HubStatusEntryIterator) All
func(it*HubStatusEntryIterator)All()iter.Seq2[*networkconnectivitypb.HubStatusEntry,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*HubStatusEntryIterator) Next
func(it*HubStatusEntryIterator)Next()(*networkconnectivitypb.HubStatusEntry,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*HubStatusEntryIterator) PageInfo
func(it*HubStatusEntryIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
InternalRangeCallOptions
typeInternalRangeCallOptionsstruct{ListInternalRanges[]gax.CallOptionGetInternalRange[]gax.CallOptionCreateInternalRange[]gax.CallOptionUpdateInternalRange[]gax.CallOptionDeleteInternalRange[]gax.CallOptionGetLocation[]gax.CallOptionListLocations[]gax.CallOptionGetIamPolicy[]gax.CallOptionSetIamPolicy[]gax.CallOptionTestIamPermissions[]gax.CallOptionCancelOperation[]gax.CallOptionDeleteOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOption}InternalRangeCallOptions contains the retry settings for each method of InternalRangeClient.
InternalRangeClient
typeInternalRangeClientstruct{// The call options for this service.CallOptions*InternalRangeCallOptions// 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}InternalRangeClient is a client for interacting with Network Connectivity API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The CLH-based service for internal range resources used to perform IPAMoperations within a VPC network.
func NewInternalRangeClient
funcNewInternalRangeClient(ctxcontext.Context,opts...option.ClientOption)(*InternalRangeClient,error)NewInternalRangeClient creates a new internal range service client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.
The CLH-based service for internal range resources used to perform IPAMoperations within a VPC network.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1")funcmain(){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_Optionsc,err:=networkconnectivity.NewInternalRangeClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func (*InternalRangeClient) CancelOperation
func(c*InternalRangeClient)CancelOperation(ctxcontext.Context,req*longrunningpb.CancelOperationRequest,opts...gax.CallOption)errorCancelOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1")funcmain(){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_Optionsc,err:=networkconnectivity.NewInternalRangeClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}}func (*InternalRangeClient) Close
func(c*InternalRangeClient)Close()errorClose closes the connection to the API service. The user should invoke this whenthe client is no longer required.
func (*InternalRangeClient) Connection (deprecated)
func(c*InternalRangeClient)Connection()*grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.
func (*InternalRangeClient) CreateInternalRange
func(c*InternalRangeClient)CreateInternalRange(ctxcontext.Context,req*networkconnectivitypb.CreateInternalRangeRequest,opts...gax.CallOption)(*CreateInternalRangeOperation,error)CreateInternalRange creates a new internal range in a given project and location.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewInternalRangeClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.CreateInternalRangeRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#CreateInternalRangeRequest.}op,err:=c.CreateInternalRange(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*InternalRangeClient) CreateInternalRangeOperation
func(c*InternalRangeClient)CreateInternalRangeOperation(namestring)*CreateInternalRangeOperationCreateInternalRangeOperation returns a new CreateInternalRangeOperation from a given name.The name must be that of a previously created CreateInternalRangeOperation, possibly from a different process.
func (*InternalRangeClient) DeleteInternalRange
func(c*InternalRangeClient)DeleteInternalRange(ctxcontext.Context,req*networkconnectivitypb.DeleteInternalRangeRequest,opts...gax.CallOption)(*DeleteInternalRangeOperation,error)DeleteInternalRange deletes a single internal range.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewInternalRangeClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.DeleteInternalRangeRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#DeleteInternalRangeRequest.}op,err:=c.DeleteInternalRange(ctx,req)iferr!=nil{// TODO: Handle error.}err=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}}func (*InternalRangeClient) DeleteInternalRangeOperation
func(c*InternalRangeClient)DeleteInternalRangeOperation(namestring)*DeleteInternalRangeOperationDeleteInternalRangeOperation returns a new DeleteInternalRangeOperation from a given name.The name must be that of a previously created DeleteInternalRangeOperation, possibly from a different process.
func (*InternalRangeClient) DeleteOperation
func(c*InternalRangeClient)DeleteOperation(ctxcontext.Context,req*longrunningpb.DeleteOperationRequest,opts...gax.CallOption)errorDeleteOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1")funcmain(){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_Optionsc,err:=networkconnectivity.NewInternalRangeClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}}func (*InternalRangeClient) GetIamPolicy
func(c*InternalRangeClient)GetIamPolicy(ctxcontext.Context,req*iampb.GetIamPolicyRequest,opts...gax.CallOption)(*iampb.Policy,error)GetIamPolicy gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.
Example
packagemainimport("context"iampb"cloud.google.com/go/iam/apiv1/iampb"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1")funcmain(){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_Optionsc,err:=networkconnectivity.NewInternalRangeClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&iampb.GetIamPolicyRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#GetIamPolicyRequest.}resp,err:=c.GetIamPolicy(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*InternalRangeClient) GetInternalRange
func(c*InternalRangeClient)GetInternalRange(ctxcontext.Context,req*networkconnectivitypb.GetInternalRangeRequest,opts...gax.CallOption)(*networkconnectivitypb.InternalRange,error)GetInternalRange gets details of a single internal range.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewInternalRangeClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.GetInternalRangeRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#GetInternalRangeRequest.}resp,err:=c.GetInternalRange(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*InternalRangeClient) GetLocation
func(c*InternalRangeClient)GetLocation(ctxcontext.Context,req*locationpb.GetLocationRequest,opts...gax.CallOption)(*locationpb.Location,error)GetLocation gets information about a location.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"locationpb"google.golang.org/genproto/googleapis/cloud/location")funcmain(){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_Optionsc,err:=networkconnectivity.NewInternalRangeClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*InternalRangeClient) GetOperation
func(c*InternalRangeClient)GetOperation(ctxcontext.Context,req*longrunningpb.GetOperationRequest,opts...gax.CallOption)(*longrunningpb.Operation,error)GetOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1")funcmain(){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_Optionsc,err:=networkconnectivity.NewInternalRangeClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*InternalRangeClient) ListInternalRanges
func(c*InternalRangeClient)ListInternalRanges(ctxcontext.Context,req*networkconnectivitypb.ListInternalRangesRequest,opts...gax.CallOption)*InternalRangeIteratorListInternalRanges lists internal ranges in a given project and location.
Examples
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb""google.golang.org/api/iterator")funcmain(){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_Optionsc,err:=networkconnectivity.NewInternalRangeClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.ListInternalRangesRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#ListInternalRangesRequest.}it:=c.ListInternalRanges(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=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.(*networkconnectivitypb.ListInternalRangesResponse)}}all
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewInternalRangeClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.ListInternalRangesRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#ListInternalRangesRequest.}forresp,err:=rangec.ListInternalRanges(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*InternalRangeClient) ListLocations
func(c*InternalRangeClient)ListLocations(ctxcontext.Context,req*locationpb.ListLocationsRequest,opts...gax.CallOption)*LocationIteratorListLocations lists information about the supported locations for this service.
Examples
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1""google.golang.org/api/iterator"locationpb"google.golang.org/genproto/googleapis/cloud/location")funcmain(){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_Optionsc,err:=networkconnectivity.NewInternalRangeClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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()iferr==iterator.Done{break}iferr!=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
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"locationpb"google.golang.org/genproto/googleapis/cloud/location")funcmain(){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_Optionsc,err:=networkconnectivity.NewInternalRangeClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&locationpb.ListLocationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.}forresp,err:=rangec.ListLocations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*InternalRangeClient) ListOperations
func(c*InternalRangeClient)ListOperations(ctxcontext.Context,req*longrunningpb.ListOperationsRequest,opts...gax.CallOption)*OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1""google.golang.org/api/iterator")funcmain(){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_Optionsc,err:=networkconnectivity.NewInternalRangeClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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()iferr==iterator.Done{break}iferr!=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
packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1")funcmain(){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_Optionsc,err:=networkconnectivity.NewInternalRangeClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}forresp,err:=rangec.ListOperations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*InternalRangeClient) SetIamPolicy
func(c*InternalRangeClient)SetIamPolicy(ctxcontext.Context,req*iampb.SetIamPolicyRequest,opts...gax.CallOption)(*iampb.Policy,error)SetIamPolicy sets the access control policy on the specified resource. Replacesany existing policy.
Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.
Example
packagemainimport("context"iampb"cloud.google.com/go/iam/apiv1/iampb"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1")funcmain(){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_Optionsc,err:=networkconnectivity.NewInternalRangeClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&iampb.SetIamPolicyRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#SetIamPolicyRequest.}resp,err:=c.SetIamPolicy(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*InternalRangeClient) TestIamPermissions
func(c*InternalRangeClient)TestIamPermissions(ctxcontext.Context,req*iampb.TestIamPermissionsRequest,opts...gax.CallOption)(*iampb.TestIamPermissionsResponse,error)TestIamPermissions returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a NOT_FOUND error.
Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may “fail open” without warning.
Example
packagemainimport("context"iampb"cloud.google.com/go/iam/apiv1/iampb"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1")funcmain(){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_Optionsc,err:=networkconnectivity.NewInternalRangeClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&iampb.TestIamPermissionsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#TestIamPermissionsRequest.}resp,err:=c.TestIamPermissions(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*InternalRangeClient) UpdateInternalRange
func(c*InternalRangeClient)UpdateInternalRange(ctxcontext.Context,req*networkconnectivitypb.UpdateInternalRangeRequest,opts...gax.CallOption)(*UpdateInternalRangeOperation,error)UpdateInternalRange updates the parameters of a single internal range.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewInternalRangeClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.UpdateInternalRangeRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#UpdateInternalRangeRequest.}op,err:=c.UpdateInternalRange(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*InternalRangeClient) UpdateInternalRangeOperation
func(c*InternalRangeClient)UpdateInternalRangeOperation(namestring)*UpdateInternalRangeOperationUpdateInternalRangeOperation returns a new UpdateInternalRangeOperation from a given name.The name must be that of a previously created UpdateInternalRangeOperation, possibly from a different process.
InternalRangeIterator
typeInternalRangeIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*networkconnectivitypb.InternalRange,nextPageTokenstring,errerror)// contains filtered or unexported fields}InternalRangeIterator manages a stream of *networkconnectivitypb.InternalRange.
func (*InternalRangeIterator) All
func(it*InternalRangeIterator)All()iter.Seq2[*networkconnectivitypb.InternalRange,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*InternalRangeIterator) Next
func(it*InternalRangeIterator)Next()(*networkconnectivitypb.InternalRange,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*InternalRangeIterator) PageInfo
func(it*InternalRangeIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
LocationIterator
typeLocationIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*locationpb.Location,nextPageTokenstring,errerror)// 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, theiterator 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 moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*LocationIterator) PageInfo
func(it*LocationIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
MulticloudDataTransferConfigIterator
typeMulticloudDataTransferConfigIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*networkconnectivitypb.MulticloudDataTransferConfig,nextPageTokenstring,errerror)// contains filtered or unexported fields}MulticloudDataTransferConfigIterator manages a stream of *networkconnectivitypb.MulticloudDataTransferConfig.
func (*MulticloudDataTransferConfigIterator) All
func(it*MulticloudDataTransferConfigIterator)All()iter.Seq2[*networkconnectivitypb.MulticloudDataTransferConfig,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*MulticloudDataTransferConfigIterator) Next
func(it*MulticloudDataTransferConfigIterator)Next()(*networkconnectivitypb.MulticloudDataTransferConfig,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*MulticloudDataTransferConfigIterator) PageInfo
func(it*MulticloudDataTransferConfigIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
MulticloudDataTransferSupportedServiceIterator
typeMulticloudDataTransferSupportedServiceIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*networkconnectivitypb.MulticloudDataTransferSupportedService,nextPageTokenstring,errerror)// contains filtered or unexported fields}MulticloudDataTransferSupportedServiceIterator manages a stream of *networkconnectivitypb.MulticloudDataTransferSupportedService.
func (*MulticloudDataTransferSupportedServiceIterator) All
func(it*MulticloudDataTransferSupportedServiceIterator)All()iter.Seq2[*networkconnectivitypb.MulticloudDataTransferSupportedService,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*MulticloudDataTransferSupportedServiceIterator) Next
func(it*MulticloudDataTransferSupportedServiceIterator)Next()(*networkconnectivitypb.MulticloudDataTransferSupportedService,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*MulticloudDataTransferSupportedServiceIterator) PageInfo
func(it*MulticloudDataTransferSupportedServiceIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
OperationIterator
typeOperationIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*longrunningpb.Operation,nextPageTokenstring,errerror)// 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, theiterator 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 moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*OperationIterator) PageInfo
func(it*OperationIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
PolicyBasedRouteIterator
typePolicyBasedRouteIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*networkconnectivitypb.PolicyBasedRoute,nextPageTokenstring,errerror)// contains filtered or unexported fields}PolicyBasedRouteIterator manages a stream of *networkconnectivitypb.PolicyBasedRoute.
func (*PolicyBasedRouteIterator) All
func(it*PolicyBasedRouteIterator)All()iter.Seq2[*networkconnectivitypb.PolicyBasedRoute,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*PolicyBasedRouteIterator) Next
func(it*PolicyBasedRouteIterator)Next()(*networkconnectivitypb.PolicyBasedRoute,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*PolicyBasedRouteIterator) PageInfo
func(it*PolicyBasedRouteIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
PolicyBasedRoutingCallOptions
typePolicyBasedRoutingCallOptionsstruct{ListPolicyBasedRoutes[]gax.CallOptionGetPolicyBasedRoute[]gax.CallOptionCreatePolicyBasedRoute[]gax.CallOptionDeletePolicyBasedRoute[]gax.CallOptionGetLocation[]gax.CallOptionListLocations[]gax.CallOptionGetIamPolicy[]gax.CallOptionSetIamPolicy[]gax.CallOptionTestIamPermissions[]gax.CallOptionCancelOperation[]gax.CallOptionDeleteOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOption}PolicyBasedRoutingCallOptions contains the retry settings for each method of PolicyBasedRoutingClient.
PolicyBasedRoutingClient
typePolicyBasedRoutingClientstruct{// The call options for this service.CallOptions*PolicyBasedRoutingCallOptions// 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}PolicyBasedRoutingClient is a client for interacting with Network Connectivity API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Policy-Based Routing allows GCP customers to specify flexibile routingpolicies for Layer 4 traffic traversing through the connected service.
func NewPolicyBasedRoutingClient
funcNewPolicyBasedRoutingClient(ctxcontext.Context,opts...option.ClientOption)(*PolicyBasedRoutingClient,error)NewPolicyBasedRoutingClient creates a new policy based routing service client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.
Policy-Based Routing allows GCP customers to specify flexibile routingpolicies for Layer 4 traffic traversing through the connected service.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1")funcmain(){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_Optionsc,err:=networkconnectivity.NewPolicyBasedRoutingClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func (*PolicyBasedRoutingClient) CancelOperation
func(c*PolicyBasedRoutingClient)CancelOperation(ctxcontext.Context,req*longrunningpb.CancelOperationRequest,opts...gax.CallOption)errorCancelOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1")funcmain(){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_Optionsc,err:=networkconnectivity.NewPolicyBasedRoutingClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}}func (*PolicyBasedRoutingClient) Close
func(c*PolicyBasedRoutingClient)Close()errorClose closes the connection to the API service. The user should invoke this whenthe client is no longer required.
func (*PolicyBasedRoutingClient) Connection (deprecated)
func(c*PolicyBasedRoutingClient)Connection()*grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.
func (*PolicyBasedRoutingClient) CreatePolicyBasedRoute
func(c*PolicyBasedRoutingClient)CreatePolicyBasedRoute(ctxcontext.Context,req*networkconnectivitypb.CreatePolicyBasedRouteRequest,opts...gax.CallOption)(*CreatePolicyBasedRouteOperation,error)CreatePolicyBasedRoute creates a new policy-based route in a given project and location.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewPolicyBasedRoutingClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.CreatePolicyBasedRouteRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#CreatePolicyBasedRouteRequest.}op,err:=c.CreatePolicyBasedRoute(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*PolicyBasedRoutingClient) CreatePolicyBasedRouteOperation
func(c*PolicyBasedRoutingClient)CreatePolicyBasedRouteOperation(namestring)*CreatePolicyBasedRouteOperationCreatePolicyBasedRouteOperation returns a new CreatePolicyBasedRouteOperation from a given name.The name must be that of a previously created CreatePolicyBasedRouteOperation, possibly from a different process.
func (*PolicyBasedRoutingClient) DeleteOperation
func(c*PolicyBasedRoutingClient)DeleteOperation(ctxcontext.Context,req*longrunningpb.DeleteOperationRequest,opts...gax.CallOption)errorDeleteOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1")funcmain(){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_Optionsc,err:=networkconnectivity.NewPolicyBasedRoutingClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}}func (*PolicyBasedRoutingClient) DeletePolicyBasedRoute
func(c*PolicyBasedRoutingClient)DeletePolicyBasedRoute(ctxcontext.Context,req*networkconnectivitypb.DeletePolicyBasedRouteRequest,opts...gax.CallOption)(*DeletePolicyBasedRouteOperation,error)DeletePolicyBasedRoute deletes a single policy-based route.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewPolicyBasedRoutingClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.DeletePolicyBasedRouteRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#DeletePolicyBasedRouteRequest.}op,err:=c.DeletePolicyBasedRoute(ctx,req)iferr!=nil{// TODO: Handle error.}err=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}}func (*PolicyBasedRoutingClient) DeletePolicyBasedRouteOperation
func(c*PolicyBasedRoutingClient)DeletePolicyBasedRouteOperation(namestring)*DeletePolicyBasedRouteOperationDeletePolicyBasedRouteOperation returns a new DeletePolicyBasedRouteOperation from a given name.The name must be that of a previously created DeletePolicyBasedRouteOperation, possibly from a different process.
func (*PolicyBasedRoutingClient) GetIamPolicy
func(c*PolicyBasedRoutingClient)GetIamPolicy(ctxcontext.Context,req*iampb.GetIamPolicyRequest,opts...gax.CallOption)(*iampb.Policy,error)GetIamPolicy gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.
Example
packagemainimport("context"iampb"cloud.google.com/go/iam/apiv1/iampb"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1")funcmain(){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_Optionsc,err:=networkconnectivity.NewPolicyBasedRoutingClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&iampb.GetIamPolicyRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#GetIamPolicyRequest.}resp,err:=c.GetIamPolicy(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*PolicyBasedRoutingClient) GetLocation
func(c*PolicyBasedRoutingClient)GetLocation(ctxcontext.Context,req*locationpb.GetLocationRequest,opts...gax.CallOption)(*locationpb.Location,error)GetLocation gets information about a location.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"locationpb"google.golang.org/genproto/googleapis/cloud/location")funcmain(){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_Optionsc,err:=networkconnectivity.NewPolicyBasedRoutingClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*PolicyBasedRoutingClient) GetOperation
func(c*PolicyBasedRoutingClient)GetOperation(ctxcontext.Context,req*longrunningpb.GetOperationRequest,opts...gax.CallOption)(*longrunningpb.Operation,error)GetOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1")funcmain(){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_Optionsc,err:=networkconnectivity.NewPolicyBasedRoutingClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*PolicyBasedRoutingClient) GetPolicyBasedRoute
func(c*PolicyBasedRoutingClient)GetPolicyBasedRoute(ctxcontext.Context,req*networkconnectivitypb.GetPolicyBasedRouteRequest,opts...gax.CallOption)(*networkconnectivitypb.PolicyBasedRoute,error)GetPolicyBasedRoute gets details of a single policy-based route.
Example
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewPolicyBasedRoutingClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.GetPolicyBasedRouteRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#GetPolicyBasedRouteRequest.}resp,err:=c.GetPolicyBasedRoute(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*PolicyBasedRoutingClient) ListLocations
func(c*PolicyBasedRoutingClient)ListLocations(ctxcontext.Context,req*locationpb.ListLocationsRequest,opts...gax.CallOption)*LocationIteratorListLocations lists information about the supported locations for this service.
Examples
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1""google.golang.org/api/iterator"locationpb"google.golang.org/genproto/googleapis/cloud/location")funcmain(){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_Optionsc,err:=networkconnectivity.NewPolicyBasedRoutingClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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()iferr==iterator.Done{break}iferr!=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
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"locationpb"google.golang.org/genproto/googleapis/cloud/location")funcmain(){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_Optionsc,err:=networkconnectivity.NewPolicyBasedRoutingClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&locationpb.ListLocationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.}forresp,err:=rangec.ListLocations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*PolicyBasedRoutingClient) ListOperations
func(c*PolicyBasedRoutingClient)ListOperations(ctxcontext.Context,req*longrunningpb.ListOperationsRequest,opts...gax.CallOption)*OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1""google.golang.org/api/iterator")funcmain(){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_Optionsc,err:=networkconnectivity.NewPolicyBasedRoutingClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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()iferr==iterator.Done{break}iferr!=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
packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1")funcmain(){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_Optionsc,err:=networkconnectivity.NewPolicyBasedRoutingClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}forresp,err:=rangec.ListOperations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*PolicyBasedRoutingClient) ListPolicyBasedRoutes
func(c*PolicyBasedRoutingClient)ListPolicyBasedRoutes(ctxcontext.Context,req*networkconnectivitypb.ListPolicyBasedRoutesRequest,opts...gax.CallOption)*PolicyBasedRouteIteratorListPolicyBasedRoutes lists policy-based routes in a given project and location.
Examples
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb""google.golang.org/api/iterator")funcmain(){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_Optionsc,err:=networkconnectivity.NewPolicyBasedRoutingClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.ListPolicyBasedRoutesRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#ListPolicyBasedRoutesRequest.}it:=c.ListPolicyBasedRoutes(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=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.(*networkconnectivitypb.ListPolicyBasedRoutesResponse)}}all
packagemainimport("context"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1"networkconnectivitypb"cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb")funcmain(){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_Optionsc,err:=networkconnectivity.NewPolicyBasedRoutingClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkconnectivitypb.ListPolicyBasedRoutesRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb#ListPolicyBasedRoutesRequest.}forresp,err:=rangec.ListPolicyBasedRoutes(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*PolicyBasedRoutingClient) SetIamPolicy
func(c*PolicyBasedRoutingClient)SetIamPolicy(ctxcontext.Context,req*iampb.SetIamPolicyRequest,opts...gax.CallOption)(*iampb.Policy,error)SetIamPolicy sets the access control policy on the specified resource. Replacesany existing policy.
Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.
Example
packagemainimport("context"iampb"cloud.google.com/go/iam/apiv1/iampb"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1")funcmain(){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_Optionsc,err:=networkconnectivity.NewPolicyBasedRoutingClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&iampb.SetIamPolicyRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#SetIamPolicyRequest.}resp,err:=c.SetIamPolicy(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*PolicyBasedRoutingClient) TestIamPermissions
func(c*PolicyBasedRoutingClient)TestIamPermissions(ctxcontext.Context,req*iampb.TestIamPermissionsRequest,opts...gax.CallOption)(*iampb.TestIamPermissionsResponse,error)TestIamPermissions returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a NOT_FOUND error.
Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may “fail open” without warning.
Example
packagemainimport("context"iampb"cloud.google.com/go/iam/apiv1/iampb"networkconnectivity"cloud.google.com/go/networkconnectivity/apiv1")funcmain(){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_Optionsc,err:=networkconnectivity.NewPolicyBasedRoutingClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&iampb.TestIamPermissionsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#TestIamPermissionsRequest.}resp,err:=c.TestIamPermissions(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}RejectHubSpokeOperation
typeRejectHubSpokeOperationstruct{// contains filtered or unexported fields}RejectHubSpokeOperation manages a long-running operation from RejectHubSpoke.
func (*RejectHubSpokeOperation) Done
func(op*RejectHubSpokeOperation)Done()boolDone reports whether the long-running operation has completed.
func (*RejectHubSpokeOperation) Metadata
func(op*RejectHubSpokeOperation)Metadata()(*networkconnectivitypb.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 (*RejectHubSpokeOperation) Name
func(op*RejectHubSpokeOperation)Name()stringName 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 (*RejectHubSpokeOperation) Poll
func(op*RejectHubSpokeOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*networkconnectivitypb.RejectHubSpokeResponse,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 andthe 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 (*RejectHubSpokeOperation) Wait
func(op*RejectHubSpokeOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*networkconnectivitypb.RejectHubSpokeResponse,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.
RejectSpokeUpdateOperation
typeRejectSpokeUpdateOperationstruct{// contains filtered or unexported fields}RejectSpokeUpdateOperation manages a long-running operation from RejectSpokeUpdate.
func (*RejectSpokeUpdateOperation) Done
func(op*RejectSpokeUpdateOperation)Done()boolDone reports whether the long-running operation has completed.
func (*RejectSpokeUpdateOperation) Metadata
func(op*RejectSpokeUpdateOperation)Metadata()(*networkconnectivitypb.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 (*RejectSpokeUpdateOperation) Name
func(op*RejectSpokeUpdateOperation)Name()stringName 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 (*RejectSpokeUpdateOperation) Poll
func(op*RejectSpokeUpdateOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*networkconnectivitypb.RejectSpokeUpdateResponse,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 andthe 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 (*RejectSpokeUpdateOperation) Wait
func(op*RejectSpokeUpdateOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*networkconnectivitypb.RejectSpokeUpdateResponse,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.
RouteIterator
typeRouteIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*networkconnectivitypb.Route,nextPageTokenstring,errerror)// contains filtered or unexported fields}RouteIterator manages a stream of *networkconnectivitypb.Route.
func (*RouteIterator) All
func(it*RouteIterator)All()iter.Seq2[*networkconnectivitypb.Route,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*RouteIterator) Next
func(it*RouteIterator)Next()(*networkconnectivitypb.Route,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*RouteIterator) PageInfo
func(it*RouteIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
RouteTableIterator
typeRouteTableIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*networkconnectivitypb.RouteTable,nextPageTokenstring,errerror)// contains filtered or unexported fields}RouteTableIterator manages a stream of *networkconnectivitypb.RouteTable.
func (*RouteTableIterator) All
func(it*RouteTableIterator)All()iter.Seq2[*networkconnectivitypb.RouteTable,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*RouteTableIterator) Next
func(it*RouteTableIterator)Next()(*networkconnectivitypb.RouteTable,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*RouteTableIterator) PageInfo
func(it*RouteTableIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
ServiceClassIterator
typeServiceClassIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*networkconnectivitypb.ServiceClass,nextPageTokenstring,errerror)// contains filtered or unexported fields}ServiceClassIterator manages a stream of *networkconnectivitypb.ServiceClass.
func (*ServiceClassIterator) All
func(it*ServiceClassIterator)All()iter.Seq2[*networkconnectivitypb.ServiceClass,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*ServiceClassIterator) Next
func(it*ServiceClassIterator)Next()(*networkconnectivitypb.ServiceClass,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*ServiceClassIterator) PageInfo
func(it*ServiceClassIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
ServiceConnectionMapIterator
typeServiceConnectionMapIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*networkconnectivitypb.ServiceConnectionMap,nextPageTokenstring,errerror)// contains filtered or unexported fields}ServiceConnectionMapIterator manages a stream of *networkconnectivitypb.ServiceConnectionMap.
func (*ServiceConnectionMapIterator) All
func(it*ServiceConnectionMapIterator)All()iter.Seq2[*networkconnectivitypb.ServiceConnectionMap,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*ServiceConnectionMapIterator) Next
func(it*ServiceConnectionMapIterator)Next()(*networkconnectivitypb.ServiceConnectionMap,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*ServiceConnectionMapIterator) PageInfo
func(it*ServiceConnectionMapIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
ServiceConnectionPolicyIterator
typeServiceConnectionPolicyIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*networkconnectivitypb.ServiceConnectionPolicy,nextPageTokenstring,errerror)// contains filtered or unexported fields}ServiceConnectionPolicyIterator manages a stream of *networkconnectivitypb.ServiceConnectionPolicy.
func (*ServiceConnectionPolicyIterator) All
func(it*ServiceConnectionPolicyIterator)All()iter.Seq2[*networkconnectivitypb.ServiceConnectionPolicy,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*ServiceConnectionPolicyIterator) Next
func(it*ServiceConnectionPolicyIterator)Next()(*networkconnectivitypb.ServiceConnectionPolicy,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*ServiceConnectionPolicyIterator) PageInfo
func(it*ServiceConnectionPolicyIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
ServiceConnectionTokenIterator
typeServiceConnectionTokenIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*networkconnectivitypb.ServiceConnectionToken,nextPageTokenstring,errerror)// contains filtered or unexported fields}ServiceConnectionTokenIterator manages a stream of *networkconnectivitypb.ServiceConnectionToken.
func (*ServiceConnectionTokenIterator) All
func(it*ServiceConnectionTokenIterator)All()iter.Seq2[*networkconnectivitypb.ServiceConnectionToken,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*ServiceConnectionTokenIterator) Next
func(it*ServiceConnectionTokenIterator)Next()(*networkconnectivitypb.ServiceConnectionToken,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*ServiceConnectionTokenIterator) PageInfo
func(it*ServiceConnectionTokenIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
SpokeIterator
typeSpokeIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*networkconnectivitypb.Spoke,nextPageTokenstring,errerror)// contains filtered or unexported fields}SpokeIterator manages a stream of *networkconnectivitypb.Spoke.
func (*SpokeIterator) All
func(it*SpokeIterator)All()iter.Seq2[*networkconnectivitypb.Spoke,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*SpokeIterator) Next
func(it*SpokeIterator)Next()(*networkconnectivitypb.Spoke,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*SpokeIterator) PageInfo
func(it*SpokeIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
UpdateDestinationOperation
typeUpdateDestinationOperationstruct{// contains filtered or unexported fields}UpdateDestinationOperation manages a long-running operation from UpdateDestination.
func (*UpdateDestinationOperation) Done
func(op*UpdateDestinationOperation)Done()boolDone reports whether the long-running operation has completed.
func (*UpdateDestinationOperation) Metadata
func(op*UpdateDestinationOperation)Metadata()(*networkconnectivitypb.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 (*UpdateDestinationOperation) Name
func(op*UpdateDestinationOperation)Name()stringName 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 (*UpdateDestinationOperation) Poll
func(op*UpdateDestinationOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*networkconnectivitypb.Destination,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 andthe 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 (*UpdateDestinationOperation) Wait
func(op*UpdateDestinationOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*networkconnectivitypb.Destination,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.
UpdateGroupOperation
typeUpdateGroupOperationstruct{// contains filtered or unexported fields}UpdateGroupOperation manages a long-running operation from UpdateGroup.
func (*UpdateGroupOperation) Done
func(op*UpdateGroupOperation)Done()boolDone reports whether the long-running operation has completed.
func (*UpdateGroupOperation) Metadata
func(op*UpdateGroupOperation)Metadata()(*networkconnectivitypb.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 (*UpdateGroupOperation) Name
func(op*UpdateGroupOperation)Name()stringName 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 (*UpdateGroupOperation) Poll
func(op*UpdateGroupOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*networkconnectivitypb.Group,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 andthe 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 (*UpdateGroupOperation) Wait
func(op*UpdateGroupOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*networkconnectivitypb.Group,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.
UpdateHubOperation
typeUpdateHubOperationstruct{// contains filtered or unexported fields}UpdateHubOperation manages a long-running operation from UpdateHub.
func (*UpdateHubOperation) Done
func(op*UpdateHubOperation)Done()boolDone reports whether the long-running operation has completed.
func (*UpdateHubOperation) Metadata
func(op*UpdateHubOperation)Metadata()(*networkconnectivitypb.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 (*UpdateHubOperation) Name
func(op*UpdateHubOperation)Name()stringName 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 (*UpdateHubOperation) Poll
func(op*UpdateHubOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*networkconnectivitypb.Hub,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 andthe 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 (*UpdateHubOperation) Wait
func(op*UpdateHubOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*networkconnectivitypb.Hub,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.
UpdateInternalRangeOperation
typeUpdateInternalRangeOperationstruct{// contains filtered or unexported fields}UpdateInternalRangeOperation manages a long-running operation from UpdateInternalRange.
func (*UpdateInternalRangeOperation) Done
func(op*UpdateInternalRangeOperation)Done()boolDone reports whether the long-running operation has completed.
func (*UpdateInternalRangeOperation) Metadata
func(op*UpdateInternalRangeOperation)Metadata()(*networkconnectivitypb.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 (*UpdateInternalRangeOperation) Name
func(op*UpdateInternalRangeOperation)Name()stringName 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 (*UpdateInternalRangeOperation) Poll
func(op*UpdateInternalRangeOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*networkconnectivitypb.InternalRange,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 andthe 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 (*UpdateInternalRangeOperation) Wait
func(op*UpdateInternalRangeOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*networkconnectivitypb.InternalRange,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.
UpdateMulticloudDataTransferConfigOperation
typeUpdateMulticloudDataTransferConfigOperationstruct{// contains filtered or unexported fields}UpdateMulticloudDataTransferConfigOperation manages a long-running operation from UpdateMulticloudDataTransferConfig.
func (*UpdateMulticloudDataTransferConfigOperation) Done
func(op*UpdateMulticloudDataTransferConfigOperation)Done()boolDone reports whether the long-running operation has completed.
func (*UpdateMulticloudDataTransferConfigOperation) Metadata
func(op*UpdateMulticloudDataTransferConfigOperation)Metadata()(*networkconnectivitypb.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 (*UpdateMulticloudDataTransferConfigOperation) Name
func(op*UpdateMulticloudDataTransferConfigOperation)Name()stringName 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 (*UpdateMulticloudDataTransferConfigOperation) Poll
func(op*UpdateMulticloudDataTransferConfigOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*networkconnectivitypb.MulticloudDataTransferConfig,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 andthe 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 (*UpdateMulticloudDataTransferConfigOperation) Wait
func(op*UpdateMulticloudDataTransferConfigOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*networkconnectivitypb.MulticloudDataTransferConfig,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.
UpdateServiceClassOperation
typeUpdateServiceClassOperationstruct{// contains filtered or unexported fields}UpdateServiceClassOperation manages a long-running operation from UpdateServiceClass.
func (*UpdateServiceClassOperation) Done
func(op*UpdateServiceClassOperation)Done()boolDone reports whether the long-running operation has completed.
func (*UpdateServiceClassOperation) Metadata
func(op*UpdateServiceClassOperation)Metadata()(*networkconnectivitypb.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 (*UpdateServiceClassOperation) Name
func(op*UpdateServiceClassOperation)Name()stringName 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 (*UpdateServiceClassOperation) Poll
func(op*UpdateServiceClassOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*networkconnectivitypb.ServiceClass,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 andthe 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 (*UpdateServiceClassOperation) Wait
func(op*UpdateServiceClassOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*networkconnectivitypb.ServiceClass,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.
UpdateServiceConnectionMapOperation
typeUpdateServiceConnectionMapOperationstruct{// contains filtered or unexported fields}UpdateServiceConnectionMapOperation manages a long-running operation from UpdateServiceConnectionMap.
func (*UpdateServiceConnectionMapOperation) Done
func(op*UpdateServiceConnectionMapOperation)Done()boolDone reports whether the long-running operation has completed.
func (*UpdateServiceConnectionMapOperation) Metadata
func(op*UpdateServiceConnectionMapOperation)Metadata()(*networkconnectivitypb.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 (*UpdateServiceConnectionMapOperation) Name
func(op*UpdateServiceConnectionMapOperation)Name()stringName 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 (*UpdateServiceConnectionMapOperation) Poll
func(op*UpdateServiceConnectionMapOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*networkconnectivitypb.ServiceConnectionMap,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 andthe 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 (*UpdateServiceConnectionMapOperation) Wait
func(op*UpdateServiceConnectionMapOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*networkconnectivitypb.ServiceConnectionMap,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.
UpdateServiceConnectionPolicyOperation
typeUpdateServiceConnectionPolicyOperationstruct{// contains filtered or unexported fields}UpdateServiceConnectionPolicyOperation manages a long-running operation from UpdateServiceConnectionPolicy.
func (*UpdateServiceConnectionPolicyOperation) Done
func(op*UpdateServiceConnectionPolicyOperation)Done()boolDone reports whether the long-running operation has completed.
func (*UpdateServiceConnectionPolicyOperation) Metadata
func(op*UpdateServiceConnectionPolicyOperation)Metadata()(*networkconnectivitypb.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 (*UpdateServiceConnectionPolicyOperation) Name
func(op*UpdateServiceConnectionPolicyOperation)Name()stringName 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 (*UpdateServiceConnectionPolicyOperation) Poll
func(op*UpdateServiceConnectionPolicyOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*networkconnectivitypb.ServiceConnectionPolicy,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 andthe 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 (*UpdateServiceConnectionPolicyOperation) Wait
func(op*UpdateServiceConnectionPolicyOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*networkconnectivitypb.ServiceConnectionPolicy,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.
UpdateSpokeOperation
typeUpdateSpokeOperationstruct{// contains filtered or unexported fields}UpdateSpokeOperation manages a long-running operation from UpdateSpoke.
func (*UpdateSpokeOperation) Done
func(op*UpdateSpokeOperation)Done()boolDone reports whether the long-running operation has completed.
func (*UpdateSpokeOperation) Metadata
func(op*UpdateSpokeOperation)Metadata()(*networkconnectivitypb.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 (*UpdateSpokeOperation) Name
func(op*UpdateSpokeOperation)Name()stringName 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 (*UpdateSpokeOperation) Poll
func(op*UpdateSpokeOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*networkconnectivitypb.Spoke,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 andthe 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 (*UpdateSpokeOperation) Wait
func(op*UpdateSpokeOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*networkconnectivitypb.Spoke,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.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-10-30 UTC.