lib/google/cloud/dataproc/v1/job_controller_client.rb in google-cloud-dataproc-0.2.2 vs lib/google/cloud/dataproc/v1/job_controller_client.rb in google-cloud-dataproc-0.3.0

- old
+ new

@@ -1,6 +1,6 @@ -# Copyright 2018 Google LLC +# 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 # @@ -213,10 +213,22 @@ # Required. The Cloud Dataproc region in which to handle the request. # @param job [Google::Cloud::Dataproc::V1::Job | Hash] # Required. The job resource. # A hash of the same form as `Google::Cloud::Dataproc::V1::Job` # can also be provided. + # @param request_id [String] + # Optional. A unique id used to identify the request. If the server + # receives two {Google::Cloud::Dataproc::V1::SubmitJobRequest SubmitJobRequest} requests with the same + # id, then the second request will be ignored and the + # first {Google::Cloud::Dataproc::V1::Job Job} created and stored in the backend + # is returned. + # + # It is recommended to always set this value to a + # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + # + # The id must contain only letters (a-z, A-Z), numbers (0-9), + # underscores (_), and hyphens (-). The maximum length is 40 characters. # @param options [Google::Gax::CallOptions] # Overrides the default settings for this call, e.g, timeout, # retries, etc. # @yield [result, operation] Access the result along with the RPC operation # @yieldparam result [Google::Cloud::Dataproc::V1::Job] @@ -240,15 +252,17 @@ def submit_job \ project_id, region, job, + request_id: nil, options: nil, &block req = { project_id: project_id, region: region, - job: job + job: job, + request_id: request_id }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Cloud::Dataproc::V1::SubmitJobRequest) @submit_job.call(req, options, &block) end