diff --git a/google-cloud-bigtable/pom.xml b/google-cloud-bigtable/pom.xml
new file mode 100644
index 000000000000..332cc1a30b5d
--- /dev/null
+++ b/google-cloud-bigtable/pom.xml
@@ -0,0 +1,183 @@
+
+
This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *
+ *
+ * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]");
+ * Instance response = bigtableInstanceAdminClient.getInstance(name);
+ * }
+ *
+ *
+ *
+ * Note: close() needs to be called on the bigtableInstanceAdminClient object to clean up + * resources such as threads. In the example above, try-with-resources is used, which automatically + * calls close(). + * + *
The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *
See the individual methods for example code. + * + *
Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *
This class can be customized by passing in a custom instance of BigtableInstanceAdminSettings + * to create(). For example: + * + *
To customize credentials: + * + *
+ *
+ * BigtableInstanceAdminSettings bigtableInstanceAdminSettings =
+ * BigtableInstanceAdminSettings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * BigtableInstanceAdminClient bigtableInstanceAdminClient =
+ * BigtableInstanceAdminClient.create(bigtableInstanceAdminSettings);
+ *
+ *
+ *
+ * To customize the endpoint:
+ *
+ *
+ *
+ * BigtableInstanceAdminSettings bigtableInstanceAdminSettings =
+ * BigtableInstanceAdminSettings.newBuilder()
+ * .setTransportChannelProvider(BigtableInstanceAdminSettings.defaultGrpcTransportProviderBuilder()
+ * .setEndpoint(myEndpoint)
+ * .build())
+ * .build();
+ * BigtableInstanceAdminClient bigtableInstanceAdminClient =
+ * BigtableInstanceAdminClient.create(bigtableInstanceAdminSettings);
+ *
+ *
+ */
+@Generated("by GAPIC v0.0.5")
+@BetaApi
+public class BigtableInstanceAdminClient implements BackgroundResource {
+ private final BigtableInstanceAdminSettings settings;
+ private final BigtableInstanceAdminStub stub;
+ private final OperationsClient operationsClient;
+
+ /** Constructs an instance of BigtableInstanceAdminClient with default settings. */
+ public static final BigtableInstanceAdminClient create() throws IOException {
+ return create(BigtableInstanceAdminSettings.newBuilder().build());
+ }
+
+ /**
+ * Constructs an instance of BigtableInstanceAdminClient, using the given settings. The channels
+ * are created based on the settings passed in, or defaults for any settings that are not set.
+ */
+ public static final BigtableInstanceAdminClient create(BigtableInstanceAdminSettings settings)
+ throws IOException {
+ return new BigtableInstanceAdminClient(settings);
+ }
+
+ /**
+ * Constructs an instance of BigtableInstanceAdminClient, using the given stub for making calls.
+ * This is for advanced usage - prefer to use BigtableInstanceAdminSettings}.
+ */
+ @BetaApi
+ public static final BigtableInstanceAdminClient create(BigtableInstanceAdminStub stub) {
+ return new BigtableInstanceAdminClient(stub);
+ }
+
+ /**
+ * Constructs an instance of BigtableInstanceAdminClient, using the given settings. This is
+ * protected so that it is easy to make a subclass, but otherwise, the static factory methods
+ * should be preferred.
+ */
+ protected BigtableInstanceAdminClient(BigtableInstanceAdminSettings settings) throws IOException {
+ this.settings = settings;
+ this.stub = settings.createStub();
+ this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
+ }
+
+ protected BigtableInstanceAdminClient(BigtableInstanceAdminStub stub) {
+ this.settings = null;
+ this.stub = stub;
+ this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
+ }
+
+ public final BigtableInstanceAdminSettings getSettings() {
+ return settings;
+ }
+
+ @BetaApi
+ public BigtableInstanceAdminStub getStub() {
+ return stub;
+ }
+
+ /**
+ * Returns the OperationsClient that can be used to query the status of a long-running operation
+ * returned by another API method call.
+ */
+ public final OperationsClient getOperationsClient() {
+ return operationsClient;
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Create an instance within a project.
+ *
+ * Sample code: + * + *
+ * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * ProjectName parent = ProjectName.of("[PROJECT]");
+ * String instanceId = "";
+ * Instance instance = Instance.newBuilder().build();
+ * Map<String, Cluster> clusters = new HashMap<>();
+ * Instance response = bigtableInstanceAdminClient.createInstanceAsync(parent, instanceId, instance, clusters).get();
+ * }
+ *
+ *
+ * @param parent The unique name of the project in which to create the new instance. Values are of
+ * the form `projects/<project>`.
+ * @param instanceId The ID to be used when referring to the new instance within its project,
+ * e.g., just `myinstance` rather than `projects/myproject/instances/myinstance`.
+ * @param instance The instance to create. Fields marked `OutputOnly` must be left blank.
+ * @param clusters 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. Currently exactly one cluster must be specified.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample code: + * + *
+ * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * ProjectName parent = ProjectName.of("[PROJECT]");
+ * String instanceId = "";
+ * Instance instance = Instance.newBuilder().build();
+ * Map<String, Cluster> clusters = new HashMap<>();
+ * CreateInstanceRequest request = CreateInstanceRequest.newBuilder()
+ * .setParentWithProjectName(parent)
+ * .setInstanceId(instanceId)
+ * .setInstance(instance)
+ * .putAllClusters(clusters)
+ * .build();
+ * Instance response = bigtableInstanceAdminClient.createInstanceAsync(request).get();
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample code: + * + *
+ * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * ProjectName parent = ProjectName.of("[PROJECT]");
+ * String instanceId = "";
+ * Instance instance = Instance.newBuilder().build();
+ * Map<String, Cluster> clusters = new HashMap<>();
+ * CreateInstanceRequest request = CreateInstanceRequest.newBuilder()
+ * .setParentWithProjectName(parent)
+ * .setInstanceId(instanceId)
+ * .setInstance(instance)
+ * .putAllClusters(clusters)
+ * .build();
+ * OperationFuture<Operation> future = bigtableInstanceAdminClient.createInstanceOperationCallable().futureCall(request);
+ * // Do something
+ * Instance response = future.get();
+ * }
+ *
+ */
+ public final OperationCallableSample code: + * + *
+ * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * ProjectName parent = ProjectName.of("[PROJECT]");
+ * String instanceId = "";
+ * Instance instance = Instance.newBuilder().build();
+ * Map<String, Cluster> clusters = new HashMap<>();
+ * CreateInstanceRequest request = CreateInstanceRequest.newBuilder()
+ * .setParentWithProjectName(parent)
+ * .setInstanceId(instanceId)
+ * .setInstance(instance)
+ * .putAllClusters(clusters)
+ * .build();
+ * ApiFuture<Operation> future = bigtableInstanceAdminClient.createInstanceCallable().futureCall(request);
+ * // Do something
+ * Operation response = future.get();
+ * }
+ *
+ */
+ public final UnaryCallableSample code: + * + *
+ * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]");
+ * Instance response = bigtableInstanceAdminClient.getInstance(name);
+ * }
+ *
+ *
+ * @param name The unique name of the requested instance. Values are of the form
+ * `projects/<project>/instances/<instance>`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Instance getInstance(InstanceName name) {
+
+ GetInstanceRequest request =
+ GetInstanceRequest.newBuilder().setNameWithInstanceName(name).build();
+ return getInstance(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets information about an instance.
+ *
+ * Sample code: + * + *
+ * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]");
+ * GetInstanceRequest request = GetInstanceRequest.newBuilder()
+ * .setNameWithInstanceName(name)
+ * .build();
+ * Instance response = bigtableInstanceAdminClient.getInstance(request);
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ private final Instance getInstance(GetInstanceRequest request) {
+ return getInstanceCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets information about an instance.
+ *
+ * Sample code: + * + *
+ * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]");
+ * GetInstanceRequest request = GetInstanceRequest.newBuilder()
+ * .setNameWithInstanceName(name)
+ * .build();
+ * ApiFuture<Instance> future = bigtableInstanceAdminClient.getInstanceCallable().futureCall(request);
+ * // Do something
+ * Instance response = future.get();
+ * }
+ *
+ */
+ public final UnaryCallableSample code: + * + *
+ * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * ProjectName parent = ProjectName.of("[PROJECT]");
+ * ListInstancesResponse response = bigtableInstanceAdminClient.listInstances(parent);
+ * }
+ *
+ *
+ * @param parent The unique name of the project for which a list of instances is requested. Values
+ * are of the form `projects/<project>`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListInstancesResponse listInstances(ProjectName parent) {
+
+ ListInstancesRequest request =
+ ListInstancesRequest.newBuilder().setParentWithProjectName(parent).build();
+ return listInstances(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists information about instances in a project.
+ *
+ * Sample code: + * + *
+ * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * ProjectName parent = ProjectName.of("[PROJECT]");
+ * ListInstancesRequest request = ListInstancesRequest.newBuilder()
+ * .setParentWithProjectName(parent)
+ * .build();
+ * ListInstancesResponse response = bigtableInstanceAdminClient.listInstances(request);
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListInstancesResponse listInstances(ListInstancesRequest request) {
+ return listInstancesCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists information about instances in a project.
+ *
+ * Sample code: + * + *
+ * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * ProjectName parent = ProjectName.of("[PROJECT]");
+ * ListInstancesRequest request = ListInstancesRequest.newBuilder()
+ * .setParentWithProjectName(parent)
+ * .build();
+ * ApiFuture<ListInstancesResponse> future = bigtableInstanceAdminClient.listInstancesCallable().futureCall(request);
+ * // Do something
+ * ListInstancesResponse response = future.get();
+ * }
+ *
+ */
+ public final UnaryCallableSample code: + * + *
+ * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]");
+ * String displayName = "";
+ * Instance.Type type = Instance.Type.TYPE_UNSPECIFIED;
+ * Instance response = bigtableInstanceAdminClient.updateInstance(name, displayName, type);
+ * }
+ *
+ *
+ * @param name (`OutputOnly`) The unique name of the instance. Values are of the form
+ * `projects/<project>/instances/[a-z][a-z0-9\\-]+[a-z0-9]`.
+ * @param displayName 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.
+ * @param type The type of the instance. Defaults to `PRODUCTION`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Instance updateInstance(InstanceName name, String displayName, Instance.Type type) {
+
+ Instance request =
+ Instance.newBuilder()
+ .setNameWithInstanceName(name)
+ .setDisplayName(displayName)
+ .setType(type)
+ .build();
+ return updateInstance(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Updates an instance within a project.
+ *
+ * Sample code: + * + *
+ * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]");
+ * String displayName = "";
+ * Instance.Type type = Instance.Type.TYPE_UNSPECIFIED;
+ * Instance request = Instance.newBuilder()
+ * .setNameWithInstanceName(name)
+ * .setDisplayName(displayName)
+ * .setType(type)
+ * .build();
+ * Instance response = bigtableInstanceAdminClient.updateInstance(request);
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Instance updateInstance(Instance request) {
+ return updateInstanceCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Updates an instance within a project.
+ *
+ * Sample code: + * + *
+ * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]");
+ * String displayName = "";
+ * Instance.Type type = Instance.Type.TYPE_UNSPECIFIED;
+ * Instance request = Instance.newBuilder()
+ * .setNameWithInstanceName(name)
+ * .setDisplayName(displayName)
+ * .setType(type)
+ * .build();
+ * ApiFuture<Instance> future = bigtableInstanceAdminClient.updateInstanceCallable().futureCall(request);
+ * // Do something
+ * Instance response = future.get();
+ * }
+ *
+ */
+ public final UnaryCallableSample code: + * + *
+ * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]");
+ * bigtableInstanceAdminClient.deleteInstance(name);
+ * }
+ *
+ *
+ * @param name The unique name of the instance to be deleted. Values are of the form
+ * `projects/<project>/instances/<instance>`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteInstance(InstanceName name) {
+
+ DeleteInstanceRequest request =
+ DeleteInstanceRequest.newBuilder().setNameWithInstanceName(name).build();
+ deleteInstance(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Delete an instance from a project.
+ *
+ * Sample code: + * + *
+ * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]");
+ * DeleteInstanceRequest request = DeleteInstanceRequest.newBuilder()
+ * .setNameWithInstanceName(name)
+ * .build();
+ * bigtableInstanceAdminClient.deleteInstance(request);
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ private final void deleteInstance(DeleteInstanceRequest request) {
+ deleteInstanceCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Delete an instance from a project.
+ *
+ * Sample code: + * + *
+ * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]");
+ * DeleteInstanceRequest request = DeleteInstanceRequest.newBuilder()
+ * .setNameWithInstanceName(name)
+ * .build();
+ * ApiFuture<Void> future = bigtableInstanceAdminClient.deleteInstanceCallable().futureCall(request);
+ * // Do something
+ * future.get();
+ * }
+ *
+ */
+ public final UnaryCallableSample code: + * + *
+ * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+ * String clusterId = "";
+ * Cluster cluster = Cluster.newBuilder().build();
+ * Cluster response = bigtableInstanceAdminClient.createClusterAsync(parent, clusterId, cluster).get();
+ * }
+ *
+ *
+ * @param parent The unique name of the instance in which to create the new cluster. Values are of
+ * the form `projects/<project>/instances/<instance>`.
+ * @param clusterId The ID to be used when referring to the new cluster within its instance, e.g.,
+ * just `mycluster` rather than `projects/myproject/instances/myinstance/clusters/mycluster`.
+ * @param cluster The cluster to be created. Fields marked `OutputOnly` must be left blank.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample code: + * + *
+ * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+ * String clusterId = "";
+ * Cluster cluster = Cluster.newBuilder().build();
+ * CreateClusterRequest request = CreateClusterRequest.newBuilder()
+ * .setParentWithInstanceName(parent)
+ * .setClusterId(clusterId)
+ * .setCluster(cluster)
+ * .build();
+ * Cluster response = bigtableInstanceAdminClient.createClusterAsync(request).get();
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample code: + * + *
+ * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+ * String clusterId = "";
+ * Cluster cluster = Cluster.newBuilder().build();
+ * CreateClusterRequest request = CreateClusterRequest.newBuilder()
+ * .setParentWithInstanceName(parent)
+ * .setClusterId(clusterId)
+ * .setCluster(cluster)
+ * .build();
+ * OperationFuture<Operation> future = bigtableInstanceAdminClient.createClusterOperationCallable().futureCall(request);
+ * // Do something
+ * Cluster response = future.get();
+ * }
+ *
+ */
+ public final OperationCallableSample code: + * + *
+ * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+ * String clusterId = "";
+ * Cluster cluster = Cluster.newBuilder().build();
+ * CreateClusterRequest request = CreateClusterRequest.newBuilder()
+ * .setParentWithInstanceName(parent)
+ * .setClusterId(clusterId)
+ * .setCluster(cluster)
+ * .build();
+ * ApiFuture<Operation> future = bigtableInstanceAdminClient.createClusterCallable().futureCall(request);
+ * // Do something
+ * Operation response = future.get();
+ * }
+ *
+ */
+ public final UnaryCallableSample code: + * + *
+ * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * ClusterName name = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
+ * Cluster response = bigtableInstanceAdminClient.getCluster(name);
+ * }
+ *
+ *
+ * @param name The unique name of the requested cluster. Values are of the form
+ * `projects/<project>/instances/<instance>/clusters/<cluster>`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Cluster getCluster(ClusterName name) {
+
+ GetClusterRequest request = GetClusterRequest.newBuilder().setNameWithClusterName(name).build();
+ return getCluster(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets information about a cluster.
+ *
+ * Sample code: + * + *
+ * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * ClusterName name = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
+ * GetClusterRequest request = GetClusterRequest.newBuilder()
+ * .setNameWithClusterName(name)
+ * .build();
+ * Cluster response = bigtableInstanceAdminClient.getCluster(request);
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ private final Cluster getCluster(GetClusterRequest request) {
+ return getClusterCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets information about a cluster.
+ *
+ * Sample code: + * + *
+ * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * ClusterName name = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
+ * GetClusterRequest request = GetClusterRequest.newBuilder()
+ * .setNameWithClusterName(name)
+ * .build();
+ * ApiFuture<Cluster> future = bigtableInstanceAdminClient.getClusterCallable().futureCall(request);
+ * // Do something
+ * Cluster response = future.get();
+ * }
+ *
+ */
+ public final UnaryCallableSample code: + * + *
+ * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+ * ListClustersResponse response = bigtableInstanceAdminClient.listClusters(parent);
+ * }
+ *
+ *
+ * @param parent The unique name of the instance for which a list of clusters is requested. Values
+ * are of the form `projects/<project>/instances/<instance>`. Use
+ * `<instance> = '-'` to list Clusters for all Instances in a project, e.g.,
+ * `projects/myproject/instances/-`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListClustersResponse listClusters(InstanceName parent) {
+
+ ListClustersRequest request =
+ ListClustersRequest.newBuilder().setParentWithInstanceName(parent).build();
+ return listClusters(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists information about clusters in an instance.
+ *
+ * Sample code: + * + *
+ * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+ * ListClustersRequest request = ListClustersRequest.newBuilder()
+ * .setParentWithInstanceName(parent)
+ * .build();
+ * ListClustersResponse response = bigtableInstanceAdminClient.listClusters(request);
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListClustersResponse listClusters(ListClustersRequest request) {
+ return listClustersCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists information about clusters in an instance.
+ *
+ * Sample code: + * + *
+ * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+ * ListClustersRequest request = ListClustersRequest.newBuilder()
+ * .setParentWithInstanceName(parent)
+ * .build();
+ * ApiFuture<ListClustersResponse> future = bigtableInstanceAdminClient.listClustersCallable().futureCall(request);
+ * // Do something
+ * ListClustersResponse response = future.get();
+ * }
+ *
+ */
+ public final UnaryCallableSample code: + * + *
+ * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * ClusterName name = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
+ * LocationName location = LocationName.of("[PROJECT]", "[LOCATION]");
+ * int serveNodes = 0;
+ * StorageType defaultStorageType = StorageType.STORAGE_TYPE_UNSPECIFIED;
+ * Cluster response = bigtableInstanceAdminClient.updateClusterAsync(name, location, serveNodes, defaultStorageType).get();
+ * }
+ *
+ *
+ * @param name (`OutputOnly`) The unique name of the cluster. Values are of the form
+ * `projects/<project>/instances/<instance>/clusters/[a-z][-a-z0-9]*`.
+ * @param location (`CreationOnly`) The location where this cluster's nodes and storage reside.
+ * For best performance, clients should be located as close as possible to this cluster.
+ * Currently only zones are supported, so values should be of the form
+ * `projects/<project>/locations/<zone>`.
+ * @param serveNodes The number of nodes allocated to this cluster. More nodes enable higher
+ * throughput and more consistent performance.
+ * @param defaultStorageType (`CreationOnly`) The type of storage used by this cluster to serve
+ * its parent instance's tables, unless explicitly overridden.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample code: + * + *
+ * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * ClusterName name = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
+ * LocationName location = LocationName.of("[PROJECT]", "[LOCATION]");
+ * int serveNodes = 0;
+ * StorageType defaultStorageType = StorageType.STORAGE_TYPE_UNSPECIFIED;
+ * Cluster request = Cluster.newBuilder()
+ * .setNameWithClusterName(name)
+ * .setLocationWithLocationName(location)
+ * .setServeNodes(serveNodes)
+ * .setDefaultStorageType(defaultStorageType)
+ * .build();
+ * Cluster response = bigtableInstanceAdminClient.updateClusterAsync(request).get();
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample code: + * + *
+ * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * ClusterName name = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
+ * LocationName location = LocationName.of("[PROJECT]", "[LOCATION]");
+ * int serveNodes = 0;
+ * StorageType defaultStorageType = StorageType.STORAGE_TYPE_UNSPECIFIED;
+ * Cluster request = Cluster.newBuilder()
+ * .setNameWithClusterName(name)
+ * .setLocationWithLocationName(location)
+ * .setServeNodes(serveNodes)
+ * .setDefaultStorageType(defaultStorageType)
+ * .build();
+ * OperationFuture<Operation> future = bigtableInstanceAdminClient.updateClusterOperationCallable().futureCall(request);
+ * // Do something
+ * Cluster response = future.get();
+ * }
+ *
+ */
+ public final OperationCallableSample code: + * + *
+ * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * ClusterName name = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
+ * LocationName location = LocationName.of("[PROJECT]", "[LOCATION]");
+ * int serveNodes = 0;
+ * StorageType defaultStorageType = StorageType.STORAGE_TYPE_UNSPECIFIED;
+ * Cluster request = Cluster.newBuilder()
+ * .setNameWithClusterName(name)
+ * .setLocationWithLocationName(location)
+ * .setServeNodes(serveNodes)
+ * .setDefaultStorageType(defaultStorageType)
+ * .build();
+ * ApiFuture<Operation> future = bigtableInstanceAdminClient.updateClusterCallable().futureCall(request);
+ * // Do something
+ * Operation response = future.get();
+ * }
+ *
+ */
+ public final UnaryCallableSample code: + * + *
+ * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * ClusterName name = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
+ * bigtableInstanceAdminClient.deleteCluster(name);
+ * }
+ *
+ *
+ * @param name The unique name of the cluster to be deleted. Values are of the form
+ * `projects/<project>/instances/<instance>/clusters/<cluster>`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteCluster(ClusterName name) {
+
+ DeleteClusterRequest request =
+ DeleteClusterRequest.newBuilder().setNameWithClusterName(name).build();
+ deleteCluster(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes a cluster from an instance.
+ *
+ * Sample code: + * + *
+ * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * ClusterName name = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
+ * DeleteClusterRequest request = DeleteClusterRequest.newBuilder()
+ * .setNameWithClusterName(name)
+ * .build();
+ * bigtableInstanceAdminClient.deleteCluster(request);
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ private final void deleteCluster(DeleteClusterRequest request) {
+ deleteClusterCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes a cluster from an instance.
+ *
+ * Sample code: + * + *
+ * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * ClusterName name = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
+ * DeleteClusterRequest request = DeleteClusterRequest.newBuilder()
+ * .setNameWithClusterName(name)
+ * .build();
+ * ApiFuture<Void> future = bigtableInstanceAdminClient.deleteClusterCallable().futureCall(request);
+ * // Do something
+ * future.get();
+ * }
+ *
+ */
+ public final UnaryCallableThe default instance has everything set to sensible defaults: + * + *
The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of getInstance to 30 seconds: + * + *
+ *
+ * BigtableInstanceAdminSettings.Builder bigtableInstanceAdminSettingsBuilder =
+ * BigtableInstanceAdminSettings.newBuilder();
+ * bigtableInstanceAdminSettingsBuilder.getInstanceSettings().getRetrySettingsBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30));
+ * BigtableInstanceAdminSettings bigtableInstanceAdminSettings = bigtableInstanceAdminSettingsBuilder.build();
+ *
+ *
+ */
+@Generated("by GAPIC v0.0.5")
+@BetaApi
+public class BigtableInstanceAdminSettings extends ClientSettings {
+ /** The default scopes of the service. */
+ private static final ImmutableListNote: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction Provides access to the table schemas only, not the data stored within the tables.
+ *
+ * This class provides the ability to make remote calls to the backing service through method
+ * calls that map to API methods. Sample code to get started:
+ *
+ * Note: close() needs to be called on the bigtableTableAdminClient object to clean up resources
+ * such as threads. In the example above, try-with-resources is used, which automatically calls
+ * close().
+ *
+ * The surface of this class includes several types of Java methods for each of the API's
+ * methods:
+ *
+ * See the individual methods for example code.
+ *
+ * Many parameters require resource names to be formatted in a particular way. To assist with
+ * these names, this class includes a format method for each type of name, and additionally a parse
+ * method to extract the individual identifiers contained within names that are returned.
+ *
+ * This class can be customized by passing in a custom instance of BigtableTableAdminSettings to
+ * create(). For example:
+ *
+ * To customize credentials:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * The default instance has everything set to sensible defaults:
+ *
+ * The builder of this class is recursive, so contained classes are themselves builders. When
+ * build() is called, the tree of builders is called to create the complete settings object. For
+ * example, to set the total timeout of createTable to 30 seconds:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction The interfaces provided are listed below, along with usage samples.
+ *
+ * =========================== BigtableInstanceAdminClient ===========================
+ *
+ * Service Description: Service for creating, configuring, and deleting Cloud Bigtable Instances
+ * and Clusters. Provides access to the Instance and Cluster schemas only, not the tables' metadata
+ * or data stored in those tables.
+ *
+ * Sample for BigtableInstanceAdminClient:
+ *
+ * Service Description: Service for creating, configuring, and deleting Cloud Bigtable tables.
+ *
+ * Provides access to the table schemas only, not the data stored within the tables.
+ *
+ * Sample for BigtableTableAdminClient:
+ *
+ * This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by GAPIC v0.0.5")
+@BetaApi
+public abstract class BigtableInstanceAdminStub implements BackgroundResource {
+
+ public OperationsStub getOperationsStub() {
+ throw new UnsupportedOperationException("Not implemented: getOperationsStub()");
+ }
+
+ public OperationCallable This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by GAPIC v0.0.5")
+@BetaApi
+public abstract class BigtableTableAdminStub implements BackgroundResource {
+
+ public UnaryCallable This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by GAPIC v0.0.5")
+@BetaApi
+public class GrpcBigtableInstanceAdminStub extends BigtableInstanceAdminStub {
+
+ private static final MethodDescriptor This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by GAPIC v0.0.5")
+@BetaApi
+public class GrpcBigtableTableAdminStub extends BigtableTableAdminStub {
+
+ private static final MethodDescriptor
+ *
+ *
+ *
+ * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
+ * InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+ * String tableId = "";
+ * Table table = Table.newBuilder().build();
+ * Table response = bigtableTableAdminClient.createTable(parent, tableId, table);
+ * }
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * To customize the endpoint:
+ *
+ *
+ * BigtableTableAdminSettings bigtableTableAdminSettings =
+ * BigtableTableAdminSettings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * BigtableTableAdminClient bigtableTableAdminClient =
+ * BigtableTableAdminClient.create(bigtableTableAdminSettings);
+ *
+ *
+ *
+ */
+@Generated("by GAPIC v0.0.5")
+@BetaApi
+public class BigtableTableAdminClient implements BackgroundResource {
+ private final BigtableTableAdminSettings settings;
+ private final BigtableTableAdminStub stub;
+
+ /** Constructs an instance of BigtableTableAdminClient with default settings. */
+ public static final BigtableTableAdminClient create() throws IOException {
+ return create(BigtableTableAdminSettings.newBuilder().build());
+ }
+
+ /**
+ * Constructs an instance of BigtableTableAdminClient, using the given settings. The channels are
+ * created based on the settings passed in, or defaults for any settings that are not set.
+ */
+ public static final BigtableTableAdminClient create(BigtableTableAdminSettings settings)
+ throws IOException {
+ return new BigtableTableAdminClient(settings);
+ }
+
+ /**
+ * Constructs an instance of BigtableTableAdminClient, using the given stub for making calls. This
+ * is for advanced usage - prefer to use BigtableTableAdminSettings}.
+ */
+ @BetaApi
+ public static final BigtableTableAdminClient create(BigtableTableAdminStub stub) {
+ return new BigtableTableAdminClient(stub);
+ }
+
+ /**
+ * Constructs an instance of BigtableTableAdminClient, using the given settings. This is protected
+ * so that it is easy to make a subclass, but otherwise, the static factory methods should be
+ * preferred.
+ */
+ protected BigtableTableAdminClient(BigtableTableAdminSettings settings) throws IOException {
+ this.settings = settings;
+ this.stub = settings.createStub();
+ }
+
+ protected BigtableTableAdminClient(BigtableTableAdminStub stub) {
+ this.settings = null;
+ this.stub = stub;
+ }
+
+ public final BigtableTableAdminSettings getSettings() {
+ return settings;
+ }
+
+ @BetaApi
+ public BigtableTableAdminStub getStub() {
+ return stub;
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a new table in the specified instance. The table can be created with a full set of
+ * initial column families, specified in the request.
+ *
+ *
+ * BigtableTableAdminSettings bigtableTableAdminSettings =
+ * BigtableTableAdminSettings.newBuilder()
+ * .setTransportChannelProvider(BigtableTableAdminSettings.defaultGrpcTransportProviderBuilder()
+ * .setEndpoint(myEndpoint)
+ * .build())
+ * .build();
+ * BigtableTableAdminClient bigtableTableAdminClient =
+ * BigtableTableAdminClient.create(bigtableTableAdminSettings);
+ *
+ *
+ *
+ * @param parent The unique name of the instance in which to create the table. Values are of the
+ * form `projects/<project>/instances/<instance>`.
+ * @param tableId The name by which the new table should be referred to within the parent
+ * instance, e.g., `foobar` rather than `<parent>/tables/foobar`.
+ * @param table The Table to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Table createTable(InstanceName parent, String tableId, Table table) {
+
+ CreateTableRequest request =
+ CreateTableRequest.newBuilder()
+ .setParentWithInstanceName(parent)
+ .setTableId(tableId)
+ .setTable(table)
+ .build();
+ return createTable(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a new table in the specified instance. The table can be created with a full set of
+ * initial column families, specified in the request.
+ *
+ *
+ * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
+ * InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+ * String tableId = "";
+ * Table table = Table.newBuilder().build();
+ * Table response = bigtableTableAdminClient.createTable(parent, tableId, table);
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Table createTable(CreateTableRequest request) {
+ return createTableCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a new table in the specified instance. The table can be created with a full set of
+ * initial column families, specified in the request.
+ *
+ *
+ * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
+ * InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+ * String tableId = "";
+ * Table table = Table.newBuilder().build();
+ * CreateTableRequest request = CreateTableRequest.newBuilder()
+ * .setParentWithInstanceName(parent)
+ * .setTableId(tableId)
+ * .setTable(table)
+ * .build();
+ * Table response = bigtableTableAdminClient.createTable(request);
+ * }
+ *
+ */
+ public final UnaryCallable
+ * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
+ * InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+ * String tableId = "";
+ * Table table = Table.newBuilder().build();
+ * CreateTableRequest request = CreateTableRequest.newBuilder()
+ * .setParentWithInstanceName(parent)
+ * .setTableId(tableId)
+ * .setTable(table)
+ * .build();
+ * ApiFuture<Table> future = bigtableTableAdminClient.createTableCallable().futureCall(request);
+ * // Do something
+ * Table response = future.get();
+ * }
+ *
+ *
+ * @param parent The unique name of the instance for which tables should be listed. Values are of
+ * the form `projects/<project>/instances/<instance>`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListTablesPagedResponse listTables(InstanceName parent) {
+ ListTablesRequest request =
+ ListTablesRequest.newBuilder().setParentWithInstanceName(parent).build();
+ return listTables(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists all tables served from a specified instance.
+ *
+ *
+ * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
+ * InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+ * for (Table element : bigtableTableAdminClient.listTables(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ private final ListTablesPagedResponse listTables(ListTablesRequest request) {
+ return listTablesPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists all tables served from a specified instance.
+ *
+ *
+ * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
+ * InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+ * ListTablesRequest request = ListTablesRequest.newBuilder()
+ * .setParentWithInstanceName(parent)
+ * .build();
+ * for (Table element : bigtableTableAdminClient.listTables(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ */
+ public final UnaryCallable
+ * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
+ * InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+ * ListTablesRequest request = ListTablesRequest.newBuilder()
+ * .setParentWithInstanceName(parent)
+ * .build();
+ * ApiFuture<ListTablesPagedResponse> future = bigtableTableAdminClient.listTablesPagedCallable().futureCall(request);
+ * // Do something
+ * for (Table element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ */
+ public final UnaryCallable
+ * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
+ * InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+ * ListTablesRequest request = ListTablesRequest.newBuilder()
+ * .setParentWithInstanceName(parent)
+ * .build();
+ * while (true) {
+ * ListTablesResponse response = bigtableTableAdminClient.listTablesCallable().call(request);
+ * for (Table element : response.getTablesList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ *
+ *
+ * @param name The unique name of the requested table. Values are of the form
+ * `projects/<project>/instances/<instance>/tables/<table>`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Table getTable(TableName name) {
+
+ GetTableRequest request = GetTableRequest.newBuilder().setNameWithTableName(name).build();
+ return getTable(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets metadata information about the specified table.
+ *
+ *
+ * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
+ * TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
+ * Table response = bigtableTableAdminClient.getTable(name);
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Table getTable(GetTableRequest request) {
+ return getTableCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets metadata information about the specified table.
+ *
+ *
+ * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
+ * TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
+ * GetTableRequest request = GetTableRequest.newBuilder()
+ * .setNameWithTableName(name)
+ * .build();
+ * Table response = bigtableTableAdminClient.getTable(request);
+ * }
+ *
+ */
+ public final UnaryCallable
+ * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
+ * TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
+ * GetTableRequest request = GetTableRequest.newBuilder()
+ * .setNameWithTableName(name)
+ * .build();
+ * ApiFuture<Table> future = bigtableTableAdminClient.getTableCallable().futureCall(request);
+ * // Do something
+ * Table response = future.get();
+ * }
+ *
+ *
+ * @param name The unique name of the table to be deleted. Values are of the form
+ * `projects/<project>/instances/<instance>/tables/<table>`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteTable(TableName name) {
+
+ DeleteTableRequest request = DeleteTableRequest.newBuilder().setNameWithTableName(name).build();
+ deleteTable(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Permanently deletes a specified table and all of its data.
+ *
+ *
+ * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
+ * TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
+ * bigtableTableAdminClient.deleteTable(name);
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ private final void deleteTable(DeleteTableRequest request) {
+ deleteTableCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Permanently deletes a specified table and all of its data.
+ *
+ *
+ * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
+ * TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
+ * DeleteTableRequest request = DeleteTableRequest.newBuilder()
+ * .setNameWithTableName(name)
+ * .build();
+ * bigtableTableAdminClient.deleteTable(request);
+ * }
+ *
+ */
+ public final UnaryCallable
+ * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
+ * TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
+ * DeleteTableRequest request = DeleteTableRequest.newBuilder()
+ * .setNameWithTableName(name)
+ * .build();
+ * ApiFuture<Void> future = bigtableTableAdminClient.deleteTableCallable().futureCall(request);
+ * // Do something
+ * future.get();
+ * }
+ *
+ *
+ * @param name The unique name of the table whose families should be modified. Values are of the
+ * form `projects/<project>/instances/<instance>/tables/<table>`.
+ * @param modifications Modifications to be atomically applied to the specified table's families.
+ * Entries are applied in order, meaning that earlier modifications can be masked by later
+ * ones (in the case of repeated updates to the same family, for example).
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Table modifyColumnFamilies(
+ TableName name, List
+ * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
+ * TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
+ * List<ModifyColumnFamiliesRequest.Modification> modifications = new ArrayList<>();
+ * Table response = bigtableTableAdminClient.modifyColumnFamilies(name, modifications);
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Table modifyColumnFamilies(ModifyColumnFamiliesRequest request) {
+ return modifyColumnFamiliesCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Performs a series of column family modifications on the specified table. Either all or none of
+ * the modifications will occur before this method returns, but data requests received prior to
+ * that point may see a table where only some modifications have taken effect.
+ *
+ *
+ * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
+ * TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
+ * List<ModifyColumnFamiliesRequest.Modification> modifications = new ArrayList<>();
+ * ModifyColumnFamiliesRequest request = ModifyColumnFamiliesRequest.newBuilder()
+ * .setNameWithTableName(name)
+ * .addAllModifications(modifications)
+ * .build();
+ * Table response = bigtableTableAdminClient.modifyColumnFamilies(request);
+ * }
+ *
+ */
+ public final UnaryCallable
+ * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
+ * TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
+ * List<ModifyColumnFamiliesRequest.Modification> modifications = new ArrayList<>();
+ * ModifyColumnFamiliesRequest request = ModifyColumnFamiliesRequest.newBuilder()
+ * .setNameWithTableName(name)
+ * .addAllModifications(modifications)
+ * .build();
+ * ApiFuture<Table> future = bigtableTableAdminClient.modifyColumnFamiliesCallable().futureCall(request);
+ * // Do something
+ * Table response = future.get();
+ * }
+ *
+ *
+ * @param name The unique name of the table on which to drop a range of rows. Values are of the
+ * form `projects/<project>/instances/<instance>/tables/<table>`.
+ * @param rowKeyPrefix Delete all rows that start with this row key prefix. Prefix cannot be zero
+ * length.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void dropRowRange(String name, ByteString rowKeyPrefix) {
+
+ DropRowRangeRequest request =
+ DropRowRangeRequest.newBuilder().setName(name).setRowKeyPrefix(rowKeyPrefix).build();
+ dropRowRange(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Permanently drop/delete a row range from a specified table. The request can specify whether to
+ * delete all rows in a table, or only those that match a particular prefix.
+ *
+ *
+ * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
+ * String formattedName = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString();
+ * ByteString rowKeyPrefix = ByteString.copyFromUtf8("");
+ * bigtableTableAdminClient.dropRowRange(formattedName, rowKeyPrefix);
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void dropRowRange(DropRowRangeRequest request) {
+ dropRowRangeCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Permanently drop/delete a row range from a specified table. The request can specify whether to
+ * delete all rows in a table, or only those that match a particular prefix.
+ *
+ *
+ * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
+ * String formattedName = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString();
+ * DropRowRangeRequest request = DropRowRangeRequest.newBuilder()
+ * .setName(formattedName)
+ * .build();
+ * bigtableTableAdminClient.dropRowRange(request);
+ * }
+ *
+ */
+ public final UnaryCallable
+ * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
+ * String formattedName = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString();
+ * DropRowRangeRequest request = DropRowRangeRequest.newBuilder()
+ * .setName(formattedName)
+ * .build();
+ * ApiFuture<Void> future = bigtableTableAdminClient.dropRowRangeCallable().futureCall(request);
+ * // Do something
+ * future.get();
+ * }
+ *
+ *
+ *
+ *
+ *
+ */
+@Generated("by GAPIC v0.0.5")
+@BetaApi
+public class BigtableTableAdminSettings extends ClientSettings {
+ /** The default scopes of the service. */
+ private static final ImmutableList
+ * BigtableTableAdminSettings.Builder bigtableTableAdminSettingsBuilder =
+ * BigtableTableAdminSettings.newBuilder();
+ * bigtableTableAdminSettingsBuilder.createTableSettings().getRetrySettingsBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30));
+ * BigtableTableAdminSettings bigtableTableAdminSettings = bigtableTableAdminSettingsBuilder.build();
+ *
+ * extractResources(ListTablesResponse payload) {
+ return payload.getTablesList();
+ }
+ };
+
+ private static final PagedListResponseFactory<
+ ListTablesRequest, ListTablesResponse, ListTablesPagedResponse>
+ LIST_TABLES_PAGE_STR_FACT =
+ new PagedListResponseFactory<
+ ListTablesRequest, ListTablesResponse, ListTablesPagedResponse>() {
+ @Override
+ public ApiFuture
+ *
+ *
+ * ======================== BigtableTableAdminClient ========================
+ *
+ *
+ * try (BigtableInstanceAdminClient bigtableInstanceAdminClient = BigtableInstanceAdminClient.create()) {
+ * InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]");
+ * Instance response = bigtableInstanceAdminClient.getInstance(name);
+ * }
+ *
+ *
+ *
+ */
+package com.google.cloud.bigtable.admin.v2;
diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableInstanceAdminStub.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableInstanceAdminStub.java
new file mode 100644
index 000000000000..fefdfa29388f
--- /dev/null
+++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableInstanceAdminStub.java
@@ -0,0 +1,110 @@
+/*
+ * Copyright 2017 Google Inc. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.bigtable.admin.v2.stub;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.rpc.OperationCallable;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.bigtable.admin.v2.Cluster;
+import com.google.bigtable.admin.v2.CreateClusterMetadata;
+import com.google.bigtable.admin.v2.CreateClusterRequest;
+import com.google.bigtable.admin.v2.CreateInstanceMetadata;
+import com.google.bigtable.admin.v2.CreateInstanceRequest;
+import com.google.bigtable.admin.v2.DeleteClusterRequest;
+import com.google.bigtable.admin.v2.DeleteInstanceRequest;
+import com.google.bigtable.admin.v2.GetClusterRequest;
+import com.google.bigtable.admin.v2.GetInstanceRequest;
+import com.google.bigtable.admin.v2.Instance;
+import com.google.bigtable.admin.v2.ListClustersRequest;
+import com.google.bigtable.admin.v2.ListClustersResponse;
+import com.google.bigtable.admin.v2.ListInstancesRequest;
+import com.google.bigtable.admin.v2.ListInstancesResponse;
+import com.google.bigtable.admin.v2.UpdateClusterMetadata;
+import com.google.longrunning.Operation;
+import com.google.longrunning.stub.OperationsStub;
+import com.google.protobuf.Empty;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS
+/**
+ * Base stub class for Cloud Bigtable Admin API.
+ *
+ *
+ * try (BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.create()) {
+ * InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]");
+ * String tableId = "";
+ * Table table = Table.newBuilder().build();
+ * Table response = bigtableTableAdminClient.createTable(parent, tableId, table);
+ * }
+ *
+ *