Class BareMetalSolutionClient (0.14.0)

public class BareMetalSolutionClient implements BackgroundResource

Service Description: 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.

This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
   Instance response = bareMetalSolutionClient.getInstance(name);
 }
 

Note: close() needs to be called on the BareMetalSolutionClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().

The surface of this class includes several types of Java methods for each of the API's methods:

  1. A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
  2. A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
  3. A "callable" method. This type of method takes no parameters and returns an immutable API callable object, which can be used to initiate calls to the service.

See the individual methods for example code.

Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.

This class can be customized by passing in a custom instance of BareMetalSolutionSettings to create(). For example:

To customize credentials:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 BareMetalSolutionSettings bareMetalSolutionSettings =
     BareMetalSolutionSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 BareMetalSolutionClient bareMetalSolutionClient =
     BareMetalSolutionClient.create(bareMetalSolutionSettings);
 

To customize the endpoint:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 BareMetalSolutionSettings bareMetalSolutionSettings =
     BareMetalSolutionSettings.newBuilder().setEndpoint(myEndpoint).build();
 BareMetalSolutionClient bareMetalSolutionClient =
     BareMetalSolutionClient.create(bareMetalSolutionSettings);
 

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 BareMetalSolutionSettings bareMetalSolutionSettings =
     BareMetalSolutionSettings.newHttpJsonBuilder().build();
 BareMetalSolutionClient bareMetalSolutionClient =
     BareMetalSolutionClient.create(bareMetalSolutionSettings);
 

Please refer to the GitHub repository's samples for more quickstart code snippets.

Inheritance

java.lang.Object > BareMetalSolutionClient

Implements

BackgroundResource

Static Methods

create()

public static final BareMetalSolutionClient create()

Constructs an instance of BareMetalSolutionClient with default settings.

Returns
TypeDescription
BareMetalSolutionClient
Exceptions
TypeDescription
IOException

create(BareMetalSolutionSettings settings)

public static final BareMetalSolutionClient create(BareMetalSolutionSettings settings)

Constructs an instance of BareMetalSolutionClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.

Parameter
NameDescription
settingsBareMetalSolutionSettings
Returns
TypeDescription
BareMetalSolutionClient
Exceptions
TypeDescription
IOException

create(BareMetalSolutionStub stub)

public static final BareMetalSolutionClient create(BareMetalSolutionStub stub)

Constructs an instance of BareMetalSolutionClient, using the given stub for making calls. This is for advanced usage - prefer using create(BareMetalSolutionSettings).

Parameter
NameDescription
stubBareMetalSolutionStub
Returns
TypeDescription
BareMetalSolutionClient

Constructors

BareMetalSolutionClient(BareMetalSolutionSettings settings)

protected BareMetalSolutionClient(BareMetalSolutionSettings settings)

Constructs an instance of BareMetalSolutionClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.

Parameter
NameDescription
settingsBareMetalSolutionSettings

BareMetalSolutionClient(BareMetalSolutionStub stub)

protected BareMetalSolutionClient(BareMetalSolutionStub stub)
Parameter
NameDescription
stubBareMetalSolutionStub

Methods

awaitTermination(long duration, TimeUnit unit)

public boolean awaitTermination(long duration, TimeUnit unit)
Parameters
NameDescription
durationlong
unitTimeUnit
Returns
TypeDescription
boolean
Exceptions
TypeDescription
InterruptedException

close()

public final void close()

detachLunAsync(DetachLunRequest request)

public final OperationFuture<Instance,OperationMetadata> detachLunAsync(DetachLunRequest request)

Detach LUN from Instance.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   DetachLunRequest request =
       DetachLunRequest.newBuilder()
           .setInstance(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
           .setLun(LunName.of("[PROJECT]", "[LOCATION]", "[VOLUME]", "[LUN]").toString())
           .build();
   Instance response = bareMetalSolutionClient.detachLunAsync(request).get();
 }
 
Parameter
NameDescription
requestDetachLunRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<Instance,OperationMetadata>

detachLunAsync(InstanceName instance, LunName lun)

public final OperationFuture<Instance,OperationMetadata> detachLunAsync(InstanceName instance, LunName lun)

Detach LUN from Instance.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   InstanceName instance = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
   LunName lun = LunName.of("[PROJECT]", "[LOCATION]", "[VOLUME]", "[LUN]");
   Instance response = bareMetalSolutionClient.detachLunAsync(instance, lun).get();
 }
 
Parameters
NameDescription
instanceInstanceName

Required. Name of the instance.

lunLunName

Required. Name of the Lun to detach.

Returns
TypeDescription
OperationFuture<Instance,OperationMetadata>

detachLunAsync(InstanceName instance, String lun)

public final OperationFuture<Instance,OperationMetadata> detachLunAsync(InstanceName instance, String lun)

Detach LUN from Instance.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   InstanceName instance = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
   String lun = LunName.of("[PROJECT]", "[LOCATION]", "[VOLUME]", "[LUN]").toString();
   Instance response = bareMetalSolutionClient.detachLunAsync(instance, lun).get();
 }
 
Parameters
NameDescription
instanceInstanceName

Required. Name of the instance.

lunString

Required. Name of the Lun to detach.

Returns
TypeDescription
OperationFuture<Instance,OperationMetadata>

detachLunAsync(String instance, LunName lun)

public final OperationFuture<Instance,OperationMetadata> detachLunAsync(String instance, LunName lun)

Detach LUN from Instance.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   String instance = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
   LunName lun = LunName.of("[PROJECT]", "[LOCATION]", "[VOLUME]", "[LUN]");
   Instance response = bareMetalSolutionClient.detachLunAsync(instance, lun).get();
 }
 
Parameters
NameDescription
instanceString

Required. Name of the instance.

lunLunName

Required. Name of the Lun to detach.

Returns
TypeDescription
OperationFuture<Instance,OperationMetadata>

detachLunAsync(String instance, String lun)

public final OperationFuture<Instance,OperationMetadata> detachLunAsync(String instance, String lun)

Detach LUN from Instance.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   String instance = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
   String lun = LunName.of("[PROJECT]", "[LOCATION]", "[VOLUME]", "[LUN]").toString();
   Instance response = bareMetalSolutionClient.detachLunAsync(instance, lun).get();
 }
 
