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. |
Methods
create(optionsopt)
Create an app profile.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
object |
<optional> |
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
|
||||||||||||
callback |
function |
<optional> |
The callback function. Properties
|
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
|
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. |
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
|
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
|
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.
});