instances
Creates, updates, deletes, gets or lists an instances
resource.
Overview
Name | instances |
Type | Resource |
Id | google.bigtableadmin.instances |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Successful response
Name | Datatype | Description |
---|---|---|
name | string | The unique name of the instance. Values are of the form projects/{project}/instances/a-z+[a-z0-9] . |
createTime | string (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 . |
displayName | string | Required. 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. |
labels | object | 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}{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. |
satisfiesPzi | boolean | Output only. Reserved for future use. |
satisfiesPzs | boolean | Output only. Reserved for future use. |
state | string | Output only. The current state of the instance. |
tags | object | Optional. 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. |
type | string | The type of the instance. Defaults to PRODUCTION . |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | The unique name of the instance. Values are of the form projects/{project}/instances/a-z+[a-z0-9] . |
createTime | string (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 . |
displayName | string | Required. 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. |
labels | object | 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}{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. |
satisfiesPzi | boolean | Output only. Reserved for future use. |
satisfiesPzs | boolean | Output only. Reserved for future use. |
state | string | Output only. The current state of the instance. |
tags | object | Optional. 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. |
type | string | The type of the instance. Defaults to PRODUCTION . |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | projectsId , instancesId | Gets information about an instance. | |
list | select | projectsId | pageToken | Lists information about instances in a project. |
create | insert | projectsId | 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. | |
update | replace | projectsId , instancesId | 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. | |
delete | delete | projectsId , instancesId | Delete an instance from a project. | |
partial_update_instance | exec | projectsId , instancesId | updateMask | 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. |
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.
Name | Datatype | Description |
---|---|---|
instancesId | string | |
projectsId | string | |
pageToken | string | |
updateMask | string (google-fieldmask) |
SELECT
examples
- get
- list
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;
Lists information about instances in a project.
SELECT
name,
createTime,
displayName,
labels,
satisfiesPzi,
satisfiesPzs,
state,
tags,
type
FROM google.bigtableadmin.instances
WHERE projectsId = '{{ projectsId }}' -- required
AND pageToken = '{{ pageToken }}';
INSERT
examples
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: instances
props:
- name: projectsId
value: string
description: Required parameter for the instances resource.
- name: parent
value: string
description: >
Required. The unique name of the project in which to create the new instance. Values are of the form `projects/{project}`.
- name: instanceId
value: string
description: >
Required. The ID to be used when referring to the new instance within its project, e.g., just `myinstance` rather than `projects/myproject/instances/myinstance`.
- name: instance
value: object
description: >
Required. The instance to create. Fields marked `OutputOnly` must be left blank.
- name: clusters
value: object
description: >
Required. 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.
REPLACE
examples
- update
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
Delete an instance from a project.
DELETE FROM google.bigtableadmin.instances
WHERE projectsId = '{{ projectsId }}' --required
AND instancesId = '{{ instancesId }}' --required;
Lifecycle Methods
- partial_update_instance
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 }}"
}';