Class CloudFilestoreManagerClient (1.9.0)

public class CloudFilestoreManagerClient implements BackgroundResource

Service Description: Configures and manages Cloud Filestore resources.

Cloud Filestore Manager v1.

The file.googleapis.com service implements the Cloud Filestore API and defines the following resource model for managing instances:

  • The service works with a collection of cloud projects, named: /projects/*
  • Each project has a collection of available locations, named: /locations/*
  • Each location has a collection of instances and backups, named: /instances/* and /backups/* respectively.
  • As such, Cloud Filestore instances are resources of the form: /projects/{project_number}/locations/{location_id}/instances/{instance_id} and backups are resources of the form: /projects/{project_number}/locations/{location_id}/backup/{backup_id}

Note that location_id must be a GCP zone for instances and but to a GCP region for backups; for example:

  • projects/12345/locations/us-central1-c/instances/my-filestore
  • projects/12345/locations/us-central1/backups/my-backup

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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
     CloudFilestoreManagerClient.create()) {
   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
   Instance response = cloudFilestoreManagerClient.getInstance(name);
 }
 

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

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

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

See the individual methods for example code.

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

This class can be customized by passing in a custom instance of CloudFilestoreManagerSettings 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
 CloudFilestoreManagerSettings cloudFilestoreManagerSettings =
     CloudFilestoreManagerSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 CloudFilestoreManagerClient cloudFilestoreManagerClient =
     CloudFilestoreManagerClient.create(cloudFilestoreManagerSettings);
 

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
 CloudFilestoreManagerSettings cloudFilestoreManagerSettings =
     CloudFilestoreManagerSettings.newBuilder().setEndpoint(myEndpoint).build();
 CloudFilestoreManagerClient cloudFilestoreManagerClient =
     CloudFilestoreManagerClient.create(cloudFilestoreManagerSettings);
 

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
 CloudFilestoreManagerSettings cloudFilestoreManagerSettings =
     CloudFilestoreManagerSettings.newHttpJsonBuilder().build();
 CloudFilestoreManagerClient cloudFilestoreManagerClient =
     CloudFilestoreManagerClient.create(cloudFilestoreManagerSettings);
 

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

Inheritance

java.lang.Object > CloudFilestoreManagerClient

Implements

BackgroundResource

Static Methods

create()

public static final CloudFilestoreManagerClient create()

Constructs an instance of CloudFilestoreManagerClient with default settings.

Returns
TypeDescription
CloudFilestoreManagerClient
Exceptions
TypeDescription
IOException

create(CloudFilestoreManagerSettings settings)

public static final CloudFilestoreManagerClient create(CloudFilestoreManagerSettings settings)

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

Parameter
NameDescription
settingsCloudFilestoreManagerSettings
Returns
TypeDescription
CloudFilestoreManagerClient
Exceptions
TypeDescription
IOException

create(CloudFilestoreManagerStub stub)

public static final CloudFilestoreManagerClient create(CloudFilestoreManagerStub stub)

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

Parameter
NameDescription
stubCloudFilestoreManagerStub
Returns
TypeDescription
CloudFilestoreManagerClient

Constructors

CloudFilestoreManagerClient(CloudFilestoreManagerSettings settings)

protected CloudFilestoreManagerClient(CloudFilestoreManagerSettings settings)

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

Parameter
NameDescription
settingsCloudFilestoreManagerSettings

CloudFilestoreManagerClient(CloudFilestoreManagerStub stub)

protected CloudFilestoreManagerClient(CloudFilestoreManagerStub stub)
Parameter
NameDescription
stubCloudFilestoreManagerStub

Methods

awaitTermination(long duration, TimeUnit unit)

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

close()

public final void close()

createBackupAsync(CreateBackupRequest request)

public final OperationFuture<Backup,OperationMetadata> createBackupAsync(CreateBackupRequest request)

Creates a backup.

Sample code:


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

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

Returns
TypeDescription
OperationFuture<Backup,OperationMetadata>

createBackupAsync(LocationName parent, Backup backup, String backupId)

public final OperationFuture<Backup,OperationMetadata> createBackupAsync(LocationName parent, Backup backup, String backupId)

Creates a backup.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
     CloudFilestoreManagerClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   Backup backup = Backup.newBuilder().build();
   String backupId = "backupId2121930365";
   Backup response =
       cloudFilestoreManagerClient.createBackupAsync(parent, backup, backupId).get();
 }
 
Parameters
NameDescription
parentLocationName

Required. The backup's project and location, in the format projects/{project_number}/locations/{location}. In Cloud Filestore, backup locations map to GCP regions, for example **us-west1**.

backupBackup

Required. A backup resource

backupIdString

Required. The ID to use for the backup. The ID must be unique within the specified project and location.

This value must start with a lowercase letter followed by up to 62 lowercase letters, numbers, or hyphens, and cannot end with a hyphen. Values that do not match this pattern will trigger an INVALID_ARGUMENT error.

Returns
TypeDescription
OperationFuture<Backup,OperationMetadata>

createBackupAsync(String parent, Backup backup, String backupId)

public final OperationFuture<Backup,OperationMetadata> createBackupAsync(String parent, Backup backup, String backupId)

Creates a backup.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
     CloudFilestoreManagerClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   Backup backup = Backup.newBuilder().build();
   String backupId = "backupId2121930365";
   Backup response =
       cloudFilestoreManagerClient.createBackupAsync(parent, backup, backupId).get();
 }
 
Parameters
NameDescription
parentString

Required. The backup's project and location, in the format projects/{project_number}/locations/{location}. In Cloud Filestore, backup locations map to GCP regions, for example **us-west1**.

backupBackup

Required. A backup resource

backupIdString

Required. The ID to use for the backup. The ID must be unique within the specified project and location.

This value must start with a lowercase letter followed by up to 62 lowercase letters, numbers, or hyphens, and cannot end with a hyphen. Values that do not match this pattern will trigger an INVALID_ARGUMENT error.

Returns
TypeDescription
OperationFuture<Backup,OperationMetadata>

createBackupCallable()

public final UnaryCallable<CreateBackupRequest,Operation> createBackupCallable()

Creates a backup.

Sample code:


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

createBackupOperationCallable()

public final OperationCallable<CreateBackupRequest,Backup,OperationMetadata> createBackupOperationCallable()

Creates a backup.

Sample code:


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

createInstanceAsync(CreateInstanceRequest request)

public final OperationFuture<Instance,OperationMetadata> createInstanceAsync(CreateInstanceRequest request)

Creates an instance. When creating from a backup, the capacity of the new instance needs to be equal to or larger than the capacity of the backup (and also equal to or larger than the minimum capacity of the tier).

Sample code:


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

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

Returns
TypeDescription
OperationFuture<Instance,OperationMetadata>

createInstanceAsync(LocationName parent, Instance instance, String instanceId)

public final OperationFuture<Instance,OperationMetadata> createInstanceAsync(LocationName parent, Instance instance, String instanceId)

Creates an instance. When creating from a backup, the capacity of the new instance needs to be equal to or larger than the capacity of the backup (and also equal to or larger than the minimum capacity of the tier).

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (CloudFilestoreManagerClient cloudFilestoreManagerClient =
     CloudFilestoreManagerClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   Instance instance = Instance.newBuilder().build();
   String instanceId = "instanceId902024336";
   Instance response =
       cloudFilestoreManagerClient.createInstanceAsync(parent, instance, instanceId).get();
 }
 
Parameters
NameDescription
parentLocationName

Required. The instance's project and location, in the format projects/{project_id}/locations/{location}. In Cloud Filestore, locations map to GCP zones, for example **us-west1-b**.

instanceInstance

Required. An instance resource

instanceIdString

Required. The name of the instance to create. The name must be unique for the specified project and location.

Returns
TypeDescription
OperationFuture<Instance,OperationMetadata>

createInstanceAsync(String parent, Instance instance, String instanceId)

public final OperationFuture<Instance,OperationMetadata> createInstanceAsync(String parent, Instance instance, String instanceId)

Creates an instance. When creating from a backup, the capacity of the new instance needs to be equal to or larger than the capacity of the backup (and also equal to or larger than the minimum capacity of the tier).

Sample code:


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

Required. The instance's project and location, in the format projects/{project_id}/locations/{location}. In Cloud Filestore, locations map to GCP zones, for example **us-west1-b**.

instanceInstance

Required. An instance resource

instanceIdString

Required. The name of the instance to create. The name must be unique for the specified project and location.

Returns
TypeDescription
OperationFuture<Instance,OperationMetadata>

createInstanceCallable()

public final UnaryCallable<CreateInstanceRequest,Operation> createInstanceCallable()

Creates an instance. When creating from a backup, the capacity of the new instance needs to be equal to or larger than the capacity of the backup (and also equal to or larger than the minimum capacity of the tier).

Sample code:


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

createInstanceOperationCallable()

public final OperationCallable<CreateInstanceRequest,Instance,OperationMetadata> createInstanceOperationCallable()

Creates an instance. When creating from a backup, the capacity of the new instance needs to be equal to or larger than the capacity of the backup (and also equal to or larger than the minimum capacity of the tier).

Sample code:


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

deleteBackupAsync(BackupName name)

public final OperationFuture<Empty,OperationMetadata> deleteBackupAsync(BackupName name)

Deletes a backup.

Sample code:


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

Required. The backup resource name, in the format projects/{project_number}/locations/{location}/backups/{backup_id}

Returns
TypeDescription
OperationFuture<Empty,OperationMetadata>

deleteBackupAsync(DeleteBackupRequest request)

public final OperationFuture<Empty,OperationMetadata> deleteBackupAsync(DeleteBackupRequest request)

Deletes a backup.

Sample code:


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

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

Returns
TypeDescription
OperationFuture<Empty,OperationMetadata>

deleteBackupAsync(String name)

public final OperationFuture<Empty,OperationMetadata> deleteBackupAsync(String name)

Deletes a backup.

Sample code:


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

Required. The backup resource name, in the format projects/{project_number}/locations/{location}/backups/{backup_id}

Returns
TypeDescription
OperationFuture<Empty,OperationMetadata>

deleteBackupCallable()

public final UnaryCallable<DeleteBackupRequest,Operation> deleteBackupCallable()

Deletes a backup.

Sample code:


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

deleteBackupOperationCallable()

public final OperationCallable<DeleteBackupRequest,Empty,OperationMetadata> deleteBackupOperationCallable()

Deletes a backup.

Sample code:


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

deleteInstanceAsync(DeleteInstanceRequest request)

public final OperationFuture<Empty,OperationMetadata> deleteInstanceAsync(DeleteInstanceRequest request)

Deletes 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
     CloudFilestoreManagerClient.create()) {
   DeleteInstanceRequest request =
       DeleteInstanceRequest.newBuilder()
           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
           .build();
   cloudFilestoreManagerClient.deleteInstanceAsync(request).get();
 }
 
Parameter
NameDescription
requestDeleteInstanceRequest

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

Returns
TypeDescription
OperationFuture<Empty,OperationMetadata>

deleteInstanceAsync(InstanceName name)

public final OperationFuture<Empty,OperationMetadata> deleteInstanceAsync(InstanceName name)

Deletes 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
     CloudFilestoreManagerClient.create()) {
   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
   cloudFilestoreManagerClient.deleteInstanceAsync(name).get();
 }
 
Parameter
NameDescription
nameInstanceName

Required. The instance resource name, in the format projects/{project_id}/locations/{location}/instances/{instance_id}

Returns
TypeDescription
OperationFuture<Empty,OperationMetadata>

deleteInstanceAsync(String name)

public final OperationFuture<Empty,OperationMetadata> deleteInstanceAsync(String name)

Deletes 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
     CloudFilestoreManagerClient.create()) {
   String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
   cloudFilestoreManagerClient.deleteInstanceAsync(name).get();
 }
 
Parameter
NameDescription
nameString

Required. The instance resource name, in the format projects/{project_id}/locations/{location}/instances/{instance_id}

Returns
TypeDescription
OperationFuture<Empty,OperationMetadata>

deleteInstanceCallable()

public final UnaryCallable<DeleteInstanceRequest,Operation> deleteInstanceCallable()

Deletes 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
     CloudFilestoreManagerClient.create()) {
   DeleteInstanceRequest request =
       DeleteInstanceRequest.newBuilder()
           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
           .build();
   ApiFuture<Operation> future =
       cloudFilestoreManagerClient.deleteInstanceCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
TypeDescription
UnaryCallable<DeleteInstanceRequest,Operation>

deleteInstanceOperationCallable()

public final OperationCallable<DeleteInstanceRequest,Empty,OperationMetadata> deleteInstanceOperationCallable()

Deletes 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
     CloudFilestoreManagerClient.create()) {
   DeleteInstanceRequest request =
       DeleteInstanceRequest.newBuilder()
           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
           .build();
   OperationFuture<Empty, OperationMetadata> future =
       cloudFilestoreManagerClient.deleteInstanceOperationCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
TypeDescription
OperationCallable<DeleteInstanceRequest,Empty,OperationMetadata>

getBackup(BackupName name)

public final Backup getBackup(BackupName name)

Gets the details of a specific backup.

Sample code:


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

Required. The backup resource name, in the format projects/{project_number}/locations/{location}/backups/{backup_id}.

Returns
TypeDescription
Backup

getBackup(GetBackupRequest request)

public final Backup getBackup(GetBackupRequest request)

Gets the details of a specific backup.

Sample code:


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

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

Returns
TypeDescription
Backup

getBackup(String name)

public final Backup getBackup(String name)

Gets the details of a specific backup.

Sample code:


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

Required. The backup resource name, in the format projects/{project_number}/locations/{location}/backups/{backup_id}.

Returns
TypeDescription
Backup

getBackupCallable()

public final UnaryCallable<GetBackupRequest,Backup> getBackupCallable()

Gets the details of a specific backup.

Sample code:


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

getHttpJsonOperationsClient()

public final OperationsClient getHttpJsonOperationsClient()

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

Returns
TypeDescription
OperationsClient

getInstance(GetInstanceRequest request)

public final Instance getInstance(GetInstanceRequest request)

Gets the details of a specific 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
     CloudFilestoreManagerClient.create()) {
   GetInstanceRequest request =
       GetInstanceRequest.newBuilder()
           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
           .build();
   Instance response = cloudFilestoreManagerClient.getInstance(request);
 }
 
Parameter
NameDescription
requestGetInstanceRequest

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

Returns
TypeDescription
Instance

getInstance(InstanceName name)

public final Instance getInstance(InstanceName name)

Gets the details of a specific 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
     CloudFilestoreManagerClient.create()) {
   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
   Instance response = cloudFilestoreManagerClient.getInstance(name);
 }
 
Parameter
NameDescription
nameInstanceName

Required. The instance resource name, in the format projects/{project_id}/locations/{location}/instances/{instance_id}.

Returns
TypeDescription
Instance

getInstance(String name)

public final Instance getInstance(String name)

Gets the details of a specific 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
     CloudFilestoreManagerClient.create()) {
   String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
   Instance response = cloudFilestoreManagerClient.getInstance(name);
 }
 
Parameter
NameDescription
nameString

Required. The instance resource name, in the format projects/{project_id}/locations/{location}/instances/{instance_id}.

Returns
TypeDescription
Instance

getInstanceCallable()

public final UnaryCallable<GetInstanceRequest,Instance> getInstanceCallable()

Gets the details of a specific 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
     CloudFilestoreManagerClient.create()) {
   GetInstanceRequest request =
       GetInstanceRequest.newBuilder()
           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
           .build();
   ApiFuture<Instance> future =
       cloudFilestoreManagerClient.getInstanceCallable().futureCall(request);
   // Do something.
   Instance response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<GetInstanceRequest,Instance>

getOperationsClient()

public final OperationsClient getOperationsClient()

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

Returns
TypeDescription
OperationsClient

getSettings()

public final CloudFilestoreManagerSettings getSettings()
Returns
TypeDescription
CloudFilestoreManagerSettings

getStub()

public CloudFilestoreManagerStub getStub()
Returns
TypeDescription
CloudFilestoreManagerStub

isShutdown()

public boolean isShutdown()
Returns
TypeDescription
boolean

isTerminated()

public boolean isTerminated()
Returns
TypeDescription
boolean

listBackups(ListBackupsRequest request)

public final CloudFilestoreManagerClient.ListBackupsPagedResponse listBackups(ListBackupsRequest request)

Lists all backups in a project for either a specified location or for all locations.

Sample code:


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

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

Returns
TypeDescription
CloudFilestoreManagerClient.ListBackupsPagedResponse

listBackups(LocationName parent)

public final CloudFilestoreManagerClient.ListBackupsPagedResponse listBackups(LocationName parent)

Lists all backups in a project for either a specified location or for all locations.

Sample code:


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

Required. The project and location for which to retrieve backup information, in the format projects/{project_number}/locations/{location}. In Cloud Filestore, backup locations map to GCP regions, for example **us-west1**. To retrieve backup information for all locations, use "-" for the {location} value.

Returns
TypeDescription
CloudFilestoreManagerClient.ListBackupsPagedResponse

listBackups(String parent)

public final CloudFilestoreManagerClient.ListBackupsPagedResponse listBackups(String parent)

Lists all backups in a project for either a specified location or for all locations.

Sample code:


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

Required. The project and location for which to retrieve backup information, in the format projects/{project_number}/locations/{location}. In Cloud Filestore, backup locations map to GCP regions, for example **us-west1**. To retrieve backup information for all locations, use "-" for the {location} value.

Returns
TypeDescription
CloudFilestoreManagerClient.ListBackupsPagedResponse

listBackupsCallable()

public final UnaryCallable<ListBackupsRequest,ListBackupsResponse> listBackupsCallable()

Lists all backups in a project for either a specified location or for all locations.

Sample code:


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

listBackupsPagedCallable()

public final UnaryCallable<ListBackupsRequest,CloudFilestoreManagerClient.ListBackupsPagedResponse> listBackupsPagedCallable()

Lists all backups in a project for either a specified location or for all locations.

Sample code:


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

listInstances(ListInstancesRequest request)

public final CloudFilestoreManagerClient.ListInstancesPagedResponse listInstances(ListInstancesRequest request)

Lists all instances in a project for either a specified location or for all locations.

Sample code:


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

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

Returns
TypeDescription
CloudFilestoreManagerClient.ListInstancesPagedResponse

listInstances(LocationName parent)

public final CloudFilestoreManagerClient.ListInstancesPagedResponse listInstances(LocationName parent)

Lists all instances in a project for either a specified location or for all locations.

Sample code:


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

Required. The project and location for which to retrieve instance information, in the format projects/{project_id}/locations/{location}. In Cloud Filestore, locations map to GCP zones, for example **us-west1-b**. To retrieve instance information for all locations, use "-" for the {location} value.

Returns
TypeDescription
CloudFilestoreManagerClient.ListInstancesPagedResponse

listInstances(String parent)

public final CloudFilestoreManagerClient.ListInstancesPagedResponse listInstances(String parent)

Lists all instances in a project for either a specified location or for all locations.

Sample code:


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

Required. The project and location for which to retrieve instance information, in the format projects/{project_id}/locations/{location}. In Cloud Filestore, locations map to GCP zones, for example **us-west1-b**. To retrieve instance information for all locations, use "-" for the {location} value.

Returns
TypeDescription
CloudFilestoreManagerClient.ListInstancesPagedResponse

listInstancesCallable()

public final UnaryCallable<ListInstancesRequest,ListInstancesResponse> listInstancesCallable()

Lists all instances in a project for either a specified location or for all locations.

Sample code:


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

listInstancesPagedCallable()

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

Lists all instances in a project for either a specified location or for all locations.

Sample code:


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

restoreInstanceAsync(RestoreInstanceRequest request)

public final OperationFuture<Instance,OperationMetadata> restoreInstanceAsync(RestoreInstanceRequest request)

Restores an existing instance's file share from a backup.

The capacity of the instance needs to be equal to or larger than the capacity of the backup (and also equal to or larger than the minimum capacity of the tier).

Sample code:


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

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

Returns
TypeDescription
OperationFuture<Instance,OperationMetadata>

restoreInstanceCallable()

public final UnaryCallable<RestoreInstanceRequest,Operation> restoreInstanceCallable()

Restores an existing instance's file share from a backup.

The capacity of the instance needs to be equal to or larger than the capacity of the backup (and also equal to or larger than the minimum capacity of the tier).

Sample code:


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

restoreInstanceOperationCallable()

public final OperationCallable<RestoreInstanceRequest,Instance,OperationMetadata> restoreInstanceOperationCallable()

Restores an existing instance's file share from a backup.

The capacity of the instance needs to be equal to or larger than the capacity of the backup (and also equal to or larger than the minimum capacity of the tier).

Sample code:


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

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

updateBackupAsync(Backup backup, FieldMask updateMask)

public final OperationFuture<Backup,OperationMetadata> updateBackupAsync(Backup backup, FieldMask updateMask)

Updates the settings of a specific backup.

Sample code:


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

Required. A backup resource

updateMaskFieldMask

Required. Mask of fields to update. At least one path must be supplied in this field.

Returns
TypeDescription
OperationFuture<Backup,OperationMetadata>

updateBackupAsync(UpdateBackupRequest request)

public final OperationFuture<Backup,OperationMetadata> updateBackupAsync(UpdateBackupRequest request)

Updates the settings of a specific backup.

Sample code:


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

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

Returns
TypeDescription
OperationFuture<Backup,OperationMetadata>

updateBackupCallable()

public final UnaryCallable<UpdateBackupRequest,Operation> updateBackupCallable()

Updates the settings of a specific backup.

Sample code:


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

updateBackupOperationCallable()

public final OperationCallable<UpdateBackupRequest,Backup,OperationMetadata> updateBackupOperationCallable()

Updates the settings of a specific backup.

Sample code:


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

updateInstanceAsync(Instance instance, FieldMask updateMask)

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

Updates the settings of a specific 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
     CloudFilestoreManagerClient.create()) {
   Instance instance = Instance.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   Instance response =
       cloudFilestoreManagerClient.updateInstanceAsync(instance, updateMask).get();
 }
 
Parameters
NameDescription
instanceInstance

Only fields specified in update_mask are updated.

updateMaskFieldMask

Mask of fields to update. At least one path must be supplied in this field. The elements of the repeated paths field may only include these fields:

  • "description"
  • "file_shares"
  • "labels"

Returns
TypeDescription
OperationFuture<Instance,OperationMetadata>

updateInstanceAsync(UpdateInstanceRequest request)

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

Updates the settings of a specific 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
     CloudFilestoreManagerClient.create()) {
   UpdateInstanceRequest request =
       UpdateInstanceRequest.newBuilder()
           .setUpdateMask(FieldMask.newBuilder().build())
           .setInstance(Instance.newBuilder().build())
           .build();
   Instance response = cloudFilestoreManagerClient.updateInstanceAsync(request).get();
 }
 
Parameter
NameDescription
requestUpdateInstanceRequest

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

Returns
TypeDescription
OperationFuture<Instance,OperationMetadata>

updateInstanceCallable()

public final UnaryCallable<UpdateInstanceRequest,Operation> updateInstanceCallable()

Updates the settings of a specific 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
     CloudFilestoreManagerClient.create()) {
   UpdateInstanceRequest request =
       UpdateInstanceRequest.newBuilder()
           .setUpdateMask(FieldMask.newBuilder().build())
           .setInstance(Instance.newBuilder().build())
           .build();
   ApiFuture<Operation> future =
       cloudFilestoreManagerClient.updateInstanceCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
TypeDescription
UnaryCallable<UpdateInstanceRequest,Operation>

updateInstanceOperationCallable()

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

Updates the settings of a specific 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 (CloudFilestoreManagerClient cloudFilestoreManagerClient =
     CloudFilestoreManagerClient.create()) {
   UpdateInstanceRequest request =
       UpdateInstanceRequest.newBuilder()
           .setUpdateMask(FieldMask.newBuilder().build())
           .setInstance(Instance.newBuilder().build())
           .build();
   OperationFuture<Instance, OperationMetadata> future =
       cloudFilestoreManagerClient.updateInstanceOperationCallable().futureCall(request);
   // Do something.
   Instance response = future.get();
 }
 
Returns
TypeDescription
OperationCallable<UpdateInstanceRequest,Instance,OperationMetadata>