CloudFilestoreManagerClient

CloudFilestoreManagerClient

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

Constructor

new CloudFilestoreManagerClient(optionsopt, gaxInstanceopt)

Construct an instance of CloudFilestoreManagerClient.

Parameters:
Name Type Attributes Description
options object <optional>

The configuration object. The options accepted by the constructor are described in detail in this document. The common options are:

Properties
Name Type Attributes Description
credentials object <optional>

Credentials object.

Properties
Name Type Attributes Description
client_email string <optional>
private_key string <optional>
email string <optional>

Account email address. Required when using a .pem or .p12 keyFilename.

keyFilename string <optional>

Full path to the a .json, .pem, or .p12 key downloaded from the Google Developers Console. If you provide a path to a JSON file, the projectId option below is not necessary. NOTE: .pem and .p12 require you to specify options.email as well.

port number <optional>

The port on which to connect to the remote host.

projectId string <optional>

The project ID from the Google Developer's Console, e.g. 'grape-spaceship-123'. We will also check the environment variable GCLOUD_PROJECT for your project ID. If your app is running in an environment which supports Application Default Credentials, your project ID will be detected automatically.

apiEndpoint string <optional>

The domain name of the API remote host.

clientConfig gax.ClientConfig <optional>

Client configuration override. Follows the structure of gapicConfig.

fallback boolean | "rest" <optional>

Use HTTP fallback mode. Pass "rest" to use HTTP/1.1 REST API instead of gRPC. For more information, please check the documentation.

gaxInstance gax <optional>

loaded instance of google-gax. Useful if you need to avoid loading the default gRPC version and want to use the fallback HTTP implementation. Load only fallback version and pass it to the constructor: const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC const client = new CloudFilestoreManagerClient({fallback: 'rest'}, gax);

Members

apiEndpoint

The DNS address for this API service - same as servicePath(), exists for compatibility reasons.

port

The port for this API service.

scopes

The scopes needed to make gRPC calls for every method defined in this service.

servicePath

The DNS address for this API service.

Methods

backupPath(project, location, backup) → {string}

Return a fully-qualified backup resource name string.

Parameters:
Name Type Description
project string
location string
backup string
Returns:
Type Description
string

Resource name string.

cancelOperation(request, optionsopt, callbackopt) → {Promise}

Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
name string

The name of the operation resource to be cancelled.

options Object <optional>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback function <optional>

The function which will be called with the result of the API call.

Returns:
Type Description
Promise
  • The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call.
Example
```
const client = longrunning.operationsClient();
await client.cancelOperation({name: ''});
```

(async) checkCreateBackupProgress(name) → {Promise}

Check the status of the long running operation returned by createBackup().

Parameters:
Name Type Description
name String

The operation name that will be passed.

Returns:
Type Description
Promise
  • The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.
