Skip to main content

instances

Creates, updates, deletes, gets or lists an instances resource.

Overview

Nameinstances
TypeResource
Idgoogle.bigtableadmin.instances

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringThe unique name of the instance. Values are of the form projects/{project}/instances/a-z+[a-z0-9].
createTimestring (google-datetime)Output only. A commit timestamp representing when this Instance was created. For instances created before this field was added (August 2021), this value is seconds: 0, nanos: 1.
displayNamestringRequired. 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.
labelsobjectLabels 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}{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.
satisfiesPzibooleanOutput only. Reserved for future use.
satisfiesPzsbooleanOutput only. Reserved for future use.
statestringOutput only. The current state of the instance.
tagsobjectOptional. Input only. Immutable. Tag keys/values directly bound to this resource. For example: - "123/environment": "production", - "123/costCenter": "marketing" Tags and Labels (above) are both used to bind metadata to resources, with different use-cases. See https://cloud.google.com/resource-manager/docs/tags/tags-overview for an in-depth overview on the difference between tags and labels.
typestringThe type of the instance. Defaults to PRODUCTION.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, instancesIdGets information about an instance.
listselectprojectsIdpageTokenLists information about instances in a project.
createinsertprojectsIdCreate an instance within a project. Note that exactly one of Cluster.serve_nodes and Cluster.cluster_config.cluster_autoscaling_config can be set. If serve_nodes is set to non-zero, then the cluster is manually scaled. If cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is enabled.
updatereplaceprojectsId, instancesIdUpdates an instance within a project. This method updates only the display name and type for an Instance. To update other Instance properties, such as labels, use PartialUpdateInstance.
deletedeleteprojectsId, instancesIdDelete an instance from a project.
partial_update_instanceexecprojectsId, instancesIdupdateMaskPartially updates an instance within a project. This method can modify all fields of an Instance and is the preferred way to update an Instance.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
instancesIdstring
projectsIdstring
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

Gets information about an instance.

SELECT
name,
createTime,
displayName,
labels,
satisfiesPzi,
satisfiesPzs,
state,
tags,
type
FROM google.bigtableadmin.instances
WHERE projectsId = '{{ projectsId }}' -- required
AND instancesId = '{{ instancesId }}' -- required;

INSERT examples

Create an instance within a project. Note that exactly one of Cluster.serve_nodes and Cluster.cluster_config.cluster_autoscaling_config can be set. If serve_nodes is set to non-zero, then the cluster is manually scaled. If cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is enabled.

INSERT INTO google.bigtableadmin.instances (
data__parent,
data__instanceId,
data__instance,
data__clusters,
projectsId
)
SELECT
'{{ parent }}',
'{{ instanceId }}',
'{{ instance }}',
'{{ clusters }}',
'{{ projectsId }}'
RETURNING
name,
done,
error,
metadata,
response
;

REPLACE examples

Updates an instance within a project. This method updates only the display name and type for an Instance. To update other Instance properties, such as labels, use PartialUpdateInstance.

REPLACE google.bigtableadmin.instances
SET
data__name = '{{ name }}',
data__displayName = '{{ displayName }}',
data__type = '{{ type }}',
data__labels = '{{ labels }}',
data__tags = '{{ tags }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND instancesId = '{{ instancesId }}' --required
RETURNING
name,
createTime,
displayName,
labels,
satisfiesPzi,
satisfiesPzs,
state,
tags,
type;

DELETE examples

Delete an instance from a project.

DELETE FROM google.bigtableadmin.instances
WHERE projectsId = '{{ projectsId }}' --required
AND instancesId = '{{ instancesId }}' --required;

Lifecycle Methods

Partially updates an instance within a project. This method can modify all fields of an Instance and is the preferred way to update an Instance.

EXEC google.bigtableadmin.instances.partial_update_instance 
@projectsId='{{ projectsId }}' --required,
@instancesId='{{ instancesId }}' --required,
@updateMask='{{ updateMask }}'
@@json=
'{
"name": "{{ name }}",
"displayName": "{{ displayName }}",
"type": "{{ type }}",
"labels": "{{ labels }}",
"tags": "{{ tags }}"
}';