Properties

Methods

new BigtableInstanceAdminClient([options])

Construct an instance of BigtableInstanceAdminClient.

Parameters

Name Type Optional Description

options

 

Yes

The configuration object. See the subsequent parameters for more details.

Values in options have the following properties:

Name Type Optional Description

credentials

 

Yes

Credentials object.

credentials.client_email

 

Yes

credentials.private_key

 

Yes

email

 

Yes

Account email address. Required when using a .pem or .p12 keyFilename.

keyFilename

 

Yes

Full path to the a .json, .pem, or .p12 key downloaded from the Google Developers Console. If you provide a path to a JSON file, the projectId option below is not necessary. NOTE: .pem and .p12 require you to specify options.email as well.

port

 

Yes

The port on which to connect to the remote host.

projectId

 

Yes

The project ID from the Google Developer's Console, e.g. 'grape-spaceship-123'. We will also check the environment variable GCLOUD_PROJECT for your project ID. If your app is running in an environment which supports Application Default Credentials, your project ID will be detected automatically.

promise

 

Yes

Custom promise module to use instead of native Promises.

servicePath

 

Yes

The domain name of the API remote host.

Properties

static

port

The port for this API service.

static

scopes

The scopes needed to make gRPC calls for every method defined in this service.

static

servicePath

The DNS address for this API service.

Methods

appProfilePath(project, instance, appProfile) → String

Return a fully-qualified app_profile resource name string.

Parameters

Name Type Optional Description

project

String

 

instance

String

 

appProfile

String

 

Returns

String 

clusterPath(project, instance, cluster) → String

Return a fully-qualified cluster resource name string.

Parameters

Name Type Optional Description

project

String

 

instance

String

 

cluster

String

 

Returns

String 

createAppProfile(request[, options][, callback]) → Promise

This is a private alpha release of Cloud Bigtable replication. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.

Creates an app profile within an instance.

Example

const admin = require('admin.v2');

var client = new admin.v2.BigtableInstanceAdminClient({
  // optional auth parameters.
});

var formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]');
var appProfileId = '';
var appProfile = {};
var request = {
  parent: formattedParent,
  appProfileId: appProfileId,
  appProfile: appProfile,
};
client.createAppProfile(request)
  .then(responses => {
    var response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

parent

string

 

The unique name of the instance in which to create the new app profile. Values are of the form projects/<project>/instances/<instance>.

appProfileId

string

 

The ID to be used when referring to the new app profile within its instance, e.g., just myprofile rather than projects/myproject/instances/myinstance/appProfiles/myprofile.

appProfile

Object

 

The app profile to be created. Fields marked OutputOnly will be ignored.

This object should have the same structure as AppProfile

ignoreWarnings

boolean

Yes

If true, ignore safety checks when creating the app profile.

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing AppProfile.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing AppProfile. The promise has a method named "cancel" which cancels the ongoing API call.

createCluster(request[, options][, callback]) → Promise

Creates a cluster within an instance.

Example

const admin = require('admin.v2');

var client = new admin.v2.BigtableInstanceAdminClient({
  // optional auth parameters.
});

var formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]');
var clusterId = '';
var cluster = {};
var request = {
  parent: formattedParent,
  clusterId: clusterId,
  cluster: cluster,
};

// Handle the operation using the promise pattern.
client.createCluster(request)
  .then(responses => {
    var operation = responses[0];
    var initialApiResponse = responses[1];

    // Operation#promise starts polling for the completion of the LRO.
    return operation.promise();
  })
  .then(responses => {
    // The final result of the operation.
    var result = responses[0];

    // The metadata value of the completed operation.
    var metadata = responses[1];

    // The response of the api call returning the complete operation.
    var finalApiResponse = responses[2];
  })
  .catch(err => {
    console.error(err);
  });

var formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]');
var clusterId = '';
var cluster = {};
var request = {
  parent: formattedParent,
  clusterId: clusterId,
  cluster: cluster,
};

