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 592055c5..9247e11f 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 @@ -42,6 +42,16 @@ *
This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * + *
{@code + * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + * AutoscalingPolicyServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build(); + * AutoscalingPolicy response = + * autoscalingPolicyServiceClient.createAutoscalingPolicy(parent, policy); + * } + * }+ * *
Note: close() needs to be called on the AutoscalingPolicyServiceClient object to clean up * resources such as threads. In the example above, try-with-resources is used, which automatically * calls close(). @@ -150,6 +160,18 @@ public AutoscalingPolicyServiceStub getStub() { /** * Creates new autoscaling policy. * + *
Sample code: + * + *
{@code + * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + * AutoscalingPolicyServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build(); + * AutoscalingPolicy response = + * autoscalingPolicyServiceClient.createAutoscalingPolicy(parent, policy); + * } + * }+ * * @param parent Required. The "resource name" of the region or location, as described in * https://cloud.google.com/apis/design/resource_names. *
Sample code: + * + *
{@code + * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + * AutoscalingPolicyServiceClient.create()) { + * RegionName parent = RegionName.of("[PROJECT]", "[REGION]"); + * AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build(); + * AutoscalingPolicy response = + * autoscalingPolicyServiceClient.createAutoscalingPolicy(parent, policy); + * } + * }+ * * @param parent Required. The "resource name" of the region or location, as described in * https://cloud.google.com/apis/design/resource_names. *
Sample code: + * + *
{@code + * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + * AutoscalingPolicyServiceClient.create()) { + * String parent = + * AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName( + * "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]") + * .toString(); + * AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build(); + * AutoscalingPolicy response = + * autoscalingPolicyServiceClient.createAutoscalingPolicy(parent, policy); + * } + * }+ * * @param parent Required. The "resource name" of the region or location, as described in * https://cloud.google.com/apis/design/resource_names. *
Sample code: + * + *
{@code + * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + * AutoscalingPolicyServiceClient.create()) { + * CreateAutoscalingPolicyRequest request = + * CreateAutoscalingPolicyRequest.newBuilder() + * .setParent( + * AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName( + * "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]") + * .toString()) + * .setPolicy(AutoscalingPolicy.newBuilder().build()) + * .build(); + * AutoscalingPolicy response = autoscalingPolicyServiceClient.createAutoscalingPolicy(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 */ @@ -242,6 +308,24 @@ public final AutoscalingPolicy createAutoscalingPolicy(CreateAutoscalingPolicyRe * Creates new autoscaling policy. * *
Sample code: + * + *
{@code + * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + * AutoscalingPolicyServiceClient.create()) { + * CreateAutoscalingPolicyRequest request = + * CreateAutoscalingPolicyRequest.newBuilder() + * .setParent( + * AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName( + * "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]") + * .toString()) + * .setPolicy(AutoscalingPolicy.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * autoscalingPolicyServiceClient.createAutoscalingPolicyCallable().futureCall(request); + * // Do something. + * AutoscalingPolicy response = future.get(); + * } + * }
Disabled check for update_mask, because all updates will be full replacements. * + *
Sample code: + * + *
{@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 */ @@ -269,6 +363,19 @@ public final AutoscalingPolicy updateAutoscalingPolicy(AutoscalingPolicy policy) * *
Disabled check for update_mask, because all updates will be full replacements. * + *
Sample code: + * + *
{@code + * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + * AutoscalingPolicyServiceClient.create()) { + * UpdateAutoscalingPolicyRequest request = + * UpdateAutoscalingPolicyRequest.newBuilder() + * .setPolicy(AutoscalingPolicy.newBuilder().build()) + * .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 */ @@ -283,6 +390,20 @@ public final AutoscalingPolicy updateAutoscalingPolicy(UpdateAutoscalingPolicyRe *
Disabled check for update_mask, because all updates will be full replacements. * *
Sample code: + * + *
{@code + * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + * AutoscalingPolicyServiceClient.create()) { + * UpdateAutoscalingPolicyRequest request = + * UpdateAutoscalingPolicyRequest.newBuilder() + * .setPolicy(AutoscalingPolicy.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * autoscalingPolicyServiceClient.updateAutoscalingPolicyCallable().futureCall(request); + * // Do something. + * AutoscalingPolicy response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + * AutoscalingPolicyServiceClient.create()) { + * AutoscalingPolicyName name = + * AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName( + * "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]"); + * AutoscalingPolicy response = autoscalingPolicyServiceClient.getAutoscalingPolicy(name); + * } + * }+ * * @param name Required. The "resource name" of the autoscaling policy, as described in * https://cloud.google.com/apis/design/resource_names. *
Sample code: + * + *
{@code + * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + * AutoscalingPolicyServiceClient.create()) { + * String name = + * AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName( + * "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]") + * .toString(); + * AutoscalingPolicy response = autoscalingPolicyServiceClient.getAutoscalingPolicy(name); + * } + * }+ * * @param name Required. The "resource name" of the autoscaling policy, as described in * https://cloud.google.com/apis/design/resource_names. *
Sample code: + * + *
{@code + * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + * AutoscalingPolicyServiceClient.create()) { + * GetAutoscalingPolicyRequest request = + * GetAutoscalingPolicyRequest.newBuilder() + * .setName( + * AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName( + * "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]") + * .toString()) + * .build(); + * AutoscalingPolicy response = autoscalingPolicyServiceClient.getAutoscalingPolicy(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 */ @@ -357,6 +519,23 @@ public final AutoscalingPolicy getAutoscalingPolicy(GetAutoscalingPolicyRequest * Retrieves autoscaling policy. * *
Sample code: + * + *
{@code + * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + * AutoscalingPolicyServiceClient.create()) { + * GetAutoscalingPolicyRequest request = + * GetAutoscalingPolicyRequest.newBuilder() + * .setName( + * AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName( + * "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]") + * .toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * autoscalingPolicyServiceClient.getAutoscalingPolicyCallable().futureCall(request); + * // Do something. + * AutoscalingPolicy response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + * AutoscalingPolicyServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * for (AutoscalingPolicy element : + * autoscalingPolicyServiceClient.listAutoscalingPolicies(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. The "resource name" of the region or location, as described in * https://cloud.google.com/apis/design/resource_names. *
Sample code: + * + *
{@code + * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + * AutoscalingPolicyServiceClient.create()) { + * RegionName parent = RegionName.of("[PROJECT]", "[REGION]"); + * for (AutoscalingPolicy element : + * autoscalingPolicyServiceClient.listAutoscalingPolicies(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. The "resource name" of the region or location, as described in * https://cloud.google.com/apis/design/resource_names. *
Sample code: + * + *
{@code + * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + * AutoscalingPolicyServiceClient.create()) { + * String parent = + * AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName( + * "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]") + * .toString(); + * for (AutoscalingPolicy element : + * autoscalingPolicyServiceClient.listAutoscalingPolicies(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. The "resource name" of the region or location, as described in * https://cloud.google.com/apis/design/resource_names. *
Sample code: + * + *
{@code + * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + * AutoscalingPolicyServiceClient.create()) { + * ListAutoscalingPoliciesRequest request = + * ListAutoscalingPoliciesRequest.newBuilder() + * .setParent( + * AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName( + * "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]") + * .toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (AutoscalingPolicy element : + * autoscalingPolicyServiceClient.listAutoscalingPolicies(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -453,6 +695,27 @@ public final ListAutoscalingPoliciesPagedResponse listAutoscalingPolicies( * Lists autoscaling policies in the project. * *
Sample code: + * + *
{@code + * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + * AutoscalingPolicyServiceClient.create()) { + * ListAutoscalingPoliciesRequest request = + * ListAutoscalingPoliciesRequest.newBuilder() + * .setParent( + * AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName( + * "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]") + * .toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * autoscalingPolicyServiceClient.listAutoscalingPoliciesPagedCallable().futureCall(request); + * // Do something. + * for (AutoscalingPolicy element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + * AutoscalingPolicyServiceClient.create()) { + * while (true) { + * ListAutoscalingPoliciesResponse response = + * autoscalingPolicyServiceClient.listAutoscalingPoliciesCallable().call(request); + * for (AutoscalingPolicy element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
Sample code: + * + *
{@code + * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + * AutoscalingPolicyServiceClient.create()) { + * AutoscalingPolicyName name = + * AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName( + * "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]"); + * autoscalingPolicyServiceClient.deleteAutoscalingPolicy(name); + * } + * }+ * * @param name Required. The "resource name" of the autoscaling policy, as described in * https://cloud.google.com/apis/design/resource_names. *
Sample code: + * + *
{@code + * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + * AutoscalingPolicyServiceClient.create()) { + * String name = + * AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName( + * "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]") + * .toString(); + * autoscalingPolicyServiceClient.deleteAutoscalingPolicy(name); + * } + * }+ * * @param name Required. The "resource name" of the autoscaling policy, as described in * https://cloud.google.com/apis/design/resource_names. *
Sample code: + * + *
{@code + * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + * AutoscalingPolicyServiceClient.create()) { + * DeleteAutoscalingPolicyRequest request = + * DeleteAutoscalingPolicyRequest.newBuilder() + * .setName( + * AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName( + * "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]") + * .toString()) + * .build(); + * autoscalingPolicyServiceClient.deleteAutoscalingPolicy(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 */ @@ -542,6 +865,23 @@ public final void deleteAutoscalingPolicy(DeleteAutoscalingPolicyRequest request * one or more clusters. * *
Sample code: + * + *
{@code + * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + * AutoscalingPolicyServiceClient.create()) { + * DeleteAutoscalingPolicyRequest request = + * DeleteAutoscalingPolicyRequest.newBuilder() + * .setName( + * AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName( + * "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]") + * .toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * autoscalingPolicyServiceClient.deleteAutoscalingPolicyCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * String projectId = "projectId-894832108"; + * String region = "region-934795532"; + * String clusterName = "clusterName-1141738587"; + * Cluster response = clusterControllerClient.getCluster(projectId, region, clusterName); + * } + * }+ * *
Note: close() needs to be called on the ClusterControllerClient object to clean up resources * such as threads. In the example above, try-with-resources is used, which automatically calls * close(). @@ -167,6 +176,18 @@ public final OperationsClient getOperationsClient() { * [Operation.metadata][google.longrunning.Operation.metadata] will be * [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). * + *
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * String projectId = "projectId-894832108"; + * String region = "region-934795532"; + * Cluster cluster = Cluster.newBuilder().build(); + * Cluster response = + * clusterControllerClient.createClusterAsync(projectId, region, cluster).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. @@ -190,6 +211,21 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * CreateClusterRequest request = + * CreateClusterRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setCluster(Cluster.newBuilder().build()) + * .setRequestId("requestId693933066") + * .build(); + * Cluster response = clusterControllerClient.createClusterAsync(request).get(); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -205,6 +241,22 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * CreateClusterRequest request = + * CreateClusterRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setCluster(Cluster.newBuilder().build()) + * .setRequestId("requestId693933066") + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * clusterControllerClient.createClusterOperationCallable().futureCall(request); + * // Do something. + * Cluster response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * CreateClusterRequest request = + * CreateClusterRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setCluster(Cluster.newBuilder().build()) + * .setRequestId("requestId693933066") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * clusterControllerClient.createClusterCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * String projectId = "projectId-894832108"; + * String region = "region-934795532"; + * String clusterName = "clusterName-1141738587"; + * Cluster cluster = Cluster.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * Cluster response = + * clusterControllerClient + * .updateClusterAsync(projectId, region, clusterName, cluster, updateMask) + * .get(); + * } + * }+ * * @param projectId Required. The ID of the Google Cloud Platform project the cluster belongs to. * @param region Required. The Dataproc region in which to handle the request. * @param clusterName Required. The cluster name. @@ -275,6 +359,24 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * UpdateClusterRequest request = + * UpdateClusterRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setClusterName("clusterName-1141738587") + * .setCluster(Cluster.newBuilder().build()) + * .setGracefulDecommissionTimeout(Duration.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .setRequestId("requestId693933066") + * .build(); + * Cluster response = clusterControllerClient.updateClusterAsync(request).get(); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -290,6 +392,25 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * UpdateClusterRequest request = + * UpdateClusterRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setClusterName("clusterName-1141738587") + * .setCluster(Cluster.newBuilder().build()) + * .setGracefulDecommissionTimeout(Duration.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .setRequestId("requestId693933066") + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * clusterControllerClient.updateClusterOperationCallable().futureCall(request); + * // Do something. + * Cluster response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * UpdateClusterRequest request = + * UpdateClusterRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setClusterName("clusterName-1141738587") + * .setCluster(Cluster.newBuilder().build()) + * .setGracefulDecommissionTimeout(Duration.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .setRequestId("requestId693933066") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * clusterControllerClient.updateClusterCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * String projectId = "projectId-894832108"; + * String region = "region-934795532"; + * String clusterName = "clusterName-1141738587"; + * clusterControllerClient.deleteClusterAsync(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. @@ -337,6 +488,22 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * DeleteClusterRequest request = + * DeleteClusterRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setClusterName("clusterName-1141738587") + * .setClusterUuid("clusterUuid-1141510955") + * .setRequestId("requestId693933066") + * .build(); + * clusterControllerClient.deleteClusterAsync(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 */ @@ -352,6 +519,23 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * DeleteClusterRequest request = + * DeleteClusterRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setClusterName("clusterName-1141738587") + * .setClusterUuid("clusterUuid-1141510955") + * .setRequestId("requestId693933066") + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * clusterControllerClient.deleteClusterOperationCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * DeleteClusterRequest request = + * DeleteClusterRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setClusterName("clusterName-1141738587") + * .setClusterUuid("clusterUuid-1141510955") + * .setRequestId("requestId693933066") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * clusterControllerClient.deleteClusterCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * String projectId = "projectId-894832108"; + * String region = "region-934795532"; + * String clusterName = "clusterName-1141738587"; + * Cluster response = clusterControllerClient.getCluster(projectId, region, clusterName); + * } + * }+ * * @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. @@ -394,6 +606,20 @@ public final Cluster getCluster(String projectId, String region, String clusterN /** * Gets the resource representation for a cluster in a project. * + *
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * GetClusterRequest request = + * GetClusterRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setClusterName("clusterName-1141738587") + * .build(); + * Cluster response = clusterControllerClient.getCluster(request); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -406,6 +632,20 @@ public final Cluster getCluster(GetClusterRequest request) { * Gets the resource representation for a cluster in a project. * *
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * GetClusterRequest request = + * GetClusterRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setClusterName("clusterName-1141738587") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = clusterControllerClient.getClusterCallable().futureCall(request); + * // Do something. + * Cluster response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * String projectId = "projectId-894832108"; + * String region = "region-934795532"; + * for (Cluster element : clusterControllerClient.listClusters(projectId, region).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @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. @@ -430,6 +682,20 @@ public final ListClustersPagedResponse listClusters(String projectId, String reg /** * Lists all regions/{region}/clusters in a project alphabetically. * + *
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * String projectId = "projectId-894832108"; + * String region = "region-934795532"; + * String filter = "filter-1274492040"; + * for (Cluster element : + * clusterControllerClient.listClusters(projectId, region, filter).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @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. @@ -464,6 +730,24 @@ public final ListClustersPagedResponse listClusters( /** * Lists all regions/{region}/clusters in a project alphabetically. * + *
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * ListClustersRequest request = + * ListClustersRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (Cluster element : clusterControllerClient.listClusters(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -476,6 +760,25 @@ public final ListClustersPagedResponse listClusters(ListClustersRequest request) * Lists all regions/{region}/clusters in a project alphabetically. * *
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * ListClustersRequest request = + * ListClustersRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * clusterControllerClient.listClustersPagedCallable().futureCall(request); + * // Do something. + * for (Cluster element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * while (true) { + * ListClustersResponse response = + * clusterControllerClient.listClustersCallable().call(request); + * for (Cluster element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * String projectId = "projectId-894832108"; + * String region = "region-934795532"; + * String clusterName = "clusterName-1141738587"; + * DiagnoseClusterResults response = + * 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. @@ -527,6 +860,20 @@ public final UnaryCallable
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * DiagnoseClusterRequest request = + * DiagnoseClusterRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setClusterName("clusterName-1141738587") + * .build(); + * DiagnoseClusterResults response = 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 */ @@ -545,6 +892,21 @@ public final UnaryCallable
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * DiagnoseClusterRequest request = + * DiagnoseClusterRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setClusterName("clusterName-1141738587") + * .build(); + * OperationFuture*/ public final OperationCallable< DiagnoseClusterRequest, DiagnoseClusterResults, ClusterOperationMetadata> @@ -562,6 +924,21 @@ public final UnaryCallablefuture = + * clusterControllerClient.diagnoseClusterOperationCallable().futureCall(request); + * // Do something. + * DiagnoseClusterResults response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * DiagnoseClusterRequest request = + * DiagnoseClusterRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setClusterName("clusterName-1141738587") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * clusterControllerClient.diagnoseClusterCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * String projectId = "projectId-894832108"; + * String region = "region-934795532"; + * Job job = Job.newBuilder().build(); + * Job response = jobControllerClient.submitJob(projectId, region, job); + * } + * }+ * *
Note: close() needs to be called on the JobControllerClient object to clean up resources such * as threads. In the example above, try-with-resources is used, which automatically calls close(). * @@ -160,6 +169,17 @@ public final OperationsClient getOperationsClient() { /** * Submits a job to a cluster. * + *
Sample code: + * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * String projectId = "projectId-894832108"; + * String region = "region-934795532"; + * Job job = Job.newBuilder().build(); + * Job response = jobControllerClient.submitJob(projectId, region, job); + * } + * }+ * * @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. @@ -175,6 +195,21 @@ public final Job submitJob(String projectId, String region, Job job) { /** * Submits a job to a cluster. * + *
Sample code: + * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * SubmitJobRequest request = + * SubmitJobRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setJob(Job.newBuilder().build()) + * .setRequestId("requestId693933066") + * .build(); + * Job response = jobControllerClient.submitJob(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 */ @@ -187,6 +222,21 @@ public final Job submitJob(SubmitJobRequest request) { * Submits a job to a cluster. * *
Sample code: + * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * SubmitJobRequest request = + * SubmitJobRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setJob(Job.newBuilder().build()) + * .setRequestId("requestId693933066") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = jobControllerClient.submitJobCallable().futureCall(request); + * // Do something. + * Job response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * String projectId = "projectId-894832108"; + * String region = "region-934795532"; + * 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. @@ -212,6 +273,21 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * SubmitJobRequest request = + * SubmitJobRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setJob(Job.newBuilder().build()) + * .setRequestId("requestId693933066") + * .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 */ @@ -225,6 +301,22 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * SubmitJobRequest request = + * SubmitJobRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setJob(Job.newBuilder().build()) + * .setRequestId("requestId693933066") + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * jobControllerClient.submitJobAsOperationOperationCallable().futureCall(request); + * // Do something. + * Job response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * SubmitJobRequest request = + * SubmitJobRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setJob(Job.newBuilder().build()) + * .setRequestId("requestId693933066") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * jobControllerClient.submitJobAsOperationCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * String projectId = "projectId-894832108"; + * String region = "region-934795532"; + * String jobId = "jobId101296568"; + * Job response = jobControllerClient.getJob(projectId, region, jobId); + * } + * }+ * * @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 jobId Required. The job ID. @@ -264,6 +383,20 @@ public final Job getJob(String projectId, String region, String jobId) { /** * Gets the resource representation for a job in a project. * + *
Sample code: + * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * GetJobRequest request = + * GetJobRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setJobId("jobId101296568") + * .build(); + * Job response = jobControllerClient.getJob(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 */ @@ -276,6 +409,20 @@ public final Job getJob(GetJobRequest request) { * Gets the resource representation for a job in a project. * *
Sample code: + * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * GetJobRequest request = + * GetJobRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setJobId("jobId101296568") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = jobControllerClient.getJobCallable().futureCall(request); + * // Do something. + * Job response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * String projectId = "projectId-894832108"; + * String region = "region-934795532"; + * for (Job element : jobControllerClient.listJobs(projectId, region).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @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. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -299,6 +458,19 @@ public final ListJobsPagedResponse listJobs(String projectId, String region) { /** * Lists regions/{region}/jobs in a project. * + *
Sample code: + * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * String projectId = "projectId-894832108"; + * String region = "region-934795532"; + * String filter = "filter-1274492040"; + * for (Job element : jobControllerClient.listJobs(projectId, region, filter).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @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 filter Optional. A filter constraining the jobs to list. Filters are case-sensitive and @@ -326,6 +498,25 @@ public final ListJobsPagedResponse listJobs(String projectId, String region, Str /** * Lists regions/{region}/jobs in a project. * + *
Sample code: + * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * ListJobsRequest request = + * ListJobsRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setClusterName("clusterName-1141738587") + * .setFilter("filter-1274492040") + * .build(); + * for (Job element : jobControllerClient.listJobs(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -338,6 +529,25 @@ public final ListJobsPagedResponse listJobs(ListJobsRequest request) { * Lists regions/{region}/jobs in a project. * *
Sample code: + * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * ListJobsRequest request = + * ListJobsRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setClusterName("clusterName-1141738587") + * .setFilter("filter-1274492040") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = jobControllerClient.listJobsPagedCallable().futureCall(request); + * // Do something. + * for (Job element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * while (true) { + * ListJobsResponse response = jobControllerClient.listJobsCallable().call(request); + * for (Job element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
Sample code: + * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * UpdateJobRequest request = + * UpdateJobRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setJobId("jobId101296568") + * .setJob(Job.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * Job response = jobControllerClient.updateJob(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 */ @@ -369,6 +612,22 @@ public final Job updateJob(UpdateJobRequest request) { * Updates a job in a project. * *
Sample code: + * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * UpdateJobRequest request = + * UpdateJobRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setJobId("jobId101296568") + * .setJob(Job.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = jobControllerClient.updateJobCallable().futureCall(request); + * // Do something. + * Job response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * String projectId = "projectId-894832108"; + * String region = "region-934795532"; + * String jobId = "jobId101296568"; + * Job response = jobControllerClient.cancelJob(projectId, region, jobId); + * } + * }+ * * @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 jobId Required. The job ID. @@ -403,6 +673,20 @@ public final Job cancelJob(String projectId, String region, String jobId) { * or * [regions/{region}/jobs.get](https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/get). * + *
Sample code: + * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * CancelJobRequest request = + * CancelJobRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setJobId("jobId101296568") + * .build(); + * Job response = jobControllerClient.cancelJob(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 */ @@ -418,6 +702,20 @@ public final Job cancelJob(CancelJobRequest request) { * [regions/{region}/jobs.get](https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/get). * *
Sample code: + * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * CancelJobRequest request = + * CancelJobRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setJobId("jobId101296568") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = jobControllerClient.cancelJobCallable().futureCall(request); + * // Do something. + * Job response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * String projectId = "projectId-894832108"; + * String region = "region-934795532"; + * String jobId = "jobId101296568"; + * jobControllerClient.deleteJob(projectId, region, jobId); + * } + * }+ * * @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 jobId Required. The job ID. @@ -448,6 +757,20 @@ public final void deleteJob(String projectId, String region, String jobId) { * Deletes the job from the project. If the job is active, the delete fails, and the response * returns `FAILED_PRECONDITION`. * + *
Sample code: + * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * DeleteJobRequest request = + * DeleteJobRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setJobId("jobId101296568") + * .build(); + * jobControllerClient.deleteJob(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 */ @@ -461,6 +784,20 @@ public final void deleteJob(DeleteJobRequest request) { * returns `FAILED_PRECONDITION`. * *
Sample code: + * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * DeleteJobRequest request = + * DeleteJobRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setJobId("jobId101296568") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = jobControllerClient.deleteJobCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * WorkflowTemplate template = WorkflowTemplate.newBuilder().build(); + * WorkflowTemplate response = + * workflowTemplateServiceClient.createWorkflowTemplate(parent, template); + * } + * }+ * *
Note: close() needs to be called on the WorkflowTemplateServiceClient object to clean up * resources such as threads. In the example above, try-with-resources is used, which automatically * calls close(). @@ -165,6 +175,18 @@ public final OperationsClient getOperationsClient() { /** * Creates new workflow template. * + *
Sample code: + * + *
{@code + * 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. *
Sample code: + * + *
{@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. *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * String parent = + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]") + * .toString(); + * 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. *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * CreateWorkflowTemplateRequest request = + * CreateWorkflowTemplateRequest.newBuilder() + * .setParent( + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]") + * .toString()) + * .setTemplate(WorkflowTemplate.newBuilder().build()) + * .build(); + * WorkflowTemplate response = workflowTemplateServiceClient.createWorkflowTemplate(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 */ @@ -257,6 +323,24 @@ public final WorkflowTemplate createWorkflowTemplate(CreateWorkflowTemplateReque * Creates new workflow template. * *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * CreateWorkflowTemplateRequest request = + * CreateWorkflowTemplateRequest.newBuilder() + * .setParent( + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]") + * .toString()) + * .setTemplate(WorkflowTemplate.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * workflowTemplateServiceClient.createWorkflowTemplateCallable().futureCall(request); + * // Do something. + * WorkflowTemplate response = future.get(); + * } + * }
Can retrieve previously instantiated template by specifying optional version parameter. * + *
Sample code: + * + *
{@code + * 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. *
Can retrieve previously instantiated template by specifying optional version parameter. * + *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * String name = + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]") + * .toString(); + * 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. *
Can retrieve previously instantiated template by specifying optional version parameter. * + *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * GetWorkflowTemplateRequest request = + * GetWorkflowTemplateRequest.newBuilder() + * .setName( + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]") + * .toString()) + * .setVersion(351608024) + * .build(); + * WorkflowTemplate response = workflowTemplateServiceClient.getWorkflowTemplate(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 */ @@ -339,6 +465,24 @@ public final WorkflowTemplate getWorkflowTemplate(GetWorkflowTemplateRequest req *
Can retrieve previously instantiated template by specifying optional version parameter. * *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * GetWorkflowTemplateRequest request = + * GetWorkflowTemplateRequest.newBuilder() + * .setName( + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]") + * .toString()) + * .setVersion(351608024) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * workflowTemplateServiceClient.getWorkflowTemplateCallable().futureCall(request); + * // Do something. + * WorkflowTemplate response = future.get(); + * } + * }
On successful completion, [Operation.response][google.longrunning.Operation.response] will * be [Empty][google.protobuf.Empty]. * + *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * WorkflowTemplateName name = + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]"); + * workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name).get(); + * } + * }+ * * @param name Required. The resource name of the workflow template, as described in * https://cloud.google.com/apis/design/resource_names. *
On successful completion, [Operation.response][google.longrunning.Operation.response] will * be [Empty][google.protobuf.Empty]. * + *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * String name = + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]") + * .toString(); + * workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name).get(); + * } + * }+ * * @param name Required. The resource name of the workflow template, as described in * https://cloud.google.com/apis/design/resource_names. *
On successful completion, [Operation.response][google.longrunning.Operation.response] will * be [Empty][google.protobuf.Empty]. * + *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * WorkflowTemplateName name = + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]"); + * Map+ * * @param name Required. The resource name of the workflow template, as described in * https://cloud.google.com/apis/design/resource_names. *parameters = new HashMap<>(); + * workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name, parameters).get(); + * } + * }
On successful completion, [Operation.response][google.longrunning.Operation.response] will * be [Empty][google.protobuf.Empty]. * + *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * String name = + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]") + * .toString(); + * Map+ * * @param name Required. The resource name of the workflow template, as described in * https://cloud.google.com/apis/design/resource_names. *parameters = new HashMap<>(); + * workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name, parameters).get(); + * } + * }
On successful completion, [Operation.response][google.longrunning.Operation.response] will * be [Empty][google.protobuf.Empty]. * + *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * InstantiateWorkflowTemplateRequest request = + * InstantiateWorkflowTemplateRequest.newBuilder() + * .setName( + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]") + * .toString()) + * .setVersion(351608024) + * .setRequestId("requestId693933066") + * .putAllParameters(new HashMap+ * * @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 */ @@ -574,6 +789,28 @@ public final OperationFuture()) + * .build(); + * workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(request).get(); + * } + * }
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * InstantiateWorkflowTemplateRequest request = + * InstantiateWorkflowTemplateRequest.newBuilder() + * .setName( + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]") + * .toString()) + * .setVersion(351608024) + * .setRequestId("requestId693933066") + * .putAllParameters(new HashMap*/ public final OperationCallable()) + * .build(); + * OperationFuture future = + * workflowTemplateServiceClient + * .instantiateWorkflowTemplateOperationCallable() + * .futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * InstantiateWorkflowTemplateRequest request = + * InstantiateWorkflowTemplateRequest.newBuilder() + * .setName( + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]") + * .toString()) + * .setVersion(351608024) + * .setRequestId("requestId693933066") + * .putAllParameters(new HashMap*/ public final UnaryCallable()) + * .build(); + * ApiFuture future = + * workflowTemplateServiceClient.instantiateWorkflowTemplateCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
On successful completion, [Operation.response][google.longrunning.Operation.response] will * be [Empty][google.protobuf.Empty]. * + *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * WorkflowTemplate template = WorkflowTemplate.newBuilder().build(); + * workflowTemplateServiceClient.instantiateInlineWorkflowTemplateAsync(parent, template).get(); + * } + * }+ * * @param parent Required. The resource name of the region or location, as described in * https://cloud.google.com/apis/design/resource_names. *
On successful completion, [Operation.response][google.longrunning.Operation.response] will * be [Empty][google.protobuf.Empty]. * + *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * RegionName parent = RegionName.of("[PROJECT]", "[REGION]"); + * WorkflowTemplate template = WorkflowTemplate.newBuilder().build(); + * workflowTemplateServiceClient.instantiateInlineWorkflowTemplateAsync(parent, template).get(); + * } + * }+ * * @param parent Required. The resource name of the region or location, as described in * https://cloud.google.com/apis/design/resource_names. *
On successful completion, [Operation.response][google.longrunning.Operation.response] will * be [Empty][google.protobuf.Empty]. * + *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * String parent = + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]") + * .toString(); + * WorkflowTemplate template = WorkflowTemplate.newBuilder().build(); + * workflowTemplateServiceClient.instantiateInlineWorkflowTemplateAsync(parent, template).get(); + * } + * }+ * * @param parent Required. The resource name of the region or location, as described in * https://cloud.google.com/apis/design/resource_names. *
On successful completion, [Operation.response][google.longrunning.Operation.response] will * be [Empty][google.protobuf.Empty]. * + *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * InstantiateInlineWorkflowTemplateRequest request = + * InstantiateInlineWorkflowTemplateRequest.newBuilder() + * .setParent( + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]") + * .toString()) + * .setTemplate(WorkflowTemplate.newBuilder().build()) + * .setRequestId("requestId693933066") + * .build(); + * 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 */ @@ -813,6 +1124,27 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * InstantiateInlineWorkflowTemplateRequest request = + * InstantiateInlineWorkflowTemplateRequest.newBuilder() + * .setParent( + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]") + * .toString()) + * .setTemplate(WorkflowTemplate.newBuilder().build()) + * .setRequestId("requestId693933066") + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * workflowTemplateServiceClient + * .instantiateInlineWorkflowTemplateOperationCallable() + * .futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * InstantiateInlineWorkflowTemplateRequest request = + * InstantiateInlineWorkflowTemplateRequest.newBuilder() + * .setParent( + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]") + * .toString()) + * .setTemplate(WorkflowTemplate.newBuilder().build()) + * .setRequestId("requestId693933066") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * workflowTemplateServiceClient + * .instantiateInlineWorkflowTemplateCallable() + * .futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * WorkflowTemplate template = WorkflowTemplate.newBuilder().build(); + * WorkflowTemplate response = workflowTemplateServiceClient.updateWorkflowTemplate(template); + * } + * }+ * * @param template Required. The updated workflow template. *
The `template.version` field must match the current version. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -871,6 +1234,19 @@ public final WorkflowTemplate updateWorkflowTemplate(WorkflowTemplate template) * Updates (replaces) workflow template. The updated template must contain version that matches * the current server version. * + *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * UpdateWorkflowTemplateRequest request = + * UpdateWorkflowTemplateRequest.newBuilder() + * .setTemplate(WorkflowTemplate.newBuilder().build()) + * .build(); + * WorkflowTemplate response = workflowTemplateServiceClient.updateWorkflowTemplate(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 */ @@ -884,6 +1260,20 @@ public final WorkflowTemplate updateWorkflowTemplate(UpdateWorkflowTemplateReque * the current server version. * *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * UpdateWorkflowTemplateRequest request = + * UpdateWorkflowTemplateRequest.newBuilder() + * .setTemplate(WorkflowTemplate.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * workflowTemplateServiceClient.updateWorkflowTemplateCallable().futureCall(request); + * // Do something. + * WorkflowTemplate response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * for (WorkflowTemplate element : + * workflowTemplateServiceClient.listWorkflowTemplates(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. The resource name of the region or location, as described in * https://cloud.google.com/apis/design/resource_names. *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * RegionName parent = RegionName.of("[PROJECT]", "[REGION]"); + * for (WorkflowTemplate element : + * workflowTemplateServiceClient.listWorkflowTemplates(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. The resource name of the region or location, as described in * https://cloud.google.com/apis/design/resource_names. *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * String parent = + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]") + * .toString(); + * for (WorkflowTemplate element : + * workflowTemplateServiceClient.listWorkflowTemplates(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. The resource name of the region or location, as described in * https://cloud.google.com/apis/design/resource_names. *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * ListWorkflowTemplatesRequest request = + * ListWorkflowTemplatesRequest.newBuilder() + * .setParent( + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]") + * .toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (WorkflowTemplate element : + * workflowTemplateServiceClient.listWorkflowTemplates(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -980,6 +1433,27 @@ public final ListWorkflowTemplatesPagedResponse listWorkflowTemplates( * Lists workflows that match the specified filter in the request. * *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * ListWorkflowTemplatesRequest request = + * ListWorkflowTemplatesRequest.newBuilder() + * .setParent( + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]") + * .toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * workflowTemplateServiceClient.listWorkflowTemplatesPagedCallable().futureCall(request); + * // Do something. + * for (WorkflowTemplate element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * while (true) { + * ListWorkflowTemplatesResponse response = + * workflowTemplateServiceClient.listWorkflowTemplatesCallable().call(request); + * for (WorkflowTemplate element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * WorkflowTemplateName name = + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]"); + * workflowTemplateServiceClient.deleteWorkflowTemplate(name); + * } + * }+ * * @param name Required. The resource name of the workflow template, as described in * https://cloud.google.com/apis/design/resource_names. *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * String name = + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]") + * .toString(); + * workflowTemplateServiceClient.deleteWorkflowTemplate(name); + * } + * }+ * * @param name Required. The resource name of the workflow template, as described in * https://cloud.google.com/apis/design/resource_names. *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * DeleteWorkflowTemplateRequest request = + * DeleteWorkflowTemplateRequest.newBuilder() + * .setName( + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]") + * .toString()) + * .setVersion(351608024) + * .build(); + * workflowTemplateServiceClient.deleteWorkflowTemplate(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 */ @@ -1065,6 +1600,24 @@ public final void deleteWorkflowTemplate(DeleteWorkflowTemplateRequest request) * Deletes a workflow template. It does not cancel in-progress workflows. * *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * DeleteWorkflowTemplateRequest request = + * DeleteWorkflowTemplateRequest.newBuilder() + * .setName( + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]") + * .toString()) + * .setVersion(351608024) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * workflowTemplateServiceClient.deleteWorkflowTemplateCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample for AutoscalingPolicyServiceClient: * + *
{@code + * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + * AutoscalingPolicyServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build(); + * AutoscalingPolicy response = + * autoscalingPolicyServiceClient.createAutoscalingPolicy(parent, policy); + * } + * }+ * *
======================= ClusterControllerClient ======================= * *
Service Description: The ClusterControllerService provides methods to manage clusters of @@ -30,17 +40,45 @@ * *
Sample for ClusterControllerClient: * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * String projectId = "projectId-894832108"; + * String region = "region-934795532"; + * String clusterName = "clusterName-1141738587"; + * Cluster response = clusterControllerClient.getCluster(projectId, region, clusterName); + * } + * }+ * *
======================= JobControllerClient ======================= * *
Service Description: The JobController provides methods to manage jobs. * *
Sample for JobControllerClient: * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * String projectId = "projectId-894832108"; + * String region = "region-934795532"; + * Job job = Job.newBuilder().build(); + * Job response = jobControllerClient.submitJob(projectId, region, job); + * } + * }+ * *
======================= WorkflowTemplateServiceClient ======================= * *
Service Description: The API interface for managing Workflow Templates in the Dataproc API. * *
Sample for WorkflowTemplateServiceClient: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * WorkflowTemplate template = WorkflowTemplate.newBuilder().build(); + * WorkflowTemplate response = + * workflowTemplateServiceClient.createWorkflowTemplate(parent, template); + * } + * }*/ @Generated("by gapic-generator-java") package com.google.cloud.dataproc.v1; diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/AutoscalingPolicyServiceClient.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/AutoscalingPolicyServiceClient.java index 4de0c395..dedaf8ce 100644 --- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/AutoscalingPolicyServiceClient.java +++ b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1beta2/AutoscalingPolicyServiceClient.java @@ -43,6 +43,16 @@ *
This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * + *
{@code + * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + * AutoscalingPolicyServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build(); + * AutoscalingPolicy response = + * autoscalingPolicyServiceClient.createAutoscalingPolicy(parent, policy); + * } + * }+ * *
Note: close() needs to be called on the AutoscalingPolicyServiceClient object to clean up * resources such as threads. In the example above, try-with-resources is used, which automatically * calls close(). @@ -152,6 +162,18 @@ public AutoscalingPolicyServiceStub getStub() { /** * Creates new autoscaling policy. * + *
Sample code: + * + *
{@code + * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + * AutoscalingPolicyServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build(); + * AutoscalingPolicy response = + * autoscalingPolicyServiceClient.createAutoscalingPolicy(parent, policy); + * } + * }+ * * @param parent Required. The "resource name" of the region or location, as described in * https://cloud.google.com/apis/design/resource_names. *
Sample code: + * + *
{@code + * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + * AutoscalingPolicyServiceClient.create()) { + * RegionName parent = RegionName.of("[PROJECT]", "[REGION]"); + * AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build(); + * AutoscalingPolicy response = + * autoscalingPolicyServiceClient.createAutoscalingPolicy(parent, policy); + * } + * }+ * * @param parent Required. The "resource name" of the region or location, as described in * https://cloud.google.com/apis/design/resource_names. *
Sample code: + * + *
{@code + * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + * AutoscalingPolicyServiceClient.create()) { + * String parent = + * AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName( + * "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]") + * .toString(); + * AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build(); + * AutoscalingPolicy response = + * autoscalingPolicyServiceClient.createAutoscalingPolicy(parent, policy); + * } + * }+ * * @param parent Required. The "resource name" of the region or location, as described in * https://cloud.google.com/apis/design/resource_names. *
Sample code: + * + *
{@code + * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + * AutoscalingPolicyServiceClient.create()) { + * CreateAutoscalingPolicyRequest request = + * CreateAutoscalingPolicyRequest.newBuilder() + * .setParent( + * AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName( + * "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]") + * .toString()) + * .setPolicy(AutoscalingPolicy.newBuilder().build()) + * .build(); + * AutoscalingPolicy response = autoscalingPolicyServiceClient.createAutoscalingPolicy(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 */ @@ -244,6 +310,24 @@ public final AutoscalingPolicy createAutoscalingPolicy(CreateAutoscalingPolicyRe * Creates new autoscaling policy. * *
Sample code: + * + *
{@code + * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + * AutoscalingPolicyServiceClient.create()) { + * CreateAutoscalingPolicyRequest request = + * CreateAutoscalingPolicyRequest.newBuilder() + * .setParent( + * AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName( + * "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]") + * .toString()) + * .setPolicy(AutoscalingPolicy.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * autoscalingPolicyServiceClient.createAutoscalingPolicyCallable().futureCall(request); + * // Do something. + * AutoscalingPolicy response = future.get(); + * } + * }
Disabled check for update_mask, because all updates will be full replacements. * + *
Sample code: + * + *
{@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 */ @@ -271,6 +365,19 @@ public final AutoscalingPolicy updateAutoscalingPolicy(AutoscalingPolicy policy) * *
Disabled check for update_mask, because all updates will be full replacements. * + *
Sample code: + * + *
{@code + * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + * AutoscalingPolicyServiceClient.create()) { + * UpdateAutoscalingPolicyRequest request = + * UpdateAutoscalingPolicyRequest.newBuilder() + * .setPolicy(AutoscalingPolicy.newBuilder().build()) + * .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 */ @@ -285,6 +392,20 @@ public final AutoscalingPolicy updateAutoscalingPolicy(UpdateAutoscalingPolicyRe *
Disabled check for update_mask, because all updates will be full replacements. * *
Sample code: + * + *
{@code + * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + * AutoscalingPolicyServiceClient.create()) { + * UpdateAutoscalingPolicyRequest request = + * UpdateAutoscalingPolicyRequest.newBuilder() + * .setPolicy(AutoscalingPolicy.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * autoscalingPolicyServiceClient.updateAutoscalingPolicyCallable().futureCall(request); + * // Do something. + * AutoscalingPolicy response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + * AutoscalingPolicyServiceClient.create()) { + * AutoscalingPolicyName name = + * AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName( + * "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]"); + * AutoscalingPolicy response = autoscalingPolicyServiceClient.getAutoscalingPolicy(name); + * } + * }+ * * @param name Required. The "resource name" of the autoscaling policy, as described in * https://cloud.google.com/apis/design/resource_names. *
Sample code: + * + *
{@code + * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + * AutoscalingPolicyServiceClient.create()) { + * String name = + * AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName( + * "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]") + * .toString(); + * AutoscalingPolicy response = autoscalingPolicyServiceClient.getAutoscalingPolicy(name); + * } + * }+ * * @param name Required. The "resource name" of the autoscaling policy, as described in * https://cloud.google.com/apis/design/resource_names. *
Sample code: + * + *
{@code + * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + * AutoscalingPolicyServiceClient.create()) { + * GetAutoscalingPolicyRequest request = + * GetAutoscalingPolicyRequest.newBuilder() + * .setName( + * AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName( + * "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]") + * .toString()) + * .build(); + * AutoscalingPolicy response = autoscalingPolicyServiceClient.getAutoscalingPolicy(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 */ @@ -359,6 +521,23 @@ public final AutoscalingPolicy getAutoscalingPolicy(GetAutoscalingPolicyRequest * Retrieves autoscaling policy. * *
Sample code: + * + *
{@code + * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + * AutoscalingPolicyServiceClient.create()) { + * GetAutoscalingPolicyRequest request = + * GetAutoscalingPolicyRequest.newBuilder() + * .setName( + * AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName( + * "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]") + * .toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * autoscalingPolicyServiceClient.getAutoscalingPolicyCallable().futureCall(request); + * // Do something. + * AutoscalingPolicy response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + * AutoscalingPolicyServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * for (AutoscalingPolicy element : + * autoscalingPolicyServiceClient.listAutoscalingPolicies(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. The "resource name" of the region or location, as described in * https://cloud.google.com/apis/design/resource_names. *
Sample code: + * + *
{@code + * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + * AutoscalingPolicyServiceClient.create()) { + * RegionName parent = RegionName.of("[PROJECT]", "[REGION]"); + * for (AutoscalingPolicy element : + * autoscalingPolicyServiceClient.listAutoscalingPolicies(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. The "resource name" of the region or location, as described in * https://cloud.google.com/apis/design/resource_names. *
Sample code: + * + *
{@code + * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + * AutoscalingPolicyServiceClient.create()) { + * String parent = + * AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName( + * "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]") + * .toString(); + * for (AutoscalingPolicy element : + * autoscalingPolicyServiceClient.listAutoscalingPolicies(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. The "resource name" of the region or location, as described in * https://cloud.google.com/apis/design/resource_names. *
Sample code: + * + *
{@code + * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + * AutoscalingPolicyServiceClient.create()) { + * ListAutoscalingPoliciesRequest request = + * ListAutoscalingPoliciesRequest.newBuilder() + * .setParent( + * AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName( + * "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]") + * .toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (AutoscalingPolicy element : + * autoscalingPolicyServiceClient.listAutoscalingPolicies(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -455,6 +697,27 @@ public final ListAutoscalingPoliciesPagedResponse listAutoscalingPolicies( * Lists autoscaling policies in the project. * *
Sample code: + * + *
{@code + * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + * AutoscalingPolicyServiceClient.create()) { + * ListAutoscalingPoliciesRequest request = + * ListAutoscalingPoliciesRequest.newBuilder() + * .setParent( + * AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName( + * "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]") + * .toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * autoscalingPolicyServiceClient.listAutoscalingPoliciesPagedCallable().futureCall(request); + * // Do something. + * for (AutoscalingPolicy element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + * AutoscalingPolicyServiceClient.create()) { + * while (true) { + * ListAutoscalingPoliciesResponse response = + * autoscalingPolicyServiceClient.listAutoscalingPoliciesCallable().call(request); + * for (AutoscalingPolicy element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
Sample code: + * + *
{@code + * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + * AutoscalingPolicyServiceClient.create()) { + * AutoscalingPolicyName name = + * AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName( + * "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]"); + * autoscalingPolicyServiceClient.deleteAutoscalingPolicy(name); + * } + * }+ * * @param name Required. The "resource name" of the autoscaling policy, as described in * https://cloud.google.com/apis/design/resource_names. *
Sample code: + * + *
{@code + * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + * AutoscalingPolicyServiceClient.create()) { + * String name = + * AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName( + * "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]") + * .toString(); + * autoscalingPolicyServiceClient.deleteAutoscalingPolicy(name); + * } + * }+ * * @param name Required. The "resource name" of the autoscaling policy, as described in * https://cloud.google.com/apis/design/resource_names. *
Sample code: + * + *
{@code + * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + * AutoscalingPolicyServiceClient.create()) { + * DeleteAutoscalingPolicyRequest request = + * DeleteAutoscalingPolicyRequest.newBuilder() + * .setName( + * AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName( + * "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]") + * .toString()) + * .build(); + * autoscalingPolicyServiceClient.deleteAutoscalingPolicy(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 */ @@ -544,6 +867,23 @@ public final void deleteAutoscalingPolicy(DeleteAutoscalingPolicyRequest request * one or more clusters. * *
Sample code: + * + *
{@code + * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + * AutoscalingPolicyServiceClient.create()) { + * DeleteAutoscalingPolicyRequest request = + * DeleteAutoscalingPolicyRequest.newBuilder() + * .setName( + * AutoscalingPolicyName.ofProjectLocationAutoscalingPolicyName( + * "[PROJECT]", "[LOCATION]", "[AUTOSCALING_POLICY]") + * .toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * autoscalingPolicyServiceClient.deleteAutoscalingPolicyCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * String projectId = "projectId-894832108"; + * String region = "region-934795532"; + * String clusterName = "clusterName-1141738587"; + * Cluster response = clusterControllerClient.getCluster(projectId, region, clusterName); + * } + * }+ * *
Note: close() needs to be called on the ClusterControllerClient object to clean up resources * such as threads. In the example above, try-with-resources is used, which automatically calls * close(). @@ -168,6 +177,18 @@ public final OperationsClient getOperationsClient() { * [Operation.metadata][google.longrunning.Operation.metadata] will be * [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#clusteroperationmetadata). * + *
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * String projectId = "projectId-894832108"; + * String region = "region-934795532"; + * Cluster cluster = Cluster.newBuilder().build(); + * Cluster response = + * clusterControllerClient.createClusterAsync(projectId, region, cluster).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. @@ -191,6 +212,21 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * CreateClusterRequest request = + * CreateClusterRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setCluster(Cluster.newBuilder().build()) + * .setRequestId("requestId693933066") + * .build(); + * Cluster response = clusterControllerClient.createClusterAsync(request).get(); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -206,6 +242,22 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * CreateClusterRequest request = + * CreateClusterRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setCluster(Cluster.newBuilder().build()) + * .setRequestId("requestId693933066") + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * clusterControllerClient.createClusterOperationCallable().futureCall(request); + * // Do something. + * Cluster response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * CreateClusterRequest request = + * CreateClusterRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setCluster(Cluster.newBuilder().build()) + * .setRequestId("requestId693933066") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * clusterControllerClient.createClusterCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * String projectId = "projectId-894832108"; + * String region = "region-934795532"; + * String clusterName = "clusterName-1141738587"; + * Cluster cluster = Cluster.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * Cluster response = + * clusterControllerClient + * .updateClusterAsync(projectId, region, clusterName, cluster, updateMask) + * .get(); + * } + * }+ * * @param projectId Required. The ID of the Google Cloud Platform project the cluster belongs to. * @param region Required. The Dataproc region in which to handle the request. * @param clusterName Required. The cluster name. @@ -281,6 +365,24 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * UpdateClusterRequest request = + * UpdateClusterRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setClusterName("clusterName-1141738587") + * .setCluster(Cluster.newBuilder().build()) + * .setGracefulDecommissionTimeout(Duration.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .setRequestId("requestId693933066") + * .build(); + * Cluster response = clusterControllerClient.updateClusterAsync(request).get(); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -296,6 +398,25 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * UpdateClusterRequest request = + * UpdateClusterRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setClusterName("clusterName-1141738587") + * .setCluster(Cluster.newBuilder().build()) + * .setGracefulDecommissionTimeout(Duration.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .setRequestId("requestId693933066") + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * clusterControllerClient.updateClusterOperationCallable().futureCall(request); + * // Do something. + * Cluster response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * UpdateClusterRequest request = + * UpdateClusterRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setClusterName("clusterName-1141738587") + * .setCluster(Cluster.newBuilder().build()) + * .setGracefulDecommissionTimeout(Duration.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .setRequestId("requestId693933066") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * clusterControllerClient.updateClusterCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * String projectId = "projectId-894832108"; + * String region = "region-934795532"; + * String clusterName = "clusterName-1141738587"; + * clusterControllerClient.deleteClusterAsync(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. @@ -343,6 +494,22 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * DeleteClusterRequest request = + * DeleteClusterRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setClusterName("clusterName-1141738587") + * .setClusterUuid("clusterUuid-1141510955") + * .setRequestId("requestId693933066") + * .build(); + * clusterControllerClient.deleteClusterAsync(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 */ @@ -358,6 +525,23 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * DeleteClusterRequest request = + * DeleteClusterRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setClusterName("clusterName-1141738587") + * .setClusterUuid("clusterUuid-1141510955") + * .setRequestId("requestId693933066") + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * clusterControllerClient.deleteClusterOperationCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * DeleteClusterRequest request = + * DeleteClusterRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setClusterName("clusterName-1141738587") + * .setClusterUuid("clusterUuid-1141510955") + * .setRequestId("requestId693933066") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * clusterControllerClient.deleteClusterCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * String projectId = "projectId-894832108"; + * String region = "region-934795532"; + * String clusterName = "clusterName-1141738587"; + * Cluster response = clusterControllerClient.getCluster(projectId, region, clusterName); + * } + * }+ * * @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. @@ -400,6 +612,20 @@ public final Cluster getCluster(String projectId, String region, String clusterN /** * Gets the resource representation for a cluster in a project. * + *
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * GetClusterRequest request = + * GetClusterRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setClusterName("clusterName-1141738587") + * .build(); + * Cluster response = clusterControllerClient.getCluster(request); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -412,6 +638,20 @@ public final Cluster getCluster(GetClusterRequest request) { * Gets the resource representation for a cluster in a project. * *
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * GetClusterRequest request = + * GetClusterRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setClusterName("clusterName-1141738587") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = clusterControllerClient.getClusterCallable().futureCall(request); + * // Do something. + * Cluster response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * String projectId = "projectId-894832108"; + * String region = "region-934795532"; + * for (Cluster element : clusterControllerClient.listClusters(projectId, region).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @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. @@ -436,6 +688,20 @@ public final ListClustersPagedResponse listClusters(String projectId, String reg /** * Lists all regions/{region}/clusters in a project alphabetically. * + *
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * String projectId = "projectId-894832108"; + * String region = "region-934795532"; + * String filter = "filter-1274492040"; + * for (Cluster element : + * clusterControllerClient.listClusters(projectId, region, filter).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @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. @@ -470,6 +736,24 @@ public final ListClustersPagedResponse listClusters( /** * Lists all regions/{region}/clusters in a project alphabetically. * + *
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * ListClustersRequest request = + * ListClustersRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (Cluster element : clusterControllerClient.listClusters(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -482,6 +766,25 @@ public final ListClustersPagedResponse listClusters(ListClustersRequest request) * Lists all regions/{region}/clusters in a project alphabetically. * *
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * ListClustersRequest request = + * ListClustersRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * clusterControllerClient.listClustersPagedCallable().futureCall(request); + * // Do something. + * for (Cluster element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * while (true) { + * ListClustersResponse response = + * clusterControllerClient.listClustersCallable().call(request); + * for (Cluster element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * String projectId = "projectId-894832108"; + * String region = "region-934795532"; + * String clusterName = "clusterName-1141738587"; + * 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. @@ -531,6 +863,20 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * DiagnoseClusterRequest request = + * DiagnoseClusterRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setClusterName("clusterName-1141738587") + * .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 */ @@ -548,6 +894,21 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * DiagnoseClusterRequest request = + * DiagnoseClusterRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setClusterName("clusterName-1141738587") + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * clusterControllerClient.diagnoseClusterOperationCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * DiagnoseClusterRequest request = + * DiagnoseClusterRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setClusterName("clusterName-1141738587") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * clusterControllerClient.diagnoseClusterCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * String projectId = "projectId-894832108"; + * String region = "region-934795532"; + * Job job = Job.newBuilder().build(); + * Job response = jobControllerClient.submitJob(projectId, region, job); + * } + * }+ * *
Note: close() needs to be called on the JobControllerClient object to clean up resources such * as threads. In the example above, try-with-resources is used, which automatically calls close(). * @@ -161,6 +170,17 @@ public final OperationsClient getOperationsClient() { /** * Submits a job to a cluster. * + *
Sample code: + * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * String projectId = "projectId-894832108"; + * String region = "region-934795532"; + * Job job = Job.newBuilder().build(); + * Job response = jobControllerClient.submitJob(projectId, region, job); + * } + * }+ * * @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. @@ -176,6 +196,21 @@ public final Job submitJob(String projectId, String region, Job job) { /** * Submits a job to a cluster. * + *
Sample code: + * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * SubmitJobRequest request = + * SubmitJobRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setJob(Job.newBuilder().build()) + * .setRequestId("requestId693933066") + * .build(); + * Job response = jobControllerClient.submitJob(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 */ @@ -188,6 +223,21 @@ public final Job submitJob(SubmitJobRequest request) { * Submits a job to a cluster. * *
Sample code: + * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * SubmitJobRequest request = + * SubmitJobRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setJob(Job.newBuilder().build()) + * .setRequestId("requestId693933066") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = jobControllerClient.submitJobCallable().futureCall(request); + * // Do something. + * Job response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * String projectId = "projectId-894832108"; + * String region = "region-934795532"; + * 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. @@ -213,6 +274,21 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * SubmitJobRequest request = + * SubmitJobRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setJob(Job.newBuilder().build()) + * .setRequestId("requestId693933066") + * .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 */ @@ -226,6 +302,22 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * SubmitJobRequest request = + * SubmitJobRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setJob(Job.newBuilder().build()) + * .setRequestId("requestId693933066") + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * jobControllerClient.submitJobAsOperationOperationCallable().futureCall(request); + * // Do something. + * Job response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * SubmitJobRequest request = + * SubmitJobRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setJob(Job.newBuilder().build()) + * .setRequestId("requestId693933066") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * jobControllerClient.submitJobAsOperationCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * String projectId = "projectId-894832108"; + * String region = "region-934795532"; + * String jobId = "jobId101296568"; + * Job response = jobControllerClient.getJob(projectId, region, jobId); + * } + * }+ * * @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 jobId Required. The job ID. @@ -265,6 +384,20 @@ public final Job getJob(String projectId, String region, String jobId) { /** * Gets the resource representation for a job in a project. * + *
Sample code: + * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * GetJobRequest request = + * GetJobRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setJobId("jobId101296568") + * .build(); + * Job response = jobControllerClient.getJob(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 */ @@ -277,6 +410,20 @@ public final Job getJob(GetJobRequest request) { * Gets the resource representation for a job in a project. * *
Sample code: + * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * GetJobRequest request = + * GetJobRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setJobId("jobId101296568") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = jobControllerClient.getJobCallable().futureCall(request); + * // Do something. + * Job response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * String projectId = "projectId-894832108"; + * String region = "region-934795532"; + * for (Job element : jobControllerClient.listJobs(projectId, region).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @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. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -300,6 +459,19 @@ public final ListJobsPagedResponse listJobs(String projectId, String region) { /** * Lists regions/{region}/jobs in a project. * + *
Sample code: + * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * String projectId = "projectId-894832108"; + * String region = "region-934795532"; + * String filter = "filter-1274492040"; + * for (Job element : jobControllerClient.listJobs(projectId, region, filter).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @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 filter Optional. A filter constraining the jobs to list. Filters are case-sensitive and @@ -327,6 +499,25 @@ public final ListJobsPagedResponse listJobs(String projectId, String region, Str /** * Lists regions/{region}/jobs in a project. * + *
Sample code: + * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * ListJobsRequest request = + * ListJobsRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setClusterName("clusterName-1141738587") + * .setFilter("filter-1274492040") + * .build(); + * for (Job element : jobControllerClient.listJobs(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -339,6 +530,25 @@ public final ListJobsPagedResponse listJobs(ListJobsRequest request) { * Lists regions/{region}/jobs in a project. * *
Sample code: + * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * ListJobsRequest request = + * ListJobsRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setClusterName("clusterName-1141738587") + * .setFilter("filter-1274492040") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = jobControllerClient.listJobsPagedCallable().futureCall(request); + * // Do something. + * for (Job element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * while (true) { + * ListJobsResponse response = jobControllerClient.listJobsCallable().call(request); + * for (Job element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
Sample code: + * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * UpdateJobRequest request = + * UpdateJobRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setJobId("jobId101296568") + * .setJob(Job.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * Job response = jobControllerClient.updateJob(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 */ @@ -370,6 +613,22 @@ public final Job updateJob(UpdateJobRequest request) { * Updates a job in a project. * *
Sample code: + * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * UpdateJobRequest request = + * UpdateJobRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setJobId("jobId101296568") + * .setJob(Job.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = jobControllerClient.updateJobCallable().futureCall(request); + * // Do something. + * Job response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * String projectId = "projectId-894832108"; + * String region = "region-934795532"; + * String jobId = "jobId101296568"; + * Job response = jobControllerClient.cancelJob(projectId, region, jobId); + * } + * }+ * * @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 jobId Required. The job ID. @@ -404,6 +674,20 @@ public final Job cancelJob(String projectId, String region, String jobId) { * or * [regions/{region}/jobs.get](https://cloud.google.com/dataproc/docs/reference/rest/v1beta2/projects.regions.jobs/get). * + *
Sample code: + * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * CancelJobRequest request = + * CancelJobRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setJobId("jobId101296568") + * .build(); + * Job response = jobControllerClient.cancelJob(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 */ @@ -419,6 +703,20 @@ public final Job cancelJob(CancelJobRequest request) { * [regions/{region}/jobs.get](https://cloud.google.com/dataproc/docs/reference/rest/v1beta2/projects.regions.jobs/get). * *
Sample code: + * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * CancelJobRequest request = + * CancelJobRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setJobId("jobId101296568") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = jobControllerClient.cancelJobCallable().futureCall(request); + * // Do something. + * Job response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * String projectId = "projectId-894832108"; + * String region = "region-934795532"; + * String jobId = "jobId101296568"; + * jobControllerClient.deleteJob(projectId, region, jobId); + * } + * }+ * * @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 jobId Required. The job ID. @@ -449,6 +758,20 @@ public final void deleteJob(String projectId, String region, String jobId) { * Deletes the job from the project. If the job is active, the delete fails, and the response * returns `FAILED_PRECONDITION`. * + *
Sample code: + * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * DeleteJobRequest request = + * DeleteJobRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setJobId("jobId101296568") + * .build(); + * jobControllerClient.deleteJob(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 */ @@ -462,6 +785,20 @@ public final void deleteJob(DeleteJobRequest request) { * returns `FAILED_PRECONDITION`. * *
Sample code: + * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * DeleteJobRequest request = + * DeleteJobRequest.newBuilder() + * .setProjectId("projectId-894832108") + * .setRegion("region-934795532") + * .setJobId("jobId101296568") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = jobControllerClient.deleteJobCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * WorkflowTemplate template = WorkflowTemplate.newBuilder().build(); + * WorkflowTemplate response = + * workflowTemplateServiceClient.createWorkflowTemplate(parent, template); + * } + * }+ * *
Note: close() needs to be called on the WorkflowTemplateServiceClient object to clean up * resources such as threads. In the example above, try-with-resources is used, which automatically * calls close(). @@ -166,6 +176,18 @@ public final OperationsClient getOperationsClient() { /** * Creates new workflow template. * + *
Sample code: + * + *
{@code + * 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. *
Sample code: + * + *
{@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. *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * String parent = + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]") + * .toString(); + * 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. *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * CreateWorkflowTemplateRequest request = + * CreateWorkflowTemplateRequest.newBuilder() + * .setParent( + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]") + * .toString()) + * .setTemplate(WorkflowTemplate.newBuilder().build()) + * .build(); + * WorkflowTemplate response = workflowTemplateServiceClient.createWorkflowTemplate(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 */ @@ -258,6 +324,24 @@ public final WorkflowTemplate createWorkflowTemplate(CreateWorkflowTemplateReque * Creates new workflow template. * *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * CreateWorkflowTemplateRequest request = + * CreateWorkflowTemplateRequest.newBuilder() + * .setParent( + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]") + * .toString()) + * .setTemplate(WorkflowTemplate.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * workflowTemplateServiceClient.createWorkflowTemplateCallable().futureCall(request); + * // Do something. + * WorkflowTemplate response = future.get(); + * } + * }
Can retrieve previously instantiated template by specifying optional version parameter. * + *
Sample code: + * + *
{@code + * 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. *
Can retrieve previously instantiated template by specifying optional version parameter. * + *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * String name = + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]") + * .toString(); + * 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. *
Can retrieve previously instantiated template by specifying optional version parameter. * + *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * GetWorkflowTemplateRequest request = + * GetWorkflowTemplateRequest.newBuilder() + * .setName( + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]") + * .toString()) + * .setVersion(351608024) + * .build(); + * WorkflowTemplate response = workflowTemplateServiceClient.getWorkflowTemplate(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 */ @@ -340,6 +466,24 @@ public final WorkflowTemplate getWorkflowTemplate(GetWorkflowTemplateRequest req *
Can retrieve previously instantiated template by specifying optional version parameter. * *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * GetWorkflowTemplateRequest request = + * GetWorkflowTemplateRequest.newBuilder() + * .setName( + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]") + * .toString()) + * .setVersion(351608024) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * workflowTemplateServiceClient.getWorkflowTemplateCallable().futureCall(request); + * // Do something. + * WorkflowTemplate response = future.get(); + * } + * }
On successful completion, [Operation.response][google.longrunning.Operation.response] will * be [Empty][google.protobuf.Empty]. * + *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * WorkflowTemplateName name = + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]"); + * workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name).get(); + * } + * }+ * * @param name Required. The resource name of the workflow template, as described in * https://cloud.google.com/apis/design/resource_names. *
On successful completion, [Operation.response][google.longrunning.Operation.response] will * be [Empty][google.protobuf.Empty]. * + *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * String name = + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]") + * .toString(); + * workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name).get(); + * } + * }+ * * @param name Required. The resource name of the workflow template, as described in * https://cloud.google.com/apis/design/resource_names. *
On successful completion, [Operation.response][google.longrunning.Operation.response] will * be [Empty][google.protobuf.Empty]. * + *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * WorkflowTemplateName name = + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]"); + * Map+ * * @param name Required. The resource name of the workflow template, as described in * https://cloud.google.com/apis/design/resource_names. *parameters = new HashMap<>(); + * workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name, parameters).get(); + * } + * }
On successful completion, [Operation.response][google.longrunning.Operation.response] will * be [Empty][google.protobuf.Empty]. * + *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * String name = + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]") + * .toString(); + * Map+ * * @param name Required. The resource name of the workflow template, as described in * https://cloud.google.com/apis/design/resource_names. *parameters = new HashMap<>(); + * workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name, parameters).get(); + * } + * }
On successful completion, [Operation.response][google.longrunning.Operation.response] will * be [Empty][google.protobuf.Empty]. * + *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * InstantiateWorkflowTemplateRequest request = + * InstantiateWorkflowTemplateRequest.newBuilder() + * .setName( + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]") + * .toString()) + * .setVersion(351608024) + * .setInstanceId("instanceId902024336") + * .setRequestId("requestId693933066") + * .putAllParameters(new HashMap+ * * @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 */ @@ -575,6 +791,29 @@ public final OperationFuture()) + * .build(); + * workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(request).get(); + * } + * }
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * InstantiateWorkflowTemplateRequest request = + * InstantiateWorkflowTemplateRequest.newBuilder() + * .setName( + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]") + * .toString()) + * .setVersion(351608024) + * .setInstanceId("instanceId902024336") + * .setRequestId("requestId693933066") + * .putAllParameters(new HashMap*/ public final OperationCallable()) + * .build(); + * OperationFuture future = + * workflowTemplateServiceClient + * .instantiateWorkflowTemplateOperationCallable() + * .futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * InstantiateWorkflowTemplateRequest request = + * InstantiateWorkflowTemplateRequest.newBuilder() + * .setName( + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]") + * .toString()) + * .setVersion(351608024) + * .setInstanceId("instanceId902024336") + * .setRequestId("requestId693933066") + * .putAllParameters(new HashMap*/ public final UnaryCallable()) + * .build(); + * ApiFuture future = + * workflowTemplateServiceClient.instantiateWorkflowTemplateCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
On successful completion, [Operation.response][google.longrunning.Operation.response] will * be [Empty][google.protobuf.Empty]. * + *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * WorkflowTemplate template = WorkflowTemplate.newBuilder().build(); + * workflowTemplateServiceClient.instantiateInlineWorkflowTemplateAsync(parent, template).get(); + * } + * }+ * * @param parent Required. The resource name of the region or location, as described in * https://cloud.google.com/apis/design/resource_names. *
On successful completion, [Operation.response][google.longrunning.Operation.response] will * be [Empty][google.protobuf.Empty]. * + *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * RegionName parent = RegionName.of("[PROJECT]", "[REGION]"); + * WorkflowTemplate template = WorkflowTemplate.newBuilder().build(); + * workflowTemplateServiceClient.instantiateInlineWorkflowTemplateAsync(parent, template).get(); + * } + * }+ * * @param parent Required. The resource name of the region or location, as described in * https://cloud.google.com/apis/design/resource_names. *
On successful completion, [Operation.response][google.longrunning.Operation.response] will * be [Empty][google.protobuf.Empty]. * + *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * String parent = + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]") + * .toString(); + * WorkflowTemplate template = WorkflowTemplate.newBuilder().build(); + * workflowTemplateServiceClient.instantiateInlineWorkflowTemplateAsync(parent, template).get(); + * } + * }+ * * @param parent Required. The resource name of the region or location, as described in * https://cloud.google.com/apis/design/resource_names. *
On successful completion, [Operation.response][google.longrunning.Operation.response] will * be [Empty][google.protobuf.Empty]. * + *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * InstantiateInlineWorkflowTemplateRequest request = + * InstantiateInlineWorkflowTemplateRequest.newBuilder() + * .setParent( + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]") + * .toString()) + * .setTemplate(WorkflowTemplate.newBuilder().build()) + * .setInstanceId("instanceId902024336") + * .setRequestId("requestId693933066") + * .build(); + * 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 */ @@ -814,6 +1129,28 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * InstantiateInlineWorkflowTemplateRequest request = + * InstantiateInlineWorkflowTemplateRequest.newBuilder() + * .setParent( + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]") + * .toString()) + * .setTemplate(WorkflowTemplate.newBuilder().build()) + * .setInstanceId("instanceId902024336") + * .setRequestId("requestId693933066") + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * workflowTemplateServiceClient + * .instantiateInlineWorkflowTemplateOperationCallable() + * .futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * InstantiateInlineWorkflowTemplateRequest request = + * InstantiateInlineWorkflowTemplateRequest.newBuilder() + * .setParent( + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]") + * .toString()) + * .setTemplate(WorkflowTemplate.newBuilder().build()) + * .setInstanceId("instanceId902024336") + * .setRequestId("requestId693933066") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * workflowTemplateServiceClient + * .instantiateInlineWorkflowTemplateCallable() + * .futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * WorkflowTemplate template = WorkflowTemplate.newBuilder().build(); + * WorkflowTemplate response = workflowTemplateServiceClient.updateWorkflowTemplate(template); + * } + * }+ * * @param template Required. The updated workflow template. *
The `template.version` field must match the current version. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -872,6 +1241,19 @@ public final WorkflowTemplate updateWorkflowTemplate(WorkflowTemplate template) * Updates (replaces) workflow template. The updated template must contain version that matches * the current server version. * + *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * UpdateWorkflowTemplateRequest request = + * UpdateWorkflowTemplateRequest.newBuilder() + * .setTemplate(WorkflowTemplate.newBuilder().build()) + * .build(); + * WorkflowTemplate response = workflowTemplateServiceClient.updateWorkflowTemplate(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 */ @@ -885,6 +1267,20 @@ public final WorkflowTemplate updateWorkflowTemplate(UpdateWorkflowTemplateReque * the current server version. * *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * UpdateWorkflowTemplateRequest request = + * UpdateWorkflowTemplateRequest.newBuilder() + * .setTemplate(WorkflowTemplate.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * workflowTemplateServiceClient.updateWorkflowTemplateCallable().futureCall(request); + * // Do something. + * WorkflowTemplate response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * for (WorkflowTemplate element : + * workflowTemplateServiceClient.listWorkflowTemplates(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. The resource name of the region or location, as described in * https://cloud.google.com/apis/design/resource_names. *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * RegionName parent = RegionName.of("[PROJECT]", "[REGION]"); + * for (WorkflowTemplate element : + * workflowTemplateServiceClient.listWorkflowTemplates(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. The resource name of the region or location, as described in * https://cloud.google.com/apis/design/resource_names. *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * String parent = + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]") + * .toString(); + * for (WorkflowTemplate element : + * workflowTemplateServiceClient.listWorkflowTemplates(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. The resource name of the region or location, as described in * https://cloud.google.com/apis/design/resource_names. *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * ListWorkflowTemplatesRequest request = + * ListWorkflowTemplatesRequest.newBuilder() + * .setParent( + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]") + * .toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (WorkflowTemplate element : + * workflowTemplateServiceClient.listWorkflowTemplates(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -981,6 +1440,27 @@ public final ListWorkflowTemplatesPagedResponse listWorkflowTemplates( * Lists workflows that match the specified filter in the request. * *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * ListWorkflowTemplatesRequest request = + * ListWorkflowTemplatesRequest.newBuilder() + * .setParent( + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]") + * .toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * workflowTemplateServiceClient.listWorkflowTemplatesPagedCallable().futureCall(request); + * // Do something. + * for (WorkflowTemplate element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * while (true) { + * ListWorkflowTemplatesResponse response = + * workflowTemplateServiceClient.listWorkflowTemplatesCallable().call(request); + * for (WorkflowTemplate element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * WorkflowTemplateName name = + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]"); + * workflowTemplateServiceClient.deleteWorkflowTemplate(name); + * } + * }+ * * @param name Required. The resource name of the workflow template, as described in * https://cloud.google.com/apis/design/resource_names. *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * String name = + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]") + * .toString(); + * workflowTemplateServiceClient.deleteWorkflowTemplate(name); + * } + * }+ * * @param name Required. The resource name of the workflow template, as described in * https://cloud.google.com/apis/design/resource_names. *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * DeleteWorkflowTemplateRequest request = + * DeleteWorkflowTemplateRequest.newBuilder() + * .setName( + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]") + * .toString()) + * .setVersion(351608024) + * .build(); + * workflowTemplateServiceClient.deleteWorkflowTemplate(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 */ @@ -1066,6 +1607,24 @@ public final void deleteWorkflowTemplate(DeleteWorkflowTemplateRequest request) * Deletes a workflow template. It does not cancel in-progress workflows. * *
Sample code: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * DeleteWorkflowTemplateRequest request = + * DeleteWorkflowTemplateRequest.newBuilder() + * .setName( + * WorkflowTemplateName.ofProjectRegionWorkflowTemplateName( + * "[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]") + * .toString()) + * .setVersion(351608024) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * workflowTemplateServiceClient.deleteWorkflowTemplateCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample for AutoscalingPolicyServiceClient: * + *
{@code + * try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = + * AutoscalingPolicyServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * AutoscalingPolicy policy = AutoscalingPolicy.newBuilder().build(); + * AutoscalingPolicy response = + * autoscalingPolicyServiceClient.createAutoscalingPolicy(parent, policy); + * } + * }+ * *
======================= ClusterControllerClient ======================= * *
Service Description: The ClusterControllerService provides methods to manage clusters of @@ -31,17 +41,45 @@ * *
Sample for ClusterControllerClient: * + *
{@code + * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) { + * String projectId = "projectId-894832108"; + * String region = "region-934795532"; + * String clusterName = "clusterName-1141738587"; + * Cluster response = clusterControllerClient.getCluster(projectId, region, clusterName); + * } + * }+ * *
======================= JobControllerClient ======================= * *
Service Description: The JobController provides methods to manage jobs. * *
Sample for JobControllerClient: * + *
{@code + * try (JobControllerClient jobControllerClient = JobControllerClient.create()) { + * String projectId = "projectId-894832108"; + * String region = "region-934795532"; + * Job job = Job.newBuilder().build(); + * Job response = jobControllerClient.submitJob(projectId, region, job); + * } + * }+ * *
======================= WorkflowTemplateServiceClient ======================= * *
Service Description: The API interface for managing Workflow Templates in the Dataproc API. * *
Sample for WorkflowTemplateServiceClient: + * + *
{@code + * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = + * WorkflowTemplateServiceClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * WorkflowTemplate template = WorkflowTemplate.newBuilder().build(); + * WorkflowTemplate response = + * workflowTemplateServiceClient.createWorkflowTemplate(parent, template); + * } + * }*/ @Generated("by gapic-generator-java") package com.google.cloud.dataproc.v1beta2; diff --git a/synth.metadata b/synth.metadata index c97959fe..e1ece754 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,23 +4,23 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-dataproc.git", - "sha": "fb1262dc4e427d5cfb6196f24c00f865b7573bcd" + "sha": "24065636d88e9ac7818921717f8ed06e77cc2ebc" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "91e206bcfeaf8948ea03fe3cb1b7616108496cd3", - "internalRef": "350949863" + "sha": "8d8c008e56f1af31d57f75561e0f1848ffb29eeb", + "internalRef": "356341083" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "91e206bcfeaf8948ea03fe3cb1b7616108496cd3", - "internalRef": "350949863" + "sha": "8d8c008e56f1af31d57f75561e0f1848ffb29eeb", + "internalRef": "356341083" } }, {