Example
  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  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**.
   */
  // const parent = 'abc123'
  /**
   *  Required. A backup resource google.cloud.filestore.v1beta1.Backup 
   */
  // const backup = {}
  /**
   *  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.
   */
  // const backupId = 'abc123'

  // Imports the Filestore library
  const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1;

  // Instantiates a client
  const filestoreClient = new CloudFilestoreManagerClient();

  async function callCreateBackup() {
    // Construct request
    const request = {
      parent,
      backup,
      backupId,
    };

    // Run request
    const [operation] = await filestoreClient.createBackup(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCreateBackup();

(async) checkCreateInstanceProgress(name) → {Promise}

Check the status of the long running operation returned by createInstance().

Parameters:
Name Type Description
name String

The operation name that will be passed.

Returns:
Type Description
Promise
  • The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.
Example
  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  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**.
   */
  // const parent = 'abc123'
  /**
   *  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.
   */
  // const instanceId = 'abc123'
  /**
   *  Required. An instance resource google.cloud.filestore.v1beta1.Instance 
   */
  // const instance = {}

  // Imports the Filestore library
  const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1;

  // Instantiates a client
  const filestoreClient = new CloudFilestoreManagerClient();

  async function callCreateInstance() {
    // Construct request
    const request = {
      parent,
      instanceId,
      instance,
    };

    // Run request
    const [operation] = await filestoreClient.createInstance(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCreateInstance();

(async) checkCreateShareProgress(name) → {Promise}

Check the status of the long running operation returned by createShare().

Parameters:
Name Type Description
name String

The operation name that will be passed.

Returns:
Type Description
Promise
  • The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.
Example
  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The Filestore Instance to create the share for, in the format
   *  `projects/{project_id}/locations/{location}/instances/{instance_id}`
   */
  // const parent = 'abc123'
  /**
   *  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.
   */
  // const shareId = 'abc123'
  /**
   *  Required. A share resource
   */
  // const share = {}

  // Imports the Filestore library
  const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1;

  // Instantiates a client
  const filestoreClient = new CloudFilestoreManagerClient();

  async function callCreateShare() {
    // Construct request
    const request = {
      parent,
      shareId,
      share,
    };

    // Run request
    const [operation] = await filestoreClient.createShare(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCreateShare();

(async) checkCreateSnapshotProgress(name) → {Promise}

Check the status of the long running operation returned by createSnapshot().

Parameters:
Name Type Description
name String

The operation name that will be passed.

Returns:
Type Description
Promise
  • The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.
Example
  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The Filestore Instance to create the snapshots of, in the format
   *  `projects/{project_id}/locations/{location}/instances/{instance_id}`
   */
  // const parent = 'abc123'
  /**
   *  Required. The ID to use for the snapshot.
   *  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.
   */
  // const snapshotId = 'abc123'
  /**
   *  Required. A snapshot resource
   */
  // const snapshot = {}

  // Imports the Filestore library
  const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1;

  // Instantiates a client
  const filestoreClient = new CloudFilestoreManagerClient();

  async function callCreateSnapshot() {
    // Construct request
    const request = {
      parent,
      snapshotId,
      snapshot,
    };

    // Run request
    const [operation] = await filestoreClient.createSnapshot(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCreateSnapshot();

(async) checkDeleteBackupProgress(name) → {Promise}

Check the status of the long running operation returned by deleteBackup().

Parameters:
Name Type Description
name String

The operation name that will be passed.

Returns:
Type Description
Promise
  • The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.
Example
  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The backup resource name, in the format
   *  `projects/{project_id}/locations/{location}/backups/{backup_id}`
   */
  // const name = 'abc123'

  // Imports the Filestore library
  const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1;

  // Instantiates a client
  const filestoreClient = new CloudFilestoreManagerClient();

  async function callDeleteBackup() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await filestoreClient.deleteBackup(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callDeleteBackup();

(async) checkDeleteInstanceProgress(name) → {Promise}

Check the status of the long running operation returned by deleteInstance().

Parameters:
Name Type Description
name String

The operation name that will be passed.

Returns:
Type Description
Promise
  • The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.
Example
  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The instance resource name, in the format
   *  `projects/{project_id}/locations/{location}/instances/{instance_id}`
   */
  // const name = 'abc123'
  /**
   *  If set to true, any snapshots of the instance will also be deleted.
   *  (Otherwise, the request will only work if the instance has no snapshots.)
   */
  // const force = true

  // Imports the Filestore library
  const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1;

  // Instantiates a client
  const filestoreClient = new CloudFilestoreManagerClient();

  async function callDeleteInstance() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await filestoreClient.deleteInstance(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callDeleteInstance();

(async) checkDeleteShareProgress(name) → {Promise}

Check the status of the long running operation returned by deleteShare().

Parameters:
Name Type Description
name String

The operation name that will be passed.

Returns:
Type Description
Promise
  • The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.
Example
  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The share resource name, in the format
   *  `projects/{project_id}/locations/{location}/instances/{instance_id}/share/{share_id}`
   */
  // const name = 'abc123'

  // Imports the Filestore library
  const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1;

  // Instantiates a client
  const filestoreClient = new CloudFilestoreManagerClient();

  async function callDeleteShare() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await filestoreClient.deleteShare(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callDeleteShare();

(async) checkDeleteSnapshotProgress(name) → {Promise}

Check the status of the long running operation returned by deleteSnapshot().

Parameters:
Name Type Description
name String

The operation name that will be passed.

Returns:
Type Description
Promise
  • The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.
Example
  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The snapshot resource name, in the format
   *  `projects/{project_id}/locations/{location}/instances/{instance_id}/snapshots/{snapshot_id}`
   */
  // const name = 'abc123'

  // Imports the Filestore library
  const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1;

  // Instantiates a client
  const filestoreClient = new CloudFilestoreManagerClient();

  async function callDeleteSnapshot() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await filestoreClient.deleteSnapshot(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callDeleteSnapshot();

(async) checkRestoreInstanceProgress(name) → {Promise}

Check the status of the long running operation returned by restoreInstance().

Parameters:
Name Type Description
name String

The operation name that will be passed.

Returns:
Type Description
Promise
  • The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.
Example
  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The resource name of the instance, in the format
   *  `projects/{project_id}/locations/{location_id}/instances/{instance_id}`.
   */
  // const name = 'abc123'
  /**
   *  Required. Name of the file share in the Filestore instance that the snapshot
   *  is being restored to.
   */
  // const fileShare = 'abc123'
  /**
   *  The resource name of the snapshot, in the format
   *  `projects/{project_id}/locations/{location_id}/snapshots/{snapshot_id}`.
   */
  // const sourceSnapshot = 'abc123'
  /**
   *  The resource name of the backup, in the format
   *  `projects/{project_id}/locations/{location_id}/backups/{backup_id}`.
   */
  // const sourceBackup = 'abc123'

  // Imports the Filestore library
  const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1;

  // Instantiates a client
  const filestoreClient = new CloudFilestoreManagerClient();

  async function callRestoreInstance() {
    // Construct request
    const request = {
      name,
      fileShare,
    };

    // Run request
    const [operation] = await filestoreClient.restoreInstance(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callRestoreInstance();

(async) checkRevertInstanceProgress(name) → {Promise}

Check the status of the long running operation returned by revertInstance().

Parameters:
Name Type Description
name String

The operation name that will be passed.

Returns:
Type Description
Promise
  • The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.
Example
  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. projects/{project_id}/locations/{location_id}/instances/{instance_id}.
   *  The resource name of the instance, in the format
   */
  // const name = 'abc123'
  /**
   *  Required. The snapshot resource ID, in the format 'my-snapshot', where the specified
   *  ID is the {snapshot_id} of the fully qualified name like
   *  projects/{project_id}/locations/{location_id}/instances/{instance_id}/snapshots/{snapshot_id}
   */
  // const targetSnapshotId = 'abc123'

  // Imports the Filestore library
  const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1;

  // Instantiates a client
  const filestoreClient = new CloudFilestoreManagerClient();

  async function callRevertInstance() {
    // Construct request
    const request = {
      name,
      targetSnapshotId,
    };

    // Run request
    const [operation] = await filestoreClient.revertInstance(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callRevertInstance();

(async) checkUpdateBackupProgress(name) → {Promise}

Check the status of the long running operation returned by updateBackup().

Parameters:
Name Type Description
name String

The operation name that will be passed.

Returns:
Type Description
Promise
  • The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.
Example
  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. A backup resource google.cloud.filestore.v1beta1.Backup 
   */
  // const backup = {}
  /**
   *  Required. Mask of fields to update.  At least one path must be supplied in this
   *  field.
   */
  // const updateMask = {}

  // Imports the Filestore library
  const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1;

  // Instantiates a client
  const filestoreClient = new CloudFilestoreManagerClient();

  async function callUpdateBackup() {
    // Construct request
    const request = {
      backup,
      updateMask,
    };

    // Run request
    const [operation] = await filestoreClient.updateBackup(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callUpdateBackup();

(async) checkUpdateInstanceProgress(name) → {Promise}

Check the status of the long running operation returned by updateInstance().

Parameters:
Name Type Description
name String

The operation name that will be passed.

Returns:
Type Description
Promise
  • The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.
Example
  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. 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"
   */
  // const updateMask = {}
  /**
   *  Required. Only fields specified in update_mask are updated.
   */
  // const instance = {}

  // Imports the Filestore library
  const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1;

  // Instantiates a client
  const filestoreClient = new CloudFilestoreManagerClient();

  async function callUpdateInstance() {
    // Construct request
    const request = {
      updateMask,
      instance,
    };

    // Run request
    const [operation] = await filestoreClient.updateInstance(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callUpdateInstance();

(async) checkUpdateShareProgress(name) → {Promise}

Check the status of the long running operation returned by updateShare().

Parameters:
Name Type Description
name String

The operation name that will be passed.

Returns:
Type Description
Promise
  • The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.
Example
  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. A share resource.
   *  Only fields specified in update_mask are updated.
   */
  // const share = {}
  /**
   *  Required. 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"
   *  * "capacity_gb"
   *  * "labels"
   *  * "nfs_export_options"
   */
  // const updateMask = {}

  // Imports the Filestore library
  const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1;

  // Instantiates a client
  const filestoreClient = new CloudFilestoreManagerClient();

  async function callUpdateShare() {
    // Construct request
    const request = {
      share,
      updateMask,
    };

    // Run request
    const [operation] = await filestoreClient.updateShare(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callUpdateShare();

(async) checkUpdateSnapshotProgress(name) → {Promise}

Check the status of the long running operation returned by updateSnapshot().

Parameters:
Name Type Description
name String

The operation name that will be passed.

Returns:
Type Description
Promise
  • The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.
Example
  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Mask of fields to update.  At least one path must be supplied in this
   *  field.
   */
  // const updateMask = {}
  /**
   *  Required. A snapshot resource
   */
  // const snapshot = {}

  // Imports the Filestore library
  const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1;

  // Instantiates a client
  const filestoreClient = new CloudFilestoreManagerClient();

  async function callUpdateSnapshot() {
    // Construct request
    const request = {
      updateMask,
      snapshot,
    };

    // Run request
    const [operation] = await filestoreClient.updateSnapshot(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callUpdateSnapshot();

close() → {Promise}

Terminate the gRPC channel and close the client.

The client will no longer be usable and all future behavior is undefined.

Returns:
Type Description
Promise

A promise that resolves when the client is closed.

deleteOperation(request, optionsopt, callbackopt) → {Promise}

Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
name string

The name of the operation resource to be deleted.

options Object <optional>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback function <optional>

The function which will be called with the result of the API call.

Returns:
Type Description
Promise
  • The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call.
Example
```
const client = longrunning.operationsClient();
await client.deleteOperation({name: ''});
```

getLocation(request, optionsopt) → {Promise}

Gets information about a location.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
name string

Resource name for the location.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Promise
  • The promise which resolves to an array. The first element of the array is an object representing Location. Please see the documentation for more details and examples.
Example
```
const [response] = await client.getLocation(request);
```

getOperation(request, optionsopt, callbackopt) → {Promise}

Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
name string

The name of the operation resource.

options Object <optional>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback function <optional>

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing google.longrunning.Operation.

Returns:
Type Description
Promise
  • The promise which resolves to an array. The first element of the array is an object representing google.longrunning.Operation. The promise has a method named "cancel" which cancels the ongoing API call.
Example
```
const client = longrunning.operationsClient();
const name = '';
const [response] = await client.getOperation({name});
// doThingsWith(response)
```

getProjectId() → {Promise}

Return the project ID used by this class.

Returns:
Type Description
Promise

A promise that resolves to string containing the project ID.

initialize() → {Promise}

Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.

You can await on this method if you want to make sure the client is initialized.

Returns:
Type Description
Promise

A promise that resolves to an authenticated service stub.

instancePath(project, location, instance) → {string}

Return a fully-qualified instance resource name string.

Parameters:
Name Type Description
project string
location string
instance string
Returns:
Type Description
string

Resource name string.

listBackupsAsync(request, optionsopt) → {Object}

Equivalent to listBackups, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
parent string

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

pageSize number

The maximum number of items to return.

pageToken string

The next_page_token value to use if there are additional results to retrieve for this list request.

orderBy string

Sort results. Supported values are "name", "name desc" or "" (unsorted).

filter string

List filter.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Object

An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing Backup. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example
  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The project and location for which to retrieve backup information,
   *  in the format `projects/{project_id}/locations/{location}`.
   *  In Filestore, backup locations map to GCP regions,
   *  for example **us-west1**.
   *  To retrieve backup information for all locations, use "-" for the
   *  `{location}` value.
   */
  // const parent = 'abc123'
  /**
   *  The maximum number of items to return.
   */
  // const pageSize = 1234
  /**
   *  The next_page_token value to use if there are additional
   *  results to retrieve for this list request.
   */
  // const pageToken = 'abc123'
  /**
   *  Sort results. Supported values are "name", "name desc" or "" (unsorted).
   */
  // const orderBy = 'abc123'
  /**
   *  List filter.
   */
  // const filter = 'abc123'

  // Imports the Filestore library
  const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1;

  // Instantiates a client
  const filestoreClient = new CloudFilestoreManagerClient();

  async function callListBackups() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const iterable = await filestoreClient.listBackupsAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callListBackups();

listBackupsStream(request, optionsopt) → {Stream}

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
parent string

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

pageSize number

The maximum number of items to return.

pageToken string

The next_page_token value to use if there are additional results to retrieve for this list request.

orderBy string

Sort results. Supported values are "name", "name desc" or "" (unsorted).

filter string

List filter.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Stream

An object stream which emits an object representing Backup on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listBackupsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listInstancesAsync(request, optionsopt) → {Object}

Equivalent to listInstances, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
parent string

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.

pageSize number

The maximum number of items to return.

pageToken string

The next_page_token value to use if there are additional results to retrieve for this list request.

orderBy string

Sort results. Supported values are "name", "name desc" or "" (unsorted).

filter string

List filter.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Object

An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing Instance. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example
  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  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.
   */
  // const parent = 'abc123'
  /**
   *  The maximum number of items to return.
   */
  // const pageSize = 1234
  /**
   *  The next_page_token value to use if there are additional
   *  results to retrieve for this list request.
   */
  // const pageToken = 'abc123'
  /**
   *  Sort results. Supported values are "name", "name desc" or "" (unsorted).
   */
  // const orderBy = 'abc123'
  /**
   *  List filter.
   */
  // const filter = 'abc123'

  // Imports the Filestore library
  const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1;

  // Instantiates a client
  const filestoreClient = new CloudFilestoreManagerClient();

  async function callListInstances() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const iterable = await filestoreClient.listInstancesAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callListInstances();

listInstancesStream(request, optionsopt) → {Stream}

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
parent string

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.

pageSize number

The maximum number of items to return.

pageToken string

The next_page_token value to use if there are additional results to retrieve for this list request.

orderBy string

Sort results. Supported values are "name", "name desc" or "" (unsorted).

filter string

List filter.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Stream

An object stream which emits an object representing Instance on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listInstancesAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listLocationsAsync(request, optionsopt) → {Object}

Lists information about the supported locations for this service. Returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
name string

The resource that owns the locations collection, if applicable.

filter string

The standard list filter.

pageSize number

The standard list page size.

pageToken string

The standard list page token.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Object

An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing Location. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example
```
const iterable = client.listLocationsAsync(request);
for await (const response of iterable) {
  // process response
}
```

listOperationsAsync(request, optionsopt) → {Object}

Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED. Returns an iterable object.

For-await-of syntax is used with the iterable to recursively get response element on-demand.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
name string

The name of the operation collection.

filter string

The standard list filter.

pageSize number <optional>

The maximum number of resources contained in the underlying API response. If page streaming is performed per-resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page.

options Object <optional>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

Returns:
Type Description
Object

An iterable Object that conforms to iteration protocols.

Example
```
const client = longrunning.operationsClient();
for await (const response of client.listOperationsAsync(request));
// doThingsWith(response)
```

listSharesAsync(request, optionsopt) → {Object}

Equivalent to listShares, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
parent string

Required. The instance for which to retrieve share information, in the format projects/{project_id}/locations/{location}/instances/{instance_id}.

pageSize number

The maximum number of items to return.

pageToken string

The next_page_token value to use if there are additional results to retrieve for this list request.

orderBy string

Sort results. Supported values are "name", "name desc" or "" (unsorted).

filter string

List filter.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Object

An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing Share. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example
  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The instance for which to retrieve share information,
   *  in the format
   *  `projects/{project_id}/locations/{location}/instances/{instance_id}`.
   */
  // const parent = 'abc123'
  /**
   *  The maximum number of items to return.
   */
  // const pageSize = 1234
  /**
   *  The next_page_token value to use if there are additional
   *  results to retrieve for this list request.
   */
  // const pageToken = 'abc123'
  /**
   *  Sort results. Supported values are "name", "name desc" or "" (unsorted).
   */
  // const orderBy = 'abc123'
  /**
   *  List filter.
   */
  // const filter = 'abc123'

  // Imports the Filestore library
  const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1;

  // Instantiates a client
  const filestoreClient = new CloudFilestoreManagerClient();

  async function callListShares() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const iterable = await filestoreClient.listSharesAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callListShares();

listSharesStream(request, optionsopt) → {Stream}

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
parent string

Required. The instance for which to retrieve share information, in the format projects/{project_id}/locations/{location}/instances/{instance_id}.

pageSize number

The maximum number of items to return.

pageToken string

The next_page_token value to use if there are additional results to retrieve for this list request.

orderBy string

Sort results. Supported values are "name", "name desc" or "" (unsorted).

filter string

List filter.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Stream

An object stream which emits an object representing Share on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listSharesAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listSnapshotsAsync(request, optionsopt) → {Object}

Equivalent to listSnapshots, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
parent string

Required. The instance for which to retrieve snapshot information, in the format projects/{project_id}/locations/{location}/instances/{instance_id}.

pageSize number

The maximum number of items to return.

pageToken string

The next_page_token value to use if there are additional results to retrieve for this list request.

orderBy string

Sort results. Supported values are "name", "name desc" or "" (unsorted).

filter string

List filter.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Object

An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing Snapshot. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example
  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The instance for which to retrieve snapshot information,
   *  in the format
   *  `projects/{project_id}/locations/{location}/instances/{instance_id}`.
   */
  // const parent = 'abc123'
  /**
   *  The maximum number of items to return.
   */
  // const pageSize = 1234
  /**
   *  The next_page_token value to use if there are additional
   *  results to retrieve for this list request.
   */
  // const pageToken = 'abc123'
  /**
   *  Sort results. Supported values are "name", "name desc" or "" (unsorted).
   */
  // const orderBy = 'abc123'
  /**
   *  List filter.
   */
  // const filter = 'abc123'

  // Imports the Filestore library
  const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1;

  // Instantiates a client
  const filestoreClient = new CloudFilestoreManagerClient();

  async function callListSnapshots() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const iterable = await filestoreClient.listSnapshotsAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callListSnapshots();

listSnapshotsStream(request, optionsopt) → {Stream}

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
parent string

Required. The instance for which to retrieve snapshot information, in the format projects/{project_id}/locations/{location}/instances/{instance_id}.

pageSize number

The maximum number of items to return.

pageToken string

The next_page_token value to use if there are additional results to retrieve for this list request.

orderBy string

Sort results. Supported values are "name", "name desc" or "" (unsorted).

filter string

List filter.

options object <optional>

Call options. See CallOptions for more details.

Returns:
Type Description
Stream

An object stream which emits an object representing Snapshot on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listSnapshotsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

locationPath(project, location) → {string}

Return a fully-qualified location resource name string.

Parameters:
Name Type Description
project string
location string
Returns:
Type Description
string

Resource name string.

matchBackupFromBackupName(backupName) → {string}

Parse the backup from Backup resource.

Parameters:
Name Type Description
backupName string

A fully-qualified path representing Backup resource.

Returns:
Type Description
string

A string representing the backup.

matchInstanceFromInstanceName(instanceName) → {string}

Parse the instance from Instance resource.

Parameters:
Name Type Description
instanceName string

A fully-qualified path representing Instance resource.

Returns:
Type Description
string

A string representing the instance.

matchInstanceFromShareName(shareName) → {string}

Parse the instance from Share resource.

Parameters:
Name Type Description
shareName string

A fully-qualified path representing Share resource.

Returns:
Type Description
string

A string representing the instance.

matchInstanceFromSnapshotName(snapshotName) → {string}

Parse the instance from Snapshot resource.

Parameters:
Name Type Description
snapshotName string

A fully-qualified path representing Snapshot resource.

Returns:
Type Description
string

A string representing the instance.

matchLocationFromBackupName(backupName) → {string}

Parse the location from Backup resource.

Parameters:
Name Type Description
backupName string

A fully-qualified path representing Backup resource.

Returns:
Type Description
string

A string representing the location.

matchLocationFromInstanceName(instanceName) → {string}

Parse the location from Instance resource.

Parameters:
Name Type Description
instanceName string

A fully-qualified path representing Instance resource.

Returns:
Type Description
string

A string representing the location.

matchLocationFromLocationName(locationName) → {string}

Parse the location from Location resource.

Parameters:
Name Type Description
locationName string

A fully-qualified path representing Location resource.

Returns:
Type Description
string

A string representing the location.

matchLocationFromShareName(shareName) → {string}

Parse the location from Share resource.

Parameters:
Name Type Description
shareName string

A fully-qualified path representing Share resource.

Returns:
Type Description
string

A string representing the location.

matchLocationFromSnapshotName(snapshotName) → {string}

Parse the location from Snapshot resource.

Parameters:
Name Type Description
snapshotName string

A fully-qualified path representing Snapshot resource.

Returns:
Type Description
string

A string representing the location.

matchProjectFromBackupName(backupName) → {string}

Parse the project from Backup resource.

Parameters:
Name Type Description
backupName string

A fully-qualified path representing Backup resource.

Returns:
Type Description
string

A string representing the project.

matchProjectFromInstanceName(instanceName) → {string}

Parse the project from Instance resource.

Parameters:
Name Type Description
instanceName string

A fully-qualified path representing Instance resource.

Returns:
Type Description
string

A string representing the project.

matchProjectFromLocationName(locationName) → {string}

Parse the project from Location resource.

Parameters:
Name Type Description
locationName string

A fully-qualified path representing Location resource.

Returns:
Type Description
string

A string representing the project.

matchProjectFromShareName(shareName) → {string}

Parse the project from Share resource.

Parameters:
Name Type Description
shareName string

A fully-qualified path representing Share resource.

Returns:
Type Description
string

A string representing the project.

matchProjectFromSnapshotName(snapshotName) → {string}

Parse the project from Snapshot resource.

Parameters:
Name Type Description
snapshotName string

A fully-qualified path representing Snapshot resource.

Returns:
Type Description
string

A string representing the project.

matchShareFromShareName(shareName) → {string}

Parse the share from Share resource.

Parameters:
Name Type Description
shareName string

A fully-qualified path representing Share resource.

Returns:
Type Description
string

A string representing the share.

matchSnapshotFromSnapshotName(snapshotName) → {string}

Parse the snapshot from Snapshot resource.

Parameters:
Name Type Description
snapshotName string

A fully-qualified path representing Snapshot resource.

Returns:
Type Description
string

A string representing the snapshot.

sharePath(project, location, instance, share) → {string}

Return a fully-qualified share resource name string.

Parameters:
Name Type Description
project string
location string
instance string
share string
Returns:
Type Description
string

Resource name string.

snapshotPath(project, location, instance, snapshot) → {string}

Return a fully-qualified snapshot resource name string.

Parameters:
Name Type Description
project string
location string
instance string
snapshot string
Returns:
Type Description
string

Resource name string.