AppProfile
Create an app profile object to interact with your app profile.
Constructor
AppProfile
new AppProfile(instance, name)
Parameter |
|
---|---|
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 |
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
|
||||||
callback |
Optional function() The callback function. Values in
|
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
|
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
|
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
|
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];
});