BigtableInstanceAdminClient

BigtableInstanceAdminClient

Service for creating, configuring, and deleting Cloud Bigtable Instances and Clusters. Provides access to the Instance and Cluster schemas only, not the tables' metadata or data stored in those tables.

Constructor

new BigtableInstanceAdminClient(optionsopt)

Construct an instance of BigtableInstanceAdminClient.

Parameters:
Name Type Attributes Description
options object <optional>

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

Properties
Name Type Attributes Description
credentials object <optional>

Credentials object.

Properties
Name Type Attributes Description
client_email string <optional>
private_key string <optional>
email string <optional>

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

keyFilename string <optional>

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 number <optional>

The port on which to connect to the remote host.

projectId string <optional>

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 function <optional>

Custom promise module to use instead of native Promises.

apiEndpoint string <optional>

The domain name of the API remote host.

Source:

Members

(static) apiEndpoint

The DNS address for this API service - same as servicePath(), exists for compatibility reasons.

Source:

(static) port

The port for this API service.

Source:

(static) scopes

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

Source:

(static) servicePath

The DNS address for this API service.

Source:

Methods

appProfilePath(project, instance, appProfile) → {String}

Return a fully-qualified app_profile resource name string.

Parameters:
Name Type Description
project String
instance String
appProfile String
Source:

clusterPath(project, instance, cluster) → {String}

Return a fully-qualified cluster resource name string.

Parameters:
Name Type Description
project String
instance String
cluster String
Source:

createAppProfile(request, optionsopt, callbackopt) → {Promise}

Creates an app profile within an instance.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes 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 <optional>

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

options Object <optional>

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 <optional>

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

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

Source:
Example
const admin = require('admin.v2');

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

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

createCluster(request, optionsopt, callbackopt) → {Promise}

Creates a cluster within an instance.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type 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 <optional>

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 <optional>

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

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

Source:
Example
const admin = require('admin.v2');

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

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

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

    // Operation#promise starts polling for the completion of the LRO.
    return operation.promise();
  })
  .then(responses => {
    const result = responses[0];
    const metadata = responses[1];
    const finalApiResponse = responses[2];
  })
  .catch(err => {
    console.error(err);
  });

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

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

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

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

// Handle the operation using the await pattern.
const [operation] = await client.createCluster(request);

const [response] = await operation.promise();

createInstance(request, optionsopt, callbackopt) → {Promise}

Create an instance within a project.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type 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.<string, Object>

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, at most two clusters can be specified.

options Object <optional>

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 <optional>

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

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

Source:
Example
const admin = require('admin.v2');

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

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

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

    // Operation#promise starts polling for the completion of the LRO.
    return operation.promise();
  })
  .then(responses => {
    const result = responses[0];
    const metadata = responses[1];
    const finalApiResponse = responses[2];
  })
  .catch(err => {
    console.error(err);
  });

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

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

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

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

// Handle the operation using the await pattern.
const [operation] = await client.createInstance(request);

const [response] = await operation.promise();

deleteAppProfile(request, optionsopt, callbackopt) → {Promise}

Deletes an app profile from an instance.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type 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 <optional>

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 <optional>

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

Source:
Example
const admin = require('admin.v2');

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

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

deleteCluster(request, optionsopt, callbackopt) → {Promise}

Deletes a cluster from an instance.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type 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 <optional>

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 <optional>

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

Source:
Example
const admin = require('admin.v2');

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

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

deleteInstance(request, optionsopt, callbackopt) → {Promise}

Delete an instance from a project.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
name string

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

options Object <optional>

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 <optional>

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

Source:
Example
const admin = require('admin.v2');

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

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

getAppProfile(request, optionsopt, callbackopt) → {Promise}

Gets information about an app profile.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type 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 <optional>

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 <optional>

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

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

Source:
Example
const admin = require('admin.v2');

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

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

getCluster(request, optionsopt, callbackopt) → {Promise}

Gets information about a cluster.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
name string

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

options Object <optional>

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 <optional>

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

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

Source:
Example
const admin = require('admin.v2');

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

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