Parameters
NameDescription
instanceString

Required. Name of the instance.

lunString

Required. Name of the Lun to detach.

Returns
TypeDescription
OperationFuture<Instance,OperationMetadata>

detachLunCallable()

public final UnaryCallable<DetachLunRequest,Operation> detachLunCallable()

Detach LUN from Instance.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   DetachLunRequest request =
       DetachLunRequest.newBuilder()
           .setInstance(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
           .setLun(LunName.of("[PROJECT]", "[LOCATION]", "[VOLUME]", "[LUN]").toString())
           .build();
   ApiFuture<Operation> future = bareMetalSolutionClient.detachLunCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<DetachLunRequest,Operation>

detachLunOperationCallable()

public final OperationCallable<DetachLunRequest,Instance,OperationMetadata> detachLunOperationCallable()

Detach LUN from Instance.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   DetachLunRequest request =
       DetachLunRequest.newBuilder()
           .setInstance(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
           .setLun(LunName.of("[PROJECT]", "[LOCATION]", "[VOLUME]", "[LUN]").toString())
           .build();
   OperationFuture<Instance, OperationMetadata> future =
       bareMetalSolutionClient.detachLunOperationCallable().futureCall(request);
   // Do something.
   Instance response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<DetachLunRequest,Instance,OperationMetadata>

getHttpJsonOperationsClient()

public final OperationsClient getHttpJsonOperationsClient()

Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.

Returns
TypeDescription
OperationsClient

getInstance(GetInstanceRequest request)

public final Instance getInstance(GetInstanceRequest request)

Get details about a single server.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   GetInstanceRequest request =
       GetInstanceRequest.newBuilder()
           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
           .build();
   Instance response = bareMetalSolutionClient.getInstance(request);
 }
 
Parameter
NameDescription
requestGetInstanceRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
Instance

getInstance(InstanceName name)

public final Instance getInstance(InstanceName name)

Get details about a single server.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
   Instance response = bareMetalSolutionClient.getInstance(name);
 }
 
Parameter
NameDescription
nameInstanceName

Required. Name of the resource.

Returns
TypeDescription
Instance

getInstance(String name)

public final Instance getInstance(String name)

Get details about a single server.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
   Instance response = bareMetalSolutionClient.getInstance(name);
 }
 
Parameter
NameDescription
nameString

Required. Name of the resource.

Returns
TypeDescription
Instance

getInstanceCallable()

public final UnaryCallable<GetInstanceRequest,Instance> getInstanceCallable()

Get details about a single server.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   GetInstanceRequest request =
       GetInstanceRequest.newBuilder()
           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
           .build();
   ApiFuture<Instance> future =
       bareMetalSolutionClient.getInstanceCallable().futureCall(request);
   // Do something.
   Instance response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<GetInstanceRequest,Instance>

getLun(GetLunRequest request)

public final Lun getLun(GetLunRequest request)

Get details of a single storage logical unit number(LUN).

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   GetLunRequest request =
       GetLunRequest.newBuilder()
           .setName(LunName.of("[PROJECT]", "[LOCATION]", "[VOLUME]", "[LUN]").toString())
           .build();
   Lun response = bareMetalSolutionClient.getLun(request);
 }
 
Parameter
NameDescription
requestGetLunRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
Lun

getLun(LunName name)

public final Lun getLun(LunName name)

Get details of a single storage logical unit number(LUN).

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   LunName name = LunName.of("[PROJECT]", "[LOCATION]", "[VOLUME]", "[LUN]");
   Lun response = bareMetalSolutionClient.getLun(name);
 }
 
Parameter
NameDescription
nameLunName

Required. Name of the resource.

Returns
TypeDescription
Lun

getLun(String name)

public final Lun getLun(String name)

Get details of a single storage logical unit number(LUN).

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   String name = LunName.of("[PROJECT]", "[LOCATION]", "[VOLUME]", "[LUN]").toString();
   Lun response = bareMetalSolutionClient.getLun(name);
 }
 
Parameter
NameDescription
nameString

Required. Name of the resource.

Returns
TypeDescription
Lun

getLunCallable()

public final UnaryCallable<GetLunRequest,Lun> getLunCallable()

Get details of a single storage logical unit number(LUN).

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   GetLunRequest request =
       GetLunRequest.newBuilder()
           .setName(LunName.of("[PROJECT]", "[LOCATION]", "[VOLUME]", "[LUN]").toString())
           .build();
   ApiFuture<Lun> future = bareMetalSolutionClient.getLunCallable().futureCall(request);
   // Do something.
   Lun response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<GetLunRequest,Lun>

getNetwork(GetNetworkRequest request)

public final Network getNetwork(GetNetworkRequest request)

Get details of a single network.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   GetNetworkRequest request =
       GetNetworkRequest.newBuilder()
           .setName(NetworkName.of("[PROJECT]", "[LOCATION]", "[NETWORK]").toString())
           .build();
   Network response = bareMetalSolutionClient.getNetwork(request);
 }
 
Parameter
NameDescription
requestGetNetworkRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
Network

getNetwork(NetworkName name)

public final Network getNetwork(NetworkName name)

Get details of a single network.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   NetworkName name = NetworkName.of("[PROJECT]", "[LOCATION]", "[NETWORK]");
   Network response = bareMetalSolutionClient.getNetwork(name);
 }
 
Parameter
NameDescription
nameNetworkName

Required. Name of the resource.

Returns
TypeDescription
Network

getNetwork(String name)

public final Network getNetwork(String name)

Get details of a single network.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   String name = NetworkName.of("[PROJECT]", "[LOCATION]", "[NETWORK]").toString();
   Network response = bareMetalSolutionClient.getNetwork(name);
 }
 
Parameter
NameDescription
nameString

Required. Name of the resource.

Returns
TypeDescription
Network

getNetworkCallable()

public final UnaryCallable<GetNetworkRequest,Network> getNetworkCallable()

