Package networkservices is an auto-generated package for the Network Services API.
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/networkservices/apiv1beta1@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 := networkservices.NewDepClient(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 := &networkservicespb.CreateExtensionBindingRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1beta1/networkservicespb#CreateExtensionBindingRequest. } op, err := c.CreateExtensionBinding(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 NewDepClient 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.
CallOptions
type CallOptions struct {
ListEndpointPolicies []gax.CallOption
GetEndpointPolicy []gax.CallOption
CreateEndpointPolicy []gax.CallOption
UpdateEndpointPolicy []gax.CallOption
DeleteEndpointPolicy []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
}CallOptions contains the retry settings for each method of Client.
Client
type Client struct {
// The call options for this service.
CallOptions *CallOptions
// LROClient is used internally to handle long-running operations.
// It is exposed so that its CallOptions can be modified if required.
// Users should not Close this client.
LROClient *lroauto.OperationsClient
// contains filtered or unexported fields
}Client is a client for interacting with Network Services API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service describing handlers for resources.
func NewClient
NewClient creates a new network services client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Service describing handlers for resources.
Example
package main
import (
"context"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
)
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 := networkservices.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewRESTClient
NewRESTClient creates a new network services rest client.
Service describing handlers for resources.
Example
package main
import (
"context"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
)
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 := networkservices.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*Client) CancelOperation
func (c *Client) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) errorCancelOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
)
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 := networkservices.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*Client) Close
Close closes the connection to the API service. Always call Close() when the client is no longer required.
func (*Client) Connection (deprecated)
func (c *Client) 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 (*Client) CreateEndpointPolicy
func (c *Client) CreateEndpointPolicy(ctx context.Context, req *networkservicespb.CreateEndpointPolicyRequest, opts ...gax.CallOption) (*CreateEndpointPolicyOperation, error)CreateEndpointPolicy creates a new EndpointPolicy in a given project and location.
Example
package main
import (
"context"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
networkservicespb "cloud.google.com/go/networkservices/apiv1beta1/networkservicespb"
)
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 := networkservices.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkservicespb.CreateEndpointPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1beta1/networkservicespb#CreateEndpointPolicyRequest.
}
op, err := c.CreateEndpointPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) CreateEndpointPolicyOperation
func (c *Client) CreateEndpointPolicyOperation(name string) *CreateEndpointPolicyOperationCreateEndpointPolicyOperation returns a new CreateEndpointPolicyOperation from a given name. The name must be that of a previously created CreateEndpointPolicyOperation, possibly from a different process.
func (*Client) DeleteEndpointPolicy
func (c *Client) DeleteEndpointPolicy(ctx context.Context, req *networkservicespb.DeleteEndpointPolicyRequest, opts ...gax.CallOption) (*DeleteEndpointPolicyOperation, error)DeleteEndpointPolicy deletes a single EndpointPolicy.
Example
package main
import (
"context"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
networkservicespb "cloud.google.com/go/networkservices/apiv1beta1/networkservicespb"
)
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 := networkservices.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkservicespb.DeleteEndpointPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1beta1/networkservicespb#DeleteEndpointPolicyRequest.
}
op, err := c.DeleteEndpointPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*Client) DeleteEndpointPolicyOperation
func (c *Client) DeleteEndpointPolicyOperation(name string) *DeleteEndpointPolicyOperationDeleteEndpointPolicyOperation returns a new DeleteEndpointPolicyOperation from a given name. The name must be that of a previously created DeleteEndpointPolicyOperation, possibly from a different process.
func (*Client) DeleteOperation
func (c *Client) 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"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
)
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 := networkservices.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.DeleteOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.
}
err = c.DeleteOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*Client) GetEndpointPolicy
func (c *Client) GetEndpointPolicy(ctx context.Context, req *networkservicespb.GetEndpointPolicyRequest, opts ...gax.CallOption) (*networkservicespb.EndpointPolicy, error)GetEndpointPolicy gets details of a single EndpointPolicy.
Example
package main
import (
"context"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
networkservicespb "cloud.google.com/go/networkservices/apiv1beta1/networkservicespb"
)
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 := networkservices.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkservicespb.GetEndpointPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1beta1/networkservicespb#GetEndpointPolicyRequest.
}
resp, err := c.GetEndpointPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) GetIamPolicy
func (c *Client) 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"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
)
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 := networkservices.NewClient(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 (*Client) GetLocation
func (c *Client) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)GetLocation gets information about a location.
Example
package main
import (
"context"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
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 := networkservices.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.GetLocationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#GetLocationRequest.
}
resp, err := c.GetLocation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) GetOperation
func (c *Client) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)GetOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
)
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 := networkservices.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) ListEndpointPolicies
func (c *Client) ListEndpointPolicies(ctx context.Context, req *networkservicespb.ListEndpointPoliciesRequest, opts ...gax.CallOption) *EndpointPolicyIteratorListEndpointPolicies lists EndpointPolicies in a given project and location.
Examples
package main
import (
"context"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
networkservicespb "cloud.google.com/go/networkservices/apiv1beta1/networkservicespb"
"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 := networkservices.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkservicespb.ListEndpointPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1beta1/networkservicespb#ListEndpointPoliciesRequest.
}
it := c.ListEndpointPolicies(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.(*networkservicespb.ListEndpointPoliciesResponse)
}
}
all
package main
import (
"context"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
networkservicespb "cloud.google.com/go/networkservices/apiv1beta1/networkservicespb"
)
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 := networkservices.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkservicespb.ListEndpointPoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1beta1/networkservicespb#ListEndpointPoliciesRequest.
}
for resp, err := range c.ListEndpointPolicies(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*Client) ListLocations
func (c *Client) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIteratorListLocations lists information about the supported locations for this service.
This method lists locations based on the resource scope provided in the [ListLocationsRequest.name (at http://ListLocationsRequest.name)][google.cloud.location.ListLocationsRequest.name (at http://google.cloud.location.ListLocationsRequest.name)] field: * Global locations: If name is empty, the method lists the public locations available to all projects. * Project-specific locations: If name follows the format projects/{project}, the method lists locations visible to that specific project. This includes public, private, or other project-specific locations enabled for the project.
For gRPC and client library implementations, the resource name is passed as the name field. For direct service calls, the resource name is incorporated into the request path based on the specific service implementation and version.
Examples
package main
import (
"context"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
"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 := networkservices.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
it := c.ListLocations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*locationpb.ListLocationsResponse)
}
}
all
package main
import (
"context"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
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 := networkservices.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
for resp, err := range c.ListLocations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*Client) ListOperations
func (c *Client) 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"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
"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 := networkservices.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
it := c.ListOperations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*longrunningpb.ListOperationsResponse)
}
}
all
package main
import (
"context"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
)
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 := networkservices.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
for resp, err := range c.ListOperations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*Client) SetIamPolicy
func (c *Client) 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"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
)
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 := networkservices.NewClient(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 (*Client) TestIamPermissions
func (c *Client) 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"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
)
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 := networkservices.NewClient(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 (*Client) UpdateEndpointPolicy
func (c *Client) UpdateEndpointPolicy(ctx context.Context, req *networkservicespb.UpdateEndpointPolicyRequest, opts ...gax.CallOption) (*UpdateEndpointPolicyOperation, error)UpdateEndpointPolicy updates the parameters of a single EndpointPolicy.
Example
package main
import (
"context"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
networkservicespb "cloud.google.com/go/networkservices/apiv1beta1/networkservicespb"
)
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 := networkservices.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkservicespb.UpdateEndpointPolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1beta1/networkservicespb#UpdateEndpointPolicyRequest.
}
op, err := c.UpdateEndpointPolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) UpdateEndpointPolicyOperation
func (c *Client) UpdateEndpointPolicyOperation(name string) *UpdateEndpointPolicyOperationUpdateEndpointPolicyOperation returns a new UpdateEndpointPolicyOperation from a given name. The name must be that of a previously created UpdateEndpointPolicyOperation, possibly from a different process.
CreateEndpointPolicyOperation
type CreateEndpointPolicyOperation struct {
// contains filtered or unexported fields
}CreateEndpointPolicyOperation manages a long-running operation from CreateEndpointPolicy.
func (*CreateEndpointPolicyOperation) Done
func (op *CreateEndpointPolicyOperation) Done() boolDone reports whether the long-running operation has completed.
func (*CreateEndpointPolicyOperation) Metadata
func (op *CreateEndpointPolicyOperation) Metadata() (*networkservicespb.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 (*CreateEndpointPolicyOperation) Name
func (op *CreateEndpointPolicyOperation) 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 (*CreateEndpointPolicyOperation) Poll
func (op *CreateEndpointPolicyOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*networkservicespb.EndpointPolicy, 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 (*CreateEndpointPolicyOperation) Wait
func (op *CreateEndpointPolicyOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*networkservicespb.EndpointPolicy, 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.
CreateExtensionBindingOperation
type CreateExtensionBindingOperation struct {
// contains filtered or unexported fields
}CreateExtensionBindingOperation manages a long-running operation from CreateExtensionBinding.
func (*CreateExtensionBindingOperation) Done
func (op *CreateExtensionBindingOperation) Done() boolDone reports whether the long-running operation has completed.
func (*CreateExtensionBindingOperation) Metadata
func (op *CreateExtensionBindingOperation) Metadata() (*networkservicespb.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 (*CreateExtensionBindingOperation) Name
func (op *CreateExtensionBindingOperation) 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 (*CreateExtensionBindingOperation) Poll
func (op *CreateExtensionBindingOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*networkservicespb.ExtensionBinding, 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 (*CreateExtensionBindingOperation) Wait
func (op *CreateExtensionBindingOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*networkservicespb.ExtensionBinding, 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.
CreateLbRouteExtensionOperation
type CreateLbRouteExtensionOperation struct {
// contains filtered or unexported fields
}CreateLbRouteExtensionOperation manages a long-running operation from CreateLbRouteExtension.
func (*CreateLbRouteExtensionOperation) Done
func (op *CreateLbRouteExtensionOperation) Done() boolDone reports whether the long-running operation has completed.
func (*CreateLbRouteExtensionOperation) Metadata
func (op *CreateLbRouteExtensionOperation) Metadata() (*networkservicespb.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 (*CreateLbRouteExtensionOperation) Name
func (op *CreateLbRouteExtensionOperation) 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 (*CreateLbRouteExtensionOperation) Poll
func (op *CreateLbRouteExtensionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*networkservicespb.LbRouteExtension, 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 (*CreateLbRouteExtensionOperation) Wait
func (op *CreateLbRouteExtensionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*networkservicespb.LbRouteExtension, 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.
CreateLbTrafficExtensionOperation
type CreateLbTrafficExtensionOperation struct {
// contains filtered or unexported fields
}CreateLbTrafficExtensionOperation manages a long-running operation from CreateLbTrafficExtension.
func (*CreateLbTrafficExtensionOperation) Done
func (op *CreateLbTrafficExtensionOperation) Done() boolDone reports whether the long-running operation has completed.
func (*CreateLbTrafficExtensionOperation) Metadata
func (op *CreateLbTrafficExtensionOperation) Metadata() (*networkservicespb.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 (*CreateLbTrafficExtensionOperation) Name
func (op *CreateLbTrafficExtensionOperation) 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 (*CreateLbTrafficExtensionOperation) Poll
func (op *CreateLbTrafficExtensionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*networkservicespb.LbTrafficExtension, 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 (*CreateLbTrafficExtensionOperation) Wait
func (op *CreateLbTrafficExtensionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*networkservicespb.LbTrafficExtension, 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.
DeleteEndpointPolicyOperation
type DeleteEndpointPolicyOperation struct {
// contains filtered or unexported fields
}DeleteEndpointPolicyOperation manages a long-running operation from DeleteEndpointPolicy.
func (*DeleteEndpointPolicyOperation) Done
func (op *DeleteEndpointPolicyOperation) Done() boolDone reports whether the long-running operation has completed.
func (*DeleteEndpointPolicyOperation) Metadata
func (op *DeleteEndpointPolicyOperation) Metadata() (*networkservicespb.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 (*DeleteEndpointPolicyOperation) Name
func (op *DeleteEndpointPolicyOperation) 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 (*DeleteEndpointPolicyOperation) Poll
func (op *DeleteEndpointPolicyOperation) 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 (*DeleteEndpointPolicyOperation) Wait
func (op *DeleteEndpointPolicyOperation) 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.
DeleteExtensionBindingOperation
type DeleteExtensionBindingOperation struct {
// contains filtered or unexported fields
}DeleteExtensionBindingOperation manages a long-running operation from DeleteExtensionBinding.
func (*DeleteExtensionBindingOperation) Done
func (op *DeleteExtensionBindingOperation) Done() boolDone reports whether the long-running operation has completed.
func (*DeleteExtensionBindingOperation) Metadata
func (op *DeleteExtensionBindingOperation) Metadata() (*networkservicespb.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 (*DeleteExtensionBindingOperation) Name
func (op *DeleteExtensionBindingOperation) 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 (*DeleteExtensionBindingOperation) Poll
func (op *DeleteExtensionBindingOperation) 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 (*DeleteExtensionBindingOperation) Wait
func (op *DeleteExtensionBindingOperation) 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.
DeleteLbRouteExtensionOperation
type DeleteLbRouteExtensionOperation struct {
// contains filtered or unexported fields
}DeleteLbRouteExtensionOperation manages a long-running operation from DeleteLbRouteExtension.
func (*DeleteLbRouteExtensionOperation) Done
func (op *DeleteLbRouteExtensionOperation) Done() boolDone reports whether the long-running operation has completed.
func (*DeleteLbRouteExtensionOperation) Metadata
func (op *DeleteLbRouteExtensionOperation) Metadata() (*networkservicespb.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 (*DeleteLbRouteExtensionOperation) Name
func (op *DeleteLbRouteExtensionOperation) 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 (*DeleteLbRouteExtensionOperation) Poll
func (op *DeleteLbRouteExtensionOperation) 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 (*DeleteLbRouteExtensionOperation) Wait
func (op *DeleteLbRouteExtensionOperation) 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.
DeleteLbTrafficExtensionOperation
type DeleteLbTrafficExtensionOperation struct {
// contains filtered or unexported fields
}DeleteLbTrafficExtensionOperation manages a long-running operation from DeleteLbTrafficExtension.
func (*DeleteLbTrafficExtensionOperation) Done
func (op *DeleteLbTrafficExtensionOperation) Done() boolDone reports whether the long-running operation has completed.
func (*DeleteLbTrafficExtensionOperation) Metadata
func (op *DeleteLbTrafficExtensionOperation) Metadata() (*networkservicespb.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 (*DeleteLbTrafficExtensionOperation) Name
func (op *DeleteLbTrafficExtensionOperation) 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 (*DeleteLbTrafficExtensionOperation) Poll
func (op *DeleteLbTrafficExtensionOperation) 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 (*DeleteLbTrafficExtensionOperation) Wait
func (op *DeleteLbTrafficExtensionOperation) 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.
DepCallOptions
type DepCallOptions struct {
ListLbTrafficExtensions []gax.CallOption
GetLbTrafficExtension []gax.CallOption
CreateLbTrafficExtension []gax.CallOption
UpdateLbTrafficExtension []gax.CallOption
DeleteLbTrafficExtension []gax.CallOption
ListLbRouteExtensions []gax.CallOption
GetLbRouteExtension []gax.CallOption
CreateLbRouteExtension []gax.CallOption
UpdateLbRouteExtension []gax.CallOption
DeleteLbRouteExtension []gax.CallOption
ListExtensionBindings []gax.CallOption
GetExtensionBinding []gax.CallOption
CreateExtensionBinding []gax.CallOption
UpdateExtensionBinding []gax.CallOption
DeleteExtensionBinding []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
}DepCallOptions contains the retry settings for each method of DepClient.
DepClient
type DepClient struct {
// The call options for this service.
CallOptions *DepCallOptions
// 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
}DepClient is a client for interacting with Network Services API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service describing handlers for resources.
func NewDepClient
NewDepClient creates a new dep service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Service describing handlers for resources.
Example
package main
import (
"context"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
)
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 := networkservices.NewDepClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewDepRESTClient
NewDepRESTClient creates a new dep service rest client.
Service describing handlers for resources.
Example
package main
import (
"context"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
)
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 := networkservices.NewDepRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*DepClient) CancelOperation
func (c *DepClient) 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"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
)
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 := networkservices.NewDepClient(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 (*DepClient) Close
Close closes the connection to the API service. Always call Close() when the client is no longer required.
func (*DepClient) Connection (deprecated)
func (c *DepClient) 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 (*DepClient) CreateExtensionBinding
func (c *DepClient) CreateExtensionBinding(ctx context.Context, req *networkservicespb.CreateExtensionBindingRequest, opts ...gax.CallOption) (*CreateExtensionBindingOperation, error)CreateExtensionBinding creates a new ExtensionBinding resource in a given project and location.
Example
package main
import (
"context"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
networkservicespb "cloud.google.com/go/networkservices/apiv1beta1/networkservicespb"
)
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 := networkservices.NewDepClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkservicespb.CreateExtensionBindingRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1beta1/networkservicespb#CreateExtensionBindingRequest.
}
op, err := c.CreateExtensionBinding(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DepClient) CreateExtensionBindingOperation
func (c *DepClient) CreateExtensionBindingOperation(name string) *CreateExtensionBindingOperationCreateExtensionBindingOperation returns a new CreateExtensionBindingOperation from a given name. The name must be that of a previously created CreateExtensionBindingOperation, possibly from a different process.
func (*DepClient) CreateLbRouteExtension
func (c *DepClient) CreateLbRouteExtension(ctx context.Context, req *networkservicespb.CreateLbRouteExtensionRequest, opts ...gax.CallOption) (*CreateLbRouteExtensionOperation, error)CreateLbRouteExtension creates a new LbRouteExtension resource in a given project and location.
Example
package main
import (
"context"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
networkservicespb "cloud.google.com/go/networkservices/apiv1beta1/networkservicespb"
)
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 := networkservices.NewDepClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkservicespb.CreateLbRouteExtensionRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1beta1/networkservicespb#CreateLbRouteExtensionRequest.
}
op, err := c.CreateLbRouteExtension(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DepClient) CreateLbRouteExtensionOperation
func (c *DepClient) CreateLbRouteExtensionOperation(name string) *CreateLbRouteExtensionOperationCreateLbRouteExtensionOperation returns a new CreateLbRouteExtensionOperation from a given name. The name must be that of a previously created CreateLbRouteExtensionOperation, possibly from a different process.
func (*DepClient) CreateLbTrafficExtension
func (c *DepClient) CreateLbTrafficExtension(ctx context.Context, req *networkservicespb.CreateLbTrafficExtensionRequest, opts ...gax.CallOption) (*CreateLbTrafficExtensionOperation, error)CreateLbTrafficExtension creates a new LbTrafficExtension resource in a given project and location.
Example
package main
import (
"context"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
networkservicespb "cloud.google.com/go/networkservices/apiv1beta1/networkservicespb"
)
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 := networkservices.NewDepClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkservicespb.CreateLbTrafficExtensionRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1beta1/networkservicespb#CreateLbTrafficExtensionRequest.
}
op, err := c.CreateLbTrafficExtension(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DepClient) CreateLbTrafficExtensionOperation
func (c *DepClient) CreateLbTrafficExtensionOperation(name string) *CreateLbTrafficExtensionOperationCreateLbTrafficExtensionOperation returns a new CreateLbTrafficExtensionOperation from a given name. The name must be that of a previously created CreateLbTrafficExtensionOperation, possibly from a different process.
func (*DepClient) DeleteExtensionBinding
func (c *DepClient) DeleteExtensionBinding(ctx context.Context, req *networkservicespb.DeleteExtensionBindingRequest, opts ...gax.CallOption) (*DeleteExtensionBindingOperation, error)DeleteExtensionBinding deletes the specified ExtensionBinding resource.
Example
package main
import (
"context"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
networkservicespb "cloud.google.com/go/networkservices/apiv1beta1/networkservicespb"
)
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 := networkservices.NewDepClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkservicespb.DeleteExtensionBindingRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1beta1/networkservicespb#DeleteExtensionBindingRequest.
}
op, err := c.DeleteExtensionBinding(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*DepClient) DeleteExtensionBindingOperation
func (c *DepClient) DeleteExtensionBindingOperation(name string) *DeleteExtensionBindingOperationDeleteExtensionBindingOperation returns a new DeleteExtensionBindingOperation from a given name. The name must be that of a previously created DeleteExtensionBindingOperation, possibly from a different process.
func (*DepClient) DeleteLbRouteExtension
func (c *DepClient) DeleteLbRouteExtension(ctx context.Context, req *networkservicespb.DeleteLbRouteExtensionRequest, opts ...gax.CallOption) (*DeleteLbRouteExtensionOperation, error)DeleteLbRouteExtension deletes the specified LbRouteExtension resource.
Example
package main
import (
"context"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
networkservicespb "cloud.google.com/go/networkservices/apiv1beta1/networkservicespb"
)
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 := networkservices.NewDepClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkservicespb.DeleteLbRouteExtensionRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1beta1/networkservicespb#DeleteLbRouteExtensionRequest.
}
op, err := c.DeleteLbRouteExtension(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*DepClient) DeleteLbRouteExtensionOperation
func (c *DepClient) DeleteLbRouteExtensionOperation(name string) *DeleteLbRouteExtensionOperationDeleteLbRouteExtensionOperation returns a new DeleteLbRouteExtensionOperation from a given name. The name must be that of a previously created DeleteLbRouteExtensionOperation, possibly from a different process.
func (*DepClient) DeleteLbTrafficExtension
func (c *DepClient) DeleteLbTrafficExtension(ctx context.Context, req *networkservicespb.DeleteLbTrafficExtensionRequest, opts ...gax.CallOption) (*DeleteLbTrafficExtensionOperation, error)DeleteLbTrafficExtension deletes the specified LbTrafficExtension resource.
Example
package main
import (
"context"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
networkservicespb "cloud.google.com/go/networkservices/apiv1beta1/networkservicespb"
)
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 := networkservices.NewDepClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkservicespb.DeleteLbTrafficExtensionRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1beta1/networkservicespb#DeleteLbTrafficExtensionRequest.
}
op, err := c.DeleteLbTrafficExtension(ctx, req)
if err != nil {
// TODO: Handle error.
}
err = op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
}
func (*DepClient) DeleteLbTrafficExtensionOperation
func (c *DepClient) DeleteLbTrafficExtensionOperation(name string) *DeleteLbTrafficExtensionOperationDeleteLbTrafficExtensionOperation returns a new DeleteLbTrafficExtensionOperation from a given name. The name must be that of a previously created DeleteLbTrafficExtensionOperation, possibly from a different process.
func (*DepClient) DeleteOperation
func (c *DepClient) 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"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
)
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 := networkservices.NewDepClient(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 (*DepClient) GetExtensionBinding
func (c *DepClient) GetExtensionBinding(ctx context.Context, req *networkservicespb.GetExtensionBindingRequest, opts ...gax.CallOption) (*networkservicespb.ExtensionBinding, error)GetExtensionBinding gets details of the specified ExtensionBinding resource.
Example
package main
import (
"context"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
networkservicespb "cloud.google.com/go/networkservices/apiv1beta1/networkservicespb"
)
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 := networkservices.NewDepClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkservicespb.GetExtensionBindingRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1beta1/networkservicespb#GetExtensionBindingRequest.
}
resp, err := c.GetExtensionBinding(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DepClient) GetIamPolicy
func (c *DepClient) 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"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
)
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 := networkservices.NewDepClient(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 (*DepClient) GetLbRouteExtension
func (c *DepClient) GetLbRouteExtension(ctx context.Context, req *networkservicespb.GetLbRouteExtensionRequest, opts ...gax.CallOption) (*networkservicespb.LbRouteExtension, error)GetLbRouteExtension gets details of the specified LbRouteExtension resource.
Example
package main
import (
"context"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
networkservicespb "cloud.google.com/go/networkservices/apiv1beta1/networkservicespb"
)
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 := networkservices.NewDepClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkservicespb.GetLbRouteExtensionRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1beta1/networkservicespb#GetLbRouteExtensionRequest.
}
resp, err := c.GetLbRouteExtension(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DepClient) GetLbTrafficExtension
func (c *DepClient) GetLbTrafficExtension(ctx context.Context, req *networkservicespb.GetLbTrafficExtensionRequest, opts ...gax.CallOption) (*networkservicespb.LbTrafficExtension, error)GetLbTrafficExtension gets details of the specified LbTrafficExtension resource.
Example
package main
import (
"context"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
networkservicespb "cloud.google.com/go/networkservices/apiv1beta1/networkservicespb"
)
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 := networkservices.NewDepClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkservicespb.GetLbTrafficExtensionRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1beta1/networkservicespb#GetLbTrafficExtensionRequest.
}
resp, err := c.GetLbTrafficExtension(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DepClient) GetLocation
func (c *DepClient) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)GetLocation gets information about a location.
Example
package main
import (
"context"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
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 := networkservices.NewDepClient(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 (*DepClient) GetOperation
func (c *DepClient) 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"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
)
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 := networkservices.NewDepClient(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 (*DepClient) ListExtensionBindings
func (c *DepClient) ListExtensionBindings(ctx context.Context, req *networkservicespb.ListExtensionBindingsRequest, opts ...gax.CallOption) *ExtensionBindingIteratorListExtensionBindings lists ExtensionBinding resources in a given project and location.
Examples
package main
import (
"context"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
networkservicespb "cloud.google.com/go/networkservices/apiv1beta1/networkservicespb"
"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 := networkservices.NewDepClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkservicespb.ListExtensionBindingsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1beta1/networkservicespb#ListExtensionBindingsRequest.
}
it := c.ListExtensionBindings(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.(*networkservicespb.ListExtensionBindingsResponse)
}
}
all
package main
import (
"context"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
networkservicespb "cloud.google.com/go/networkservices/apiv1beta1/networkservicespb"
)
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 := networkservices.NewDepClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkservicespb.ListExtensionBindingsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1beta1/networkservicespb#ListExtensionBindingsRequest.
}
for resp, err := range c.ListExtensionBindings(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*DepClient) ListLbRouteExtensions
func (c *DepClient) ListLbRouteExtensions(ctx context.Context, req *networkservicespb.ListLbRouteExtensionsRequest, opts ...gax.CallOption) *LbRouteExtensionIteratorListLbRouteExtensions lists LbRouteExtension resources in a given project and location.
Examples
package main
import (
"context"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
networkservicespb "cloud.google.com/go/networkservices/apiv1beta1/networkservicespb"
"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 := networkservices.NewDepClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkservicespb.ListLbRouteExtensionsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1beta1/networkservicespb#ListLbRouteExtensionsRequest.
}
it := c.ListLbRouteExtensions(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.(*networkservicespb.ListLbRouteExtensionsResponse)
}
}
all
package main
import (
"context"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
networkservicespb "cloud.google.com/go/networkservices/apiv1beta1/networkservicespb"
)
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 := networkservices.NewDepClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkservicespb.ListLbRouteExtensionsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1beta1/networkservicespb#ListLbRouteExtensionsRequest.
}
for resp, err := range c.ListLbRouteExtensions(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*DepClient) ListLbTrafficExtensions
func (c *DepClient) ListLbTrafficExtensions(ctx context.Context, req *networkservicespb.ListLbTrafficExtensionsRequest, opts ...gax.CallOption) *LbTrafficExtensionIteratorListLbTrafficExtensions lists LbTrafficExtension resources in a given project and location.
Examples
package main
import (
"context"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
networkservicespb "cloud.google.com/go/networkservices/apiv1beta1/networkservicespb"
"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 := networkservices.NewDepClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkservicespb.ListLbTrafficExtensionsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1beta1/networkservicespb#ListLbTrafficExtensionsRequest.
}
it := c.ListLbTrafficExtensions(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.(*networkservicespb.ListLbTrafficExtensionsResponse)
}
}
all
package main
import (
"context"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
networkservicespb "cloud.google.com/go/networkservices/apiv1beta1/networkservicespb"
)
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 := networkservices.NewDepClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkservicespb.ListLbTrafficExtensionsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1beta1/networkservicespb#ListLbTrafficExtensionsRequest.
}
for resp, err := range c.ListLbTrafficExtensions(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*DepClient) ListLocations
func (c *DepClient) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIteratorListLocations lists information about the supported locations for this service.
This method lists locations based on the resource scope provided in the [ListLocationsRequest.name (at http://ListLocationsRequest.name)][google.cloud.location.ListLocationsRequest.name (at http://google.cloud.location.ListLocationsRequest.name)] field: * Global locations: If name is empty, the method lists the public locations available to all projects. * Project-specific locations: If name follows the format projects/{project}, the method lists locations visible to that specific project. This includes public, private, or other project-specific locations enabled for the project.
For gRPC and client library implementations, the resource name is passed as the name field. For direct service calls, the resource name is incorporated into the request path based on the specific service implementation and version.
Examples
package main
import (
"context"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
"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 := networkservices.NewDepClient(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"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
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 := networkservices.NewDepClient(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 (*DepClient) ListOperations
func (c *DepClient) 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"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
"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 := networkservices.NewDepClient(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"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
)
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 := networkservices.NewDepClient(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 (*DepClient) SetIamPolicy
func (c *DepClient) 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"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
)
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 := networkservices.NewDepClient(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 (*DepClient) TestIamPermissions
func (c *DepClient) 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"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
)
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 := networkservices.NewDepClient(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 (*DepClient) UpdateExtensionBinding
func (c *DepClient) UpdateExtensionBinding(ctx context.Context, req *networkservicespb.UpdateExtensionBindingRequest, opts ...gax.CallOption) (*UpdateExtensionBindingOperation, error)UpdateExtensionBinding updates the parameters of the specified ExtensionBinding resource.
Example
package main
import (
"context"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
networkservicespb "cloud.google.com/go/networkservices/apiv1beta1/networkservicespb"
)
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 := networkservices.NewDepClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkservicespb.UpdateExtensionBindingRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1beta1/networkservicespb#UpdateExtensionBindingRequest.
}
op, err := c.UpdateExtensionBinding(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DepClient) UpdateExtensionBindingOperation
func (c *DepClient) UpdateExtensionBindingOperation(name string) *UpdateExtensionBindingOperationUpdateExtensionBindingOperation returns a new UpdateExtensionBindingOperation from a given name. The name must be that of a previously created UpdateExtensionBindingOperation, possibly from a different process.
func (*DepClient) UpdateLbRouteExtension
func (c *DepClient) UpdateLbRouteExtension(ctx context.Context, req *networkservicespb.UpdateLbRouteExtensionRequest, opts ...gax.CallOption) (*UpdateLbRouteExtensionOperation, error)UpdateLbRouteExtension updates the parameters of the specified LbRouteExtension resource.
Example
package main
import (
"context"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
networkservicespb "cloud.google.com/go/networkservices/apiv1beta1/networkservicespb"
)
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 := networkservices.NewDepClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkservicespb.UpdateLbRouteExtensionRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1beta1/networkservicespb#UpdateLbRouteExtensionRequest.
}
op, err := c.UpdateLbRouteExtension(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DepClient) UpdateLbRouteExtensionOperation
func (c *DepClient) UpdateLbRouteExtensionOperation(name string) *UpdateLbRouteExtensionOperationUpdateLbRouteExtensionOperation returns a new UpdateLbRouteExtensionOperation from a given name. The name must be that of a previously created UpdateLbRouteExtensionOperation, possibly from a different process.
func (*DepClient) UpdateLbTrafficExtension
func (c *DepClient) UpdateLbTrafficExtension(ctx context.Context, req *networkservicespb.UpdateLbTrafficExtensionRequest, opts ...gax.CallOption) (*UpdateLbTrafficExtensionOperation, error)UpdateLbTrafficExtension updates the parameters of the specified LbTrafficExtension resource.
Example
package main
import (
"context"
networkservices "cloud.google.com/go/networkservices/apiv1beta1"
networkservicespb "cloud.google.com/go/networkservices/apiv1beta1/networkservicespb"
)
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 := networkservices.NewDepClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &networkservicespb.UpdateLbTrafficExtensionRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/networkservices/apiv1beta1/networkservicespb#UpdateLbTrafficExtensionRequest.
}
op, err := c.UpdateLbTrafficExtension(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DepClient) UpdateLbTrafficExtensionOperation
func (c *DepClient) UpdateLbTrafficExtensionOperation(name string) *UpdateLbTrafficExtensionOperationUpdateLbTrafficExtensionOperation returns a new UpdateLbTrafficExtensionOperation from a given name. The name must be that of a previously created UpdateLbTrafficExtensionOperation, possibly from a different process.
EndpointPolicyIterator
type EndpointPolicyIterator 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 []*networkservicespb.EndpointPolicy, nextPageToken string, err error)
// contains filtered or unexported fields
}EndpointPolicyIterator manages a stream of *networkservicespb.EndpointPolicy.
func (*EndpointPolicyIterator) All
func (it *EndpointPolicyIterator) All() iter.Seq2[*networkservicespb.EndpointPolicy, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*EndpointPolicyIterator) Next
func (it *EndpointPolicyIterator) Next() (*networkservicespb.EndpointPolicy, 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 (*EndpointPolicyIterator) PageInfo
func (it *EndpointPolicyIterator) PageInfo() *iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
ExtensionBindingIterator
type ExtensionBindingIterator 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 []*networkservicespb.ExtensionBinding, nextPageToken string, err error)
// contains filtered or unexported fields
}ExtensionBindingIterator manages a stream of *networkservicespb.ExtensionBinding.
func (*ExtensionBindingIterator) All
func (it *ExtensionBindingIterator) All() iter.Seq2[*networkservicespb.ExtensionBinding, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ExtensionBindingIterator) Next
func (it *ExtensionBindingIterator) Next() (*networkservicespb.ExtensionBinding, 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 (*ExtensionBindingIterator) PageInfo
func (it *ExtensionBindingIterator) PageInfo() *iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
LbRouteExtensionIterator
type LbRouteExtensionIterator 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 []*networkservicespb.LbRouteExtension, nextPageToken string, err error)
// contains filtered or unexported fields
}LbRouteExtensionIterator manages a stream of *networkservicespb.LbRouteExtension.
func (*LbRouteExtensionIterator) All
func (it *LbRouteExtensionIterator) All() iter.Seq2[*networkservicespb.LbRouteExtension, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*LbRouteExtensionIterator) Next
func (it *LbRouteExtensionIterator) Next() (*networkservicespb.LbRouteExtension, 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 (*LbRouteExtensionIterator) PageInfo
func (it *LbRouteExtensionIterator) PageInfo() *iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
LbTrafficExtensionIterator
type LbTrafficExtensionIterator 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 []*networkservicespb.LbTrafficExtension, nextPageToken string, err error)
// contains filtered or unexported fields
}LbTrafficExtensionIterator manages a stream of *networkservicespb.LbTrafficExtension.
func (*LbTrafficExtensionIterator) All
func (it *LbTrafficExtensionIterator) All() iter.Seq2[*networkservicespb.LbTrafficExtension, error]All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*LbTrafficExtensionIterator) Next
func (it *LbTrafficExtensionIterator) Next() (*networkservicespb.LbTrafficExtension, 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 (*LbTrafficExtensionIterator) PageInfo
func (it *LbTrafficExtensionIterator) 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.
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.
UpdateEndpointPolicyOperation
type UpdateEndpointPolicyOperation struct {
// contains filtered or unexported fields
}UpdateEndpointPolicyOperation manages a long-running operation from UpdateEndpointPolicy.
func (*UpdateEndpointPolicyOperation) Done
func (op *UpdateEndpointPolicyOperation) Done() boolDone reports whether the long-running operation has completed.
func (*UpdateEndpointPolicyOperation) Metadata
func (op *UpdateEndpointPolicyOperation) Metadata() (*networkservicespb.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 (*UpdateEndpointPolicyOperation) Name
func (op *UpdateEndpointPolicyOperation) 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 (*UpdateEndpointPolicyOperation) Poll
func (op *UpdateEndpointPolicyOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*networkservicespb.EndpointPolicy, 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 (*UpdateEndpointPolicyOperation) Wait
func (op *UpdateEndpointPolicyOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*networkservicespb.EndpointPolicy, 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.
UpdateExtensionBindingOperation
type UpdateExtensionBindingOperation struct {
// contains filtered or unexported fields
}UpdateExtensionBindingOperation manages a long-running operation from UpdateExtensionBinding.
func (*UpdateExtensionBindingOperation) Done
func (op *UpdateExtensionBindingOperation) Done() boolDone reports whether the long-running operation has completed.
func (*UpdateExtensionBindingOperation) Metadata
func (op *UpdateExtensionBindingOperation) Metadata() (*networkservicespb.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 (*UpdateExtensionBindingOperation) Name
func (op *UpdateExtensionBindingOperation) 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 (*UpdateExtensionBindingOperation) Poll
func (op *UpdateExtensionBindingOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*networkservicespb.ExtensionBinding, 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 (*UpdateExtensionBindingOperation) Wait
func (op *UpdateExtensionBindingOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*networkservicespb.ExtensionBinding, 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.
UpdateLbRouteExtensionOperation
type UpdateLbRouteExtensionOperation struct {
// contains filtered or unexported fields
}UpdateLbRouteExtensionOperation manages a long-running operation from UpdateLbRouteExtension.
func (*UpdateLbRouteExtensionOperation) Done
func (op *UpdateLbRouteExtensionOperation) Done() boolDone reports whether the long-running operation has completed.
func (*UpdateLbRouteExtensionOperation) Metadata
func (op *UpdateLbRouteExtensionOperation) Metadata() (*networkservicespb.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 (*UpdateLbRouteExtensionOperation) Name
func (op *UpdateLbRouteExtensionOperation) 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 (*UpdateLbRouteExtensionOperation) Poll
func (op *UpdateLbRouteExtensionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*networkservicespb.LbRouteExtension, 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 (*UpdateLbRouteExtensionOperation) Wait
func (op *UpdateLbRouteExtensionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*networkservicespb.LbRouteExtension, 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.
UpdateLbTrafficExtensionOperation
type UpdateLbTrafficExtensionOperation struct {
// contains filtered or unexported fields
}UpdateLbTrafficExtensionOperation manages a long-running operation from UpdateLbTrafficExtension.
func (*UpdateLbTrafficExtensionOperation) Done
func (op *UpdateLbTrafficExtensionOperation) Done() boolDone reports whether the long-running operation has completed.
func (*UpdateLbTrafficExtensionOperation) Metadata
func (op *UpdateLbTrafficExtensionOperation) Metadata() (*networkservicespb.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 (*UpdateLbTrafficExtensionOperation) Name
func (op *UpdateLbTrafficExtensionOperation) 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 (*UpdateLbTrafficExtensionOperation) Poll
func (op *UpdateLbTrafficExtensionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*networkservicespb.LbTrafficExtension, 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 (*UpdateLbTrafficExtensionOperation) Wait
func (op *UpdateLbTrafficExtensionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*networkservicespb.LbTrafficExtension, 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.