AppProfile

AppProfile

Create an app profile object to interact with your app profile.

Constructor

new AppProfile(instance, name)

Parameters:
Name Type Description
instance Instance

The parent instance of this app profile.

name string

Name of the app profile.

Source:
Example
const Bigtable = require('@google-cloud/bigtable');
const bigtable = new Bigtable();
const instance = bigtable.instance('my-instance');
const appProfile = instance.appProfile('my-app-profile');

Methods

create(optionsopt)

Create an app profile.

Parameters:
Name Type Attributes Description
options object <optional>

See Instance#createAppProfile.

Source:
Example
    const Bigtable = require('@google-cloud/bigtable');
    const bigtable = new Bigtable();
    const instance = bigtable.instance(instanceId);

    const cluster = instance.cluster(clusterId);

    const options = {
      routing: cluster,
      allowTransactionalWrites: true,
      ignoreWarnings: true,
    };

    instance.createAppProfile(appProfileId, options, (err, appProfile) => {
      if (err) {
        // Handle the error.
        return callback(err);
      }
      return callback(appProfile);
    });

delete(optionsopt, callbackopt)

Delete the app profile.

Parameters:
Name Type Attributes Description
options object <optional>

Cluster creation options.

Properties
Name Type Attributes Description
gaxOptions object <optional>

Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/global.html#CallOptions.

ignoreWarnings boolean <optional>

Whether to ignore safety checks when deleting the app profile.

callback function <optional>

The callback function.

Properties
Name Type Attributes Description
err error <nullable>

An error returned while making this request.

apiResponse object

The full API response.

Source:
Example
    const Bigtable = require('@google-cloud/bigtable');
    const bigtable = new Bigtable();
    const instance = bigtable.instance(instanceId);
    const appProfile = instance.appProfile(appProfileId);

    appProfile
      .delete()
      .then(result => {
        const apiResponse = result[0];
      })
      .catch(err => {
        // Handle the error.
      });

exists(gaxOptionsopt, callback)

Check if an app profile exists.

Parameters:
Name Type Attributes Description
gaxOptions object <optional>

Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/CallSettings.html.

callback function

The callback function.

Properties
Name Type Attributes Description
err error <nullable>

An error returned while making this request.

exists boolean

Whether the app profile exists or not.

Source:
Example
    const Bigtable = require('@google-cloud/bigtable');
    const bigtable = new Bigtable();
    const instance = bigtable.instance(instanceId);
    const appProfile = instance.appProfile(appProfileId);

    appProfile
      .exists()
      .then(result => {
        const exists = result[0];
      })
      .catch(err => {
        // Handle the error.
      });

get(gaxOptionsopt)

Get a appProfile if it exists.

Parameters:
Name Type Attributes Description
gaxOptions object <optional>

Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/CallSettings.html.

Source:
Example
    const Bigtable = require('@google-cloud/bigtable');
    const bigtable = new Bigtable();
    const instance = bigtable.instance(instanceId);
    const appProfile = instance.appProfile(appProfileId);

    appProfile
      .get()
      .then(result => {
        const appProfile = result[0];
        const apiResponse = result[1];
      })
      .catch(err => {
        // Handle the error.
      });

getMetadata(gaxOptionsopt, callback)

Get the app profile metadata.

Parameters:
Name Type Attributes Description
gaxOptions object <optional>

Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/CallSettings.html.

callback function

The callback function.

Properties
Name Type Attributes Description
err error <nullable>

An error returned while making this request.

metadata object

The metadata.

apiResponse object

The full API response.

Source:
Example
    const Bigtable = require('@google-cloud/bigtable');
    const bigtable = new Bigtable();
    const instance = bigtable.instance(instanceId);
    const appProfile = instance.appProfile(appProfileId);

    appProfile
      .getMetadata()
      .then(result => {
        const metadata = result[0];
        const apiResponse = result[1];
      })
      .catch(err => {
        // Handle the error.
      });

setMetadata(metadata, gaxOptionsopt, callback)

Set the app profile metadata.

Parameters:
Name Type Attributes Description
metadata object

See Instance#createAppProfile for the available metadata options.

gaxOptions object <optional>

Request configuration options, outlined here: https://googleapis.github.io/gax-nodejs/CallSettings.html.

callback function

The callback function.

Properties
Name Type Attributes Description
err error <nullable>

An error returned while making this request.

apiResponse object

The full API response.

Source:
Example
    const Bigtable = require('@google-cloud/bigtable');
    const bigtable = new Bigtable();
    const instance = bigtable.instance(instanceId);
    const cluster = instance.cluster(clusterId);
    const appProfile = instance.appProfile(appProfileId);

    const metadata = {
      description: 'My Updated App Profile',
      routing: cluster,
      allowTransactionalWrites: true,
    };

    appProfile
      .setMetadata(metadata)
      .then(result => {
        const apiResponse = result[0];
      })
      .catch(err => {
        // Handle the error.
      });