Google Compute Engine API v1 - Package cloud.google.com/go/compute/apiv1 (v0.89.0)

Package compute is an auto-generated package for the Google Compute Engine API.

NOTE: This package is in alpha. It is not stable, and is likely to change.

Use of Context

The ctx passed to NewClient is used for authentication requests and for creating the underlying connection, but is not used for subsequent calls. Individual methods on the client use the ctx given to them.

To close the open connection, use the Close() method.

For information about setting deadlines, reusing contexts, and more please visit https://pkg.go.dev/cloud.google.com/go.

Functions

func DefaultAuthScopes

func DefaultAuthScopes() []string

DefaultAuthScopes reports the default set of authentication scopes to use with this package.

AcceleratorTypesCallOptions

type AcceleratorTypesCallOptions struct {
	AggregatedList []gax.CallOption
	Get            []gax.CallOption
	List           []gax.CallOption
}

AcceleratorTypesCallOptions contains the retry settings for each method of AcceleratorTypesClient.

AcceleratorTypesClient

type AcceleratorTypesClient struct {

	// The call options for this service.
	CallOptions *AcceleratorTypesCallOptions
	// contains filtered or unexported fields
}

AcceleratorTypesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

Services

The AcceleratorTypes API.

func NewAcceleratorTypesRESTClient

func NewAcceleratorTypesRESTClient(ctx context.Context, opts ...option.ClientOption) (*AcceleratorTypesClient, error)

NewAcceleratorTypesRESTClient creates a new accelerator types rest client.

Services

The AcceleratorTypes API.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewAcceleratorTypesRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func (*AcceleratorTypesClient) AggregatedList

AggregatedList retrieves an aggregated list of accelerator types.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewAcceleratorTypesRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.AggregatedListAcceleratorTypesRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.AggregatedList(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*AcceleratorTypesClient) Close

func (c *AcceleratorTypesClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*AcceleratorTypesClient) Connection

func (c *AcceleratorTypesClient) Connection() *grpc.ClientConn

Connection returns a connection to the API service.

Deprecated.

func (*AcceleratorTypesClient) Get

Get returns the specified accelerator type.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewAcceleratorTypesRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.GetAcceleratorTypeRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.Get(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*AcceleratorTypesClient) List