getIamPolicy(request, optionsopt, callbackopt) → {Promise}

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

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
resource string

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

options Object <optional>

OPTIONAL: A GetPolicyOptions object for specifying options to GetIamPolicy. This field is only used by Cloud IAM.

This object should have the same structure as GetPolicyOptions

options Object <optional>

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 <optional>

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

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

Source:
Example
const admin = require('admin.v2');

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

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

getInstance(request, optionsopt, callbackopt) → {Promise}

Gets information about an instance.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
name string

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

options Object <optional>

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 <optional>

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

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

Source:
Example
const admin = require('admin.v2');

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

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

getProjectId(callback)

Return the project ID used by this class.

Parameters:
Name Type Description
callback function

the callback to be called with the current project Id.

Source:

instancePath(project, instance) → {String}

Return a fully-qualified instance resource name string.

Parameters:
Name Type Description
project String
instance String
Source:

listAppProfiles(request, optionsopt, callbackopt) → {Promise}

Lists information about app profiles in an instance.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes 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>. Use <instance> = '-' to list AppProfiles for all Instances in a project, e.g., projects/myproject/instances/-.

pageSize number <optional>

Maximum number of results per page. CURRENTLY UNIMPLEMENTED AND IGNORED.

options Object <optional>

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 <optional>

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.

Source:
Example
const admin = require('admin.v2');

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

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

client.listAppProfiles({parent: formattedParent})
  .then(responses => {
    const resources = responses[0];
    for (const resource of resources) {
      // doThingsWith(resource)
    }
  })
  .catch(err => {
    console.error(err);
  });

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


const options = {autoPaginate: false};
const callback = responses => {
  // The actual resources in a response.
  const resources = responses[0];
  // The next request if the response shows that there are more responses.
  const nextRequest = responses[1];
  // The actual response object, if necessary.
  // const rawResponse = responses[2];
  for (const resource of resources) {
    // doThingsWith(resource);
  }
  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);
  });

listAppProfilesStream(request, optionsopt) → {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.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes 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>. Use <instance> = '-' to list AppProfiles for all Instances in a project, e.g., projects/myproject/instances/-.

pageSize number <optional>

Maximum number of results per page. CURRENTLY UNIMPLEMENTED AND IGNORED.

options Object <optional>

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

Source:
See:
Example
const admin = require('admin.v2');

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

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

listClusters(request, optionsopt, callbackopt) → {Promise}

Lists information about clusters in an instance.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes 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 <optional>

DEPRECATED: This field is unused and ignored.

options Object <optional>

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 <optional>

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

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

Source:
Example
const admin = require('admin.v2');

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

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

listInstances(request, optionsopt, callbackopt) → {Promise}

Lists information about instances in a project.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes 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 <optional>

DEPRECATED: This field is unused and ignored.

options Object <optional>

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 <optional>

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

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

Source:
Example
const admin = require('admin.v2');

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

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

locationPath(project, location) → {String}

Return a fully-qualified location resource name string.

Parameters:
Name Type Description
project String
location String
Source:

matchAppProfileFromAppProfileName(appProfileName) → {String}

Parse the appProfileName from a app_profile resource.

Parameters:
Name Type Description
appProfileName String

A fully-qualified path representing a app_profile resources.

Source:

matchClusterFromClusterName(clusterName) → {String}

Parse the clusterName from a cluster resource.

Parameters:
Name Type Description
clusterName String

A fully-qualified path representing a cluster resources.

Source:

matchInstanceFromAppProfileName(appProfileName) → {String}

Parse the appProfileName from a app_profile resource.

Parameters:
Name Type Description
appProfileName String

A fully-qualified path representing a app_profile resources.

Source:

matchInstanceFromClusterName(clusterName) → {String}

Parse the clusterName from a cluster resource.

Parameters:
Name Type Description
clusterName String

A fully-qualified path representing a cluster resources.

Source:

matchInstanceFromInstanceName(instanceName) → {String}

Parse the instanceName from a instance resource.

Parameters:
Name Type Description
instanceName String

A fully-qualified path representing a instance resources.

Source:

matchLocationFromLocationName(locationName) → {String}

Parse the locationName from a location resource.

Parameters:
Name Type Description
locationName String

A fully-qualified path representing a location resources.

Source:

matchProjectFromAppProfileName(appProfileName) → {String}

Parse the appProfileName from a app_profile resource.

Parameters:
Name Type Description
appProfileName String

A fully-qualified path representing a app_profile resources.

Source:

matchProjectFromClusterName(clusterName) → {String}

Parse the clusterName from a cluster resource.

Parameters:
Name Type Description
clusterName String

A fully-qualified path representing a cluster resources.

Source:

matchProjectFromInstanceName(instanceName) → {String}

Parse the instanceName from a instance resource.

Parameters:
Name Type Description
instanceName String

A fully-qualified path representing a instance resources.

Source:

matchProjectFromLocationName(locationName) → {String}

Parse the locationName from a location resource.

Parameters:
Name Type Description
locationName String

A fully-qualified path representing a location resources.

Source:

matchProjectFromProjectName(projectName) → {String}

Parse the projectName from a project resource.

Parameters:
Name Type Description
projectName String

A fully-qualified path representing a project resources.

Source:

partialUpdateInstance(request, optionsopt, callbackopt) → {Promise}

Partially updates an instance within a project.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type 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 <optional>

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 <optional>

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

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

Source:
Example
const admin = require('admin.v2');

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

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

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

    // Operation#promise starts polling for the completion of the LRO.
    return operation.promise();
  })
  .then(responses => {
    const result = responses[0];
    const metadata = responses[1];
    const finalApiResponse = responses[2];
  })
  .catch(err => {
    console.error(err);
  });

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

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

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

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

