diff --git a/.github/release-please.yml b/.github/release-please.yml
new file mode 100644
index 00000000..7bf58076
--- /dev/null
+++ b/.github/release-please.yml
@@ -0,0 +1,8 @@
+bumpMinorPreMajor: true
+handleGHRelease: true
+releaseType: java-yoshi
+branches:
+ - bumpMinorPreMajor: true
+ handleGHRelease: true
+ releaseType: java-yoshi
+ branch: java7
diff --git a/.github/release-trigger.yml b/.github/release-trigger.yml
new file mode 100644
index 00000000..67c70eb2
--- /dev/null
+++ b/.github/release-trigger.yml
@@ -0,0 +1,2 @@
+enabled: true
+multiScmName: java-dataproc
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
new file mode 100644
index 00000000..2add2547
--- /dev/null
+++ b/CODE_OF_CONDUCT.md
@@ -0,0 +1,94 @@
+
+# Code of Conduct
+
+## Our Pledge
+
+In the interest of fostering an open and welcoming environment, we as
+contributors and maintainers pledge to making participation in our project and
+our community a harassment-free experience for everyone, regardless of age, body
+size, disability, ethnicity, gender identity and expression, level of
+experience, education, socio-economic status, nationality, personal appearance,
+race, religion, or sexual identity and orientation.
+
+## Our Standards
+
+Examples of behavior that contributes to creating a positive environment
+include:
+
+* Using welcoming and inclusive language
+* Being respectful of differing viewpoints and experiences
+* Gracefully accepting constructive criticism
+* Focusing on what is best for the community
+* Showing empathy towards other community members
+
+Examples of unacceptable behavior by participants include:
+
+* The use of sexualized language or imagery and unwelcome sexual attention or
+ advances
+* Trolling, insulting/derogatory comments, and personal or political attacks
+* Public or private harassment
+* Publishing others' private information, such as a physical or electronic
+ address, without explicit permission
+* Other conduct which could reasonably be considered inappropriate in a
+ professional setting
+
+## Our Responsibilities
+
+Project maintainers are responsible for clarifying the standards of acceptable
+behavior and are expected to take appropriate and fair corrective action in
+response to any instances of unacceptable behavior.
+
+Project maintainers have the right and responsibility to remove, edit, or reject
+comments, commits, code, wiki edits, issues, and other contributions that are
+not aligned to this Code of Conduct, or to ban temporarily or permanently any
+contributor for other behaviors that they deem inappropriate, threatening,
+offensive, or harmful.
+
+## Scope
+
+This Code of Conduct applies both within project spaces and in public spaces
+when an individual is representing the project or its community. Examples of
+representing a project or community include using an official project e-mail
+address, posting via an official social media account, or acting as an appointed
+representative at an online or offline event. Representation of a project may be
+further defined and clarified by project maintainers.
+
+This Code of Conduct also applies outside the project spaces when the Project
+Steward has a reasonable belief that an individual's behavior may have a
+negative impact on the project or its community.
+
+## Conflict Resolution
+
+We do not believe that all conflict is bad; healthy debate and disagreement
+often yield positive results. However, it is never okay to be disrespectful or
+to engage in behavior that violates the project’s code of conduct.
+
+If you see someone violating the code of conduct, you are encouraged to address
+the behavior directly with those involved. Many issues can be resolved quickly
+and easily, and this gives people more control over the outcome of their
+dispute. If you are unable to resolve the matter for any reason, or if the
+behavior is threatening or harassing, report it. We are dedicated to providing
+an environment where participants feel welcome and safe.
+
+Reports should be directed to *googleapis-stewards@google.com*, the
+Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to
+receive and address reported violations of the code of conduct. They will then
+work with a committee consisting of representatives from the Open Source
+Programs Office and the Google Open Source Strategy team. If for any reason you
+are uncomfortable reaching out to the Project Steward, please email
+opensource@google.com.
+
+We will investigate every complaint, but you may not receive a direct response.
+We will use our discretion in determining when and how to follow up on reported
+incidents, which may range from not taking action to permanent expulsion from
+the project and project-sponsored spaces. We will notify the accused of the
+report and provide them an opportunity to discuss it before any action is taken.
+The identity of the reporter will be omitted from the details of the report
+supplied to the accused. In potentially harmful situations, such as ongoing
+harassment or threats to anyone's safety, we may take action without notice.
+
+## Attribution
+
+This Code of Conduct is adapted from the Contributor Covenant, version 1.4,
+available at
+https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
\ No newline at end of file
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 00000000..b65dd279
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,92 @@
+# How to Contribute
+
+We'd love to accept your patches and contributions to this project. There are
+just a few small guidelines you need to follow.
+
+## Contributor License Agreement
+
+Contributions to this project must be accompanied by a Contributor License
+Agreement. You (or your employer) retain the copyright to your contribution;
+this simply gives us permission to use and redistribute your contributions as
+part of the project. Head over to
This class provides the ability to make remote calls to the backing service through method - * calls that map to API methods. Sample code to get started: - * - *
- *
- * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * String clusterName = "";
- * 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(). - * - *
The surface of this class includes several types of Java methods for each of the API's - * methods: - * - *
See the individual methods for example code. - * - *
Many parameters require resource names to be formatted in a particular way. To assist with - * these names, this class includes a format method for each type of name, and additionally a parse - * method to extract the individual identifiers contained within names that are returned. - * - *
This class can be customized by passing in a custom instance of ClusterControllerSettings to - * create(). For example: - * - *
To customize credentials: - * - *
- *
- * ClusterControllerSettings clusterControllerSettings =
- * ClusterControllerSettings.newBuilder()
- * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
- * .build();
- * ClusterControllerClient clusterControllerClient =
- * ClusterControllerClient.create(clusterControllerSettings);
- *
- *
- *
- * To customize the endpoint:
- *
- *
- *
- * ClusterControllerSettings clusterControllerSettings =
- * ClusterControllerSettings.newBuilder().setEndpoint(myEndpoint).build();
- * ClusterControllerClient clusterControllerClient =
- * ClusterControllerClient.create(clusterControllerSettings);
- *
- *
- */
-@Generated("by gapic-generator")
-@BetaApi
-public class ClusterControllerClient implements BackgroundResource {
- private final ClusterControllerSettings settings;
- private final ClusterControllerStub stub;
- private final OperationsClient operationsClient;
-
- /** Constructs an instance of ClusterControllerClient with default settings. */
- public static final ClusterControllerClient create() throws IOException {
- return create(ClusterControllerSettings.newBuilder().build());
- }
-
- /**
- * Constructs an instance of ClusterControllerClient, using the given settings. The channels are
- * created based on the settings passed in, or defaults for any settings that are not set.
- */
- public static final ClusterControllerClient create(ClusterControllerSettings settings)
- throws IOException {
- return new ClusterControllerClient(settings);
- }
-
- /**
- * Constructs an instance of ClusterControllerClient, using the given stub for making calls. This
- * is for advanced usage - prefer to use ClusterControllerSettings}.
- */
- @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
- public static final ClusterControllerClient create(ClusterControllerStub stub) {
- return new ClusterControllerClient(stub);
- }
-
- /**
- * Constructs an instance of ClusterControllerClient, using the given settings. This is protected
- * so that it is easy to make a subclass, but otherwise, the static factory methods should be
- * preferred.
- */
- protected ClusterControllerClient(ClusterControllerSettings settings) throws IOException {
- this.settings = settings;
- this.stub = ((ClusterControllerStubSettings) settings.getStubSettings()).createStub();
- this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
- }
-
- @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
- protected ClusterControllerClient(ClusterControllerStub stub) {
- this.settings = null;
- this.stub = stub;
- this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
- }
-
- public final ClusterControllerSettings getSettings() {
- return settings;
- }
-
- @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
- public ClusterControllerStub getStub() {
- return stub;
- }
-
- /**
- * Returns the OperationsClient that can be used to query the status of a long-running operation
- * returned by another API method call.
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationsClient getOperationsClient() {
- return operationsClient;
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Creates a cluster in a project. The returned
- * [Operation.metadata][google.longrunning.Operation.metadata] will be
- * [ClusterOperationMetadata](/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata).
- *
- * Sample code: - * - *
- * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * 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 Cloud Dataproc region in which to handle the request.
- * @param cluster Required. The cluster to create.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFutureSample code: - * - *
- * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * Cluster cluster = Cluster.newBuilder().build();
- * CreateClusterRequest request = CreateClusterRequest.newBuilder()
- * .setProjectId(projectId)
- * .setRegion(region)
- * .setCluster(cluster)
- * .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
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFutureSample code: - * - *
- * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * Cluster cluster = Cluster.newBuilder().build();
- * CreateClusterRequest request = CreateClusterRequest.newBuilder()
- * .setProjectId(projectId)
- * .setRegion(region)
- * .setCluster(cluster)
- * .build();
- * OperationFuture<Cluster, ClusterOperationMetadata> future = clusterControllerClient.createClusterOperationCallable().futureCall(request);
- * // Do something
- * Cluster response = future.get();
- * }
- *
- */
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
- public final OperationCallableSample code: - * - *
- * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * Cluster cluster = Cluster.newBuilder().build();
- * CreateClusterRequest request = CreateClusterRequest.newBuilder()
- * .setProjectId(projectId)
- * .setRegion(region)
- * .setCluster(cluster)
- * .build();
- * ApiFuture<Operation> future = clusterControllerClient.createClusterCallable().futureCall(request);
- * // Do something
- * Operation response = future.get();
- * }
- *
- */
- public final UnaryCallableSample code: - * - *
- * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * String clusterName = "";
- * 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 Cloud Dataproc region in which to handle the request.
- * @param clusterName Required. The cluster name.
- * @param cluster Required. The changes to the cluster.
- * @param updateMask Required. Specifies the path, relative to `Cluster`, of the field to update.
- * For example, to change the number of workers in a cluster to 5, the `update_mask` parameter
- * would be specified as `config.worker_config.num_instances`, and the `PATCH` request body
- * would specify the new value, as follows:
- * { "config":{ "workerConfig":{ "numInstances":"5" } } } Similarly, to change the number - * of preemptible workers in a cluster to 5, the `update_mask` parameter would be - * `config.secondary_worker_config.num_instances`, and the `PATCH` request body would be set - * as follows: - *
{ "config":{ "secondaryWorkerConfig":{ "numInstances":"5" } } } - * <strong>Note:</strong> Currently, only the following fields can be updated: - *
<table> <tbody> <tr>
- * <td><strong>Mask</strong></td>
- * <td><strong>Purpose</strong></td> </tr> <tr>
- * <td><strong><em>labels</em></strong></td>
- * <td>Update labels</td> </tr> <tr>
- * <td><strong><em>config.worker_config.num_instances</em></strong></td>
- * <td>Resize primary worker group</td> </tr> <tr>
- * <td><strong><em>config.secondary_worker_config.num_instances</em></strong></td>
- * <td>Resize secondary worker group</td> </tr> <tr>
- * <td>config.autoscaling_config.policy_uri</td><td>Use, stop using, or
- * change autoscaling policies</td> </tr> </tbody> </table>
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * field = value [AND [field = value]] ...
- * where **field** is one of `status.state`, `clusterName`, or
- * `labels.[KEY]`, and `[KEY]` is a label key. **value** can be `*` to
- * match all values. `status.state` can be one of the following: `ACTIVE`, `INACTIVE`,
- * `CREATING`, `RUNNING`, `ERROR`, `DELETING`, or `UPDATING`. `ACTIVE` contains the
- * `CREATING`, `UPDATING`, and `RUNNING` states. `INACTIVE` contains the `DELETING` and
- * `ERROR` states. `clusterName` is the name of the cluster provided at creation time. Only
- * the logical `AND` operator is supported; space-separated items are treated as having an
- * implicit `AND` operator.
- * Example filter:
- * status.state = ACTIVE AND clusterName = mycluster AND labels.env = staging AND
- * labels.starred = *
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final ListClustersPagedResponse listClusters(
- String projectId, String region, String filter) {
- ListClustersRequest request =
- ListClustersRequest.newBuilder()
- .setProjectId(projectId)
- .setRegion(region)
- .setFilter(filter)
- .build();
- return listClusters(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Lists all regions/{region}/clusters in a project.
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * The default instance has everything set to sensible defaults:
- *
- * The builder of this class is recursive, so contained classes are themselves builders. When
- * build() is called, the tree of builders is called to create the complete settings object.
- *
- * For example, to set the total timeout of getCluster to 30 seconds:
- *
- * Note: This method does not support applying settings to streaming methods.
- */
- public Builder applyToAllUnaryMethods(
- ApiFunction This class provides the ability to make remote calls to the backing service through method
- * calls that map to API methods. Sample code to get started:
- *
- * Note: close() needs to be called on the jobControllerClient object to clean up resources such
- * as threads. In the example above, try-with-resources is used, which automatically calls close().
- *
- * The surface of this class includes several types of Java methods for each of the API's
- * methods:
- *
- * See the individual methods for example code.
- *
- * Many parameters require resource names to be formatted in a particular way. To assist with
- * these names, this class includes a format method for each type of name, and additionally a parse
- * method to extract the individual identifiers contained within names that are returned.
- *
- * This class can be customized by passing in a custom instance of JobControllerSettings to
- * create(). For example:
- *
- * To customize credentials:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * [field = value] AND [field [= value]] ...
- * where **field** is `status.state` or `labels.[KEY]`, and `[KEY]` is a
- * label key. **value** can be `*` to match all values. `status.state` can
- * be either `ACTIVE` or `NON_ACTIVE`. Only the logical `AND` operator is supported;
- * space-separated items are treated as having an implicit `AND` operator.
- * Example filter:
- * status.state = ACTIVE AND labels.env = staging AND labels.starred = *
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final ListJobsPagedResponse listJobs(String projectId, String region, String filter) {
- ListJobsRequest request =
- ListJobsRequest.newBuilder()
- .setProjectId(projectId)
- .setRegion(region)
- .setFilter(filter)
- .build();
- return listJobs(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Lists regions/{region}/jobs in a project.
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * The default instance has everything set to sensible defaults:
- *
- * The builder of this class is recursive, so contained classes are themselves builders. When
- * build() is called, the tree of builders is called to create the complete settings object.
- *
- * For example, to set the total timeout of submitJob to 30 seconds:
- *
- * Note: This method does not support applying settings to streaming methods.
- */
- public Builder applyToAllUnaryMethods(
- ApiFunction This class provides the ability to make remote calls to the backing service through method
- * calls that map to API methods. Sample code to get started:
- *
- * Note: close() needs to be called on the workflowTemplateServiceClient object to clean up
- * resources such as threads. In the example above, try-with-resources is used, which automatically
- * calls close().
- *
- * The surface of this class includes several types of Java methods for each of the API's
- * methods:
- *
- * See the individual methods for example code.
- *
- * Many parameters require resource names to be formatted in a particular way. To assist with
- * these names, this class includes a format method for each type of name, and additionally a parse
- * method to extract the individual identifiers contained within names that are returned.
- *
- * This class can be customized by passing in a custom instance of
- * WorkflowTemplateServiceSettings to create(). For example:
- *
- * To customize credentials:
- *
- * Sample code:
- *
- * * For `projects.regions.workflowTemplates,create`, the resource name of the region
- * has the following format: `projects/{project_id}/regions/{region}`
- * * For `projects.locations.workflowTemplates.create`, the resource name of the
- * location has the following format: `projects/{project_id}/locations/{location}`
- * @param template Required. The Dataproc workflow template to create.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final WorkflowTemplate createWorkflowTemplate(
- RegionName parent, WorkflowTemplate template) {
-
- CreateWorkflowTemplateRequest request =
- CreateWorkflowTemplateRequest.newBuilder()
- .setParent(parent == null ? null : parent.toString())
- .setTemplate(template)
- .build();
- return createWorkflowTemplate(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Creates new workflow template.
- *
- * Sample code:
- *
- * * For `projects.regions.workflowTemplates,create`, the resource name of the region
- * has the following format: `projects/{project_id}/regions/{region}`
- * * For `projects.locations.workflowTemplates.create`, the resource name of the
- * location has the following format: `projects/{project_id}/locations/{location}`
- * @param template Required. The Dataproc workflow template to create.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final WorkflowTemplate createWorkflowTemplate(String parent, WorkflowTemplate template) {
-
- CreateWorkflowTemplateRequest request =
- CreateWorkflowTemplateRequest.newBuilder().setParent(parent).setTemplate(template).build();
- return createWorkflowTemplate(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Creates new workflow template.
- *
- * Sample code:
- *
- * Sample code:
- *
- * Can retrieve previously instantiated template by specifying optional version parameter.
- *
- * Sample code:
- *
- * * For `projects.regions.workflowTemplates.get`, the resource name of the template
- * has the following format:
- * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}`
- * * For `projects.locations.workflowTemplates.get`, the resource name of the template
- * has the following format:
- * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}`
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final WorkflowTemplate getWorkflowTemplate(WorkflowTemplateName name) {
-
- GetWorkflowTemplateRequest request =
- GetWorkflowTemplateRequest.newBuilder()
- .setName(name == null ? null : name.toString())
- .build();
- return getWorkflowTemplate(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Retrieves the latest workflow template.
- *
- * Can retrieve previously instantiated template by specifying optional version parameter.
- *
- * Sample code:
- *
- * * For `projects.regions.workflowTemplates.get`, the resource name of the template
- * has the following format:
- * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}`
- * * For `projects.locations.workflowTemplates.get`, the resource name of the template
- * has the following format:
- * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}`
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final WorkflowTemplate getWorkflowTemplate(String name) {
-
- GetWorkflowTemplateRequest request =
- GetWorkflowTemplateRequest.newBuilder().setName(name).build();
- return getWorkflowTemplate(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Retrieves the latest workflow template.
- *
- * Can retrieve previously instantiated template by specifying optional version parameter.
- *
- * Sample code:
- *
- * Can retrieve previously instantiated template by specifying optional version parameter.
- *
- * Sample code:
- *
- * The returned Operation can be used to track execution of workflow by polling
- * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when
- * entire workflow is finished.
- *
- * The running workflow can be aborted via
- * [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any
- * inflight jobs to be cancelled and workflow-owned clusters to be deleted.
- *
- * The [Operation.metadata][google.longrunning.Operation.metadata] will be
- * [WorkflowMetadata](/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata).
- * Also see [Using
- * WorkflowMetadata](/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).
- *
- * On successful completion, [Operation.response][google.longrunning.Operation.response] will
- * be [Empty][google.protobuf.Empty].
- *
- * Sample code:
- *
- * * For `projects.regions.workflowTemplates.instantiate`, the resource name of the
- * template has the following format:
- * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}`
- * * For `projects.locations.workflowTemplates.instantiate`, the resource name of the
- * template has the following format:
- * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}`
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture The returned Operation can be used to track execution of workflow by polling
- * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when
- * entire workflow is finished.
- *
- * The running workflow can be aborted via
- * [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any
- * inflight jobs to be cancelled and workflow-owned clusters to be deleted.
- *
- * The [Operation.metadata][google.longrunning.Operation.metadata] will be
- * [WorkflowMetadata](/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata).
- * Also see [Using
- * WorkflowMetadata](/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).
- *
- * On successful completion, [Operation.response][google.longrunning.Operation.response] will
- * be [Empty][google.protobuf.Empty].
- *
- * Sample code:
- *
- * * For `projects.regions.workflowTemplates.instantiate`, the resource name of the
- * template has the following format:
- * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}`
- * * For `projects.locations.workflowTemplates.instantiate`, the resource name of the
- * template has the following format:
- * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}`
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture The returned Operation can be used to track execution of workflow by polling
- * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when
- * entire workflow is finished.
- *
- * The running workflow can be aborted via
- * [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any
- * inflight jobs to be cancelled and workflow-owned clusters to be deleted.
- *
- * The [Operation.metadata][google.longrunning.Operation.metadata] will be
- * [WorkflowMetadata](/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata).
- * Also see [Using
- * WorkflowMetadata](/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).
- *
- * On successful completion, [Operation.response][google.longrunning.Operation.response] will
- * be [Empty][google.protobuf.Empty].
- *
- * Sample code:
- *
- * * For `projects.regions.workflowTemplates.instantiate`, the resource name of the
- * template has the following format:
- * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}`
- * * For `projects.locations.workflowTemplates.instantiate`, the resource name of the
- * template has the following format:
- * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}`
- * @param parameters Optional. Map from parameter names to values that should be used for those
- * parameters. Values may not exceed 100 characters.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture The returned Operation can be used to track execution of workflow by polling
- * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when
- * entire workflow is finished.
- *
- * The running workflow can be aborted via
- * [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any
- * inflight jobs to be cancelled and workflow-owned clusters to be deleted.
- *
- * The [Operation.metadata][google.longrunning.Operation.metadata] will be
- * [WorkflowMetadata](/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata).
- * Also see [Using
- * WorkflowMetadata](/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).
- *
- * On successful completion, [Operation.response][google.longrunning.Operation.response] will
- * be [Empty][google.protobuf.Empty].
- *
- * Sample code:
- *
- * * For `projects.regions.workflowTemplates.instantiate`, the resource name of the
- * template has the following format:
- * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}`
- * * For `projects.locations.workflowTemplates.instantiate`, the resource name of the
- * template has the following format:
- * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}`
- * @param parameters Optional. Map from parameter names to values that should be used for those
- * parameters. Values may not exceed 100 characters.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture The returned Operation can be used to track execution of workflow by polling
- * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when
- * entire workflow is finished.
- *
- * The running workflow can be aborted via
- * [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any
- * inflight jobs to be cancelled and workflow-owned clusters to be deleted.
- *
- * The [Operation.metadata][google.longrunning.Operation.metadata] will be
- * [WorkflowMetadata](/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata).
- * Also see [Using
- * WorkflowMetadata](/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).
- *
- * On successful completion, [Operation.response][google.longrunning.Operation.response] will
- * be [Empty][google.protobuf.Empty].
- *
- * Sample code:
- *
- * The returned Operation can be used to track execution of workflow by polling
- * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when
- * entire workflow is finished.
- *
- * The running workflow can be aborted via
- * [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any
- * inflight jobs to be cancelled and workflow-owned clusters to be deleted.
- *
- * The [Operation.metadata][google.longrunning.Operation.metadata] will be
- * [WorkflowMetadata](/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata).
- * Also see [Using
- * WorkflowMetadata](/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).
- *
- * On successful completion, [Operation.response][google.longrunning.Operation.response] will
- * be [Empty][google.protobuf.Empty].
- *
- * Sample code:
- *
- * The returned Operation can be used to track execution of workflow by polling
- * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when
- * entire workflow is finished.
- *
- * The running workflow can be aborted via
- * [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any
- * inflight jobs to be cancelled and workflow-owned clusters to be deleted.
- *
- * The [Operation.metadata][google.longrunning.Operation.metadata] will be
- * [WorkflowMetadata](/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata).
- * Also see [Using
- * WorkflowMetadata](/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).
- *
- * On successful completion, [Operation.response][google.longrunning.Operation.response] will
- * be [Empty][google.protobuf.Empty].
- *
- * Sample code:
- *
- * This method is equivalent to executing the sequence
- * [CreateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate],
- * [InstantiateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate],
- * [DeleteWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.DeleteWorkflowTemplate].
- *
- * The returned Operation can be used to track execution of workflow by polling
- * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when
- * entire workflow is finished.
- *
- * The running workflow can be aborted via
- * [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any
- * inflight jobs to be cancelled and workflow-owned clusters to be deleted.
- *
- * The [Operation.metadata][google.longrunning.Operation.metadata] will be
- * [WorkflowMetadata](/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata).
- * Also see [Using
- * WorkflowMetadata](/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).
- *
- * On successful completion, [Operation.response][google.longrunning.Operation.response] will
- * be [Empty][google.protobuf.Empty].
- *
- * Sample code:
- *
- * * For `projects.regions.workflowTemplates,instantiateinline`, the resource name of
- * the region has the following format: `projects/{project_id}/regions/{region}`
- * * For `projects.locations.workflowTemplates.instantiateinline`, the resource name of
- * the location has the following format: `projects/{project_id}/locations/{location}`
- * @param template Required. The workflow template to instantiate.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture This method is equivalent to executing the sequence
- * [CreateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate],
- * [InstantiateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate],
- * [DeleteWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.DeleteWorkflowTemplate].
- *
- * The returned Operation can be used to track execution of workflow by polling
- * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when
- * entire workflow is finished.
- *
- * The running workflow can be aborted via
- * [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any
- * inflight jobs to be cancelled and workflow-owned clusters to be deleted.
- *
- * The [Operation.metadata][google.longrunning.Operation.metadata] will be
- * [WorkflowMetadata](/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata).
- * Also see [Using
- * WorkflowMetadata](/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).
- *
- * On successful completion, [Operation.response][google.longrunning.Operation.response] will
- * be [Empty][google.protobuf.Empty].
- *
- * Sample code:
- *
- * * For `projects.regions.workflowTemplates,instantiateinline`, the resource name of
- * the region has the following format: `projects/{project_id}/regions/{region}`
- * * For `projects.locations.workflowTemplates.instantiateinline`, the resource name of
- * the location has the following format: `projects/{project_id}/locations/{location}`
- * @param template Required. The workflow template to instantiate.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture This method is equivalent to executing the sequence
- * [CreateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate],
- * [InstantiateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate],
- * [DeleteWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.DeleteWorkflowTemplate].
- *
- * The returned Operation can be used to track execution of workflow by polling
- * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when
- * entire workflow is finished.
- *
- * The running workflow can be aborted via
- * [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any
- * inflight jobs to be cancelled and workflow-owned clusters to be deleted.
- *
- * The [Operation.metadata][google.longrunning.Operation.metadata] will be
- * [WorkflowMetadata](/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata).
- * Also see [Using
- * WorkflowMetadata](/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).
- *
- * On successful completion, [Operation.response][google.longrunning.Operation.response] will
- * be [Empty][google.protobuf.Empty].
- *
- * Sample code:
- *
- * This method is equivalent to executing the sequence
- * [CreateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate],
- * [InstantiateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate],
- * [DeleteWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.DeleteWorkflowTemplate].
- *
- * The returned Operation can be used to track execution of workflow by polling
- * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when
- * entire workflow is finished.
- *
- * The running workflow can be aborted via
- * [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any
- * inflight jobs to be cancelled and workflow-owned clusters to be deleted.
- *
- * The [Operation.metadata][google.longrunning.Operation.metadata] will be
- * [WorkflowMetadata](/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata).
- * Also see [Using
- * WorkflowMetadata](/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).
- *
- * On successful completion, [Operation.response][google.longrunning.Operation.response] will
- * be [Empty][google.protobuf.Empty].
- *
- * Sample code:
- *
- * This method is equivalent to executing the sequence
- * [CreateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate],
- * [InstantiateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate],
- * [DeleteWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.DeleteWorkflowTemplate].
- *
- * The returned Operation can be used to track execution of workflow by polling
- * [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when
- * entire workflow is finished.
- *
- * The running workflow can be aborted via
- * [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any
- * inflight jobs to be cancelled and workflow-owned clusters to be deleted.
- *
- * The [Operation.metadata][google.longrunning.Operation.metadata] will be
- * [WorkflowMetadata](/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata).
- * Also see [Using
- * WorkflowMetadata](/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).
- *
- * On successful completion, [Operation.response][google.longrunning.Operation.response] will
- * be [Empty][google.protobuf.Empty].
- *
- * Sample code:
- *
- * Sample code:
- *
- * The `template.version` field must match the current version.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final WorkflowTemplate updateWorkflowTemplate(WorkflowTemplate template) {
-
- UpdateWorkflowTemplateRequest request =
- UpdateWorkflowTemplateRequest.newBuilder().setTemplate(template).build();
- return updateWorkflowTemplate(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Updates (replaces) workflow template. The updated template must contain version that matches
- * the current server version.
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * * For `projects.regions.workflowTemplates,list`, the resource name of the region has
- * the following format: `projects/{project_id}/regions/{region}`
- * * For `projects.locations.workflowTemplates.list`, the resource name of the location
- * has the following format: `projects/{project_id}/locations/{location}`
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final ListWorkflowTemplatesPagedResponse listWorkflowTemplates(RegionName parent) {
- ListWorkflowTemplatesRequest request =
- ListWorkflowTemplatesRequest.newBuilder()
- .setParent(parent == null ? null : parent.toString())
- .build();
- return listWorkflowTemplates(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Lists workflows that match the specified filter in the request.
- *
- * Sample code:
- *
- * * For `projects.regions.workflowTemplates,list`, the resource name of the region has
- * the following format: `projects/{project_id}/regions/{region}`
- * * For `projects.locations.workflowTemplates.list`, the resource name of the location
- * has the following format: `projects/{project_id}/locations/{location}`
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final ListWorkflowTemplatesPagedResponse listWorkflowTemplates(String parent) {
- ListWorkflowTemplatesRequest request =
- ListWorkflowTemplatesRequest.newBuilder().setParent(parent).build();
- return listWorkflowTemplates(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Lists workflows that match the specified filter in the request.
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * * For `projects.regions.workflowTemplates.delete`, the resource name of the template
- * has the following format:
- * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}`
- * * For `projects.locations.workflowTemplates.instantiate`, the resource name of the
- * template has the following format:
- * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}`
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final void deleteWorkflowTemplate(WorkflowTemplateName name) {
-
- DeleteWorkflowTemplateRequest request =
- DeleteWorkflowTemplateRequest.newBuilder()
- .setName(name == null ? null : name.toString())
- .build();
- deleteWorkflowTemplate(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes a workflow template. It does not cancel in-progress workflows.
- *
- * Sample code:
- *
- * * For `projects.regions.workflowTemplates.delete`, the resource name of the template
- * has the following format:
- * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}`
- * * For `projects.locations.workflowTemplates.instantiate`, the resource name of the
- * template has the following format:
- * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}`
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final void deleteWorkflowTemplate(String name) {
-
- DeleteWorkflowTemplateRequest request =
- DeleteWorkflowTemplateRequest.newBuilder().setName(name).build();
- deleteWorkflowTemplate(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes a workflow template. It does not cancel in-progress workflows.
- *
- * Sample code:
- *
- * Sample code:
- *
- * The default instance has everything set to sensible defaults:
- *
- * The builder of this class is recursive, so contained classes are themselves builders. When
- * build() is called, the tree of builders is called to create the complete settings object.
- *
- * For example, to set the total timeout of createWorkflowTemplate to 30 seconds:
- *
- * Note: This method does not support applying settings to streaming methods.
- */
- public Builder applyToAllUnaryMethods(
- ApiFunction The interfaces provided are listed below, along with usage samples.
- *
- * ======================= ClusterControllerClient =======================
- *
- * Service Description: The ClusterControllerService provides methods to manage clusters of
- * Compute Engine instances.
- *
- * Sample for ClusterControllerClient:
- *
- * Service Description: The JobController provides methods to manage jobs.
- *
- * Sample for JobControllerClient:
- *
- * Service Description: The API interface for managing Workflow Templates in the Cloud Dataproc
- * API.
- *
- * Sample for WorkflowTemplateServiceClient:
- *
- * This class is for advanced usage and reflects the underlying API directly.
- */
-@Generated("by gapic-generator")
-@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
-public abstract class ClusterControllerStub implements BackgroundResource {
-
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
- public OperationsStub getOperationsStub() {
- throw new UnsupportedOperationException("Not implemented: getOperationsStub()");
- }
-
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
- public OperationCallable The default instance has everything set to sensible defaults:
- *
- * The builder of this class is recursive, so contained classes are themselves builders. When
- * build() is called, the tree of builders is called to create the complete settings object.
- *
- * For example, to set the total timeout of getCluster to 30 seconds:
- *
- * Note: This method does not support applying settings to streaming methods.
- */
- public Builder applyToAllUnaryMethods(
- ApiFunction This class is for advanced usage.
- */
-@Generated("by gapic-generator")
-@BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
-public class GrpcClusterControllerCallableFactory implements GrpcStubCallableFactory {
- @Override
- public This class is for advanced usage and reflects the underlying API directly.
- */
-@Generated("by gapic-generator")
-@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
-public class GrpcClusterControllerStub extends ClusterControllerStub {
-
- private static final MethodDescriptor
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture
- * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * String clusterName = "";
- * Cluster cluster = Cluster.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * UpdateClusterRequest request = UpdateClusterRequest.newBuilder()
- * .setProjectId(projectId)
- * .setRegion(region)
- * .setClusterName(clusterName)
- * .setCluster(cluster)
- * .setUpdateMask(updateMask)
- * .build();
- * Cluster response = clusterControllerClient.updateClusterAsync(request).get();
- * }
- *
- */
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
- public final OperationCallable
- * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * String clusterName = "";
- * Cluster cluster = Cluster.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * UpdateClusterRequest request = UpdateClusterRequest.newBuilder()
- * .setProjectId(projectId)
- * .setRegion(region)
- * .setClusterName(clusterName)
- * .setCluster(cluster)
- * .setUpdateMask(updateMask)
- * .build();
- * OperationFuture<Cluster, ClusterOperationMetadata> future = clusterControllerClient.updateClusterOperationCallable().futureCall(request);
- * // Do something
- * Cluster response = future.get();
- * }
- *
- */
- public final UnaryCallable
- * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * String clusterName = "";
- * Cluster cluster = Cluster.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * UpdateClusterRequest request = UpdateClusterRequest.newBuilder()
- * .setProjectId(projectId)
- * .setRegion(region)
- * .setClusterName(clusterName)
- * .setCluster(cluster)
- * .setUpdateMask(updateMask)
- * .build();
- * ApiFuture<Operation> future = clusterControllerClient.updateClusterCallable().futureCall(request);
- * // Do something
- * Operation response = future.get();
- * }
- *
- *
- * @param projectId Required. The ID of the Google Cloud Platform project that the cluster belongs
- * to.
- * @param region Required. The Cloud Dataproc region in which to handle the request.
- * @param clusterName Required. The cluster name.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture
- * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * String clusterName = "";
- * clusterControllerClient.deleteClusterAsync(projectId, region, clusterName).get();
- * }
- *
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture
- * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * String clusterName = "";
- * DeleteClusterRequest request = DeleteClusterRequest.newBuilder()
- * .setProjectId(projectId)
- * .setRegion(region)
- * .setClusterName(clusterName)
- * .build();
- * clusterControllerClient.deleteClusterAsync(request).get();
- * }
- *
- */
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
- public final OperationCallable
- * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * String clusterName = "";
- * DeleteClusterRequest request = DeleteClusterRequest.newBuilder()
- * .setProjectId(projectId)
- * .setRegion(region)
- * .setClusterName(clusterName)
- * .build();
- * OperationFuture<Empty, ClusterOperationMetadata> future = clusterControllerClient.deleteClusterOperationCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
- */
- public final UnaryCallable
- * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * String clusterName = "";
- * DeleteClusterRequest request = DeleteClusterRequest.newBuilder()
- * .setProjectId(projectId)
- * .setRegion(region)
- * .setClusterName(clusterName)
- * .build();
- * ApiFuture<Operation> future = clusterControllerClient.deleteClusterCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
- *
- * @param projectId Required. The ID of the Google Cloud Platform project that the cluster belongs
- * to.
- * @param region Required. The Cloud Dataproc region in which to handle the request.
- * @param clusterName Required. The cluster name.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final Cluster getCluster(String projectId, String region, String clusterName) {
-
- GetClusterRequest request =
- GetClusterRequest.newBuilder()
- .setProjectId(projectId)
- .setRegion(region)
- .setClusterName(clusterName)
- .build();
- return getCluster(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Gets the resource representation for a cluster in a project.
- *
- *
- * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * String clusterName = "";
- * Cluster response = clusterControllerClient.getCluster(projectId, region, clusterName);
- * }
- *
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final Cluster getCluster(GetClusterRequest request) {
- return getClusterCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Gets the resource representation for a cluster in a project.
- *
- *
- * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * String clusterName = "";
- * GetClusterRequest request = GetClusterRequest.newBuilder()
- * .setProjectId(projectId)
- * .setRegion(region)
- * .setClusterName(clusterName)
- * .build();
- * Cluster response = clusterControllerClient.getCluster(request);
- * }
- *
- */
- public final UnaryCallable
- * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * String clusterName = "";
- * GetClusterRequest request = GetClusterRequest.newBuilder()
- * .setProjectId(projectId)
- * .setRegion(region)
- * .setClusterName(clusterName)
- * .build();
- * ApiFuture<Cluster> future = clusterControllerClient.getClusterCallable().futureCall(request);
- * // Do something
- * Cluster response = future.get();
- * }
- *
- *
- * @param projectId Required. The ID of the Google Cloud Platform project that the cluster belongs
- * to.
- * @param region Required. The Cloud Dataproc region in which to handle the request.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final ListClustersPagedResponse listClusters(String projectId, String region) {
- ListClustersRequest request =
- ListClustersRequest.newBuilder().setProjectId(projectId).setRegion(region).build();
- return listClusters(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Lists all regions/{region}/clusters in a project.
- *
- *
- * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * 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 Cloud Dataproc region in which to handle the request.
- * @param filter Optional. A filter constraining the clusters to list. Filters are case-sensitive
- * and have the following syntax:
- *
- * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * String filter = "";
- * for (Cluster element : clusterControllerClient.listClusters(projectId, region, filter).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
- */
- public final ListClustersPagedResponse listClusters(ListClustersRequest request) {
- return listClustersPagedCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Lists all regions/{region}/clusters in a project.
- *
- *
- * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * ListClustersRequest request = ListClustersRequest.newBuilder()
- * .setProjectId(projectId)
- * .setRegion(region)
- * .build();
- * for (Cluster element : clusterControllerClient.listClusters(request).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- */
- public final UnaryCallable
- * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * ListClustersRequest request = ListClustersRequest.newBuilder()
- * .setProjectId(projectId)
- * .setRegion(region)
- * .build();
- * ApiFuture<ListClustersPagedResponse> future = clusterControllerClient.listClustersPagedCallable().futureCall(request);
- * // Do something
- * for (Cluster element : future.get().iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- */
- public final UnaryCallable
- * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * ListClustersRequest request = ListClustersRequest.newBuilder()
- * .setProjectId(projectId)
- * .setRegion(region)
- * .build();
- * while (true) {
- * ListClustersResponse response = clusterControllerClient.listClustersCallable().call(request);
- * for (Cluster element : response.getClustersList()) {
- * // doThingsWith(element);
- * }
- * String nextPageToken = response.getNextPageToken();
- * if (!Strings.isNullOrEmpty(nextPageToken)) {
- * request = request.toBuilder().setPageToken(nextPageToken).build();
- * } else {
- * break;
- * }
- * }
- * }
- *
- *
- * @param projectId Required. The ID of the Google Cloud Platform project that the cluster belongs
- * to.
- * @param region Required. The Cloud Dataproc region in which to handle the request.
- * @param clusterName Required. The cluster name.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture
- * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * String clusterName = "";
- * clusterControllerClient.diagnoseClusterAsync(projectId, region, clusterName).get();
- * }
- *
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture
- * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * String clusterName = "";
- * DiagnoseClusterRequest request = DiagnoseClusterRequest.newBuilder()
- * .setProjectId(projectId)
- * .setRegion(region)
- * .setClusterName(clusterName)
- * .build();
- * clusterControllerClient.diagnoseClusterAsync(request).get();
- * }
- *
- */
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
- public final OperationCallable
- * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * String clusterName = "";
- * DiagnoseClusterRequest request = DiagnoseClusterRequest.newBuilder()
- * .setProjectId(projectId)
- * .setRegion(region)
- * .setClusterName(clusterName)
- * .build();
- * OperationFuture<Empty, DiagnoseClusterResults> future = clusterControllerClient.diagnoseClusterOperationCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
- */
- public final UnaryCallable
- * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * String clusterName = "";
- * DiagnoseClusterRequest request = DiagnoseClusterRequest.newBuilder()
- * .setProjectId(projectId)
- * .setRegion(region)
- * .setClusterName(clusterName)
- * .build();
- * ApiFuture<Operation> future = clusterControllerClient.diagnoseClusterCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
- *
- *
- *
- *
- */
-@Generated("by gapic-generator")
-@BetaApi
-public class ClusterControllerSettings extends ClientSettings
- * ClusterControllerSettings.Builder clusterControllerSettingsBuilder =
- * ClusterControllerSettings.newBuilder();
- * clusterControllerSettingsBuilder.getClusterSettings().getRetrySettings().toBuilder()
- * .setTotalTimeout(Duration.ofSeconds(30));
- * ClusterControllerSettings clusterControllerSettings = clusterControllerSettingsBuilder.build();
- *
- *
- *
- *
- *
- * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * Job job = Job.newBuilder().build();
- * Job response = jobControllerClient.submitJob(projectId, region, job);
- * }
- *
- *
- *
- *
- *
- *
- *
- * To customize the endpoint:
- *
- *
- * JobControllerSettings jobControllerSettings =
- * JobControllerSettings.newBuilder()
- * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
- * .build();
- * JobControllerClient jobControllerClient =
- * JobControllerClient.create(jobControllerSettings);
- *
- *
- *
- */
-@Generated("by gapic-generator")
-@BetaApi
-public class JobControllerClient implements BackgroundResource {
- private final JobControllerSettings settings;
- private final JobControllerStub stub;
-
- /** Constructs an instance of JobControllerClient with default settings. */
- public static final JobControllerClient create() throws IOException {
- return create(JobControllerSettings.newBuilder().build());
- }
-
- /**
- * Constructs an instance of JobControllerClient, using the given settings. The channels are
- * created based on the settings passed in, or defaults for any settings that are not set.
- */
- public static final JobControllerClient create(JobControllerSettings settings)
- throws IOException {
- return new JobControllerClient(settings);
- }
-
- /**
- * Constructs an instance of JobControllerClient, using the given stub for making calls. This is
- * for advanced usage - prefer to use JobControllerSettings}.
- */
- @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
- public static final JobControllerClient create(JobControllerStub stub) {
- return new JobControllerClient(stub);
- }
-
- /**
- * Constructs an instance of JobControllerClient, using the given settings. This is protected so
- * that it is easy to make a subclass, but otherwise, the static factory methods should be
- * preferred.
- */
- protected JobControllerClient(JobControllerSettings settings) throws IOException {
- this.settings = settings;
- this.stub = ((JobControllerStubSettings) settings.getStubSettings()).createStub();
- }
-
- @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
- protected JobControllerClient(JobControllerStub stub) {
- this.settings = null;
- this.stub = stub;
- }
-
- public final JobControllerSettings getSettings() {
- return settings;
- }
-
- @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
- public JobControllerStub getStub() {
- return stub;
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Submits a job to a cluster.
- *
- *
- * JobControllerSettings jobControllerSettings =
- * JobControllerSettings.newBuilder().setEndpoint(myEndpoint).build();
- * JobControllerClient jobControllerClient =
- * JobControllerClient.create(jobControllerSettings);
- *
- *
- *
- * @param projectId Required. The ID of the Google Cloud Platform project that the job belongs to.
- * @param region Required. The Cloud Dataproc region in which to handle the request.
- * @param job Required. The job resource.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final Job submitJob(String projectId, String region, Job job) {
-
- SubmitJobRequest request =
- SubmitJobRequest.newBuilder().setProjectId(projectId).setRegion(region).setJob(job).build();
- return submitJob(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Submits a job to a cluster.
- *
- *
- * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * Job job = Job.newBuilder().build();
- * Job response = jobControllerClient.submitJob(projectId, region, job);
- * }
- *
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final Job submitJob(SubmitJobRequest request) {
- return submitJobCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Submits a job to a cluster.
- *
- *
- * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * Job job = Job.newBuilder().build();
- * SubmitJobRequest request = SubmitJobRequest.newBuilder()
- * .setProjectId(projectId)
- * .setRegion(region)
- * .setJob(job)
- * .build();
- * Job response = jobControllerClient.submitJob(request);
- * }
- *
- */
- public final UnaryCallable
- * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * Job job = Job.newBuilder().build();
- * SubmitJobRequest request = SubmitJobRequest.newBuilder()
- * .setProjectId(projectId)
- * .setRegion(region)
- * .setJob(job)
- * .build();
- * ApiFuture<Job> future = jobControllerClient.submitJobCallable().futureCall(request);
- * // Do something
- * Job response = future.get();
- * }
- *
- *
- * @param projectId Required. The ID of the Google Cloud Platform project that the job belongs to.
- * @param region Required. The Cloud Dataproc region in which to handle the request.
- * @param jobId Required. The job ID.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final Job getJob(String projectId, String region, String jobId) {
-
- GetJobRequest request =
- GetJobRequest.newBuilder()
- .setProjectId(projectId)
- .setRegion(region)
- .setJobId(jobId)
- .build();
- return getJob(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Gets the resource representation for a job in a project.
- *
- *
- * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * String jobId = "";
- * Job response = jobControllerClient.getJob(projectId, region, jobId);
- * }
- *
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final Job getJob(GetJobRequest request) {
- return getJobCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Gets the resource representation for a job in a project.
- *
- *
- * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * String jobId = "";
- * GetJobRequest request = GetJobRequest.newBuilder()
- * .setProjectId(projectId)
- * .setRegion(region)
- * .setJobId(jobId)
- * .build();
- * Job response = jobControllerClient.getJob(request);
- * }
- *
- */
- public final UnaryCallable
- * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * String jobId = "";
- * GetJobRequest request = GetJobRequest.newBuilder()
- * .setProjectId(projectId)
- * .setRegion(region)
- * .setJobId(jobId)
- * .build();
- * ApiFuture<Job> future = jobControllerClient.getJobCallable().futureCall(request);
- * // Do something
- * Job response = future.get();
- * }
- *
- *
- * @param projectId Required. The ID of the Google Cloud Platform project that the job belongs to.
- * @param region Required. The Cloud Dataproc region in which to handle the request.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final ListJobsPagedResponse listJobs(String projectId, String region) {
- ListJobsRequest request =
- ListJobsRequest.newBuilder().setProjectId(projectId).setRegion(region).build();
- return listJobs(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Lists regions/{region}/jobs in a project.
- *
- *
- * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * 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 Cloud Dataproc region in which to handle the request.
- * @param filter Optional. A filter constraining the jobs to list. Filters are case-sensitive and
- * have the following syntax:
- *
- * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * String filter = "";
- * for (Job element : jobControllerClient.listJobs(projectId, region, filter).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
- */
- public final ListJobsPagedResponse listJobs(ListJobsRequest request) {
- return listJobsPagedCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Lists regions/{region}/jobs in a project.
- *
- *
- * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * ListJobsRequest request = ListJobsRequest.newBuilder()
- * .setProjectId(projectId)
- * .setRegion(region)
- * .build();
- * for (Job element : jobControllerClient.listJobs(request).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- */
- public final UnaryCallable
- * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * ListJobsRequest request = ListJobsRequest.newBuilder()
- * .setProjectId(projectId)
- * .setRegion(region)
- * .build();
- * ApiFuture<ListJobsPagedResponse> future = jobControllerClient.listJobsPagedCallable().futureCall(request);
- * // Do something
- * for (Job element : future.get().iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- */
- public final UnaryCallable
- * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * ListJobsRequest request = ListJobsRequest.newBuilder()
- * .setProjectId(projectId)
- * .setRegion(region)
- * .build();
- * while (true) {
- * ListJobsResponse response = jobControllerClient.listJobsCallable().call(request);
- * for (Job element : response.getJobsList()) {
- * // doThingsWith(element);
- * }
- * String nextPageToken = response.getNextPageToken();
- * if (!Strings.isNullOrEmpty(nextPageToken)) {
- * request = request.toBuilder().setPageToken(nextPageToken).build();
- * } else {
- * break;
- * }
- * }
- * }
- *
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final Job updateJob(UpdateJobRequest request) {
- return updateJobCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Updates a job in a project.
- *
- *
- * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * String jobId = "";
- * Job job = Job.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * UpdateJobRequest request = UpdateJobRequest.newBuilder()
- * .setProjectId(projectId)
- * .setRegion(region)
- * .setJobId(jobId)
- * .setJob(job)
- * .setUpdateMask(updateMask)
- * .build();
- * Job response = jobControllerClient.updateJob(request);
- * }
- *
- */
- public final UnaryCallable
- * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * String jobId = "";
- * Job job = Job.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * UpdateJobRequest request = UpdateJobRequest.newBuilder()
- * .setProjectId(projectId)
- * .setRegion(region)
- * .setJobId(jobId)
- * .setJob(job)
- * .setUpdateMask(updateMask)
- * .build();
- * ApiFuture<Job> future = jobControllerClient.updateJobCallable().futureCall(request);
- * // Do something
- * Job response = future.get();
- * }
- *
- *
- * @param projectId Required. The ID of the Google Cloud Platform project that the job belongs to.
- * @param region Required. The Cloud Dataproc region in which to handle the request.
- * @param jobId Required. The job ID.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final Job cancelJob(String projectId, String region, String jobId) {
-
- CancelJobRequest request =
- CancelJobRequest.newBuilder()
- .setProjectId(projectId)
- .setRegion(region)
- .setJobId(jobId)
- .build();
- return cancelJob(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Starts a job cancellation request. To access the job resource after cancellation, call
- * [regions/{region}/jobs.list](/dataproc/docs/reference/rest/v1/projects.regions.jobs/list) or
- * [regions/{region}/jobs.get](/dataproc/docs/reference/rest/v1/projects.regions.jobs/get).
- *
- *
- * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * String jobId = "";
- * Job response = jobControllerClient.cancelJob(projectId, region, jobId);
- * }
- *
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final Job cancelJob(CancelJobRequest request) {
- return cancelJobCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Starts a job cancellation request. To access the job resource after cancellation, call
- * [regions/{region}/jobs.list](/dataproc/docs/reference/rest/v1/projects.regions.jobs/list) or
- * [regions/{region}/jobs.get](/dataproc/docs/reference/rest/v1/projects.regions.jobs/get).
- *
- *
- * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * String jobId = "";
- * CancelJobRequest request = CancelJobRequest.newBuilder()
- * .setProjectId(projectId)
- * .setRegion(region)
- * .setJobId(jobId)
- * .build();
- * Job response = jobControllerClient.cancelJob(request);
- * }
- *
- */
- public final UnaryCallable
- * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * String jobId = "";
- * CancelJobRequest request = CancelJobRequest.newBuilder()
- * .setProjectId(projectId)
- * .setRegion(region)
- * .setJobId(jobId)
- * .build();
- * ApiFuture<Job> future = jobControllerClient.cancelJobCallable().futureCall(request);
- * // Do something
- * Job response = future.get();
- * }
- *
- *
- * @param projectId Required. The ID of the Google Cloud Platform project that the job belongs to.
- * @param region Required. The Cloud Dataproc region in which to handle the request.
- * @param jobId Required. The job ID.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final void deleteJob(String projectId, String region, String jobId) {
-
- DeleteJobRequest request =
- DeleteJobRequest.newBuilder()
- .setProjectId(projectId)
- .setRegion(region)
- .setJobId(jobId)
- .build();
- deleteJob(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes the job from the project. If the job is active, the delete fails, and the response
- * returns `FAILED_PRECONDITION`.
- *
- *
- * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * String jobId = "";
- * jobControllerClient.deleteJob(projectId, region, jobId);
- * }
- *
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final void deleteJob(DeleteJobRequest request) {
- deleteJobCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes the job from the project. If the job is active, the delete fails, and the response
- * returns `FAILED_PRECONDITION`.
- *
- *
- * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * String jobId = "";
- * DeleteJobRequest request = DeleteJobRequest.newBuilder()
- * .setProjectId(projectId)
- * .setRegion(region)
- * .setJobId(jobId)
- * .build();
- * jobControllerClient.deleteJob(request);
- * }
- *
- */
- public final UnaryCallable
- * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * String jobId = "";
- * DeleteJobRequest request = DeleteJobRequest.newBuilder()
- * .setProjectId(projectId)
- * .setRegion(region)
- * .setJobId(jobId)
- * .build();
- * ApiFuture<Void> future = jobControllerClient.deleteJobCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
- *
- *
- *
- *
- */
-@Generated("by gapic-generator")
-@BetaApi
-public class JobControllerSettings extends ClientSettings
- * JobControllerSettings.Builder jobControllerSettingsBuilder =
- * JobControllerSettings.newBuilder();
- * jobControllerSettingsBuilder.submitJobSettings().getRetrySettings().toBuilder()
- * .setTotalTimeout(Duration.ofSeconds(30));
- * JobControllerSettings jobControllerSettings = jobControllerSettingsBuilder.build();
- *
- *
- *
- *
- *
- * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
- * WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
- * WorkflowTemplate response = workflowTemplateServiceClient.createWorkflowTemplate(parent, template);
- * }
- *
- *
- *
- *
- *
- *
- *
- * To customize the endpoint:
- *
- *
- * WorkflowTemplateServiceSettings workflowTemplateServiceSettings =
- * WorkflowTemplateServiceSettings.newBuilder()
- * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
- * .build();
- * WorkflowTemplateServiceClient workflowTemplateServiceClient =
- * WorkflowTemplateServiceClient.create(workflowTemplateServiceSettings);
- *
- *
- *
- */
-@Generated("by gapic-generator")
-@BetaApi
-public class WorkflowTemplateServiceClient implements BackgroundResource {
- private final WorkflowTemplateServiceSettings settings;
- private final WorkflowTemplateServiceStub stub;
- private final OperationsClient operationsClient;
-
- /** Constructs an instance of WorkflowTemplateServiceClient with default settings. */
- public static final WorkflowTemplateServiceClient create() throws IOException {
- return create(WorkflowTemplateServiceSettings.newBuilder().build());
- }
-
- /**
- * Constructs an instance of WorkflowTemplateServiceClient, using the given settings. The channels
- * are created based on the settings passed in, or defaults for any settings that are not set.
- */
- public static final WorkflowTemplateServiceClient create(WorkflowTemplateServiceSettings settings)
- throws IOException {
- return new WorkflowTemplateServiceClient(settings);
- }
-
- /**
- * Constructs an instance of WorkflowTemplateServiceClient, using the given stub for making calls.
- * This is for advanced usage - prefer to use WorkflowTemplateServiceSettings}.
- */
- @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
- public static final WorkflowTemplateServiceClient create(WorkflowTemplateServiceStub stub) {
- return new WorkflowTemplateServiceClient(stub);
- }
-
- /**
- * Constructs an instance of WorkflowTemplateServiceClient, using the given settings. This is
- * protected so that it is easy to make a subclass, but otherwise, the static factory methods
- * should be preferred.
- */
- protected WorkflowTemplateServiceClient(WorkflowTemplateServiceSettings settings)
- throws IOException {
- this.settings = settings;
- this.stub = ((WorkflowTemplateServiceStubSettings) settings.getStubSettings()).createStub();
- this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
- }
-
- @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
- protected WorkflowTemplateServiceClient(WorkflowTemplateServiceStub stub) {
- this.settings = null;
- this.stub = stub;
- this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
- }
-
- public final WorkflowTemplateServiceSettings getSettings() {
- return settings;
- }
-
- @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
- public WorkflowTemplateServiceStub getStub() {
- return stub;
- }
-
- /**
- * Returns the OperationsClient that can be used to query the status of a long-running operation
- * returned by another API method call.
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationsClient getOperationsClient() {
- return operationsClient;
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Creates new workflow template.
- *
- *
- * WorkflowTemplateServiceSettings workflowTemplateServiceSettings =
- * WorkflowTemplateServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
- * WorkflowTemplateServiceClient workflowTemplateServiceClient =
- * WorkflowTemplateServiceClient.create(workflowTemplateServiceSettings);
- *
- *
- *
- * @param parent Required. The resource name of the region or location, as described in
- * https://cloud.google.com/apis/design/resource_names.
- *
- * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * 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.
- *
- * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
- * WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
- * WorkflowTemplate response = workflowTemplateServiceClient.createWorkflowTemplate(parent.toString(), template);
- * }
- *
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final WorkflowTemplate createWorkflowTemplate(CreateWorkflowTemplateRequest request) {
- return createWorkflowTemplateCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Creates new workflow template.
- *
- *
- * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
- * WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
- * CreateWorkflowTemplateRequest request = CreateWorkflowTemplateRequest.newBuilder()
- * .setParent(parent.toString())
- * .setTemplate(template)
- * .build();
- * WorkflowTemplate response = workflowTemplateServiceClient.createWorkflowTemplate(request);
- * }
- *
- */
- public final UnaryCallable
- * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
- * WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
- * CreateWorkflowTemplateRequest request = CreateWorkflowTemplateRequest.newBuilder()
- * .setParent(parent.toString())
- * .setTemplate(template)
- * .build();
- * ApiFuture<WorkflowTemplate> future = workflowTemplateServiceClient.createWorkflowTemplateCallable().futureCall(request);
- * // Do something
- * WorkflowTemplate response = future.get();
- * }
- *
- *
- * @param name Required. The resource name of the workflow template, as described in
- * https://cloud.google.com/apis/design/resource_names.
- *
- * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
- * WorkflowTemplate response = workflowTemplateServiceClient.getWorkflowTemplate(name);
- * }
- *
- *
- * @param name Required. The resource name of the workflow template, as described in
- * https://cloud.google.com/apis/design/resource_names.
- *
- * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
- * WorkflowTemplate response = workflowTemplateServiceClient.getWorkflowTemplate(name.toString());
- * }
- *
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final WorkflowTemplate getWorkflowTemplate(GetWorkflowTemplateRequest request) {
- return getWorkflowTemplateCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Retrieves the latest workflow template.
- *
- *
- * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
- * GetWorkflowTemplateRequest request = GetWorkflowTemplateRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * WorkflowTemplate response = workflowTemplateServiceClient.getWorkflowTemplate(request);
- * }
- *
- */
- public final UnaryCallable
- * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
- * GetWorkflowTemplateRequest request = GetWorkflowTemplateRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<WorkflowTemplate> future = workflowTemplateServiceClient.getWorkflowTemplateCallable().futureCall(request);
- * // Do something
- * WorkflowTemplate response = future.get();
- * }
- *
- *
- * @param name Required. The resource name of the workflow template, as described in
- * https://cloud.google.com/apis/design/resource_names.
- *
- * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.of("[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.
- *
- * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
- * workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name.toString()).get();
- * }
- *
- *
- * @param name Required. The resource name of the workflow template, as described in
- * https://cloud.google.com/apis/design/resource_names.
- *
- * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
- * Map<String, String> parameters = new HashMap<>();
- * workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name, parameters).get();
- * }
- *
- *
- * @param name Required. The resource name of the workflow template, as described in
- * https://cloud.google.com/apis/design/resource_names.
- *
- * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
- * Map<String, String> parameters = new HashMap<>();
- * workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(name.toString(), parameters).get();
- * }
- *
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture
- * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
- * InstantiateWorkflowTemplateRequest request = InstantiateWorkflowTemplateRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * workflowTemplateServiceClient.instantiateWorkflowTemplateAsync(request).get();
- * }
- *
- */
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
- public final OperationCallable
- * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
- * InstantiateWorkflowTemplateRequest request = InstantiateWorkflowTemplateRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * OperationFuture<Empty, WorkflowMetadata> future = workflowTemplateServiceClient.instantiateWorkflowTemplateOperationCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
- */
- public final UnaryCallable
- * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
- * InstantiateWorkflowTemplateRequest request = InstantiateWorkflowTemplateRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Operation> future = workflowTemplateServiceClient.instantiateWorkflowTemplateCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
- *
- * @param parent Required. The resource name of the region or location, as described in
- * https://cloud.google.com/apis/design/resource_names.
- *
- * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * 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.
- *
- * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
- * WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
- * workflowTemplateServiceClient.instantiateInlineWorkflowTemplateAsync(parent.toString(), template).get();
- * }
- *
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- @BetaApi(
- "The surface for long-running operations is not stable yet and may change in the future.")
- public final OperationFuture
- * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
- * WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
- * InstantiateInlineWorkflowTemplateRequest request = InstantiateInlineWorkflowTemplateRequest.newBuilder()
- * .setParent(parent.toString())
- * .setTemplate(template)
- * .build();
- * workflowTemplateServiceClient.instantiateInlineWorkflowTemplateAsync(request).get();
- * }
- *
- */
- @BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
- public final OperationCallable
- * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
- * WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
- * InstantiateInlineWorkflowTemplateRequest request = InstantiateInlineWorkflowTemplateRequest.newBuilder()
- * .setParent(parent.toString())
- * .setTemplate(template)
- * .build();
- * OperationFuture<Empty, WorkflowMetadata> future = workflowTemplateServiceClient.instantiateInlineWorkflowTemplateOperationCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
- */
- public final UnaryCallable
- * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
- * WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
- * InstantiateInlineWorkflowTemplateRequest request = InstantiateInlineWorkflowTemplateRequest.newBuilder()
- * .setParent(parent.toString())
- * .setTemplate(template)
- * .build();
- * ApiFuture<Operation> future = workflowTemplateServiceClient.instantiateInlineWorkflowTemplateCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
- *
- * @param template Required. The updated workflow template.
- *
- * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
- * WorkflowTemplate response = workflowTemplateServiceClient.updateWorkflowTemplate(template);
- * }
- *
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final WorkflowTemplate updateWorkflowTemplate(UpdateWorkflowTemplateRequest request) {
- return updateWorkflowTemplateCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Updates (replaces) workflow template. The updated template must contain version that matches
- * the current server version.
- *
- *
- * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
- * UpdateWorkflowTemplateRequest request = UpdateWorkflowTemplateRequest.newBuilder()
- * .setTemplate(template)
- * .build();
- * WorkflowTemplate response = workflowTemplateServiceClient.updateWorkflowTemplate(request);
- * }
- *
- */
- public final UnaryCallable
- * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
- * UpdateWorkflowTemplateRequest request = UpdateWorkflowTemplateRequest.newBuilder()
- * .setTemplate(template)
- * .build();
- * ApiFuture<WorkflowTemplate> future = workflowTemplateServiceClient.updateWorkflowTemplateCallable().futureCall(request);
- * // Do something
- * WorkflowTemplate response = future.get();
- * }
- *
- *
- * @param parent Required. The resource name of the region or location, as described in
- * https://cloud.google.com/apis/design/resource_names.
- *
- * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * 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.
- *
- * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
- * for (WorkflowTemplate element : workflowTemplateServiceClient.listWorkflowTemplates(parent.toString()).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
- */
- public final ListWorkflowTemplatesPagedResponse listWorkflowTemplates(
- ListWorkflowTemplatesRequest request) {
- return listWorkflowTemplatesPagedCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Lists workflows that match the specified filter in the request.
- *
- *
- * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
- * ListWorkflowTemplatesRequest request = ListWorkflowTemplatesRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * for (WorkflowTemplate element : workflowTemplateServiceClient.listWorkflowTemplates(request).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- */
- public final UnaryCallable
- * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
- * ListWorkflowTemplatesRequest request = ListWorkflowTemplatesRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * ApiFuture<ListWorkflowTemplatesPagedResponse> future = workflowTemplateServiceClient.listWorkflowTemplatesPagedCallable().futureCall(request);
- * // Do something
- * for (WorkflowTemplate element : future.get().iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
- */
- public final UnaryCallable
- * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
- * ListWorkflowTemplatesRequest request = ListWorkflowTemplatesRequest.newBuilder()
- * .setParent(parent.toString())
- * .build();
- * while (true) {
- * ListWorkflowTemplatesResponse response = workflowTemplateServiceClient.listWorkflowTemplatesCallable().call(request);
- * for (WorkflowTemplate element : response.getTemplatesList()) {
- * // doThingsWith(element);
- * }
- * String nextPageToken = response.getNextPageToken();
- * if (!Strings.isNullOrEmpty(nextPageToken)) {
- * request = request.toBuilder().setPageToken(nextPageToken).build();
- * } else {
- * break;
- * }
- * }
- * }
- *
- *
- * @param name Required. The resource name of the workflow template, as described in
- * https://cloud.google.com/apis/design/resource_names.
- *
- * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.of("[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.
- *
- * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
- * workflowTemplateServiceClient.deleteWorkflowTemplate(name.toString());
- * }
- *
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final void deleteWorkflowTemplate(DeleteWorkflowTemplateRequest request) {
- deleteWorkflowTemplateCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes a workflow template. It does not cancel in-progress workflows.
- *
- *
- * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
- * DeleteWorkflowTemplateRequest request = DeleteWorkflowTemplateRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * workflowTemplateServiceClient.deleteWorkflowTemplate(request);
- * }
- *
- */
- public final UnaryCallable
- * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * WorkflowTemplateName name = WorkflowTemplateName.of("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]");
- * DeleteWorkflowTemplateRequest request = DeleteWorkflowTemplateRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Void> future = workflowTemplateServiceClient.deleteWorkflowTemplateCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
- *
- *
- *
- *
- */
-@Generated("by gapic-generator")
-@BetaApi
-public class WorkflowTemplateServiceSettings
- extends ClientSettings
- * WorkflowTemplateServiceSettings.Builder workflowTemplateServiceSettingsBuilder =
- * WorkflowTemplateServiceSettings.newBuilder();
- * workflowTemplateServiceSettingsBuilder.createWorkflowTemplateSettings().getRetrySettings().toBuilder()
- * .setTotalTimeout(Duration.ofSeconds(30));
- * WorkflowTemplateServiceSettings workflowTemplateServiceSettings = workflowTemplateServiceSettingsBuilder.build();
- *
- *
- *
- *
- * =================== JobControllerClient ===================
- *
- *
- * try (ClusterControllerClient clusterControllerClient = ClusterControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * String clusterName = "";
- * Cluster response = clusterControllerClient.getCluster(projectId, region, clusterName);
- * }
- *
- *
- *
- *
- * ============================= WorkflowTemplateServiceClient =============================
- *
- *
- * try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
- * String projectId = "";
- * String region = "";
- * Job job = Job.newBuilder().build();
- * Job response = jobControllerClient.submitJob(projectId, region, job);
- * }
- *
- *
- *
- */
-@Generated("by gapic-generator")
-package com.google.cloud.dataproc.v1;
-
-import javax.annotation.Generated;
diff --git a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/ClusterControllerStub.java b/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/ClusterControllerStub.java
deleted file mode 100644
index 960ac1a9..00000000
--- a/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/stub/ClusterControllerStub.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright 2019 Google LLC
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.google.cloud.dataproc.v1.stub;
-
-import static com.google.cloud.dataproc.v1.ClusterControllerClient.ListClustersPagedResponse;
-
-import com.google.api.core.BetaApi;
-import com.google.api.gax.core.BackgroundResource;
-import com.google.api.gax.rpc.OperationCallable;
-import com.google.api.gax.rpc.UnaryCallable;
-import com.google.cloud.dataproc.v1.Cluster;
-import com.google.cloud.dataproc.v1.ClusterOperationMetadata;
-import com.google.cloud.dataproc.v1.CreateClusterRequest;
-import com.google.cloud.dataproc.v1.DeleteClusterRequest;
-import com.google.cloud.dataproc.v1.DiagnoseClusterRequest;
-import com.google.cloud.dataproc.v1.DiagnoseClusterResults;
-import com.google.cloud.dataproc.v1.GetClusterRequest;
-import com.google.cloud.dataproc.v1.ListClustersRequest;
-import com.google.cloud.dataproc.v1.ListClustersResponse;
-import com.google.cloud.dataproc.v1.UpdateClusterRequest;
-import com.google.longrunning.Operation;
-import com.google.longrunning.stub.OperationsStub;
-import com.google.protobuf.Empty;
-import javax.annotation.Generated;
-
-// AUTO-GENERATED DOCUMENTATION AND CLASS
-/**
- * Base stub class for Google Cloud Dataproc API.
- *
- *
- * try (WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.create()) {
- * RegionName parent = RegionName.of("[PROJECT]", "[REGION]");
- * WorkflowTemplate template = WorkflowTemplate.newBuilder().build();
- * WorkflowTemplate response = workflowTemplateServiceClient.createWorkflowTemplate(parent, template);
- * }
- *
- *
- *
- *
- *
- *
- */
-@Generated("by gapic-generator")
-@BetaApi
-public class ClusterControllerStubSettings extends StubSettings
- * ClusterControllerStubSettings.Builder clusterControllerSettingsBuilder =
- * ClusterControllerStubSettings.newBuilder();
- * clusterControllerSettingsBuilder.getClusterSettings().getRetrySettings().toBuilder()
- * .setTotalTimeout(Duration.ofSeconds(30));
- * ClusterControllerStubSettings clusterControllerSettings = clusterControllerSettingsBuilder.build();
- *
- *