List retrieves a list of accelerator types that are available to the specified project.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewAcceleratorTypesRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.ListAcceleratorTypesRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.List(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

AddressesCallOptions

type AddressesCallOptions struct {
	AggregatedList []gax.CallOption
	Delete         []gax.CallOption
	Get            []gax.CallOption
	Insert         []gax.CallOption
	List           []gax.CallOption
}

AddressesCallOptions contains the retry settings for each method of AddressesClient.

AddressesClient

type AddressesClient struct {

	// The call options for this service.
	CallOptions *AddressesCallOptions
	// contains filtered or unexported fields
}

AddressesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

The Addresses API.

func NewAddressesRESTClient

func NewAddressesRESTClient(ctx context.Context, opts ...option.ClientOption) (*AddressesClient, error)

NewAddressesRESTClient creates a new addresses rest client.

The Addresses API.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewAddressesRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func (*AddressesClient) AggregatedList

AggregatedList retrieves an aggregated list of addresses.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewAddressesRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.AggregatedListAddressesRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.AggregatedList(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*AddressesClient) Close

func (c *AddressesClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*AddressesClient) Connection

func (c *AddressesClient) Connection() *grpc.ClientConn

Connection returns a connection to the API service.

Deprecated.

func (*AddressesClient) Delete

Delete deletes the specified address resource.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewAddressesRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.DeleteAddressRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.Delete(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*AddressesClient) Get

Get returns the specified address resource.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewAddressesRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.GetAddressRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.Get(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*AddressesClient) Insert

Insert creates an address resource in the specified project by using the data included in the request.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewAddressesRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.InsertAddressRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.Insert(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*AddressesClient) List

List retrieves a list of addresses contained within the specified region.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewAddressesRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.ListAddressesRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.List(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

AutoscalersCallOptions

type AutoscalersCallOptions struct {
	AggregatedList []gax.CallOption
	Delete         []gax.CallOption
	Get            []gax.CallOption
	Insert         []gax.CallOption
	List           []gax.CallOption
	Patch          []gax.CallOption
	Update         []gax.CallOption
}

AutoscalersCallOptions contains the retry settings for each method of AutoscalersClient.

AutoscalersClient

type AutoscalersClient struct {

	// The call options for this service.
	CallOptions *AutoscalersCallOptions
	// contains filtered or unexported fields
}

AutoscalersClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

The Autoscalers API.

func NewAutoscalersRESTClient

func NewAutoscalersRESTClient(ctx context.Context, opts ...option.ClientOption) (*AutoscalersClient, error)

NewAutoscalersRESTClient creates a new autoscalers rest client.

The Autoscalers API.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewAutoscalersRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func (*AutoscalersClient) AggregatedList

AggregatedList retrieves an aggregated list of autoscalers.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewAutoscalersRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.AggregatedListAutoscalersRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.AggregatedList(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*AutoscalersClient) Close

func (c *AutoscalersClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*AutoscalersClient) Connection

func (c *AutoscalersClient) Connection() *grpc.ClientConn

Connection returns a connection to the API service.

Deprecated.

func (*AutoscalersClient) Delete

Delete deletes the specified autoscaler.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewAutoscalersRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.DeleteAutoscalerRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.Delete(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*AutoscalersClient) Get

Get returns the specified autoscaler resource. Gets a list of available autoscalers by making a list() request.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewAutoscalersRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.GetAutoscalerRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.Get(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*AutoscalersClient) Insert

Insert creates an autoscaler in the specified project using the data included in the request.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewAutoscalersRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.InsertAutoscalerRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.Insert(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*AutoscalersClient) List

List retrieves a list of autoscalers contained within the specified zone.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewAutoscalersRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.ListAutoscalersRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.List(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*AutoscalersClient) Patch

Patch updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewAutoscalersRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.PatchAutoscalerRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.Patch(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*AutoscalersClient) Update

Update updates an autoscaler in the specified project using the data included in the request.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewAutoscalersRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.UpdateAutoscalerRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.Update(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

BackendBucketsCallOptions

type BackendBucketsCallOptions struct {
	AddSignedUrlKey    []gax.CallOption
	Delete             []gax.CallOption
	DeleteSignedUrlKey []gax.CallOption
	Get                []gax.CallOption
	Insert             []gax.CallOption
	List               []gax.CallOption
	Patch              []gax.CallOption
	Update             []gax.CallOption
}

BackendBucketsCallOptions contains the retry settings for each method of BackendBucketsClient.

BackendBucketsClient

type BackendBucketsClient struct {

	// The call options for this service.
	CallOptions *BackendBucketsCallOptions
	// contains filtered or unexported fields
}

BackendBucketsClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

The BackendBuckets API.

func NewBackendBucketsRESTClient

func NewBackendBucketsRESTClient(ctx context.Context, opts ...option.ClientOption) (*BackendBucketsClient, error)

NewBackendBucketsRESTClient creates a new backend buckets rest client.

The BackendBuckets API.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewBackendBucketsRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func (*BackendBucketsClient) AddSignedUrlKey

AddSignedUrlKey adds a key for validating requests with signed URLs for this backend bucket.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewBackendBucketsRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.AddSignedUrlKeyBackendBucketRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.AddSignedUrlKey(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*BackendBucketsClient) Close

func (c *BackendBucketsClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*BackendBucketsClient) Connection

func (c *BackendBucketsClient) Connection() *grpc.ClientConn

Connection returns a connection to the API service.

Deprecated.

func (*BackendBucketsClient) Delete

Delete deletes the specified BackendBucket resource.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewBackendBucketsRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.DeleteBackendBucketRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.Delete(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*BackendBucketsClient) DeleteSignedUrlKey

DeleteSignedUrlKey deletes a key for validating requests with signed URLs for this backend bucket.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewBackendBucketsRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.DeleteSignedUrlKeyBackendBucketRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.DeleteSignedUrlKey(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*BackendBucketsClient) Get

Get returns the specified BackendBucket resource. Gets a list of available backend buckets by making a list() request.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewBackendBucketsRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.GetBackendBucketRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.Get(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*BackendBucketsClient) Insert

Insert creates a BackendBucket resource in the specified project using the data included in the request.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewBackendBucketsRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.InsertBackendBucketRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.Insert(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*BackendBucketsClient) List

List retrieves the list of BackendBucket resources available to the specified project.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewBackendBucketsRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.ListBackendBucketsRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.List(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*BackendBucketsClient) Patch

Patch updates the specified BackendBucket resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewBackendBucketsRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.PatchBackendBucketRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.Patch(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*BackendBucketsClient) Update

Update updates the specified BackendBucket resource with the data included in the request.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewBackendBucketsRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.UpdateBackendBucketRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.Update(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

BackendServicesCallOptions

type BackendServicesCallOptions struct {
	AddSignedUrlKey    []gax.CallOption
	AggregatedList     []gax.CallOption
	Delete             []gax.CallOption
	DeleteSignedUrlKey []gax.CallOption
	Get                []gax.CallOption
	GetHealth          []gax.CallOption
	Insert             []gax.CallOption
	List               []gax.CallOption
	Patch              []gax.CallOption
	SetSecurityPolicy  []gax.CallOption
	Update             []gax.CallOption
}

BackendServicesCallOptions contains the retry settings for each method of BackendServicesClient.

BackendServicesClient

type BackendServicesClient struct {

	// The call options for this service.
	CallOptions *BackendServicesCallOptions
	// contains filtered or unexported fields
}

BackendServicesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

The BackendServices API.

func NewBackendServicesRESTClient

func NewBackendServicesRESTClient(ctx context.Context, opts ...option.ClientOption) (*BackendServicesClient, error)

NewBackendServicesRESTClient creates a new backend services rest client.

The BackendServices API.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewBackendServicesRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func (*BackendServicesClient) AddSignedUrlKey

AddSignedUrlKey adds a key for validating requests with signed URLs for this backend service.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewBackendServicesRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.AddSignedUrlKeyBackendServiceRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.AddSignedUrlKey(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*BackendServicesClient) AggregatedList

AggregatedList retrieves the list of all BackendService resources, regional and global, available to the specified project.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewBackendServicesRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.AggregatedListBackendServicesRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.AggregatedList(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*BackendServicesClient) Close

func (c *BackendServicesClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*BackendServicesClient) Connection

func (c *BackendServicesClient) Connection() *grpc.ClientConn

Connection returns a connection to the API service.

Deprecated.

func (*BackendServicesClient) Delete

Delete deletes the specified BackendService resource.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewBackendServicesRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.DeleteBackendServiceRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.Delete(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*BackendServicesClient) DeleteSignedUrlKey

DeleteSignedUrlKey deletes a key for validating requests with signed URLs for this backend service.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewBackendServicesRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.DeleteSignedUrlKeyBackendServiceRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.DeleteSignedUrlKey(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*BackendServicesClient) Get

Get returns the specified BackendService resource. Gets a list of available backend services.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewBackendServicesRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.GetBackendServiceRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.Get(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*BackendServicesClient) GetHealth

GetHealth gets the most recent health check results for this BackendService.

Example request body:

{ “group”: “/zones/us-east1-b/instanceGroups/lb-backend-example” }

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewBackendServicesRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.GetHealthBackendServiceRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.GetHealth(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*BackendServicesClient) Insert

Insert creates a BackendService resource in the specified project using the data included in the request. For more information, see Backend services overview.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewBackendServicesRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.InsertBackendServiceRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.Insert(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*BackendServicesClient) List

List retrieves the list of BackendService resources available to the specified project.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewBackendServicesRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.ListBackendServicesRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.List(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*BackendServicesClient) Patch

Patch patches the specified BackendService resource with the data included in the request. For more information, see Backend services overview. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewBackendServicesRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.PatchBackendServiceRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.Patch(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*BackendServicesClient) SetSecurityPolicy

SetSecurityPolicy sets the Google Cloud Armor security policy for the specified backend service. For more information, see Google Cloud Armor Overview

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewBackendServicesRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.SetSecurityPolicyBackendServiceRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.SetSecurityPolicy(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*BackendServicesClient) Update

Update updates the specified BackendService resource with the data included in the request. For more information, see Backend services overview.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewBackendServicesRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.UpdateBackendServiceRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.Update(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

DiskTypesCallOptions

type DiskTypesCallOptions struct {
	AggregatedList []gax.CallOption
	Get            []gax.CallOption
	List           []gax.CallOption
}

DiskTypesCallOptions contains the retry settings for each method of DiskTypesClient.

DiskTypesClient

type DiskTypesClient struct {

	// The call options for this service.
	CallOptions *DiskTypesCallOptions
	// contains filtered or unexported fields
}

DiskTypesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

The DiskTypes API.

func NewDiskTypesRESTClient

func NewDiskTypesRESTClient(ctx context.Context, opts ...option.ClientOption) (*DiskTypesClient, error)

NewDiskTypesRESTClient creates a new disk types rest client.

The DiskTypes API.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewDiskTypesRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func (*DiskTypesClient) AggregatedList

AggregatedList retrieves an aggregated list of disk types.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewDiskTypesRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.AggregatedListDiskTypesRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.AggregatedList(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*DiskTypesClient) Close

func (c *DiskTypesClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*DiskTypesClient) Connection

func (c *DiskTypesClient) Connection() *grpc.ClientConn

Connection returns a connection to the API service.

Deprecated.

func (*DiskTypesClient) Get

Get returns the specified disk type. Gets a list of available disk types by making a list() request.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewDiskTypesRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.GetDiskTypeRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.Get(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*DiskTypesClient) List

List retrieves a list of disk types available to the specified project.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewDiskTypesRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.ListDiskTypesRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.List(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

DisksCallOptions

type DisksCallOptions struct {
	AddResourcePolicies    []gax.CallOption
	AggregatedList         []gax.CallOption
	CreateSnapshot         []gax.CallOption
	Delete                 []gax.CallOption
	Get                    []gax.CallOption
	GetIamPolicy           []gax.CallOption
	Insert                 []gax.CallOption
	List                   []gax.CallOption
	RemoveResourcePolicies []gax.CallOption
	Resize                 []gax.CallOption
	SetIamPolicy           []gax.CallOption
	SetLabels              []gax.CallOption
	TestIamPermissions     []gax.CallOption
}

DisksCallOptions contains the retry settings for each method of DisksClient.

DisksClient

type DisksClient struct {

	// The call options for this service.
	CallOptions *DisksCallOptions
	// contains filtered or unexported fields
}

DisksClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

The Disks API.

func NewDisksRESTClient

func NewDisksRESTClient(ctx context.Context, opts ...option.ClientOption) (*DisksClient, error)

NewDisksRESTClient creates a new disks rest client.

The Disks API.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewDisksRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func (*DisksClient) AddResourcePolicies

AddResourcePolicies adds existing resource policies to a disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewDisksRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.AddResourcePoliciesDiskRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.AddResourcePolicies(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*DisksClient) AggregatedList

AggregatedList retrieves an aggregated list of persistent disks.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewDisksRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.AggregatedListDisksRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.AggregatedList(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*DisksClient) Close

func (c *DisksClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*DisksClient) Connection

func (c *DisksClient) Connection() *grpc.ClientConn

Connection returns a connection to the API service.

Deprecated.

func (*DisksClient) CreateSnapshot

CreateSnapshot creates a snapshot of a specified persistent disk.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewDisksRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.CreateSnapshotDiskRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.CreateSnapshot(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*DisksClient) Delete

Delete deletes the specified persistent disk. Deleting a disk removes its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewDisksRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.DeleteDiskRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.Delete(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*DisksClient) Get

Get returns a specified persistent disk. Gets a list of available persistent disks by making a list() request.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewDisksRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.GetDiskRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.Get(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*DisksClient) GetIamPolicy

GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewDisksRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.GetIamPolicyDiskRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.GetIamPolicy(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*DisksClient) Insert

Insert creates a persistent disk in the specified project using the data in the request. You can create a disk from a source (sourceImage, sourceSnapshot, or sourceDisk) or create an empty 500 GB data disk by omitting all properties. You can also create a disk that is larger than the default size by specifying the sizeGb property.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewDisksRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.InsertDiskRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.Insert(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*DisksClient) List

List retrieves a list of persistent disks contained within the specified zone.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewDisksRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.ListDisksRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.List(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*DisksClient) RemoveResourcePolicies

RemoveResourcePolicies removes resource policies from a disk.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewDisksRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.RemoveResourcePoliciesDiskRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.RemoveResourcePolicies(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*DisksClient) Resize

Resize resizes the specified persistent disk. You can only increase the size of the disk.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewDisksRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.ResizeDiskRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.Resize(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*DisksClient) SetIamPolicy

SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewDisksRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.SetIamPolicyDiskRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.SetIamPolicy(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*DisksClient) SetLabels

SetLabels sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewDisksRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.SetLabelsDiskRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.SetLabels(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*DisksClient) TestIamPermissions

TestIamPermissions returns permissions that a caller has on the specified resource.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewDisksRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.TestIamPermissionsDiskRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.TestIamPermissions(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

ExternalVpnGatewaysCallOptions

type ExternalVpnGatewaysCallOptions struct {
	Delete             []gax.CallOption
	Get                []gax.CallOption
	Insert             []gax.CallOption
	List               []gax.CallOption
	SetLabels          []gax.CallOption
	TestIamPermissions []gax.CallOption
}

ExternalVpnGatewaysCallOptions contains the retry settings for each method of ExternalVpnGatewaysClient.

ExternalVpnGatewaysClient

type ExternalVpnGatewaysClient struct {

	// The call options for this service.
	CallOptions *ExternalVpnGatewaysCallOptions
	// contains filtered or unexported fields
}

ExternalVpnGatewaysClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

The ExternalVpnGateways API.

func NewExternalVpnGatewaysRESTClient

func NewExternalVpnGatewaysRESTClient(ctx context.Context, opts ...option.ClientOption) (*ExternalVpnGatewaysClient, error)

NewExternalVpnGatewaysRESTClient creates a new external vpn gateways rest client.

The ExternalVpnGateways API.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewExternalVpnGatewaysRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func (*ExternalVpnGatewaysClient) Close

func (c *ExternalVpnGatewaysClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*ExternalVpnGatewaysClient) Connection

func (c *ExternalVpnGatewaysClient) Connection() *grpc.ClientConn

Connection returns a connection to the API service.

Deprecated.

func (*ExternalVpnGatewaysClient) Delete

Delete deletes the specified externalVpnGateway.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewExternalVpnGatewaysRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.DeleteExternalVpnGatewayRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.Delete(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*ExternalVpnGatewaysClient) Get

Get returns the specified externalVpnGateway. Get a list of available externalVpnGateways by making a list() request.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewExternalVpnGatewaysRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.GetExternalVpnGatewayRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.Get(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*ExternalVpnGatewaysClient) Insert

Insert creates a ExternalVpnGateway in the specified project using the data included in the request.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewExternalVpnGatewaysRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.InsertExternalVpnGatewayRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.Insert(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*ExternalVpnGatewaysClient) List

List retrieves the list of ExternalVpnGateway available to the specified project.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewExternalVpnGatewaysRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.ListExternalVpnGatewaysRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.List(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*ExternalVpnGatewaysClient) SetLabels

SetLabels sets the labels on an ExternalVpnGateway. To learn more about labels, read the Labeling Resources documentation.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewExternalVpnGatewaysRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.SetLabelsExternalVpnGatewayRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.SetLabels(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*ExternalVpnGatewaysClient) TestIamPermissions

TestIamPermissions returns permissions that a caller has on the specified resource.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewExternalVpnGatewaysRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.TestIamPermissionsExternalVpnGatewayRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.TestIamPermissions(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

FirewallPoliciesCallOptions

type FirewallPoliciesCallOptions struct {
	AddAssociation     []gax.CallOption
	AddRule            []gax.CallOption
	CloneRules         []gax.CallOption
	Delete             []gax.CallOption
	Get                []gax.CallOption
	GetAssociation     []gax.CallOption
	GetIamPolicy       []gax.CallOption
	GetRule            []gax.CallOption
	Insert             []gax.CallOption
	List               []gax.CallOption
	ListAssociations   []gax.CallOption
	Move               []gax.CallOption
	Patch              []gax.CallOption
	PatchRule          []gax.CallOption
	RemoveAssociation  []gax.CallOption
	RemoveRule         []gax.CallOption
	SetIamPolicy       []gax.CallOption
	TestIamPermissions []gax.CallOption
}

FirewallPoliciesCallOptions contains the retry settings for each method of FirewallPoliciesClient.

FirewallPoliciesClient

type FirewallPoliciesClient struct {

	// The call options for this service.
	CallOptions *FirewallPoliciesCallOptions
	// contains filtered or unexported fields
}

FirewallPoliciesClient is a client for interacting with Google Compute Engine API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

The FirewallPolicies API.

func NewFirewallPoliciesRESTClient

func NewFirewallPoliciesRESTClient(ctx context.Context, opts ...option.ClientOption) (*FirewallPoliciesClient, error)

NewFirewallPoliciesRESTClient creates a new firewall policies rest client.

The FirewallPolicies API.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewFirewallPoliciesRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	// TODO: Use client.
	_ = c
}

func (*FirewallPoliciesClient) AddAssociation

AddAssociation inserts an association for the specified firewall policy.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewFirewallPoliciesRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.AddAssociationFirewallPolicyRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.AddAssociation(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*FirewallPoliciesClient) AddRule

AddRule inserts a rule into a firewall policy.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewFirewallPoliciesRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.AddRuleFirewallPolicyRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.AddRule(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*FirewallPoliciesClient) CloneRules

CloneRules copies rules to the specified firewall policy.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewFirewallPoliciesRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.CloneRulesFirewallPolicyRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.CloneRules(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*FirewallPoliciesClient) Close

func (c *FirewallPoliciesClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*FirewallPoliciesClient) Connection

func (c *FirewallPoliciesClient) Connection() *grpc.ClientConn

Connection returns a connection to the API service.

Deprecated.

func (*FirewallPoliciesClient) Delete

Delete deletes the specified policy.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewFirewallPoliciesRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.DeleteFirewallPolicyRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.Delete(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*FirewallPoliciesClient) Get

Get returns the specified firewall policy.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewFirewallPoliciesRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.GetFirewallPolicyRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.Get(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*FirewallPoliciesClient) GetAssociation

GetAssociation gets an association with the specified name.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewFirewallPoliciesRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.GetAssociationFirewallPolicyRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.GetAssociation(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*FirewallPoliciesClient) GetIamPolicy

GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewFirewallPoliciesRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.GetIamPolicyFirewallPolicyRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.GetIamPolicy(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*FirewallPoliciesClient) GetRule

GetRule gets a rule of the specified priority.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewFirewallPoliciesRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.GetRuleFirewallPolicyRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.GetRule(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*FirewallPoliciesClient) Insert

Insert creates a new policy in the specified project using the data included in the request.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
)

func main() {
	ctx := context.Background()
	c, err := compute.NewFirewallPoliciesRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &computepb.InsertFirewallPolicyRequest{
		// TODO: Fill request struct fields.
	}
	resp, err := c.Insert(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*FirewallPoliciesClient) List

List lists all the policies that have been configured for the specified project.

Example

package main

import (
	"context"

	compute "cloud.google.com/go/compute