Package baremetalsolution is an auto-generated package for the Bare Metal Solution API.
Provides ways to manage Bare Metal Solution hardware installed in a regional extension located near a Google Cloud data center.
NOTE: This package is in beta. It is not stable, and may be subject to changes.
Example usage
To get started with this package, create a client.
ctx := context.Background() c, err := baremetalsolution.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close()
The client will use your default application credentials. Clients should be reused instead of created as needed. The methods of Client are safe for concurrent use by multiple goroutines. The returned client must be Closed when it is done being used.
Using the Client
The following is an example of making an API call with the newly created client.
ctx := context.Background() c, err := baremetalsolution.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &baremetalsolutionpb.ListInstancesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#ListInstancesRequest. } it := c.ListInstances(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Use of Context
The ctx passed to NewClient is used for authentication requests and for creating the underlying connection, but is not used for subsequent calls. Individual methods on the client use the ctx given to them.
To close the open connection, use the Close() method.
For information about setting deadlines, reusing contexts, and more please visit https://pkg.go.dev/cloud.google.com/go.
Functions
func DefaultAuthScopes
func DefaultAuthScopes() []string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
CallOptions
type CallOptions struct {
ListInstances []gax.CallOption
GetInstance []gax.CallOption
ResetInstance []gax.CallOption
ListVolumes []gax.CallOption
GetVolume []gax.CallOption
UpdateVolume []gax.CallOption
ListNetworks []gax.CallOption
GetNetwork []gax.CallOption
ListSnapshotSchedulePolicies []gax.CallOption
GetSnapshotSchedulePolicy []gax.CallOption
CreateSnapshotSchedulePolicy []gax.CallOption
UpdateSnapshotSchedulePolicy []gax.CallOption
DeleteSnapshotSchedulePolicy []gax.CallOption
CreateVolumeSnapshot []gax.CallOption
RestoreVolumeSnapshot []gax.CallOption
DeleteVolumeSnapshot []gax.CallOption
GetVolumeSnapshot []gax.CallOption
ListVolumeSnapshots []gax.CallOption
GetLun []gax.CallOption
ListLuns []gax.CallOption
}
CallOptions contains the retry settings for each method of Client.
Client
type Client struct {
// The call options for this service.
CallOptions *CallOptions
// LROClient is used internally to handle long-running operations.
// It is exposed so that its CallOptions can be modified if required.
// Users should not Close this client.
LROClient *lroauto.OperationsClient
// contains filtered or unexported fields
}
Client is a client for interacting with Bare Metal Solution API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Performs management operations on Bare Metal Solution servers.
The baremetalsolution.googleapis.com service provides management capabilities for Bare Metal Solution servers. To access the API methods, you must assign Bare Metal Solution IAM roles containing the desired permissions to your staff in your Google Cloud project. You must also enable the Bare Metal Solution API. Once enabled, the methods act upon specific servers in your Bare Metal Solution environment.
func NewClient
NewClient creates a new bare metal solution client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Performs management operations on Bare Metal Solution servers.
The baremetalsolution.googleapis.com service provides management capabilities for Bare Metal Solution servers. To access the API methods, you must assign Bare Metal Solution IAM roles containing the desired permissions to your staff in your Google Cloud project. You must also enable the Bare Metal Solution API. Once enabled, the methods act upon specific servers in your Bare Metal Solution environment.
Example
package main
import (
"context"
baremetalsolution "cloud.google.com/go/baremetalsolution/apiv2"
)
func main() {
ctx := context.Background()
c, err := baremetalsolution.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*Client) Close
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*Client) Connection
func (c *Client) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated.
func (*Client) CreateSnapshotSchedulePolicy
func (c *Client) CreateSnapshotSchedulePolicy(ctx context.Context, req *baremetalsolutionpb.CreateSnapshotSchedulePolicyRequest, opts ...gax.CallOption) (*baremetalsolutionpb.SnapshotSchedulePolicy, error)
CreateSnapshotSchedulePolicy create a snapshot schedule policy in the specified project.
Example
package main
import (
"context"
baremetalsolution "cloud.google.com/go/baremetalsolution/apiv2"
baremetalsolutionpb "google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2"
)
func main() {
ctx := context.Background()
c, err := baremetalsolution.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &baremetalsolutionpb.CreateSnapshotSchedulePolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#CreateSnapshotSchedulePolicyRequest.
}
resp, err := c.CreateSnapshotSchedulePolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) CreateVolumeSnapshot
func (c *Client) CreateVolumeSnapshot(ctx context.Context, req *baremetalsolutionpb.CreateVolumeSnapshotRequest, opts ...gax.CallOption) (*baremetalsolutionpb.VolumeSnapshot, error)
CreateVolumeSnapshot create a storage volume snapshot in a containing volume.
Example
package main
import (
"context"
baremetalsolution "cloud.google.com/go/baremetalsolution/apiv2"
baremetalsolutionpb "google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2"
)
func main() {
ctx := context.Background()
c, err := baremetalsolution.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &baremetalsolutionpb.CreateVolumeSnapshotRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#CreateVolumeSnapshotRequest.
}
resp, err := c.CreateVolumeSnapshot(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) DeleteSnapshotSchedulePolicy
func (c *Client) DeleteSnapshotSchedulePolicy(ctx context.Context, req *baremetalsolutionpb.DeleteSnapshotSchedulePolicyRequest, opts ...gax.CallOption) error
DeleteSnapshotSchedulePolicy delete a named snapshot schedule policy.
Example
package main
import (
"context"
baremetalsolution "cloud.google.com/go/baremetalsolution/apiv2"
baremetalsolutionpb "google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2"
)
func main() {
ctx := context.Background()
c, err := baremetalsolution.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &baremetalsolutionpb.DeleteSnapshotSchedulePolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#DeleteSnapshotSchedulePolicyRequest.
}
err = c.DeleteSnapshotSchedulePolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*Client) DeleteVolumeSnapshot
func (c *Client) DeleteVolumeSnapshot(ctx context.Context, req *baremetalsolutionpb.DeleteVolumeSnapshotRequest, opts ...gax.CallOption) error
DeleteVolumeSnapshot deletes a storage volume snapshot for a given volume.
Example
package main
import (
"context"
baremetalsolution "cloud.google.com/go/baremetalsolution/apiv2"
baremetalsolutionpb "google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2"
)
func main() {
ctx := context.Background()
c, err := baremetalsolution.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &baremetalsolutionpb.DeleteVolumeSnapshotRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#DeleteVolumeSnapshotRequest.
}
err = c.DeleteVolumeSnapshot(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*Client) GetInstance
func (c *Client) GetInstance(ctx context.Context, req *baremetalsolutionpb.GetInstanceRequest, opts ...gax.CallOption) (*baremetalsolutionpb.Instance, error)
GetInstance get details about a single server.
Example
package main
import (
"context"
baremetalsolution "cloud.google.com/go/baremetalsolution/apiv2"
baremetalsolutionpb "google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2"
)
func main() {
ctx := context.Background()
c, err := baremetalsolution.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &baremetalsolutionpb.GetInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#GetInstanceRequest.
}
resp, err := c.GetInstance(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) GetLun
func (c *Client) GetLun(ctx context.Context, req *baremetalsolutionpb.GetLunRequest, opts ...gax.CallOption) (*baremetalsolutionpb.Lun, error)
GetLun get details of a single storage logical unit number(LUN).
Example
package main
import (
"context"
baremetalsolution "cloud.google.com/go/baremetalsolution/apiv2"
baremetalsolutionpb "google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2"
)
func main() {
ctx := context.Background()
c, err := baremetalsolution.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &baremetalsolutionpb.GetLunRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#GetLunRequest.
}
resp, err := c.GetLun(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) GetNetwork
func (c *Client) GetNetwork(ctx context.Context, req *baremetalsolutionpb.GetNetworkRequest, opts ...gax.CallOption) (*baremetalsolutionpb.Network, error)
GetNetwork get details of a single network.
Example
package main
import (
"context"
baremetalsolution "cloud.google.com/go/baremetalsolution/apiv2"
baremetalsolutionpb "google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2"
)
func main() {
ctx := context.Background()
c, err := baremetalsolution.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &baremetalsolutionpb.GetNetworkRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#GetNetworkRequest.
}
resp, err := c.GetNetwork(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) GetSnapshotSchedulePolicy
func (c *Client) GetSnapshotSchedulePolicy(ctx context.Context, req *baremetalsolutionpb.GetSnapshotSchedulePolicyRequest, opts ...gax.CallOption) (*baremetalsolutionpb.SnapshotSchedulePolicy, error)
GetSnapshotSchedulePolicy get details of a single snapshot schedule policy.
Example
package main
import (
"context"
baremetalsolution "cloud.google.com/go/baremetalsolution/apiv2"
baremetalsolutionpb "google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2"
)
func main() {
ctx := context.Background()
c, err := baremetalsolution.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &baremetalsolutionpb.GetSnapshotSchedulePolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#GetSnapshotSchedulePolicyRequest.
}
resp, err := c.GetSnapshotSchedulePolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) GetVolume
func (c *Client) GetVolume(ctx context.Context, req *baremetalsolutionpb.GetVolumeRequest, opts ...gax.CallOption) (*baremetalsolutionpb.Volume, error)
GetVolume get details of a single storage volume.
Example
package main
import (
"context"
baremetalsolution "cloud.google.com/go/baremetalsolution/apiv2"
baremetalsolutionpb "google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2"
)
func main() {
ctx := context.Background()
c, err := baremetalsolution.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &baremetalsolutionpb.GetVolumeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#GetVolumeRequest.
}
resp, err := c.GetVolume(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) GetVolumeSnapshot
func (c *Client) GetVolumeSnapshot(ctx context.Context, req *baremetalsolutionpb.GetVolumeSnapshotRequest, opts ...gax.CallOption) (*baremetalsolutionpb.VolumeSnapshot, error)
GetVolumeSnapshot get details of a single storage volume snapshot.
Example
package main
import (
"context"
baremetalsolution "cloud.google.com/go/baremetalsolution/apiv2"
baremetalsolutionpb "google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2"
)
func main() {
ctx := context.Background()
c, err := baremetalsolution.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &baremetalsolutionpb.GetVolumeSnapshotRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#GetVolumeSnapshotRequest.
}
resp, err := c.GetVolumeSnapshot(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) ListInstances
func (c *Client) ListInstances(ctx context.Context, req *baremetalsolutionpb.ListInstancesRequest, opts ...gax.CallOption) *InstanceIterator
ListInstances list servers in a given project and location.
Example
package main
import (
"context"
baremetalsolution "cloud.google.com/go/baremetalsolution/apiv2"
"google.golang.org/api/iterator"
baremetalsolutionpb "google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2"
)
func main() {
ctx := context.Background()
c, err := baremetalsolution.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &baremetalsolutionpb.ListInstancesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#ListInstancesRequest.
}
it := c.ListInstances(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func (*Client) ListLuns
func (c *Client) ListLuns(ctx context.Context, req *baremetalsolutionpb.ListLunsRequest, opts ...gax.CallOption) *LunIterator
ListLuns list storage volume luns for given storage volume.
Example
package main
import (
"context"
baremetalsolution "cloud.google.com/go/baremetalsolution/apiv2"
"google.golang.org/api/iterator"
baremetalsolutionpb "google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2"
)
func main() {
ctx := context.Background()
c, err := baremetalsolution.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &baremetalsolutionpb.ListLunsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#ListLunsRequest.
}
it := c.ListLuns(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func (*Client) ListNetworks
func (c *Client) ListNetworks(ctx context.Context, req *baremetalsolutionpb.ListNetworksRequest, opts ...gax.CallOption) *NetworkIterator
ListNetworks list network in a given project and location.
Example
package main
import (
"context"
baremetalsolution "cloud.google.com/go/baremetalsolution/apiv2"
"google.golang.org/api/iterator"
baremetalsolutionpb "google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2"
)
func main() {
ctx := context.Background()
c, err := baremetalsolution.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &baremetalsolutionpb.ListNetworksRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#ListNetworksRequest.
}
it := c.ListNetworks(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func (*Client) ListSnapshotSchedulePolicies
func (c *Client) ListSnapshotSchedulePolicies(ctx context.Context, req *baremetalsolutionpb.ListSnapshotSchedulePoliciesRequest, opts ...gax.CallOption) *SnapshotSchedulePolicyIterator
ListSnapshotSchedulePolicies list snapshot schedule policies in a given project and location.
Example
package main
import (
"context"
baremetalsolution "cloud.google.com/go/baremetalsolution/apiv2"
"google.golang.org/api/iterator"
baremetalsolutionpb "google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2"
)
func main() {
ctx := context.Background()
c, err := baremetalsolution.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &baremetalsolutionpb.ListSnapshotSchedulePoliciesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#ListSnapshotSchedulePoliciesRequest.
}
it := c.ListSnapshotSchedulePolicies(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func (*Client) ListVolumeSnapshots
func (c *Client) ListVolumeSnapshots(ctx context.Context, req *baremetalsolutionpb.ListVolumeSnapshotsRequest, opts ...gax.CallOption) *VolumeSnapshotIterator
ListVolumeSnapshots list storage volume snapshots for given storage volume.
Example
package main
import (
"context"
baremetalsolution "cloud.google.com/go/baremetalsolution/apiv2"
"google.golang.org/api/iterator"
baremetalsolutionpb "google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2"
)
func main() {
ctx := context.Background()
c, err := baremetalsolution.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &baremetalsolutionpb.ListVolumeSnapshotsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#ListVolumeSnapshotsRequest.
}
it := c.ListVolumeSnapshots(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func (*Client) ListVolumes
func (c *Client) ListVolumes(ctx context.Context, req *baremetalsolutionpb.ListVolumesRequest, opts ...gax.CallOption) *VolumeIterator
ListVolumes list storage volumes in a given project and location.
Example
package main
import (
"context"
baremetalsolution "cloud.google.com/go/baremetalsolution/apiv2"
"google.golang.org/api/iterator"
baremetalsolutionpb "google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2"
)
func main() {
ctx := context.Background()
c, err := baremetalsolution.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &baremetalsolutionpb.ListVolumesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#ListVolumesRequest.
}
it := c.ListVolumes(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func (*Client) ResetInstance
func (c *Client) ResetInstance(ctx context.Context, req *baremetalsolutionpb.ResetInstanceRequest, opts ...gax.CallOption) (*ResetInstanceOperation, error)
ResetInstance perform an ungraceful, hard reset on a server. Equivalent to shutting the power off and then turning it back on.
Example
package main
import (
"context"
baremetalsolution "cloud.google.com/go/baremetalsolution/apiv2"
baremetalsolutionpb "google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2"
)
func main() {
ctx := context.Background()
c, err := baremetalsolution.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &baremetalsolutionpb.ResetInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#ResetInstanceRequest.
}
op, err := c.ResetInstance(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) ResetInstanceOperation
func (c *Client) ResetInstanceOperation(name string) *ResetInstanceOperation
ResetInstanceOperation returns a new ResetInstanceOperation from a given name. The name must be that of a previously created ResetInstanceOperation, possibly from a different process.
func (*Client) RestoreVolumeSnapshot
func (c *Client) RestoreVolumeSnapshot(ctx context.Context, req *baremetalsolutionpb.RestoreVolumeSnapshotRequest, opts ...gax.CallOption) (*RestoreVolumeSnapshotOperation, error)
RestoreVolumeSnapshot restore a storage volume snapshot to its containing volume.
Example
package main
import (
"context"
baremetalsolution "cloud.google.com/go/baremetalsolution/apiv2"
baremetalsolutionpb "google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2"
)
func main() {
ctx := context.Background()
c, err := baremetalsolution.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &baremetalsolutionpb.RestoreVolumeSnapshotRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#RestoreVolumeSnapshotRequest.
}
op, err := c.RestoreVolumeSnapshot(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) RestoreVolumeSnapshotOperation
func (c *Client) RestoreVolumeSnapshotOperation(name string) *RestoreVolumeSnapshotOperation
RestoreVolumeSnapshotOperation returns a new RestoreVolumeSnapshotOperation from a given name. The name must be that of a previously created RestoreVolumeSnapshotOperation, possibly from a different process.
func (*Client) UpdateSnapshotSchedulePolicy
func (c *Client) UpdateSnapshotSchedulePolicy(ctx context.Context, req *baremetalsolutionpb.UpdateSnapshotSchedulePolicyRequest, opts ...gax.CallOption) (*baremetalsolutionpb.SnapshotSchedulePolicy, error)
UpdateSnapshotSchedulePolicy update a snapshot schedule policy in the specified project.
Example
package main
import (
"context"
baremetalsolution "cloud.google.com/go/baremetalsolution/apiv2"
baremetalsolutionpb "google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2"
)
func main() {
ctx := context.Background()
c, err := baremetalsolution.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &baremetalsolutionpb.UpdateSnapshotSchedulePolicyRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#UpdateSnapshotSchedulePolicyRequest.
}
resp, err := c.UpdateSnapshotSchedulePolicy(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) UpdateVolume
func (c *Client) UpdateVolume(ctx context.Context, req *baremetalsolutionpb.UpdateVolumeRequest, opts ...gax.CallOption) (*UpdateVolumeOperation, error)
UpdateVolume update details of a single storage volume.
Example
package main
import (
"context"
baremetalsolution "cloud.google.com/go/baremetalsolution/apiv2"
baremetalsolutionpb "google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2"
)
func main() {
ctx := context.Background()
c, err := baremetalsolution.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &baremetalsolutionpb.UpdateVolumeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#UpdateVolumeRequest.
}
op, err := c.UpdateVolume(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) UpdateVolumeOperation
func (c *Client) UpdateVolumeOperation(name string) *UpdateVolumeOperation
UpdateVolumeOperation returns a new UpdateVolumeOperation from a given name. The name must be that of a previously created UpdateVolumeOperation, possibly from a different process.
InstanceIterator
type InstanceIterator 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 []*baremetalsolutionpb.Instance, nextPageToken string, err error)
// contains filtered or unexported fields
}
InstanceIterator manages a stream of *baremetalsolutionpb.Instance.
func (*InstanceIterator) Next
func (it *InstanceIterator) Next() (*baremetalsolutionpb.Instance, 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 (*InstanceIterator) PageInfo
func (it *InstanceIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
LunIterator
type LunIterator 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 []*baremetalsolutionpb.Lun, nextPageToken string, err error)
// contains filtered or unexported fields
}
LunIterator manages a stream of *baremetalsolutionpb.Lun.
func (*LunIterator) Next
func (it *LunIterator) Next() (*baremetalsolutionpb.Lun, 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 (*LunIterator) PageInfo
func (it *LunIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
NetworkIterator
type NetworkIterator 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 []*baremetalsolutionpb.Network, nextPageToken string, err error)
// contains filtered or unexported fields
}
NetworkIterator manages a stream of *baremetalsolutionpb.Network.
func (*NetworkIterator) Next
func (it *NetworkIterator) Next() (*baremetalsolutionpb.Network, 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 (*NetworkIterator) PageInfo
func (it *NetworkIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
ResetInstanceOperation
type ResetInstanceOperation struct {
// contains filtered or unexported fields
}
ResetInstanceOperation manages a long-running operation from ResetInstance.
func (*ResetInstanceOperation) Done
func (op *ResetInstanceOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*ResetInstanceOperation) Metadata
func (op *ResetInstanceOperation) Metadata() (*baremetalsolutionpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*ResetInstanceOperation) Name
func (op *ResetInstanceOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*ResetInstanceOperation) Poll
func (op *ResetInstanceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*baremetalsolutionpb.ResetInstanceResponse, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*ResetInstanceOperation) Wait
func (op *ResetInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*baremetalsolutionpb.ResetInstanceResponse, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
RestoreVolumeSnapshotOperation
type RestoreVolumeSnapshotOperation struct {
// contains filtered or unexported fields
}
RestoreVolumeSnapshotOperation manages a long-running operation from RestoreVolumeSnapshot.
func (*RestoreVolumeSnapshotOperation) Done
func (op *RestoreVolumeSnapshotOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*RestoreVolumeSnapshotOperation) Metadata
func (op *RestoreVolumeSnapshotOperation) Metadata() (*baremetalsolutionpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*RestoreVolumeSnapshotOperation) Name
func (op *RestoreVolumeSnapshotOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*RestoreVolumeSnapshotOperation) Poll
func (op *RestoreVolumeSnapshotOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*baremetalsolutionpb.VolumeSnapshot, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*RestoreVolumeSnapshotOperation) Wait
func (op *RestoreVolumeSnapshotOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*baremetalsolutionpb.VolumeSnapshot, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
SnapshotSchedulePolicyIterator
type SnapshotSchedulePolicyIterator 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 []*baremetalsolutionpb.SnapshotSchedulePolicy, nextPageToken string, err error)
// contains filtered or unexported fields
}
SnapshotSchedulePolicyIterator manages a stream of *baremetalsolutionpb.SnapshotSchedulePolicy.
func (*SnapshotSchedulePolicyIterator) Next
func (it *SnapshotSchedulePolicyIterator) Next() (*baremetalsolutionpb.SnapshotSchedulePolicy, 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 (*SnapshotSchedulePolicyIterator) PageInfo
func (it *SnapshotSchedulePolicyIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
UpdateVolumeOperation
type UpdateVolumeOperation struct {
// contains filtered or unexported fields
}
UpdateVolumeOperation manages a long-running operation from UpdateVolume.
func (*UpdateVolumeOperation) Done
func (op *UpdateVolumeOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*UpdateVolumeOperation) Metadata
func (op *UpdateVolumeOperation) Metadata() (*baremetalsolutionpb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*UpdateVolumeOperation) Name
func (op *UpdateVolumeOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*UpdateVolumeOperation) Poll
func (op *UpdateVolumeOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*baremetalsolutionpb.Volume, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*UpdateVolumeOperation) Wait
func (op *UpdateVolumeOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*baremetalsolutionpb.Volume, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
VolumeIterator
type VolumeIterator 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 []*baremetalsolutionpb.Volume, nextPageToken string, err error)
// contains filtered or unexported fields
}
VolumeIterator manages a stream of *baremetalsolutionpb.Volume.
func (*VolumeIterator) Next
func (it *VolumeIterator) Next() (*baremetalsolutionpb.Volume, 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 (*VolumeIterator) PageInfo
func (it *VolumeIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
VolumeSnapshotIterator
type VolumeSnapshotIterator 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 []*baremetalsolutionpb.VolumeSnapshot, nextPageToken string, err error)
// contains filtered or unexported fields
}
VolumeSnapshotIterator manages a stream of *baremetalsolutionpb.VolumeSnapshot.
func (*VolumeSnapshotIterator) Next
func (it *VolumeSnapshotIterator) Next() (*baremetalsolutionpb.VolumeSnapshot, 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 (*VolumeSnapshotIterator) PageInfo
func (it *VolumeSnapshotIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.