- 0.116.0 (latest)
- 0.115.1
- 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.
AcceleratorTypeIterator
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
func (it *AcceleratorTypeIterator) Next() (*computepb.AcceleratorType, 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 (*AcceleratorTypeIterator) PageInfo
func (it *AcceleratorTypeIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
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) *AcceleratorTypesScopedListPairIterator
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.
}
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
}
}
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) *AcceleratorTypeIterator
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.
}
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
}
}
AcceleratorTypesScopedListPair
type AcceleratorTypesScopedListPair struct {
Key string
Value *computepb.AcceleratorTypesScopedList
}
AcceleratorTypesScopedListPair is a holder type for string/*computepb.AcceleratorTypesScopedList map entries
AcceleratorTypesScopedListPairIterator
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
func (it *AcceleratorTypesScopedListPairIterator) Next() (AcceleratorTypesScopedListPair, 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 (*AcceleratorTypesScopedListPairIterator) PageInfo
func (it *AcceleratorTypesScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
AddressIterator
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
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
func (it *AddressIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
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) *AddressesScopedListPairIterator
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.
}
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
}
}
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) (*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) (*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) *AddressIterator
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.
}
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
}
}
AddressesScopedListPair
type AddressesScopedListPair struct {
Key string
Value *computepb.AddressesScopedList
}
AddressesScopedListPair is a holder type for string/*computepb.AddressesScopedList map entries
AddressesScopedListPairIterator
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
func (it *AddressesScopedListPairIterator) Next() (AddressesScopedListPair, 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 (*AddressesScopedListPairIterator) PageInfo
func (it *AddressesScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
AutoscalerIterator
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
func (it *AutoscalerIterator) Next() (*computepb.Autoscaler, 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 (*AutoscalerIterator) PageInfo
func (it *AutoscalerIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
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) *AutoscalersScopedListPairIterator
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.
}
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
}
}
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) (*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) (*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) *AutoscalerIterator
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.
}
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
}
}
func (*AutoscalersClient) Patch
func (c *AutoscalersClient) Patch(ctx context.Context, req *computepb.PatchAutoscalerRequest, opts ...gax.CallOption) (*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) (*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
}
AutoscalersScopedListPair
type AutoscalersScopedListPair struct {
Key string
Value *computepb.AutoscalersScopedList
}
AutoscalersScopedListPair is a holder type for string/*computepb.AutoscalersScopedList map entries
AutoscalersScopedListPairIterator
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
func (it *AutoscalersScopedListPairIterator) Next() (AutoscalersScopedListPair, 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 (*AutoscalersScopedListPairIterator) PageInfo
func (it *AutoscalersScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
BackendBucketIterator
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
func (it *BackendBucketIterator) Next() (*computepb.BackendBucket, 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 (*BackendBucketIterator) PageInfo
func (it *BackendBucketIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
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) (*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) (*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) (*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) (*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) *BackendBucketIterator
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.
}
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
}
}
func (*BackendBucketsClient) Patch
func (c *BackendBucketsClient) Patch(ctx context.Context, req *computepb.PatchBackendBucketRequest, opts ...gax.CallOption) (*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) (*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
}
BackendServiceIterator
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
func (it *BackendServiceIterator) Next() (*computepb.BackendService, 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 (*BackendServiceIterator) PageInfo
func (it *BackendServiceIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
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) (*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) *BackendServicesScopedListPairIterator
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.
}
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
}
}
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) (*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) (*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) (*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) *BackendServiceIterator
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.
}
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
}
}
func (*BackendServicesClient) Patch
func (c *BackendServicesClient) Patch(ctx context.Context, req *computepb.PatchBackendServiceRequest, opts ...gax.CallOption) (*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) (*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) (*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
}
BackendServicesScopedListPair
type BackendServicesScopedListPair struct {
Key string
Value *computepb.BackendServicesScopedList
}
BackendServicesScopedListPair is a holder type for string/*computepb.BackendServicesScopedList map entries
BackendServicesScopedListPairIterator
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
func (it *BackendServicesScopedListPairIterator) Next() (BackendServicesScopedListPair, 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 (*BackendServicesScopedListPairIterator) PageInfo
func (it *BackendServicesScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
CommitmentIterator
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
func (it *CommitmentIterator) Next() (*computepb.Commitment, 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 (*CommitmentIterator) PageInfo
func (it *CommitmentIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
CommitmentsScopedListPair
type CommitmentsScopedListPair struct {
Key string
Value *computepb.CommitmentsScopedList
}
CommitmentsScopedListPair is a holder type for string/*computepb.CommitmentsScopedList map entries
CommitmentsScopedListPairIterator
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
func (it *CommitmentsScopedListPairIterator) Next() (CommitmentsScopedListPair, 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 (*CommitmentsScopedListPairIterator) PageInfo
func (it *CommitmentsScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
DiskIterator
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
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
func (it *DiskIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
DiskTypeIterator
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
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
func (it *DiskTypeIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
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) *DiskTypesScopedListPairIterator
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.
}
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
}
}
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) *DiskTypeIterator
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.
}
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
}
}
DiskTypesScopedListPair
type DiskTypesScopedListPair struct {
Key string
Value *computepb.DiskTypesScopedList
}
DiskTypesScopedListPair is a holder type for string/*computepb.DiskTypesScopedList map entries
DiskTypesScopedListPairIterator
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
func (it *DiskTypesScopedListPairIterator) Next() (DiskTypesScopedListPair, 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 (*DiskTypesScopedListPairIterator) PageInfo
func (it *DiskTypesScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
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) (*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) *DisksScopedListPairIterator
AggregatedList retrieves an aggregated list of persistent disks.
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.NewDisksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.AggregatedListDisksRequest{
// TODO: Fill request struct fields.
}
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
}
}
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) (*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) (*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) (*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) *DiskIterator
List retrieves a list of persistent disks 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.NewDisksRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListDisksRequest{
// TODO: Fill request struct fields.
}
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
}
}
func (*DisksClient) RemoveResourcePolicies
func (c *DisksClient) RemoveResourcePolicies(ctx context.Context, req *computepb.RemoveResourcePoliciesDiskRequest, opts ...gax.CallOption) (*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) (*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) (*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
}
DisksScopedListPair
type DisksScopedListPair struct {
Key string
Value *computepb.DisksScopedList
}
DisksScopedListPair is a holder type for string/*computepb.DisksScopedList map entries
DisksScopedListPairIterator
type DisksScopedListPairIterator 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 []DisksScopedListPair, nextPageToken string, err error)
// contains filtered or unexported fields
}
DisksScopedListPairIterator manages a stream of DisksScopedListPair.
func (*DisksScopedListPairIterator) Next
func (it *DisksScopedListPairIterator) Next() (DisksScopedListPair, 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 (*DisksScopedListPairIterator) PageInfo
func (it *DisksScopedListPairIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
ExchangedPeeringRouteIterator
type ExchangedPeeringRouteIterator 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.ExchangedPeeringRoute, nextPageToken string, err error)
// contains filtered or unexported fields
}
ExchangedPeeringRouteIterator manages a stream of *computepb.ExchangedPeeringRoute.
func (*ExchangedPeeringRouteIterator) Next
func (it *ExchangedPeeringRouteIterator) Next() (*computepb.ExchangedPeeringRoute, 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 (*ExchangedPeeringRouteIterator) PageInfo
func (it *ExchangedPeeringRouteIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
ExternalVpnGatewayIterator
type ExternalVpnGatewayIterator 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.ExternalVpnGateway, nextPageToken string, err error)
// contains filtered or unexported fields
}
ExternalVpnGatewayIterator manages a stream of *computepb.ExternalVpnGateway.
func (*ExternalVpnGatewayIterator) Next
func (it *ExternalVpnGatewayIterator) Next() (*computepb.ExternalVpnGateway, 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 (*ExternalVpnGatewayIterator) PageInfo
func (it *ExternalVpnGatewayIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
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) (*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) (*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) *ExternalVpnGatewayIterator
List retrieves the list of ExternalVpnGateway 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.NewExternalVpnGatewaysRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &computepb.ListExternalVpnGatewaysRequest{
// TODO: Fill request struct fields.
}
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
}
}
func (*ExternalVpnGatewaysClient) SetLabels
func (c *ExternalVpnGatewaysClient) SetLabels(ctx context.Context, req *computepb.SetLabelsExternalVpnGatewayRequest, opts ...gax.CallOption) (*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
}
FirewallIterator
type FirewallIterator 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.Firewall, nextPageToken string, err error)
// contains filtered or unexported fields
}
FirewallIterator manages a stream of *computepb.Firewall.
func (*FirewallIterator) Next
func (it *FirewallIterator) Next() (*computepb.Firewall, 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 (*FirewallIterator) PageInfo
func (it *FirewallIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
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.