Class CloudFilestoreManagerClient (1.20.0)

public class CloudFilestoreManagerClient implements BackgroundResource

Service Description: Configures and manages Filestore resources.

Filestore Manager v1beta1.

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

  • 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, Filestore instances are resources of the form: /projects/{project_id}/locations/{location_id}/instances/{instance_id} backups are resources of the form: /projects/{project_id}/locations/{location_id}/backup/{backup_id}

Note that location_id can represent a GCP zone or region depending on the resource. for example: A zonal Filestore instance:

  • projects/my-project/locations/us-central1-c/instances/my-basic-tier-filer A regional Filestore instance:
  • projects/my-project/locations/us-central1/instances/my-enterprise-filer

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_id}/locations/{location}. In 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.

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_id}/locations/{location}. In 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.

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 Filestore, locations map to GCP zones, for example **us-west1-b**.

instanceInstance

Required. An instance resource

instanceIdString

Required. The ID of the instance to create. 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.

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 Filestore, locations map to GCP zones, for example **us-west1-b**.

instanceInstance

Required. An instance resource

instanceIdString

Required. The ID of the instance to create. 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.

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>

createShareAsync(CreateShareRequest request)

public final OperationFuture<Share,OperationMetadata> createShareAsync(CreateShareRequest request)

Creates a share.

Sample code:


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

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

Returns
TypeDescription
OperationFuture<Share,OperationMetadata>

createShareAsync(InstanceName parent, Share share, String shareId)

public final OperationFuture<Share,OperationMetadata> createShareAsync(InstanceName parent, Share share, String shareId)

Creates a share.

Sample code:


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

Required. The Filestore Instance to create the share for, in the format projects/{project_id}/locations/{location}/instances/{instance_id}

shareShare

Required. A share resource

shareIdString

Required. The ID to use for the share. The ID must be unique within the specified instance.

This value must start with a lowercase letter followed by up to 62 lowercase letters, numbers, or hyphens, and cannot end with a hyphen.

Returns
TypeDescription
OperationFuture<Share,OperationMetadata>

createShareAsync(String parent, Share share, String shareId)

public final OperationFuture<Share,OperationMetadata> createShareAsync(String parent, Share share, String shareId)

Creates a share.

Sample code:


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

Required. The Filestore Instance to create the share for, in the format projects/{project_id}/locations/{location}/instances/{instance_id}

shareShare

Required. A share resource

shareIdString

Required. The ID to use for the share. The ID must be unique within the specified instance.

This value must start with a lowercase letter followed by up to 62 lowercase letters, numbers, or hyphens, and cannot end with a hyphen.

Returns
TypeDescription
OperationFuture<Share,OperationMetadata>

createShareCallable()

public final UnaryCallable<CreateShareRequest,Operation> createShareCallable()

Creates a share.

Sample code:


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

createShareOperationCallable()

public final OperationCallable<CreateShareRequest,Share,OperationMetadata> createShareOperationCallable()

Creates a share.

Sample code:


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

createSnapshotAsync(CreateSnapshotRequest request)

public final OperationFuture<Snapshot,OperationMetadata> createSnapshotAsync(CreateSnapshotRequest request)

Creates a snapshot.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying 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()) {
   CreateSnapshotRequest request =
       CreateSnapshotRequest.newBuilder()
           .setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
           .setSnapshotId("snapshotId-1113817601")
           .setSnapshot(Snapshot.newBuilder().build())
           .build();
   Snapshot response = cloudFilestoreManagerClient.createSnapshotAsync(request).get();
 }
 
Parameter
NameDescription
requestCreateSnapshotRequest

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

Returns
TypeDescription
OperationFuture<Snapshot,OperationMetadata>

createSnapshotAsync(InstanceName parent, Snapshot snapshot, String snapshotId)

public final OperationFuture<Snapshot,OperationMetadata> createSnapshotAsync(InstanceName parent, Snapshot snapshot, String snapshotId)

Creates a snapshot.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying 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 parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
   Snapshot snapshot = Snapshot.newBuilder().build();
   String snapshotId = "snapshotId-1113817601";
   Snapshot response =
       cloudFilestoreManagerClient.createSnapshotAsync(parent, snapshot, snapshotId).get();
 }
 
Parameters
NameDescription
parentInstanceName

Required. The Filestore Instance to create the snapshots of, in the format projects/{project_id}/locations/{lo