compute

package
Version: v0.95.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 21, 2021 License: Apache-2.0 Imports: 25 Imported by: 5

Documentation

Overview

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

NOTE: This package is in beta. It is not stable, and may be subject to changes.

Example usage

To get started with this package, create a client.

ctx := context.Background()
c, err := compute.NewAcceleratorTypesClient(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.

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.
	// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#AggregatedListAcceleratorTypesRequest.
}
it := c.AggregatedList(ctx, req)
for {
	resp, err := it.Next()
	if err == iterator.Done {
		break
	}
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

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.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultAuthScopes

func DefaultAuthScopes() []string

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

Types

type AcceleratorTypeIterator added in v0.91.1

type AcceleratorTypeIterator 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 []*computepb.AcceleratorType, nextPageToken string, err error)
	// contains filtered or unexported fields
}

AcceleratorTypeIterator manages a stream of *computepb.AcceleratorType.

func (*AcceleratorTypeIterator) Next added in v0.91.1

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 (*AcceleratorTypeIterator) PageInfo added in v0.91.1

func (it *AcceleratorTypeIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type AcceleratorTypesCallOptions

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

AcceleratorTypesCallOptions contains the retry settings for each method of AcceleratorTypesClient.

type 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
}
Output:

func (*AcceleratorTypesClient) AggregatedList

AggregatedList retrieves an aggregated list of accelerator types.

Example
package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	"google.golang.org/api/iterator"
	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.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#AggregatedListAcceleratorTypesRequest.
	}
	it := c.AggregatedList(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}
Output:

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.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#GetAcceleratorTypeRequest.
	}
	resp, err := c.Get(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

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"
	"google.golang.org/api/iterator"
	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.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#ListAcceleratorTypesRequest.
	}
	it := c.List(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}
Output:

type AcceleratorTypesScopedListPair added in v0.91.1

type AcceleratorTypesScopedListPair struct {
	Key   string
	Value *computepb.AcceleratorTypesScopedList
}

