Class LustreClient
- All Implemented Interfaces:
BackgroundResource,AutoCloseable
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 (LustreClient lustreClient = LustreClient.create()) {
InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
Instance response = lustreClient.getInstance(name);
}
Note: close() needs to be called on the LustreClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
| Method | Description | Method Variants |
|---|---|---|
ListInstances |
Lists instances in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetInstance |
Gets details of a single instance. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateInstance |
Creates a new instance in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateInstance |
Updates the parameters of a single instance. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteInstance |
Deletes a single instance. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ImportData |
Imports data from Cloud Storage to a Managed Lustre instance. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ExportData |
Exports data from a Managed Lustre instance to Cloud Storage. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListLocations |
Lists information about the supported locations for this service. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetLocation |
Gets information about a location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return 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 LustreSettings 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
LustreSettings lustreSettings =
LustreSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
LustreClient lustreClient = LustreClient.create(lustreSettings);
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
LustreSettings lustreSettings = LustreSettings.newBuilder().setEndpoint(myEndpoint).build();
LustreClient lustreClient = LustreClient.create(lustreSettings);
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
LustreSettings lustreSettings = LustreSettings.newHttpJsonBuilder().build();
LustreClient lustreClient = LustreClient.create(lustreSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic class -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLustreClient(LustreSettings settings) Constructs an instance of LustreClient, using the given settings.protectedLustreClient(LustreStub stub) -
Method Summary
Modifier and TypeMethodDescriptionbooleanawaitTermination(long duration, TimeUnit unit) final voidclose()static final LustreClientcreate()Constructs an instance of LustreClient with default settings.static final LustreClientcreate(LustreSettings settings) Constructs an instance of LustreClient, using the given settings.static final LustreClientcreate(LustreStub stub) Constructs an instance of LustreClient, using the given stub for making calls.createInstanceAsync(CreateInstanceRequest request) Creates a new instance in a given project and location.createInstanceAsync(LocationName parent, Instance instance, String instanceId) Creates a new instance in a given project and location.createInstanceAsync(String parent, Instance instance, String instanceId) Creates a new instance in a given project and location.Creates a new instance in a given project and location.Creates a new instance in a given project and location.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteInstanceAsync(DeleteInstanceRequest request) Deletes a single instance.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single instance.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteInstanceAsync(String name) Deletes a single instance.Deletes a single instance.final OperationCallable<DeleteInstanceRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a single instance.exportDataAsync(ExportDataRequest request) Exports data from a Managed Lustre instance to Cloud Storage.Exports data from a Managed Lustre instance to Cloud Storage.Exports data from a Managed Lustre instance to Cloud Storage.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.final InstancegetInstance(GetInstanceRequest request) Gets details of a single instance.final InstancegetInstance(InstanceName name) Gets details of a single instance.final InstancegetInstance(String name) Gets details of a single instance.Gets details of a single instance.final LocationgetLocation(GetLocationRequest request) Gets information about a location.Gets information about a location.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.final LustreSettingsgetStub()importDataAsync(ImportDataRequest request) Imports data from Cloud Storage to a Managed Lustre instance.importDataAsync(InstanceName name) Imports data from Cloud Storage to a Managed Lustre instance.importDataAsync(String name) Imports data from Cloud Storage to a Managed Lustre instance.Imports data from Cloud Storage to a Managed Lustre instance.Imports data from Cloud Storage to a Managed Lustre instance.booleanbooleanlistInstances(ListInstancesRequest request) Lists instances in a given project and location.listInstances(LocationName parent) Lists instances in a given project and location.listInstances(String parent) Lists instances in a given project and location.Lists instances in a given project and location.Lists instances in a given project and location.listLocations(ListLocationsRequest request) Lists information about the supported locations for this service.Lists information about the supported locations for this service.Lists information about the supported locations for this service.voidshutdown()voidupdateInstanceAsync(Instance instance, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single instance.updateInstanceAsync(UpdateInstanceRequest request) Updates the parameters of a single instance.Updates the parameters of a single instance.Updates the parameters of a single instance.
-
Constructor Details
-
LustreClient
Constructs an instance of LustreClient, 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
-
LustreClient
-
-
Method Details
-
create
Constructs an instance of LustreClient with default settings.- Throws:
IOException
-
create
Constructs an instance of LustreClient, 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
Constructs an instance of LustreClient, using the given stub for making calls. This is for advanced usage - prefer using create(LustreSettings). -
getSettings
-
getStub
-
getOperationsClient
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call. -
getHttpJsonOperationsClient
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call. -
listInstances
Lists instances 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 (LustreClient lustreClient = LustreClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (Instance element : lustreClient.listInstances(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The project and location for which to retrieve a list of instances, in the format `projects/{projectId}/locations/{location}`.To retrieve instance information for all locations, use "-" as the value of `{location}`.
- Throws:
ApiException- if the remote call fails
-
listInstances
Lists instances 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 (LustreClient lustreClient = LustreClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (Instance element : lustreClient.listInstances(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The project and location for which to retrieve a list of instances, in the format `projects/{projectId}/locations/{location}`.To retrieve instance information for all locations, use "-" as the value of `{location}`.
- Throws:
ApiException- if the remote call fails
-
listInstances
Lists instances 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 (LustreClient lustreClient = LustreClient.create()) { ListInstancesRequest request = ListInstancesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (Instance element : lustreClient.listInstances(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listInstancesPagedCallable
public final UnaryCallable<ListInstancesRequest,LustreClient.ListInstancesPagedResponse> listInstancesPagedCallable()Lists instances 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 (LustreClient lustreClient = LustreClient.create()) { ListInstancesRequest request = ListInstancesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<Instance> future = lustreClient.listInstancesPagedCallable().futureCall(request); // Do something. for (Instance element : future.get().iterateAll()) { // doThingsWith(element); } } -
listInstancesCallable
Lists instances 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 (LustreClient lustreClient = LustreClient.create()) { ListInstancesRequest request = ListInstancesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { ListInstancesResponse response = lustreClient.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
Gets details of a single 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 (LustreClient lustreClient = LustreClient.create()) { InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); Instance response = lustreClient.getInstance(name); }- Parameters:
name- Required. The instance resource name, in the format `projects/{projectId}/locations/{location}/instances/{instanceId}`.- Throws:
ApiException- if the remote call fails
-
getInstance
Gets details of a single 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 (LustreClient lustreClient = LustreClient.create()) { String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString(); Instance response = lustreClient.getInstance(name); }- Parameters:
name- Required. The instance resource name, in the format `projects/{projectId}/locations/{location}/instances/{instanceId}`.- Throws:
ApiException- if the remote call fails
-
getInstance
Gets details of a single 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 (LustreClient lustreClient = LustreClient.create()) { GetInstanceRequest request = GetInstanceRequest.newBuilder() .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) .build(); Instance response = lustreClient.getInstance(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getInstanceCallable
Gets details of a single 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 (LustreClient lustreClient = LustreClient.create()) { GetInstanceRequest request = GetInstanceRequest.newBuilder() .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) .build(); ApiFuture<Instance> future = lustreClient.getInstanceCallable().futureCall(request); // Do something. Instance response = future.get(); } -
createInstanceAsync
public final OperationFuture<Instance,OperationMetadata> createInstanceAsync(LocationName parent, Instance instance, String instanceId) Creates a new instance 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 (LustreClient lustreClient = LustreClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); Instance instance = Instance.newBuilder().build(); String instanceId = "instanceId902024336"; Instance response = lustreClient.createInstanceAsync(parent, instance, instanceId).get(); }- Parameters:
parent- Required. The instance's project and location, in the format `projects/{project}/locations/{location}`. Locations map to Google Cloud zones; for example, `us-west1-b`.instance- Required. The resource being createdinstanceId- Required. The name of the Managed Lustre instance.- Must contain only lowercase letters, numbers, and hyphens.
- Must start with a letter.
- Must be between 1-63 characters.
- Must end with a number or a letter.
- Throws:
ApiException- if the remote call fails
-
createInstanceAsync
public final OperationFuture<Instance,OperationMetadata> createInstanceAsync(String parent, Instance instance, String instanceId) Creates a new instance 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 (LustreClient lustreClient = LustreClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); Instance instance = Instance.newBuilder().build(); String instanceId = "instanceId902024336"; Instance response = lustreClient.createInstanceAsync(parent, instance, instanceId).get(); }- Parameters:
parent- Required. The instance's project and location, in the format `projects/{project}/locations/{location}`. Locations map to Google Cloud zones; for example, `us-west1-b`.instance- Required. The resource being createdinstanceId- Required. The name of the Managed Lustre instance.- Must contain only lowercase letters, numbers, and hyphens.
- Must start with a letter.
- Must be between 1-63 characters.
- Must end with a number or a letter.
- Throws:
ApiException- if the remote call fails
-
createInstanceAsync
public final OperationFuture<Instance,OperationMetadata> createInstanceAsync(CreateInstanceRequest request) Creates a new instance 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 (LustreClient lustreClient = LustreClient.create()) { CreateInstanceRequest request = CreateInstanceRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setInstanceId("instanceId902024336") .setInstance(Instance.newBuilder().build()) .setRequestId("requestId693933066") .build(); Instance response = lustreClient.createInstanceAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createInstanceOperationCallable
public final OperationCallable<CreateInstanceRequest,Instance, createInstanceOperationCallable()OperationMetadata> Creates a new instance 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 (LustreClient lustreClient = LustreClient.create()) { CreateInstanceRequest request = CreateInstanceRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setInstanceId("instanceId902024336") .setInstance(Instance.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<Instance, OperationMetadata> future = lustreClient.createInstanceOperationCallable().futureCall(request); // Do something. Instance response = future.get(); } -
createInstanceCallable
Creates a new instance 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 (LustreClient lustreClient = LustreClient.create()) { CreateInstanceRequest request = CreateInstanceRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setInstanceId("instanceId902024336") .setInstance(Instance.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = lustreClient.createInstanceCallable().futureCall(request); // Do something. Operation response = future.get(); } -
updateInstanceAsync
public final OperationFuture<Instance,OperationMetadata> updateInstanceAsync(Instance instance, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single 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 (LustreClient lustreClient = LustreClient.create()) { Instance instance = Instance.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); Instance response = lustreClient.updateInstanceAsync(instance, updateMask).get(); }- Parameters:
instance- Required. The resource name of the instance to update, in the format `projects/{projectId}/locations/{location}/instances/{instanceId}`.updateMask- Optional. Specifies the fields to be overwritten in the instance resource by the update.The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If no mask is provided then all fields present in the request are overwritten.
- Throws:
ApiException- if the remote call fails
-
updateInstanceAsync
public final OperationFuture<Instance,OperationMetadata> updateInstanceAsync(UpdateInstanceRequest request) Updates the parameters of a single 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 (LustreClient lustreClient = LustreClient.create()) { UpdateInstanceRequest request = UpdateInstanceRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setInstance(Instance.newBuilder().build()) .setRequestId("requestId693933066") .build(); Instance response = lustreClient.updateInstanceAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateInstanceOperationCallable
public final OperationCallable<UpdateInstanceRequest,Instance, updateInstanceOperationCallable()OperationMetadata> Updates the parameters of a single 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 (LustreClient lustreClient = LustreClient.create()) { UpdateInstanceRequest request = UpdateInstanceRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setInstance(Instance.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<Instance, OperationMetadata> future = lustreClient.updateInstanceOperationCallable().futureCall(request); // Do something. Instance response = future.get(); } -
updateInstanceCallable
Updates the parameters of a single 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 (LustreClient lustreClient = LustreClient.create()) { UpdateInstanceRequest request = UpdateInstanceRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setInstance(Instance.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = lustreClient.updateInstanceCallable().futureCall(request); // Do something. Operation response = future.get(); } -
deleteInstanceAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteInstanceAsync(InstanceName name) Deletes a single 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 (LustreClient lustreClient = LustreClient.create()) { InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); lustreClient.deleteInstanceAsync(name).get(); }- Parameters:
name- Required. The resource name of the instance to delete, in the format `projects/{projectId}/locations/{location}/instances/{instanceId}`.- Throws:
ApiException- if the remote call fails
-
deleteInstanceAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteInstanceAsync(String name) Deletes a single 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 (LustreClient lustreClient = LustreClient.create()) { String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString(); lustreClient.deleteInstanceAsync(name).get(); }- Parameters:
name- Required. The resource name of the instance to delete, in the format `projects/{projectId}/locations/{location}/instances/{instanceId}`.- Throws:
ApiException- if the remote call fails
-
deleteInstanceAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteInstanceAsync(DeleteInstanceRequest request) Deletes a single 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 (LustreClient lustreClient = LustreClient.create()) { DeleteInstanceRequest request = DeleteInstanceRequest.newBuilder() .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) .setRequestId("requestId693933066") .build(); lustreClient.deleteInstanceAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteInstanceOperationCallable
public final OperationCallable<DeleteInstanceRequest,com.google.protobuf.Empty, deleteInstanceOperationCallable()OperationMetadata> Deletes a single 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 (LustreClient lustreClient = LustreClient.create()) { DeleteInstanceRequest request = DeleteInstanceRequest.newBuilder() .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) .setRequestId("requestId693933066") .build(); OperationFuture<Empty, OperationMetadata> future = lustreClient.deleteInstanceOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteInstanceCallable
Deletes a single 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 (LustreClient lustreClient = LustreClient.create()) { DeleteInstanceRequest request = DeleteInstanceRequest.newBuilder() .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = lustreClient.deleteInstanceCallable().futureCall(request); // Do something. future.get(); } -
importDataAsync
public final OperationFuture<ImportDataResponse,ImportDataMetadata> importDataAsync(InstanceName name) Imports data from Cloud Storage to a Managed Lustre 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 (LustreClient lustreClient = LustreClient.create()) { InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); ImportDataResponse response = lustreClient.importDataAsync(name).get(); }- Parameters:
name- Required. The name of the Managed Lustre instance in the format `projects/{project}/locations/{location}/instances/{instance}`.- Throws:
ApiException- if the remote call fails
-
importDataAsync
Imports data from Cloud Storage to a Managed Lustre 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 (LustreClient lustreClient = LustreClient.create()) { String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString(); ImportDataResponse response = lustreClient.importDataAsync(name).get(); }- Parameters:
name- Required. The name of the Managed Lustre instance in the format `projects/{project}/locations/{location}/instances/{instance}`.- Throws:
ApiException- if the remote call fails
-
importDataAsync
public final OperationFuture<ImportDataResponse,ImportDataMetadata> importDataAsync(ImportDataRequest request) Imports data from Cloud Storage to a Managed Lustre 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 (LustreClient lustreClient = LustreClient.create()) { ImportDataRequest request = ImportDataRequest.newBuilder() .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) .setRequestId("requestId693933066") .setServiceAccount(ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]").toString()) .build(); ImportDataResponse response = lustreClient.importDataAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
importDataOperationCallable
public final OperationCallable<ImportDataRequest,ImportDataResponse, importDataOperationCallable()ImportDataMetadata> Imports data from Cloud Storage to a Managed Lustre 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 (LustreClient lustreClient = LustreClient.create()) { ImportDataRequest request = ImportDataRequest.newBuilder() .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) .setRequestId("requestId693933066") .setServiceAccount(ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]").toString()) .build(); OperationFuture<ImportDataResponse, ImportDataMetadata> future = lustreClient.importDataOperationCallable().futureCall(request); // Do something. ImportDataResponse response = future.get(); } -
importDataCallable
Imports data from Cloud Storage to a Managed Lustre 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 (LustreClient lustreClient = LustreClient.create()) { ImportDataRequest request = ImportDataRequest.newBuilder() .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) .setRequestId("requestId693933066") .setServiceAccount(ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]").toString()) .build(); ApiFuture<Operation> future = lustreClient.importDataCallable().futureCall(request); // Do something. Operation response = future.get(); } -
exportDataAsync
public final OperationFuture<ExportDataResponse,ExportDataMetadata> exportDataAsync(ExportDataRequest request) Exports data from a Managed Lustre instance to Cloud Storage.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (LustreClient lustreClient = LustreClient.create()) { ExportDataRequest request = ExportDataRequest.newBuilder() .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) .setRequestId("requestId693933066") .setServiceAccount(ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]").toString()) .build(); ExportDataResponse response = lustreClient.exportDataAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
exportDataOperationCallable
public final OperationCallable<ExportDataRequest,ExportDataResponse, exportDataOperationCallable()ExportDataMetadata> Exports data from a Managed Lustre instance to Cloud Storage.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (LustreClient lustreClient = LustreClient.create()) { ExportDataRequest request = ExportDataRequest.newBuilder() .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) .setRequestId("requestId693933066") .setServiceAccount(ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]").toString()) .build(); OperationFuture<ExportDataResponse, ExportDataMetadata> future = lustreClient.exportDataOperationCallable().futureCall(request); // Do something. ExportDataResponse response = future.get(); } -
exportDataCallable
Exports data from a Managed Lustre instance to Cloud Storage.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (LustreClient lustreClient = LustreClient.create()) { ExportDataRequest request = ExportDataRequest.newBuilder() .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) .setRequestId("requestId693933066") .setServiceAccount(ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]").toString()) .build(); ApiFuture<Operation> future = lustreClient.exportDataCallable().futureCall(request); // Do something. Operation response = future.get(); } -
listLocations
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 (LustreClient lustreClient = LustreClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Location element : lustreClient.listLocations(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listLocationsPagedCallable
public final UnaryCallable<ListLocationsRequest,LustreClient.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 (LustreClient lustreClient = LustreClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Location> future = lustreClient.listLocationsPagedCallable().futureCall(request); // Do something. for (Location element : future.get().iterateAll()) { // doThingsWith(element); } } -
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 (LustreClient lustreClient = LustreClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListLocationsResponse response = lustreClient.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
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 (LustreClient lustreClient = LustreClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); Location response = lustreClient.getLocation(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
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 (LustreClient lustreClient = LustreClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); ApiFuture<Location> future = lustreClient.getLocationCallable().futureCall(request); // Do something. Location response = future.get(); } -
close
public final void close()- Specified by:
closein interfaceAutoCloseable
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceBackgroundResource
-
isShutdown
public boolean isShutdown()- Specified by:
isShutdownin interfaceBackgroundResource
-
isTerminated
public boolean isTerminated()- Specified by:
isTerminatedin interfaceBackgroundResource
-
shutdownNow
public void shutdownNow()- Specified by:
shutdownNowin interfaceBackgroundResource
-
awaitTermination
- Specified by:
awaitTerminationin interfaceBackgroundResource- Throws:
InterruptedException
-