- 0.115.1 (latest)
- 0.115.0
- 0.114.0
- 0.113.0
- 0.112.2
- 0.111.0
- 0.110.10
- 0.109.0
- 0.108.0
- 0.107.0
- 0.106.0
- 0.105.0
- 0.104.0
- 0.103.0
- 0.102.1
- 0.101.1
- 0.100.2
- 0.99.0
- 0.98.0
- 0.97.0
- 0.96.0
- 0.95.0
- 0.94.1
- 0.93.3
- 0.92.3
- 0.91.1
- 0.90.0
- 0.89.0
- 0.88.0
- 0.87.0
- 0.86.0
- 0.85.0
- 0.84.0
- 0.83.0
- 0.82.0
- 0.81.0
- 0.80.0
- 0.79.0
- 0.78.0
- 0.77.0
- 0.76.0
- 0.75.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
func (c *AcceleratorTypesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListAcceleratorTypesRequest, opts ...gax.CallOption) (*computepb.AcceleratorTypeAggregatedList, error)
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
func (c *AcceleratorTypesClient) Get(ctx context.Context, req *computepb.GetAcceleratorTypeRequest, opts ...gax.CallOption) (*computepb.AcceleratorType, error)
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
func (c *AcceleratorTypesClient) List(ctx context.Context, req *computepb.ListAcceleratorTypesRequest, opts ...gax.CallOption) (*computepb.AcceleratorTypeList, error)
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
func (c *AddressesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListAddressesRequest, opts ...gax.CallOption) (*computepb.AddressAggregatedList, error)
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
func (c *AddressesClient) Delete(ctx context.Context, req *computepb.DeleteAddressRequest, opts ...gax.CallOption) (*computepb.Operation, error)
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
func (c *AddressesClient) Get(ctx context.Context, req *computepb.GetAddressRequest, opts ...gax.CallOption) (*computepb.Address, error)
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
func (c *AddressesClient) Insert(ctx context.Context, req *computepb.InsertAddressRequest, opts ...gax.CallOption) (*computepb.Operation, error)
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
func (c *AddressesClient) List(ctx context.Context, req *computepb.ListAddressesRequest, opts ...gax.CallOption) (*computepb.AddressList, error)
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
func (c *AutoscalersClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListAutoscalersRequest, opts ...gax.CallOption) (*computepb.AutoscalerAggregatedList, error)
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
func (c *AutoscalersClient) Delete(ctx context.Context, req *computepb.DeleteAutoscalerRequest, opts ...gax.CallOption) (*computepb.Operation, error)
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
func (c *AutoscalersClient) Get(ctx context.Context, req *computepb.GetAutoscalerRequest, opts ...gax.CallOption) (*computepb.Autoscaler, error)
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
func (c *AutoscalersClient) Insert(ctx context.Context, req *computepb.InsertAutoscalerRequest, opts ...gax.CallOption) (*computepb.Operation, error)
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
func (c *AutoscalersClient) List(ctx context.Context, req *computepb.ListAutoscalersRequest, opts ...gax.CallOption) (*computepb.AutoscalerList, error)
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
func (c *AutoscalersClient) Patch(ctx context.Context, req *computepb.PatchAutoscalerRequest, opts ...gax.CallOption) (*computepb.Operation, error)
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
func (c *AutoscalersClient) Update(ctx context.Context, req *computepb.UpdateAutoscalerRequest, opts ...gax.CallOption) (*computepb.Operation, error)
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
func (c *BackendBucketsClient) AddSignedUrlKey(ctx context.Context, req *computepb.AddSignedUrlKeyBackendBucketRequest, opts ...gax.CallOption) (*computepb.Operation, error)
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
func (c *BackendBucketsClient) Delete(ctx context.Context, req *computepb.DeleteBackendBucketRequest, opts ...gax.CallOption) (*computepb.Operation, error)
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
func (c *BackendBucketsClient) DeleteSignedUrlKey(ctx context.Context, req *computepb.DeleteSignedUrlKeyBackendBucketRequest, opts ...gax.CallOption) (*computepb.Operation, error)
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
func (c *BackendBucketsClient) Get(ctx context.Context, req *computepb.GetBackendBucketRequest, opts ...gax.CallOption) (*computepb.BackendBucket, error)
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
func (c *BackendBucketsClient) Insert(ctx context.Context, req *computepb.InsertBackendBucketRequest, opts ...gax.CallOption) (*computepb.Operation, error)
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
func (c *BackendBucketsClient) List(ctx context.Context, req *computepb.ListBackendBucketsRequest, opts ...gax.CallOption) (*computepb.BackendBucketList, error)
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
func (c *BackendBucketsClient) Patch(ctx context.Context, req *computepb.PatchBackendBucketRequest, opts ...gax.CallOption) (*computepb.Operation, error)
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
func (c *BackendBucketsClient) Update(ctx context.Context, req *computepb.UpdateBackendBucketRequest, opts ...gax.CallOption) (*computepb.Operation, error)
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
func (c *BackendServicesClient) AddSignedUrlKey(ctx context.Context, req *computepb.AddSignedUrlKeyBackendServiceRequest, opts ...gax.CallOption) (*computepb.Operation, error)
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
func (c *BackendServicesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListBackendServicesRequest, opts ...gax.CallOption) (*computepb.BackendServiceAggregatedList, error)
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
func (c *BackendServicesClient) Delete(ctx context.Context, req *computepb.DeleteBackendServiceRequest, opts ...gax.CallOption) (*computepb.Operation, error)
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
func (c *BackendServicesClient) DeleteSignedUrlKey(ctx context.Context, req *computepb.DeleteSignedUrlKeyBackendServiceRequest, opts ...gax.CallOption) (*computepb.Operation, error)
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
func (c *BackendServicesClient) Get(ctx context.Context, req *computepb.GetBackendServiceRequest, opts ...gax.CallOption) (*computepb.BackendService, error)
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
func (c *BackendServicesClient) GetHealth(ctx context.Context, req *computepb.GetHealthBackendServiceRequest, opts ...gax.CallOption) (*computepb.BackendServiceGroupHealth, error)
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
func (c *BackendServicesClient) Insert(ctx context.Context, req *computepb.InsertBackendServiceRequest, opts ...gax.CallOption) (*computepb.Operation, error)
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
func (c *BackendServicesClient) List(ctx context.Context, req *computepb.ListBackendServicesRequest, opts ...gax.CallOption) (*computepb.BackendServiceList, error)
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
func (c *BackendServicesClient) Patch(ctx context.Context, req *computepb.PatchBackendServiceRequest, opts ...gax.CallOption) (*computepb.Operation, error)
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
func (c *BackendServicesClient) SetSecurityPolicy(ctx context.Context, req *computepb.SetSecurityPolicyBackendServiceRequest, opts ...gax.CallOption) (*computepb.Operation, error)
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
func (c *BackendServicesClient) Update(ctx context.Context, req *computepb.UpdateBackendServiceRequest, opts ...gax.CallOption) (*computepb.Operation, error)
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
func (c *DiskTypesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListDiskTypesRequest, opts ...gax.CallOption) (*computepb.DiskTypeAggregatedList, error)
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
func (c *DiskTypesClient) Get(ctx context.Context, req *computepb.GetDiskTypeRequest, opts ...gax.CallOption) (*computepb.DiskType, error)
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
func (c *DiskTypesClient) List(ctx context.Context, req *computepb.ListDiskTypesRequest, opts ...gax.CallOption) (*computepb.DiskTypeList, error)
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
func (c *DisksClient) AddResourcePolicies(ctx context.Context, req *computepb.AddResourcePoliciesDiskRequest, opts ...gax.CallOption) (*computepb.Operation, error)
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
func (c *DisksClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListDisksRequest, opts ...gax.CallOption) (*computepb.DiskAggregatedList, error)
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
func (c *DisksClient) CreateSnapshot(ctx context.Context, req *computepb.CreateSnapshotDiskRequest, opts ...gax.CallOption) (*computepb.Operation, error)
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
func (c *DisksClient) Delete(ctx context.Context, req *computepb.DeleteDiskRequest, opts ...gax.CallOption) (*computepb.Operation, error)
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
func (c *DisksClient) Get(ctx context.Context, req *computepb.GetDiskRequest, opts ...gax.CallOption) (*computepb.Disk, error)
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
func (c *DisksClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyDiskRequest, opts ...gax.CallOption) (*computepb.Policy, error)
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
func (c *DisksClient) Insert(ctx context.Context, req *computepb.InsertDiskRequest, opts ...gax.CallOption) (*computepb.Operation, error)
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
func (c *DisksClient) List(ctx context.Context, req *computepb.ListDisksRequest, opts ...gax.CallOption) (*computepb.DiskList, error)
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
func (c *DisksClient) RemoveResourcePolicies(ctx context.Context, req *computepb.RemoveResourcePoliciesDiskRequest, opts ...gax.CallOption) (*computepb.Operation, error)
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
func (c *DisksClient) Resize(ctx context.Context, req *computepb.ResizeDiskRequest, opts ...gax.CallOption) (*computepb.Operation, error)
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
func (c *DisksClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyDiskRequest, opts ...gax.CallOption) (*computepb.Policy, error)
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
func (c *DisksClient) SetLabels(ctx context.Context, req *computepb.SetLabelsDiskRequest, opts ...gax.CallOption) (*computepb.Operation, error)
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
func (c *DisksClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsDiskRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
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
func (c *ExternalVpnGatewaysClient) Delete(ctx context.Context, req *computepb.DeleteExternalVpnGatewayRequest, opts ...gax.CallOption) (*computepb.Operation, error)
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
func (c *ExternalVpnGatewaysClient) Get(ctx context.Context, req *computepb.GetExternalVpnGatewayRequest, opts ...gax.CallOption) (*computepb.ExternalVpnGateway, error)
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
func (c *ExternalVpnGatewaysClient) Insert(ctx context.Context, req *computepb.InsertExternalVpnGatewayRequest, opts ...gax.CallOption) (*computepb.Operation, error)
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
func (c *ExternalVpnGatewaysClient) List(ctx context.Context, req *computepb.ListExternalVpnGatewaysRequest, opts ...gax.CallOption) (*computepb.ExternalVpnGatewayList, error)
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
func (c *ExternalVpnGatewaysClient) SetLabels(ctx context.Context, req *computepb.SetLabelsExternalVpnGatewayRequest, opts ...gax.CallOption) (*computepb.Operation, error)
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
func (c *ExternalVpnGatewaysClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsExternalVpnGatewayRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
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
func (c *FirewallPoliciesClient) AddAssociation(ctx context.Context, req *computepb.AddAssociationFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.Operation, error)
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
func (c *FirewallPoliciesClient) AddRule(ctx context.Context, req *computepb.AddRuleFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.Operation, error)
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
func (c *FirewallPoliciesClient) CloneRules(ctx context.Context, req *computepb.CloneRulesFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.Operation, error)
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
func (c *FirewallPoliciesClient) Delete(ctx context.Context, req *computepb.DeleteFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.Operation, error)
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
func (c *FirewallPoliciesClient) Get(ctx context.Context, req *computepb.GetFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.FirewallPolicy, error)
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
func (c *FirewallPoliciesClient) GetAssociation(ctx context.Context, req *computepb.GetAssociationFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.FirewallPolicyAssociation, error)
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
func (c *FirewallPoliciesClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.Policy, error)
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
func (c *FirewallPoliciesClient) GetRule(ctx context.Context, req *computepb.GetRuleFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.FirewallPolicyRule, error)
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
func (c *FirewallPoliciesClient) Insert(ctx context.Context, req *computepb.InsertFirewallPolicyRequest, opts ...gax.CallOption) (*computepb.Operation, error)
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
func (c *FirewallPoliciesClient) List(ctx context.Context, req *computepb.ListFirewallPoliciesRequest, opts ...gax.CallOption) (*computepb.FirewallPolicyList, error)
List lists all the policies that have been configured for the specified project.
Example
package main
import (
"context"
compute "cloud.google.com/go/compute