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.

Example

const Bigtable = require('@google-cloud/bigtable');
const bigtable = new Bigtable();
const instance = bigtable.instance('my-instance');
const appProfile = instance.appProfile('my-appProfile');

appProfile.create(function(err, appProfile, apiResponse) {
  if (!err) {
    // The app profile was created successfully.
  }
});

//-
// If the callback is omitted, we'll return a Promise.
//-
appProfile.create().then(function(data) {
  const appProfile = data[0];
  const apiResponse = data[1];
});

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.

Example

appProfile.delete(function(err, apiResponse) {});

//-
// If the callback is omitted, we'll return a Promise.
//-
appProfile.delete().then(function(data) {
  var apiResponse = data[0];
});

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.

Example

appProfile.exists(function(err, exists) {});

//-
// If the callback is omitted, we'll return a Promise.
//-
appProfile.exists().then(function(data) {
  var exists = data[0];
});

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.

Example

appProfile.get(function(err, appProfile, apiResponse) {
  // The `appProfile` data has been populated.
});

//-
// If the callback is omitted, we'll return a Promise.
//-
appProfile.get().then(function(data) {
  var appProfile = data[0];
  var apiResponse = data[1];
});

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.

Example

appProfile.getMetadata(function(err, metadata, apiResponse) {});

//-
// If the callback is omitted, we'll return a Promise.
//-
appProfile.getMetadata().then(function(data) {
  var metadata = data[0];
  var apiResponse = data[1];
});

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.

Example

const Bigtable = require('@google-cloud/bigtable');
const bigtable = new Bigtable();
const instance = bigtable.instance('my-instance');
const cluster = instance.cluster('my-cluster');
const appProfile = instance.appProfile('my-appProfile');

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

appProfile.setMetadata(metadata, callback);

//-
// If the callback is omitted, we'll return a Promise.
//-
appProfile.setMetadata(metadata).then(function(data) {
  const apiResponse = data[0];
});