AcceleratorTypesScopedListPair is a holder type for string/*computepb.AcceleratorTypesScopedList map entries

type AcceleratorTypesScopedListPairIterator added in v0.91.1

type AcceleratorTypesScopedListPairIterator 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 []AcceleratorTypesScopedListPair, nextPageToken string, err error)
	// contains filtered or unexported fields
}

AcceleratorTypesScopedListPairIterator manages a stream of AcceleratorTypesScopedListPair.

func (*AcceleratorTypesScopedListPairIterator) Next added in v0.91.1

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 (*AcceleratorTypesScopedListPairIterator) PageInfo added in v0.91.1

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type AddressIterator added in v0.91.1

type AddressIterator 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 []*computepb.Address, nextPageToken string, err error)
	// contains filtered or unexported fields
}

AddressIterator manages a stream of *computepb.Address.

func (*AddressIterator) Next added in v0.91.1

func (it *AddressIterator) Next() (*computepb.Address, 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 (*AddressIterator) PageInfo added in v0.91.1

func (it *AddressIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type 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.

type 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
}
Output:

func (*AddressesClient) AggregatedList

AggregatedList retrieves an aggregated list of addresses.

Example
package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	"google.golang.org/api/iterator"
	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.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#AggregatedListAddressesRequest.
	}
	it := c.AggregatedList(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}
Output:

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.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#DeleteAddressRequest.
	}
	resp, err := c.Delete(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

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.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#GetAddressRequest.
	}
	resp, err := c.Get(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

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.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#InsertAddressRequest.
	}
	resp, err := c.Insert(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

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"
	"google.golang.org/api/iterator"
	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.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#ListAddressesRequest.
	}
	it := c.List(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}
Output:

type AddressesScopedListPair added in v0.91.1

type AddressesScopedListPair struct {
	Key   string
	Value *computepb.AddressesScopedList
}

AddressesScopedListPair is a holder type for string/*computepb.AddressesScopedList map entries

type AddressesScopedListPairIterator added in v0.91.1

type AddressesScopedListPairIterator 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 []AddressesScopedListPair, nextPageToken string, err error)
	// contains filtered or unexported fields
}

AddressesScopedListPairIterator manages a stream of AddressesScopedListPair.

func (*AddressesScopedListPairIterator) Next added in v0.91.1

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 (*AddressesScopedListPairIterator) PageInfo added in v0.91.1

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type AutoscalerIterator added in v0.91.1

type AutoscalerIterator 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 []*computepb.Autoscaler, nextPageToken string, err error)
	// contains filtered or unexported fields
}

AutoscalerIterator manages a stream of *computepb.Autoscaler.

func (*AutoscalerIterator) Next added in v0.91.1

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 (*AutoscalerIterator) PageInfo added in v0.91.1

func (it *AutoscalerIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type 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.

type 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
}
Output:

func (*AutoscalersClient) AggregatedList

AggregatedList retrieves an aggregated list of autoscalers.

Example
package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	"google.golang.org/api/iterator"
	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.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#AggregatedListAutoscalersRequest.
	}
	it := c.AggregatedList(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}
Output:

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.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#DeleteAutoscalerRequest.
	}
	resp, err := c.Delete(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

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.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#GetAutoscalerRequest.
	}
	resp, err := c.Get(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

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.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#InsertAutoscalerRequest.
	}
	resp, err := c.Insert(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

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"
	"google.golang.org/api/iterator"
	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.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#ListAutoscalersRequest.
	}
	it := c.List(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}
Output:

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.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#PatchAutoscalerRequest.
	}
	resp, err := c.Patch(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

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.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#UpdateAutoscalerRequest.
	}
	resp, err := c.Update(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

type AutoscalersScopedListPair added in v0.91.1

type AutoscalersScopedListPair struct {
	Key   string
	Value *computepb.AutoscalersScopedList
}

AutoscalersScopedListPair is a holder type for string/*computepb.AutoscalersScopedList map entries

type AutoscalersScopedListPairIterator added in v0.91.1

type AutoscalersScopedListPairIterator 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 []AutoscalersScopedListPair, nextPageToken string, err error)
	// contains filtered or unexported fields
}

AutoscalersScopedListPairIterator manages a stream of AutoscalersScopedListPair.

func (*AutoscalersScopedListPairIterator) Next added in v0.91.1

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 (*AutoscalersScopedListPairIterator) PageInfo added in v0.91.1

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type BackendBucketIterator added in v0.91.1

type BackendBucketIterator 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 []*computepb.BackendBucket, nextPageToken string, err error)
	// contains filtered or unexported fields
}

BackendBucketIterator manages a stream of *computepb.BackendBucket.

func (*BackendBucketIterator) Next added in v0.91.1

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 (*BackendBucketIterator) PageInfo added in v0.91.1

func (it *BackendBucketIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type 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.

type 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
}
Output:

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.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#AddSignedUrlKeyBackendBucketRequest.
	}
	resp, err := c.AddSignedUrlKey(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

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.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#DeleteBackendBucketRequest.
	}
	resp, err := c.Delete(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

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.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#DeleteSignedUrlKeyBackendBucketRequest.
	}
	resp, err := c.DeleteSignedUrlKey(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

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.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#GetBackendBucketRequest.
	}
	resp, err := c.Get(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

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.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#InsertBackendBucketRequest.
	}
	resp, err := c.Insert(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

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"
	"google.golang.org/api/iterator"
	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.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#ListBackendBucketsRequest.
	}
	it := c.List(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}
Output:

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.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#PatchBackendBucketRequest.
	}
	resp, err := c.Patch(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

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.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#UpdateBackendBucketRequest.
	}
	resp, err := c.Update(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

type BackendServiceIterator added in v0.91.1

type BackendServiceIterator 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 []*computepb.BackendService, nextPageToken string, err error)
	// contains filtered or unexported fields
}

BackendServiceIterator manages a stream of *computepb.BackendService.

func (*BackendServiceIterator) Next added in v0.91.1

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 (*BackendServiceIterator) PageInfo added in v0.91.1

func (it *BackendServiceIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type 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.

type 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
}
Output:

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.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#AddSignedUrlKeyBackendServiceRequest.
	}
	resp, err := c.AddSignedUrlKey(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

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"
	"google.golang.org/api/iterator"
	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.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#AggregatedListBackendServicesRequest.
	}
	it := c.AggregatedList(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}
Output:

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.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#DeleteBackendServiceRequest.
	}
	resp, err := c.Delete(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

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.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#DeleteSignedUrlKeyBackendServiceRequest.
	}
	resp, err := c.DeleteSignedUrlKey(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

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.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#GetBackendServiceRequest.
	}
	resp, err := c.Get(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

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.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#GetHealthBackendServiceRequest.
	}
	resp, err := c.GetHealth(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

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.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#InsertBackendServiceRequest.
	}
	resp, err := c.Insert(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

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"
	"google.golang.org/api/iterator"
	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.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#ListBackendServicesRequest.
	}
	it := c.List(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}
Output:

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.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#PatchBackendServiceRequest.
	}
	resp, err := c.Patch(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

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.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#SetSecurityPolicyBackendServiceRequest.
	}
	resp, err := c.SetSecurityPolicy(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

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.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#UpdateBackendServiceRequest.
	}
	resp, err := c.Update(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

type BackendServicesScopedListPair added in v0.91.1

type BackendServicesScopedListPair struct {
	Key   string
	Value *computepb.BackendServicesScopedList
}

BackendServicesScopedListPair is a holder type for string/*computepb.BackendServicesScopedList map entries

type BackendServicesScopedListPairIterator added in v0.91.1

type BackendServicesScopedListPairIterator 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 []BackendServicesScopedListPair, nextPageToken string, err error)
	// contains filtered or unexported fields
}

BackendServicesScopedListPairIterator manages a stream of BackendServicesScopedListPair.

func (*BackendServicesScopedListPairIterator) Next added in v0.91.1

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 (*BackendServicesScopedListPairIterator) PageInfo added in v0.91.1

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type CommitmentIterator added in v0.91.1

type CommitmentIterator 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 []*computepb.Commitment, nextPageToken string, err error)
	// contains filtered or unexported fields
}

CommitmentIterator manages a stream of *computepb.Commitment.

func (*CommitmentIterator) Next added in v0.91.1

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 (*CommitmentIterator) PageInfo added in v0.91.1

func (it *CommitmentIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type CommitmentsScopedListPair added in v0.91.1

type CommitmentsScopedListPair struct {
	Key   string
	Value *computepb.CommitmentsScopedList
}

CommitmentsScopedListPair is a holder type for string/*computepb.CommitmentsScopedList map entries

type CommitmentsScopedListPairIterator added in v0.91.1

type CommitmentsScopedListPairIterator 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 []CommitmentsScopedListPair, nextPageToken string, err error)
	// contains filtered or unexported fields
}

CommitmentsScopedListPairIterator manages a stream of CommitmentsScopedListPair.

func (*CommitmentsScopedListPairIterator) Next added in v0.91.1

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 (*CommitmentsScopedListPairIterator) PageInfo added in v0.91.1

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type DiskIterator added in v0.91.1

type DiskIterator 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 []*computepb.Disk, nextPageToken string, err error)
	// contains filtered or unexported fields
}

DiskIterator manages a stream of *computepb.Disk.

func (*DiskIterator) Next added in v0.91.1

func (it *DiskIterator) Next() (*computepb.Disk, 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 (*DiskIterator) PageInfo added in v0.91.1

func (it *DiskIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type DiskTypeIterator added in v0.91.1

type DiskTypeIterator 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 []*computepb.DiskType, nextPageToken string, err error)
	// contains filtered or unexported fields
}

DiskTypeIterator manages a stream of *computepb.DiskType.

func (*DiskTypeIterator) Next added in v0.91.1

func (it *DiskTypeIterator) Next() (*computepb.DiskType, 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 (*DiskTypeIterator) PageInfo added in v0.91.1

func (it *DiskTypeIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type DiskTypesCallOptions

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

DiskTypesCallOptions contains the retry settings for each method of DiskTypesClient.

type 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
}
Output:

func (*DiskTypesClient) AggregatedList

AggregatedList retrieves an aggregated list of disk types.

Example
package main

import (
	"context"

	compute "cloud.google.com/go/compute/apiv1"
	"google.golang.org/api/iterator"
	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.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#AggregatedListDiskTypesRequest.
	}
	it := c.AggregatedList(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}
Output:

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.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#GetDiskTypeRequest.
	}
	resp, err := c.Get(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
Output:

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"
	"google.golang.org/api/iterator"
	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.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#ListDiskTypesRequest.
	}
	it := c.List(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp
	}
}
Output:

type DiskTypesScopedListPair added in v0.91.1

type DiskTypesScopedListPair struct {
	Key   string
	Value *computepb.DiskTypesScopedList
}

DiskTypesScopedListPair is a holder type for string/*computepb.DiskTypesScopedList map entries

type DiskTypesScopedListPairIterator added in v0.91.1

type DiskTypesScopedListPairIterator 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 []DiskTypesScopedListPair, nextPageToken string, err error)
	// contains filtered or unexported fields
}

DiskTypesScopedListPairIterator manages a stream of DiskTypesScopedListPair.

func (*DiskTypesScopedListPairIterator) Next added in v0.91.1

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 (*DiskTypesScopedListPairIterator) PageInfo added in v0.91.1

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type 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
}