# Class CreateInstanceRequest (2.79.0)

2.79.0 (latest) 2.78.1 2.77.0 2.74.0 2.73.0 2.72.0 2.71.0 2.70.0 2.68.0 2.67.1 2.66.0 2.65.1 2.63.0 2.62.0 2.61.0 2.60.0 2.59.0 2.58.2 2.56.0 2.54.0 2.52.0 2.51.2 2.49.0 2.46.0 2.45.1 2.44.1 2.43.0 2.42.0 2.40.0 2.39.5 2.37.0 2.35.1 2.34.0 2.33.0 2.32.0 2.31.0 2.30.0 2.29.1 2.28.0

    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](https://cloud.google.com/bigtable/docs/instances-clusters-nodes#instances)

## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> CreateInstanceRequest

## Inherited Members

[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) [Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) [Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) [Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) [Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) [Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) [Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) [Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) [Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) [Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) [Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)

## Static Methods

### of(String instanceId)

    public static CreateInstanceRequest of(String instanceId)

Builds a new request to create a new instance with the specified id.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `instanceId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.admin.v2.models.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.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `clusterId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` the name of the cluster. |
| `zone` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` the zone where the cluster will be created. |
| `clusterAutoscalingConfig` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.admin.v2.models.ClusterAutoscalingConfig` the autoscaling config that sets the min serve nodes, max serve nodes, and CPU utilization percentage |
| `storageType` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.admin.v2.models.StorageType` the type of storage used by this cluster to serve its parent instance's tables. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.admin.v2.models.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.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `clusterId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` the name of the cluster. |
| `zone` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` the zone where the cluster will be created. |
| `serveNodes` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` the number of nodes that cluster will contain. DEVELOPMENT instance clusters must have exactly one node. |
| `storageType` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.admin.v2.models.StorageType` the type of storage used by this cluster to serve its parent instance's tables. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.admin.v2.models.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.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `clusterId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` the name of the cluster. |
| `zone` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` the zone where the cluster will be created. |
| `serveNodes` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` the number of nodes that cluster will contain. DEVELOPMENT instance clusters must have exactly one node. |
| `storageType` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.admin.v2.models.StorageType` the type of storage used by this cluster to serve its parent instance's tables. |
| `kmsKeyName` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` the full name of the KMS key name to use in the format `projects/{key_project_id}/locations/{location}/keyRings/{ring_name}/cryptoKeys/{key_name}` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.admin.v2.models.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.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `clusterId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` the name of the cluster. |
| `zone` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` the zone where the cluster will be created. |
| `storageType` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.admin.v2.models.StorageType` the type of storage used by this cluster to serve its parent instance's tables. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.admin.v2.models.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](https://cloud.google.com/bigtable/docs/creating-managing-labels)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `key` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |
| `value` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.admin.v2.models.CreateInstanceRequest` |   |

### addTag(String key, String value)

    public CreateInstanceRequest addTag(String key, String value)

Adds a tag to the instance.

Tags are a way to organize and govern resources across Google Cloud. Unlike labels, Tags are
standalone resources created and managed through the Resource Manager API.
See Also: [For more details](https://cloud.google.com/bigtable/docs/tags)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `key` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |
| `value` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.admin.v2.models.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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `displayName` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.admin.v2.models.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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `type` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.admin.v2.models.Instance.Type` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.admin.v2.models.CreateInstanceRequest` |   |

### toProto(String projectId)

    public CreateInstanceRequest toProto(String projectId)

> [!WARNING]
> **Internal Only**: This feature is not stable for application use.

Creates the request protobuf. This method is considered an internal implementation detail and
not meant to be used by applications.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `projectId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.bigtable.admin.v2.CreateInstanceRequest` |   |