Class BareMetalSolutionClient
- java.lang.Object
-
- com.google.cloud.baremetalsolution.v2.BareMetalSolutionClient
-
- All Implemented Interfaces:
com.google.api.gax.core.BackgroundResource
,AutoCloseable
@Generated("by gapic-generator-java") public class BareMetalSolutionClient extends Object implements com.google.api.gax.core.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.
-
-
Nested Class Summary
-
Constructor Summary
Constructors Modifier Constructor Description protected
BareMetalSolutionClient(BareMetalSolutionSettings settings)
Constructs an instance of BareMetalSolutionClient, using the given settings.protected
BareMetalSolutionClient(BareMetalSolutionStub stub)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
awaitTermination(long duration, TimeUnit unit)
void
close()
static BareMetalSolutionClient
create()
Constructs an instance of BareMetalSolutionClient with default settings.static BareMetalSolutionClient
create(BareMetalSolutionSettings settings)
Constructs an instance of BareMetalSolutionClient, using the given settings.static BareMetalSolutionClient
create(BareMetalSolutionStub stub)
Constructs an instance of BareMetalSolutionClient, using the given stub for making calls.com.google.api.gax.longrunning.OperationFuture<NfsShare,OperationMetadata>
createNfsShareAsync(CreateNfsShareRequest request)
Create an NFS share.com.google.api.gax.longrunning.OperationFuture<NfsShare,OperationMetadata>
createNfsShareAsync(LocationName parent, NfsShare nfsShare)
Create an NFS share.com.google.api.gax.longrunning.OperationFuture<NfsShare,OperationMetadata>
createNfsShareAsync(String parent, NfsShare nfsShare)
Create an NFS share.com.google.api.gax.rpc.UnaryCallable<CreateNfsShareRequest,com.google.longrunning.Operation>
createNfsShareCallable()
Create an NFS share.com.google.api.gax.rpc.OperationCallable<CreateNfsShareRequest,NfsShare,OperationMetadata>
createNfsShareOperationCallable()
Create an NFS share.ProvisioningConfig
createProvisioningConfig(CreateProvisioningConfigRequest request)
Create new ProvisioningConfig.ProvisioningConfig
createProvisioningConfig(LocationName parent, ProvisioningConfig provisioningConfig)
Create new ProvisioningConfig.ProvisioningConfig
createProvisioningConfig(String parent, ProvisioningConfig provisioningConfig)
Create new ProvisioningConfig.com.google.api.gax.rpc.UnaryCallable<CreateProvisioningConfigRequest,ProvisioningConfig>
createProvisioningConfigCallable()
Create new ProvisioningConfig.SSHKey
createSSHKey(CreateSSHKeyRequest request)
Register a public SSH key in the specified project for use with the interactive serial console feature.SSHKey
createSSHKey(LocationName parent, SSHKey sshKey, String sshKeyId)
Register a public SSH key in the specified project for use with the interactive serial console feature.SSHKey
createSSHKey(String parent, SSHKey sshKey, String sshKeyId)
Register a public SSH key in the specified project for use with the interactive serial console feature.com.google.api.gax.rpc.UnaryCallable<CreateSSHKeyRequest,SSHKey>
createSSHKeyCallable()
Register a public SSH key in the specified project for use with the interactive serial console feature.VolumeSnapshot
createVolumeSnapshot(CreateVolumeSnapshotRequest request)
Takes a snapshot of a boot volume.VolumeSnapshot
createVolumeSnapshot(VolumeName parent, VolumeSnapshot volumeSnapshot)
Takes a snapshot of a boot volume.VolumeSnapshot
createVolumeSnapshot(String parent, VolumeSnapshot volumeSnapshot)
Takes a snapshot of a boot volume.com.google.api.gax.rpc.UnaryCallable<CreateVolumeSnapshotRequest,VolumeSnapshot>
createVolumeSnapshotCallable()
Takes a snapshot of a boot volume.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata>
deleteNfsShareAsync(DeleteNfsShareRequest request)
Delete an NFS share.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata>
deleteNfsShareAsync(NFSShareName name)
Delete an NFS share.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata>
deleteNfsShareAsync(String name)
Delete an NFS share.com.google.api.gax.rpc.UnaryCallable<DeleteNfsShareRequest,com.google.longrunning.Operation>
deleteNfsShareCallable()
Delete an NFS share.com.google.api.gax.rpc.OperationCallable<DeleteNfsShareRequest,com.google.protobuf.Empty,OperationMetadata>
deleteNfsShareOperationCallable()
Delete an NFS share.void
deleteSSHKey(DeleteSSHKeyRequest request)
Deletes a public SSH key registered in the specified project.void
deleteSSHKey(SshKeyName name)
Deletes a public SSH key registered in the specified project.void
deleteSSHKey(String name)
Deletes a public SSH key registered in the specified project.com.google.api.gax.rpc.UnaryCallable<DeleteSSHKeyRequest,com.google.protobuf.Empty>
deleteSSHKeyCallable()
Deletes a public SSH key registered in the specified project.void
deleteVolumeSnapshot(DeleteVolumeSnapshotRequest request)
Deletes a volume snapshot.void
deleteVolumeSnapshot(VolumeSnapshotName name)
Deletes a volume snapshot.void
deleteVolumeSnapshot(String name)
Deletes a volume snapshot.com.google.api.gax.rpc.UnaryCallable<DeleteVolumeSnapshotRequest,com.google.protobuf.Empty>
deleteVolumeSnapshotCallable()
Deletes a volume snapshot.com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata>
detachLunAsync(DetachLunRequest request)
Detach LUN from Instance.com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata>
detachLunAsync(InstanceName instance, LunName lun)
Detach LUN from Instance.com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata>
detachLunAsync(InstanceName instance, String lun)
Detach LUN from Instance.com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata>
detachLunAsync(String instance, LunName lun)
Detach LUN from Instance.com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata>
detachLunAsync(String instance, String lun)
Detach LUN from Instance.com.google.api.gax.rpc.UnaryCallable<DetachLunRequest,com.google.longrunning.Operation>
detachLunCallable()
Detach LUN from Instance.com.google.api.gax.rpc.OperationCallable<DetachLunRequest,Instance,OperationMetadata>
detachLunOperationCallable()
Detach LUN from Instance.com.google.api.gax.longrunning.OperationFuture<DisableInteractiveSerialConsoleResponse,OperationMetadata>
disableInteractiveSerialConsoleAsync(DisableInteractiveSerialConsoleRequest request)
Disable the interactive serial console feature on an instance.com.google.api.gax.longrunning.OperationFuture<DisableInteractiveSerialConsoleResponse,OperationMetadata>
disableInteractiveSerialConsoleAsync(InstanceName name)
Disable the interactive serial console feature on an instance.com.google.api.gax.longrunning.OperationFuture<DisableInteractiveSerialConsoleResponse,OperationMetadata>
disableInteractiveSerialConsoleAsync(String name)
Disable the interactive serial console feature on an instance.com.google.api.gax.rpc.UnaryCallable<DisableInteractiveSerialConsoleRequest,com.google.longrunning.Operation>
disableInteractiveSerialConsoleCallable()
Disable the interactive serial console feature on an instance.com.google.api.gax.rpc.OperationCallable<DisableInteractiveSerialConsoleRequest,DisableInteractiveSerialConsoleResponse,OperationMetadata>
disableInteractiveSerialConsoleOperationCallable()
Disable the interactive serial console feature on an instance.com.google.api.gax.longrunning.OperationFuture<EnableInteractiveSerialConsoleResponse,OperationMetadata>
enableInteractiveSerialConsoleAsync(EnableInteractiveSerialConsoleRequest request)
Enable the interactive serial console feature on an instance.com.google.api.gax.longrunning.OperationFuture<EnableInteractiveSerialConsoleResponse,OperationMetadata>
enableInteractiveSerialConsoleAsync(InstanceName name)
Enable the interactive serial console feature on an instance.com.google.api.gax.longrunning.OperationFuture<EnableInteractiveSerialConsoleResponse,OperationMetadata>
enableInteractiveSerialConsoleAsync(String name)
Enable the interactive serial console feature on an instance.com.google.api.gax.rpc.UnaryCallable<EnableInteractiveSerialConsoleRequest,com.google.longrunning.Operation>
enableInteractiveSerialConsoleCallable()
Enable the interactive serial console feature on an instance.com.google.api.gax.rpc.OperationCallable<EnableInteractiveSerialConsoleRequest,EnableInteractiveSerialConsoleResponse,OperationMetadata>
enableInteractiveSerialConsoleOperationCallable()
Enable the interactive serial console feature on an instance.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata>
evictLunAsync(EvictLunRequest request)
Skips lun's cooloff and deletes it now.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata>
evictLunAsync(LunName name)
Skips lun's cooloff and deletes it now.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata>
evictLunAsync(String name)
Skips lun's cooloff and deletes it now.com.google.api.gax.rpc.UnaryCallable<EvictLunRequest,com.google.longrunning.Operation>
evictLunCallable()
Skips lun's cooloff and deletes it now.com.google.api.gax.rpc.OperationCallable<EvictLunRequest,com.google.protobuf.Empty,OperationMetadata>
evictLunOperationCallable()
Skips lun's cooloff and deletes it now.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata>
evictVolumeAsync(EvictVolumeRequest request)
Skips volume's cooloff and deletes it now.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata>
evictVolumeAsync(VolumeName name)
Skips volume's cooloff and deletes it now.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata>
evictVolumeAsync(String name)
Skips volume's cooloff and deletes it now.com.google.api.gax.rpc.UnaryCallable<EvictVolumeRequest,com.google.longrunning.Operation>
evictVolumeCallable()
Skips volume's cooloff and deletes it now.com.google.api.gax.rpc.OperationCallable<EvictVolumeRequest,com.google.protobuf.Empty,OperationMetadata>
evictVolumeOperationCallable()
Skips volume's cooloff and deletes it now.com.google.api.gax.httpjson.longrunning.OperationsClient
getHttpJsonOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.Instance
getInstance(GetInstanceRequest request)
Get details about a single server.Instance
getInstance(InstanceName name)
Get details about a single server.Instance
getInstance(String name)
Get details about a single server.com.google.api.gax.rpc.UnaryCallable<GetInstanceRequest,Instance>
getInstanceCallable()
Get details about a single server.com.google.cloud.location.Location
getLocation(com.google.cloud.location.GetLocationRequest request)
Gets information about a location.com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location>
getLocationCallable()
Gets information about a location.Lun
getLun(GetLunRequest request)
Get details of a single storage logical unit number(LUN).Lun
getLun(LunName name)
Get details of a single storage logical unit number(LUN).Lun
getLun(String name)
Get details of a single storage logical unit number(LUN).com.google.api.gax.rpc.UnaryCallable<GetLunRequest,Lun>
getLunCallable()
Get details of a single storage logical unit number(LUN).Network
getNetwork(GetNetworkRequest request)
Get details of a single network.Network
getNetwork(NetworkName name)
Get details of a single network.Network
getNetwork(String name)
Get details of a single network.com.google.api.gax.rpc.UnaryCallable<GetNetworkRequest,Network>
getNetworkCallable()
Get details of a single network.NfsShare
getNfsShare(GetNfsShareRequest request)
Get details of a single NFS share.NfsShare
getNfsShare(NFSShareName name)
Get details of a single NFS share.NfsShare
getNfsShare(String name)
Get details of a single NFS share.com.google.api.gax.rpc.UnaryCallable<GetNfsShareRequest,NfsShare>
getNfsShareCallable()
Get details of a single NFS share.com.google.longrunning.OperationsClient
getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.ProvisioningConfig
getProvisioningConfig(GetProvisioningConfigRequest request)
Get ProvisioningConfig by name.ProvisioningConfig
getProvisioningConfig(ProvisioningConfigName name)
Get ProvisioningConfig by name.ProvisioningConfig
getProvisioningConfig(String name)
Get ProvisioningConfig by name.com.google.api.gax.rpc.UnaryCallable<GetProvisioningConfigRequest,ProvisioningConfig>
getProvisioningConfigCallable()
Get ProvisioningConfig by name.BareMetalSolutionSettings
getSettings()
BareMetalSolutionStub
getStub()
Volume
getVolume(GetVolumeRequest request)
Get details of a single storage volume.Volume
getVolume(VolumeName name)
Get details of a single storage volume.Volume
getVolume(String name)
Get details of a single storage volume.com.google.api.gax.rpc.UnaryCallable<GetVolumeRequest,Volume>
getVolumeCallable()
Get details of a single storage volume.VolumeSnapshot
getVolumeSnapshot(GetVolumeSnapshotRequest request)
Returns the specified snapshot resource.VolumeSnapshot
getVolumeSnapshot(VolumeSnapshotName name)
Returns the specified snapshot resource.VolumeSnapshot
getVolumeSnapshot(String name)
Returns the specified snapshot resource.com.google.api.gax.rpc.UnaryCallable<GetVolumeSnapshotRequest,VolumeSnapshot>
getVolumeSnapshotCallable()
Returns the specified snapshot resource.boolean
isShutdown()
boolean
isTerminated()
BareMetalSolutionClient.ListInstancesPagedResponse
listInstances(ListInstancesRequest request)
List servers in a given project and location.BareMetalSolutionClient.ListInstancesPagedResponse
listInstances(LocationName parent)
List servers in a given project and location.BareMetalSolutionClient.ListInstancesPagedResponse
listInstances(String parent)
List servers in a given project and location.com.google.api.gax.rpc.UnaryCallable<ListInstancesRequest,ListInstancesResponse>
listInstancesCallable()
List servers in a given project and location.com.google.api.gax.rpc.UnaryCallable<ListInstancesRequest,BareMetalSolutionClient.ListInstancesPagedResponse>
listInstancesPagedCallable()
List servers in a given project and location.BareMetalSolutionClient.ListLocationsPagedResponse
listLocations(com.google.cloud.location.ListLocationsRequest request)
Lists information about the supported locations for this service.com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse>
listLocationsCallable()
Lists information about the supported locations for this service.com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,BareMetalSolutionClient.ListLocationsPagedResponse>
listLocationsPagedCallable()
Lists information about the supported locations for this service.BareMetalSolutionClient.ListLunsPagedResponse
listLuns(ListLunsRequest request)
List storage volume luns for given storage volume.BareMetalSolutionClient.ListLunsPagedResponse
listLuns(VolumeName parent)
List storage volume luns for given storage volume.BareMetalSolutionClient.ListLunsPagedResponse
listLuns(String parent)
List storage volume luns for given storage volume.com.google.api.gax.rpc.UnaryCallable<ListLunsRequest,ListLunsResponse>
listLunsCallable()
List storage volume luns for given storage volume.com.google.api.gax.rpc.UnaryCallable<ListLunsRequest,BareMetalSolutionClient.ListLunsPagedResponse>
listLunsPagedCallable()
List storage volume luns for given storage volume.BareMetalSolutionClient.ListNetworksPagedResponse
listNetworks(ListNetworksRequest request)
List network in a given project and location.BareMetalSolutionClient.ListNetworksPagedResponse
listNetworks(LocationName parent)
List network in a given project and location.BareMetalSolutionClient.ListNetworksPagedResponse
listNetworks(String parent)
List network in a given project and location.com.google.api.gax.rpc.UnaryCallable<ListNetworksRequest,ListNetworksResponse>
listNetworksCallable()
List network in a given project and location.com.google.api.gax.rpc.UnaryCallable<ListNetworksRequest,BareMetalSolutionClient.ListNetworksPagedResponse>
listNetworksPagedCallable()
List network in a given project and location.ListNetworkUsageResponse
listNetworkUsage(ListNetworkUsageRequest request)
List all Networks (and used IPs for each Network) in the vendor account associated with the specified project.ListNetworkUsageResponse
listNetworkUsage(LocationName location)
List all Networks (and used IPs for each Network) in the vendor account associated with the specified project.ListNetworkUsageResponse
listNetworkUsage(String location)
List all Networks (and used IPs for each Network) in the vendor account associated with the specified project.com.google.api.gax.rpc.UnaryCallable<ListNetworkUsageRequest,ListNetworkUsageResponse>
listNetworkUsageCallable()
List all Networks (and used IPs for each Network) in the vendor account associated with the specified project.BareMetalSolutionClient.ListNfsSharesPagedResponse
listNfsShares(ListNfsSharesRequest request)
List NFS shares.BareMetalSolutionClient.ListNfsSharesPagedResponse
listNfsShares(LocationName parent)
List NFS shares.BareMetalSolutionClient.ListNfsSharesPagedResponse
listNfsShares(String parent)
List NFS shares.com.google.api.gax.rpc.UnaryCallable<ListNfsSharesRequest,ListNfsSharesResponse>
listNfsSharesCallable()
List NFS shares.com.google.api.gax.rpc.UnaryCallable<ListNfsSharesRequest,BareMetalSolutionClient.ListNfsSharesPagedResponse>
listNfsSharesPagedCallable()
List NFS shares.BareMetalSolutionClient.ListOSImagesPagedResponse
listOSImages(ListOSImagesRequest request)
Retrieves the list of OS images which are currently approved.BareMetalSolutionClient.ListOSImagesPagedResponse
listOSImages(LocationName parent)
Retrieves the list of OS images which are currently approved.BareMetalSolutionClient.ListOSImagesPagedResponse
listOSImages(String parent)
Retrieves the list of OS images which are currently approved.com.google.api.gax.rpc.UnaryCallable<ListOSImagesRequest,ListOSImagesResponse>
listOSImagesCallable()
Retrieves the list of OS images which are currently approved.com.google.api.gax.rpc.UnaryCallable<ListOSImagesRequest,BareMetalSolutionClient.ListOSImagesPagedResponse>
listOSImagesPagedCallable()
Retrieves the list of OS images which are currently approved.BareMetalSolutionClient.ListProvisioningQuotasPagedResponse
listProvisioningQuotas(ListProvisioningQuotasRequest request)
List the budget details to provision resources on a given project.BareMetalSolutionClient.ListProvisioningQuotasPagedResponse
listProvisioningQuotas(LocationName parent)
List the budget details to provision resources on a given project.BareMetalSolutionClient.ListProvisioningQuotasPagedResponse
listProvisioningQuotas(String parent)
List the budget details to provision resources on a given project.com.google.api.gax.rpc.UnaryCallable<ListProvisioningQuotasRequest,ListProvisioningQuotasResponse>
listProvisioningQuotasCallable()
List the budget details to provision resources on a given project.com.google.api.gax.rpc.UnaryCallable<ListProvisioningQuotasRequest,BareMetalSolutionClient.ListProvisioningQuotasPagedResponse>
listProvisioningQuotasPagedCallable()
List the budget details to provision resources on a given project.BareMetalSolutionClient.ListSSHKeysPagedResponse
listSSHKeys(ListSSHKeysRequest request)
Lists the public SSH keys registered for the specified project.BareMetalSolutionClient.ListSSHKeysPagedResponse
listSSHKeys(LocationName parent)
Lists the public SSH keys registered for the specified project.BareMetalSolutionClient.ListSSHKeysPagedResponse
listSSHKeys(String parent)
Lists the public SSH keys registered for the specified project.com.google.api.gax.rpc.UnaryCallable<ListSSHKeysRequest,ListSSHKeysResponse>
listSSHKeysCallable()
Lists the public SSH keys registered for the specified project.com.google.api.gax.rpc.UnaryCallable<ListSSHKeysRequest,BareMetalSolutionClient.ListSSHKeysPagedResponse>
listSSHKeysPagedCallable()
Lists the public SSH keys registered for the specified project.BareMetalSolutionClient.ListVolumesPagedResponse
listVolumes(ListVolumesRequest request)
List storage volumes in a given project and location.BareMetalSolutionClient.ListVolumesPagedResponse
listVolumes(LocationName parent)
List storage volumes in a given project and location.BareMetalSolutionClient.ListVolumesPagedResponse
listVolumes(String parent)
List storage volumes in a given project and location.com.google.api.gax.rpc.UnaryCallable<ListVolumesRequest,ListVolumesResponse>
listVolumesCallable()
List storage volumes in a given project and location.BareMetalSolutionClient.ListVolumeSnapshotsPagedResponse
listVolumeSnapshots(ListVolumeSnapshotsRequest request)
Retrieves the list of snapshots for the specified volume.BareMetalSolutionClient.ListVolumeSnapshotsPagedResponse
listVolumeSnapshots(VolumeName parent)
Retrieves the list of snapshots for the specified volume.BareMetalSolutionClient.ListVolumeSnapshotsPagedResponse
listVolumeSnapshots(String parent)
Retrieves the list of snapshots for the specified volume.com.google.api.gax.rpc.UnaryCallable<ListVolumeSnapshotsRequest,ListVolumeSnapshotsResponse>
listVolumeSnapshotsCallable()
Retrieves the list of snapshots for the specified volume.com.google.api.gax.rpc.UnaryCallable<ListVolumeSnapshotsRequest,BareMetalSolutionClient.ListVolumeSnapshotsPagedResponse>
listVolumeSnapshotsPagedCallable()
Retrieves the list of snapshots for the specified volume.com.google.api.gax.rpc.UnaryCallable<ListVolumesRequest,BareMetalSolutionClient.ListVolumesPagedResponse>
listVolumesPagedCallable()
List storage volumes in a given project and location.Instance
renameInstance(InstanceName name, String newInstanceId)
RenameInstance sets a new name for an instance.Instance
renameInstance(RenameInstanceRequest request)
RenameInstance sets a new name for an instance.Instance
renameInstance(String name, String newInstanceId)
RenameInstance sets a new name for an instance.com.google.api.gax.rpc.UnaryCallable<RenameInstanceRequest,Instance>
renameInstanceCallable()
RenameInstance sets a new name for an instance.Network
renameNetwork(NetworkName name, String newNetworkId)
RenameNetwork sets a new name for a network.Network
renameNetwork(RenameNetworkRequest request)
RenameNetwork sets a new name for a network.Network
renameNetwork(String name, String newNetworkId)
RenameNetwork sets a new name for a network.com.google.api.gax.rpc.UnaryCallable<RenameNetworkRequest,Network>
renameNetworkCallable()
RenameNetwork sets a new name for a network.NfsShare
renameNfsShare(NFSShareName name, String newNfsshareId)
RenameNfsShare sets a new name for an nfsshare.NfsShare
renameNfsShare(RenameNfsShareRequest request)
RenameNfsShare sets a new name for an nfsshare.NfsShare
renameNfsShare(String name, String newNfsshareId)
RenameNfsShare sets a new name for an nfsshare.com.google.api.gax.rpc.UnaryCallable<RenameNfsShareRequest,NfsShare>
renameNfsShareCallable()
RenameNfsShare sets a new name for an nfsshare.Volume
renameVolume(RenameVolumeRequest request)
RenameVolume sets a new name for a volume.Volume
renameVolume(VolumeName name, String newVolumeId)
RenameVolume sets a new name for a volume.Volume
renameVolume(String name, String newVolumeId)
RenameVolume sets a new name for a volume.com.google.api.gax.rpc.UnaryCallable<RenameVolumeRequest,Volume>
renameVolumeCallable()
RenameVolume sets a new name for a volume.com.google.api.gax.longrunning.OperationFuture<ResetInstanceResponse,OperationMetadata>
resetInstanceAsync(InstanceName name)
Perform an ungraceful, hard reset on a server.com.google.api.gax.longrunning.OperationFuture<ResetInstanceResponse,OperationMetadata>
resetInstanceAsync(ResetInstanceRequest request)
Perform an ungraceful, hard reset on a server.com.google.api.gax.longrunning.OperationFuture<ResetInstanceResponse,OperationMetadata>
resetInstanceAsync(String name)
Perform an ungraceful, hard reset on a server.com.google.api.gax.rpc.UnaryCallable<ResetInstanceRequest,com.google.longrunning.Operation>
resetInstanceCallable()
Perform an ungraceful, hard reset on a server.com.google.api.gax.rpc.OperationCallable<ResetInstanceRequest,ResetInstanceResponse,OperationMetadata>
resetInstanceOperationCallable()
Perform an ungraceful, hard reset on a server.com.google.api.gax.longrunning.OperationFuture<Volume,OperationMetadata>
resizeVolumeAsync(ResizeVolumeRequest request)
Emergency Volume resize.com.google.api.gax.longrunning.OperationFuture<Volume,OperationMetadata>
resizeVolumeAsync(VolumeName volume, long sizeGib)
Emergency Volume resize.com.google.api.gax.longrunning.OperationFuture<Volume,OperationMetadata>
resizeVolumeAsync(String volume, long sizeGib)
Emergency Volume resize.com.google.api.gax.rpc.UnaryCallable<ResizeVolumeRequest,com.google.longrunning.Operation>
resizeVolumeCallable()
Emergency Volume resize.com.google.api.gax.rpc.OperationCallable<ResizeVolumeRequest,Volume,OperationMetadata>
resizeVolumeOperationCallable()
Emergency Volume resize.com.google.api.gax.longrunning.OperationFuture<VolumeSnapshot,OperationMetadata>
restoreVolumeSnapshotAsync(RestoreVolumeSnapshotRequest request)
Uses the specified snapshot to restore its parent volume.com.google.api.gax.longrunning.OperationFuture<VolumeSnapshot,OperationMetadata>
restoreVolumeSnapshotAsync(VolumeSnapshotName volumeSnapshot)
Uses the specified snapshot to restore its parent volume.com.google.api.gax.longrunning.OperationFuture<VolumeSnapshot,OperationMetadata>
restoreVolumeSnapshotAsync(String volumeSnapshot)
Uses the specified snapshot to restore its parent volume.com.google.api.gax.rpc.UnaryCallable<RestoreVolumeSnapshotRequest,com.google.longrunning.Operation>
restoreVolumeSnapshotCallable()
Uses the specified snapshot to restore its parent volume.com.google.api.gax.rpc.OperationCallable<RestoreVolumeSnapshotRequest,VolumeSnapshot,OperationMetadata>
restoreVolumeSnapshotOperationCallable()
Uses the specified snapshot to restore its parent volume.void
shutdown()
void
shutdownNow()
com.google.api.gax.longrunning.OperationFuture<StartInstanceResponse,OperationMetadata>
startInstanceAsync(InstanceName name)
Starts a server that was shutdown.com.google.api.gax.longrunning.OperationFuture<StartInstanceResponse,OperationMetadata>
startInstanceAsync(StartInstanceRequest request)
Starts a server that was shutdown.com.google.api.gax.longrunning.OperationFuture<StartInstanceResponse,OperationMetadata>
startInstanceAsync(String name)
Starts a server that was shutdown.com.google.api.gax.rpc.UnaryCallable<StartInstanceRequest,com.google.longrunning.Operation>
startInstanceCallable()
Starts a server that was shutdown.com.google.api.gax.rpc.OperationCallable<StartInstanceRequest,StartInstanceResponse,OperationMetadata>
startInstanceOperationCallable()
Starts a server that was shutdown.com.google.api.gax.longrunning.OperationFuture<StopInstanceResponse,OperationMetadata>
stopInstanceAsync(InstanceName name)
Stop a running server.com.google.api.gax.longrunning.OperationFuture<StopInstanceResponse,OperationMetadata>
stopInstanceAsync(StopInstanceRequest request)
Stop a running server.com.google.api.gax.longrunning.OperationFuture<StopInstanceResponse,OperationMetadata>
stopInstanceAsync(String name)
Stop a running server.com.google.api.gax.rpc.UnaryCallable<StopInstanceRequest,com.google.longrunning.Operation>
stopInstanceCallable()
Stop a running server.com.google.api.gax.rpc.OperationCallable<StopInstanceRequest,StopInstanceResponse,OperationMetadata>
stopInstanceOperationCallable()
Stop a running server.SubmitProvisioningConfigResponse
submitProvisioningConfig(LocationName parent, ProvisioningConfig provisioningConfig)
Submit a provisiong configuration for a given project.SubmitProvisioningConfigResponse
submitProvisioningConfig(SubmitProvisioningConfigRequest request)
Submit a provisiong configuration for a given project.SubmitProvisioningConfigResponse
submitProvisioningConfig(String parent, ProvisioningConfig provisioningConfig)
Submit a provisiong configuration for a given project.com.google.api.gax.rpc.UnaryCallable<SubmitProvisioningConfigRequest,SubmitProvisioningConfigResponse>
submitProvisioningConfigCallable()
Submit a provisiong configuration for a given project.com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata>
updateInstanceAsync(Instance instance, com.google.protobuf.FieldMask updateMask)
Update details of a single server.com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata>
updateInstanceAsync(UpdateInstanceRequest request)
Update details of a single server.com.google.api.gax.rpc.UnaryCallable<UpdateInstanceRequest,com.google.longrunning.Operation>
updateInstanceCallable()
Update details of a single server.com.google.api.gax.rpc.OperationCallable<UpdateInstanceRequest,Instance,OperationMetadata>
updateInstanceOperationCallable()
Update details of a single server.com.google.api.gax.longrunning.OperationFuture<Network,OperationMetadata>
updateNetworkAsync(Network network, com.google.protobuf.FieldMask updateMask)
Update details of a single network.com.google.api.gax.longrunning.OperationFuture<Network,OperationMetadata>
updateNetworkAsync(UpdateNetworkRequest request)
Update details of a single network.com.google.api.gax.rpc.UnaryCallable<UpdateNetworkRequest,com.google.longrunning.Operation>
updateNetworkCallable()
Update details of a single network.com.google.api.gax.rpc.OperationCallable<UpdateNetworkRequest,Network,OperationMetadata>
updateNetworkOperationCallable()
Update details of a single network.com.google.api.gax.longrunning.OperationFuture<NfsShare,OperationMetadata>
updateNfsShareAsync(NfsShare nfsShare, com.google.protobuf.FieldMask updateMask)
Update details of a single NFS share.com.google.api.gax.longrunning.OperationFuture<NfsShare,OperationMetadata>
updateNfsShareAsync(UpdateNfsShareRequest request)
Update details of a single NFS share.com.google.api.gax.rpc.UnaryCallable<UpdateNfsShareRequest,com.google.longrunning.Operation>
updateNfsShareCallable()
Update details of a single NFS share.com.google.api.gax.rpc.OperationCallable<UpdateNfsShareRequest,NfsShare,OperationMetadata>
updateNfsShareOperationCallable()
Update details of a single NFS share.ProvisioningConfig
updateProvisioningConfig(ProvisioningConfig provisioningConfig, com.google.protobuf.FieldMask updateMask)
Update existing ProvisioningConfig.ProvisioningConfig
updateProvisioningConfig(UpdateProvisioningConfigRequest request)
Update existing ProvisioningConfig.com.google.api.gax.rpc.UnaryCallable<UpdateProvisioningConfigRequest,ProvisioningConfig>
updateProvisioningConfigCallable()
Update existing ProvisioningConfig.com.google.api.gax.longrunning.OperationFuture<Volume,OperationMetadata>
updateVolumeAsync(UpdateVolumeRequest request)
Update details of a single storage volume.com.google.api.gax.longrunning.OperationFuture<Volume,OperationMetadata>
updateVolumeAsync(Volume volume, com.google.protobuf.FieldMask updateMask)
Update details of a single storage volume.com.google.api.gax.rpc.UnaryCallable<UpdateVolumeRequest,com.google.longrunning.Operation>
updateVolumeCallable()
Update details of a single storage volume.com.google.api.gax.rpc.OperationCallable<UpdateVolumeRequest,Volume,OperationMetadata>
updateVolumeOperationCallable()
Update details of a single storage volume.
-
-
-
Constructor Detail
-
BareMetalSolutionClient
protected BareMetalSolutionClient(BareMetalSolutionSettings settings) throws IOException
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.- Throws:
IOException
-
BareMetalSolutionClient
protected BareMetalSolutionClient(BareMetalSolutionStub stub)
-
-
Method Detail
-
create
public static final BareMetalSolutionClient create() throws IOException
Constructs an instance of BareMetalSolutionClient with default settings.- Throws:
IOException
-
create
public static final BareMetalSolutionClient create(BareMetalSolutionSettings settings) throws IOException
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.- Throws:
IOException
-
create
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).
-
getSettings
public final BareMetalSolutionSettings getSettings()
-
getStub
public BareMetalSolutionStub getStub()
-
getOperationsClient
public final com.google.longrunning.OperationsClient getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
-
getHttpJsonOperationsClient
@BetaApi public final com.google.api.gax.httpjson.longrunning.OperationsClient getHttpJsonOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
-
listInstances
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); } }
- Parameters:
parent
- Required. Parent value for ListInstancesRequest.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listInstances
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); } }
- Parameters:
parent
- Required. Parent value for ListInstancesRequest.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listInstances
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); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listInstancesPagedCallable
public final com.google.api.gax.rpc.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); } }
-
listInstancesCallable
public final com.google.api.gax.rpc.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; } } }
-
getInstance
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); }
- Parameters:
name
- Required. Name of the resource.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getInstance
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); }
- Parameters:
name
- Required. Name of the resource.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getInstance
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); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getInstanceCallable
public final com.google.api.gax.rpc.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(); }
-
updateInstanceAsync
public final com.google.api.gax.longrunning.OperationFuture<Instance,OperationMetadata> updateInstanceAsync(Instance instance, com.google.protobuf.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:
instance
- Required. The server to update.The `name` field is used to identify the instance to update. Format: projects/{project}/locations/{location}/instances/{instance}
updateMask
- The list of fields to update. The currently supported fields are: `labels` `hyperthreading_enabled` `os_image`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updateInstanceAsync
public final com.google.api.gax.longrunning.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(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updateInstanceOperationCallable
public final com.google.api.gax.rpc.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(); }
-
updateInstanceCallable
public final com.google.api.gax.rpc.UnaryCallable<UpdateInstanceRequest,com.google.longrunning.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(); }
-
renameInstance
public final Instance renameInstance(InstanceName name, String newInstanceId)
RenameInstance sets a new name for an instance. Use with caution, previous names become immediately invalidated.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]"); String newInstanceId = "newInstanceId1749535312"; Instance response = bareMetalSolutionClient.renameInstance(name, newInstanceId); }
- Parameters:
name
- Required. The `name` field is used to identify the instance. Format: projects/{project}/locations/{location}/instances/{instance}newInstanceId
- Required. The new `id` of the instance.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
renameInstance
public final Instance renameInstance(String name, String newInstanceId)
RenameInstance sets a new name for an instance. Use with caution, previous names become immediately invalidated.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(); String newInstanceId = "newInstanceId1749535312"; Instance response = bareMetalSolutionClient.renameInstance(name, newInstanceId); }
- Parameters:
name
- Required. The `name` field is used to identify the instance. Format: projects/{project}/locations/{location}/instances/{instance}newInstanceId
- Required. The new `id` of the instance.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
renameInstance
public final Instance renameInstance(RenameInstanceRequest request)
RenameInstance sets a new name for an instance. Use with caution, previous names become immediately invalidated.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()) { RenameInstanceRequest request = RenameInstanceRequest.newBuilder() .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) .setNewInstanceId("newInstanceId1749535312") .build(); Instance response = bareMetalSolutionClient.renameInstance(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
renameInstanceCallable
public final com.google.api.gax.rpc.UnaryCallable<RenameInstanceRequest,Instance> renameInstanceCallable()
RenameInstance sets a new name for an instance. Use with caution, previous names become immediately invalidated.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()) { RenameInstanceRequest request = RenameInstanceRequest.newBuilder() .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) .setNewInstanceId("newInstanceId1749535312") .build(); ApiFuture<Instance> future = bareMetalSolutionClient.renameInstanceCallable().futureCall(request); // Do something. Instance response = future.get(); }
-
resetInstanceAsync
public final com.google.api.gax.longrunning.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(); }
- Parameters:
name
- Required. Name of the resource.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
resetInstanceAsync
public final com.google.api.gax.longrunning.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(); }
- Parameters:
name
- Required. Name of the resource.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
resetInstanceAsync
public final com.google.api.gax.longrunning.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(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
resetInstanceOperationCallable
public final com.google.api.gax.rpc.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(); }
-
resetInstanceCallable
public final com.google.api.gax.rpc.UnaryCallable<ResetInstanceRequest,com.google.longrunning.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(); }
-
startInstanceAsync
public final com.google.api.gax.longrunning.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(); }
- Parameters:
name
- Required. Name of the resource.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
startInstanceAsync
public final com.google.api.gax.longrunning.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(); }
- Parameters:
name
- Required. Name of the resource.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
startInstanceAsync
public final com.google.api.gax.longrunning.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(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
startInstanceOperationCallable
public final com.google.api.gax.rpc.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(); }
-
startInstanceCallable
public final com.google.api.gax.rpc.UnaryCallable<StartInstanceRequest,com.google.longrunning.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(); }
-
stopInstanceAsync
public final com.google.api.gax.longrunning.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(); }
- Parameters:
name
- Required. Name of the resource.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
stopInstanceAsync
public final com.google.api.gax.longrunning.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(); }
- Parameters:
name
- Required. Name of the resource.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
stopInstanceAsync
public final com.google.api.gax.longrunning.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(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
stopInstanceOperationCallable
public final com.google.api.gax.rpc.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(); }
-
stopInstanceCallable
public final com.google.api.gax.rpc.UnaryCallable<StopInstanceRequest,com.google.longrunning.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(); }
-
enableInteractiveSerialConsoleAsync
public final com.google.api.gax.longrunning.OperationFuture<EnableInteractiveSerialConsoleResponse,OperationMetadata> enableInteractiveSerialConsoleAsync(InstanceName name)
Enable the interactive serial console feature on an 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 name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); EnableInteractiveSerialConsoleResponse response = bareMetalSolutionClient.enableInteractiveSerialConsoleAsync(name).get(); }
- Parameters:
name
- Required. Name of the resource.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
enableInteractiveSerialConsoleAsync
public final com.google.api.gax.longrunning.OperationFuture<EnableInteractiveSerialConsoleResponse,OperationMetadata> enableInteractiveSerialConsoleAsync(String name)
Enable the interactive serial console feature on an 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 name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString(); EnableInteractiveSerialConsoleResponse response = bareMetalSolutionClient.enableInteractiveSerialConsoleAsync(name).get(); }
- Parameters:
name
- Required. Name of the resource.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
enableInteractiveSerialConsoleAsync
public final com.google.api.gax.longrunning.OperationFuture<EnableInteractiveSerialConsoleResponse,OperationMetadata> enableInteractiveSerialConsoleAsync(EnableInteractiveSerialConsoleRequest request)
Enable the interactive serial console feature on an 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()) { EnableInteractiveSerialConsoleRequest request = EnableInteractiveSerialConsoleRequest.newBuilder() .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) .build(); EnableInteractiveSerialConsoleResponse response = bareMetalSolutionClient.enableInteractiveSerialConsoleAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
enableInteractiveSerialConsoleOperationCallable
public final com.google.api.gax.rpc.OperationCallable<EnableInteractiveSerialConsoleRequest,EnableInteractiveSerialConsoleResponse,OperationMetadata> enableInteractiveSerialConsoleOperationCallable()
Enable the interactive serial console feature on an 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()) { EnableInteractiveSerialConsoleRequest request = EnableInteractiveSerialConsoleRequest.newBuilder() .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) .build(); OperationFuture<EnableInteractiveSerialConsoleResponse, OperationMetadata> future = bareMetalSolutionClient .enableInteractiveSerialConsoleOperationCallable() .futureCall(request); // Do something. EnableInteractiveSerialConsoleResponse response = future.get(); }
-
enableInteractiveSerialConsoleCallable
public final com.google.api.gax.rpc.UnaryCallable<EnableInteractiveSerialConsoleRequest,com.google.longrunning.Operation> enableInteractiveSerialConsoleCallable()
Enable the interactive serial console feature on an 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()) { EnableInteractiveSerialConsoleRequest request = EnableInteractiveSerialConsoleRequest.newBuilder() .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) .build(); ApiFuture<Operation> future = bareMetalSolutionClient.enableInteractiveSerialConsoleCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
disableInteractiveSerialConsoleAsync
public final com.google.api.gax.longrunning.OperationFuture<DisableInteractiveSerialConsoleResponse,OperationMetadata> disableInteractiveSerialConsoleAsync(InstanceName name)
Disable the interactive serial console feature on an 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 name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); DisableInteractiveSerialConsoleResponse response = bareMetalSolutionClient.disableInteractiveSerialConsoleAsync(name).get(); }
- Parameters:
name
- Required. Name of the resource.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
disableInteractiveSerialConsoleAsync
public final com.google.api.gax.longrunning.OperationFuture<DisableInteractiveSerialConsoleResponse,OperationMetadata> disableInteractiveSerialConsoleAsync(String name)
Disable the interactive serial console feature on an 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 name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString(); DisableInteractiveSerialConsoleResponse response = bareMetalSolutionClient.disableInteractiveSerialConsoleAsync(name).get(); }
- Parameters:
name
- Required. Name of the resource.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
disableInteractiveSerialConsoleAsync
public final com.google.api.gax.longrunning.OperationFuture<DisableInteractiveSerialConsoleResponse,OperationMetadata> disableInteractiveSerialConsoleAsync(DisableInteractiveSerialConsoleRequest request)
Disable the interactive serial console feature on an 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()) { DisableInteractiveSerialConsoleRequest request = DisableInteractiveSerialConsoleRequest.newBuilder() .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) .build(); DisableInteractiveSerialConsoleResponse response = bareMetalSolutionClient.disableInteractiveSerialConsoleAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
disableInteractiveSerialConsoleOperationCallable
public final com.google.api.gax.rpc.OperationCallable<DisableInteractiveSerialConsoleRequest,DisableInteractiveSerialConsoleResponse,OperationMetadata> disableInteractiveSerialConsoleOperationCallable()
Disable the interactive serial console feature on an 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()) { DisableInteractiveSerialConsoleRequest request = DisableInteractiveSerialConsoleRequest.newBuilder() .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) .build(); OperationFuture<DisableInteractiveSerialConsoleResponse, OperationMetadata> future = bareMetalSolutionClient .disableInteractiveSerialConsoleOperationCallable() .futureCall(request); // Do something. DisableInteractiveSerialConsoleResponse response = future.get(); }
-
disableInteractiveSerialConsoleCallable
public final com.google.api.gax.rpc.UnaryCallable<DisableInteractiveSerialConsoleRequest,com.google.longrunning.Operation> disableInteractiveSerialConsoleCallable()
Disable the interactive serial console feature on an 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()) { DisableInteractiveSerialConsoleRequest request = DisableInteractiveSerialConsoleRequest.newBuilder() .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) .build(); ApiFuture<Operation> future = bareMetalSolutionClient.disableInteractiveSerialConsoleCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
detachLunAsync
public final com.google.api.gax.longrunning.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:
instance
- Required. Name of the instance.lun
- Required. Name of the Lun to detach.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
detachLunAsync
public final com.google.api.gax.longrunning.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:
instance
- Required. Name of the instance.lun
- Required. Name of the Lun to detach.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
detachLunAsync
public final com.google.api.gax.longrunning.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:
instance
- Required. Name of the instance.lun
- Required. Name of the Lun to detach.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
detachLunAsync
public final com.google.api.gax.longrunning.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:
instance
- Required. Name of the instance.lun
- Required. Name of the Lun to detach.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
detachLunAsync
public final com.google.api.gax.longrunning.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()) .setSkipReboot(true) .build(); Instance response = bareMetalSolutionClient.detachLunAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
detachLunOperationCallable
public final com.google.api.gax.rpc.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()) .setSkipReboot(true) .build(); OperationFuture<Instance, OperationMetadata> future = bareMetalSolutionClient.detachLunOperationCallable().futureCall(request); // Do something. Instance response = future.get(); }
-
detachLunCallable
public final com.google.api.gax.rpc.UnaryCallable<DetachLunRequest,com.google.longrunning.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()) .setSkipReboot(true) .build(); ApiFuture<Operation> future = bareMetalSolutionClient.detachLunCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
listSSHKeys
public final BareMetalSolutionClient.ListSSHKeysPagedResponse listSSHKeys(LocationName parent)
Lists the public SSH keys registered for the specified project. These SSH keys are used only for the interactive serial console feature.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 (SSHKey element : bareMetalSolutionClient.listSSHKeys(parent).iterateAll()) { // doThingsWith(element); } }
- Parameters:
parent
- Required. The parent containing the SSH keys. Currently, the only valid value for the location is "global".- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listSSHKeys
public final BareMetalSolutionClient.ListSSHKeysPagedResponse listSSHKeys(String parent)
Lists the public SSH keys registered for the specified project. These SSH keys are used only for the interactive serial console feature.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 (SSHKey element : bareMetalSolutionClient.listSSHKeys(parent).iterateAll()) { // doThingsWith(element); } }
- Parameters:
parent
- Required. The parent containing the SSH keys. Currently, the only valid value for the location is "global".- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listSSHKeys
public final BareMetalSolutionClient.ListSSHKeysPagedResponse listSSHKeys(ListSSHKeysRequest request)
Lists the public SSH keys registered for the specified project. These SSH keys are used only for the interactive serial console feature.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()) { ListSSHKeysRequest request = ListSSHKeysRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (SSHKey element : bareMetalSolutionClient.listSSHKeys(request).iterateAll()) { // doThingsWith(element); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listSSHKeysPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<ListSSHKeysRequest,BareMetalSolutionClient.ListSSHKeysPagedResponse> listSSHKeysPagedCallable()
Lists the public SSH keys registered for the specified project. These SSH keys are used only for the interactive serial console feature.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()) { ListSSHKeysRequest request = ListSSHKeysRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<SSHKey> future = bareMetalSolutionClient.listSSHKeysPagedCallable().futureCall(request); // Do something. for (SSHKey element : future.get().iterateAll()) { // doThingsWith(element); } }
-
listSSHKeysCallable
public final com.google.api.gax.rpc.UnaryCallable<ListSSHKeysRequest,ListSSHKeysResponse> listSSHKeysCallable()
Lists the public SSH keys registered for the specified project. These SSH keys are used only for the interactive serial console feature.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()) { ListSSHKeysRequest request = ListSSHKeysRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListSSHKeysResponse response = bareMetalSolutionClient.listSSHKeysCallable().call(request); for (SSHKey element : response.getSshKeysList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } }
-
createSSHKey
public final SSHKey createSSHKey(LocationName parent, SSHKey sshKey, String sshKeyId)
Register a public SSH key in the specified project for use with the interactive serial console feature.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]"); SSHKey sshKey = SSHKey.newBuilder().build(); String sshKeyId = "sshKeyId593257138"; SSHKey response = bareMetalSolutionClient.createSSHKey(parent, sshKey, sshKeyId); }
- Parameters:
parent
- Required. The parent containing the SSH keys.sshKey
- Required. The SSH key to register.sshKeyId
- Required. The ID to use for the key, which will become the final component of the key's resource name.This value must match the regex: [a-zA-Z0-9@.\\-_]{1,64}
- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createSSHKey
public final SSHKey createSSHKey(String parent, SSHKey sshKey, String sshKeyId)
Register a public SSH key in the specified project for use with the interactive serial console feature.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(); SSHKey sshKey = SSHKey.newBuilder().build(); String sshKeyId = "sshKeyId593257138"; SSHKey response = bareMetalSolutionClient.createSSHKey(parent, sshKey, sshKeyId); }
- Parameters:
parent
- Required. The parent containing the SSH keys.sshKey
- Required. The SSH key to register.sshKeyId
- Required. The ID to use for the key, which will become the final component of the key's resource name.This value must match the regex: [a-zA-Z0-9@.\\-_]{1,64}
- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createSSHKey
public final SSHKey createSSHKey(CreateSSHKeyRequest request)
Register a public SSH key in the specified project for use with the interactive serial console feature.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()) { CreateSSHKeyRequest request = CreateSSHKeyRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setSshKey(SSHKey.newBuilder().build()) .setSshKeyId("sshKeyId593257138") .build(); SSHKey response = bareMetalSolutionClient.createSSHKey(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createSSHKeyCallable
public final com.google.api.gax.rpc.UnaryCallable<CreateSSHKeyRequest,SSHKey> createSSHKeyCallable()
Register a public SSH key in the specified project for use with the interactive serial console feature.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()) { CreateSSHKeyRequest request = CreateSSHKeyRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setSshKey(SSHKey.newBuilder().build()) .setSshKeyId("sshKeyId593257138") .build(); ApiFuture<SSHKey> future = bareMetalSolutionClient.createSSHKeyCallable().futureCall(request); // Do something. SSHKey response = future.get(); }
-
deleteSSHKey
public final void deleteSSHKey(SshKeyName name)
Deletes a public SSH key registered in 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()) { SshKeyName name = SshKeyName.of("[PROJECT]", "[LOCATION]", "[SSH_KEY]"); bareMetalSolutionClient.deleteSSHKey(name); }
- Parameters:
name
- Required. The name of the SSH key to delete. Currently, the only valid value for the location is "global".- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteSSHKey
public final void deleteSSHKey(String name)
Deletes a public SSH key registered in 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 name = SshKeyName.of("[PROJECT]", "[LOCATION]", "[SSH_KEY]").toString(); bareMetalSolutionClient.deleteSSHKey(name); }
- Parameters:
name
- Required. The name of the SSH key to delete. Currently, the only valid value for the location is "global".- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteSSHKey
public final void deleteSSHKey(DeleteSSHKeyRequest request)
Deletes a public SSH key registered in 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()) { DeleteSSHKeyRequest request = DeleteSSHKeyRequest.newBuilder() .setName(SshKeyName.of("[PROJECT]", "[LOCATION]", "[SSH_KEY]").toString()) .build(); bareMetalSolutionClient.deleteSSHKey(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteSSHKeyCallable
public final com.google.api.gax.rpc.UnaryCallable<DeleteSSHKeyRequest,com.google.protobuf.Empty> deleteSSHKeyCallable()
Deletes a public SSH key registered in 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()) { DeleteSSHKeyRequest request = DeleteSSHKeyRequest.newBuilder() .setName(SshKeyName.of("[PROJECT]", "[LOCATION]", "[SSH_KEY]").toString()) .build(); ApiFuture<Empty> future = bareMetalSolutionClient.deleteSSHKeyCallable().futureCall(request); // Do something. future.get(); }
-
listVolumes
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); } }
- Parameters:
parent
- Required. Parent value for ListVolumesRequest.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listVolumes
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); } }
- Parameters:
parent
- Required. Parent value for ListVolumesRequest.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listVolumes
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); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listVolumesPagedCallable
public final com.google.api.gax.rpc.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); } }
-
listVolumesCallable
public final com.google.api.gax.rpc.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; } } }
-
getVolume
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); }
- Parameters:
name
- Required. Name of the resource.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getVolume
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); }
- Parameters:
name
- Required. Name of the resource.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getVolume
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); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getVolumeCallable
public final com.google.api.gax.rpc.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(); }
-
updateVolumeAsync
public final com.google.api.gax.longrunning.OperationFuture<Volume,OperationMetadata> updateVolumeAsync(Volume volume, com.google.protobuf.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:
volume
- Required. The volume to update.The `name` field is used to identify the volume to update. Format: projects/{project}/locations/{location}/volumes/{volume}
updateMask
- The list of fields to update. The only currently supported fields are: 'labels'- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updateVolumeAsync
public final com.google.api.gax.longrunning.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(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updateVolumeOperationCallable
public final com.google.api.gax.rpc.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(); }
-
updateVolumeCallable
public final com.google.api.gax.rpc.UnaryCallable<UpdateVolumeRequest,com.google.longrunning.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(); }
-
renameVolume
public final Volume renameVolume(VolumeName name, String newVolumeId)
RenameVolume sets a new name for a volume. Use with caution, previous names become immediately invalidated.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]"); String newVolumeId = "newVolumeId-613023851"; Volume response = bareMetalSolutionClient.renameVolume(name, newVolumeId); }
- Parameters:
name
- Required. The `name` field is used to identify the volume. Format: projects/{project}/locations/{location}/volumes/{volume}newVolumeId
- Required. The new `id` of the volume.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
renameVolume
public final Volume renameVolume(String name, String newVolumeId)
RenameVolume sets a new name for a volume. Use with caution, previous names become immediately invalidated.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(); String newVolumeId = "newVolumeId-613023851"; Volume response = bareMetalSolutionClient.renameVolume(name, newVolumeId); }
- Parameters:
name
- Required. The `name` field is used to identify the volume. Format: projects/{project}/locations/{location}/volumes/{volume}newVolumeId
- Required. The new `id` of the volume.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
renameVolume
public final Volume renameVolume(RenameVolumeRequest request)
RenameVolume sets a new name for a volume. Use with caution, previous names become immediately invalidated.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()) { RenameVolumeRequest request = RenameVolumeRequest.newBuilder() .setName(VolumeName.of("[PROJECT]", "[LOCATION]", "[VOLUME]").toString()) .setNewVolumeId("newVolumeId-613023851") .build(); Volume response = bareMetalSolutionClient.renameVolume(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
renameVolumeCallable
public final com.google.api.gax.rpc.UnaryCallable<RenameVolumeRequest,Volume> renameVolumeCallable()
RenameVolume sets a new name for a volume. Use with caution, previous names become immediately invalidated.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()) { RenameVolumeRequest request = RenameVolumeRequest.newBuilder() .setName(VolumeName.of("[PROJECT]", "[LOCATION]", "[VOLUME]").toString()) .setNewVolumeId("newVolumeId-613023851") .build(); ApiFuture<Volume> future = bareMetalSolutionClient.renameVolumeCallable().futureCall(request); // Do something. Volume response = future.get(); }
-
evictVolumeAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> evictVolumeAsync(VolumeName name)
Skips volume's cooloff and deletes it now. Volume must be in cooloff state.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]"); bareMetalSolutionClient.evictVolumeAsync(name).get(); }
- Parameters:
name
- Required. The name of the Volume.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
evictVolumeAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> evictVolumeAsync(String name)
Skips volume's cooloff and deletes it now. Volume must be in cooloff state.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(); bareMetalSolutionClient.evictVolumeAsync(name).get(); }
- Parameters:
name
- Required. The name of the Volume.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
evictVolumeAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> evictVolumeAsync(EvictVolumeRequest request)
Skips volume's cooloff and deletes it now. Volume must be in cooloff state.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()) { EvictVolumeRequest request = EvictVolumeRequest.newBuilder() .setName(VolumeName.of("[PROJECT]", "[LOCATION]", "[VOLUME]").toString()) .build(); bareMetalSolutionClient.evictVolumeAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
evictVolumeOperationCallable
public final com.google.api.gax.rpc.OperationCallable<EvictVolumeRequest,com.google.protobuf.Empty,OperationMetadata> evictVolumeOperationCallable()
Skips volume's cooloff and deletes it now. Volume must be in cooloff state.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()) { EvictVolumeRequest request = EvictVolumeRequest.newBuilder() .setName(VolumeName.of("[PROJECT]", "[LOCATION]", "[VOLUME]").toString()) .build(); OperationFuture<Empty, OperationMetadata> future = bareMetalSolutionClient.evictVolumeOperationCallable().futureCall(request); // Do something. future.get(); }
-
evictVolumeCallable
public final com.google.api.gax.rpc.UnaryCallable<EvictVolumeRequest,com.google.longrunning.Operation> evictVolumeCallable()
Skips volume's cooloff and deletes it now. Volume must be in cooloff state.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()) { EvictVolumeRequest request = EvictVolumeRequest.newBuilder() .setName(VolumeName.of("[PROJECT]", "[LOCATION]", "[VOLUME]").toString()) .build(); ApiFuture<Operation> future = bareMetalSolutionClient.evictVolumeCallable().futureCall(request); // Do something. future.get(); }
-
resizeVolumeAsync
public final com.google.api.gax.longrunning.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:
volume
- Required. Volume to resize.sizeGib
- New Volume size, in GiB.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
resizeVolumeAsync
public final com.google.api.gax.longrunning.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:
volume
- Required. Volume to resize.sizeGib
- New Volume size, in GiB.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
resizeVolumeAsync
public final com.google.api.gax.longrunning.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(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
resizeVolumeOperationCallable
public final com.google.api.gax.rpc.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(); }
-
resizeVolumeCallable
public final com.google.api.gax.rpc.UnaryCallable<ResizeVolumeRequest,com.google.longrunning.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(); }
-
listNetworks
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); } }
- Parameters:
parent
- Required. Parent value for ListNetworksRequest.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listNetworks
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); } }
- Parameters:
parent
- Required. Parent value for ListNetworksRequest.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listNetworks
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); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listNetworksPagedCallable
public final com.google.api.gax.rpc.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); } }
-
listNetworksCallable
public final com.google.api.gax.rpc.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; } } }
-
listNetworkUsage
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); }
- Parameters:
location
- Required. Parent value (project and location).- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listNetworkUsage
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); }
- Parameters:
location
- Required. Parent value (project and location).- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listNetworkUsage
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); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listNetworkUsageCallable
public final com.google.api.gax.rpc.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(); }
-
getNetwork
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); }
- Parameters:
name
- Required. Name of the resource.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getNetwork
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); }
- Parameters:
name
- Required. Name of the resource.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getNetwork
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); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getNetworkCallable
public final com.google.api.gax.rpc.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(); }
-
updateNetworkAsync
public final com.google.api.gax.longrunning.OperationFuture<Network,OperationMetadata> updateNetworkAsync(Network network, com.google.protobuf.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:
network
- Required. The network to update.The `name` field is used to identify the instance to update. Format: projects/{project}/locations/{location}/networks/{network}
updateMask
- The list of fields to update. The only currently supported fields are: `labels`, `reservations`, `vrf.vlan_attachments`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updateNetworkAsync
public final com.google.api.gax.longrunning.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(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updateNetworkOperationCallable
public final com.google.api.gax.rpc.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(); }
-
updateNetworkCallable
public final com.google.api.gax.rpc.UnaryCallable<UpdateNetworkRequest,com.google.longrunning.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(); }
-
createVolumeSnapshot
public final VolumeSnapshot createVolumeSnapshot(VolumeName parent, VolumeSnapshot volumeSnapshot)
Takes a snapshot of a boot volume. Returns INVALID_ARGUMENT if called for a non-boot 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]"); VolumeSnapshot volumeSnapshot = VolumeSnapshot.newBuilder().build(); VolumeSnapshot response = bareMetalSolutionClient.createVolumeSnapshot(parent, volumeSnapshot); }
- Parameters:
parent
- Required. The volume to snapshot.volumeSnapshot
- Required. The snapshot to create.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createVolumeSnapshot
public final VolumeSnapshot createVolumeSnapshot(String parent, VolumeSnapshot volumeSnapshot)
Takes a snapshot of a boot volume. Returns INVALID_ARGUMENT if called for a non-boot 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(); VolumeSnapshot volumeSnapshot = VolumeSnapshot.newBuilder().build(); VolumeSnapshot response = bareMetalSolutionClient.createVolumeSnapshot(parent, volumeSnapshot); }
- Parameters:
parent
- Required. The volume to snapshot.volumeSnapshot
- Required. The snapshot to create.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createVolumeSnapshot
public final VolumeSnapshot createVolumeSnapshot(CreateVolumeSnapshotRequest request)
Takes a snapshot of a boot volume. Returns INVALID_ARGUMENT if called for a non-boot 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()) { CreateVolumeSnapshotRequest request = CreateVolumeSnapshotRequest.newBuilder() .setParent(VolumeName.of("[PROJECT]", "[LOCATION]", "[VOLUME]").toString()) .setVolumeSnapshot(VolumeSnapshot.newBuilder().build()) .build(); VolumeSnapshot response = bareMetalSolutionClient.createVolumeSnapshot(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createVolumeSnapshotCallable
public final com.google.api.gax.rpc.UnaryCallable<CreateVolumeSnapshotRequest,VolumeSnapshot> createVolumeSnapshotCallable()
Takes a snapshot of a boot volume. Returns INVALID_ARGUMENT if called for a non-boot 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()) { CreateVolumeSnapshotRequest request = CreateVolumeSnapshotRequest.newBuilder() .setParent(VolumeName.of("[PROJECT]", "[LOCATION]", "[VOLUME]").toString()) .setVolumeSnapshot(VolumeSnapshot.newBuilder().build()) .build(); ApiFuture<VolumeSnapshot> future = bareMetalSolutionClient.createVolumeSnapshotCallable().futureCall(request); // Do something. VolumeSnapshot response = future.get(); }
-
restoreVolumeSnapshotAsync
public final com.google.api.gax.longrunning.OperationFuture<VolumeSnapshot,OperationMetadata> restoreVolumeSnapshotAsync(VolumeSnapshotName volumeSnapshot)
Uses the specified snapshot to restore its parent volume. Returns INVALID_ARGUMENT if called for a non-boot 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()) { VolumeSnapshotName volumeSnapshot = VolumeSnapshotName.of("[PROJECT]", "[LOCATION]", "[VOLUME]", "[SNAPSHOT]"); VolumeSnapshot response = bareMetalSolutionClient.restoreVolumeSnapshotAsync(volumeSnapshot).get(); }
- Parameters:
volumeSnapshot
- Required. Name of the snapshot which will be used to restore its parent volume.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
restoreVolumeSnapshotAsync
public final com.google.api.gax.longrunning.OperationFuture<VolumeSnapshot,OperationMetadata> restoreVolumeSnapshotAsync(String volumeSnapshot)
Uses the specified snapshot to restore its parent volume. Returns INVALID_ARGUMENT if called for a non-boot 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 volumeSnapshot = VolumeSnapshotName.of("[PROJECT]", "[LOCATION]", "[VOLUME]", "[SNAPSHOT]").toString(); VolumeSnapshot response = bareMetalSolutionClient.restoreVolumeSnapshotAsync(volumeSnapshot).get(); }
- Parameters:
volumeSnapshot
- Required. Name of the snapshot which will be used to restore its parent volume.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
restoreVolumeSnapshotAsync
public final com.google.api.gax.longrunning.OperationFuture<VolumeSnapshot,OperationMetadata> restoreVolumeSnapshotAsync(RestoreVolumeSnapshotRequest request)
Uses the specified snapshot to restore its parent volume. Returns INVALID_ARGUMENT if called for a non-boot 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()) { RestoreVolumeSnapshotRequest request = RestoreVolumeSnapshotRequest.newBuilder() .setVolumeSnapshot( VolumeSnapshotName.of("[PROJECT]", "[LOCATION]", "[VOLUME]", "[SNAPSHOT]") .toString()) .build(); VolumeSnapshot response = bareMetalSolutionClient.restoreVolumeSnapshotAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
restoreVolumeSnapshotOperationCallable
public final com.google.api.gax.rpc.OperationCallable<RestoreVolumeSnapshotRequest,VolumeSnapshot,OperationMetadata> restoreVolumeSnapshotOperationCallable()
Uses the specified snapshot to restore its parent volume. Returns INVALID_ARGUMENT if called for a non-boot 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()) { RestoreVolumeSnapshotRequest request = RestoreVolumeSnapshotRequest.newBuilder() .setVolumeSnapshot( VolumeSnapshotName.of("[PROJECT]", "[LOCATION]", "[VOLUME]", "[SNAPSHOT]") .toString()) .build(); OperationFuture<VolumeSnapshot, OperationMetadata> future = bareMetalSolutionClient.restoreVolumeSnapshotOperationCallable().futureCall(request); // Do something. VolumeSnapshot response = future.get(); }
-
restoreVolumeSnapshotCallable
public final com.google.api.gax.rpc.UnaryCallable<RestoreVolumeSnapshotRequest,com.google.longrunning.Operation> restoreVolumeSnapshotCallable()
Uses the specified snapshot to restore its parent volume. Returns INVALID_ARGUMENT if called for a non-boot 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()) { RestoreVolumeSnapshotRequest request = RestoreVolumeSnapshotRequest.newBuilder() .setVolumeSnapshot( VolumeSnapshotName.of("[PROJECT]", "[LOCATION]", "[VOLUME]", "[SNAPSHOT]") .toString()) .build(); ApiFuture<Operation> future = bareMetalSolutionClient.restoreVolumeSnapshotCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
deleteVolumeSnapshot
public final void deleteVolumeSnapshot(VolumeSnapshotName name)
Deletes a volume snapshot. Returns INVALID_ARGUMENT if called for a non-boot 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()) { VolumeSnapshotName name = VolumeSnapshotName.of("[PROJECT]", "[LOCATION]", "[VOLUME]", "[SNAPSHOT]"); bareMetalSolutionClient.deleteVolumeSnapshot(name); }
- Parameters:
name
- Required. The name of the snapshot to delete.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteVolumeSnapshot
public final void deleteVolumeSnapshot(String name)
Deletes a volume snapshot. Returns INVALID_ARGUMENT if called for a non-boot 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 = VolumeSnapshotName.of("[PROJECT]", "[LOCATION]", "[VOLUME]", "[SNAPSHOT]").toString(); bareMetalSolutionClient.deleteVolumeSnapshot(name); }
- Parameters:
name
- Required. The name of the snapshot to delete.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteVolumeSnapshot
public final void deleteVolumeSnapshot(DeleteVolumeSnapshotRequest request)
Deletes a volume snapshot. Returns INVALID_ARGUMENT if called for a non-boot 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()) { DeleteVolumeSnapshotRequest request = DeleteVolumeSnapshotRequest.newBuilder() .setName( VolumeSnapshotName.of("[PROJECT]", "[LOCATION]", "[VOLUME]", "[SNAPSHOT]") .toString()) .build(); bareMetalSolutionClient.deleteVolumeSnapshot(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteVolumeSnapshotCallable
public final com.google.api.gax.rpc.UnaryCallable<DeleteVolumeSnapshotRequest,com.google.protobuf.Empty> deleteVolumeSnapshotCallable()
Deletes a volume snapshot. Returns INVALID_ARGUMENT if called for a non-boot 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()) { DeleteVolumeSnapshotRequest request = DeleteVolumeSnapshotRequest.newBuilder() .setName( VolumeSnapshotName.of("[PROJECT]", "[LOCATION]", "[VOLUME]", "[SNAPSHOT]") .toString()) .build(); ApiFuture<Empty> future = bareMetalSolutionClient.deleteVolumeSnapshotCallable().futureCall(request); // Do something. future.get(); }
-
getVolumeSnapshot
public final VolumeSnapshot getVolumeSnapshot(VolumeSnapshotName name)
Returns the specified snapshot resource. Returns INVALID_ARGUMENT if called for a non-boot 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()) { VolumeSnapshotName name = VolumeSnapshotName.of("[PROJECT]", "[LOCATION]", "[VOLUME]", "[SNAPSHOT]"); VolumeSnapshot response = bareMetalSolutionClient.getVolumeSnapshot(name); }
- Parameters:
name
- Required. The name of the snapshot.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getVolumeSnapshot
public final VolumeSnapshot getVolumeSnapshot(String name)
Returns the specified snapshot resource. Returns INVALID_ARGUMENT if called for a non-boot 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 = VolumeSnapshotName.of("[PROJECT]", "[LOCATION]", "[VOLUME]", "[SNAPSHOT]").toString(); VolumeSnapshot response = bareMetalSolutionClient.getVolumeSnapshot(name); }
- Parameters:
name
- Required. The name of the snapshot.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getVolumeSnapshot
public final VolumeSnapshot getVolumeSnapshot(GetVolumeSnapshotRequest request)
Returns the specified snapshot resource. Returns INVALID_ARGUMENT if called for a non-boot 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()) { GetVolumeSnapshotRequest request = GetVolumeSnapshotRequest.newBuilder() .setName( VolumeSnapshotName.of("[PROJECT]", "[LOCATION]", "[VOLUME]", "[SNAPSHOT]") .toString()) .build(); VolumeSnapshot response = bareMetalSolutionClient.getVolumeSnapshot(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getVolumeSnapshotCallable
public final com.google.api.gax.rpc.UnaryCallable<GetVolumeSnapshotRequest,VolumeSnapshot> getVolumeSnapshotCallable()
Returns the specified snapshot resource. Returns INVALID_ARGUMENT if called for a non-boot 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()) { GetVolumeSnapshotRequest request = GetVolumeSnapshotRequest.newBuilder() .setName( VolumeSnapshotName.of("[PROJECT]", "[LOCATION]", "[VOLUME]", "[SNAPSHOT]") .toString()) .build(); ApiFuture<VolumeSnapshot> future = bareMetalSolutionClient.getVolumeSnapshotCallable().futureCall(request); // Do something. VolumeSnapshot response = future.get(); }
-
listVolumeSnapshots
public final BareMetalSolutionClient.ListVolumeSnapshotsPagedResponse listVolumeSnapshots(VolumeName parent)
Retrieves the list of snapshots for the specified volume. Returns a response with an empty list of snapshots if called for a non-boot 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 (VolumeSnapshot element : bareMetalSolutionClient.listVolumeSnapshots(parent).iterateAll()) { // doThingsWith(element); } }
- Parameters:
parent
- Required. Parent value for ListVolumesRequest.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listVolumeSnapshots
public final BareMetalSolutionClient.ListVolumeSnapshotsPagedResponse listVolumeSnapshots(String parent)
Retrieves the list of snapshots for the specified volume. Returns a response with an empty list of snapshots if called for a non-boot 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 (VolumeSnapshot element : bareMetalSolutionClient.listVolumeSnapshots(parent).iterateAll()) { // doThingsWith(element); } }
- Parameters:
parent
- Required. Parent value for ListVolumesRequest.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listVolumeSnapshots
public final BareMetalSolutionClient.ListVolumeSnapshotsPagedResponse listVolumeSnapshots(ListVolumeSnapshotsRequest request)
Retrieves the list of snapshots for the specified volume. Returns a response with an empty list of snapshots if called for a non-boot 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()) { ListVolumeSnapshotsRequest request = ListVolumeSnapshotsRequest.newBuilder() .setParent(VolumeName.of("[PROJECT]", "[LOCATION]", "[VOLUME]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (VolumeSnapshot element : bareMetalSolutionClient.listVolumeSnapshots(request).iterateAll()) { // doThingsWith(element); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listVolumeSnapshotsPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<ListVolumeSnapshotsRequest,BareMetalSolutionClient.ListVolumeSnapshotsPagedResponse> listVolumeSnapshotsPagedCallable()
Retrieves the list of snapshots for the specified volume. Returns a response with an empty list of snapshots if called for a non-boot 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()) { ListVolumeSnapshotsRequest request = ListVolumeSnapshotsRequest.newBuilder() .setParent(VolumeName.of("[PROJECT]", "[LOCATION]", "[VOLUME]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<VolumeSnapshot> future = bareMetalSolutionClient.listVolumeSnapshotsPagedCallable().futureCall(request); // Do something. for (VolumeSnapshot element : future.get().iterateAll()) { // doThingsWith(element); } }
-
listVolumeSnapshotsCallable
public final com.google.api.gax.rpc.UnaryCallable<ListVolumeSnapshotsRequest,ListVolumeSnapshotsResponse> listVolumeSnapshotsCallable()
Retrieves the list of snapshots for the specified volume. Returns a response with an empty list of snapshots if called for a non-boot 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()) { ListVolumeSnapshotsRequest request = ListVolumeSnapshotsRequest.newBuilder() .setParent(VolumeName.of("[PROJECT]", "[LOCATION]", "[VOLUME]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListVolumeSnapshotsResponse response = bareMetalSolutionClient.listVolumeSnapshotsCallable().call(request); for (VolumeSnapshot element : response.getVolumeSnapshotsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } }
-
getLun
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); }
- Parameters:
name
- Required. Name of the resource.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getLun
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); }
- Parameters:
name
- Required. Name of the resource.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getLun
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); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getLunCallable
public final com.google.api.gax.rpc.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(); }
-
listLuns
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); } }
- Parameters:
parent
- Required. Parent value for ListLunsRequest.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listLuns
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); } }
- Parameters:
parent
- Required. Parent value for ListLunsRequest.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listLuns
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); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listLunsPagedCallable
public final com.google.api.gax.rpc.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); } }
-
listLunsCallable
public final com.google.api.gax.rpc.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; } } }
-
evictLunAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> evictLunAsync(LunName name)
Skips lun's cooloff and deletes it now. Lun must be in cooloff state.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]"); bareMetalSolutionClient.evictLunAsync(name).get(); }
- Parameters:
name
- Required. The name of the lun.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
evictLunAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> evictLunAsync(String name)
Skips lun's cooloff and deletes it now. Lun must be in cooloff state.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(); bareMetalSolutionClient.evictLunAsync(name).get(); }
- Parameters:
name
- Required. The name of the lun.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
evictLunAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> evictLunAsync(EvictLunRequest request)
Skips lun's cooloff and deletes it now. Lun must be in cooloff state.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()) { EvictLunRequest request = EvictLunRequest.newBuilder() .setName(LunName.of("[PROJECT]", "[LOCATION]", "[VOLUME]", "[LUN]").toString()) .build(); bareMetalSolutionClient.evictLunAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
evictLunOperationCallable
public final com.google.api.gax.rpc.OperationCallable<EvictLunRequest,com.google.protobuf.Empty,OperationMetadata> evictLunOperationCallable()
Skips lun's cooloff and deletes it now. Lun must be in cooloff state.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()) { EvictLunRequest request = EvictLunRequest.newBuilder() .setName(LunName.of("[PROJECT]", "[LOCATION]", "[VOLUME]", "[LUN]").toString()) .build(); OperationFuture<Empty, OperationMetadata> future = bareMetalSolutionClient.evictLunOperationCallable().futureCall(request); // Do something. future.get(); }
-
evictLunCallable
public final com.google.api.gax.rpc.UnaryCallable<EvictLunRequest,com.google.longrunning.Operation> evictLunCallable()
Skips lun's cooloff and deletes it now. Lun must be in cooloff state.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()) { EvictLunRequest request = EvictLunRequest.newBuilder() .setName(LunName.of("[PROJECT]", "[LOCATION]", "[VOLUME]", "[LUN]").toString()) .build(); ApiFuture<Operation> future = bareMetalSolutionClient.evictLunCallable().futureCall(request); // Do something. future.get(); }
-
getNfsShare
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); }
- Parameters:
name
- Required. Name of the resource.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getNfsShare
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); }
- Parameters:
name
- Required. Name of the resource.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getNfsShare
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); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getNfsShareCallable
public final com.google.api.gax.rpc.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(); }
-
listNfsShares
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); } }
- Parameters:
parent
- Required. Parent value for ListNfsSharesRequest.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listNfsShares
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); } }
- Parameters:
parent
- Required. Parent value for ListNfsSharesRequest.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listNfsShares
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); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listNfsSharesPagedCallable
public final com.google.api.gax.rpc.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); } }
-
listNfsSharesCallable
public final com.google.api.gax.rpc.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; } } }
-
updateNfsShareAsync
public final com.google.api.gax.longrunning.OperationFuture<NfsShare,OperationMetadata> updateNfsShareAsync(NfsShare nfsShare, com.google.protobuf.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:
nfsShare
- 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}
updateMask
- The list of fields to update. The only currently supported fields are: `labels` `allowed_clients`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updateNfsShareAsync
public final com.google.api.gax.longrunning.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(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updateNfsShareOperationCallable
public final com.google.api.gax.rpc.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(); }
-
updateNfsShareCallable
public final com.google.api.gax.rpc.UnaryCallable<UpdateNfsShareRequest,com.google.longrunning.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(); }
-
createNfsShareAsync
public final com.google.api.gax.longrunning.OperationFuture<NfsShare,OperationMetadata> createNfsShareAsync(LocationName parent, NfsShare nfsShare)
Create an 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()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); NfsShare nfsShare = NfsShare.newBuilder().build(); NfsShare response = bareMetalSolutionClient.createNfsShareAsync(parent, nfsShare).get(); }
- Parameters:
parent
- Required. The parent project and location.nfsShare
- Required. The NfsShare to create.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createNfsShareAsync
public final com.google.api.gax.longrunning.OperationFuture<NfsShare,OperationMetadata> createNfsShareAsync(String parent, NfsShare nfsShare)
Create an 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 parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); NfsShare nfsShare = NfsShare.newBuilder().build(); NfsShare response = bareMetalSolutionClient.createNfsShareAsync(parent, nfsShare).get(); }
- Parameters:
parent
- Required. The parent project and location.nfsShare
- Required. The NfsShare to create.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createNfsShareAsync
public final com.google.api.gax.longrunning.OperationFuture<NfsShare,OperationMetadata> createNfsShareAsync(CreateNfsShareRequest request)
Create an 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()) { CreateNfsShareRequest request = CreateNfsShareRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setNfsShare(NfsShare.newBuilder().build()) .build(); NfsShare response = bareMetalSolutionClient.createNfsShareAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createNfsShareOperationCallable
public final com.google.api.gax.rpc.OperationCallable<CreateNfsShareRequest,NfsShare,OperationMetadata> createNfsShareOperationCallable()
Create an 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()) { CreateNfsShareRequest request = CreateNfsShareRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setNfsShare(NfsShare.newBuilder().build()) .build(); OperationFuture<NfsShare, OperationMetadata> future = bareMetalSolutionClient.createNfsShareOperationCallable().futureCall(request); // Do something. NfsShare response = future.get(); }
-
createNfsShareCallable
public final com.google.api.gax.rpc.UnaryCallable<CreateNfsShareRequest,com.google.longrunning.Operation> createNfsShareCallable()
Create an 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()) { CreateNfsShareRequest request = CreateNfsShareRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setNfsShare(NfsShare.newBuilder().build()) .build(); ApiFuture<Operation> future = bareMetalSolutionClient.createNfsShareCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
renameNfsShare
public final NfsShare renameNfsShare(NFSShareName name, String newNfsshareId)
RenameNfsShare sets a new name for an nfsshare. Use with caution, previous names become immediately invalidated.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]"); String newNfsshareId = "newNfsshareId1643043071"; NfsShare response = bareMetalSolutionClient.renameNfsShare(name, newNfsshareId); }
- Parameters:
name
- Required. The `name` field is used to identify the nfsshare. Format: projects/{project}/locations/{location}/nfsshares/{nfsshare}newNfsshareId
- Required. The new `id` of the nfsshare.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
renameNfsShare
public final NfsShare renameNfsShare(String name, String newNfsshareId)
RenameNfsShare sets a new name for an nfsshare. Use with caution, previous names become immediately invalidated.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(); String newNfsshareId = "newNfsshareId1643043071"; NfsShare response = bareMetalSolutionClient.renameNfsShare(name, newNfsshareId); }
- Parameters:
name
- Required. The `name` field is used to identify the nfsshare. Format: projects/{project}/locations/{location}/nfsshares/{nfsshare}newNfsshareId
- Required. The new `id` of the nfsshare.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
renameNfsShare
public final NfsShare renameNfsShare(RenameNfsShareRequest request)
RenameNfsShare sets a new name for an nfsshare. Use with caution, previous names become immediately invalidated.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()) { RenameNfsShareRequest request = RenameNfsShareRequest.newBuilder() .setName(NFSShareName.of("[PROJECT]", "[LOCATION]", "[NFS_SHARE]").toString()) .setNewNfsshareId("newNfsshareId1643043071") .build(); NfsShare response = bareMetalSolutionClient.renameNfsShare(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
renameNfsShareCallable
public final com.google.api.gax.rpc.UnaryCallable<RenameNfsShareRequest,NfsShare> renameNfsShareCallable()
RenameNfsShare sets a new name for an nfsshare. Use with caution, previous names become immediately invalidated.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()) { RenameNfsShareRequest request = RenameNfsShareRequest.newBuilder() .setName(NFSShareName.of("[PROJECT]", "[LOCATION]", "[NFS_SHARE]").toString()) .setNewNfsshareId("newNfsshareId1643043071") .build(); ApiFuture<NfsShare> future = bareMetalSolutionClient.renameNfsShareCallable().futureCall(request); // Do something. NfsShare response = future.get(); }
-
deleteNfsShareAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteNfsShareAsync(NFSShareName name)
Delete an NFS share. The underlying volume is automatically deleted.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]"); bareMetalSolutionClient.deleteNfsShareAsync(name).get(); }
- Parameters:
name
- Required. The name of the NFS share to delete.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteNfsShareAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteNfsShareAsync(String name)
Delete an NFS share. The underlying volume is automatically deleted.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(); bareMetalSolutionClient.deleteNfsShareAsync(name).get(); }
- Parameters:
name
- Required. The name of the NFS share to delete.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteNfsShareAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteNfsShareAsync(DeleteNfsShareRequest request)
Delete an NFS share. The underlying volume is automatically deleted.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()) { DeleteNfsShareRequest request = DeleteNfsShareRequest.newBuilder() .setName(NFSShareName.of("[PROJECT]", "[LOCATION]", "[NFS_SHARE]").toString()) .build(); bareMetalSolutionClient.deleteNfsShareAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteNfsShareOperationCallable
public final com.google.api.gax.rpc.OperationCallable<DeleteNfsShareRequest,com.google.protobuf.Empty,OperationMetadata> deleteNfsShareOperationCallable()
Delete an NFS share. The underlying volume is automatically deleted.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()) { DeleteNfsShareRequest request = DeleteNfsShareRequest.newBuilder() .setName(NFSShareName.of("[PROJECT]", "[LOCATION]", "[NFS_SHARE]").toString()) .build(); OperationFuture<Empty, OperationMetadata> future = bareMetalSolutionClient.deleteNfsShareOperationCallable().futureCall(request); // Do something. future.get(); }
-
deleteNfsShareCallable
public final com.google.api.gax.rpc.UnaryCallable<DeleteNfsShareRequest,com.google.longrunning.Operation> deleteNfsShareCallable()
Delete an NFS share. The underlying volume is automatically deleted.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()) { DeleteNfsShareRequest request = DeleteNfsShareRequest.newBuilder() .setName(NFSShareName.of("[PROJECT]", "[LOCATION]", "[NFS_SHARE]").toString()) .build(); ApiFuture<Operation> future = bareMetalSolutionClient.deleteNfsShareCallable().futureCall(request); // Do something. future.get(); }
-
listProvisioningQuotas
public final BareMetalSolutionClient.ListProvisioningQuotasPagedResponse listProvisioningQuotas(LocationName parent)
List the budget details to provision resources on a given 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 parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (ProvisioningQuota element : bareMetalSolutionClient.listProvisioningQuotas(parent).iterateAll()) { // doThingsWith(element); } }
- Parameters:
parent
- Required. Parent value for ListProvisioningQuotasRequest.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listProvisioningQuotas
public final BareMetalSolutionClient.ListProvisioningQuotasPagedResponse listProvisioningQuotas(String parent)
List the budget details to provision resources on a given 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 parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (ProvisioningQuota element : bareMetalSolutionClient.listProvisioningQuotas(parent).iterateAll()) { // doThingsWith(element); } }
- Parameters:
parent
- Required. Parent value for ListProvisioningQuotasRequest.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listProvisioningQuotas
public final BareMetalSolutionClient.ListProvisioningQuotasPagedResponse listProvisioningQuotas(ListProvisioningQuotasRequest request)
List the budget details to provision resources on a given 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()) { ListProvisioningQuotasRequest request = ListProvisioningQuotasRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (ProvisioningQuota element : bareMetalSolutionClient.listProvisioningQuotas(request).iterateAll()) { // doThingsWith(element); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listProvisioningQuotasPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<ListProvisioningQuotasRequest,BareMetalSolutionClient.ListProvisioningQuotasPagedResponse> listProvisioningQuotasPagedCallable()
List the budget details to provision resources on a given 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()) { ListProvisioningQuotasRequest request = ListProvisioningQuotasRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<ProvisioningQuota> future = bareMetalSolutionClient.listProvisioningQuotasPagedCallable().futureCall(request); // Do something. for (ProvisioningQuota element : future.get().iterateAll()) { // doThingsWith(element); } }
-
listProvisioningQuotasCallable
public final com.google.api.gax.rpc.UnaryCallable<ListProvisioningQuotasRequest,ListProvisioningQuotasResponse> listProvisioningQuotasCallable()
List the budget details to provision resources on a given 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()) { ListProvisioningQuotasRequest request = ListProvisioningQuotasRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListProvisioningQuotasResponse response = bareMetalSolutionClient.listProvisioningQuotasCallable().call(request); for (ProvisioningQuota element : response.getProvisioningQuotasList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } }
-
submitProvisioningConfig
public final SubmitProvisioningConfigResponse submitProvisioningConfig(LocationName parent, ProvisioningConfig provisioningConfig)
Submit a provisiong configuration for a given 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 parent = LocationName.of("[PROJECT]", "[LOCATION]"); ProvisioningConfig provisioningConfig = ProvisioningConfig.newBuilder().build(); SubmitProvisioningConfigResponse response = bareMetalSolutionClient.submitProvisioningConfig(parent, provisioningConfig); }
- Parameters:
parent
- Required. The parent project and location containing the ProvisioningConfig.provisioningConfig
- Required. The ProvisioningConfig to create.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
submitProvisioningConfig
public final SubmitProvisioningConfigResponse submitProvisioningConfig(String parent, ProvisioningConfig provisioningConfig)
Submit a provisiong configuration for a given 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 parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); ProvisioningConfig provisioningConfig = ProvisioningConfig.newBuilder().build(); SubmitProvisioningConfigResponse response = bareMetalSolutionClient.submitProvisioningConfig(parent, provisioningConfig); }
- Parameters:
parent
- Required. The parent project and location containing the ProvisioningConfig.provisioningConfig
- Required. The ProvisioningConfig to create.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
submitProvisioningConfig
public final SubmitProvisioningConfigResponse submitProvisioningConfig(SubmitProvisioningConfigRequest request)
Submit a provisiong configuration for a given 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()) { SubmitProvisioningConfigRequest request = SubmitProvisioningConfigRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setProvisioningConfig(ProvisioningConfig.newBuilder().build()) .setEmail("email96619420") .build(); SubmitProvisioningConfigResponse response = bareMetalSolutionClient.submitProvisioningConfig(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
submitProvisioningConfigCallable
public final com.google.api.gax.rpc.UnaryCallable<SubmitProvisioningConfigRequest,SubmitProvisioningConfigResponse> submitProvisioningConfigCallable()
Submit a provisiong configuration for a given 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()) { SubmitProvisioningConfigRequest request = SubmitProvisioningConfigRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setProvisioningConfig(ProvisioningConfig.newBuilder().build()) .setEmail("email96619420") .build(); ApiFuture<SubmitProvisioningConfigResponse> future = bareMetalSolutionClient.submitProvisioningConfigCallable().futureCall(request); // Do something. SubmitProvisioningConfigResponse response = future.get(); }
-
getProvisioningConfig
public final ProvisioningConfig getProvisioningConfig(ProvisioningConfigName name)
Get ProvisioningConfig by name.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()) { ProvisioningConfigName name = ProvisioningConfigName.of("[PROJECT]", "[LOCATION]", "[PROVISIONING_CONFIG]"); ProvisioningConfig response = bareMetalSolutionClient.getProvisioningConfig(name); }
- Parameters:
name
- Required. Name of the ProvisioningConfig.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getProvisioningConfig
public final ProvisioningConfig getProvisioningConfig(String name)
Get ProvisioningConfig by name.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 = ProvisioningConfigName.of("[PROJECT]", "[LOCATION]", "[PROVISIONING_CONFIG]").toString(); ProvisioningConfig response = bareMetalSolutionClient.getProvisioningConfig(name); }
- Parameters:
name
- Required. Name of the ProvisioningConfig.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getProvisioningConfig
public final ProvisioningConfig getProvisioningConfig(GetProvisioningConfigRequest request)
Get ProvisioningConfig by name.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()) { GetProvisioningConfigRequest request = GetProvisioningConfigRequest.newBuilder() .setName( ProvisioningConfigName.of("[PROJECT]", "[LOCATION]", "[PROVISIONING_CONFIG]") .toString()) .build(); ProvisioningConfig response = bareMetalSolutionClient.getProvisioningConfig(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getProvisioningConfigCallable
public final com.google.api.gax.rpc.UnaryCallable<GetProvisioningConfigRequest,ProvisioningConfig> getProvisioningConfigCallable()
Get ProvisioningConfig by name.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()) { GetProvisioningConfigRequest request = GetProvisioningConfigRequest.newBuilder() .setName( ProvisioningConfigName.of("[PROJECT]", "[LOCATION]", "[PROVISIONING_CONFIG]") .toString()) .build(); ApiFuture<ProvisioningConfig> future = bareMetalSolutionClient.getProvisioningConfigCallable().futureCall(request); // Do something. ProvisioningConfig response = future.get(); }
-
createProvisioningConfig
public final ProvisioningConfig createProvisioningConfig(LocationName parent, ProvisioningConfig provisioningConfig)
Create new ProvisioningConfig.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]"); ProvisioningConfig provisioningConfig = ProvisioningConfig.newBuilder().build(); ProvisioningConfig response = bareMetalSolutionClient.createProvisioningConfig(parent, provisioningConfig); }
- Parameters:
parent
- Required. The parent project and location containing the ProvisioningConfig.provisioningConfig
- Required. The ProvisioningConfig to create.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createProvisioningConfig
public final ProvisioningConfig createProvisioningConfig(String parent, ProvisioningConfig provisioningConfig)
Create new ProvisioningConfig.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(); ProvisioningConfig provisioningConfig = ProvisioningConfig.newBuilder().build(); ProvisioningConfig response = bareMetalSolutionClient.createProvisioningConfig(parent, provisioningConfig); }
- Parameters:
parent
- Required. The parent project and location containing the ProvisioningConfig.provisioningConfig
- Required. The ProvisioningConfig to create.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createProvisioningConfig
public final ProvisioningConfig createProvisioningConfig(CreateProvisioningConfigRequest request)
Create new ProvisioningConfig.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()) { CreateProvisioningConfigRequest request = CreateProvisioningConfigRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setProvisioningConfig(ProvisioningConfig.newBuilder().build()) .setEmail("email96619420") .build(); ProvisioningConfig response = bareMetalSolutionClient.createProvisioningConfig(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createProvisioningConfigCallable
public final com.google.api.gax.rpc.UnaryCallable<CreateProvisioningConfigRequest,ProvisioningConfig> createProvisioningConfigCallable()
Create new ProvisioningConfig.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()) { CreateProvisioningConfigRequest request = CreateProvisioningConfigRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setProvisioningConfig(ProvisioningConfig.newBuilder().build()) .setEmail("email96619420") .build(); ApiFuture<ProvisioningConfig> future = bareMetalSolutionClient.createProvisioningConfigCallable().futureCall(request); // Do something. ProvisioningConfig response = future.get(); }
-
updateProvisioningConfig
public final ProvisioningConfig updateProvisioningConfig(ProvisioningConfig provisioningConfig, com.google.protobuf.FieldMask updateMask)
Update existing ProvisioningConfig.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()) { ProvisioningConfig provisioningConfig = ProvisioningConfig.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); ProvisioningConfig response = bareMetalSolutionClient.updateProvisioningConfig(provisioningConfig, updateMask); }
- Parameters:
provisioningConfig
- Required. The ProvisioningConfig to update.updateMask
- Required. The list of fields to update.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updateProvisioningConfig
public final ProvisioningConfig updateProvisioningConfig(UpdateProvisioningConfigRequest request)
Update existing ProvisioningConfig.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()) { UpdateProvisioningConfigRequest request = UpdateProvisioningConfigRequest.newBuilder() .setProvisioningConfig(ProvisioningConfig.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .setEmail("email96619420") .build(); ProvisioningConfig response = bareMetalSolutionClient.updateProvisioningConfig(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updateProvisioningConfigCallable
public final com.google.api.gax.rpc.UnaryCallable<UpdateProvisioningConfigRequest,ProvisioningConfig> updateProvisioningConfigCallable()
Update existing ProvisioningConfig.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()) { UpdateProvisioningConfigRequest request = UpdateProvisioningConfigRequest.newBuilder() .setProvisioningConfig(ProvisioningConfig.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .setEmail("email96619420") .build(); ApiFuture<ProvisioningConfig> future = bareMetalSolutionClient.updateProvisioningConfigCallable().futureCall(request); // Do something. ProvisioningConfig response = future.get(); }
-
renameNetwork
public final Network renameNetwork(NetworkName name, String newNetworkId)
RenameNetwork sets a new name for a network. Use with caution, previous names become immediately invalidated.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]"); String newNetworkId = "newNetworkId-1927751127"; Network response = bareMetalSolutionClient.renameNetwork(name, newNetworkId); }
- Parameters:
name
- Required. The `name` field is used to identify the network. Format: projects/{project}/locations/{location}/networks/{network}newNetworkId
- Required. The new `id` of the network.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
renameNetwork
public final Network renameNetwork(String name, String newNetworkId)
RenameNetwork sets a new name for a network. Use with caution, previous names become immediately invalidated.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(); String newNetworkId = "newNetworkId-1927751127"; Network response = bareMetalSolutionClient.renameNetwork(name, newNetworkId); }
- Parameters:
name
- Required. The `name` field is used to identify the network. Format: projects/{project}/locations/{location}/networks/{network}newNetworkId
- Required. The new `id` of the network.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
renameNetwork
public final Network renameNetwork(RenameNetworkRequest request)
RenameNetwork sets a new name for a network. Use with caution, previous names become immediately invalidated.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()) { RenameNetworkRequest request = RenameNetworkRequest.newBuilder() .setName(NetworkName.of("[PROJECT]", "[LOCATION]", "[NETWORK]").toString()) .setNewNetworkId("newNetworkId-1927751127") .build(); Network response = bareMetalSolutionClient.renameNetwork(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
renameNetworkCallable
public final com.google.api.gax.rpc.UnaryCallable<RenameNetworkRequest,Network> renameNetworkCallable()
RenameNetwork sets a new name for a network. Use with caution, previous names become immediately invalidated.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()) { RenameNetworkRequest request = RenameNetworkRequest.newBuilder() .setName(NetworkName.of("[PROJECT]", "[LOCATION]", "[NETWORK]").toString()) .setNewNetworkId("newNetworkId-1927751127") .build(); ApiFuture<Network> future = bareMetalSolutionClient.renameNetworkCallable().futureCall(request); // Do something. Network response = future.get(); }
-
listOSImages
public final BareMetalSolutionClient.ListOSImagesPagedResponse listOSImages(LocationName parent)
Retrieves the list of OS images which are currently approved.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 (OSImage element : bareMetalSolutionClient.listOSImages(parent).iterateAll()) { // doThingsWith(element); } }
- Parameters:
parent
- Required. Parent value for ListProvisioningQuotasRequest.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listOSImages
public final BareMetalSolutionClient.ListOSImagesPagedResponse listOSImages(String parent)
Retrieves the list of OS images which are currently approved.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 (OSImage element : bareMetalSolutionClient.listOSImages(parent).iterateAll()) { // doThingsWith(element); } }
- Parameters:
parent
- Required. Parent value for ListProvisioningQuotasRequest.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listOSImages
public final BareMetalSolutionClient.ListOSImagesPagedResponse listOSImages(ListOSImagesRequest request)
Retrieves the list of OS images which are currently approved.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()) { ListOSImagesRequest request = ListOSImagesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (OSImage element : bareMetalSolutionClient.listOSImages(request).iterateAll()) { // doThingsWith(element); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listOSImagesPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<ListOSImagesRequest,BareMetalSolutionClient.ListOSImagesPagedResponse> listOSImagesPagedCallable()
Retrieves the list of OS images which are currently approved.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()) { ListOSImagesRequest request = ListOSImagesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<OSImage> future = bareMetalSolutionClient.listOSImagesPagedCallable().futureCall(request); // Do something. for (OSImage element : future.get().iterateAll()) { // doThingsWith(element); } }
-
listOSImagesCallable
public final com.google.api.gax.rpc.UnaryCallable<ListOSImagesRequest,ListOSImagesResponse> listOSImagesCallable()
Retrieves the list of OS images which are currently approved.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()) { ListOSImagesRequest request = ListOSImagesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListOSImagesResponse response = bareMetalSolutionClient.listOSImagesCallable().call(request); for (OSImage element : response.getOsImagesList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } }
-
listLocations
public final BareMetalSolutionClient.ListLocationsPagedResponse listLocations(com.google.cloud.location.ListLocationsRequest request)
Lists information about the supported locations for this service.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()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Location element : bareMetalSolutionClient.listLocations(request).iterateAll()) { // doThingsWith(element); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listLocationsPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,BareMetalSolutionClient.ListLocationsPagedResponse> listLocationsPagedCallable()
Lists information about the supported locations for this service.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()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Location> future = bareMetalSolutionClient.listLocationsPagedCallable().futureCall(request); // Do something. for (Location element : future.get().iterateAll()) { // doThingsWith(element); } }
-
listLocationsCallable
public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> listLocationsCallable()
Lists information about the supported locations for this service.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()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListLocationsResponse response = bareMetalSolutionClient.listLocationsCallable().call(request); for (Location element : response.getLocationsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } }
-
getLocation
public final com.google.cloud.location.Location getLocation(com.google.cloud.location.GetLocationRequest request)
Gets information about a 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()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); Location response = bareMetalSolutionClient.getLocation(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getLocationCallable
public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> getLocationCallable()
Gets information about a 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()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); ApiFuture<Location> future = bareMetalSolutionClient.getLocationCallable().futureCall(request); // Do something. Location response = future.get(); }
-
close
public final void close()
- Specified by:
close
in interfaceAutoCloseable
-
shutdown
public void shutdown()
- Specified by:
shutdown
in interfacecom.google.api.gax.core.BackgroundResource
-
isShutdown
public boolean isShutdown()
- Specified by:
isShutdown
in interfacecom.google.api.gax.core.BackgroundResource
-
isTerminated
public boolean isTerminated()
- Specified by:
isTerminated
in interfacecom.google.api.gax.core.BackgroundResource
-
shutdownNow
public void shutdownNow()
- Specified by:
shutdownNow
in interfacecom.google.api.gax.core.BackgroundResource
-
awaitTermination
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
- Specified by:
awaitTermination
in interfacecom.google.api.gax.core.BackgroundResource
- Throws:
InterruptedException
-
-