public final class CreateInstanceRequest extends Object
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:
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)
.addCluster("cluster1", "us-east1-c", 1, StorageType.SSD);
Modifier and Type | Method and Description |
---|---|
CreateInstanceRequest |
addCluster(String clusterId,
String zone,
int serveNodes,
StorageType storageType)
Adds a cluster to the instance request.
|
CreateInstanceRequest |
addLabel(String key,
String value)
Adds an arbitrary label to the instance.
|
static CreateInstanceRequest |
of(String instanceId)
Builds a new request to create a new instance with the specified id.
|
CreateInstanceRequest |
setDisplayName(String displayName)
Sets the friendly display name of the instance.
|
CreateInstanceRequest |
setType(Instance.Type type)
Sets the type of instance.
|
com.google.bigtable.admin.v2.CreateInstanceRequest |
toProto(String projectId)
Creates the request protobuf.
|
public static CreateInstanceRequest of(@Nonnull String instanceId)
public CreateInstanceRequest setDisplayName(@Nonnull String displayName)
public CreateInstanceRequest setType(@Nonnull Instance.Type type)
Can be either DEVELOPMENT or PRODUCTION. Defaults to PRODUCTION. Please see class javadoc for details.
public CreateInstanceRequest addLabel(@Nonnull String key, @Nonnull String value)
Labels are key-value pairs that you can use to group related instances and store metadata about an instance.
public CreateInstanceRequest addCluster(@Nonnull String clusterId, @Nonnull String zone, int serveNodes, @Nonnull StorageType storageType)
All new instances must have at least one cluster. DEVELOPMENT instances must have exactly one cluster.
clusterId
- The name of the cluster.zone
- The zone where the cluster will be created.serveNodes
- The number of nodes that cluster will contain. DEVELOPMENT instance clusters
must have exactly one node.storageType
- The type of storage used by this cluster to serve its parent instance's
tables.@InternalApi public com.google.bigtable.admin.v2.CreateInstanceRequest toProto(String projectId)
Copyright © 2019 Google LLC. All rights reserved.