diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPolicyServiceClient.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPolicyServiceClient.java index 198afa73..42681501 100644 --- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPolicyServiceClient.java +++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/AutoscalingPolicyServiceClient.java @@ -44,8 +44,9 @@ *
*
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
+ * RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
* AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
- * AutoscalingPolicy response = autoscalingPolicyServiceClient.updateAutoscalingPolicy(policy);
+ * AutoscalingPolicy response = autoscalingPolicyServiceClient.createAutoscalingPolicy(parent, policy);
* }
*
*
@@ -157,80 +158,6 @@ public AutoscalingPolicyServiceStub getStub() {
return stub;
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Updates (replaces) autoscaling policy.
- *
- * Disabled check for update_mask, because all updates will be full replacements. - * - *
Sample code: - * - *
- * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
- * AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
- * AutoscalingPolicy response = autoscalingPolicyServiceClient.updateAutoscalingPolicy(policy);
- * }
- *
- *
- * @param policy Required. The updated autoscaling policy.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final AutoscalingPolicy updateAutoscalingPolicy(AutoscalingPolicy policy) {
- UpdateAutoscalingPolicyRequest request =
- UpdateAutoscalingPolicyRequest.newBuilder().setPolicy(policy).build();
- return updateAutoscalingPolicy(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Updates (replaces) autoscaling policy.
- *
- * Disabled check for update_mask, because all updates will be full replacements. - * - *
Sample code: - * - *
- * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
- * AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
- * UpdateAutoscalingPolicyRequest request = UpdateAutoscalingPolicyRequest.newBuilder()
- * .setPolicy(policy)
- * .build();
- * AutoscalingPolicy response = autoscalingPolicyServiceClient.updateAutoscalingPolicy(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 AutoscalingPolicy updateAutoscalingPolicy(UpdateAutoscalingPolicyRequest request) {
- return updateAutoscalingPolicyCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Updates (replaces) autoscaling policy.
- *
- * Disabled check for update_mask, because all updates will be full replacements. - * - *
Sample code: - * - *
- * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
- * AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
- * UpdateAutoscalingPolicyRequest request = UpdateAutoscalingPolicyRequest.newBuilder()
- * .setPolicy(policy)
- * .build();
- * ApiFuture<AutoscalingPolicy> future = autoscalingPolicyServiceClient.updateAutoscalingPolicyCallable().futureCall(request);
- * // Do something
- * AutoscalingPolicy response = future.get();
- * }
- *
- */
- public final UnaryCallableDisabled check for update_mask, because all updates will be full replacements. + * + *
Sample code: + * + *
+ * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
+ * AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
+ * AutoscalingPolicy response = autoscalingPolicyServiceClient.updateAutoscalingPolicy(policy);
+ * }
+ *
+ *
+ * @param policy Required. The updated autoscaling policy.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final AutoscalingPolicy updateAutoscalingPolicy(AutoscalingPolicy policy) {
+ UpdateAutoscalingPolicyRequest request =
+ UpdateAutoscalingPolicyRequest.newBuilder().setPolicy(policy).build();
+ return updateAutoscalingPolicy(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Updates (replaces) autoscaling policy.
+ *
+ * Disabled check for update_mask, because all updates will be full replacements. + * + *
Sample code: + * + *
+ * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
+ * AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
+ * UpdateAutoscalingPolicyRequest request = UpdateAutoscalingPolicyRequest.newBuilder()
+ * .setPolicy(policy)
+ * .build();
+ * AutoscalingPolicy response = autoscalingPolicyServiceClient.updateAutoscalingPolicy(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 AutoscalingPolicy updateAutoscalingPolicy(UpdateAutoscalingPolicyRequest request) {
+ return updateAutoscalingPolicyCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Updates (replaces) autoscaling policy.
+ *
+ * Disabled check for update_mask, because all updates will be full replacements. + * + *
Sample code: + * + *
+ * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
+ * AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
+ * UpdateAutoscalingPolicyRequest request = UpdateAutoscalingPolicyRequest.newBuilder()
+ * .setPolicy(policy)
+ * .build();
+ * ApiFuture<AutoscalingPolicy> future = autoscalingPolicyServiceClient.updateAutoscalingPolicyCallable().futureCall(request);
+ * // Do something
+ * AutoscalingPolicy response = future.get();
+ * }
+ *
+ */
+ public final UnaryCallableThe 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 updateAutoscalingPolicy to 30 seconds: + *
For example, to set the total timeout of createAutoscalingPolicy to 30 seconds: * *
*
* AutoscalingPolicyServiceSettings.Builder autoscalingPolicyServiceSettingsBuilder =
* AutoscalingPolicyServiceSettings.newBuilder();
* autoscalingPolicyServiceSettingsBuilder
- * .updateAutoscalingPolicySettings()
+ * .createAutoscalingPolicySettings()
* .setRetrySettings(
- * autoscalingPolicyServiceSettingsBuilder.updateAutoscalingPolicySettings().getRetrySettings().toBuilder()
+ * autoscalingPolicyServiceSettingsBuilder.createAutoscalingPolicySettings().getRetrySettings().toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* AutoscalingPolicyServiceSettings autoscalingPolicyServiceSettings = autoscalingPolicyServiceSettingsBuilder.build();
@@ -69,13 +69,6 @@
@BetaApi
public class AutoscalingPolicyServiceSettings
extends ClientSettings {
- /** Returns the object with the settings used for calls to updateAutoscalingPolicy. */
- public UnaryCallSettings
- updateAutoscalingPolicySettings() {
- return ((AutoscalingPolicyServiceStubSettings) getStubSettings())
- .updateAutoscalingPolicySettings();
- }
-
/** Returns the object with the settings used for calls to createAutoscalingPolicy. */
public UnaryCallSettings
createAutoscalingPolicySettings() {
@@ -83,6 +76,13 @@ public class AutoscalingPolicyServiceSettings
.createAutoscalingPolicySettings();
}
+ /** Returns the object with the settings used for calls to updateAutoscalingPolicy. */
+ public UnaryCallSettings
+ updateAutoscalingPolicySettings() {
+ return ((AutoscalingPolicyServiceStubSettings) getStubSettings())
+ .updateAutoscalingPolicySettings();
+ }
+
/** Returns the object with the settings used for calls to getAutoscalingPolicy. */
public UnaryCallSettings
getAutoscalingPolicySettings() {
@@ -205,18 +205,18 @@ public Builder applyToAllUnaryMethods(
return this;
}
- /** Returns the builder for the settings used for calls to updateAutoscalingPolicy. */
- public UnaryCallSettings.Builder
- updateAutoscalingPolicySettings() {
- return getStubSettingsBuilder().updateAutoscalingPolicySettings();
- }
-
/** Returns the builder for the settings used for calls to createAutoscalingPolicy. */
public UnaryCallSettings.Builder
createAutoscalingPolicySettings() {
return getStubSettingsBuilder().createAutoscalingPolicySettings();
}
+ /** Returns the builder for the settings used for calls to updateAutoscalingPolicy. */
+ public UnaryCallSettings.Builder
+ updateAutoscalingPolicySettings() {
+ return getStubSettingsBuilder().updateAutoscalingPolicySettings();
+ }
+
/** Returns the builder for the settings used for calls to getAutoscalingPolicy. */
public UnaryCallSettings.Builder
getAutoscalingPolicySettings() {
diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/ClusterControllerClient.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/ClusterControllerClient.java
index bc3c3a40..9731463b 100644
--- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/ClusterControllerClient.java
+++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/ClusterControllerClient.java
@@ -591,6 +591,144 @@ public final UnaryCallable deleteClusterCallabl
return stub.deleteClusterCallable();
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets cluster diagnostic information. The returned
+ * [Operation.metadata][google.longrunning.Operation.metadata] will be
+ * [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata).
+ * After the operation completes, [Operation.response][google.longrunning.Operation.response]
+ * contains
+ * [DiagnoseClusterResults](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#diagnoseclusterresults).
+ *
+ * Sample code:
+ *
+ *
+ * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
+ * String projectId = "";
+ * String region = "";
+ * String clusterName = "";
+ * clusterControllerClient.diagnoseClusterAsync(projectId, region, clusterName).get();
+ * }
+ *
+ *
+ * @param projectId Required. The ID of the Google Cloud Platform project that the cluster belongs
+ * to.
+ * @param region Required. The Dataproc region in which to handle the request.
+ * @param clusterName Required. The cluster name.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture diagnoseClusterAsync(
+ String projectId, String region, String clusterName) {
+ DiagnoseClusterRequest request =
+ DiagnoseClusterRequest.newBuilder()
+ .setProjectId(projectId)
+ .setRegion(region)
+ .setClusterName(clusterName)
+ .build();
+ return diagnoseClusterAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets cluster diagnostic information. The returned
+ * [Operation.metadata][google.longrunning.Operation.metadata] will be
+ * [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata).
+ * After the operation completes, [Operation.response][google.longrunning.Operation.response]
+ * contains
+ * [DiagnoseClusterResults](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#diagnoseclusterresults).
+ *
+ * Sample code:
+ *
+ *
+ * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
+ * String projectId = "";
+ * String region = "";
+ * String clusterName = "";
+ * DiagnoseClusterRequest request = DiagnoseClusterRequest.newBuilder()
+ * .setProjectId(projectId)
+ * .setRegion(region)
+ * .setClusterName(clusterName)
+ * .build();
+ * clusterControllerClient.diagnoseClusterAsync(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
+ */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture diagnoseClusterAsync(
+ DiagnoseClusterRequest request) {
+ return diagnoseClusterOperationCallable().futureCall(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets cluster diagnostic information. The returned
+ * [Operation.metadata][google.longrunning.Operation.metadata] will be
+ * [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata).
+ * After the operation completes, [Operation.response][google.longrunning.Operation.response]
+ * contains
+ * [DiagnoseClusterResults](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#diagnoseclusterresults).
+ *
+ * Sample code:
+ *
+ *
+ * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
+ * String projectId = "";
+ * String region = "";
+ * String clusterName = "";
+ * DiagnoseClusterRequest request = DiagnoseClusterRequest.newBuilder()
+ * .setProjectId(projectId)
+ * .setRegion(region)
+ * .setClusterName(clusterName)
+ * .build();
+ * OperationFuture<Empty, DiagnoseClusterResults> future = clusterControllerClient.diagnoseClusterOperationCallable().futureCall(request);
+ * // Do something
+ * future.get();
+ * }
+ *
+ */
+ @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
+ public final OperationCallable
+ diagnoseClusterOperationCallable() {
+ return stub.diagnoseClusterOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets cluster diagnostic information. The returned
+ * [Operation.metadata][google.longrunning.Operation.metadata] will be
+ * [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata).
+ * After the operation completes, [Operation.response][google.longrunning.Operation.response]
+ * contains
+ * [DiagnoseClusterResults](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#diagnoseclusterresults).
+ *
+ * Sample code:
+ *
+ *
+ * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
+ * String projectId = "";
+ * String region = "";
+ * String clusterName = "";
+ * DiagnoseClusterRequest request = DiagnoseClusterRequest.newBuilder()
+ * .setProjectId(projectId)
+ * .setRegion(region)
+ * .setClusterName(clusterName)
+ * .build();
+ * ApiFuture<Operation> future = clusterControllerClient.diagnoseClusterCallable().futureCall(request);
+ * // Do something
+ * future.get();
+ * }
+ *
+ */
+ public final UnaryCallable diagnoseClusterCallable() {
+ return stub.diagnoseClusterCallable();
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Gets the resource representation for a cluster in a project.
@@ -836,144 +974,6 @@ public final UnaryCallable listCluste
return stub.listClustersCallable();
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Gets cluster diagnostic information. The returned
- * [Operation.metadata][google.longrunning.Operation.metadata] will be
- * [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata).
- * After the operation completes, [Operation.response][google.longrunning.Operation.response]
- * contains
- * [DiagnoseClusterResults](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#diagnoseclusterresults).
- *
- * Sample code:
- *
- *
- * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * String clusterName = "";
- * clusterControllerClient.diagnoseClusterAsync(projectId, region, clusterName).get();
- * }
- *
- *
- * @param projectId Required. The ID of the Google Cloud Platform project that the cluster belongs
- * to.
- * @param region Required. The Dataproc region in which to handle the request.
- * @param clusterName Required. The cluster name.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture diagnoseClusterAsync(
- String projectId, String region, String clusterName) {
- DiagnoseClusterRequest request =
- DiagnoseClusterRequest.newBuilder()
- .setProjectId(projectId)
- .setRegion(region)
- .setClusterName(clusterName)
- .build();
- return diagnoseClusterAsync(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Gets cluster diagnostic information. The returned
- * [Operation.metadata][google.longrunning.Operation.metadata] will be
- * [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata).
- * After the operation completes, [Operation.response][google.longrunning.Operation.response]
- * contains
- * [DiagnoseClusterResults](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#diagnoseclusterresults).
- *
- * Sample code:
- *
- *
- * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * String clusterName = "";
- * DiagnoseClusterRequest request = DiagnoseClusterRequest.newBuilder()
- * .setProjectId(projectId)
- * .setRegion(region)
- * .setClusterName(clusterName)
- * .build();
- * clusterControllerClient.diagnoseClusterAsync(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
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture diagnoseClusterAsync(
- DiagnoseClusterRequest request) {
- return diagnoseClusterOperationCallable().futureCall(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Gets cluster diagnostic information. The returned
- * [Operation.metadata][google.longrunning.Operation.metadata] will be
- * [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata).
- * After the operation completes, [Operation.response][google.longrunning.Operation.response]
- * contains
- * [DiagnoseClusterResults](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#diagnoseclusterresults).
- *
- * Sample code:
- *
- *
- * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * String clusterName = "";
- * DiagnoseClusterRequest request = DiagnoseClusterRequest.newBuilder()
- * .setProjectId(projectId)
- * .setRegion(region)
- * .setClusterName(clusterName)
- * .build();
- * OperationFuture<Empty, DiagnoseClusterResults> future = clusterControllerClient.diagnoseClusterOperationCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
- */
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
- public final OperationCallable
- diagnoseClusterOperationCallable() {
- return stub.diagnoseClusterOperationCallable();
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Gets cluster diagnostic information. The returned
- * [Operation.metadata][google.longrunning.Operation.metadata] will be
- * [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata).
- * After the operation completes, [Operation.response][google.longrunning.Operation.response]
- * contains
- * [DiagnoseClusterResults](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#diagnoseclusterresults).
- *
- * Sample code:
- *
- *
- * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * String clusterName = "";
- * DiagnoseClusterRequest request = DiagnoseClusterRequest.newBuilder()
- * .setProjectId(projectId)
- * .setRegion(region)
- * .setClusterName(clusterName)
- * .build();
- * ApiFuture<Operation> future = clusterControllerClient.diagnoseClusterCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
- */
- public final UnaryCallable diagnoseClusterCallable() {
- return stub.diagnoseClusterCallable();
- }
-
@Override
public final void close() {
stub.close();
diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/ClusterControllerSettings.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/ClusterControllerSettings.java
index 8fb9b070..497b0bb7 100644
--- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/ClusterControllerSettings.java
+++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/ClusterControllerSettings.java
@@ -109,17 +109,6 @@ public UnaryCallSettings deleteClusterSettings(
return ((ClusterControllerStubSettings) getStubSettings()).deleteClusterOperationSettings();
}
- /** Returns the object with the settings used for calls to getCluster. */
- public UnaryCallSettings getClusterSettings() {
- return ((ClusterControllerStubSettings) getStubSettings()).getClusterSettings();
- }
-
- /** Returns the object with the settings used for calls to listClusters. */
- public PagedCallSettings
- listClustersSettings() {
- return ((ClusterControllerStubSettings) getStubSettings()).listClustersSettings();
- }
-
/** Returns the object with the settings used for calls to diagnoseCluster. */
public UnaryCallSettings diagnoseClusterSettings() {
return ((ClusterControllerStubSettings) getStubSettings()).diagnoseClusterSettings();
@@ -133,6 +122,17 @@ public UnaryCallSettings diagnoseClusterSetti
return ((ClusterControllerStubSettings) getStubSettings()).diagnoseClusterOperationSettings();
}
+ /** Returns the object with the settings used for calls to getCluster. */
+ public UnaryCallSettings getClusterSettings() {
+ return ((ClusterControllerStubSettings) getStubSettings()).getClusterSettings();
+ }
+
+ /** Returns the object with the settings used for calls to listClusters. */
+ public PagedCallSettings
+ listClustersSettings() {
+ return ((ClusterControllerStubSettings) getStubSettings()).listClustersSettings();
+ }
+
public static final ClusterControllerSettings create(ClusterControllerStubSettings stub)
throws IOException {
return new ClusterControllerSettings.Builder(stub.toBuilder()).build();
@@ -269,18 +269,6 @@ public UnaryCallSettings.Builder deleteClusterS
return getStubSettingsBuilder().deleteClusterOperationSettings();
}
- /** Returns the builder for the settings used for calls to getCluster. */
- public UnaryCallSettings.Builder getClusterSettings() {
- return getStubSettingsBuilder().getClusterSettings();
- }
-
- /** Returns the builder for the settings used for calls to listClusters. */
- public PagedCallSettings.Builder<
- ListClustersRequest, ListClustersResponse, ListClustersPagedResponse>
- listClustersSettings() {
- return getStubSettingsBuilder().listClustersSettings();
- }
-
/** Returns the builder for the settings used for calls to diagnoseCluster. */
public UnaryCallSettings.Builder diagnoseClusterSettings() {
return getStubSettingsBuilder().diagnoseClusterSettings();
@@ -294,6 +282,18 @@ public UnaryCallSettings.Builder diagnoseClus
return getStubSettingsBuilder().diagnoseClusterOperationSettings();
}
+ /** Returns the builder for the settings used for calls to getCluster. */
+ public UnaryCallSettings.Builder getClusterSettings() {
+ return getStubSettingsBuilder().getClusterSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to listClusters. */
+ public PagedCallSettings.Builder<
+ ListClustersRequest, ListClustersResponse, ListClustersPagedResponse>
+ listClustersSettings() {
+ return getStubSettingsBuilder().listClustersSettings();
+ }
+
@Override
public ClusterControllerSettings build() throws IOException {
return new ClusterControllerSettings(this);
diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/JobControllerClient.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/JobControllerClient.java
index 7b7c5377..51856e4c 100644
--- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/JobControllerClient.java
+++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/JobControllerClient.java
@@ -252,6 +252,119 @@ public final UnaryCallable submitJobCallable() {
return stub.submitJobCallable();
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Submits job to a cluster.
+ *
+ * Sample code:
+ *
+ *
+ * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
+ * String projectId = "";
+ * String region = "";
+ * Job job = Job.newBuilder().build();
+ * Job response = jobControllerClient.submitJobAsOperationAsync(projectId, region, job).get();
+ * }
+ *
+ *
+ * @param projectId Required. The ID of the Google Cloud Platform project that the job belongs to.
+ * @param region Required. The Dataproc region in which to handle the request.
+ * @param job Required. The job resource.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture submitJobAsOperationAsync(
+ String projectId, String region, Job job) {
+ SubmitJobRequest request =
+ SubmitJobRequest.newBuilder().setProjectId(projectId).setRegion(region).setJob(job).build();
+ return submitJobAsOperationAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Submits job to a cluster.
+ *
+ * Sample code:
+ *
+ *
+ * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
+ * String projectId = "";
+ * String region = "";
+ * Job job = Job.newBuilder().build();
+ * SubmitJobRequest request = SubmitJobRequest.newBuilder()
+ * .setProjectId(projectId)
+ * .setRegion(region)
+ * .setJob(job)
+ * .build();
+ * Job response = jobControllerClient.submitJobAsOperationAsync(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
+ */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture submitJobAsOperationAsync(
+ SubmitJobRequest request) {
+ return submitJobAsOperationOperationCallable().futureCall(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Submits job to a cluster.
+ *
+ * Sample code:
+ *
+ *
+ * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
+ * String projectId = "";
+ * String region = "";
+ * Job job = Job.newBuilder().build();
+ * SubmitJobRequest request = SubmitJobRequest.newBuilder()
+ * .setProjectId(projectId)
+ * .setRegion(region)
+ * .setJob(job)
+ * .build();
+ * OperationFuture<Job, JobMetadata> future = jobControllerClient.submitJobAsOperationOperationCallable().futureCall(request);
+ * // Do something
+ * Job response = future.get();
+ * }
+ *
+ */
+ @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
+ public final OperationCallable
+ submitJobAsOperationOperationCallable() {
+ return stub.submitJobAsOperationOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Submits job to a cluster.
+ *
+ * Sample code:
+ *
+ *
+ * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
+ * String projectId = "";
+ * String region = "";
+ * Job job = Job.newBuilder().build();
+ * SubmitJobRequest request = SubmitJobRequest.newBuilder()
+ * .setProjectId(projectId)
+ * .setRegion(region)
+ * .setJob(job)
+ * .build();
+ * ApiFuture<Operation> future = jobControllerClient.submitJobAsOperationCallable().futureCall(request);
+ * // Do something
+ * Operation response = future.get();
+ * }
+ *
+ */
+ public final UnaryCallable submitJobAsOperationCallable() {
+ return stub.submitJobAsOperationCallable();
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Gets the resource representation for a job in a project.
@@ -726,119 +839,6 @@ public final UnaryCallable deleteJobCallable() {
return stub.deleteJobCallable();
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Submits job to a cluster.
- *
- * Sample code:
- *
- *
- * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * Job job = Job.newBuilder().build();
- * Job response = jobControllerClient.submitJobAsOperationAsync(projectId, region, job).get();
- * }
- *
- *
- * @param projectId Required. The ID of the Google Cloud Platform project that the job belongs to.
- * @param region Required. The Dataproc region in which to handle the request.
- * @param job Required. The job resource.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture submitJobAsOperationAsync(
- String projectId, String region, Job job) {
- SubmitJobRequest request =
- SubmitJobRequest.newBuilder().setProjectId(projectId).setRegion(region).setJob(job).build();
- return submitJobAsOperationAsync(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Submits job to a cluster.
- *
- * Sample code:
- *
- *
- * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * Job job = Job.newBuilder().build();
- * SubmitJobRequest request = SubmitJobRequest.newBuilder()
- * .setProjectId(projectId)
- * .setRegion(region)
- * .setJob(job)
- * .build();
- * Job response = jobControllerClient.submitJobAsOperationAsync(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
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture submitJobAsOperationAsync(
- SubmitJobRequest request) {
- return submitJobAsOperationOperationCallable().futureCall(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Submits job to a cluster.
- *
- * Sample code:
- *
- *
- * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * Job job = Job.newBuilder().build();
- * SubmitJobRequest request = SubmitJobRequest.newBuilder()
- * .setProjectId(projectId)
- * .setRegion(region)
- * .setJob(job)
- * .build();
- * OperationFuture<Job, JobMetadata> future = jobControllerClient.submitJobAsOperationOperationCallable().futureCall(request);
- * // Do something
- * Job response = future.get();
- * }
- *
- */
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
- public final OperationCallable
- submitJobAsOperationOperationCallable() {
- return stub.submitJobAsOperationOperationCallable();
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Submits job to a cluster.
- *
- * Sample code:
- *
- *
- * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * Job job = Job.newBuilder().build();
- * SubmitJobRequest request = SubmitJobRequest.newBuilder()
- * .setProjectId(projectId)
- * .setRegion(region)
- * .setJob(job)
- * .build();
- * ApiFuture<Operation> future = jobControllerClient.submitJobAsOperationCallable().futureCall(request);
- * // Do something
- * Operation response = future.get();
- * }
- *
- */
- public final UnaryCallable submitJobAsOperationCallable() {
- return stub.submitJobAsOperationCallable();
- }
-
@Override
public final void close() {
stub.close();
diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/JobControllerSettings.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/JobControllerSettings.java
index c4b3fe2b..7f3f2964 100644
--- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/JobControllerSettings.java
+++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/JobControllerSettings.java
@@ -75,6 +75,19 @@ public UnaryCallSettings submitJobSettings() {
return ((JobControllerStubSettings) getStubSettings()).submitJobSettings();
}
+ /** Returns the object with the settings used for calls to submitJobAsOperation. */
+ public UnaryCallSettings submitJobAsOperationSettings() {
+ return ((JobControllerStubSettings) getStubSettings()).submitJobAsOperationSettings();
+ }
+
+ /** Returns the object with the settings used for calls to submitJobAsOperation. */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public OperationCallSettings
+ submitJobAsOperationOperationSettings() {
+ return ((JobControllerStubSettings) getStubSettings()).submitJobAsOperationOperationSettings();
+ }
+
/** Returns the object with the settings used for calls to getJob. */
public UnaryCallSettings getJobSettings() {
return ((JobControllerStubSettings) getStubSettings()).getJobSettings();
@@ -101,19 +114,6 @@ public UnaryCallSettings deleteJobSettings() {
return ((JobControllerStubSettings) getStubSettings()).deleteJobSettings();
}
- /** Returns the object with the settings used for calls to submitJobAsOperation. */
- public UnaryCallSettings submitJobAsOperationSettings() {
- return ((JobControllerStubSettings) getStubSettings()).submitJobAsOperationSettings();
- }
-
- /** Returns the object with the settings used for calls to submitJobAsOperation. */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public OperationCallSettings
- submitJobAsOperationOperationSettings() {
- return ((JobControllerStubSettings) getStubSettings()).submitJobAsOperationOperationSettings();
- }
-
public static final JobControllerSettings create(JobControllerStubSettings stub)
throws IOException {
return new JobControllerSettings.Builder(stub.toBuilder()).build();
@@ -216,6 +216,19 @@ public UnaryCallSettings.Builder submitJobSettings() {
return getStubSettingsBuilder().submitJobSettings();
}
+ /** Returns the builder for the settings used for calls to submitJobAsOperation. */
+ public UnaryCallSettings.Builder submitJobAsOperationSettings() {
+ return getStubSettingsBuilder().submitJobAsOperationSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to submitJobAsOperation. */
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public OperationCallSettings.Builder
+ submitJobAsOperationOperationSettings() {
+ return getStubSettingsBuilder().submitJobAsOperationOperationSettings();
+ }
+
/** Returns the builder for the settings used for calls to getJob. */
public UnaryCallSettings.Builder getJobSettings() {
return getStubSettingsBuilder().getJobSettings();
@@ -242,19 +255,6 @@ public UnaryCallSettings.Builder deleteJobSettings() {
return getStubSettingsBuilder().deleteJobSettings();
}
- /** Returns the builder for the settings used for calls to submitJobAsOperation. */
- public UnaryCallSettings.Builder submitJobAsOperationSettings() {
- return getStubSettingsBuilder().submitJobAsOperationSettings();
- }
-
- /** Returns the builder for the settings used for calls to submitJobAsOperation. */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public OperationCallSettings.Builder
- submitJobAsOperationOperationSettings() {
- return getStubSettingsBuilder().submitJobAsOperationOperationSettings();
- }
-
@Override
public JobControllerSettings build() throws IOException {
return new JobControllerSettings(this);
diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/WorkflowTemplateServiceClient.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/WorkflowTemplateServiceClient.java
index ec3d964c..87932168 100644
--- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/WorkflowTemplateServiceClient.java
+++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/WorkflowTemplateServiceClient.java
@@ -177,261 +177,250 @@ public final OperationsClient getOperationsClient() {
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Creates new workflow template.
+ * Instantiates a template and begins execution.
*
- * Sample code:
+ *
The returned Operation can be used to track execution of workflow by polling
+ * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when
+ * entire workflow is finished.
*
- *
- * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
- * WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
- * WorkflowTemplate response = workflowTemplateServiceClient.createWorkflowTemplate(parent, template);
- * }
- *
+ * The running workflow can be aborted via
+ * [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any
+ * inflight jobs to be cancelled and workflow-owned clusters to be deleted.
*
- * @param parent Required. The resource name of the region or location, as described in
- * https://cloud.google.com/apis/design/resource_names.
- *
* For `projects.regions.workflowTemplates,create`, the resource name of the region
- * has the following format: `projects/{project_id}/regions/{region}`
- *
* For `projects.locations.workflowTemplates.create`, the resource name of the
- * location has the following format: `projects/{project_id}/locations/{location}`
- * @param template Required. The Dataproc workflow template to create.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final WorkflowTemplate createWorkflowTemplate(
- RegionName parent, WorkflowTemplate template) {
- CreateWorkflowTemplateRequest request =
- CreateWorkflowTemplateRequest.newBuilder()
- .setParent(parent == null ? null : parent.toString())
- .setTemplate(template)
- .build();
- return createWorkflowTemplate(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Creates new workflow template.
+ *
The [Operation.metadata][google.longrunning.Operation.metadata] will be
+ * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata).
+ * Also see [Using
+ * WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).
+ *
+ *
On successful completion, [Operation.response][google.longrunning.Operation.response] will
+ * be [Empty][google.protobuf.Empty].
*
*
Sample code:
*
*
* try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- * WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
- * WorkflowTemplate response = workflowTemplateServiceClient.createWorkflowTemplate(parent, template);
+ * WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ * workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name).get();
* }
*
*
- * @param parent Required. The resource name of the region or location, as described in
+ * @param name Required. The resource name of the workflow template, as described in
* https://cloud.google.com/apis/design/resource_names.
- * * For `projects.regions.workflowTemplates,create`, the resource name of the region
- * has the following format: `projects/{project_id}/regions/{region}`
- *
* For `projects.locations.workflowTemplates.create`, the resource name of the
- * location has the following format: `projects/{project_id}/locations/{location}`
- * @param template Required. The Dataproc workflow template to create.
+ *
* For `projects.regions.workflowTemplates.instantiate`, the resource name of the
+ * template has the following format:
+ * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}`
+ *
* For `projects.locations.workflowTemplates.instantiate`, the resource name of the
+ * template has the following format:
+ * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final WorkflowTemplate createWorkflowTemplate(
- LocationName parent, WorkflowTemplate template) {
- CreateWorkflowTemplateRequest request =
- CreateWorkflowTemplateRequest.newBuilder()
- .setParent(parent == null ? null : parent.toString())
- .setTemplate(template)
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture instantiateWorkflowTemplateAsync(
+ WorkflowTemplateName name) {
+ InstantiateWorkflowTemplateRequest request =
+ InstantiateWorkflowTemplateRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
.build();
- return createWorkflowTemplate(request);
+ return instantiateWorkflowTemplateAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Creates new workflow template.
+ * Instantiates a template and begins execution.
*
- * Sample code:
+ *
The returned Operation can be used to track execution of workflow by polling
+ * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when
+ * entire workflow is finished.
*
- *
- * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
- * WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
- * WorkflowTemplate response = workflowTemplateServiceClient.createWorkflowTemplate(parent.toString(), template);
- * }
- *
+ * The running workflow can be aborted via
+ * [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any
+ * inflight jobs to be cancelled and workflow-owned clusters to be deleted.
*
- * @param parent Required. The resource name of the region or location, as described in
- * https://cloud.google.com/apis/design/resource_names.
- *
* For `projects.regions.workflowTemplates,create`, the resource name of the region
- * has the following format: `projects/{project_id}/regions/{region}`
- *
* For `projects.locations.workflowTemplates.create`, the resource name of the
- * location has the following format: `projects/{project_id}/locations/{location}`
- * @param template Required. The Dataproc workflow template to create.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final WorkflowTemplate createWorkflowTemplate(String parent, WorkflowTemplate template) {
- CreateWorkflowTemplateRequest request =
- CreateWorkflowTemplateRequest.newBuilder().setParent(parent).setTemplate(template).build();
- return createWorkflowTemplate(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Creates new workflow template.
+ *
The [Operation.metadata][google.longrunning.Operation.metadata] will be
+ * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata).
+ * Also see [Using
+ * WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).
+ *
+ *
On successful completion, [Operation.response][google.longrunning.Operation.response] will
+ * be [Empty][google.protobuf.Empty].
*
*
Sample code:
*
*
* try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
- * WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
- * CreateWorkflowTemplateRequest request = CreateWorkflowTemplateRequest.newBuilder()
- * .setParent(parent.toString())
- * .setTemplate(template)
- * .build();
- * WorkflowTemplate response = workflowTemplateServiceClient.createWorkflowTemplate(request);
+ * WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ * workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name.toString()).get();
* }
*
*
- * @param request The request object containing all of the parameters for the API call.
+ * @param name Required. The resource name of the workflow template, as described in
+ * https://cloud.google.com/apis/design/resource_names.
+ * * For `projects.regions.workflowTemplates.instantiate`, the resource name of the
+ * template has the following format:
+ * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}`
+ *
* For `projects.locations.workflowTemplates.instantiate`, the resource name of the
+ * template has the following format:
+ * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final WorkflowTemplate createWorkflowTemplate(CreateWorkflowTemplateRequest request) {
- return createWorkflowTemplateCallable().call(request);
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture instantiateWorkflowTemplateAsync(
+ String name) {
+ InstantiateWorkflowTemplateRequest request =
+ InstantiateWorkflowTemplateRequest.newBuilder().setName(name).build();
+ return instantiateWorkflowTemplateAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Creates new workflow template.
+ * Instantiates a template and begins execution.
*
- * Sample code:
+ *
The returned Operation can be used to track execution of workflow by polling
+ * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when
+ * entire workflow is finished.
*
- *
- * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
- * WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
- * CreateWorkflowTemplateRequest request = CreateWorkflowTemplateRequest.newBuilder()
- * .setParent(parent.toString())
- * .setTemplate(template)
- * .build();
- * ApiFuture<WorkflowTemplate> future = workflowTemplateServiceClient.createWorkflowTemplateCallable().futureCall(request);
- * // Do something
- * WorkflowTemplate response = future.get();
- * }
- *
- */
- public final UnaryCallable
- createWorkflowTemplateCallable() {
- return stub.createWorkflowTemplateCallable();
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Retrieves the latest workflow template.
+ * The running workflow can be aborted via
+ * [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any
+ * inflight jobs to be cancelled and workflow-owned clusters to be deleted.
*
- *
Can retrieve previously instantiated template by specifying optional version parameter.
+ *
The [Operation.metadata][google.longrunning.Operation.metadata] will be
+ * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata).
+ * Also see [Using
+ * WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).
+ *
+ *
On successful completion, [Operation.response][google.longrunning.Operation.response] will
+ * be [Empty][google.protobuf.Empty].
*
*
Sample code:
*
*
* try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
* WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
- * WorkflowTemplate response = workflowTemplateServiceClient.getWorkflowTemplate(name);
+ * Map<String, String> parameters = new HashMap<>();
+ * workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name, parameters).get();
* }
*
*
* @param name Required. The resource name of the workflow template, as described in
* https://cloud.google.com/apis/design/resource_names.
- * * For `projects.regions.workflowTemplates.get`, the resource name of the template
- * has the following format:
+ *
* For `projects.regions.workflowTemplates.instantiate`, the resource name of the
+ * template has the following format:
* `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}`
- *
* For `projects.locations.workflowTemplates.get`, the resource name of the template
- * has the following format:
+ *
* For `projects.locations.workflowTemplates.instantiate`, the resource name of the
+ * template has the following format:
* `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}`
+ * @param parameters Optional. Map from parameter names to values that should be used for those
+ * parameters. Values may not exceed 100 characters.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final WorkflowTemplate getWorkflowTemplate(WorkflowTemplateName name) {
- GetWorkflowTemplateRequest request =
- GetWorkflowTemplateRequest.newBuilder()
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture instantiateWorkflowTemplateAsync(
+ WorkflowTemplateName name, Map parameters) {
+ InstantiateWorkflowTemplateRequest request =
+ InstantiateWorkflowTemplateRequest.newBuilder()
.setName(name == null ? null : name.toString())
+ .putAllParameters(parameters)
.build();
- return getWorkflowTemplate(request);
+ return instantiateWorkflowTemplateAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Retrieves the latest workflow template.
+ * Instantiates a template and begins execution.
*
- * Can retrieve previously instantiated template by specifying optional version parameter.
+ *
The returned Operation can be used to track execution of workflow by polling
+ * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when
+ * entire workflow is finished.
+ *
+ *
The running workflow can be aborted via
+ * [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any
+ * inflight jobs to be cancelled and workflow-owned clusters to be deleted.
+ *
+ *
The [Operation.metadata][google.longrunning.Operation.metadata] will be
+ * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata).
+ * Also see [Using
+ * WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).
+ *
+ *
On successful completion, [Operation.response][google.longrunning.Operation.response] will
+ * be [Empty][google.protobuf.Empty].
*
*
Sample code:
*
*
* try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
* WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
- * WorkflowTemplate response = workflowTemplateServiceClient.getWorkflowTemplate(name.toString());
+ * Map<String, String> parameters = new HashMap<>();
+ * workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name.toString(), parameters).get();
* }
*
*
* @param name Required. The resource name of the workflow template, as described in
* https://cloud.google.com/apis/design/resource_names.
- * * For `projects.regions.workflowTemplates.get`, the resource name of the template
- * has the following format:
+ *
* For `projects.regions.workflowTemplates.instantiate`, the resource name of the
+ * template has the following format:
* `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}`
- *
* For `projects.locations.workflowTemplates.get`, the resource name of the template
- * has the following format:
+ *
* For `projects.locations.workflowTemplates.instantiate`, the resource name of the
+ * template has the following format:
* `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}`
+ * @param parameters Optional. Map from parameter names to values that should be used for those
+ * parameters. Values may not exceed 100 characters.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final WorkflowTemplate getWorkflowTemplate(String name) {
- GetWorkflowTemplateRequest request =
- GetWorkflowTemplateRequest.newBuilder().setName(name).build();
- return getWorkflowTemplate(request);
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture instantiateWorkflowTemplateAsync(
+ String name, Map parameters) {
+ InstantiateWorkflowTemplateRequest request =
+ InstantiateWorkflowTemplateRequest.newBuilder()
+ .setName(name)
+ .putAllParameters(parameters)
+ .build();
+ return instantiateWorkflowTemplateAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Retrieves the latest workflow template.
- *
- * Can retrieve previously instantiated template by specifying optional version parameter.
+ * Instantiates a template and begins execution.
*
- *
Sample code:
+ *
The returned Operation can be used to track execution of workflow by polling
+ * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when
+ * entire workflow is finished.
*
- *
- * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
- * GetWorkflowTemplateRequest request = GetWorkflowTemplateRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * WorkflowTemplate response = workflowTemplateServiceClient.getWorkflowTemplate(request);
- * }
- *
+ * The running workflow can be aborted via
+ * [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any
+ * inflight jobs to be cancelled and workflow-owned clusters to be deleted.
*
- * @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 WorkflowTemplate getWorkflowTemplate(GetWorkflowTemplateRequest request) {
- return getWorkflowTemplateCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Retrieves the latest workflow template.
+ *
The [Operation.metadata][google.longrunning.Operation.metadata] will be
+ * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata).
+ * Also see [Using
+ * WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).
*
- *
Can retrieve previously instantiated template by specifying optional version parameter.
+ *
On successful completion, [Operation.response][google.longrunning.Operation.response] will
+ * be [Empty][google.protobuf.Empty].
*
*
Sample code:
*
*
* try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
* WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
- * GetWorkflowTemplateRequest request = GetWorkflowTemplateRequest.newBuilder()
+ * InstantiateWorkflowTemplateRequest request = InstantiateWorkflowTemplateRequest.newBuilder()
* .setName(name.toString())
* .build();
- * ApiFuture<WorkflowTemplate> future = workflowTemplateServiceClient.getWorkflowTemplateCallable().futureCall(request);
- * // Do something
- * WorkflowTemplate response = future.get();
+ * workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(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 UnaryCallable
- getWorkflowTemplateCallable() {
- return stub.getWorkflowTemplateCallable();
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture instantiateWorkflowTemplateAsync(
+ InstantiateWorkflowTemplateRequest request) {
+ return instantiateWorkflowTemplateOperationCallable().futureCall(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
@@ -459,29 +448,19 @@ public final WorkflowTemplate getWorkflowTemplate(GetWorkflowTemplateRequest req
*
* try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
* WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
- * workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name).get();
+ * InstantiateWorkflowTemplateRequest request = InstantiateWorkflowTemplateRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * OperationFuture<Empty, WorkflowMetadata> future = workflowTemplateServiceClient.instantiateWorkflowTemplateOperationCallable().futureCall(request);
+ * // Do something
+ * future.get();
* }
*
- *
- * @param name Required. The resource name of the workflow template, as described in
- * https://cloud.google.com/apis/design/resource_names.
- * * For `projects.regions.workflowTemplates.instantiate`, the resource name of the
- * template has the following format:
- * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}`
- *
* For `projects.locations.workflowTemplates.instantiate`, the resource name of the
- * template has the following format:
- * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}`
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture instantiateWorkflowTemplateAsync(
- WorkflowTemplateName name) {
- InstantiateWorkflowTemplateRequest request =
- InstantiateWorkflowTemplateRequest.newBuilder()
- .setName(name == null ? null : name.toString())
- .build();
- return instantiateWorkflowTemplateAsync(request);
+ @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
+ public final OperationCallable
+ instantiateWorkflowTemplateOperationCallable() {
+ return stub.instantiateWorkflowTemplateOperationCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
@@ -509,33 +488,29 @@ public final OperationFuture instantiateWorkflowTemplat
*
* try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
* WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
- * workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name.toString()).get();
+ * InstantiateWorkflowTemplateRequest request = InstantiateWorkflowTemplateRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * ApiFuture<Operation> future = workflowTemplateServiceClient.instantiateWorkflowTemplateCallable().futureCall(request);
+ * // Do something
+ * future.get();
* }
*
- *
- * @param name Required. The resource name of the workflow template, as described in
- * https://cloud.google.com/apis/design/resource_names.
- * * For `projects.regions.workflowTemplates.instantiate`, the resource name of the
- * template has the following format:
- * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}`
- *
* For `projects.locations.workflowTemplates.instantiate`, the resource name of the
- * template has the following format:
- * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}`
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture instantiateWorkflowTemplateAsync(
- String name) {
- InstantiateWorkflowTemplateRequest request =
- InstantiateWorkflowTemplateRequest.newBuilder().setName(name).build();
- return instantiateWorkflowTemplateAsync(request);
+ public final UnaryCallable
+ instantiateWorkflowTemplateCallable() {
+ return stub.instantiateWorkflowTemplateCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Instantiates a template and begins execution.
*
+ * This method is equivalent to executing the sequence
+ * [CreateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate],
+ * [InstantiateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate],
+ * [DeleteWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.DeleteWorkflowTemplate].
+ *
*
The returned Operation can be used to track execution of workflow by polling
* [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when
* entire workflow is finished.
@@ -556,40 +531,42 @@ public final OperationFuture instantiateWorkflowTemplat
*
*
* try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
- * Map<String, String> parameters = new HashMap<>();
- * workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name, parameters).get();
+ * RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
+ * WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
+ * workflowTemplateServiceClient.instantiateInlineWorkflowTemplateAsync(parent, template).get();
* }
*
*
- * @param name Required. The resource name of the workflow template, as described in
+ * @param parent Required. The resource name of the region or location, as described in
* https://cloud.google.com/apis/design/resource_names.
- * * For `projects.regions.workflowTemplates.instantiate`, the resource name of the
- * template has the following format:
- * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}`
- *
* For `projects.locations.workflowTemplates.instantiate`, the resource name of the
- * template has the following format:
- * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}`
- * @param parameters Optional. Map from parameter names to values that should be used for those
- * parameters. Values may not exceed 100 characters.
+ *
* For `projects.regions.workflowTemplates,instantiateinline`, the resource name of
+ * the region has the following format: `projects/{project_id}/regions/{region}`
+ *
* For `projects.locations.workflowTemplates.instantiateinline`, the resource name of
+ * the location has the following format: `projects/{project_id}/locations/{location}`
+ * @param template Required. The workflow template to instantiate.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture instantiateWorkflowTemplateAsync(
- WorkflowTemplateName name, Map parameters) {
- InstantiateWorkflowTemplateRequest request =
- InstantiateWorkflowTemplateRequest.newBuilder()
- .setName(name == null ? null : name.toString())
- .putAllParameters(parameters)
+ public final OperationFuture instantiateInlineWorkflowTemplateAsync(
+ RegionName parent, WorkflowTemplate template) {
+ InstantiateInlineWorkflowTemplateRequest request =
+ InstantiateInlineWorkflowTemplateRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setTemplate(template)
.build();
- return instantiateWorkflowTemplateAsync(request);
+ return instantiateInlineWorkflowTemplateAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Instantiates a template and begins execution.
*
+ * This method is equivalent to executing the sequence
+ * [CreateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate],
+ * [InstantiateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate],
+ * [DeleteWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.DeleteWorkflowTemplate].
+ *
*
The returned Operation can be used to track execution of workflow by polling
* [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when
* entire workflow is finished.
@@ -610,40 +587,42 @@ public final OperationFuture instantiateWorkflowTemplat
*
*
* try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
- * Map<String, String> parameters = new HashMap<>();
- * workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name.toString(), parameters).get();
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
+ * workflowTemplateServiceClient.instantiateInlineWorkflowTemplateAsync(parent, template).get();
* }
*
*
- * @param name Required. The resource name of the workflow template, as described in
+ * @param parent Required. The resource name of the region or location, as described in
* https://cloud.google.com/apis/design/resource_names.
- * * For `projects.regions.workflowTemplates.instantiate`, the resource name of the
- * template has the following format:
- * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}`
- *
* For `projects.locations.workflowTemplates.instantiate`, the resource name of the
- * template has the following format:
- * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}`
- * @param parameters Optional. Map from parameter names to values that should be used for those
- * parameters. Values may not exceed 100 characters.
+ *
* For `projects.regions.workflowTemplates,instantiateinline`, the resource name of
+ * the region has the following format: `projects/{project_id}/regions/{region}`
+ *
* For `projects.locations.workflowTemplates.instantiateinline`, the resource name of
+ * the location has the following format: `projects/{project_id}/locations/{location}`
+ * @param template Required. The workflow template to instantiate.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture instantiateWorkflowTemplateAsync(
- String name, Map parameters) {
- InstantiateWorkflowTemplateRequest request =
- InstantiateWorkflowTemplateRequest.newBuilder()
- .setName(name)
- .putAllParameters(parameters)
+ public final OperationFuture instantiateInlineWorkflowTemplateAsync(
+ LocationName parent, WorkflowTemplate template) {
+ InstantiateInlineWorkflowTemplateRequest request =
+ InstantiateInlineWorkflowTemplateRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setTemplate(template)
.build();
- return instantiateWorkflowTemplateAsync(request);
+ return instantiateInlineWorkflowTemplateAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Instantiates a template and begins execution.
*
+ * This method is equivalent to executing the sequence
+ * [CreateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate],
+ * [InstantiateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate],
+ * [DeleteWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.DeleteWorkflowTemplate].
+ *
*
The returned Operation can be used to track execution of workflow by polling
* [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when
* entire workflow is finished.
@@ -664,28 +643,42 @@ public final OperationFuture instantiateWorkflowTemplat
*
*
* try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
- * InstantiateWorkflowTemplateRequest request = InstantiateWorkflowTemplateRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(request).get();
+ * RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
+ * WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
+ * workflowTemplateServiceClient.instantiateInlineWorkflowTemplateAsync(parent.toString(), template).get();
* }
*
*
- * @param request The request object containing all of the parameters for the API call.
+ * @param parent Required. The resource name of the region or location, as described in
+ * https://cloud.google.com/apis/design/resource_names.
+ * * For `projects.regions.workflowTemplates,instantiateinline`, the resource name of
+ * the region has the following format: `projects/{project_id}/regions/{region}`
+ *
* For `projects.locations.workflowTemplates.instantiateinline`, the resource name of
+ * the location has the following format: `projects/{project_id}/locations/{location}`
+ * @param template Required. The workflow template to instantiate.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture instantiateWorkflowTemplateAsync(
- InstantiateWorkflowTemplateRequest request) {
- return instantiateWorkflowTemplateOperationCallable().futureCall(request);
+ public final OperationFuture instantiateInlineWorkflowTemplateAsync(
+ String parent, WorkflowTemplate template) {
+ InstantiateInlineWorkflowTemplateRequest request =
+ InstantiateInlineWorkflowTemplateRequest.newBuilder()
+ .setParent(parent)
+ .setTemplate(template)
+ .build();
+ return instantiateInlineWorkflowTemplateAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Instantiates a template and begins execution.
*
+ * This method is equivalent to executing the sequence
+ * [CreateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate],
+ * [InstantiateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate],
+ * [DeleteWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.DeleteWorkflowTemplate].
+ *
*
The returned Operation can be used to track execution of workflow by polling
* [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when
* entire workflow is finished.
@@ -706,26 +699,35 @@ public final OperationFuture instantiateWorkflowTemplat
*
*
* try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
- * InstantiateWorkflowTemplateRequest request = InstantiateWorkflowTemplateRequest.newBuilder()
- * .setName(name.toString())
+ * RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
+ * WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
+ * InstantiateInlineWorkflowTemplateRequest request = InstantiateInlineWorkflowTemplateRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .setTemplate(template)
* .build();
- * OperationFuture<Empty, WorkflowMetadata> future = workflowTemplateServiceClient.instantiateWorkflowTemplateOperationCallable().futureCall(request);
- * // Do something
- * future.get();
+ * workflowTemplateServiceClient.instantiateInlineWorkflowTemplateAsync(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
*/
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
- public final OperationCallable
- instantiateWorkflowTemplateOperationCallable() {
- return stub.instantiateWorkflowTemplateOperationCallable();
+ @BetaApi(
+ "The surface for long-running operations is not stable yet and may change in the future.")
+ public final OperationFuture instantiateInlineWorkflowTemplateAsync(
+ InstantiateInlineWorkflowTemplateRequest request) {
+ return instantiateInlineWorkflowTemplateOperationCallable().futureCall(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Instantiates a template and begins execution.
*
+ * This method is equivalent to executing the sequence
+ * [CreateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate],
+ * [InstantiateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate],
+ * [DeleteWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.DeleteWorkflowTemplate].
+ *
*
The returned Operation can be used to track execution of workflow by polling
* [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when
* entire workflow is finished.
@@ -746,19 +748,22 @@ public final OperationFuture instantiateWorkflowTemplat
*
*
* try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
- * InstantiateWorkflowTemplateRequest request = InstantiateWorkflowTemplateRequest.newBuilder()
- * .setName(name.toString())
+ * RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
+ * WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
+ * InstantiateInlineWorkflowTemplateRequest request = InstantiateInlineWorkflowTemplateRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .setTemplate(template)
* .build();
- * ApiFuture<Operation> future = workflowTemplateServiceClient.instantiateWorkflowTemplateCallable().futureCall(request);
+ * OperationFuture<Empty, WorkflowMetadata> future = workflowTemplateServiceClient.instantiateInlineWorkflowTemplateOperationCallable().futureCall(request);
* // Do something
* future.get();
* }
*
*/
- public final UnaryCallable
- instantiateWorkflowTemplateCallable() {
- return stub.instantiateWorkflowTemplateCallable();
+ @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
+ public final OperationCallable
+ instantiateInlineWorkflowTemplateOperationCallable() {
+ return stub.instantiateInlineWorkflowTemplateOperationCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
@@ -792,111 +797,119 @@ public final OperationFuture instantiateWorkflowTemplat
* try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
* RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
* WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
- * workflowTemplateServiceClient.instantiateInlineWorkflowTemplateAsync(parent, template).get();
+ * InstantiateInlineWorkflowTemplateRequest request = InstantiateInlineWorkflowTemplateRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .setTemplate(template)
+ * .build();
+ * ApiFuture<Operation> future = workflowTemplateServiceClient.instantiateInlineWorkflowTemplateCallable().futureCall(request);
+ * // Do something
+ * future.get();
+ * }
+ *
+ */
+ public final UnaryCallableSample code: + * + *
+ * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
+ * RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
+ * WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
+ * WorkflowTemplate response = workflowTemplateServiceClient.createWorkflowTemplate(parent, template);
* }
*
*
* @param parent Required. The resource name of the region or location, as described in
* https://cloud.google.com/apis/design/resource_names.
- * * For `projects.regions.workflowTemplates,instantiateinline`, the resource name of - * the region has the following format: `projects/{project_id}/regions/{region}` - *
* For `projects.locations.workflowTemplates.instantiateinline`, the resource name of - * the location has the following format: `projects/{project_id}/locations/{location}` - * @param template Required. The workflow template to instantiate. + *
* For `projects.regions.workflowTemplates,create`, the resource name of the region + * has the following format: `projects/{project_id}/regions/{region}` + *
* For `projects.locations.workflowTemplates.create`, the resource name of the
+ * location has the following format: `projects/{project_id}/locations/{location}`
+ * @param template Required. The Dataproc workflow template to create.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture This method is equivalent to executing the sequence
- * [CreateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate],
- * [InstantiateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate],
- * [DeleteWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.DeleteWorkflowTemplate].
- *
- * The returned Operation can be used to track execution of workflow by polling
- * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when
- * entire workflow is finished.
+ * Creates new workflow template.
*
- * The running workflow can be aborted via
- * [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any
- * inflight jobs to be cancelled and workflow-owned clusters to be deleted.
+ * Sample code:
*
- * The [Operation.metadata][google.longrunning.Operation.metadata] will be
- * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata).
- * Also see [Using
- * WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).
+ * On successful completion, [Operation.response][google.longrunning.Operation.response] will
- * be [Empty][google.protobuf.Empty].
+ * @param parent Required. The resource name of the region or location, as described in
+ * https://cloud.google.com/apis/design/resource_names.
+ * * For `projects.regions.workflowTemplates,create`, the resource name of the region
+ * has the following format: `projects/{project_id}/regions/{region}`
+ * * For `projects.locations.workflowTemplates.create`, the resource name of the
+ * location has the following format: `projects/{project_id}/locations/{location}`
+ * @param template Required. The Dataproc workflow template to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final WorkflowTemplate createWorkflowTemplate(
+ LocationName parent, WorkflowTemplate template) {
+ CreateWorkflowTemplateRequest request =
+ CreateWorkflowTemplateRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setTemplate(template)
+ .build();
+ return createWorkflowTemplate(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates new workflow template.
*
* Sample code:
*
* * For `projects.regions.workflowTemplates,instantiateinline`, the resource name of
- * the region has the following format: `projects/{project_id}/regions/{region}`
- * * For `projects.locations.workflowTemplates.instantiateinline`, the resource name of
- * the location has the following format: `projects/{project_id}/locations/{location}`
- * @param template Required. The workflow template to instantiate.
+ * * For `projects.regions.workflowTemplates,create`, the resource name of the region
+ * has the following format: `projects/{project_id}/regions/{region}`
+ * * For `projects.locations.workflowTemplates.create`, the resource name of the
+ * location has the following format: `projects/{project_id}/locations/{location}`
+ * @param template Required. The Dataproc workflow template to create.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture This method is equivalent to executing the sequence
- * [CreateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate],
- * [InstantiateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate],
- * [DeleteWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.DeleteWorkflowTemplate].
- *
- * The returned Operation can be used to track execution of workflow by polling
- * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when
- * entire workflow is finished.
- *
- * The running workflow can be aborted via
- * [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any
- * inflight jobs to be cancelled and workflow-owned clusters to be deleted.
- *
- * The [Operation.metadata][google.longrunning.Operation.metadata] will be
- * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata).
- * Also see [Using
- * WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).
- *
- * On successful completion, [Operation.response][google.longrunning.Operation.response] will
- * be [Empty][google.protobuf.Empty].
+ * Creates new workflow template.
*
* Sample code:
*
@@ -904,55 +917,24 @@ public final OperationFuture * For `projects.regions.workflowTemplates,instantiateinline`, the resource name of
- * the region has the following format: `projects/{project_id}/regions/{region}`
- * * For `projects.locations.workflowTemplates.instantiateinline`, the resource name of
- * the location has the following format: `projects/{project_id}/locations/{location}`
- * @param template Required. The workflow template to instantiate.
+ * @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
*/
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture This method is equivalent to executing the sequence
- * [CreateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate],
- * [InstantiateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate],
- * [DeleteWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.DeleteWorkflowTemplate].
- *
- * The returned Operation can be used to track execution of workflow by polling
- * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when
- * entire workflow is finished.
- *
- * The running workflow can be aborted via
- * [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any
- * inflight jobs to be cancelled and workflow-owned clusters to be deleted.
- *
- * The [Operation.metadata][google.longrunning.Operation.metadata] will be
- * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata).
- * Also see [Using
- * WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).
- *
- * On successful completion, [Operation.response][google.longrunning.Operation.response] will
- * be [Empty][google.protobuf.Empty].
+ * Creates new workflow template.
*
* Sample code:
*
@@ -960,115 +942,133 @@ public final OperationFuture This method is equivalent to executing the sequence
- * [CreateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate],
- * [InstantiateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate],
- * [DeleteWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.DeleteWorkflowTemplate].
+ * Can retrieve previously instantiated template by specifying optional version parameter.
*
- * The returned Operation can be used to track execution of workflow by polling
- * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when
- * entire workflow is finished.
+ * Sample code:
*
- * The running workflow can be aborted via
- * [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any
- * inflight jobs to be cancelled and workflow-owned clusters to be deleted.
+ * The [Operation.metadata][google.longrunning.Operation.metadata] will be
- * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata).
- * Also see [Using
- * WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).
+ * @param name Required. The resource name of the workflow template, as described in
+ * https://cloud.google.com/apis/design/resource_names.
+ * * For `projects.regions.workflowTemplates.get`, the resource name of the template
+ * has the following format:
+ * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}`
+ * * For `projects.locations.workflowTemplates.get`, the resource name of the template
+ * has the following format:
+ * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final WorkflowTemplate getWorkflowTemplate(WorkflowTemplateName name) {
+ GetWorkflowTemplateRequest request =
+ GetWorkflowTemplateRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ return getWorkflowTemplate(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Retrieves the latest workflow template.
*
- * On successful completion, [Operation.response][google.longrunning.Operation.response] will
- * be [Empty][google.protobuf.Empty].
+ * Can retrieve previously instantiated template by specifying optional version parameter.
*
* Sample code:
*
* * For `projects.regions.workflowTemplates.get`, the resource name of the template
+ * has the following format:
+ * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}`
+ * * For `projects.locations.workflowTemplates.get`, the resource name of the template
+ * has the following format:
+ * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
- public final OperationCallable This method is equivalent to executing the sequence
- * [CreateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate],
- * [InstantiateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate],
- * [DeleteWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.DeleteWorkflowTemplate].
+ * Can retrieve previously instantiated template by specifying optional version parameter.
*
- * The returned Operation can be used to track execution of workflow by polling
- * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when
- * entire workflow is finished.
+ * Sample code:
*
- * The running workflow can be aborted via
- * [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any
- * inflight jobs to be cancelled and workflow-owned clusters to be deleted.
+ * The [Operation.metadata][google.longrunning.Operation.metadata] will be
- * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata).
- * Also see [Using
- * WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).
+ * @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 WorkflowTemplate getWorkflowTemplate(GetWorkflowTemplateRequest request) {
+ return getWorkflowTemplateCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Retrieves the latest workflow template.
*
- * On successful completion, [Operation.response][google.longrunning.Operation.response] will
- * be [Empty][google.protobuf.Empty].
+ * Can retrieve previously instantiated template by specifying optional version parameter.
*
* Sample code:
*
* 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 updateAutoscalingPolicy to 30 seconds:
+ * For example, to set the total timeout of createAutoscalingPolicy to 30 seconds:
*
*
*
- *
+ * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
+ * WorkflowTemplate response = workflowTemplateServiceClient.createWorkflowTemplate(parent, template);
+ * }
+ *
*
* @param parent Required. The resource name of the region or location, as described in
* https://cloud.google.com/apis/design/resource_names.
- *
* try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
* WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
- * workflowTemplateServiceClient.instantiateInlineWorkflowTemplateAsync(parent, template).get();
+ * WorkflowTemplate response = workflowTemplateServiceClient.createWorkflowTemplate(parent.toString(), template);
* }
*
*
- *
+ * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
+ * WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ * WorkflowTemplate response = workflowTemplateServiceClient.getWorkflowTemplate(name);
+ * }
+ *
+ *
+ * @param name Required. The resource name of the workflow template, as described in
+ * https://cloud.google.com/apis/design/resource_names.
+ *
* try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
- * WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
- * InstantiateInlineWorkflowTemplateRequest request = InstantiateInlineWorkflowTemplateRequest.newBuilder()
- * .setParent(parent.toString())
- * .setTemplate(template)
- * .build();
- * OperationFuture<Empty, WorkflowMetadata> future = workflowTemplateServiceClient.instantiateInlineWorkflowTemplateOperationCallable().futureCall(request);
- * // Do something
- * future.get();
+ * WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ * WorkflowTemplate response = workflowTemplateServiceClient.getWorkflowTemplate(name.toString());
* }
*
*
- *
+ * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
+ * WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ * GetWorkflowTemplateRequest request = GetWorkflowTemplateRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * WorkflowTemplate response = workflowTemplateServiceClient.getWorkflowTemplate(request);
+ * }
+ *
*/
- public final UnaryCallable
* try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
- * WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
- * InstantiateInlineWorkflowTemplateRequest request = InstantiateInlineWorkflowTemplateRequest.newBuilder()
- * .setParent(parent.toString())
- * .setTemplate(template)
+ * WorkflowTemplateName name = WorkflowTemplateName.ofProjectRegionWorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
+ * GetWorkflowTemplateRequest request = GetWorkflowTemplateRequest.newBuilder()
+ * .setName(name.toString())
* .build();
- * ApiFuture<Operation> future = workflowTemplateServiceClient.instantiateInlineWorkflowTemplateCallable().futureCall(request);
+ * ApiFuture<WorkflowTemplate> future = workflowTemplateServiceClient.getWorkflowTemplateCallable().futureCall(request);
* // Do something
- * future.get();
+ * WorkflowTemplate response = future.get();
* }
*
*
diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/AutoscalingPolicyServiceStub.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/AutoscalingPolicyServiceStub.java
index 337a677c..01685310 100644
--- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/AutoscalingPolicyServiceStub.java
+++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/AutoscalingPolicyServiceStub.java
@@ -40,16 +40,16 @@
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public abstract class AutoscalingPolicyServiceStub implements BackgroundResource {
- public UnaryCallable
* try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.create()) {
+ * RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
* AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build();
- * AutoscalingPolicy response = autoscalingPolicyServiceClient.updateAutoscalingPolicy(policy);
+ * AutoscalingPolicy response = autoscalingPolicyServiceClient.createAutoscalingPolicy(parent, policy);
* }
*
*
*
* AutoscalingPolicyServiceStubSettings.Builder autoscalingPolicyServiceSettingsBuilder =
* AutoscalingPolicyServiceStubSettings.newBuilder();
* autoscalingPolicyServiceSettingsBuilder
- * .updateAutoscalingPolicySettings()
+ * .createAutoscalingPolicySettings()
* .setRetrySettings(
- * autoscalingPolicyServiceSettingsBuilder.updateAutoscalingPolicySettings().getRetrySettings().toBuilder()
+ * autoscalingPolicyServiceSettingsBuilder.createAutoscalingPolicySettings().getRetrySettings().toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* AutoscalingPolicyServiceStubSettings autoscalingPolicyServiceSettings = autoscalingPolicyServiceSettingsBuilder.build();
@@ -95,10 +95,10 @@ public class AutoscalingPolicyServiceStubSettings
private static final ImmutableList