Bare Metal Solution API v2 - Package cloud.google.com/go/baremetalsolution/apiv2 (v0.2.0)

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
	UpdateInstance   []gax.CallOption
	ResetInstance    []gax.CallOption
	StartInstance    []gax.CallOption
	StopInstance     []gax.CallOption
	DetachLun        []gax.CallOption
	ListVolumes      []gax.CallOption
	GetVolume        []gax.CallOption
	UpdateVolume     []gax.CallOption
	ResizeVolume     []gax.CallOption
	ListNetworks     []gax.CallOption
	ListNetworkUsage []gax.CallOption
	GetNetwork       []gax.CallOption
	UpdateNetwork    []gax.CallOption
	GetLun           []gax.CallOption
	ListLuns         []gax.CallOption
	GetNfsShare      []gax.CallOption
	ListNfsShares    []gax.CallOption
	UpdateNfsShare   []gax.CallOption
	GetLocation      []gax.CallOption
	ListLocations    []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

func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error)

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

func (c *Client) Close() error

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) DetachLun

DetachLun detach LUN from Instance.

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.DetachLunRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#DetachLunRequest.
	}
	op, err := c.DetachLun(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) DetachLunOperation

func (c *Client) DetachLunOperation(name string) *DetachLunOperation

DetachLunOperation returns a new DetachLunOperation from a given name. The name must be that of a previously created DetachLunOperation, possibly from a different process.

func (*Client) GetInstance

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) GetLocation

func (c *Client) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)

GetLocation gets information about a location.

Example

package main

import (
	"context"

	baremetalsolution "cloud.google.com/go/baremetalsolution/apiv2"

	locationpb "google.golang.org/genproto/googleapis/cloud/location"
)

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

	req := &locationpb.GetLocationRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#GetLocationRequest.
	}
	resp, err := c.GetLocation(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*Client) GetLun

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

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) GetNfsShare

GetNfsShare get details of a single NFS share.

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.GetNfsShareRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#GetNfsShareRequest.
	}
	resp, err := c.GetNfsShare(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*Client) GetVolume

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) ListInstances

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) ListLocations

func (c *Client) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator

ListLocations lists information about the supported locations for this service.

Example

package main

import (
	"context"

	baremetalsolution "cloud.google.com/go/baremetalsolution/apiv2"
	"google.golang.org/api/iterator"

	locationpb "google.golang.org/genproto/googleapis/cloud/location"
)

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

	req := &locationpb.ListLocationsRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
	}
	it := c.ListLocations(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

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) ListNetworkUsage

ListNetworkUsage list all Networks (and used IPs for each Network) in the vendor account associated with 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.ListNetworkUsageRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#ListNetworkUsageRequest.
	}
	resp, err := c.ListNetworkUsage(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

func (*Client) ListNetworks

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) ListNfsShares

ListNfsShares list NFS shares.

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.ListNfsSharesRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#ListNfsSharesRequest.
	}
	it := c.ListNfsShares(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

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

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) ResizeVolume

ResizeVolume emergency Volume resize.

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.ResizeVolumeRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#ResizeVolumeRequest.
	}
	op, err := c.ResizeVolume(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) ResizeVolumeOperation

func (c *Client) ResizeVolumeOperation(name string) *ResizeVolumeOperation

ResizeVolumeOperation returns a new ResizeVolumeOperation from a given name. The name must be that of a previously created ResizeVolumeOperation, possibly from a different process.

func (*Client) StartInstance

StartInstance starts a server that was shutdown.

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.StartInstanceRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#StartInstanceRequest.
	}
	op, err := c.StartInstance(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) StartInstanceOperation

func (c *Client) StartInstanceOperation(name string) *StartInstanceOperation

StartInstanceOperation returns a new StartInstanceOperation from a given name. The name must be that of a previously created StartInstanceOperation, possibly from a different process.

func (*Client) StopInstance

StopInstance stop a running 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.StopInstanceRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#StopInstanceRequest.
	}
	op, err := c.StopInstance(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) StopInstanceOperation

func (c *Client) StopInstanceOperation(name string) *StopInstanceOperation

StopInstanceOperation returns a new StopInstanceOperation from a given name. The name must be that of a previously created StopInstanceOperation, possibly from a different process.

func (*Client) UpdateInstance

UpdateInstance update details of 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.UpdateInstanceRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#UpdateInstanceRequest.
	}
	op, err := c.UpdateInstance(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) UpdateInstanceOperation

func (c *Client) UpdateInstanceOperation(name string) *UpdateInstanceOperation

UpdateInstanceOperation returns a new UpdateInstanceOperation from a given name. The name must be that of a previously created UpdateInstanceOperation, possibly from a different process.

func (*Client) UpdateNetwork

UpdateNetwork update 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.UpdateNetworkRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#UpdateNetworkRequest.
	}
	op, err := c.UpdateNetwork(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) UpdateNetworkOperation

func (c *Client) UpdateNetworkOperation(name string) *UpdateNetworkOperation

UpdateNetworkOperation returns a new UpdateNetworkOperation from a given name. The name must be that of a previously created UpdateNetworkOperation, possibly from a different process.

func (*Client) UpdateNfsShare

UpdateNfsShare update details of a single NFS share.

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.UpdateNfsShareRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2#UpdateNfsShareRequest.
	}
	op, err := c.UpdateNfsShare(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) UpdateNfsShareOperation

func (c *Client) UpdateNfsShareOperation(name string) *UpdateNfsShareOperation

