Package networkconnectivity is an auto-generated package for the Network Connectivity API.
This API enables connectivity with and between Google Cloud resources.
NOTE: This package is in beta. It is not stable, and may be subject to changes.
General documentation
For information that is relevant for all client libraries please reference https://pkg.go.dev/cloud.google.com/go#pkg-overview. Some information on this page includes:
- Authentication and Authorization
- Timeouts and Cancellation
- Testing against Client Libraries
- Debugging Client Libraries
- Inspecting errors
Example usage
To get started with this package, create a client.
// go get cloud.google.com/go/networkconnectivity/apiv1beta@latest ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := networkconnectivity.NewDataTransferClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close()
The client will use your default application credentials. Clients should be reused instead of created as needed. The methods of Client are safe for concurrent use by multiple goroutines. The returned client must be Closed when it is done being used.
Using the Client
The following is an example of making an API call with the newly created client, mentioned above.
req := &networkconnectivitypb.CreateDestinationRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#CreateDestinationRequest. } op, err := c.CreateDestination(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp
Use of Context
The ctx passed to NewDataTransferClient is used for authentication requests and for creating the underlying connection, but is not used for subsequent calls. Individual methods on the client use the ctx given to them.
To close the open connection, use the Close() method.
Functions
func DefaultAuthScopes
func DefaultAuthScopes() []stringDefaultAuthScopes reports the default set of authentication scopes to use with this package.
AcceptHubSpokeOperation
type AcceptHubSpokeOperation struct {
// 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(ctx context.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 and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*AcceptHubSpokeOperation) Wait
func (op *AcceptHubSpokeOperation) Wait(ctx context.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
type AcceptSpokeUpdateOperation struct {
// 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(ctx context.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 and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*AcceptSpokeUpdateOperation) Wait
func (op *AcceptSpokeUpdateOperation) Wait(ctx context.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
type CreateDestinationOperation struct {
// 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(ctx context.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 and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*CreateDestinationOperation) Wait
func (op *CreateDestinationOperation) Wait(ctx context.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.
CreateGatewayAdvertisedRouteOperation
type CreateGatewayAdvertisedRouteOperation struct {
// contains filtered or unexported fields
}CreateGatewayAdvertisedRouteOperation manages a long-running operation from CreateGatewayAdvertisedRoute.
func (*CreateGatewayAdvertisedRouteOperation) Done
func (op *CreateGatewayAdvertisedRouteOperation) Done() boolDone reports whether the long-running operation has completed.
func (*CreateGatewayAdvertisedRouteOperation) Metadata
func (op *CreateGatewayAdvertisedRouteOperation) 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 (*CreateGatewayAdvertisedRouteOperation) Name
func (op *CreateGatewayAdvertisedRouteOperation) 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 (*CreateGatewayAdvertisedRouteOperation) Poll
func (op *CreateGatewayAdvertisedRouteOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*networkconnectivitypb.GatewayAdvertisedRoute, error)Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*CreateGatewayAdvertisedRouteOperation) Wait
func (op *CreateGatewayAdvertisedRouteOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*networkconnectivitypb.GatewayAdvertisedRoute, 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
type CreateHubOperation struct {
// 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(ctx context.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 and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*CreateHubOperation) Wait
func (op *CreateHubOperation) Wait(ctx context.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.
CreateMulticloudDataTransferConfigOperation
type CreateMulticloudDataTransferConfigOperation struct {
// 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(ctx context.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 and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*CreateMulticloudDataTransferConfigOperation) Wait
func (op *CreateMulticloudDataTransferConfigOperation) Wait(ctx context.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
type CreatePolicyBasedRouteOperation struct {
// 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(ctx context.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 and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*CreatePolicyBasedRouteOperation) Wait
func (op *CreatePolicyBasedRouteOperation) Wait(ctx context.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.
CreateSpokeOperation
type CreateSpokeOperation struct {
// 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(ctx context.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 and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*CreateSpokeOperation) Wait
func (op *CreateSpokeOperation) Wait(ctx context.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.
CreateTransportOperation
type CreateTransportOperation struct {
// contains filtered or unexported fields
}CreateTransportOperation manages a long-running operation from CreateTransport.
func (*CreateTransportOperation) Done
func (op *CreateTransportOperation) Done() boolDone reports whether the long-running operation has completed.
func (*CreateTransportOperation) Metadata
func (op *CreateTransportOperation) 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 (*CreateTransportOperation) Name
func (op *CreateTransportOperation) 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 (*CreateTransportOperation) Poll
func (op *CreateTransportOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*networkconnectivitypb.Transport, error)Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*CreateTransportOperation) Wait
func (op *CreateTransportOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*networkconnectivitypb.Transport, 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.
DataTransferCallOptions
type DataTransferCallOptions struct {
ListMulticloudDataTransferConfigs []gax.CallOption
GetMulticloudDataTransferConfig []gax.CallOption
CreateMulticloudDataTransferConfig []gax.CallOption
UpdateMulticloudDataTransferConfig []gax.CallOption
DeleteMulticloudDataTransferConfig []gax.CallOption
ListDestinations []gax.CallOption
GetDestination []gax.CallOption
CreateDestination []gax.CallOption
UpdateDestination []gax.CallOption
DeleteDestination []gax.CallOption
GetMulticloudDataTransferSupportedService []gax.CallOption
ListMulticloudDataTransferSupportedServices []gax.CallOption
GetLocation []gax.CallOption
ListLocations []gax.CallOption
GetIamPolicy []gax.CallOption
SetIamPolicy []gax.CallOption
TestIamPermissions []gax.CallOption
CancelOperation []gax.CallOption
DeleteOperation []gax.CallOption
GetOperation []gax.CallOption
ListOperations []gax.CallOption
}DataTransferCallOptions contains the retry settings for each method of DataTransferClient.
DataTransferClient
type DataTransferClient struct {
// 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
func NewDataTransferClient(ctx context.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
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewDataTransferClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*DataTransferClient) CancelOperation
func (c *DataTransferClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) errorCancelOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewDataTransferClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*DataTransferClient) Close
func (c *DataTransferClient) Close() errorClose closes the connection to the API service. The user should invoke this when the 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 always return the same resource.
func (*DataTransferClient) CreateDestination
func (c *DataTransferClient) CreateDestination(ctx context.Context, req *networkconnectivitypb.CreateDestinationRequest, opts ...gax.CallOption) (*CreateDestinationOperation, error)CreateDestination creates a Destination resource in a specified project and location.
Example
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewDataTransferClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.CreateDestinationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#CreateDestinationRequest.
}
op, err := c.CreateDestination(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DataTransferClient) CreateDestinationOperation
func (c *DataTransferClient) CreateDestinationOperation(name string) *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(ctx context.Context, req *networkconnectivitypb.CreateMulticloudDataTransferConfigRequest, opts ...gax.CallOption) (*CreateMulticloudDataTransferConfigOperation, error)CreateMulticloudDataTransferConfig creates a MulticloudDataTransferConfig resource in a specified project and location.
Example
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewDataTransferClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.CreateMulticloudDataTransferConfigRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#CreateMulticloudDataTransferConfigRequest.
}
op, err := c.CreateMulticloudDataTransferConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DataTransferClient) CreateMulticloudDataTransferConfigOperation
func (c *DataTransferClient) CreateMulticloudDataTransferConfigOperation(name string) *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(ctx context.Context, req *networkconnectivitypb.DeleteDestinationRequest, opts ...gax.CallOption) (*DeleteDestinationOperation, error)DeleteDestination deletes a Destination resource.
Example
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewDataTransferClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.DeleteDestinationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#DeleteDestinationRequest.
}
op, err := c.DeleteDestination(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*DataTransferClient) DeleteDestinationOperation
func (c *DataTransferClient) DeleteDestinationOperation(name string) *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(ctx context.Context, req *networkconnectivitypb.DeleteMulticloudDataTransferConfigRequest, opts ...gax.CallOption) (*DeleteMulticloudDataTransferConfigOperation, error)DeleteMulticloudDataTransferConfig deletes a MulticloudDataTransferConfig resource.
Example
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewDataTransferClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.DeleteMulticloudDataTransferConfigRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#DeleteMulticloudDataTransferConfigRequest.
}
op, err := c.DeleteMulticloudDataTransferConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*DataTransferClient) DeleteMulticloudDataTransferConfigOperation
func (c *DataTransferClient) DeleteMulticloudDataTransferConfigOperation(name string) *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(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) errorDeleteOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewDataTransferClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.DeleteOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.
}
err = c.DeleteOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*DataTransferClient) GetDestination
func (c *DataTransferClient) GetDestination(ctx context.Context, req *networkconnectivitypb.GetDestinationRequest, opts ...gax.CallOption) (*networkconnectivitypb.Destination, error)GetDestination gets the details of a Destination resource.
Example
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewDataTransferClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.GetDestinationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#GetDestinationRequest.
}
resp, err := c.GetDestination(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DataTransferClient) GetIamPolicy
func (c *DataTransferClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)GetIamPolicy gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.
Example
package main
import (
"context"
iampb "cloud.google.com/go/iam/apiv1/iampb"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewDataTransferClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.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)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DataTransferClient) GetLocation
func (c *DataTransferClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)GetLocation gets information about a location.
Example
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewDataTransferClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.GetLocationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#GetLocationRequest.
}
resp, err := c.GetLocation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DataTransferClient) GetMulticloudDataTransferConfig
func (c *DataTransferClient) GetMulticloudDataTransferConfig(ctx context.Context, req *networkconnectivitypb.GetMulticloudDataTransferConfigRequest, opts ...gax.CallOption) (*networkconnectivitypb.MulticloudDataTransferConfig, error)GetMulticloudDataTransferConfig gets the details of a MulticloudDataTransferConfig resource.
Example
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewDataTransferClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.GetMulticloudDataTransferConfigRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#GetMulticloudDataTransferConfigRequest.
}
resp, err := c.GetMulticloudDataTransferConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DataTransferClient) GetMulticloudDataTransferSupportedService
func (c *DataTransferClient) GetMulticloudDataTransferSupportedService(ctx context.Context, req *networkconnectivitypb.GetMulticloudDataTransferSupportedServiceRequest, opts ...gax.CallOption) (*networkconnectivitypb.MulticloudDataTransferSupportedService, error)GetMulticloudDataTransferSupportedService gets the details of a service that is supported for Data Transfer Essentials.
Example
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewDataTransferClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.GetMulticloudDataTransferSupportedServiceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#GetMulticloudDataTransferSupportedServiceRequest.
}
resp, err := c.GetMulticloudDataTransferSupportedService(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DataTransferClient) GetOperation
func (c *DataTransferClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)GetOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewDataTransferClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DataTransferClient) ListDestinations
func (c *DataTransferClient) ListDestinations(ctx context.Context, req *networkconnectivitypb.ListDestinationsRequest, opts ...gax.CallOption) *DestinationIteratorListDestinations lists the Destination resources in a specified project and location.
Examples
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewDataTransferClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.ListDestinationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#ListDestinationsRequest.
}
it := c.ListDestinations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*networkconnectivitypb.ListDestinationsResponse)
}
}
all
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewDataTransferClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.ListDestinationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#ListDestinationsRequest.
}
for resp, err := range c.ListDestinations(ctx, req).All() {
if err != 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(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIteratorListLocations lists information about the supported locations for this service. This method can be called in two ways:
List all public locations: Use the path GET /v1/locations.
List project-visible locations: Use the path
GET /v1/projects/{project_id}/locations. This may include public
locations as well as private or other locations specifically visible
to the project.
Examples
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
"google.golang.org/api/iterator"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewDataTransferClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
it := c.ListLocations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*locationpb.ListLocationsResponse)
}
}
all
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewDataTransferClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
for resp, err := range c.ListLocations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*DataTransferClient) ListMulticloudDataTransferConfigs
func (c *DataTransferClient) ListMulticloudDataTransferConfigs(ctx context.Context, req *networkconnectivitypb.ListMulticloudDataTransferConfigsRequest, opts ...gax.CallOption) *MulticloudDataTransferConfigIteratorListMulticloudDataTransferConfigs lists the MulticloudDataTransferConfig resources in a specified project and location.
Examples
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewDataTransferClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.ListMulticloudDataTransferConfigsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#ListMulticloudDataTransferConfigsRequest.
}
it := c.ListMulticloudDataTransferConfigs(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*networkconnectivitypb.ListMulticloudDataTransferConfigsResponse)
}
}
all
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewDataTransferClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.ListMulticloudDataTransferConfigsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#ListMulticloudDataTransferConfigsRequest.
}
for resp, err := range c.ListMulticloudDataTransferConfigs(ctx, req).All() {
if err != 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(ctx context.Context, req *networkconnectivitypb.ListMulticloudDataTransferSupportedServicesRequest, opts ...gax.CallOption) *MulticloudDataTransferSupportedServiceIteratorListMulticloudDataTransferSupportedServices lists the services in the project for a region that are supported for Data Transfer Essentials.
Examples
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewDataTransferClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.ListMulticloudDataTransferSupportedServicesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#ListMulticloudDataTransferSupportedServicesRequest.
}
it := c.ListMulticloudDataTransferSupportedServices(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*networkconnectivitypb.ListMulticloudDataTransferSupportedServicesResponse)
}
}
all
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewDataTransferClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.ListMulticloudDataTransferSupportedServicesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#ListMulticloudDataTransferSupportedServicesRequest.
}
for resp, err := range c.ListMulticloudDataTransferSupportedServices(ctx, req).All() {
if err != 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(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
package main
import (
"context"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewDataTransferClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
it := c.ListOperations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*longrunningpb.ListOperationsResponse)
}
}
all
package main
import (
"context"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewDataTransferClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
for resp, err := range c.ListOperations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*DataTransferClient) SetIamPolicy
func (c *DataTransferClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.
Example
package main
import (
"context"
iampb "cloud.google.com/go/iam/apiv1/iampb"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewDataTransferClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.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)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DataTransferClient) TestIamPermissions
func (c *DataTransferClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error)TestIamPermissions returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.
Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may “fail open” without warning.
Example
package main
import (
"context"
iampb "cloud.google.com/go/iam/apiv1/iampb"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewDataTransferClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.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)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DataTransferClient) UpdateDestination
func (c *DataTransferClient) UpdateDestination(ctx context.Context, req *networkconnectivitypb.UpdateDestinationRequest, opts ...gax.CallOption) (*UpdateDestinationOperation, error)UpdateDestination updates a Destination resource in a specified project and location.
Example
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewDataTransferClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.UpdateDestinationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#UpdateDestinationRequest.
}
op, err := c.UpdateDestination(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DataTransferClient) UpdateDestinationOperation
func (c *DataTransferClient) UpdateDestinationOperation(name string) *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(ctx context.Context, req *networkconnectivitypb.UpdateMulticloudDataTransferConfigRequest, opts ...gax.CallOption) (*UpdateMulticloudDataTransferConfigOperation, error)UpdateMulticloudDataTransferConfig updates a MulticloudDataTransferConfig resource in a specified project and location.
Example
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewDataTransferClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.UpdateMulticloudDataTransferConfigRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#UpdateMulticloudDataTransferConfigRequest.
}
op, err := c.UpdateMulticloudDataTransferConfig(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DataTransferClient) UpdateMulticloudDataTransferConfigOperation
func (c *DataTransferClient) UpdateMulticloudDataTransferConfigOperation(name string) *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
type DeleteDestinationOperation struct {
// 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(ctx context.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 and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*DeleteDestinationOperation) Wait
func (op *DeleteDestinationOperation) Wait(ctx context.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.
DeleteGatewayAdvertisedRouteOperation
type DeleteGatewayAdvertisedRouteOperation struct {
// contains filtered or unexported fields
}DeleteGatewayAdvertisedRouteOperation manages a long-running operation from DeleteGatewayAdvertisedRoute.
func (*DeleteGatewayAdvertisedRouteOperation) Done
func (op *DeleteGatewayAdvertisedRouteOperation) Done() boolDone reports whether the long-running operation has completed.
func (*DeleteGatewayAdvertisedRouteOperation) Metadata
func (op *DeleteGatewayAdvertisedRouteOperation) 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 (*DeleteGatewayAdvertisedRouteOperation) Name
func (op *DeleteGatewayAdvertisedRouteOperation) 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 (*DeleteGatewayAdvertisedRouteOperation) Poll
func (op *DeleteGatewayAdvertisedRouteOperation) Poll(ctx context.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 and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*DeleteGatewayAdvertisedRouteOperation) Wait
func (op *DeleteGatewayAdvertisedRouteOperation) Wait(ctx context.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
type DeleteHubOperation struct {
// 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(ctx context.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 and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*DeleteHubOperation) Wait
func (op *DeleteHubOperation) Wait(ctx context.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
type DeleteMulticloudDataTransferConfigOperation struct {
// 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(ctx context.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 and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*DeleteMulticloudDataTransferConfigOperation) Wait
func (op *DeleteMulticloudDataTransferConfigOperation) Wait(ctx context.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
type DeletePolicyBasedRouteOperation struct {
// 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(ctx context.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 and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*DeletePolicyBasedRouteOperation) Wait
func (op *DeletePolicyBasedRouteOperation) Wait(ctx context.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
type DeleteSpokeOperation struct {
// 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(ctx context.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 and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*DeleteSpokeOperation) Wait
func (op *DeleteSpokeOperation) Wait(ctx context.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.
DeleteTransportOperation
type DeleteTransportOperation struct {
// contains filtered or unexported fields
}DeleteTransportOperation manages a long-running operation from DeleteTransport.
func (*DeleteTransportOperation) Done
func (op *DeleteTransportOperation) Done() boolDone reports whether the long-running operation has completed.
func (*DeleteTransportOperation) Metadata
func (op *DeleteTransportOperation) 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 (*DeleteTransportOperation) Name
func (op *DeleteTransportOperation) 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 (*DeleteTransportOperation) Poll
func (op *DeleteTransportOperation) Poll(ctx context.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 and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*DeleteTransportOperation) Wait
func (op *DeleteTransportOperation) Wait(ctx context.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
type DestinationIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*networkconnectivitypb.Destination, nextPageToken string, err error)
// 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, the iterator 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 more results. 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.
GatewayAdvertisedRouteIterator
type GatewayAdvertisedRouteIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*networkconnectivitypb.GatewayAdvertisedRoute, nextPageToken string, err error)
// contains filtered or unexported fields
}GatewayAdvertisedRouteIterator manages a stream of *networkconnectivitypb.GatewayAdvertisedRoute.
func (*GatewayAdvertisedRouteIterator) All
func (it *GatewayAdvertisedRouteIterator) All() iter.Seq2[*networkconnectivitypb.GatewayAdvertisedRoute, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*GatewayAdvertisedRouteIterator) Next
func (it *GatewayAdvertisedRouteIterator) Next() (*networkconnectivitypb.GatewayAdvertisedRoute, error)Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*GatewayAdvertisedRouteIterator) PageInfo
func (it *GatewayAdvertisedRouteIterator) PageInfo() *iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
GroupIterator
type GroupIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*networkconnectivitypb.Group, nextPageToken string, err error)
// 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, the iterator 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 more results. 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
type HubCallOptions struct {
ListHubs []gax.CallOption
GetHub []gax.CallOption
CreateHub []gax.CallOption
UpdateHub []gax.CallOption
DeleteHub []gax.CallOption
ListHubSpokes []gax.CallOption
QueryHubStatus []gax.CallOption
ListSpokes []gax.CallOption
GetSpoke []gax.CallOption
CreateSpoke []gax.CallOption
UpdateSpoke []gax.CallOption
RejectHubSpoke []gax.CallOption
AcceptHubSpoke []gax.CallOption
AcceptSpokeUpdate []gax.CallOption
RejectSpokeUpdate []gax.CallOption
DeleteSpoke []gax.CallOption
GetRouteTable []gax.CallOption
GetRoute []gax.CallOption
ListRoutes []gax.CallOption
ListRouteTables []gax.CallOption
GetGroup []gax.CallOption
ListGroups []gax.CallOption
UpdateGroup []gax.CallOption
CreateGatewayAdvertisedRoute []gax.CallOption
GetGatewayAdvertisedRoute []gax.CallOption
ListGatewayAdvertisedRoutes []gax.CallOption
UpdateGatewayAdvertisedRoute []gax.CallOption
DeleteGatewayAdvertisedRoute []gax.CallOption
GetLocation []gax.CallOption
ListLocations []gax.CallOption
GetIamPolicy []gax.CallOption
SetIamPolicy []gax.CallOption
TestIamPermissions []gax.CallOption
CancelOperation []gax.CallOption
DeleteOperation []gax.CallOption
GetOperation []gax.CallOption
ListOperations []gax.CallOption
}HubCallOptions contains the retry settings for each method of HubClient.
HubClient
type HubClient struct {
// 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 network connectivity management in Google Cloud. It reduces operational complexity through 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 network connectivity management in Google Cloud. It reduces operational complexity through a simple, centralized connectivity management model.
Example
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*HubClient) AcceptHubSpoke
func (c *HubClient) AcceptHubSpoke(ctx context.Context, req *networkconnectivitypb.AcceptHubSpokeRequest, opts ...gax.CallOption) (*AcceptHubSpokeOperation, error)AcceptHubSpoke accepts a proposal to attach a Network Connectivity Center spoke to a hub.
Example
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.AcceptHubSpokeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#AcceptHubSpokeRequest.
}
op, err := c.AcceptHubSpoke(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*HubClient) AcceptHubSpokeOperation
func (c *HubClient) AcceptHubSpokeOperation(name string) *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(ctx context.Context, req *networkconnectivitypb.AcceptSpokeUpdateRequest, opts ...gax.CallOption) (*AcceptSpokeUpdateOperation, error)AcceptSpokeUpdate accepts a proposal to update a Network Connectivity Center spoke in a hub.
Example
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.AcceptSpokeUpdateRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#AcceptSpokeUpdateRequest.
}
op, err := c.AcceptSpokeUpdate(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*HubClient) AcceptSpokeUpdateOperation
func (c *HubClient) AcceptSpokeUpdateOperation(name string) *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(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) errorCancelOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*HubClient) Close
Close closes the connection to the API service. The user should invoke this when the 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 always return the same resource.
func (*HubClient) CreateGatewayAdvertisedRoute
func (c *HubClient) CreateGatewayAdvertisedRoute(ctx context.Context, req *networkconnectivitypb.CreateGatewayAdvertisedRouteRequest, opts ...gax.CallOption) (*CreateGatewayAdvertisedRouteOperation, error)CreateGatewayAdvertisedRoute create a GatewayAdvertisedRoute
Example
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.CreateGatewayAdvertisedRouteRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#CreateGatewayAdvertisedRouteRequest.
}
op, err := c.CreateGatewayAdvertisedRoute(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*HubClient) CreateGatewayAdvertisedRouteOperation
func (c *HubClient) CreateGatewayAdvertisedRouteOperation(name string) *CreateGatewayAdvertisedRouteOperationCreateGatewayAdvertisedRouteOperation returns a new CreateGatewayAdvertisedRouteOperation from a given name. The name must be that of a previously created CreateGatewayAdvertisedRouteOperation, possibly from a different process.
func (*HubClient) CreateHub
func (c *HubClient) CreateHub(ctx context.Context, req *networkconnectivitypb.CreateHubRequest, opts ...gax.CallOption) (*CreateHubOperation, error)CreateHub creates a new Network Connectivity Center hub in the specified project.
Example
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.CreateHubRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#CreateHubRequest.
}
op, err := c.CreateHub(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*HubClient) CreateHubOperation
func (c *HubClient) CreateHubOperation(name string) *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(ctx context.Context, req *networkconnectivitypb.CreateSpokeRequest, opts ...gax.CallOption) (*CreateSpokeOperation, error)CreateSpoke creates a Network Connectivity Center spoke.
Example
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.CreateSpokeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#CreateSpokeRequest.
}
op, err := c.CreateSpoke(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*HubClient) CreateSpokeOperation
func (c *HubClient) CreateSpokeOperation(name string) *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) DeleteGatewayAdvertisedRoute
func (c *HubClient) DeleteGatewayAdvertisedRoute(ctx context.Context, req *networkconnectivitypb.DeleteGatewayAdvertisedRouteRequest, opts ...gax.CallOption) (*DeleteGatewayAdvertisedRouteOperation, error)DeleteGatewayAdvertisedRoute delete a GatewayAdvertisedRoute
Example
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.DeleteGatewayAdvertisedRouteRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#DeleteGatewayAdvertisedRouteRequest.
}
op, err := c.DeleteGatewayAdvertisedRoute(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*HubClient) DeleteGatewayAdvertisedRouteOperation
func (c *HubClient) DeleteGatewayAdvertisedRouteOperation(name string) *DeleteGatewayAdvertisedRouteOperationDeleteGatewayAdvertisedRouteOperation returns a new DeleteGatewayAdvertisedRouteOperation from a given name. The name must be that of a previously created DeleteGatewayAdvertisedRouteOperation, possibly from a different process.
func (*HubClient) DeleteHub
func (c *HubClient) DeleteHub(ctx context.Context, req *networkconnectivitypb.DeleteHubRequest, opts ...gax.CallOption) (*DeleteHubOperation, error)DeleteHub deletes a Network Connectivity Center hub.
Example
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.DeleteHubRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#DeleteHubRequest.
}
op, err := c.DeleteHub(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*HubClient) DeleteHubOperation
func (c *HubClient) DeleteHubOperation(name string) *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(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) errorDeleteOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.DeleteOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.
}
err = c.DeleteOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*HubClient) DeleteSpoke
func (c *HubClient) DeleteSpoke(ctx context.Context, req *networkconnectivitypb.DeleteSpokeRequest, opts ...gax.CallOption) (*DeleteSpokeOperation, error)DeleteSpoke deletes a Network Connectivity Center spoke.
Example
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.DeleteSpokeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#DeleteSpokeRequest.
}
op, err := c.DeleteSpoke(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*HubClient) DeleteSpokeOperation
func (c *HubClient) DeleteSpokeOperation(name string) *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) GetGatewayAdvertisedRoute
func (c *HubClient) GetGatewayAdvertisedRoute(ctx context.Context, req *networkconnectivitypb.GetGatewayAdvertisedRouteRequest, opts ...gax.CallOption) (*networkconnectivitypb.GatewayAdvertisedRoute, error)GetGatewayAdvertisedRoute get a GatewayAdvertisedRoute
Example
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.GetGatewayAdvertisedRouteRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#GetGatewayAdvertisedRouteRequest.
}
resp, err := c.GetGatewayAdvertisedRoute(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*HubClient) GetGroup
func (c *HubClient) GetGroup(ctx context.Context, req *networkconnectivitypb.GetGroupRequest, opts ...gax.CallOption) (*networkconnectivitypb.Group, error)GetGroup gets details about a Network Connectivity Center group.
Example
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.GetGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#GetGroupRequest.
}
resp, err := c.GetGroup(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*HubClient) GetHub
func (c *HubClient) GetHub(ctx context.Context, req *networkconnectivitypb.GetHubRequest, opts ...gax.CallOption) (*networkconnectivitypb.Hub, error)GetHub gets details about a Network Connectivity Center hub.
Example
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.GetHubRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#GetHubRequest.
}
resp, err := c.GetHub(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*HubClient) GetIamPolicy
func (c *HubClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)GetIamPolicy gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.
Example
package main
import (
"context"
iampb "cloud.google.com/go/iam/apiv1/iampb"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.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)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*HubClient) GetLocation
func (c *HubClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)GetLocation gets information about a location.
Example
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.GetLocationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#GetLocationRequest.
}
resp, err := c.GetLocation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*HubClient) GetOperation
func (c *HubClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)GetOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*HubClient) GetRoute
func (c *HubClient) GetRoute(ctx context.Context, req *networkconnectivitypb.GetRouteRequest, opts ...gax.CallOption) (*networkconnectivitypb.Route, error)GetRoute gets details about the specified route.
Example
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.GetRouteRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#GetRouteRequest.
}
resp, err := c.GetRoute(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*HubClient) GetRouteTable
func (c *HubClient) GetRouteTable(ctx context.Context, req *networkconnectivitypb.GetRouteTableRequest, opts ...gax.CallOption) (*networkconnectivitypb.RouteTable, error)GetRouteTable gets details about a Network Connectivity Center route table.
Example
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.GetRouteTableRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#GetRouteTableRequest.
}
resp, err := c.GetRouteTable(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*HubClient) GetSpoke
func (c *HubClient) GetSpoke(ctx context.Context, req *networkconnectivitypb.GetSpokeRequest, opts ...gax.CallOption) (*networkconnectivitypb.Spoke, error)GetSpoke gets details about a Network Connectivity Center spoke.
Example
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.GetSpokeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#GetSpokeRequest.
}
resp, err := c.GetSpoke(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*HubClient) ListGatewayAdvertisedRoutes
func (c *HubClient) ListGatewayAdvertisedRoutes(ctx context.Context, req *networkconnectivitypb.ListGatewayAdvertisedRoutesRequest, opts ...gax.CallOption) *GatewayAdvertisedRouteIteratorListGatewayAdvertisedRoutes list GatewayAdvertisedRoutes
Examples
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.ListGatewayAdvertisedRoutesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#ListGatewayAdvertisedRoutesRequest.
}
it := c.ListGatewayAdvertisedRoutes(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*networkconnectivitypb.ListGatewayAdvertisedRoutesResponse)
}
}
all
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.ListGatewayAdvertisedRoutesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#ListGatewayAdvertisedRoutesRequest.
}
for resp, err := range c.ListGatewayAdvertisedRoutes(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*HubClient) ListGroups
func (c *HubClient) ListGroups(ctx context.Context, req *networkconnectivitypb.ListGroupsRequest, opts ...gax.CallOption) *GroupIteratorListGroups lists groups in a given hub.
Examples
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.ListGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#ListGroupsRequest.
}
it := c.ListGroups(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*networkconnectivitypb.ListGroupsResponse)
}
}
all
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.ListGroupsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#ListGroupsRequest.
}
for resp, err := range c.ListGroups(ctx, req).All() {
if err != 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(ctx context.Context, req *networkconnectivitypb.ListHubSpokesRequest, opts ...gax.CallOption) *SpokeIteratorListHubSpokes lists the Network Connectivity Center spokes associated with a specified hub and location. The list includes both spokes that are attached to the hub and spokes that have been proposed but not yet accepted.
Examples
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.ListHubSpokesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#ListHubSpokesRequest.
}
it := c.ListHubSpokes(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*networkconnectivitypb.ListHubSpokesResponse)
}
}
all
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.ListHubSpokesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#ListHubSpokesRequest.
}
for resp, err := range c.ListHubSpokes(ctx, req).All() {
if err != 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(ctx context.Context, req *networkconnectivitypb.ListHubsRequest, opts ...gax.CallOption) *HubIteratorListHubs lists the Network Connectivity Center hubs associated with a given project.
Examples
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.ListHubsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#ListHubsRequest.
}
it := c.ListHubs(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*networkconnectivitypb.ListHubsResponse)
}
}
all
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.ListHubsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#ListHubsRequest.
}
for resp, err := range c.ListHubs(ctx, req).All() {
if err != 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(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIteratorListLocations lists information about the supported locations for this service. This method can be called in two ways:
List all public locations: Use the path GET /v1/locations.
List project-visible locations: Use the path
GET /v1/projects/{project_id}/locations. This may include public
locations as well as private or other locations specifically visible
to the project.
Examples
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
"google.golang.org/api/iterator"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
it := c.ListLocations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*locationpb.ListLocationsResponse)
}
}
all
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
for resp, err := range c.ListLocations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*HubClient) ListOperations
func (c *HubClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
package main
import (
"context"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
it := c.ListOperations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*longrunningpb.ListOperationsResponse)
}
}
all
package main
import (
"context"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
for resp, err := range c.ListOperations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*HubClient) ListRouteTables
func (c *HubClient) ListRouteTables(ctx context.Context, req *networkconnectivitypb.ListRouteTablesRequest, opts ...gax.CallOption) *RouteTableIteratorListRouteTables lists route tables in a given hub.
Examples
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.ListRouteTablesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#ListRouteTablesRequest.
}
it := c.ListRouteTables(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*networkconnectivitypb.ListRouteTablesResponse)
}
}
all
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.ListRouteTablesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#ListRouteTablesRequest.
}
for resp, err := range c.ListRouteTables(ctx, req).All() {
if err != 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(ctx context.Context, req *networkconnectivitypb.ListRoutesRequest, opts ...gax.CallOption) *RouteIteratorListRoutes lists routes in a given route table.
Examples
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.ListRoutesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#ListRoutesRequest.
}
it := c.ListRoutes(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*networkconnectivitypb.ListRoutesResponse)
}
}
all
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.ListRoutesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#ListRoutesRequest.
}
for resp, err := range c.ListRoutes(ctx, req).All() {
if err != 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(ctx context.Context, req *networkconnectivitypb.ListSpokesRequest, opts ...gax.CallOption) *SpokeIteratorListSpokes lists the Network Connectivity Center spokes in a specified project and location.
Examples
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.ListSpokesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#ListSpokesRequest.
}
it := c.ListSpokes(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*networkconnectivitypb.ListSpokesResponse)
}
}
all
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.ListSpokesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#ListSpokesRequest.
}
for resp, err := range c.ListSpokes(ctx, req).All() {
if err != 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(ctx context.Context, req *networkconnectivitypb.QueryHubStatusRequest, opts ...gax.CallOption) *HubStatusEntryIteratorQueryHubStatus query the Private Service Connect propagation status of a Network Connectivity Center hub.
Examples
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.QueryHubStatusRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#QueryHubStatusRequest.
}
it := c.QueryHubStatus(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*networkconnectivitypb.QueryHubStatusResponse)
}
}
all
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.QueryHubStatusRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#QueryHubStatusRequest.
}
for resp, err := range c.QueryHubStatus(ctx, req).All() {
if err != 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(ctx context.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, it transitions to the INACTIVE state and is no longer able to connect to other spokes that are attached to the hub.
Example
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.RejectHubSpokeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#RejectHubSpokeRequest.
}
op, err := c.RejectHubSpoke(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*HubClient) RejectHubSpokeOperation
func (c *HubClient) RejectHubSpokeOperation(name string) *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(ctx context.Context, req *networkconnectivitypb.RejectSpokeUpdateRequest, opts ...gax.CallOption) (*RejectSpokeUpdateOperation, error)RejectSpokeUpdate rejects a proposal to update a Network Connectivity Center spoke in a hub.
Example
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.RejectSpokeUpdateRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#RejectSpokeUpdateRequest.
}
op, err := c.RejectSpokeUpdate(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*HubClient) RejectSpokeUpdateOperation
func (c *HubClient) RejectSpokeUpdateOperation(name string) *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(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.
Example
package main
import (
"context"
iampb "cloud.google.com/go/iam/apiv1/iampb"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.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)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*HubClient) TestIamPermissions
func (c *HubClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error)TestIamPermissions returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.
Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may “fail open” without warning.
Example
package main
import (
"context"
iampb "cloud.google.com/go/iam/apiv1/iampb"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.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)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*HubClient) UpdateGatewayAdvertisedRoute
func (c *HubClient) UpdateGatewayAdvertisedRoute(ctx context.Context, req *networkconnectivitypb.UpdateGatewayAdvertisedRouteRequest, opts ...gax.CallOption) (*UpdateGatewayAdvertisedRouteOperation, error)UpdateGatewayAdvertisedRoute update a GatewayAdvertisedRoute
Example
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.UpdateGatewayAdvertisedRouteRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#UpdateGatewayAdvertisedRouteRequest.
}
op, err := c.UpdateGatewayAdvertisedRoute(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*HubClient) UpdateGatewayAdvertisedRouteOperation
func (c *HubClient) UpdateGatewayAdvertisedRouteOperation(name string) *UpdateGatewayAdvertisedRouteOperationUpdateGatewayAdvertisedRouteOperation returns a new UpdateGatewayAdvertisedRouteOperation from a given name. The name must be that of a previously created UpdateGatewayAdvertisedRouteOperation, possibly from a different process.
func (*HubClient) UpdateGroup
func (c *HubClient) UpdateGroup(ctx context.Context, req *networkconnectivitypb.UpdateGroupRequest, opts ...gax.CallOption) (*UpdateGroupOperation, error)UpdateGroup updates the parameters of a Network Connectivity Center group.
Example
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.UpdateGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#UpdateGroupRequest.
}
op, err := c.UpdateGroup(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*HubClient) UpdateGroupOperation
func (c *HubClient) UpdateGroupOperation(name string) *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(ctx context.Context, req *networkconnectivitypb.UpdateHubRequest, opts ...gax.CallOption) (*UpdateHubOperation, error)UpdateHub updates the description and/or labels of a Network Connectivity Center hub.
Example
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.UpdateHubRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#UpdateHubRequest.
}
op, err := c.UpdateHub(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*HubClient) UpdateHubOperation
func (c *HubClient) UpdateHubOperation(name string) *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(ctx context.Context, req *networkconnectivitypb.UpdateSpokeRequest, opts ...gax.CallOption) (*UpdateSpokeOperation, error)UpdateSpoke updates the parameters of a Network Connectivity Center spoke.
Example
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewHubClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.UpdateSpokeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#UpdateSpokeRequest.
}
op, err := c.UpdateSpoke(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*HubClient) UpdateSpokeOperation
func (c *HubClient) UpdateSpokeOperation(name string) *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
type HubIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*networkconnectivitypb.Hub, nextPageToken string, err error)
// 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, the iterator 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 more results. 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
type HubStatusEntryIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*networkconnectivitypb.HubStatusEntry, nextPageToken string, err error)
// 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, the iterator 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 more results. 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.
LocationIterator
type LocationIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*locationpb.Location, nextPageToken string, err error)
// contains filtered or unexported fields
}LocationIterator manages a stream of *locationpb.Location.
func (*LocationIterator) All
func (it *LocationIterator) All() iter.Seq2[*locationpb.Location, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*LocationIterator) Next
func (it *LocationIterator) Next() (*locationpb.Location, error)Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*LocationIterator) PageInfo
func (it *LocationIterator) PageInfo() *iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
MulticloudDataTransferConfigIterator
type MulticloudDataTransferConfigIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*networkconnectivitypb.MulticloudDataTransferConfig, nextPageToken string, err error)
// 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, the iterator 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 more results. 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
type MulticloudDataTransferSupportedServiceIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*networkconnectivitypb.MulticloudDataTransferSupportedService, nextPageToken string, err error)
// 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, the iterator 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 more results. 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
type OperationIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*longrunningpb.Operation, nextPageToken string, err error)
// contains filtered or unexported fields
}OperationIterator manages a stream of *longrunningpb.Operation.
func (*OperationIterator) All
func (it *OperationIterator) All() iter.Seq2[*longrunningpb.Operation, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*OperationIterator) Next
func (it *OperationIterator) Next() (*longrunningpb.Operation, error)Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*OperationIterator) PageInfo
func (it *OperationIterator) PageInfo() *iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
PolicyBasedRouteIterator
type PolicyBasedRouteIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*networkconnectivitypb.PolicyBasedRoute, nextPageToken string, err error)
// 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, the iterator 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 more results. 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
type PolicyBasedRoutingCallOptions struct {
ListPolicyBasedRoutes []gax.CallOption
GetPolicyBasedRoute []gax.CallOption
CreatePolicyBasedRoute []gax.CallOption
DeletePolicyBasedRoute []gax.CallOption
GetLocation []gax.CallOption
ListLocations []gax.CallOption
GetIamPolicy []gax.CallOption
SetIamPolicy []gax.CallOption
TestIamPermissions []gax.CallOption
CancelOperation []gax.CallOption
DeleteOperation []gax.CallOption
GetOperation []gax.CallOption
ListOperations []gax.CallOption
}PolicyBasedRoutingCallOptions contains the retry settings for each method of PolicyBasedRoutingClient.
PolicyBasedRoutingClient
type PolicyBasedRoutingClient struct {
// 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 routing policies for Layer 4 traffic traversing through the connected service.
func NewPolicyBasedRoutingClient
func NewPolicyBasedRoutingClient(ctx context.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 routing policies for Layer 4 traffic traversing through the connected service.
Example
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewPolicyBasedRoutingClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*PolicyBasedRoutingClient) CancelOperation
func (c *PolicyBasedRoutingClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) errorCancelOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewPolicyBasedRoutingClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*PolicyBasedRoutingClient) Close
func (c *PolicyBasedRoutingClient) Close() errorClose closes the connection to the API service. The user should invoke this when the 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 always return the same resource.
func (*PolicyBasedRoutingClient) CreatePolicyBasedRoute
func (c *PolicyBasedRoutingClient) CreatePolicyBasedRoute(ctx context.Context, req *networkconnectivitypb.CreatePolicyBasedRouteRequest, opts ...gax.CallOption) (*CreatePolicyBasedRouteOperation, error)CreatePolicyBasedRoute creates a new policy-based route in a given project and location.
Example
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewPolicyBasedRoutingClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.CreatePolicyBasedRouteRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#CreatePolicyBasedRouteRequest.
}
op, err := c.CreatePolicyBasedRoute(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*PolicyBasedRoutingClient) CreatePolicyBasedRouteOperation
func (c *PolicyBasedRoutingClient) CreatePolicyBasedRouteOperation(name string) *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(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) errorDeleteOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewPolicyBasedRoutingClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.DeleteOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.
}
err = c.DeleteOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*PolicyBasedRoutingClient) DeletePolicyBasedRoute
func (c *PolicyBasedRoutingClient) DeletePolicyBasedRoute(ctx context.Context, req *networkconnectivitypb.DeletePolicyBasedRouteRequest, opts ...gax.CallOption) (*DeletePolicyBasedRouteOperation, error)DeletePolicyBasedRoute deletes a single policy-based route.
Example
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewPolicyBasedRoutingClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.DeletePolicyBasedRouteRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#DeletePolicyBasedRouteRequest.
}
op, err := c.DeletePolicyBasedRoute(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*PolicyBasedRoutingClient) DeletePolicyBasedRouteOperation
func (c *PolicyBasedRoutingClient) DeletePolicyBasedRouteOperation(name string) *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(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)GetIamPolicy gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.
Example
package main
import (
"context"
iampb "cloud.google.com/go/iam/apiv1/iampb"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewPolicyBasedRoutingClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.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)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*PolicyBasedRoutingClient) GetLocation
func (c *PolicyBasedRoutingClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)GetLocation gets information about a location.
Example
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewPolicyBasedRoutingClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.GetLocationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#GetLocationRequest.
}
resp, err := c.GetLocation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*PolicyBasedRoutingClient) GetOperation
func (c *PolicyBasedRoutingClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)GetOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewPolicyBasedRoutingClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*PolicyBasedRoutingClient) GetPolicyBasedRoute
func (c *PolicyBasedRoutingClient) GetPolicyBasedRoute(ctx context.Context, req *networkconnectivitypb.GetPolicyBasedRouteRequest, opts ...gax.CallOption) (*networkconnectivitypb.PolicyBasedRoute, error)GetPolicyBasedRoute gets details of a single policy-based route.
Example
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewPolicyBasedRoutingClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.GetPolicyBasedRouteRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#GetPolicyBasedRouteRequest.
}
resp, err := c.GetPolicyBasedRoute(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*PolicyBasedRoutingClient) ListLocations
func (c *PolicyBasedRoutingClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIteratorListLocations lists information about the supported locations for this service. This method can be called in two ways:
List all public locations: Use the path GET /v1/locations.
List project-visible locations: Use the path
GET /v1/projects/{project_id}/locations. This may include public
locations as well as private or other locations specifically visible
to the project.
Examples
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
"google.golang.org/api/iterator"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewPolicyBasedRoutingClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
it := c.ListLocations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*locationpb.ListLocationsResponse)
}
}
all
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewPolicyBasedRoutingClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
for resp, err := range c.ListLocations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*PolicyBasedRoutingClient) ListOperations
func (c *PolicyBasedRoutingClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
package main
import (
"context"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewPolicyBasedRoutingClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
it := c.ListOperations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*longrunningpb.ListOperationsResponse)
}
}
all
package main
import (
"context"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewPolicyBasedRoutingClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
for resp, err := range c.ListOperations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*PolicyBasedRoutingClient) ListPolicyBasedRoutes
func (c *PolicyBasedRoutingClient) ListPolicyBasedRoutes(ctx context.Context, req *networkconnectivitypb.ListPolicyBasedRoutesRequest, opts ...gax.CallOption) *PolicyBasedRouteIteratorListPolicyBasedRoutes lists policy-based routes in a given project and location.
Examples
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewPolicyBasedRoutingClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.ListPolicyBasedRoutesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#ListPolicyBasedRoutesRequest.
}
it := c.ListPolicyBasedRoutes(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*networkconnectivitypb.ListPolicyBasedRoutesResponse)
}
}
all
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewPolicyBasedRoutingClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.ListPolicyBasedRoutesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#ListPolicyBasedRoutesRequest.
}
for resp, err := range c.ListPolicyBasedRoutes(ctx, req).All() {
if err != 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(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.
Example
package main
import (
"context"
iampb "cloud.google.com/go/iam/apiv1/iampb"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewPolicyBasedRoutingClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.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)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*PolicyBasedRoutingClient) TestIamPermissions
func (c *PolicyBasedRoutingClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error)TestIamPermissions returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.
Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may “fail open” without warning.
Example
package main
import (
"context"
iampb "cloud.google.com/go/iam/apiv1/iampb"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewPolicyBasedRoutingClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.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)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
RejectHubSpokeOperation
type RejectHubSpokeOperation struct {
// 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(ctx context.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 and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*RejectHubSpokeOperation) Wait
func (op *RejectHubSpokeOperation) Wait(ctx context.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
type RejectSpokeUpdateOperation struct {
// 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(ctx context.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 and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*RejectSpokeUpdateOperation) Wait
func (op *RejectSpokeUpdateOperation) Wait(ctx context.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.
RemoteTransportProfileIterator
type RemoteTransportProfileIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*networkconnectivitypb.RemoteTransportProfile, nextPageToken string, err error)
// contains filtered or unexported fields
}RemoteTransportProfileIterator manages a stream of *networkconnectivitypb.RemoteTransportProfile.
func (*RemoteTransportProfileIterator) All
func (it *RemoteTransportProfileIterator) All() iter.Seq2[*networkconnectivitypb.RemoteTransportProfile, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*RemoteTransportProfileIterator) Next
func (it *RemoteTransportProfileIterator) Next() (*networkconnectivitypb.RemoteTransportProfile, error)Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*RemoteTransportProfileIterator) PageInfo
func (it *RemoteTransportProfileIterator) PageInfo() *iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
RouteIterator
type RouteIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*networkconnectivitypb.Route, nextPageToken string, err error)
// 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, the iterator 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 more results. 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
type RouteTableIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*networkconnectivitypb.RouteTable, nextPageToken string, err error)
// 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, the iterator 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 more results. 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.
SpokeIterator
type SpokeIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*networkconnectivitypb.Spoke, nextPageToken string, err error)
// 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, the iterator 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 more results. 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.
TransportIterator
type TransportIterator struct {
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*networkconnectivitypb.Transport, nextPageToken string, err error)
// contains filtered or unexported fields
}TransportIterator manages a stream of *networkconnectivitypb.Transport.
func (*TransportIterator) All
func (it *TransportIterator) All() iter.Seq2[*networkconnectivitypb.Transport, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*TransportIterator) Next
func (it *TransportIterator) Next() (*networkconnectivitypb.Transport, error)Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*TransportIterator) PageInfo
func (it *TransportIterator) PageInfo() *iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
TransportManagerCallOptions
type TransportManagerCallOptions struct {
ListRemoteTransportProfiles []gax.CallOption
GetRemoteTransportProfile []gax.CallOption
ListTransports []gax.CallOption
GetTransport []gax.CallOption
GetStatus []gax.CallOption
CreateTransport []gax.CallOption
UpdateTransport []gax.CallOption
DeleteTransport []gax.CallOption
GetLocation []gax.CallOption
ListLocations []gax.CallOption
GetIamPolicy []gax.CallOption
SetIamPolicy []gax.CallOption
TestIamPermissions []gax.CallOption
CancelOperation []gax.CallOption
DeleteOperation []gax.CallOption
GetOperation []gax.CallOption
ListOperations []gax.CallOption
}TransportManagerCallOptions contains the retry settings for each method of TransportManagerClient.
TransportManagerClient
type TransportManagerClient struct {
// The call options for this service.
CallOptions *TransportManagerCallOptions
// 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
}TransportManagerClient 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 managing RemoteTransportProfiles and Transports.
func NewTransportManagerClient
func NewTransportManagerClient(ctx context.Context, opts ...option.ClientOption) (*TransportManagerClient, error)NewTransportManagerClient creates a new transport manager 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 managing RemoteTransportProfiles and Transports.
Example
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewTransportManagerClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*TransportManagerClient) CancelOperation
func (c *TransportManagerClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) errorCancelOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewTransportManagerClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*TransportManagerClient) Close
func (c *TransportManagerClient) Close() errorClose closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*TransportManagerClient) Connection (deprecated)
func (c *TransportManagerClient) Connection() *grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*TransportManagerClient) CreateTransport
func (c *TransportManagerClient) CreateTransport(ctx context.Context, req *networkconnectivitypb.CreateTransportRequest, opts ...gax.CallOption) (*CreateTransportOperation, error)CreateTransport creates a new Transport in a given project and location.
Example
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewTransportManagerClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.CreateTransportRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#CreateTransportRequest.
}
op, err := c.CreateTransport(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*TransportManagerClient) CreateTransportOperation
func (c *TransportManagerClient) CreateTransportOperation(name string) *CreateTransportOperationCreateTransportOperation returns a new CreateTransportOperation from a given name. The name must be that of a previously created CreateTransportOperation, possibly from a different process.
func (*TransportManagerClient) DeleteOperation
func (c *TransportManagerClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) errorDeleteOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewTransportManagerClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.DeleteOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.
}
err = c.DeleteOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*TransportManagerClient) DeleteTransport
func (c *TransportManagerClient) DeleteTransport(ctx context.Context, req *networkconnectivitypb.DeleteTransportRequest, opts ...gax.CallOption) (*DeleteTransportOperation, error)DeleteTransport deletes a single Transport.
Example
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewTransportManagerClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.DeleteTransportRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#DeleteTransportRequest.
}
op, err := c.DeleteTransport(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*TransportManagerClient) DeleteTransportOperation
func (c *TransportManagerClient) DeleteTransportOperation(name string) *DeleteTransportOperationDeleteTransportOperation returns a new DeleteTransportOperation from a given name. The name must be that of a previously created DeleteTransportOperation, possibly from a different process.
func (*TransportManagerClient) GetIamPolicy
func (c *TransportManagerClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)GetIamPolicy gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.
Example
package main
import (
"context"
iampb "cloud.google.com/go/iam/apiv1/iampb"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewTransportManagerClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.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)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*TransportManagerClient) GetLocation
func (c *TransportManagerClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)GetLocation gets information about a location.
Example
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewTransportManagerClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.GetLocationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#GetLocationRequest.
}
resp, err := c.GetLocation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*TransportManagerClient) GetOperation
func (c *TransportManagerClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)GetOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewTransportManagerClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*TransportManagerClient) GetRemoteTransportProfile
func (c *TransportManagerClient) GetRemoteTransportProfile(ctx context.Context, req *networkconnectivitypb.GetRemoteTransportProfileRequest, opts ...gax.CallOption) (*networkconnectivitypb.RemoteTransportProfile, error)GetRemoteTransportProfile gets details of a single RemoteTransportProfile.
Example
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewTransportManagerClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.GetRemoteTransportProfileRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#GetRemoteTransportProfileRequest.
}
resp, err := c.GetRemoteTransportProfile(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*TransportManagerClient) GetStatus
func (c *TransportManagerClient) GetStatus(ctx context.Context, req *networkconnectivitypb.GetStatusRequest, opts ...gax.CallOption) (*networkconnectivitypb.GetStatusResponse, error)GetStatus gets the operational status of a single Transport.
Example
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewTransportManagerClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.GetStatusRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#GetStatusRequest.
}
resp, err := c.GetStatus(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*TransportManagerClient) GetTransport
func (c *TransportManagerClient) GetTransport(ctx context.Context, req *networkconnectivitypb.GetTransportRequest, opts ...gax.CallOption) (*networkconnectivitypb.Transport, error)GetTransport gets details of a single Transport.
Example
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewTransportManagerClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.GetTransportRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#GetTransportRequest.
}
resp, err := c.GetTransport(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*TransportManagerClient) ListLocations
func (c *TransportManagerClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIteratorListLocations lists information about the supported locations for this service. This method can be called in two ways:
List all public locations: Use the path GET /v1/locations.
List project-visible locations: Use the path
GET /v1/projects/{project_id}/locations. This may include public
locations as well as private or other locations specifically visible
to the project.
Examples
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
"google.golang.org/api/iterator"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewTransportManagerClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
it := c.ListLocations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*locationpb.ListLocationsResponse)
}
}
all
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewTransportManagerClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
for resp, err := range c.ListLocations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*TransportManagerClient) ListOperations
func (c *TransportManagerClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
package main
import (
"context"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewTransportManagerClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
it := c.ListOperations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*longrunningpb.ListOperationsResponse)
}
}
all
package main
import (
"context"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewTransportManagerClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
for resp, err := range c.ListOperations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*TransportManagerClient) ListRemoteTransportProfiles
func (c *TransportManagerClient) ListRemoteTransportProfiles(ctx context.Context, req *networkconnectivitypb.ListRemoteTransportProfilesRequest, opts ...gax.CallOption) *RemoteTransportProfileIteratorListRemoteTransportProfiles lists RemoteTransportProfiles in a given project and location.
Examples
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewTransportManagerClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.ListRemoteTransportProfilesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#ListRemoteTransportProfilesRequest.
}
it := c.ListRemoteTransportProfiles(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*networkconnectivitypb.ListRemoteTransportProfilesResponse)
}
}
all
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewTransportManagerClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.ListRemoteTransportProfilesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#ListRemoteTransportProfilesRequest.
}
for resp, err := range c.ListRemoteTransportProfiles(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*TransportManagerClient) ListTransports
func (c *TransportManagerClient) ListTransports(ctx context.Context, req *networkconnectivitypb.ListTransportsRequest, opts ...gax.CallOption) *TransportIteratorListTransports lists Transports in a given project and location.
Examples
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewTransportManagerClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.ListTransportsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#ListTransportsRequest.
}
it := c.ListTransports(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*networkconnectivitypb.ListTransportsResponse)
}
}
all
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewTransportManagerClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.ListTransportsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#ListTransportsRequest.
}
for resp, err := range c.ListTransports(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*TransportManagerClient) SetIamPolicy
func (c *TransportManagerClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.
Example
package main
import (
"context"
iampb "cloud.google.com/go/iam/apiv1/iampb"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewTransportManagerClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.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)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*TransportManagerClient) TestIamPermissions
func (c *TransportManagerClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error)TestIamPermissions returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.
Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may “fail open” without warning.
Example
package main
import (
"context"
iampb "cloud.google.com/go/iam/apiv1/iampb"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewTransportManagerClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.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)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*TransportManagerClient) UpdateTransport
func (c *TransportManagerClient) UpdateTransport(ctx context.Context, req *networkconnectivitypb.UpdateTransportRequest, opts ...gax.CallOption) (*UpdateTransportOperation, error)UpdateTransport updates the parameters of a single Transport.
Example
package main
import (
"context"
networkconnectivity "cloud.google.com/go/networkconnectivity/apiv1beta"
networkconnectivitypb "cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := networkconnectivity.NewTransportManagerClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkconnectivitypb.UpdateTransportRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkconnectivity/apiv1beta/networkconnectivitypb#UpdateTransportRequest.
}
op, err := c.UpdateTransport(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*TransportManagerClient) UpdateTransportOperation
func (c *TransportManagerClient) UpdateTransportOperation(name string) *UpdateTransportOperationUpdateTransportOperation returns a new UpdateTransportOperation from a given name. The name must be that of a previously created UpdateTransportOperation, possibly from a different process.
UpdateDestinationOperation
type UpdateDestinationOperation struct {
// 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(ctx context.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 and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*UpdateDestinationOperation) Wait
func (op *UpdateDestinationOperation) Wait(ctx context.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.
UpdateGatewayAdvertisedRouteOperation
type UpdateGatewayAdvertisedRouteOperation struct {
// contains filtered or unexported fields
}UpdateGatewayAdvertisedRouteOperation manages a long-running operation from UpdateGatewayAdvertisedRoute.
func (*UpdateGatewayAdvertisedRouteOperation) Done
func (op *UpdateGatewayAdvertisedRouteOperation) Done() boolDone reports whether the long-running operation has completed.
func (*UpdateGatewayAdvertisedRouteOperation) Metadata
func (op *UpdateGatewayAdvertisedRouteOperation) 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 (*UpdateGatewayAdvertisedRouteOperation) Name
func (op *UpdateGatewayAdvertisedRouteOperation) 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 (*UpdateGatewayAdvertisedRouteOperation) Poll
func (op *UpdateGatewayAdvertisedRouteOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*networkconnectivitypb.GatewayAdvertisedRoute, error)Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*UpdateGatewayAdvertisedRouteOperation) Wait
func (op *UpdateGatewayAdvertisedRouteOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*networkconnectivitypb.GatewayAdvertisedRoute, 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
type UpdateGroupOperation struct {
// 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(ctx context.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 and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*UpdateGroupOperation) Wait
func (op *UpdateGroupOperation) Wait(ctx context.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
type UpdateHubOperation struct {
// 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(ctx context.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 and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*UpdateHubOperation) Wait
func (op *UpdateHubOperation) Wait(ctx context.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.
UpdateMulticloudDataTransferConfigOperation
type UpdateMulticloudDataTransferConfigOperation struct {
// 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(ctx context.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 and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*UpdateMulticloudDataTransferConfigOperation) Wait
func (op *UpdateMulticloudDataTransferConfigOperation) Wait(ctx context.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.
UpdateSpokeOperation
type UpdateSpokeOperation struct {
// 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(ctx context.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 and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*UpdateSpokeOperation) Wait
func (op *UpdateSpokeOperation) Wait(ctx context.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.
UpdateTransportOperation
type UpdateTransportOperation struct {
// contains filtered or unexported fields
}UpdateTransportOperation manages a long-running operation from UpdateTransport.
func (*UpdateTransportOperation) Done
func (op *UpdateTransportOperation) Done() boolDone reports whether the long-running operation has completed.
func (*UpdateTransportOperation) Metadata
func (op *UpdateTransportOperation) 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 (*UpdateTransportOperation) Name
func (op *UpdateTransportOperation) 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 (*UpdateTransportOperation) Poll
func (op *UpdateTransportOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*networkconnectivitypb.Transport, error)Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*UpdateTransportOperation) Wait
func (op *UpdateTransportOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*networkconnectivitypb.Transport, 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.