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:
- 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.
- 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.
- 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.
Implements
BackgroundResourceStatic Methods
create()
public static final BareMetalSolutionClient create()
Constructs an instance of BareMetalSolutionClient with default settings.
Returns | |
---|---|
Type | Description |
BareMetalSolutionClient |
Exceptions | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
settings | BareMetalSolutionSettings |
Returns | |
---|---|
Type | Description |
BareMetalSolutionClient |
Exceptions | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
stub | BareMetalSolutionStub |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
settings | BareMetalSolutionSettings |
BareMetalSolutionClient(BareMetalSolutionStub stub)
protected BareMetalSolutionClient(BareMetalSolutionStub stub)
Parameter | |
---|---|
Name | Description |
stub | BareMetalSolutionStub |
Methods
awaitTermination(long duration, TimeUnit unit)
public boolean awaitTermination(long duration, TimeUnit unit)
Parameters | |
---|---|
Name | Description |
duration | long |
unit | TimeUnit |
Returns | |
---|---|
Type | Description |
boolean |
Exceptions | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
request | DetachLunRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
instance | InstanceName Required. Name of the instance. |
lun | LunName Required. Name of the Lun to detach. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
instance | InstanceName Required. Name of the instance. |
lun | String Required. Name of the Lun to detach. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
instance | String Required. Name of the instance. |
lun | LunName Required. Name of the Lun to detach. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
instance | String Required. Name of the instance. |
lun | String Required. Name of the Lun to detach. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
request | GetInstanceRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
name | InstanceName Required. Name of the resource. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
name | String Required. Name of the resource. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
request | GetLunRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
name | LunName Required. Name of the resource. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
name | String Required. Name of the resource. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
request | GetNetworkRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
name | NetworkName Required. Name of the resource. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
name | String Required. Name of the resource. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
request | GetNfsShareRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
name | NFSShareName Required. Name of the resource. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
name | String Required. Name of the resource. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
OperationsClient |
getSettings()
public final BareMetalSolutionSettings getSettings()
Returns | |
---|---|
Type | Description |
BareMetalSolutionSettings |
getStub()
public BareMetalSolutionStub getStub()
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
request | GetVolumeRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
name | VolumeName Required. Name of the resource. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
name | String Required. Name of the resource. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
UnaryCallable<GetVolumeRequest,Volume> |
isShutdown()
public boolean isShutdown()
Returns | |
---|---|
Type | Description |
boolean |
isTerminated()
public boolean isTerminated()
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
request | ListInstancesRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
parent | LocationName Required. Parent value for ListInstancesRequest. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
parent | String Required. Parent value for ListInstancesRequest. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
request | ListLunsRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
parent | VolumeName Required. Parent value for ListLunsRequest. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
parent | String Required. Parent value for ListLunsRequest. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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()) {
ListNetw