UpdateNfsShareOperation returns a new UpdateNfsShareOperation from a given name. The name must be that of a previously created UpdateNfsShareOperation, possibly from a different process.

func (*Client) UpdateVolume

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.

DetachLunOperation

type DetachLunOperation struct {
	// contains filtered or unexported fields
}

DetachLunOperation manages a long-running operation from DetachLun.

func (*DetachLunOperation) Done

func (op *DetachLunOperation) Done() bool

Done reports whether the long-running operation has completed.

func (*DetachLunOperation) Metadata

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 (*DetachLunOperation) Name

func (op *DetachLunOperation) 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 (*DetachLunOperation) Poll

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 (*DetachLunOperation) Wait

Wait blocks until the long-running operation is completed, returning the response and any errors encountered.

See documentation of Poll for error-handling information.

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

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.

LocationIterator

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

LocationIterator manages a stream of *locationpb.Location.

func (*LocationIterator) Next

func (it *LocationIterator) Next() (*locationpb.Location, 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 (*LocationIterator) PageInfo

func (it *LocationIterator) 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

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.

NfsShareIterator

type NfsShareIterator 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.NfsShare, nextPageToken string, err error)
	// contains filtered or unexported fields
}

NfsShareIterator manages a stream of *baremetalsolutionpb.NfsShare.

func (*NfsShareIterator) Next

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 (*NfsShareIterator) PageInfo

func (it *NfsShareIterator) 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

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

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

Wait blocks until the long-running operation is completed, returning the response and any errors encountered.

See documentation of Poll for error-handling information.

ResizeVolumeOperation

type ResizeVolumeOperation struct {
	// contains filtered or unexported fields
}

ResizeVolumeOperation manages a long-running operation from ResizeVolume.

func (*ResizeVolumeOperation) Done

func (op *ResizeVolumeOperation) Done() bool

Done reports whether the long-running operation has completed.

func (*ResizeVolumeOperation) Metadata

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 (*ResizeVolumeOperation) Name

func (op *ResizeVolumeOperation) 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 (*ResizeVolumeOperation) Poll

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 (*ResizeVolumeOperation) Wait

Wait blocks until the long-running operation is completed, returning the response and any errors encountered.

See documentation of Poll for error-handling information.

StartInstanceOperation

type StartInstanceOperation struct {
	// contains filtered or unexported fields
}

StartInstanceOperation manages a long-running operation from StartInstance.

func (*StartInstanceOperation) Done

func (op *StartInstanceOperation) Done() bool

Done reports whether the long-running operation has completed.

func (*StartInstanceOperation) Metadata

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 (*StartInstanceOperation) Name

func (op *StartInstanceOperation) 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 (*StartInstanceOperation) Poll

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 (*StartInstanceOperation) Wait

Wait blocks until the long-running operation is completed, returning the response and any errors encountered.

See documentation of Poll for error-handling information.

StopInstanceOperation

type StopInstanceOperation struct {
	// contains filtered or unexported fields
}

StopInstanceOperation manages a long-running operation from StopInstance.

func (*StopInstanceOperation) Done

func (op *StopInstanceOperation) Done() bool

Done reports whether the long-running operation has completed.

func (*StopInstanceOperation) Metadata

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 (*StopInstanceOperation) Name

func (op *StopInstanceOperation) 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 (*StopInstanceOperation) Poll

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 (*StopInstanceOperation) Wait

Wait blocks until the long-running operation is completed, returning the response and any errors encountered.

See documentation of Poll for error-handling information.

UpdateInstanceOperation

type UpdateInstanceOperation struct {
	// contains filtered or unexported fields
}

UpdateInstanceOperation manages a long-running operation from UpdateInstance.

func (*UpdateInstanceOperation) Done

func (op *UpdateInstanceOperation) Done() bool

Done reports whether the long-running operation has completed.

func (*UpdateInstanceOperation) Metadata

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 (*UpdateInstanceOperation) Name

func (op *UpdateInstanceOperation) 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 (*UpdateInstanceOperation) Poll

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 (*UpdateInstanceOperation) Wait

Wait blocks until the long-running operation is completed, returning the response and any errors encountered.

See documentation of Poll for error-handling information.

UpdateNetworkOperation

type UpdateNetworkOperation struct {
	// contains filtered or unexported fields
}

UpdateNetworkOperation manages a long-running operation from UpdateNetwork.

func (*UpdateNetworkOperation) Done

func (op *UpdateNetworkOperation) Done() bool

Done reports whether the long-running operation has completed.

func (*UpdateNetworkOperation) Metadata

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 (*UpdateNetworkOperation) Name

func (op *UpdateNetworkOperation) 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 (*UpdateNetworkOperation) Poll

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 (*UpdateNetworkOperation) Wait

Wait blocks until the long-running operation is completed, returning the response and any errors encountered.

See documentation of Poll for error-handling information.

UpdateNfsShareOperation

type UpdateNfsShareOperation struct {
	// contains filtered or unexported fields
}

UpdateNfsShareOperation manages a long-running operation from UpdateNfsShare.

func (*UpdateNfsShareOperation) Done

func (op *UpdateNfsShareOperation) Done() bool

Done reports whether the long-running operation has completed.

func (*UpdateNfsShareOperation) Metadata

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 (*UpdateNfsShareOperation) Name

func (op *UpdateNfsShareOperation) 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 (*UpdateNfsShareOperation) Poll

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 (*UpdateNfsShareOperation) Wait

Wait blocks until the long-running operation is completed, returning the response and any errors encountered.

See documentation of Poll for error-handling information.

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

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

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

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

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.