@BetaApi(
      "The surface for long-running operations is not stable yet and may change in the future.")
  public final OperationFuture<Instance, CreateInstanceMetadata> createInstanceAsync(
      ProjectName parent, InstanceName instanceId, Instance instance) {

    CreateInstanceRequest request =
        CreateInstanceRequest.newBuilder()
            .setParent(parent == null ? null : parent.toString())
            .setInstanceId(instanceId == null ? null : instanceId.toString())
            .setInstance(instance)
            .build();
    return createInstanceAsync(request);
  }
@ BetaApi ( "The surface for long-running operations is not stable yet and may change in the future." ) public final OperationFuture < Instance , CreateInstanceMetadata > createInstanceAsync ( ProjectName parent , InstanceName instanceId , Instance instance ) { CreateInstanceRequest request = CreateInstanceRequest . newBuilder ( ) . setParent ( parent == null ? null : parent . toString ( ) ) . setInstanceId ( instanceId == null ? null : instanceId . toString ( ) ) . setInstance ( instance ) . build ( ) ; return createInstanceAsync ( request ) ; }
Creates an instance and begins preparing it to begin serving. The returned [long-running
operation][google.longrunning.Operation] can be used to track the progress of preparing the new
instance. The instance name is assigned by the caller. If the named instance already exists,
`CreateInstance` returns `ALREADY_EXISTS`.

<p>Immediately upon completion of this request:

<p>&#42; The instance is readable via the API, with all requested attributes but no allocated
resources. Its state is `CREATING`.

<p>Until completion of the returned operation:

<p>&#42; Cancelling the operation renders the instance immediately unreadable via the API.
&#42; The instance can be deleted. &#42; All other attempts to modify the instance are
rejected.

<p>Upon completion of the returned operation:

<p>&#42; Billing for all successfully-allocated resources begins (some types may have lower
than the requested levels). &#42; Databases can be created in the instance. &#42; The
instance's allocated resource levels are readable via the API. &#42; The instance's state
becomes `READY`.

<p>The returned [long-running operation][google.longrunning.Operation] will have a name of the
format `&lt;instance_name&gt;/operations/&lt;operation_id&gt;` and can be used to track
creation of the instance. The [metadata][google.longrunning.Operation.metadata] field type is
[CreateInstanceMetadata][google.spanner.admin.instance.v1.CreateInstanceMetadata]. The
[response][google.longrunning.Operation.response] field type is
[Instance][google.spanner.admin.instance.v1.Instance], if successful.

<p>Sample code:

<pre><code>
try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
InstanceName instanceId = InstanceName.of("[PROJECT]", "[INSTANCE]");
Instance instance = Instance.newBuilder().build();
Instance response = instanceAdminClient.createInstanceAsync(parent, instanceId, instance).get();
}
</code></pre>

@param parent Required. The name of the project in which to create the instance. Values are of
the form `projects/&lt;project&gt;`.
@param instanceId Required. The ID of the instance to create. Valid identifiers are of the form
`[a-z][-a-z0-9]&#42;[a-z0-9]` and must be between 6 and 30 characters in length.
@param instance Required. The instance to create. The name may be omitted, but if specified
must be `&lt;parent&gt;/instances/&lt;instance_id&gt;`.
@throws com.google.api.gax.rpc.ApiException if the remote call fails