// Handle the operation using the await pattern.
const [operation] = await client.partialUpdateInstance(request);

const [response] = await operation.promise();

projectPath(project) → {String}

Return a fully-qualified project resource name string.

Parameters:
Name Type Description
project String
Source:

setIamPolicy(request, optionsopt, callbackopt) → {Promise}

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

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
resource string

REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

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 <optional>

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 <optional>

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

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

Source:
Example
const admin = require('admin.v2');

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

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

testIamPermissions(request, optionsopt, callbackopt) → {Promise}

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

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
resource string

REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

permissions Array.<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 <optional>

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 <optional>

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

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

Source:
Example
const admin = require('admin.v2');

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

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

updateAppProfile(request, optionsopt, callbackopt) → {Promise}

Updates an app profile within an instance.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes 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 <optional>

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

options Object <optional>

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 <optional>

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

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

Source:
Example
const admin = require('admin.v2');

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

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

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

    // Operation#promise starts polling for the completion of the LRO.
    return operation.promise();
  })
  .then(responses => {
    const result = responses[0];
    const metadata = responses[1];
    const finalApiResponse = responses[2];
  })
  .catch(err => {
    console.error(err);
  });

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

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

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

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

// Handle the operation using the await pattern.
const [operation] = await client.updateAppProfile(request);

const [response] = await operation.promise();

updateCluster(request, optionsopt, callbackopt) → {Promise}

Updates a cluster within an instance.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes 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]*.

serveNodes number

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

location string <optional>

(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>.

state number <optional>

(OutputOnly) The current state of the cluster.

The number should be among the values of State

defaultStorageType number <optional>

(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 <optional>

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 <optional>

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

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

Source:
Example
const admin = require('admin.v2');

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

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

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

    // Operation#promise starts polling for the completion of the LRO.
    return operation.promise();
  })
  .then(responses => {
    const result = responses[0];
    const metadata = responses[1];
    const finalApiResponse = responses[2];
  })
  .catch(err => {
    console.error(err);
  });

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

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

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

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

// Handle the operation using the await pattern.
const [operation] = await client.updateCluster(request);

const [response] = await operation.promise();

updateInstance(request, optionsopt, callbackopt) → {Promise}

Updates an instance within a project.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes 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.<string, string>

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 <optional>

(OutputOnly) The current state of the instance.

The number should be among the values of State

options Object <optional>

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 <optional>

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

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

Source:
Example
const admin = require('admin.v2');

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

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