Constructor

AppProfile

new AppProfile(instance, name)

Parameter

instance

Instance

The parent instance of this app profile.

name

string

Name of the app profile.

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

create(options)

Create an app profile.

Parameter

options

Optional

object

See Instance#createAppProfile.

Examples

const Bigtable = require('@google-cloud/bigtable');
const bigtable = new Bigtable();
const instance = bigtable.instance(instanceId);
const appProfile = instance.appProfile(appProfileId);
// set routing policy, required for creating an app-profile
const options = {
  routing: 'any',
};

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

delete

delete(options, callback)

Delete the app profile.

Parameter

options

Optional

object

Cluster creation options.

Values in options have the following properties:

Parameter

gaxOptions

Optional

object

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

ignoreWarnings

Optional

boolean

Whether to ignore safety checks when deleting the app profile.

callback

Optional

function()

The callback function.

Values in callback have the following properties:

Parameter

err

error

An error returned while making this request.

Value may be null.

apiResponse

object

The full API response.

Examples

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

exists(gaxOptions, callback)

Check if an app profile exists.

Parameter

gaxOptions

Optional

object

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

callback

function()

The callback function.

Values in callback have the following properties:

Parameter

err

error

An error returned while making this request.

Value may be null.

exists

boolean

Whether the app profile exists or not.

Examples

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

get(gaxOptions)

Get a appProfile if it exists.

Parameter

gaxOptions

Optional

object

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

Examples

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

getMetadata(gaxOptions, callback)

Get the app profile metadata.

Parameter

gaxOptions

Optional

object

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

callback

function()

The callback function.

Values in callback have the following properties:

Parameter

err

error

An error returned while making this request.

Value may be null.

metadata

object

The metadata.

apiResponse

object

The full API response.

Examples

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

setMetadata(metadata, gaxOptions, callback)

Set the app profile metadata.

Parameter

metadata

object

See Instance#createAppProfile for the available metadata options.

gaxOptions

Optional

object

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

callback

function()

The callback function.

Values in callback have the following properties:

Parameter

err

error

An error returned while making this request.

Value may be null.

apiResponse

object

The full API response.

Examples

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.
  });