public final class CreateInstanceRequest
Parameters for creating a new Bigtable Instance.
A Cloud Bigtable instance is mostly just a container for your clusters and nodes, which do all of the real work. Instances come in 2 flavors:
- Production
- A standard instance with either 1 or 2 clusters, as well as 3 or more nodes in each cluster. You cannot downgrade a production instance to a development instance.
- Development
- A low-cost instance for development and testing, with performance limited to the equivalent of a 1-node cluster. Development instances only support a single 1 node cluster. At any point this can be upgraded to a production instance.
When creating an Instance, you must create at least one cluster in it.
Examples:
// Small production instance:
CreateInstanceRequest smallProdInstanceRequest = CreateInstanceRequest.of("my-small-instance")
.addCluster("cluster1", "us-east1-c", 3, StorageType.SSD);
// Development instance:
CreateInstanceRequest smallProdInstanceRequest = CreateInstanceRequest.of("my-dev-instance")
.setType(Type.DEVELOPMENT)
.addDevelopmentCluster("cluster1", "us-east1-c", StorageType.SSD);
See Also: For more details
Static Methods
of(String instanceId)
public static CreateInstanceRequest of(String instanceId)
Builds a new request to create a new instance with the specified id.
Name | Description |
instanceId | String |
Type | Description |
CreateInstanceRequest |
Methods
addCluster(String clusterId, String zone, ClusterAutoscalingConfig clusterAutoscalingConfig, StorageType storageType)
public CreateInstanceRequest addCluster(String clusterId, String zone, ClusterAutoscalingConfig clusterAutoscalingConfig, StorageType storageType)
Adds a cluster to the instance request with autoscaling enabled.
All new instances must have at least one cluster. DEVELOPMENT instances must have exactly one cluster.
Name | Description |
clusterId | String the name of the cluster. |
zone | String the zone where the cluster will be created. |
clusterAutoscalingConfig | ClusterAutoscalingConfig the autoscaling config that sets the min serve nodes, max serve nodes, and CPU utilization percentage |
storageType | StorageType the type of storage used by this cluster to serve its parent instance's tables. |
Type | Description |
CreateInstanceRequest |
addCluster(String clusterId, String zone, int serveNodes, StorageType storageType)
public CreateInstanceRequest addCluster(String clusterId, String zone, int serveNodes, StorageType storageType)
Adds a cluster to the instance request with manual scaling enabled.
All new instances must have at least one cluster. DEVELOPMENT instances must have exactly one cluster.
Name | Description |
clusterId | String the name of the cluster. |
zone | String the zone where the cluster will be created. |
serveNodes | int the number of nodes that cluster will contain. DEVELOPMENT instance clusters must have exactly one node. |
storageType | StorageType the type of storage used by this cluster to serve its parent instance's tables. |
Type | Description |
CreateInstanceRequest |
addCmekCluster(String clusterId, String zone, int serveNodes, StorageType storageType, String kmsKeyName)
public CreateInstanceRequest addCmekCluster(String clusterId, String zone, int serveNodes, StorageType storageType, String kmsKeyName)
Adds a CMEK protected cluster using the specified KMS key name.
Name | Description |
clusterId | String the name of the cluster. |
zone | String the zone where the cluster will be created. |
serveNodes | int the number of nodes that cluster will contain. DEVELOPMENT instance clusters must have exactly one node. |
storageType | StorageType the type of storage used by this cluster to serve its parent instance's tables. |
kmsKeyName | String the full name of the KMS key name to use in the format
|
Type | Description |
CreateInstanceRequest |
addDevelopmentCluster(String clusterId, String zone, StorageType storageType)
public CreateInstanceRequest addDevelopmentCluster(String clusterId, String zone, StorageType storageType)
Adds a DEVELOPMENT cluster to the instance request.
This instance will have exactly one node cluster.
Name | Description |
clusterId | String the name of the cluster. |
zone | String the zone where the cluster will be created. |
storageType | StorageType the type of storage used by this cluster to serve its parent instance's tables. |
Type | Description |
CreateInstanceRequest |
addLabel(String key, String value)
public CreateInstanceRequest addLabel(String key, String value)
Adds an arbitrary label to the instance.
Labels are key-value pairs that you can use to group related instances and store metadata about an instance. See Also: For more details
Name | Description |
key | String |
value | String |
Type | Description |
CreateInstanceRequest |
setDisplayName(String displayName)
public CreateInstanceRequest setDisplayName(String displayName)
Sets the friendly display name of the instance. If left unspecified, it will default to the id
Name | Description |
displayName | String |
Type | Description |
CreateInstanceRequest |
setType(Instance.Type type)
public CreateInstanceRequest setType(Instance.Type type)
Sets the type of instance.
Can be either DEVELOPMENT or PRODUCTION. Defaults to PRODUCTION. Please see class javadoc for details.
Name | Description |
type | Instance.Type |
Type | Description |
CreateInstanceRequest |
toProto(String projectId)
public CreateInstanceRequest toProto(String projectId)
Creates the request protobuf. This method is considered an internal implementation detail and not meant to be used by applications.
Name | Description |
projectId | String |
Type | Description |
com.google.bigtable.admin.v2.CreateInstanceRequest |