Network Management API v1 - Package cloud.google.com/go/networkmanagement/apiv1 (v1.20.1) Stay organized with collections Save and categorize content based on your preferences.
Package networkmanagement is an auto-generated package for theNetwork Management API.
The Network Management API provides a collection of network performancemonitoring and diagnostic capabilities.
General documentation
For information that is relevant for all client libraries please referencehttps://pkg.go.dev/cloud.google.com/go#pkg-overview. Some information on thispage includes:
- Authentication and Authorization
- Timeouts and Cancellation
- Testing against Client Libraries
- Debugging Client Libraries
- Inspecting errors
Example usage
To get started with this package, create a client.
// go get cloud.google.com/go/networkmanagement/apiv1@latestctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=networkmanagement.NewReachabilityClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()
The client will use your default application credentials. Clients should be reused instead of created as needed.The methods of Client are safe for concurrent use by multiple goroutines.The returned client must be Closed when it is done being used.
Using the Client
The following is an example of making an API call with the newly created client, mentioned above.
req:=&networkmanagementpb.CreateConnectivityTestRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkmanagement/apiv1/networkmanagementpb#CreateConnectivityTestRequest.}op,err:=c.CreateConnectivityTest(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp
Use of Context
The ctx passed to NewReachabilityClient is used for authentication requests andfor creating the underlying connection, but is not used for subsequent calls.Individual methods on the client use the ctx given to them.
To close the open connection, use the Close() method.
Functions
func DefaultAuthScopes
funcDefaultAuthScopes()[]stringDefaultAuthScopes reports the default set of authentication scopes to use with this package.
ConnectivityTestIterator
typeConnectivityTestIteratorstruct{// Response is the raw response for the current page.// It must be cast to the RPC response type.// Calling Next() or InternalFetch() updates this value.Responseinterface{}// InternalFetch is for use by the Google Cloud Libraries only.// It is not part of the stable interface of this package.//// InternalFetch returns results from a single call to the underlying RPC.// The number of results is no greater than pageSize.// If there are no more results, nextPageToken is empty and err is nil.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*networkmanagementpb.ConnectivityTest,nextPageTokenstring,errerror)// contains filtered or unexported fields}ConnectivityTestIterator manages a stream of *networkmanagementpb.ConnectivityTest.
func (*ConnectivityTestIterator) All
func(it*ConnectivityTestIterator)All()iter.Seq2[*networkmanagementpb.ConnectivityTest,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*ConnectivityTestIterator) Next
func(it*ConnectivityTestIterator)Next()(*networkmanagementpb.ConnectivityTest,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*ConnectivityTestIterator) PageInfo
func(it*ConnectivityTestIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
CreateConnectivityTestOperation
typeCreateConnectivityTestOperationstruct{// contains filtered or unexported fields}CreateConnectivityTestOperation manages a long-running operation from CreateConnectivityTest.
func (*CreateConnectivityTestOperation) Done
func(op*CreateConnectivityTestOperation)Done()boolDone reports whether the long-running operation has completed.
func (*CreateConnectivityTestOperation) Metadata
func(op*CreateConnectivityTestOperation)Metadata()(*networkmanagementpb.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 (*CreateConnectivityTestOperation) Name
func(op*CreateConnectivityTestOperation)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 (*CreateConnectivityTestOperation) Poll
func(op*CreateConnectivityTestOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*networkmanagementpb.ConnectivityTest,error)Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds andthe operation has completed with failure, the error is returned and op.Done will return true.If Poll succeeds and the operation has completed successfully,op.Done will return true, and the response of the operation is returned.If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*CreateConnectivityTestOperation) Wait
func(op*CreateConnectivityTestOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*networkmanagementpb.ConnectivityTest,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.
CreateVpcFlowLogsConfigOperation
typeCreateVpcFlowLogsConfigOperationstruct{// contains filtered or unexported fields}CreateVpcFlowLogsConfigOperation manages a long-running operation from CreateVpcFlowLogsConfig.
func (*CreateVpcFlowLogsConfigOperation) Done
func(op*CreateVpcFlowLogsConfigOperation)Done()boolDone reports whether the long-running operation has completed.
func (*CreateVpcFlowLogsConfigOperation) Metadata
func(op*CreateVpcFlowLogsConfigOperation)Metadata()(*networkmanagementpb.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 (*CreateVpcFlowLogsConfigOperation) Name
func(op*CreateVpcFlowLogsConfigOperation)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 (*CreateVpcFlowLogsConfigOperation) Poll
func(op*CreateVpcFlowLogsConfigOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*networkmanagementpb.VpcFlowLogsConfig,error)Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds andthe operation has completed with failure, the error is returned and op.Done will return true.If Poll succeeds and the operation has completed successfully,op.Done will return true, and the response of the operation is returned.If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*CreateVpcFlowLogsConfigOperation) Wait
func(op*CreateVpcFlowLogsConfigOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*networkmanagementpb.VpcFlowLogsConfig,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.
DeleteConnectivityTestOperation
typeDeleteConnectivityTestOperationstruct{// contains filtered or unexported fields}DeleteConnectivityTestOperation manages a long-running operation from DeleteConnectivityTest.
func (*DeleteConnectivityTestOperation) Done
func(op*DeleteConnectivityTestOperation)Done()boolDone reports whether the long-running operation has completed.
func (*DeleteConnectivityTestOperation) Metadata
func(op*DeleteConnectivityTestOperation)Metadata()(*networkmanagementpb.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 (*DeleteConnectivityTestOperation) Name
func(op*DeleteConnectivityTestOperation)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 (*DeleteConnectivityTestOperation) Poll
func(op*DeleteConnectivityTestOperation)Poll(ctxcontext.Context,opts...gax.CallOption)errorPoll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds andthe operation has completed with failure, the error is returned and op.Done will return true.If Poll succeeds and the operation has completed successfully,op.Done will return true, and the response of the operation is returned.If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*DeleteConnectivityTestOperation) Wait
func(op*DeleteConnectivityTestOperation)Wait(ctxcontext.Context,opts...gax.CallOption)errorWait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
DeleteVpcFlowLogsConfigOperation
typeDeleteVpcFlowLogsConfigOperationstruct{// contains filtered or unexported fields}DeleteVpcFlowLogsConfigOperation manages a long-running operation from DeleteVpcFlowLogsConfig.
func (*DeleteVpcFlowLogsConfigOperation) Done
func(op*DeleteVpcFlowLogsConfigOperation)Done()boolDone reports whether the long-running operation has completed.
func (*DeleteVpcFlowLogsConfigOperation) Metadata
func(op*DeleteVpcFlowLogsConfigOperation)Metadata()(*networkmanagementpb.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 (*DeleteVpcFlowLogsConfigOperation) Name
func(op*DeleteVpcFlowLogsConfigOperation)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 (*DeleteVpcFlowLogsConfigOperation) Poll
func(op*DeleteVpcFlowLogsConfigOperation)Poll(ctxcontext.Context,opts...gax.CallOption)errorPoll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds andthe operation has completed with failure, the error is returned and op.Done will return true.If Poll succeeds and the operation has completed successfully,op.Done will return true, and the response of the operation is returned.If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*DeleteVpcFlowLogsConfigOperation) Wait
func(op*DeleteVpcFlowLogsConfigOperation)Wait(ctxcontext.Context,opts...gax.CallOption)errorWait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
LocationIterator
typeLocationIteratorstruct{// Response is the raw response for the current page.// It must be cast to the RPC response type.// Calling Next() or InternalFetch() updates this value.Responseinterface{}// InternalFetch is for use by the Google Cloud Libraries only.// It is not part of the stable interface of this package.//// InternalFetch returns results from a single call to the underlying RPC.// The number of results is no greater than pageSize.// If there are no more results, nextPageToken is empty and err is nil.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*locationpb.Location,nextPageTokenstring,errerror)// contains filtered or unexported fields}LocationIterator manages a stream of *locationpb.Location.
func (*LocationIterator) All
func(it*LocationIterator)All()iter.Seq2[*locationpb.Location,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*LocationIterator) Next
func(it*LocationIterator)Next()(*locationpb.Location,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*LocationIterator) PageInfo
func(it*LocationIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
OperationIterator
typeOperationIteratorstruct{// Response is the raw response for the current page.// It must be cast to the RPC response type.// Calling Next() or InternalFetch() updates this value.Responseinterface{}// InternalFetch is for use by the Google Cloud Libraries only.// It is not part of the stable interface of this package.//// InternalFetch returns results from a single call to the underlying RPC.// The number of results is no greater than pageSize.// If there are no more results, nextPageToken is empty and err is nil.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*longrunningpb.Operation,nextPageTokenstring,errerror)// contains filtered or unexported fields}OperationIterator manages a stream of *longrunningpb.Operation.
func (*OperationIterator) All
func(it*OperationIterator)All()iter.Seq2[*longrunningpb.Operation,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*OperationIterator) Next
func(it*OperationIterator)Next()(*longrunningpb.Operation,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*OperationIterator) PageInfo
func(it*OperationIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
ReachabilityCallOptions
typeReachabilityCallOptionsstruct{ListConnectivityTests[]gax.CallOptionGetConnectivityTest[]gax.CallOptionCreateConnectivityTest[]gax.CallOptionUpdateConnectivityTest[]gax.CallOptionRerunConnectivityTest[]gax.CallOptionDeleteConnectivityTest[]gax.CallOptionGetLocation[]gax.CallOptionListLocations[]gax.CallOptionGetIamPolicy[]gax.CallOptionSetIamPolicy[]gax.CallOptionTestIamPermissions[]gax.CallOptionCancelOperation[]gax.CallOptionDeleteOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOption}ReachabilityCallOptions contains the retry settings for each method of ReachabilityClient.
ReachabilityClient
typeReachabilityClientstruct{// The call options for this service.CallOptions*ReachabilityCallOptions// 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}ReachabilityClient is a client for interacting with Network Management API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The Reachability service in the Google Cloud Network Management API providesservices that analyze the reachability within a single Google Virtual PrivateCloud (VPC) network, between peered VPC networks, between VPC and on-premisesnetworks, or between VPC networks and internet hosts. A reachability analysisis based on Google Cloud network configurations.
You can use the analysis results to verify these configurations andto troubleshoot connectivity issues.
func NewReachabilityClient
funcNewReachabilityClient(ctxcontext.Context,opts...option.ClientOption)(*ReachabilityClient,error)NewReachabilityClient creates a new reachability service client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.
The Reachability service in the Google Cloud Network Management API providesservices that analyze the reachability within a single Google Virtual PrivateCloud (VPC) network, between peered VPC networks, between VPC and on-premisesnetworks, or between VPC networks and internet hosts. A reachability analysisis based on Google Cloud network configurations.
You can use the analysis results to verify these configurations andto troubleshoot connectivity issues.
Example
packagemainimport("context"networkmanagement"cloud.google.com/go/networkmanagement/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=networkmanagement.NewReachabilityClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func NewReachabilityRESTClient
funcNewReachabilityRESTClient(ctxcontext.Context,opts...option.ClientOption)(*ReachabilityClient,error)NewReachabilityRESTClient creates a new reachability service rest client.
The Reachability service in the Google Cloud Network Management API providesservices that analyze the reachability within a single Google Virtual PrivateCloud (VPC) network, between peered VPC networks, between VPC and on-premisesnetworks, or between VPC networks and internet hosts. A reachability analysisis based on Google Cloud network configurations.
You can use the analysis results to verify these configurations andto troubleshoot connectivity issues.
Example
packagemainimport("context"networkmanagement"cloud.google.com/go/networkmanagement/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=networkmanagement.NewReachabilityRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func (*ReachabilityClient) CancelOperation
func(c*ReachabilityClient)CancelOperation(ctxcontext.Context,req*longrunningpb.CancelOperationRequest,opts...gax.CallOption)errorCancelOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"networkmanagement"cloud.google.com/go/networkmanagement/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=networkmanagement.NewReachabilityClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.CancelOperationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.}err=c.CancelOperation(ctx,req)iferr!=nil{// TODO: Handle error.}}func (*ReachabilityClient) Close
func(c*ReachabilityClient)Close()errorClose closes the connection to the API service. The user should invoke this whenthe client is no longer required.
func (*ReachabilityClient) Connection (deprecated)
func(c*ReachabilityClient)Connection()*grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.
func (*ReachabilityClient) CreateConnectivityTest
func(c*ReachabilityClient)CreateConnectivityTest(ctxcontext.Context,req*networkmanagementpb.CreateConnectivityTestRequest,opts...gax.CallOption)(*CreateConnectivityTestOperation,error)CreateConnectivityTest creates a new Connectivity Test.After you create a test, the reachability analysis is performed as partof the long running operation, which completes when the analysis completes.
If the endpoint specifications in ConnectivityTest are invalid(for example, containing non-existent resources in the network, or youdon’t have read permissions to the network configurations of listedprojects), then the reachability result returns a value of UNKNOWN.
If the endpoint specifications in ConnectivityTest areincomplete, the reachability result returns a value ofAMBIGUOUS. For more information,see the Connectivity Test documentation.
Example
packagemainimport("context"networkmanagement"cloud.google.com/go/networkmanagement/apiv1"networkmanagementpb"cloud.google.com/go/networkmanagement/apiv1/networkmanagementpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=networkmanagement.NewReachabilityClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkmanagementpb.CreateConnectivityTestRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkmanagement/apiv1/networkmanagementpb#CreateConnectivityTestRequest.}op,err:=c.CreateConnectivityTest(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*ReachabilityClient) CreateConnectivityTestOperation
func(c*ReachabilityClient)CreateConnectivityTestOperation(namestring)*CreateConnectivityTestOperationCreateConnectivityTestOperation returns a new CreateConnectivityTestOperation from a given name.The name must be that of a previously created CreateConnectivityTestOperation, possibly from a different process.
func (*ReachabilityClient) DeleteConnectivityTest
func(c*ReachabilityClient)DeleteConnectivityTest(ctxcontext.Context,req*networkmanagementpb.DeleteConnectivityTestRequest,opts...gax.CallOption)(*DeleteConnectivityTestOperation,error)DeleteConnectivityTest deletes a specific ConnectivityTest.
Example
packagemainimport("context"networkmanagement"cloud.google.com/go/networkmanagement/apiv1"networkmanagementpb"cloud.google.com/go/networkmanagement/apiv1/networkmanagementpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=networkmanagement.NewReachabilityClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkmanagementpb.DeleteConnectivityTestRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkmanagement/apiv1/networkmanagementpb#DeleteConnectivityTestRequest.}op,err:=c.DeleteConnectivityTest(ctx,req)iferr!=nil{// TODO: Handle error.}err=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}}func (*ReachabilityClient) DeleteConnectivityTestOperation
func(c*ReachabilityClient)DeleteConnectivityTestOperation(namestring)*DeleteConnectivityTestOperationDeleteConnectivityTestOperation returns a new DeleteConnectivityTestOperation from a given name.The name must be that of a previously created DeleteConnectivityTestOperation, possibly from a different process.
func (*ReachabilityClient) DeleteOperation
func(c*ReachabilityClient)DeleteOperation(ctxcontext.Context,req*longrunningpb.DeleteOperationRequest,opts...gax.CallOption)errorDeleteOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"networkmanagement"cloud.google.com/go/networkmanagement/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=networkmanagement.NewReachabilityClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.DeleteOperationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.}err=c.DeleteOperation(ctx,req)iferr!=nil{// TODO: Handle error.}}func (*ReachabilityClient) GetConnectivityTest
func(c*ReachabilityClient)GetConnectivityTest(ctxcontext.Context,req*networkmanagementpb.GetConnectivityTestRequest,opts...gax.CallOption)(*networkmanagementpb.ConnectivityTest,error)GetConnectivityTest gets the details of a specific Connectivity Test.
Example
packagemainimport("context"networkmanagement"cloud.google.com/go/networkmanagement/apiv1"networkmanagementpb"cloud.google.com/go/networkmanagement/apiv1/networkmanagementpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=networkmanagement.NewReachabilityClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkmanagementpb.GetConnectivityTestRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkmanagement/apiv1/networkmanagementpb#GetConnectivityTestRequest.}resp,err:=c.GetConnectivityTest(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*ReachabilityClient) GetIamPolicy
func(c*ReachabilityClient)GetIamPolicy(ctxcontext.Context,req*iampb.GetIamPolicyRequest,opts...gax.CallOption)(*iampb.Policy,error)GetIamPolicy gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.
Example
packagemainimport("context"iampb"cloud.google.com/go/iam/apiv1/iampb"networkmanagement"cloud.google.com/go/networkmanagement/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=networkmanagement.NewReachabilityClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&iampb.GetIamPolicyRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#GetIamPolicyRequest.}resp,err:=c.GetIamPolicy(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*ReachabilityClient) GetLocation
func(c*ReachabilityClient)GetLocation(ctxcontext.Context,req*locationpb.GetLocationRequest,opts...gax.CallOption)(*locationpb.Location,error)GetLocation gets information about a location.
Example
packagemainimport("context"networkmanagement"cloud.google.com/go/networkmanagement/apiv1"locationpb"google.golang.org/genproto/googleapis/cloud/location")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=networkmanagement.NewReachabilityClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&locationpb.GetLocationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#GetLocationRequest.}resp,err:=c.GetLocation(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*ReachabilityClient) GetOperation
func(c*ReachabilityClient)GetOperation(ctxcontext.Context,req*longrunningpb.GetOperationRequest,opts...gax.CallOption)(*longrunningpb.Operation,error)GetOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"networkmanagement"cloud.google.com/go/networkmanagement/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=networkmanagement.NewReachabilityClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.GetOperationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.}resp,err:=c.GetOperation(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*ReachabilityClient) ListConnectivityTests
func(c*ReachabilityClient)ListConnectivityTests(ctxcontext.Context,req*networkmanagementpb.ListConnectivityTestsRequest,opts...gax.CallOption)*ConnectivityTestIteratorListConnectivityTests lists all Connectivity Tests owned by a project.
Examples
packagemainimport("context"networkmanagement"cloud.google.com/go/networkmanagement/apiv1"networkmanagementpb"cloud.google.com/go/networkmanagement/apiv1/networkmanagementpb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=networkmanagement.NewReachabilityClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkmanagementpb.ListConnectivityTestsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkmanagement/apiv1/networkmanagementpb#ListConnectivityTestsRequest.}it:=c.ListConnectivityTests(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*networkmanagementpb.ListConnectivityTestsResponse)}}all
packagemainimport("context"networkmanagement"cloud.google.com/go/networkmanagement/apiv1"networkmanagementpb"cloud.google.com/go/networkmanagement/apiv1/networkmanagementpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=networkmanagement.NewReachabilityClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkmanagementpb.ListConnectivityTestsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkmanagement/apiv1/networkmanagementpb#ListConnectivityTestsRequest.}forresp,err:=rangec.ListConnectivityTests(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*ReachabilityClient) ListLocations
func(c*ReachabilityClient)ListLocations(ctxcontext.Context,req*locationpb.ListLocationsRequest,opts...gax.CallOption)*LocationIteratorListLocations lists information about the supported locations for this service.
Examples
packagemainimport("context"networkmanagement"cloud.google.com/go/networkmanagement/apiv1""google.golang.org/api/iterator"locationpb"google.golang.org/genproto/googleapis/cloud/location")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=networkmanagement.NewReachabilityClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&locationpb.ListLocationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.}it:=c.ListLocations(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*locationpb.ListLocationsResponse)}}all
packagemainimport("context"networkmanagement"cloud.google.com/go/networkmanagement/apiv1"locationpb"google.golang.org/genproto/googleapis/cloud/location")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=networkmanagement.NewReachabilityClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&locationpb.ListLocationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.}forresp,err:=rangec.ListLocations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*ReachabilityClient) ListOperations
func(c*ReachabilityClient)ListOperations(ctxcontext.Context,req*longrunningpb.ListOperationsRequest,opts...gax.CallOption)*OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"networkmanagement"cloud.google.com/go/networkmanagement/apiv1""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=networkmanagement.NewReachabilityClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}it:=c.ListOperations(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*longrunningpb.ListOperationsResponse)}}all
packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"networkmanagement"cloud.google.com/go/networkmanagement/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=networkmanagement.NewReachabilityClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}forresp,err:=rangec.ListOperations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*ReachabilityClient) RerunConnectivityTest
func(c*ReachabilityClient)RerunConnectivityTest(ctxcontext.Context,req*networkmanagementpb.RerunConnectivityTestRequest,opts...gax.CallOption)(*RerunConnectivityTestOperation,error)RerunConnectivityTest rerun an existing ConnectivityTest.After the user triggers the rerun, the reachability analysis is performedas part of the long running operation, which completes when the analysiscompletes.
Even though the test configuration remains the same, the reachabilityresult may change due to underlying network configuration changes.
If the endpoint specifications in ConnectivityTest become invalid (forexample, specified resources are deleted in the network, or you lostread permissions to the network configurations of listed projects), thenthe reachability result returns a value of UNKNOWN.
Example
packagemainimport("context"networkmanagement"cloud.google.com/go/networkmanagement/apiv1"networkmanagementpb"cloud.google.com/go/networkmanagement/apiv1/networkmanagementpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=networkmanagement.NewReachabilityClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkmanagementpb.RerunConnectivityTestRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkmanagement/apiv1/networkmanagementpb#RerunConnectivityTestRequest.}op,err:=c.RerunConnectivityTest(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*ReachabilityClient) RerunConnectivityTestOperation
func(c*ReachabilityClient)RerunConnectivityTestOperation(namestring)*RerunConnectivityTestOperationRerunConnectivityTestOperation returns a new RerunConnectivityTestOperation from a given name.The name must be that of a previously created RerunConnectivityTestOperation, possibly from a different process.
func (*ReachabilityClient) SetIamPolicy
func(c*ReachabilityClient)SetIamPolicy(ctxcontext.Context,req*iampb.SetIamPolicyRequest,opts...gax.CallOption)(*iampb.Policy,error)SetIamPolicy sets the access control policy on the specified resource. Replacesany existing policy.
Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.
Example
packagemainimport("context"iampb"cloud.google.com/go/iam/apiv1/iampb"networkmanagement"cloud.google.com/go/networkmanagement/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=networkmanagement.NewReachabilityClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&iampb.SetIamPolicyRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#SetIamPolicyRequest.}resp,err:=c.SetIamPolicy(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*ReachabilityClient) TestIamPermissions
func(c*ReachabilityClient)TestIamPermissions(ctxcontext.Context,req*iampb.TestIamPermissionsRequest,opts...gax.CallOption)(*iampb.TestIamPermissionsResponse,error)TestIamPermissions returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a NOT_FOUND error.
Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may “fail open” without warning.
Example
packagemainimport("context"iampb"cloud.google.com/go/iam/apiv1/iampb"networkmanagement"cloud.google.com/go/networkmanagement/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=networkmanagement.NewReachabilityClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&iampb.TestIamPermissionsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#TestIamPermissionsRequest.}resp,err:=c.TestIamPermissions(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*ReachabilityClient) UpdateConnectivityTest
func(c*ReachabilityClient)UpdateConnectivityTest(ctxcontext.Context,req*networkmanagementpb.UpdateConnectivityTestRequest,opts...gax.CallOption)(*UpdateConnectivityTestOperation,error)UpdateConnectivityTest updates the configuration of an existing ConnectivityTest.After you update a test, the reachability analysis is performed as partof the long running operation, which completes when the analysis completes.The Reachability state in the test resource is updated with the new result.
If the endpoint specifications in ConnectivityTest are invalid(for example, they contain non-existent resources in the network, or theuser does not have read permissions to the network configurations oflisted projects), then the reachability result returns a value ofUNKNOWN.
If the endpoint specifications in ConnectivityTest are incomplete, thereachability result returns a value of AMBIGUOUS. See the documentationin ConnectivityTest for more details.
Example
packagemainimport("context"networkmanagement"cloud.google.com/go/networkmanagement/apiv1"networkmanagementpb"cloud.google.com/go/networkmanagement/apiv1/networkmanagementpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=networkmanagement.NewReachabilityClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkmanagementpb.UpdateConnectivityTestRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkmanagement/apiv1/networkmanagementpb#UpdateConnectivityTestRequest.}op,err:=c.UpdateConnectivityTest(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*ReachabilityClient) UpdateConnectivityTestOperation
func(c*ReachabilityClient)UpdateConnectivityTestOperation(namestring)*UpdateConnectivityTestOperationUpdateConnectivityTestOperation returns a new UpdateConnectivityTestOperation from a given name.The name must be that of a previously created UpdateConnectivityTestOperation, possibly from a different process.
RerunConnectivityTestOperation
typeRerunConnectivityTestOperationstruct{// contains filtered or unexported fields}RerunConnectivityTestOperation manages a long-running operation from RerunConnectivityTest.
func (*RerunConnectivityTestOperation) Done
func(op*RerunConnectivityTestOperation)Done()boolDone reports whether the long-running operation has completed.
func (*RerunConnectivityTestOperation) Metadata
func(op*RerunConnectivityTestOperation)Metadata()(*networkmanagementpb.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 (*RerunConnectivityTestOperation) Name
func(op*RerunConnectivityTestOperation)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 (*RerunConnectivityTestOperation) Poll
func(op*RerunConnectivityTestOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*networkmanagementpb.ConnectivityTest,error)Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds andthe operation has completed with failure, the error is returned and op.Done will return true.If Poll succeeds and the operation has completed successfully,op.Done will return true, and the response of the operation is returned.If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*RerunConnectivityTestOperation) Wait
func(op*RerunConnectivityTestOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*networkmanagementpb.ConnectivityTest,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.
UpdateConnectivityTestOperation
typeUpdateConnectivityTestOperationstruct{// contains filtered or unexported fields}UpdateConnectivityTestOperation manages a long-running operation from UpdateConnectivityTest.
func (*UpdateConnectivityTestOperation) Done
func(op*UpdateConnectivityTestOperation)Done()boolDone reports whether the long-running operation has completed.
func (*UpdateConnectivityTestOperation) Metadata
func(op*UpdateConnectivityTestOperation)Metadata()(*networkmanagementpb.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 (*UpdateConnectivityTestOperation) Name
func(op*UpdateConnectivityTestOperation)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 (*UpdateConnectivityTestOperation) Poll
func(op*UpdateConnectivityTestOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*networkmanagementpb.ConnectivityTest,error)Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds andthe operation has completed with failure, the error is returned and op.Done will return true.If Poll succeeds and the operation has completed successfully,op.Done will return true, and the response of the operation is returned.If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*UpdateConnectivityTestOperation) Wait
func(op*UpdateConnectivityTestOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*networkmanagementpb.ConnectivityTest,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.
UpdateVpcFlowLogsConfigOperation
typeUpdateVpcFlowLogsConfigOperationstruct{// contains filtered or unexported fields}UpdateVpcFlowLogsConfigOperation manages a long-running operation from UpdateVpcFlowLogsConfig.
func (*UpdateVpcFlowLogsConfigOperation) Done
func(op*UpdateVpcFlowLogsConfigOperation)Done()boolDone reports whether the long-running operation has completed.
func (*UpdateVpcFlowLogsConfigOperation) Metadata
func(op*UpdateVpcFlowLogsConfigOperation)Metadata()(*networkmanagementpb.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 (*UpdateVpcFlowLogsConfigOperation) Name
func(op*UpdateVpcFlowLogsConfigOperation)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 (*UpdateVpcFlowLogsConfigOperation) Poll
func(op*UpdateVpcFlowLogsConfigOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*networkmanagementpb.VpcFlowLogsConfig,error)Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds andthe operation has completed with failure, the error is returned and op.Done will return true.If Poll succeeds and the operation has completed successfully,op.Done will return true, and the response of the operation is returned.If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*UpdateVpcFlowLogsConfigOperation) Wait
func(op*UpdateVpcFlowLogsConfigOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*networkmanagementpb.VpcFlowLogsConfig,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.
VpcFlowLogsCallOptions
typeVpcFlowLogsCallOptionsstruct{ListVpcFlowLogsConfigs[]gax.CallOptionGetVpcFlowLogsConfig[]gax.CallOptionCreateVpcFlowLogsConfig[]gax.CallOptionUpdateVpcFlowLogsConfig[]gax.CallOptionDeleteVpcFlowLogsConfig[]gax.CallOptionGetLocation[]gax.CallOptionListLocations[]gax.CallOptionGetIamPolicy[]gax.CallOptionSetIamPolicy[]gax.CallOptionTestIamPermissions[]gax.CallOptionCancelOperation[]gax.CallOptionDeleteOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOption}VpcFlowLogsCallOptions contains the retry settings for each method of VpcFlowLogsClient.
VpcFlowLogsClient
typeVpcFlowLogsClientstruct{// The call options for this service.CallOptions*VpcFlowLogsCallOptions// 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}VpcFlowLogsClient is a client for interacting with Network Management API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The VPC Flow Logs service in the Google Cloud Network Management API providesconfigurations that generate Flow Logs. The service and the configurationresources created using this service are global.
func NewVpcFlowLogsClient
funcNewVpcFlowLogsClient(ctxcontext.Context,opts...option.ClientOption)(*VpcFlowLogsClient,error)NewVpcFlowLogsClient creates a new vpc flow logs service client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.
The VPC Flow Logs service in the Google Cloud Network Management API providesconfigurations that generate Flow Logs. The service and the configurationresources created using this service are global.
Example
packagemainimport("context"networkmanagement"cloud.google.com/go/networkmanagement/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=networkmanagement.NewVpcFlowLogsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func NewVpcFlowLogsRESTClient
funcNewVpcFlowLogsRESTClient(ctxcontext.Context,opts...option.ClientOption)(*VpcFlowLogsClient,error)NewVpcFlowLogsRESTClient creates a new vpc flow logs service rest client.
The VPC Flow Logs service in the Google Cloud Network Management API providesconfigurations that generate Flow Logs. The service and the configurationresources created using this service are global.
Example
packagemainimport("context"networkmanagement"cloud.google.com/go/networkmanagement/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=networkmanagement.NewVpcFlowLogsRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func (*VpcFlowLogsClient) CancelOperation
func(c*VpcFlowLogsClient)CancelOperation(ctxcontext.Context,req*longrunningpb.CancelOperationRequest,opts...gax.CallOption)errorCancelOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"networkmanagement"cloud.google.com/go/networkmanagement/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=networkmanagement.NewVpcFlowLogsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.CancelOperationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.}err=c.CancelOperation(ctx,req)iferr!=nil{// TODO: Handle error.}}func (*VpcFlowLogsClient) Close
func(c*VpcFlowLogsClient)Close()errorClose closes the connection to the API service. The user should invoke this whenthe client is no longer required.
func (*VpcFlowLogsClient) Connection (deprecated)
func(c*VpcFlowLogsClient)Connection()*grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.
func (*VpcFlowLogsClient) CreateVpcFlowLogsConfig
func(c*VpcFlowLogsClient)CreateVpcFlowLogsConfig(ctxcontext.Context,req*networkmanagementpb.CreateVpcFlowLogsConfigRequest,opts...gax.CallOption)(*CreateVpcFlowLogsConfigOperation,error)CreateVpcFlowLogsConfig creates a new VpcFlowLogsConfig.If a configuration with the exact same settings already exists (even if theID is different), the creation fails.Notes:
Creating a configuration with state=DISABLED will fail
The following fields are not considered as settings for the purposeof the check mentioned above, therefore - creating another configurationwith the same fields but different values for the following fields willfail as well:
namecreate_timeupdate_timelabelsdescriptionExample
packagemainimport("context"networkmanagement"cloud.google.com/go/networkmanagement/apiv1"networkmanagementpb"cloud.google.com/go/networkmanagement/apiv1/networkmanagementpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=networkmanagement.NewVpcFlowLogsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkmanagementpb.CreateVpcFlowLogsConfigRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkmanagement/apiv1/networkmanagementpb#CreateVpcFlowLogsConfigRequest.}op,err:=c.CreateVpcFlowLogsConfig(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*VpcFlowLogsClient) CreateVpcFlowLogsConfigOperation
func(c*VpcFlowLogsClient)CreateVpcFlowLogsConfigOperation(namestring)*CreateVpcFlowLogsConfigOperationCreateVpcFlowLogsConfigOperation returns a new CreateVpcFlowLogsConfigOperation from a given name.The name must be that of a previously created CreateVpcFlowLogsConfigOperation, possibly from a different process.
func (*VpcFlowLogsClient) DeleteOperation
func(c*VpcFlowLogsClient)DeleteOperation(ctxcontext.Context,req*longrunningpb.DeleteOperationRequest,opts...gax.CallOption)errorDeleteOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"networkmanagement"cloud.google.com/go/networkmanagement/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=networkmanagement.NewVpcFlowLogsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.DeleteOperationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.}err=c.DeleteOperation(ctx,req)iferr!=nil{// TODO: Handle error.}}func (*VpcFlowLogsClient) DeleteVpcFlowLogsConfig
func(c*VpcFlowLogsClient)DeleteVpcFlowLogsConfig(ctxcontext.Context,req*networkmanagementpb.DeleteVpcFlowLogsConfigRequest,opts...gax.CallOption)(*DeleteVpcFlowLogsConfigOperation,error)DeleteVpcFlowLogsConfig deletes a specific VpcFlowLogsConfig.
Example
packagemainimport("context"networkmanagement"cloud.google.com/go/networkmanagement/apiv1"networkmanagementpb"cloud.google.com/go/networkmanagement/apiv1/networkmanagementpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=networkmanagement.NewVpcFlowLogsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkmanagementpb.DeleteVpcFlowLogsConfigRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkmanagement/apiv1/networkmanagementpb#DeleteVpcFlowLogsConfigRequest.}op,err:=c.DeleteVpcFlowLogsConfig(ctx,req)iferr!=nil{// TODO: Handle error.}err=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}}func (*VpcFlowLogsClient) DeleteVpcFlowLogsConfigOperation
func(c*VpcFlowLogsClient)DeleteVpcFlowLogsConfigOperation(namestring)*DeleteVpcFlowLogsConfigOperationDeleteVpcFlowLogsConfigOperation returns a new DeleteVpcFlowLogsConfigOperation from a given name.The name must be that of a previously created DeleteVpcFlowLogsConfigOperation, possibly from a different process.
func (*VpcFlowLogsClient) GetIamPolicy
func(c*VpcFlowLogsClient)GetIamPolicy(ctxcontext.Context,req*iampb.GetIamPolicyRequest,opts...gax.CallOption)(*iampb.Policy,error)GetIamPolicy gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.
Example
packagemainimport("context"iampb"cloud.google.com/go/iam/apiv1/iampb"networkmanagement"cloud.google.com/go/networkmanagement/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=networkmanagement.NewVpcFlowLogsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&iampb.GetIamPolicyRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#GetIamPolicyRequest.}resp,err:=c.GetIamPolicy(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*VpcFlowLogsClient) GetLocation
func(c*VpcFlowLogsClient)GetLocation(ctxcontext.Context,req*locationpb.GetLocationRequest,opts...gax.CallOption)(*locationpb.Location,error)GetLocation gets information about a location.
Example
packagemainimport("context"networkmanagement"cloud.google.com/go/networkmanagement/apiv1"locationpb"google.golang.org/genproto/googleapis/cloud/location")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=networkmanagement.NewVpcFlowLogsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&locationpb.GetLocationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#GetLocationRequest.}resp,err:=c.GetLocation(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*VpcFlowLogsClient) GetOperation
func(c*VpcFlowLogsClient)GetOperation(ctxcontext.Context,req*longrunningpb.GetOperationRequest,opts...gax.CallOption)(*longrunningpb.Operation,error)GetOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"networkmanagement"cloud.google.com/go/networkmanagement/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=networkmanagement.NewVpcFlowLogsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.GetOperationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.}resp,err:=c.GetOperation(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*VpcFlowLogsClient) GetVpcFlowLogsConfig
func(c*VpcFlowLogsClient)GetVpcFlowLogsConfig(ctxcontext.Context,req*networkmanagementpb.GetVpcFlowLogsConfigRequest,opts...gax.CallOption)(*networkmanagementpb.VpcFlowLogsConfig,error)GetVpcFlowLogsConfig gets the details of a specific VpcFlowLogsConfig.
Example
packagemainimport("context"networkmanagement"cloud.google.com/go/networkmanagement/apiv1"networkmanagementpb"cloud.google.com/go/networkmanagement/apiv1/networkmanagementpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=networkmanagement.NewVpcFlowLogsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkmanagementpb.GetVpcFlowLogsConfigRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkmanagement/apiv1/networkmanagementpb#GetVpcFlowLogsConfigRequest.}resp,err:=c.GetVpcFlowLogsConfig(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*VpcFlowLogsClient) ListLocations
func(c*VpcFlowLogsClient)ListLocations(ctxcontext.Context,req*locationpb.ListLocationsRequest,opts...gax.CallOption)*LocationIteratorListLocations lists information about the supported locations for this service.
Examples
packagemainimport("context"networkmanagement"cloud.google.com/go/networkmanagement/apiv1""google.golang.org/api/iterator"locationpb"google.golang.org/genproto/googleapis/cloud/location")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=networkmanagement.NewVpcFlowLogsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&locationpb.ListLocationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.}it:=c.ListLocations(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*locationpb.ListLocationsResponse)}}all
packagemainimport("context"networkmanagement"cloud.google.com/go/networkmanagement/apiv1"locationpb"google.golang.org/genproto/googleapis/cloud/location")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=networkmanagement.NewVpcFlowLogsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&locationpb.ListLocationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.}forresp,err:=rangec.ListLocations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*VpcFlowLogsClient) ListOperations
func(c*VpcFlowLogsClient)ListOperations(ctxcontext.Context,req*longrunningpb.ListOperationsRequest,opts...gax.CallOption)*OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"networkmanagement"cloud.google.com/go/networkmanagement/apiv1""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=networkmanagement.NewVpcFlowLogsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}it:=c.ListOperations(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*longrunningpb.ListOperationsResponse)}}all
packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"networkmanagement"cloud.google.com/go/networkmanagement/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=networkmanagement.NewVpcFlowLogsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}forresp,err:=rangec.ListOperations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*VpcFlowLogsClient) ListVpcFlowLogsConfigs
func(c*VpcFlowLogsClient)ListVpcFlowLogsConfigs(ctxcontext.Context,req*networkmanagementpb.ListVpcFlowLogsConfigsRequest,opts...gax.CallOption)*VpcFlowLogsConfigIteratorListVpcFlowLogsConfigs lists all VpcFlowLogsConfigs in a given project.
Examples
packagemainimport("context"networkmanagement"cloud.google.com/go/networkmanagement/apiv1"networkmanagementpb"cloud.google.com/go/networkmanagement/apiv1/networkmanagementpb""google.golang.org/api/iterator")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=networkmanagement.NewVpcFlowLogsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkmanagementpb.ListVpcFlowLogsConfigsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkmanagement/apiv1/networkmanagementpb#ListVpcFlowLogsConfigsRequest.}it:=c.ListVpcFlowLogsConfigs(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*networkmanagementpb.ListVpcFlowLogsConfigsResponse)}}all
packagemainimport("context"networkmanagement"cloud.google.com/go/networkmanagement/apiv1"networkmanagementpb"cloud.google.com/go/networkmanagement/apiv1/networkmanagementpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=networkmanagement.NewVpcFlowLogsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkmanagementpb.ListVpcFlowLogsConfigsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkmanagement/apiv1/networkmanagementpb#ListVpcFlowLogsConfigsRequest.}forresp,err:=rangec.ListVpcFlowLogsConfigs(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*VpcFlowLogsClient) SetIamPolicy
func(c*VpcFlowLogsClient)SetIamPolicy(ctxcontext.Context,req*iampb.SetIamPolicyRequest,opts...gax.CallOption)(*iampb.Policy,error)SetIamPolicy sets the access control policy on the specified resource. Replacesany existing policy.
Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.
Example
packagemainimport("context"iampb"cloud.google.com/go/iam/apiv1/iampb"networkmanagement"cloud.google.com/go/networkmanagement/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=networkmanagement.NewVpcFlowLogsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&iampb.SetIamPolicyRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#SetIamPolicyRequest.}resp,err:=c.SetIamPolicy(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*VpcFlowLogsClient) TestIamPermissions
func(c*VpcFlowLogsClient)TestIamPermissions(ctxcontext.Context,req*iampb.TestIamPermissionsRequest,opts...gax.CallOption)(*iampb.TestIamPermissionsResponse,error)TestIamPermissions returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a NOT_FOUND error.
Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may “fail open” without warning.
Example
packagemainimport("context"iampb"cloud.google.com/go/iam/apiv1/iampb"networkmanagement"cloud.google.com/go/networkmanagement/apiv1")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=networkmanagement.NewVpcFlowLogsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&iampb.TestIamPermissionsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#TestIamPermissionsRequest.}resp,err:=c.TestIamPermissions(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*VpcFlowLogsClient) UpdateVpcFlowLogsConfig
func(c*VpcFlowLogsClient)UpdateVpcFlowLogsConfig(ctxcontext.Context,req*networkmanagementpb.UpdateVpcFlowLogsConfigRequest,opts...gax.CallOption)(*UpdateVpcFlowLogsConfigOperation,error)UpdateVpcFlowLogsConfig updates an existing VpcFlowLogsConfig.If a configuration with the exact same settings already exists (even if theID is different), the creation fails.Notes:
Updating a configuration with state=DISABLED will fail.
The following fields are not considered as settings for the purposeof the check mentioned above, therefore - updating another configurationwith the same fields but different values for the following fields willfail as well:
namecreate_timeupdate_timelabelsdescriptionExample
packagemainimport("context"networkmanagement"cloud.google.com/go/networkmanagement/apiv1"networkmanagementpb"cloud.google.com/go/networkmanagement/apiv1/networkmanagementpb")funcmain(){ctx:=context.Background()// This snippet has been automatically generated and should be regarded as a code template only.// It will require modifications to work:// - It may require correct/in-range values for request initialization.// - It may require specifying regional endpoints when creating the service client as shown in:// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Optionsc,err:=networkmanagement.NewVpcFlowLogsClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&networkmanagementpb.UpdateVpcFlowLogsConfigRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/networkmanagement/apiv1/networkmanagementpb#UpdateVpcFlowLogsConfigRequest.}op,err:=c.UpdateVpcFlowLogsConfig(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*VpcFlowLogsClient) UpdateVpcFlowLogsConfigOperation
func(c*VpcFlowLogsClient)UpdateVpcFlowLogsConfigOperation(namestring)*UpdateVpcFlowLogsConfigOperationUpdateVpcFlowLogsConfigOperation returns a new UpdateVpcFlowLogsConfigOperation from a given name.The name must be that of a previously created UpdateVpcFlowLogsConfigOperation, possibly from a different process.
VpcFlowLogsConfigIterator
typeVpcFlowLogsConfigIteratorstruct{// Response is the raw response for the current page.// It must be cast to the RPC response type.// Calling Next() or InternalFetch() updates this value.Responseinterface{}// InternalFetch is for use by the Google Cloud Libraries only.// It is not part of the stable interface of this package.//// InternalFetch returns results from a single call to the underlying RPC.// The number of results is no greater than pageSize.// If there are no more results, nextPageToken is empty and err is nil.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*networkmanagementpb.VpcFlowLogsConfig,nextPageTokenstring,errerror)// contains filtered or unexported fields}VpcFlowLogsConfigIterator manages a stream of *networkmanagementpb.VpcFlowLogsConfig.
func (*VpcFlowLogsConfigIterator) All
func(it*VpcFlowLogsConfigIterator)All()iter.Seq2[*networkmanagementpb.VpcFlowLogsConfig,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*VpcFlowLogsConfigIterator) Next
func(it*VpcFlowLogsConfigIterator)Next()(*networkmanagementpb.VpcFlowLogsConfig,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*VpcFlowLogsConfigIterator) PageInfo
func(it*VpcFlowLogsConfigIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-10-30 UTC.