Get details of a single network.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   GetNetworkRequest request =
       GetNetworkRequest.newBuilder()
           .setName(NetworkName.of("[PROJECT]", "[LOCATION]", "[NETWORK]").toString())
           .build();
   ApiFuture<Network> future = bareMetalSolutionClient.getNetworkCallable().futureCall(request);
   // Do something.
   Network response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<GetNetworkRequest,Network>

getNfsShare(GetNfsShareRequest request)

public final NfsShare getNfsShare(GetNfsShareRequest request)

Get details of a single NFS share.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   GetNfsShareRequest request =
       GetNfsShareRequest.newBuilder()
           .setName(NFSShareName.of("[PROJECT]", "[LOCATION]", "[NFS_SHARE]").toString())
           .build();
   NfsShare response = bareMetalSolutionClient.getNfsShare(request);
 }
 
Parameter
NameDescription
requestGetNfsShareRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
NfsShare

getNfsShare(NFSShareName name)

public final NfsShare getNfsShare(NFSShareName name)

Get details of a single NFS share.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   NFSShareName name = NFSShareName.of("[PROJECT]", "[LOCATION]", "[NFS_SHARE]");
   NfsShare response = bareMetalSolutionClient.getNfsShare(name);
 }
 
Parameter
NameDescription
nameNFSShareName

Required. Name of the resource.

Returns
TypeDescription
NfsShare

getNfsShare(String name)

public final NfsShare getNfsShare(String name)

Get details of a single NFS share.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   String name = NFSShareName.of("[PROJECT]", "[LOCATION]", "[NFS_SHARE]").toString();
   NfsShare response = bareMetalSolutionClient.getNfsShare(name);
 }
 
Parameter
NameDescription
nameString

Required. Name of the resource.

Returns
TypeDescription
NfsShare

getNfsShareCallable()

public final UnaryCallable<GetNfsShareRequest,NfsShare> getNfsShareCallable()

Get details of a single NFS share.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   GetNfsShareRequest request =
       GetNfsShareRequest.newBuilder()
           .setName(NFSShareName.of("[PROJECT]", "[LOCATION]", "[NFS_SHARE]").toString())
           .build();
   ApiFuture<NfsShare> future =
       bareMetalSolutionClient.getNfsShareCallable().futureCall(request);
   // Do something.
   NfsShare response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<GetNfsShareRequest,NfsShare>

getOperationsClient()

public final OperationsClient getOperationsClient()

Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.

Returns
TypeDescription
OperationsClient

getSettings()

public final BareMetalSolutionSettings getSettings()
Returns
TypeDescription
BareMetalSolutionSettings

getStub()

public BareMetalSolutionStub getStub()
Returns
TypeDescription
BareMetalSolutionStub

getVolume(GetVolumeRequest request)

public final Volume getVolume(GetVolumeRequest request)

Get details of a single storage volume.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   GetVolumeRequest request =
       GetVolumeRequest.newBuilder()
           .setName(VolumeName.of("[PROJECT]", "[LOCATION]", "[VOLUME]").toString())
           .build();
   Volume response = bareMetalSolutionClient.getVolume(request);
 }
 
Parameter
NameDescription
requestGetVolumeRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
Volume

getVolume(VolumeName name)

public final Volume getVolume(VolumeName name)

Get details of a single storage volume.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   VolumeName name = VolumeName.of("[PROJECT]", "[LOCATION]", "[VOLUME]");
   Volume response = bareMetalSolutionClient.getVolume(name);
 }
 
Parameter
NameDescription
nameVolumeName

Required. Name of the resource.

Returns
TypeDescription
Volume

getVolume(String name)

public final Volume getVolume(String name)

Get details of a single storage volume.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   String name = VolumeName.of("[PROJECT]", "[LOCATION]", "[VOLUME]").toString();
   Volume response = bareMetalSolutionClient.getVolume(name);
 }
 
Parameter
NameDescription
nameString

Required. Name of the resource.

Returns
TypeDescription
Volume

getVolumeCallable()

public final UnaryCallable<GetVolumeRequest,Volume> getVolumeCallable()

Get details of a single storage volume.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   GetVolumeRequest request =
       GetVolumeRequest.newBuilder()
           .setName(VolumeName.of("[PROJECT]", "[LOCATION]", "[VOLUME]").toString())
           .build();
   ApiFuture<Volume> future = bareMetalSolutionClient.getVolumeCallable().futureCall(request);
   // Do something.
   Volume response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<GetVolumeRequest,Volume>

isShutdown()

public boolean isShutdown()
Returns
TypeDescription
boolean

isTerminated()

public boolean isTerminated()
Returns
TypeDescription
boolean

listInstances(ListInstancesRequest request)

public final BareMetalSolutionClient.ListInstancesPagedResponse listInstances(ListInstancesRequest request)