// Handle the operation using the event emitter pattern.
client.createCluster(request)
  .then(responses => {
    var operation = responses[0];
    var initialApiResponse = responses[1];

    // Adding a listener for the "complete" event starts polling for the
    // completion of the operation.
    operation.on('complete', (result, metadata, finalApiResponse) => {
      // doSomethingWith(result);
    });

    // Adding a listener for the "progress" event causes the callback to be
    // called on any change in metadata when the operation is polled.
    operation.on('progress', (metadata, apiResponse) => {
      // doSomethingWith(metadata)
    });

    // Adding a listener for the "error" event handles any errors found during polling.
    operation.on('error', err => {
      // throw(err);
    });
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

parent

string

 

The unique name of the instance in which to create the new cluster. Values are of the form projects/<project>/instances/<instance>.

clusterId

string

 

The ID to be used when referring to the new cluster within its instance, e.g., just mycluster rather than projects/myproject/instances/myinstance/clusters/mycluster.

cluster

Object

 

The cluster to be created. Fields marked OutputOnly must be left blank.

This object should have the same structure as Cluster

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is a gax.Operation object.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is a gax.Operation object. The promise has a method named "cancel" which cancels the ongoing API call.

createInstance(request[, options][, callback]) → Promise

Create an instance within a project.

Example

const admin = require('admin.v2');

var client = new admin.v2.BigtableInstanceAdminClient({
  // optional auth parameters.
});

var formattedParent = client.projectPath('[PROJECT]');
var instanceId = '';
var instance = {};
var clusters = {};
var request = {
  parent: formattedParent,
  instanceId: instanceId,
  instance: instance,
  clusters: clusters,
};

// Handle the operation using the promise pattern.
client.createInstance(request)
  .then(responses => {
    var operation = responses[0];
    var initialApiResponse = responses[1];

    // Operation#promise starts polling for the completion of the LRO.
    return operation.promise();
  })
  .then(responses => {
    // The final result of the operation.
    var result = responses[0];

    // The metadata value of the completed operation.
    var metadata = responses[1];

    // The response of the api call returning the complete operation.
    var finalApiResponse = responses[2];
  })
  .catch(err => {
    console.error(err);
  });

var formattedParent = client.projectPath('[PROJECT]');
var instanceId = '';
var instance = {};
var clusters = {};
var request = {
  parent: formattedParent,
  instanceId: instanceId,
  instance: instance,
  clusters: clusters,
};

// Handle the operation using the event emitter pattern.
client.createInstance(request)
  .then(responses => {
    var operation = responses[0];
    var initialApiResponse = responses[1];

    // Adding a listener for the "complete" event starts polling for the
    // completion of the operation.
    operation.on('complete', (result, metadata, finalApiResponse) => {
      // doSomethingWith(result);
    });

    // Adding a listener for the "progress" event causes the callback to be
    // called on any change in metadata when the operation is polled.
    operation.on('progress', (metadata, apiResponse) => {
      // doSomethingWith(metadata)
    });

    // Adding a listener for the "error" event handles any errors found during polling.
    operation.on('error', err => {
      // throw(err);
    });
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

parent

string

 

The unique name of the project in which to create the new instance. Values are of the form projects/<project>.

instanceId

string

 

The ID to be used when referring to the new instance within its project, e.g., just myinstance rather than projects/myproject/instances/myinstance.

instance

Object

 

The instance to create. Fields marked OutputOnly must be left blank.

This object should have the same structure as Instance

clusters

Object with Object properties

 

The clusters to be created within the instance, mapped by desired cluster ID, e.g., just mycluster rather than projects/myproject/instances/myinstance/clusters/mycluster. Fields marked OutputOnly must be left blank. Currently exactly one cluster must be specified.

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is a gax.Operation object.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is a gax.Operation object. The promise has a method named "cancel" which cancels the ongoing API call.

deleteAppProfile(request[, options][, callback]) → Promise

This is a private alpha release of Cloud Bigtable replication. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.

Deletes an app profile from an instance.

Example

const admin = require('admin.v2');

var client = new admin.v2.BigtableInstanceAdminClient({
  // optional auth parameters.
});

var formattedName = client.appProfilePath('[PROJECT]', '[INSTANCE]', '[APP_PROFILE]');
var ignoreWarnings = false;
var request = {
  name: formattedName,
  ignoreWarnings: ignoreWarnings,
};
client.deleteAppProfile(request).catch(err => {
  console.error(err);
});

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

name

string

 

The unique name of the app profile to be deleted. Values are of the form projects/<project>/instances/<instance>/appProfiles/<app_profile>.

ignoreWarnings

boolean

 

If true, ignore safety checks when deleting the app profile.

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error)

Yes

The function which will be called with the result of the API call.

Returns

Promise 

  • The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call.

deleteCluster(request[, options][, callback]) → Promise

Deletes a cluster from an instance.

Example

const admin = require('admin.v2');

var client = new admin.v2.BigtableInstanceAdminClient({
  // optional auth parameters.
});

var formattedName = client.clusterPath('[PROJECT]', '[INSTANCE]', '[CLUSTER]');
client.deleteCluster({name: formattedName}).catch(err => {
  console.error(err);
});

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

name

string

 

The unique name of the cluster to be deleted. Values are of the form projects/<project>/instances/<instance>/clusters/<cluster>.

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error)

Yes

The function which will be called with the result of the API call.

Returns

Promise 

  • The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call.

deleteInstance(request[, options][, callback]) → Promise

Delete an instance from a project.

Example

const admin = require('admin.v2');

var client = new admin.v2.BigtableInstanceAdminClient({
  // optional auth parameters.
});

var formattedName = client.instancePath('[PROJECT]', '[INSTANCE]');
client.deleteInstance({name: formattedName}).catch(err => {
  console.error(err);
});

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

name

string

 

The unique name of the instance to be deleted. Values are of the form projects/<project>/instances/<instance>.

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error)

Yes

The function which will be called with the result of the API call.

Returns

Promise 

  • The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call.

getAppProfile(request[, options][, callback]) → Promise

This is a private alpha release of Cloud Bigtable replication. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.

Gets information about an app profile.

Example

const admin = require('admin.v2');

var client = new admin.v2.BigtableInstanceAdminClient({
  // optional auth parameters.
});

var formattedName = client.appProfilePath('[PROJECT]', '[INSTANCE]', '[APP_PROFILE]');
client.getAppProfile({name: formattedName})
  .then(responses => {
    var response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

name

string

 

The unique name of the requested app profile. Values are of the form projects/<project>/instances/<instance>/appProfiles/<app_profile>.

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing AppProfile.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing AppProfile. The promise has a method named "cancel" which cancels the ongoing API call.

getCluster(request[, options][, callback]) → Promise

Gets information about a cluster.

Example

const admin = require('admin.v2');

var client = new admin.v2.BigtableInstanceAdminClient({
  // optional auth parameters.
});

var formattedName = client.clusterPath('[PROJECT]', '[INSTANCE]', '[CLUSTER]');
client.getCluster({name: formattedName})
  .then(responses => {
    var response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

name

string

 

The unique name of the requested cluster. Values are of the form projects/<project>/instances/<instance>/clusters/<cluster>.

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing Cluster.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing Cluster. The promise has a method named "cancel" which cancels the ongoing API call.

getIamPolicy(request[, options][, callback]) → Promise

This is a private alpha release of Cloud Bigtable instance level permissions. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.

Gets the access control policy for an instance resource. Returns an empty policy if an instance exists but does not have a policy set.

Example

const admin = require('admin.v2');

var client = new admin.v2.BigtableInstanceAdminClient({
  // optional auth parameters.
});

var formattedResource = client.instancePath('[PROJECT]', '[INSTANCE]');
client.getIamPolicy({resource: formattedResource})
  .then(responses => {
    var response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

resource

string

 

REQUIRED: The resource for which the policy is being requested. resource is usually specified as a path. For example, a Project resource is specified as projects/{project}.

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing Policy.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing Policy. The promise has a method named "cancel" which cancels the ongoing API call.

getInstance(request[, options][, callback]) → Promise

Gets information about an instance.

Example

const admin = require('admin.v2');

var client = new admin.v2.BigtableInstanceAdminClient({
  // optional auth parameters.
});

var formattedName = client.instancePath('[PROJECT]', '[INSTANCE]');
client.getInstance({name: formattedName})
  .then(responses => {
    var response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

name

string

 

The unique name of the requested instance. Values are of the form projects/<project>/instances/<instance>.

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing Instance.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing Instance. The promise has a method named "cancel" which cancels the ongoing API call.

getProjectId(callback)

Return the project ID used by this class.

Parameter

Name Type Optional Description

callback

function(Error, string)

 

the callback to be called with the current project Id.

instancePath(project, instance) → String

Return a fully-qualified instance resource name string.

Parameters

Name Type Optional Description

project

String

 

instance

String

 

Returns

String 

listAppProfiles(request[, options][, callback]) → Promise

This is a private alpha release of Cloud Bigtable replication. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.

Lists information about app profiles in an instance.

Example

const admin = require('admin.v2');

var client = new admin.v2.BigtableInstanceAdminClient({
  // optional auth parameters.
});

// Iterate over all elements.
var formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]');

client.listAppProfiles({parent: formattedParent})
  .then(responses => {
    var resources = responses[0];
    for (let i = 0; i < resources.length; i += 1) {
      // doThingsWith(resources[i])
    }
  })
  .catch(err => {
    console.error(err);
  });

// Or obtain the paged response.
var formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]');


var options = {autoPaginate: false};
var callback = responses => {
  // The actual resources in a response.
  var resources = responses[0];
  // The next request if the response shows that there are more responses.
  var nextRequest = responses[1];
  // The actual response object, if necessary.
  // var rawResponse = responses[2];
  for (let i = 0; i < resources.length; i += 1) {
    // doThingsWith(resources[i]);
  }
  if (nextRequest) {
    // Fetch the next page.
    return client.listAppProfiles(nextRequest, options).then(callback);
  }
}
client.listAppProfiles({parent: formattedParent}, options)
  .then(callback)
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

parent

string

 

The unique name of the instance for which a list of app profiles is requested. Values are of the form projects/<project>/instances/<instance>.

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Array, nullable Object, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is Array of AppProfile.

When autoPaginate: false is specified through options, it contains the result in a single response. If the response indicates the next page exists, the third parameter is set to be used for the next request object. The fourth parameter keeps the raw response object of an object representing ListAppProfilesResponse.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is Array of AppProfile.

    When autoPaginate: false is specified through options, the array has three elements. The first element is Array of AppProfile in a single response. The second element is the next request object if the response indicates the next page exists, or null. The third element is an object representing ListAppProfilesResponse.

    The promise has a method named "cancel" which cancels the ongoing API call.

listAppProfilesStream(request[, options]) → Stream

Equivalent to listAppProfiles, but returns a NodeJS Stream object.

This fetches the paged responses for listAppProfiles continuously and invokes the callback registered for 'data' event for each element in the responses.

The returned object has 'end' method when no more elements are required.

autoPaginate option will be ignored.

Example

const admin = require('admin.v2');

var client = new admin.v2.BigtableInstanceAdminClient({
  // optional auth parameters.
});

var formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]');
client.listAppProfilesStream({parent: formattedParent})
  .on('data', element => {
    // doThingsWith(element)
  }).on('error', err => {
    console.log(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

parent

string

 

The unique name of the instance for which a list of app profiles is requested. Values are of the form projects/<project>/instances/<instance>.

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

See also
https://nodejs.org/api/stream.html
Returns

Stream 

An object stream which emits an object representing AppProfile on 'data' event.

listClusters(request[, options][, callback]) → Promise

Lists information about clusters in an instance.

Example

const admin = require('admin.v2');

var client = new admin.v2.BigtableInstanceAdminClient({
  // optional auth parameters.
});

var formattedParent = client.instancePath('[PROJECT]', '[INSTANCE]');
client.listClusters({parent: formattedParent})
  .then(responses => {
    var response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

parent

string

 

The unique name of the instance for which a list of clusters is requested. Values are of the form projects/<project>/instances/<instance>. Use <instance> = '-' to list Clusters for all Instances in a project, e.g., projects/myproject/instances/-.

pageToken

string

Yes

The value of next_page_token returned by a previous call.

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing ListClustersResponse.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing ListClustersResponse. The promise has a method named "cancel" which cancels the ongoing API call.

listInstances(request[, options][, callback]) → Promise

Lists information about instances in a project.

Example

const admin = require('admin.v2');

var client = new admin.v2.BigtableInstanceAdminClient({
  // optional auth parameters.
});

var formattedParent = client.projectPath('[PROJECT]');
client.listInstances({parent: formattedParent})
  .then(responses => {
    var response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

parent

string

 

The unique name of the project for which a list of instances is requested. Values are of the form projects/<project>.

pageToken

string

Yes

The value of next_page_token returned by a previous call.

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing ListInstancesResponse.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing ListInstancesResponse. The promise has a method named "cancel" which cancels the ongoing API call.

locationPath(project, location) → String

Return a fully-qualified location resource name string.

Parameters

Name Type Optional Description

project

String

 

location

String

 

Returns

String 

matchAppProfileFromAppProfileName(appProfileName) → String

Parse the appProfileName from a app_profile resource.

Parameter

Name Type Optional Description

appProfileName

String

 

A fully-qualified path representing a app_profile resources.

Returns

String 

  • A string representing the app_profile.

matchClusterFromClusterName(clusterName) → String

Parse the clusterName from a cluster resource.

Parameter

Name Type Optional Description

clusterName

String

 

A fully-qualified path representing a cluster resources.

Returns

String 

  • A string representing the cluster.

matchInstanceFromAppProfileName(appProfileName) → String

Parse the appProfileName from a app_profile resource.

Parameter

Name Type Optional Description

appProfileName

String

 

A fully-qualified path representing a app_profile resources.

Returns

String 

  • A string representing the instance.

matchInstanceFromClusterName(clusterName) → String

Parse the clusterName from a cluster resource.

Parameter

Name Type Optional Description

clusterName

String

 

A fully-qualified path representing a cluster resources.

Returns

String 

  • A string representing the instance.

matchInstanceFromInstanceName(instanceName) → String

Parse the instanceName from a instance resource.

Parameter

Name Type Optional Description

instanceName

String

 

A fully-qualified path representing a instance resources.

Returns

String 

  • A string representing the instance.

matchLocationFromLocationName(locationName) → String

Parse the locationName from a location resource.

Parameter

Name Type Optional Description

locationName

String

 

A fully-qualified path representing a location resources.

Returns

String 

  • A string representing the location.

matchProjectFromAppProfileName(appProfileName) → String

Parse the appProfileName from a app_profile resource.

Parameter

Name Type Optional Description

appProfileName

String

 

A fully-qualified path representing a app_profile resources.

Returns

String 

  • A string representing the project.

matchProjectFromClusterName(clusterName) → String

Parse the clusterName from a cluster resource.

Parameter

Name Type Optional Description

clusterName

String

 

A fully-qualified path representing a cluster resources.

Returns

String 

  • A string representing the project.

matchProjectFromInstanceName(instanceName) → String

Parse the instanceName from a instance resource.

Parameter

Name Type Optional Description

instanceName

String

 

A fully-qualified path representing a instance resources.

Returns

String 

  • A string representing the project.

matchProjectFromLocationName(locationName) → String

Parse the locationName from a location resource.

Parameter

Name Type Optional Description

locationName

String

 

A fully-qualified path representing a location resources.

Returns

String 

  • A string representing the project.

matchProjectFromProjectName(projectName) → String

Parse the projectName from a project resource.

Parameter

Name Type Optional Description

projectName

String

 

A fully-qualified path representing a project resources.

Returns

String 

  • A string representing the project.

partialUpdateInstance(request[, options][, callback]) → Promise

Partially updates an instance within a project.

Example

const admin = require('admin.v2');

var client = new admin.v2.BigtableInstanceAdminClient({
  // optional auth parameters.
});

var instance = {};
var updateMask = {};
var request = {
  instance: instance,
  updateMask: updateMask,
};

// Handle the operation using the promise pattern.
client.partialUpdateInstance(request)
  .then(responses => {
    var operation = responses[0];
    var initialApiResponse = responses[1];

    // Operation#promise starts polling for the completion of the LRO.
    return operation.promise();
  })
  .then(responses => {
    // The final result of the operation.
    var result = responses[0];

    // The metadata value of the completed operation.
    var metadata = responses[1];

    // The response of the api call returning the complete operation.
    var finalApiResponse = responses[2];
  })
  .catch(err => {
    console.error(err);
  });

var instance = {};
var updateMask = {};
var request = {
  instance: instance,
  updateMask: updateMask,
};

// Handle the operation using the event emitter pattern.
client.partialUpdateInstance(request)
  .then(responses => {
    var operation = responses[0];
    var initialApiResponse = responses[1];

    // Adding a listener for the "complete" event starts polling for the
    // completion of the operation.
    operation.on('complete', (result, metadata, finalApiResponse) => {
      // doSomethingWith(result);
    });

    // Adding a listener for the "progress" event causes the callback to be
    // called on any change in metadata when the operation is polled.
    operation.on('progress', (metadata, apiResponse) => {
      // doSomethingWith(metadata)
    });

    // Adding a listener for the "error" event handles any errors found during polling.
    operation.on('error', err => {
      // throw(err);
    });
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

instance

Object

 

The Instance which will (partially) replace the current value.

This object should have the same structure as Instance

updateMask

Object

 

The subset of Instance fields which should be replaced. Must be explicitly set.

This object should have the same structure as FieldMask

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is a gax.Operation object.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is a gax.Operation object. The promise has a method named "cancel" which cancels the ongoing API call.

projectPath(project) → String

Return a fully-qualified project resource name string.

Parameter

Name Type Optional Description

project

String

 

Returns

String 

setIamPolicy(request[, options][, callback]) → Promise

This is a private alpha release of Cloud Bigtable instance level permissions. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.

Sets the access control policy on an instance resource. Replaces any existing policy.

Example

const admin = require('admin.v2');

var client = new admin.v2.BigtableInstanceAdminClient({
  // optional auth parameters.
});

var formattedResource = client.instancePath('[PROJECT]', '[INSTANCE]');
var policy = {};
var request = {
  resource: formattedResource,
  policy: policy,
};
client.setIamPolicy(request)
  .then(responses => {
    var response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

resource

string

 

REQUIRED: The resource for which the policy is being specified. resource is usually specified as a path. For example, a Project resource is specified as projects/{project}.

policy

Object

 

REQUIRED: The complete policy to be applied to the resource. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.

This object should have the same structure as Policy

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing Policy.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing Policy. The promise has a method named "cancel" which cancels the ongoing API call.

testIamPermissions(request[, options][, callback]) → Promise

This is a private alpha release of Cloud Bigtable instance level permissions. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.

Returns permissions that the caller has on the specified instance resource.

Example

const admin = require('admin.v2');

var client = new admin.v2.BigtableInstanceAdminClient({
  // optional auth parameters.
});

var formattedResource = client.instancePath('[PROJECT]', '[INSTANCE]');
var permissions = [];
var request = {
  resource: formattedResource,
  permissions: permissions,
};
client.testIamPermissions(request)
  .then(responses => {
    var response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

resource

string

 

REQUIRED: The resource for which the policy detail is being requested. resource is usually specified as a path. For example, a Project resource is specified as projects/{project}.

permissions

Array of string

 

The set of permissions to check for the resource. Permissions with wildcards (such as '' or 'storage.') are not allowed. For more information see IAM Overview.

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing TestIamPermissionsResponse.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing TestIamPermissionsResponse. The promise has a method named "cancel" which cancels the ongoing API call.

updateAppProfile(request[, options][, callback]) → Promise

This is a private alpha release of Cloud Bigtable replication. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.

Updates an app profile within an instance.

Example

const admin = require('admin.v2');

var client = new admin.v2.BigtableInstanceAdminClient({
  // optional auth parameters.
});

var appProfile = {};
var updateMask = {};
var request = {
  appProfile: appProfile,
  updateMask: updateMask,
};

// Handle the operation using the promise pattern.
client.updateAppProfile(request)
  .then(responses => {
    var operation = responses[0];
    var initialApiResponse = responses[1];

    // Operation#promise starts polling for the completion of the LRO.
    return operation.promise();
  })
  .then(responses => {
    // The final result of the operation.
    var result = responses[0];

    // The metadata value of the completed operation.
    var metadata = responses[1];

    // The response of the api call returning the complete operation.
    var finalApiResponse = responses[2];
  })
  .catch(err => {
    console.error(err);
  });

var appProfile = {};
var updateMask = {};
var request = {
  appProfile: appProfile,
  updateMask: updateMask,
};

// Handle the operation using the event emitter pattern.
client.updateAppProfile(request)
  .then(responses => {
    var operation = responses[0];
    var initialApiResponse = responses[1];

    // Adding a listener for the "complete" event starts polling for the
    // completion of the operation.
    operation.on('complete', (result, metadata, finalApiResponse) => {
      // doSomethingWith(result);
    });

    // Adding a listener for the "progress" event causes the callback to be
    // called on any change in metadata when the operation is polled.
    operation.on('progress', (metadata, apiResponse) => {
      // doSomethingWith(metadata)
    });

    // Adding a listener for the "error" event handles any errors found during polling.
    operation.on('error', err => {
      // throw(err);
    });
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

appProfile

Object

 

The app profile which will (partially) replace the current value.

This object should have the same structure as AppProfile

updateMask

Object

 

The subset of app profile fields which should be replaced. If unset, all fields will be replaced.

This object should have the same structure as FieldMask

ignoreWarnings

boolean

Yes

If true, ignore safety checks when updating the app profile.

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is a gax.Operation object.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is a gax.Operation object. The promise has a method named "cancel" which cancels the ongoing API call.

updateCluster(request[, options][, callback]) → Promise

Updates a cluster within an instance.

Example

const admin = require('admin.v2');

var client = new admin.v2.BigtableInstanceAdminClient({
  // optional auth parameters.
});

var formattedName = client.clusterPath('[PROJECT]', '[INSTANCE]', '[CLUSTER]');
var location = '';
var serveNodes = 0;
var request = {
  name: formattedName,
  location: location,
  serveNodes: serveNodes,
};

// Handle the operation using the promise pattern.
client.updateCluster(request)
  .then(responses => {
    var operation = responses[0];
    var initialApiResponse = responses[1];

    // Operation#promise starts polling for the completion of the LRO.
    return operation.promise();
  })
  .then(responses => {
    // The final result of the operation.
    var result = responses[0];

    // The metadata value of the completed operation.
    var metadata = responses[1];

    // The response of the api call returning the complete operation.
    var finalApiResponse = responses[2];
  })
  .catch(err => {
    console.error(err);
  });

var formattedName = client.clusterPath('[PROJECT]', '[INSTANCE]', '[CLUSTER]');
var location = '';
var serveNodes = 0;
var request = {
  name: formattedName,
  location: location,
  serveNodes: serveNodes,
};

// Handle the operation using the event emitter pattern.
client.updateCluster(request)
  .then(responses => {
    var operation = responses[0];
    var initialApiResponse = responses[1];

    // Adding a listener for the "complete" event starts polling for the
    // completion of the operation.
    operation.on('complete', (result, metadata, finalApiResponse) => {
      // doSomethingWith(result);
    });

    // Adding a listener for the "progress" event causes the callback to be
    // called on any change in metadata when the operation is polled.
    operation.on('progress', (metadata, apiResponse) => {
      // doSomethingWith(metadata)
    });

    // Adding a listener for the "error" event handles any errors found during polling.
    operation.on('error', err => {
      // throw(err);
    });
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

name

string

 

(OutputOnly) The unique name of the cluster. Values are of the form projects/<project>/instances/<instance>/clusters/[a-z][-a-z0-9]*.

location

string

 

(CreationOnly) The location where this cluster's nodes and storage reside. For best performance, clients should be located as close as possible to this cluster. Currently only zones are supported, so values should be of the form projects/<project>/locations/<zone>.

serveNodes

number

 

The number of nodes allocated to this cluster. More nodes enable higher throughput and more consistent performance.

state

number

Yes

(OutputOnly) The current state of the cluster.

The number should be among the values of State

defaultStorageType

number

Yes

(CreationOnly) The type of storage used by this cluster to serve its parent instance's tables, unless explicitly overridden.

The number should be among the values of StorageType

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is a gax.Operation object.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is a gax.Operation object. The promise has a method named "cancel" which cancels the ongoing API call.

updateInstance(request[, options][, callback]) → Promise

Updates an instance within a project.

Example

const admin = require('admin.v2');

var client = new admin.v2.BigtableInstanceAdminClient({
  // optional auth parameters.
});

var formattedName = client.instancePath('[PROJECT]', '[INSTANCE]');
var displayName = '';
var type = 'TYPE_UNSPECIFIED';
var labels = {};
var request = {
  name: formattedName,
  displayName: displayName,
  type: type,
  labels: labels,
};
client.updateInstance(request)
  .then(responses => {
    var response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

Parameters

Name Type Optional Description

request

Object

 

The request object that will be sent.

Values in request have the following properties:

Name Type Optional Description

name

string

 

(OutputOnly) The unique name of the instance. Values are of the form projects/<project>/instances/[a-z][a-z0-9\\-]+[a-z0-9].

displayName

string

 

The descriptive name for this instance as it appears in UIs. Can be changed at any time, but should be kept globally unique to avoid confusion.

type

number

 

The type of the instance. Defaults to PRODUCTION.

The number should be among the values of Type

labels

Object with string properties

 

Labels are a flexible and lightweight mechanism for organizing cloud resources into groups that reflect a customer's organizational needs and deployment strategies. They can be used to filter resources and aggregate metrics.

  • Label keys must be between 1 and 63 characters long and must conform to the regular expression: [\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}.
  • Label values must be between 0 and 63 characters long and must conform to the regular expression: [\p{Ll}\p{Lo}\p{N}_-]{0,63}.
  • No more than 64 labels can be associated with a given resource.
  • Keys and values must both be under 128 bytes.

state

number

Yes

(OutputOnly) The current state of the instance.

The number should be among the values of State

options

Object

Yes

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

function(nullable Error, nullable Object)

Yes

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing Instance.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing Instance. The promise has a method named "cancel" which cancels the ongoing API call.