List servers in a given project and location.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   ListInstancesRequest request =
       ListInstancesRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .build();
   for (Instance element : bareMetalSolutionClient.listInstances(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
requestListInstancesRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
BareMetalSolutionClient.ListInstancesPagedResponse

listInstances(LocationName parent)

public final BareMetalSolutionClient.ListInstancesPagedResponse listInstances(LocationName parent)

List servers in a given project and location.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   for (Instance element : bareMetalSolutionClient.listInstances(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentLocationName

Required. Parent value for ListInstancesRequest.

Returns
TypeDescription
BareMetalSolutionClient.ListInstancesPagedResponse

listInstances(String parent)

public final BareMetalSolutionClient.ListInstancesPagedResponse listInstances(String parent)

List servers in a given project and location.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   for (Instance element : bareMetalSolutionClient.listInstances(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentString

Required. Parent value for ListInstancesRequest.

Returns
TypeDescription
BareMetalSolutionClient.ListInstancesPagedResponse

listInstancesCallable()

public final UnaryCallable<ListInstancesRequest,ListInstancesResponse> listInstancesCallable()

List servers in a given project and location.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   ListInstancesRequest request =
       ListInstancesRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .build();
   while (true) {
     ListInstancesResponse response =
         bareMetalSolutionClient.listInstancesCallable().call(request);
     for (Instance element : response.getInstancesList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListInstancesRequest,ListInstancesResponse>

listInstancesPagedCallable()

public final UnaryCallable<ListInstancesRequest,BareMetalSolutionClient.ListInstancesPagedResponse> listInstancesPagedCallable()

List servers in a given project and location.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   ListInstancesRequest request =
       ListInstancesRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .build();
   ApiFuture<Instance> future =
       bareMetalSolutionClient.listInstancesPagedCallable().futureCall(request);
   // Do something.
   for (Instance element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListInstancesRequest,ListInstancesPagedResponse>

listLuns(ListLunsRequest request)

public final BareMetalSolutionClient.ListLunsPagedResponse listLuns(ListLunsRequest request)

List storage volume luns for given storage volume.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   ListLunsRequest request =
       ListLunsRequest.newBuilder()
           .setParent(VolumeName.of("[PROJECT]", "[LOCATION]", "[VOLUME]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (Lun element : bareMetalSolutionClient.listLuns(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
requestListLunsRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
BareMetalSolutionClient.ListLunsPagedResponse

listLuns(VolumeName parent)

public final BareMetalSolutionClient.ListLunsPagedResponse listLuns(VolumeName parent)

List storage volume luns for given storage volume.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   VolumeName parent = VolumeName.of("[PROJECT]", "[LOCATION]", "[VOLUME]");
   for (Lun element : bareMetalSolutionClient.listLuns(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentVolumeName

Required. Parent value for ListLunsRequest.

Returns
TypeDescription
BareMetalSolutionClient.ListLunsPagedResponse

listLuns(String parent)

public final BareMetalSolutionClient.ListLunsPagedResponse listLuns(String parent)

List storage volume luns for given storage volume.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   String parent = VolumeName.of("[PROJECT]", "[LOCATION]", "[VOLUME]").toString();
   for (Lun element : bareMetalSolutionClient.listLuns(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentString

Required. Parent value for ListLunsRequest.

Returns
TypeDescription
BareMetalSolutionClient.ListLunsPagedResponse

listLunsCallable()

public final UnaryCallable<ListLunsRequest,ListLunsResponse> listLunsCallable()

List storage volume luns for given storage volume.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   ListLunsRequest request =
       ListLunsRequest.newBuilder()
           .setParent(VolumeName.of("[PROJECT]", "[LOCATION]", "[VOLUME]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListLunsResponse response = bareMetalSolutionClient.listLunsCallable().call(request);
     for (Lun element : response.getLunsList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListLunsRequest,ListLunsResponse>

listLunsPagedCallable()

public final UnaryCallable<ListLunsRequest,BareMetalSolutionClient.ListLunsPagedResponse> listLunsPagedCallable()

List storage volume luns for given storage volume.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   ListLunsRequest request =
       ListLunsRequest.newBuilder()
           .setParent(VolumeName.of("[PROJECT]", "[LOCATION]", "[VOLUME]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<Lun> future = bareMetalSolutionClient.listLunsPagedCallable().futureCall(request);
   // Do something.
   for (Lun element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListLunsRequest,ListLunsPagedResponse>

listNetworkUsage(ListNetworkUsageRequest request)

public final ListNetworkUsageResponse listNetworkUsage(ListNetworkUsageRequest request)

List all Networks (and used IPs for each Network) in the vendor account associated with the specified project.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   ListNetworkUsageRequest request =
       ListNetworkUsageRequest.newBuilder()
           .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .build();
   ListNetworkUsageResponse response = bareMetalSolutionClient.listNetworkUsage(request);
 }
 
Parameter
NameDescription
requestListNetworkUsageRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
ListNetworkUsageResponse

listNetworkUsage(LocationName location)

public final ListNetworkUsageResponse listNetworkUsage(LocationName location)

List all Networks (and used IPs for each Network) in the vendor account associated with the specified project.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   LocationName location = LocationName.of("[PROJECT]", "[LOCATION]");
   ListNetworkUsageResponse response = bareMetalSolutionClient.listNetworkUsage(location);
 }
 
Parameter
NameDescription
locationLocationName

Required. Parent value (project and location).

Returns
TypeDescription
ListNetworkUsageResponse

listNetworkUsage(String location)

public final ListNetworkUsageResponse listNetworkUsage(String location)

List all Networks (and used IPs for each Network) in the vendor account associated with the specified project.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   String location = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   ListNetworkUsageResponse response = bareMetalSolutionClient.listNetworkUsage(location);
 }
 
Parameter
NameDescription
locationString

Required. Parent value (project and location).

Returns
TypeDescription
ListNetworkUsageResponse

listNetworkUsageCallable()

public final UnaryCallable<ListNetworkUsageRequest,ListNetworkUsageResponse> listNetworkUsageCallable()

List all Networks (and used IPs for each Network) in the vendor account associated with the specified project.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   ListNetworkUsageRequest request =
       ListNetworkUsageRequest.newBuilder()
           .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .build();
   ApiFuture<ListNetworkUsageResponse> future =
       bareMetalSolutionClient.listNetworkUsageCallable().futureCall(request);
   // Do something.
   ListNetworkUsageResponse response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<ListNetworkUsageRequest,ListNetworkUsageResponse>

listNetworks(ListNetworksRequest request)

public final BareMetalSolutionClient.ListNetworksPagedResponse listNetworks(ListNetworksRequest request)

List network in a given project and location.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   ListNetworksRequest request =
       ListNetworksRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .build();
   for (Network element : bareMetalSolutionClient.listNetworks(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
requestListNetworksRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
BareMetalSolutionClient.ListNetworksPagedResponse

listNetworks(LocationName parent)

public final BareMetalSolutionClient.ListNetworksPagedResponse listNetworks(LocationName parent)

List network in a given project and location.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   for (Network element : bareMetalSolutionClient.listNetworks(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentLocationName

Required. Parent value for ListNetworksRequest.

Returns
TypeDescription
BareMetalSolutionClient.ListNetworksPagedResponse

listNetworks(String parent)

public final BareMetalSolutionClient.ListNetworksPagedResponse listNetworks(String parent)

List network in a given project and location.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   for (Network element : bareMetalSolutionClient.listNetworks(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentString

Required. Parent value for ListNetworksRequest.

Returns
TypeDescription
BareMetalSolutionClient.ListNetworksPagedResponse

listNetworksCallable()

public final UnaryCallable<ListNetworksRequest,ListNetworksResponse> listNetworksCallable()

List network in a given project and location.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   ListNetworksRequest request =
       ListNetworksRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .build();
   while (true) {
     ListNetworksResponse response =
         bareMetalSolutionClient.listNetworksCallable().call(request);
     for (Network element : response.getNetworksList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListNetworksRequest,ListNetworksResponse>

listNetworksPagedCallable()

public final UnaryCallable<ListNetworksRequest,BareMetalSolutionClient.ListNetworksPagedResponse> listNetworksPagedCallable()

List network in a given project and location.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   ListNetworksRequest request =
       ListNetworksRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .build();
   ApiFuture<Network> future =
       bareMetalSolutionClient.listNetworksPagedCallable().futureCall(request);
   // Do something.
   for (Network element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListNetworksRequest,ListNetworksPagedResponse>

listNfsShares(ListNfsSharesRequest request)

public final BareMetalSolutionClient.ListNfsSharesPagedResponse listNfsShares(ListNfsSharesRequest request)

List NFS shares.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   ListNfsSharesRequest request =
       ListNfsSharesRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .build();
   for (NfsShare element : bareMetalSolutionClient.listNfsShares(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
requestListNfsSharesRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
BareMetalSolutionClient.ListNfsSharesPagedResponse

listNfsShares(LocationName parent)

public final BareMetalSolutionClient.ListNfsSharesPagedResponse listNfsShares(LocationName parent)

List NFS shares.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   for (NfsShare element : bareMetalSolutionClient.listNfsShares(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentLocationName

Required. Parent value for ListNfsSharesRequest.

Returns
TypeDescription
BareMetalSolutionClient.ListNfsSharesPagedResponse

listNfsShares(String parent)

public final BareMetalSolutionClient.ListNfsSharesPagedResponse listNfsShares(String parent)

List NFS shares.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   for (NfsShare element : bareMetalSolutionClient.listNfsShares(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentString

Required. Parent value for ListNfsSharesRequest.

Returns
TypeDescription
BareMetalSolutionClient.ListNfsSharesPagedResponse

listNfsSharesCallable()

public final UnaryCallable<ListNfsSharesRequest,ListNfsSharesResponse> listNfsSharesCallable()

List NFS shares.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   ListNfsSharesRequest request =
       ListNfsSharesRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .build();
   while (true) {
     ListNfsSharesResponse response =
         bareMetalSolutionClient.listNfsSharesCallable().call(request);
     for (NfsShare element : response.getNfsSharesList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListNfsSharesRequest,ListNfsSharesResponse>

listNfsSharesPagedCallable()

public final UnaryCallable<ListNfsSharesRequest,BareMetalSolutionClient.ListNfsSharesPagedResponse> listNfsSharesPagedCallable()

List NFS shares.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   ListNfsSharesRequest request =
       ListNfsSharesRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .build();
   ApiFuture<NfsShare> future =
       bareMetalSolutionClient.listNfsSharesPagedCallable().futureCall(request);
   // Do something.
   for (NfsShare element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListNfsSharesRequest,ListNfsSharesPagedResponse>

listVolumes(ListVolumesRequest request)

public final BareMetalSolutionClient.ListVolumesPagedResponse listVolumes(ListVolumesRequest request)

List storage volumes in a given project and location.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   ListVolumesRequest request =
       ListVolumesRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .build();
   for (Volume element : bareMetalSolutionClient.listVolumes(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
requestListVolumesRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
BareMetalSolutionClient.ListVolumesPagedResponse

listVolumes(LocationName parent)

public final BareMetalSolutionClient.ListVolumesPagedResponse listVolumes(LocationName parent)

List storage volumes in a given project and location.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   for (Volume element : bareMetalSolutionClient.listVolumes(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentLocationName

Required. Parent value for ListVolumesRequest.

Returns
TypeDescription
BareMetalSolutionClient.ListVolumesPagedResponse

listVolumes(String parent)

public final BareMetalSolutionClient.ListVolumesPagedResponse listVolumes(String parent)

List storage volumes in a given project and location.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   for (Volume element : bareMetalSolutionClient.listVolumes(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
NameDescription
parentString

Required. Parent value for ListVolumesRequest.

Returns
TypeDescription
BareMetalSolutionClient.ListVolumesPagedResponse

listVolumesCallable()

public final UnaryCallable<ListVolumesRequest,ListVolumesResponse> listVolumesCallable()

List storage volumes in a given project and location.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   ListVolumesRequest request =
       ListVolumesRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .build();
   while (true) {
     ListVolumesResponse response = bareMetalSolutionClient.listVolumesCallable().call(request);
     for (Volume element : response.getVolumesList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListVolumesRequest,ListVolumesResponse>

listVolumesPagedCallable()

public final UnaryCallable<ListVolumesRequest,BareMetalSolutionClient.ListVolumesPagedResponse> listVolumesPagedCallable()

List storage volumes in a given project and location.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   ListVolumesRequest request =
       ListVolumesRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .build();
   ApiFuture<Volume> future =
       bareMetalSolutionClient.listVolumesPagedCallable().futureCall(request);
   // Do something.
   for (Volume element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
TypeDescription
UnaryCallable<ListVolumesRequest,ListVolumesPagedResponse>

resetInstanceAsync(InstanceName name)

public final OperationFuture<ResetInstanceResponse,OperationMetadata> resetInstanceAsync(InstanceName name)

Perform an ungraceful, hard reset on a server. Equivalent to shutting the power off and then turning it back on.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
   ResetInstanceResponse response = bareMetalSolutionClient.resetInstanceAsync(name).get();
 }
 
Parameter
NameDescription
nameInstanceName

Required. Name of the resource.

Returns
TypeDescription
OperationFuture<ResetInstanceResponse,OperationMetadata>

resetInstanceAsync(ResetInstanceRequest request)

public final OperationFuture<ResetInstanceResponse,OperationMetadata> resetInstanceAsync(ResetInstanceRequest request)

Perform an ungraceful, hard reset on a server. Equivalent to shutting the power off and then turning it back on.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   ResetInstanceRequest request =
       ResetInstanceRequest.newBuilder()
           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
           .build();
   ResetInstanceResponse response = bareMetalSolutionClient.resetInstanceAsync(request).get();
 }
 
Parameter
NameDescription
requestResetInstanceRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<ResetInstanceResponse,OperationMetadata>

resetInstanceAsync(String name)

public final OperationFuture<ResetInstanceResponse,OperationMetadata> resetInstanceAsync(String name)

Perform an ungraceful, hard reset on a server. Equivalent to shutting the power off and then turning it back on.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
   ResetInstanceResponse response = bareMetalSolutionClient.resetInstanceAsync(name).get();
 }
 
Parameter
NameDescription
nameString

Required. Name of the resource.

Returns
TypeDescription
OperationFuture<ResetInstanceResponse,OperationMetadata>

resetInstanceCallable()

public final UnaryCallable<ResetInstanceRequest,Operation> resetInstanceCallable()

Perform an ungraceful, hard reset on a server. Equivalent to shutting the power off and then turning it back on.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   ResetInstanceRequest request =
       ResetInstanceRequest.newBuilder()
           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
           .build();
   ApiFuture<Operation> future =
       bareMetalSolutionClient.resetInstanceCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<ResetInstanceRequest,Operation>

resetInstanceOperationCallable()

public final OperationCallable<ResetInstanceRequest,ResetInstanceResponse,OperationMetadata> resetInstanceOperationCallable()

Perform an ungraceful, hard reset on a server. Equivalent to shutting the power off and then turning it back on.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   ResetInstanceRequest request =
       ResetInstanceRequest.newBuilder()
           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
           .build();
   OperationFuture<ResetInstanceResponse, OperationMetadata> future =
       bareMetalSolutionClient.resetInstanceOperationCallable().futureCall(request);
   // Do something.
   ResetInstanceResponse response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<ResetInstanceRequest,ResetInstanceResponse,OperationMetadata>

resizeVolumeAsync(ResizeVolumeRequest request)

public final OperationFuture<Volume,OperationMetadata> resizeVolumeAsync(ResizeVolumeRequest request)

Emergency Volume resize.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   ResizeVolumeRequest request =
       ResizeVolumeRequest.newBuilder()
           .setVolume(VolumeName.of("[PROJECT]", "[LOCATION]", "[VOLUME]").toString())
           .setSizeGib(847296130)
           .build();
   Volume response = bareMetalSolutionClient.resizeVolumeAsync(request).get();
 }
 
Parameter
NameDescription
requestResizeVolumeRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<Volume,OperationMetadata>

resizeVolumeAsync(VolumeName volume, long sizeGib)

public final OperationFuture<Volume,OperationMetadata> resizeVolumeAsync(VolumeName volume, long sizeGib)

Emergency Volume resize.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   VolumeName volume = VolumeName.of("[PROJECT]", "[LOCATION]", "[VOLUME]");
   long sizeGib = 847296130;
   Volume response = bareMetalSolutionClient.resizeVolumeAsync(volume, sizeGib).get();
 }
 
Parameters
NameDescription
volumeVolumeName

Required. Volume to resize.

sizeGiblong

New Volume size, in GiB.

Returns
TypeDescription
OperationFuture<Volume,OperationMetadata>

resizeVolumeAsync(String volume, long sizeGib)

public final OperationFuture<Volume,OperationMetadata> resizeVolumeAsync(String volume, long sizeGib)

Emergency Volume resize.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   String volume = VolumeName.of("[PROJECT]", "[LOCATION]", "[VOLUME]").toString();
   long sizeGib = 847296130;
   Volume response = bareMetalSolutionClient.resizeVolumeAsync(volume, sizeGib).get();
 }
 
Parameters
NameDescription
volumeString

Required. Volume to resize.

sizeGiblong

New Volume size, in GiB.

Returns
TypeDescription
OperationFuture<Volume,OperationMetadata>

resizeVolumeCallable()

public final UnaryCallable<ResizeVolumeRequest,Operation> resizeVolumeCallable()

Emergency Volume resize.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   ResizeVolumeRequest request =
       ResizeVolumeRequest.newBuilder()
           .setVolume(VolumeName.of("[PROJECT]", "[LOCATION]", "[VOLUME]").toString())
           .setSizeGib(847296130)
           .build();
   ApiFuture<Operation> future =
       bareMetalSolutionClient.resizeVolumeCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<ResizeVolumeRequest,Operation>

resizeVolumeOperationCallable()

public final OperationCallable<ResizeVolumeRequest,Volume,OperationMetadata> resizeVolumeOperationCallable()

Emergency Volume resize.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   ResizeVolumeRequest request =
       ResizeVolumeRequest.newBuilder()
           .setVolume(VolumeName.of("[PROJECT]", "[LOCATION]", "[VOLUME]").toString())
           .setSizeGib(847296130)
           .build();
   OperationFuture<Volume, OperationMetadata> future =
       bareMetalSolutionClient.resizeVolumeOperationCallable().futureCall(request);
   // Do something.
   Volume response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<ResizeVolumeRequest,Volume,OperationMetadata>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

startInstanceAsync(InstanceName name)

public final OperationFuture<StartInstanceResponse,OperationMetadata> startInstanceAsync(InstanceName name)

Starts a server that was shutdown.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
   StartInstanceResponse response = bareMetalSolutionClient.startInstanceAsync(name).get();
 }
 
Parameter
NameDescription
nameInstanceName

Required. Name of the resource.

Returns
TypeDescription
OperationFuture<StartInstanceResponse,OperationMetadata>

startInstanceAsync(StartInstanceRequest request)

public final OperationFuture<StartInstanceResponse,OperationMetadata> startInstanceAsync(StartInstanceRequest request)

Starts a server that was shutdown.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   StartInstanceRequest request =
       StartInstanceRequest.newBuilder()
           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
           .build();
   StartInstanceResponse response = bareMetalSolutionClient.startInstanceAsync(request).get();
 }
 
Parameter
NameDescription
requestStartInstanceRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<StartInstanceResponse,OperationMetadata>

startInstanceAsync(String name)

public final OperationFuture<StartInstanceResponse,OperationMetadata> startInstanceAsync(String name)

Starts a server that was shutdown.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
   StartInstanceResponse response = bareMetalSolutionClient.startInstanceAsync(name).get();
 }
 
Parameter
NameDescription
nameString

Required. Name of the resource.

Returns
TypeDescription
OperationFuture<StartInstanceResponse,OperationMetadata>

startInstanceCallable()

public final UnaryCallable<StartInstanceRequest,Operation> startInstanceCallable()

Starts a server that was shutdown.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   StartInstanceRequest request =
       StartInstanceRequest.newBuilder()
           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
           .build();
   ApiFuture<Operation> future =
       bareMetalSolutionClient.startInstanceCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<StartInstanceRequest,Operation>

startInstanceOperationCallable()

public final OperationCallable<StartInstanceRequest,StartInstanceResponse,OperationMetadata> startInstanceOperationCallable()

Starts a server that was shutdown.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   StartInstanceRequest request =
       StartInstanceRequest.newBuilder()
           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
           .build();
   OperationFuture<StartInstanceResponse, OperationMetadata> future =
       bareMetalSolutionClient.startInstanceOperationCallable().futureCall(request);
   // Do something.
   StartInstanceResponse response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<StartInstanceRequest,StartInstanceResponse,OperationMetadata>

stopInstanceAsync(InstanceName name)

public final OperationFuture<StopInstanceResponse,OperationMetadata> stopInstanceAsync(InstanceName name)

Stop a running server.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
   StopInstanceResponse response = bareMetalSolutionClient.stopInstanceAsync(name).get();
 }
 
Parameter
NameDescription
nameInstanceName

Required. Name of the resource.

Returns
TypeDescription
OperationFuture<StopInstanceResponse,OperationMetadata>

stopInstanceAsync(StopInstanceRequest request)

public final OperationFuture<StopInstanceResponse,OperationMetadata> stopInstanceAsync(StopInstanceRequest request)

Stop a running server.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   StopInstanceRequest request =
       StopInstanceRequest.newBuilder()
           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
           .build();
   StopInstanceResponse response = bareMetalSolutionClient.stopInstanceAsync(request).get();
 }
 
Parameter
NameDescription
requestStopInstanceRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<StopInstanceResponse,OperationMetadata>

stopInstanceAsync(String name)

public final OperationFuture<StopInstanceResponse,OperationMetadata> stopInstanceAsync(String name)

Stop a running server.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
   StopInstanceResponse response = bareMetalSolutionClient.stopInstanceAsync(name).get();
 }
 
Parameter
NameDescription
nameString

Required. Name of the resource.

Returns
TypeDescription
OperationFuture<StopInstanceResponse,OperationMetadata>

stopInstanceCallable()

public final UnaryCallable<StopInstanceRequest,Operation> stopInstanceCallable()

Stop a running server.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   StopInstanceRequest request =
       StopInstanceRequest.newBuilder()
           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
           .build();
   ApiFuture<Operation> future =
       bareMetalSolutionClient.stopInstanceCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<StopInstanceRequest,Operation>

stopInstanceOperationCallable()

public final OperationCallable<StopInstanceRequest,StopInstanceResponse,OperationMetadata> stopInstanceOperationCallable()

Stop a running server.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   StopInstanceRequest request =
       StopInstanceRequest.newBuilder()
           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
           .build();
   OperationFuture<StopInstanceResponse, OperationMetadata> future =
       bareMetalSolutionClient.stopInstanceOperationCallable().futureCall(request);
   // Do something.
   StopInstanceResponse response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<StopInstanceRequest,StopInstanceResponse,OperationMetadata>

updateInstanceAsync(Instance instance, FieldMask updateMask)

public final OperationFuture<Instance,OperationMetadata> updateInstanceAsync(Instance instance, FieldMask updateMask)

Update details of a single server.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   Instance instance = Instance.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   Instance response = bareMetalSolutionClient.updateInstanceAsync(instance, updateMask).get();
 }
 
Parameters
NameDescription
instanceInstance

Required. The server to update.

The name field is used to identify the instance to update. Format: projects/{project}/locations/{location}/instances/{instance}

updateMaskFieldMask

The list of fields to update. The currently supported fields are: labels hyperthreading_enabled os_image

Returns
TypeDescription
OperationFuture<Instance,OperationMetadata>

updateInstanceAsync(UpdateInstanceRequest request)

public final OperationFuture<Instance,OperationMetadata> updateInstanceAsync(UpdateInstanceRequest request)

Update details of a single server.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   UpdateInstanceRequest request =
       UpdateInstanceRequest.newBuilder()
           .setInstance(Instance.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   Instance response = bareMetalSolutionClient.updateInstanceAsync(request).get();
 }
 
Parameter
NameDescription
requestUpdateInstanceRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<Instance,OperationMetadata>

updateInstanceCallable()

public final UnaryCallable<UpdateInstanceRequest,Operation> updateInstanceCallable()

Update details of a single server.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   UpdateInstanceRequest request =
       UpdateInstanceRequest.newBuilder()
           .setInstance(Instance.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ApiFuture<Operation> future =
       bareMetalSolutionClient.updateInstanceCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<UpdateInstanceRequest,Operation>

updateInstanceOperationCallable()

public final OperationCallable<UpdateInstanceRequest,Instance,OperationMetadata> updateInstanceOperationCallable()

Update details of a single server.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   UpdateInstanceRequest request =
       UpdateInstanceRequest.newBuilder()
           .setInstance(Instance.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   OperationFuture<Instance, OperationMetadata> future =
       bareMetalSolutionClient.updateInstanceOperationCallable().futureCall(request);
   // Do something.
   Instance response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<UpdateInstanceRequest,Instance,OperationMetadata>

updateNetworkAsync(Network network, FieldMask updateMask)

public final OperationFuture<Network,OperationMetadata> updateNetworkAsync(Network network, FieldMask updateMask)

Update details of a single network.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   Network network = Network.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   Network response = bareMetalSolutionClient.updateNetworkAsync(network, updateMask).get();
 }
 
Parameters
NameDescription
networkNetwork

Required. The network to update.

The name field is used to identify the instance to update. Format: projects/{project}/locations/{location}/networks/{network}

updateMaskFieldMask

The list of fields to update. The only currently supported fields are: labels, reservations

Returns
TypeDescription
OperationFuture<Network,OperationMetadata>

updateNetworkAsync(UpdateNetworkRequest request)

public final OperationFuture<Network,OperationMetadata> updateNetworkAsync(UpdateNetworkRequest request)

Update details of a single network.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   UpdateNetworkRequest request =
       UpdateNetworkRequest.newBuilder()
           .setNetwork(Network.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   Network response = bareMetalSolutionClient.updateNetworkAsync(request).get();
 }
 
Parameter
NameDescription
requestUpdateNetworkRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<Network,OperationMetadata>

updateNetworkCallable()

public final UnaryCallable<UpdateNetworkRequest,Operation> updateNetworkCallable()

Update details of a single network.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   UpdateNetworkRequest request =
       UpdateNetworkRequest.newBuilder()
           .setNetwork(Network.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ApiFuture<Operation> future =
       bareMetalSolutionClient.updateNetworkCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<UpdateNetworkRequest,Operation>

updateNetworkOperationCallable()

public final OperationCallable<UpdateNetworkRequest,Network,OperationMetadata> updateNetworkOperationCallable()

Update details of a single network.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   UpdateNetworkRequest request =
       UpdateNetworkRequest.newBuilder()
           .setNetwork(Network.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   OperationFuture<Network, OperationMetadata> future =
       bareMetalSolutionClient.updateNetworkOperationCallable().futureCall(request);
   // Do something.
   Network response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<UpdateNetworkRequest,Network,OperationMetadata>

updateNfsShareAsync(NfsShare nfsShare, FieldMask updateMask)

public final OperationFuture<NfsShare,OperationMetadata> updateNfsShareAsync(NfsShare nfsShare, FieldMask updateMask)

Update details of a single NFS share.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   NfsShare nfsShare = NfsShare.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   NfsShare response = bareMetalSolutionClient.updateNfsShareAsync(nfsShare, updateMask).get();
 }
 
Parameters
NameDescription
nfsShareNfsShare

Required. The NFS share to update.

The name field is used to identify the NFS share to update. Format: projects/{project}/locations/{location}/nfsShares/{nfs_share}

updateMaskFieldMask

The list of fields to update. The only currently supported fields are: labels

Returns
TypeDescription
OperationFuture<NfsShare,OperationMetadata>

updateNfsShareAsync(UpdateNfsShareRequest request)

public final OperationFuture<NfsShare,OperationMetadata> updateNfsShareAsync(UpdateNfsShareRequest request)

Update details of a single NFS share.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   UpdateNfsShareRequest request =
       UpdateNfsShareRequest.newBuilder()
           .setNfsShare(NfsShare.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   NfsShare response = bareMetalSolutionClient.updateNfsShareAsync(request).get();
 }
 
Parameter
NameDescription
requestUpdateNfsShareRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<NfsShare,OperationMetadata>

updateNfsShareCallable()

public final UnaryCallable<UpdateNfsShareRequest,Operation> updateNfsShareCallable()

Update details of a single NFS share.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   UpdateNfsShareRequest request =
       UpdateNfsShareRequest.newBuilder()
           .setNfsShare(NfsShare.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ApiFuture<Operation> future =
       bareMetalSolutionClient.updateNfsShareCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<UpdateNfsShareRequest,Operation>

updateNfsShareOperationCallable()

public final OperationCallable<UpdateNfsShareRequest,NfsShare,OperationMetadata> updateNfsShareOperationCallable()

Update details of a single NFS share.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   UpdateNfsShareRequest request =
       UpdateNfsShareRequest.newBuilder()
           .setNfsShare(NfsShare.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   OperationFuture<NfsShare, OperationMetadata> future =
       bareMetalSolutionClient.updateNfsShareOperationCallable().futureCall(request);
   // Do something.
   NfsShare response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<UpdateNfsShareRequest,NfsShare,OperationMetadata>

updateVolumeAsync(UpdateVolumeRequest request)

public final OperationFuture<Volume,OperationMetadata> updateVolumeAsync(UpdateVolumeRequest request)

Update details of a single storage volume.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   UpdateVolumeRequest request =
       UpdateVolumeRequest.newBuilder()
           .setVolume(Volume.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   Volume response = bareMetalSolutionClient.updateVolumeAsync(request).get();
 }
 
Parameter
NameDescription
requestUpdateVolumeRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<Volume,OperationMetadata>

updateVolumeAsync(Volume volume, FieldMask updateMask)

public final OperationFuture<Volume,OperationMetadata> updateVolumeAsync(Volume volume, FieldMask updateMask)

Update details of a single storage volume.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   Volume volume = Volume.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   Volume response = bareMetalSolutionClient.updateVolumeAsync(volume, updateMask).get();
 }
 
Parameters
NameDescription
volumeVolume

Required. The volume to update.

The name field is used to identify the volume to update. Format: projects/{project}/locations/{location}/volumes/{volume}

updateMaskFieldMask

The list of fields to update. The only currently supported fields are: snapshot_auto_delete_behavior snapshot_schedule_policy_name 'labels' 'snapshot_enabled' 'snapshot_reservation_detail.reserved_space_percent'

Returns
TypeDescription
OperationFuture<Volume,OperationMetadata>

updateVolumeCallable()

public final UnaryCallable<UpdateVolumeRequest,Operation> updateVolumeCallable()

Update details of a single storage volume.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   UpdateVolumeRequest request =
       UpdateVolumeRequest.newBuilder()
           .setVolume(Volume.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ApiFuture<Operation> future =
       bareMetalSolutionClient.updateVolumeCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<UpdateVolumeRequest,Operation>

updateVolumeOperationCallable()

public final OperationCallable<UpdateVolumeRequest,Volume,OperationMetadata> updateVolumeOperationCallable()

Update details of a single storage volume.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
   UpdateVolumeRequest request =
       UpdateVolumeRequest.newBuilder()
           .setVolume(Volume.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   OperationFuture<Volume, OperationMetadata> future =
       bareMetalSolutionClient.updateVolumeOperationCallable().futureCall(request);
   // Do something.
   Volume response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<UpdateVolumeRequest,Volume,OperationMetadata>