google-cloud-dataproc 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.yardopts +1 -0
- data/README.md +39 -2
- data/lib/google/cloud/dataproc.rb +38 -3
- data/lib/google/cloud/dataproc/v1.rb +96 -51
- data/lib/google/cloud/dataproc/v1/cluster_controller_client.rb +95 -31
- data/lib/google/cloud/dataproc/v1/credentials.rb +40 -0
- data/lib/google/cloud/dataproc/v1/doc/google/cloud/dataproc/v1/clusters.rb +1 -14
- data/lib/google/cloud/dataproc/v1/doc/google/cloud/dataproc/v1/jobs.rb +1 -14
- data/lib/google/cloud/dataproc/v1/doc/google/longrunning/operations.rb +92 -0
- data/lib/google/cloud/dataproc/v1/doc/google/protobuf/any.rb +1 -1
- data/lib/google/cloud/dataproc/v1/doc/google/protobuf/duration.rb +1 -1
- data/lib/google/cloud/dataproc/{credentials.rb → v1/doc/google/protobuf/empty.rb} +13 -15
- data/lib/google/cloud/dataproc/v1/doc/google/protobuf/field_mask.rb +1 -1
- data/lib/google/cloud/dataproc/v1/doc/google/protobuf/timestamp.rb +1 -1
- data/lib/google/cloud/dataproc/v1/doc/google/rpc/status.rb +1 -1
- data/lib/google/cloud/dataproc/v1/doc/overview.rb +28 -3
- data/lib/google/cloud/dataproc/v1/job_controller_client.rb +116 -38
- metadata +41 -11
@@ -0,0 +1,40 @@
|
|
1
|
+
# Copyright 2018 Google LLC
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
require "googleauth"
|
16
|
+
|
17
|
+
module Google
|
18
|
+
module Cloud
|
19
|
+
module Dataproc
|
20
|
+
module V1
|
21
|
+
class Credentials < Google::Auth::Credentials
|
22
|
+
SCOPE = [
|
23
|
+
"https://www.googleapis.com/auth/cloud-platform"
|
24
|
+
].freeze
|
25
|
+
PATH_ENV_VARS = %w(DATAPROC_CREDENTIALS
|
26
|
+
DATAPROC_KEYFILE
|
27
|
+
GOOGLE_CLOUD_CREDENTIALS
|
28
|
+
GOOGLE_CLOUD_KEYFILE
|
29
|
+
GCLOUD_KEYFILE)
|
30
|
+
JSON_ENV_VARS = %w(DATAPROC_CREDENTIALS_JSON
|
31
|
+
DATAPROC_KEYFILE_JSON
|
32
|
+
GOOGLE_CLOUD_CREDENTIALS_JSON
|
33
|
+
GOOGLE_CLOUD_KEYFILE_JSON
|
34
|
+
GCLOUD_KEYFILE_JSON)
|
35
|
+
DEFAULT_PATHS = ["~/.config/gcloud/application_default_credentials.json"]
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright
|
1
|
+
# Copyright 2018 Google LLC
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
@@ -15,19 +15,6 @@
|
|
15
15
|
module Google
|
16
16
|
module Cloud
|
17
17
|
module Dataproc
|
18
|
-
##
|
19
|
-
# # Google Cloud Dataproc API Contents
|
20
|
-
#
|
21
|
-
# | Class | Description |
|
22
|
-
# | ----- | ----------- |
|
23
|
-
# | [ClusterControllerClient][] | Manages Hadoop-based clusters and jobs on Google Cloud Platform. |
|
24
|
-
# | [JobControllerClient][] | Manages Hadoop-based clusters and jobs on Google Cloud Platform. |
|
25
|
-
# | [Data Types][] | Data types for Google::Cloud::Dataproc::V1 |
|
26
|
-
#
|
27
|
-
# [ClusterControllerClient]: https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-dataproc/latest/google/cloud/dataproc/v1/clustercontrollerclient
|
28
|
-
# [JobControllerClient]: https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-dataproc/latest/google/cloud/dataproc/v1/jobcontrollerclient
|
29
|
-
# [Data Types]: https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-dataproc/latest/google/cloud/dataproc/v1/datatypes
|
30
|
-
#
|
31
18
|
module V1
|
32
19
|
# Describes the identifying information, config, and status of
|
33
20
|
# a cluster of Google Compute Engine instances.
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright
|
1
|
+
# Copyright 2018 Google LLC
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
@@ -15,19 +15,6 @@
|
|
15
15
|
module Google
|
16
16
|
module Cloud
|
17
17
|
module Dataproc
|
18
|
-
##
|
19
|
-
# # Google Cloud Dataproc API Contents
|
20
|
-
#
|
21
|
-
# | Class | Description |
|
22
|
-
# | ----- | ----------- |
|
23
|
-
# | [ClusterControllerClient][] | Manages Hadoop-based clusters and jobs on Google Cloud Platform. |
|
24
|
-
# | [JobControllerClient][] | Manages Hadoop-based clusters and jobs on Google Cloud Platform. |
|
25
|
-
# | [Data Types][] | Data types for Google::Cloud::Dataproc::V1 |
|
26
|
-
#
|
27
|
-
# [ClusterControllerClient]: https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-dataproc/latest/google/cloud/dataproc/v1/clustercontrollerclient
|
28
|
-
# [JobControllerClient]: https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-dataproc/latest/google/cloud/dataproc/v1/jobcontrollerclient
|
29
|
-
# [Data Types]: https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-dataproc/latest/google/cloud/dataproc/v1/datatypes
|
30
|
-
#
|
31
18
|
module V1
|
32
19
|
# The runtime logging config of the job.
|
33
20
|
# @!attribute [rw] driver_log_levels
|
@@ -0,0 +1,92 @@
|
|
1
|
+
# Copyright 2018 Google LLC
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
module Google
|
16
|
+
module Longrunning
|
17
|
+
# This resource represents a long-running operation that is the result of a
|
18
|
+
# network API call.
|
19
|
+
# @!attribute [rw] name
|
20
|
+
# @return [String]
|
21
|
+
# The server-assigned name, which is only unique within the same service that
|
22
|
+
# originally returns it. If you use the default HTTP mapping, the
|
23
|
+
# +name+ should have the format of +operations/some/unique/name+.
|
24
|
+
# @!attribute [rw] metadata
|
25
|
+
# @return [Google::Protobuf::Any]
|
26
|
+
# Service-specific metadata associated with the operation. It typically
|
27
|
+
# contains progress information and common metadata such as create time.
|
28
|
+
# Some services might not provide such metadata. Any method that returns a
|
29
|
+
# long-running operation should document the metadata type, if any.
|
30
|
+
# @!attribute [rw] done
|
31
|
+
# @return [true, false]
|
32
|
+
# If the value is +false+, it means the operation is still in progress.
|
33
|
+
# If true, the operation is completed, and either +error+ or +response+ is
|
34
|
+
# available.
|
35
|
+
# @!attribute [rw] error
|
36
|
+
# @return [Google::Rpc::Status]
|
37
|
+
# The error result of the operation in case of failure or cancellation.
|
38
|
+
# @!attribute [rw] response
|
39
|
+
# @return [Google::Protobuf::Any]
|
40
|
+
# The normal response of the operation in case of success. If the original
|
41
|
+
# method returns no data on success, such as +Delete+, the response is
|
42
|
+
# +google.protobuf.Empty+. If the original method is standard
|
43
|
+
# +Get+/+Create+/+Update+, the response should be the resource. For other
|
44
|
+
# methods, the response should have the type +XxxResponse+, where +Xxx+
|
45
|
+
# is the original method name. For example, if the original method name
|
46
|
+
# is +TakeSnapshot()+, the inferred response type is
|
47
|
+
# +TakeSnapshotResponse+.
|
48
|
+
class Operation; end
|
49
|
+
|
50
|
+
# The request message for {Google::Longrunning::Operations::GetOperation Operations::GetOperation}.
|
51
|
+
# @!attribute [rw] name
|
52
|
+
# @return [String]
|
53
|
+
# The name of the operation resource.
|
54
|
+
class GetOperationRequest; end
|
55
|
+
|
56
|
+
# The request message for {Google::Longrunning::Operations::ListOperations Operations::ListOperations}.
|
57
|
+
# @!attribute [rw] name
|
58
|
+
# @return [String]
|
59
|
+
# The name of the operation collection.
|
60
|
+
# @!attribute [rw] filter
|
61
|
+
# @return [String]
|
62
|
+
# The standard list filter.
|
63
|
+
# @!attribute [rw] page_size
|
64
|
+
# @return [Integer]
|
65
|
+
# The standard list page size.
|
66
|
+
# @!attribute [rw] page_token
|
67
|
+
# @return [String]
|
68
|
+
# The standard list page token.
|
69
|
+
class ListOperationsRequest; end
|
70
|
+
|
71
|
+
# The response message for {Google::Longrunning::Operations::ListOperations Operations::ListOperations}.
|
72
|
+
# @!attribute [rw] operations
|
73
|
+
# @return [Array<Google::Longrunning::Operation>]
|
74
|
+
# A list of operations that matches the specified filter in the request.
|
75
|
+
# @!attribute [rw] next_page_token
|
76
|
+
# @return [String]
|
77
|
+
# The standard List next-page token.
|
78
|
+
class ListOperationsResponse; end
|
79
|
+
|
80
|
+
# The request message for {Google::Longrunning::Operations::CancelOperation Operations::CancelOperation}.
|
81
|
+
# @!attribute [rw] name
|
82
|
+
# @return [String]
|
83
|
+
# The name of the operation resource to be cancelled.
|
84
|
+
class CancelOperationRequest; end
|
85
|
+
|
86
|
+
# The request message for {Google::Longrunning::Operations::DeleteOperation Operations::DeleteOperation}.
|
87
|
+
# @!attribute [rw] name
|
88
|
+
# @return [String]
|
89
|
+
# The name of the operation resource to be deleted.
|
90
|
+
class DeleteOperationRequest; end
|
91
|
+
end
|
92
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright
|
1
|
+
# Copyright 2018 Google LLC
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
@@ -12,19 +12,17 @@
|
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
|
-
require "googleauth"
|
16
|
-
|
17
15
|
module Google
|
18
|
-
module
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
end
|
16
|
+
module Protobuf
|
17
|
+
# A generic empty message that you can re-use to avoid defining duplicated
|
18
|
+
# empty messages in your APIs. A typical example is to use it as the request
|
19
|
+
# or the response type of an API method. For instance:
|
20
|
+
#
|
21
|
+
# service Foo {
|
22
|
+
# rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
|
23
|
+
# }
|
24
|
+
#
|
25
|
+
# The JSON representation for +Empty+ is empty JSON object +{}+.
|
26
|
+
class Empty; end
|
29
27
|
end
|
30
|
-
end
|
28
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright
|
1
|
+
# Copyright 2018 Google LLC
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
@@ -17,7 +17,7 @@ module Google
|
|
17
17
|
# rubocop:disable LineLength
|
18
18
|
|
19
19
|
##
|
20
|
-
# # Ruby Client for Google Cloud Dataproc API ([
|
20
|
+
# # Ruby Client for Google Cloud Dataproc API ([Beta](https://github.com/GoogleCloudPlatform/google-cloud-ruby#versioning))
|
21
21
|
#
|
22
22
|
# [Google Cloud Dataproc API][Product Documentation]:
|
23
23
|
# Manages Hadoop-based clusters and jobs on Google Cloud Platform.
|
@@ -29,7 +29,7 @@ module Google
|
|
29
29
|
#
|
30
30
|
# 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
|
31
31
|
# 2. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
|
32
|
-
# 3. [Enable the Google Cloud Dataproc API.](https://console.cloud.google.com/apis/
|
32
|
+
# 3. [Enable the Google Cloud Dataproc API.](https://console.cloud.google.com/apis/library/dataproc.googleapis.com)
|
33
33
|
# 4. [Setup Authentication.](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud/master/guides/authentication)
|
34
34
|
#
|
35
35
|
# ### Installation
|
@@ -68,6 +68,31 @@ module Google
|
|
68
68
|
#
|
69
69
|
# [Product Documentation]: https://cloud.google.com/dataproc
|
70
70
|
#
|
71
|
+
# ## Enabling Logging
|
72
|
+
#
|
73
|
+
# To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
|
74
|
+
# The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib-2.5.0/libdoc/logger/rdoc/Logger.html) as shown below,
|
75
|
+
# or a [`Google::Cloud::Logging::Logger`](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-logging/latest/google/cloud/logging/logger)
|
76
|
+
# that will write logs to [Stackdriver Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
|
77
|
+
# and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
|
78
|
+
#
|
79
|
+
# Configuring a Ruby stdlib logger:
|
80
|
+
#
|
81
|
+
# ```ruby
|
82
|
+
# require "logger"
|
83
|
+
#
|
84
|
+
# module MyLogger
|
85
|
+
# LOGGER = Logger.new $stderr, level: Logger::WARN
|
86
|
+
# def logger
|
87
|
+
# LOGGER
|
88
|
+
# end
|
89
|
+
# end
|
90
|
+
#
|
91
|
+
# # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
|
92
|
+
# module GRPC
|
93
|
+
# extend MyLogger
|
94
|
+
# end
|
95
|
+
# ```
|
71
96
|
#
|
72
97
|
module Dataproc
|
73
98
|
module V1
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright
|
1
|
+
# Copyright 2018 Google LLC
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
@@ -18,9 +18,6 @@
|
|
18
18
|
# and updates to that file get reflected here through a refresh process.
|
19
19
|
# For the short term, the refresh process will only be runnable by Google
|
20
20
|
# engineers.
|
21
|
-
#
|
22
|
-
# The only allowed edits are to method and file documentation. A 3-way
|
23
|
-
# merge preserves those additions if the generated source changes.
|
24
21
|
|
25
22
|
require "json"
|
26
23
|
require "pathname"
|
@@ -28,7 +25,7 @@ require "pathname"
|
|
28
25
|
require "google/gax"
|
29
26
|
|
30
27
|
require "google/cloud/dataproc/v1/jobs_pb"
|
31
|
-
require "google/cloud/dataproc/credentials"
|
28
|
+
require "google/cloud/dataproc/v1/credentials"
|
32
29
|
|
33
30
|
module Google
|
34
31
|
module Cloud
|
@@ -47,6 +44,9 @@ module Google
|
|
47
44
|
# The default port of the service.
|
48
45
|
DEFAULT_SERVICE_PORT = 443
|
49
46
|
|
47
|
+
# The default set of gRPC interceptors.
|
48
|
+
GRPC_INTERCEPTORS = []
|
49
|
+
|
50
50
|
DEFAULT_TIMEOUT = 30
|
51
51
|
|
52
52
|
PAGE_DESCRIPTORS = {
|
@@ -89,11 +89,18 @@ module Google
|
|
89
89
|
# or the specified config is missing data points.
|
90
90
|
# @param timeout [Numeric]
|
91
91
|
# The default timeout, in seconds, for calls made through this client.
|
92
|
+
# @param metadata [Hash]
|
93
|
+
# Default metadata to be sent with each request. This can be overridden on a per call basis.
|
94
|
+
# @param exception_transformer [Proc]
|
95
|
+
# An optional proc that intercepts any exceptions raised during an API call to inject
|
96
|
+
# custom error handling.
|
92
97
|
def initialize \
|
93
98
|
credentials: nil,
|
94
99
|
scopes: ALL_SCOPES,
|
95
100
|
client_config: {},
|
96
101
|
timeout: DEFAULT_TIMEOUT,
|
102
|
+
metadata: nil,
|
103
|
+
exception_transformer: nil,
|
97
104
|
lib_name: nil,
|
98
105
|
lib_version: ""
|
99
106
|
# These require statements are intentionally placed here to initialize
|
@@ -102,10 +109,10 @@ module Google
|
|
102
109
|
require "google/gax/grpc"
|
103
110
|
require "google/cloud/dataproc/v1/jobs_services_pb"
|
104
111
|
|
105
|
-
credentials ||= Google::Cloud::Dataproc::Credentials.default
|
112
|
+
credentials ||= Google::Cloud::Dataproc::V1::Credentials.default
|
106
113
|
|
107
114
|
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
108
|
-
updater_proc = Google::Cloud::Dataproc::Credentials.new(credentials).updater_proc
|
115
|
+
updater_proc = Google::Cloud::Dataproc::V1::Credentials.new(credentials).updater_proc
|
109
116
|
end
|
110
117
|
if credentials.is_a?(GRPC::Core::Channel)
|
111
118
|
channel = credentials
|
@@ -129,6 +136,7 @@ module Google
|
|
129
136
|
google_api_client.freeze
|
130
137
|
|
131
138
|
headers = { :"x-goog-api-client" => google_api_client }
|
139
|
+
headers.merge!(metadata) unless metadata.nil?
|
132
140
|
client_config_file = Pathname.new(__dir__).join(
|
133
141
|
"job_controller_client_config.json"
|
134
142
|
)
|
@@ -141,13 +149,14 @@ module Google
|
|
141
149
|
timeout,
|
142
150
|
page_descriptors: PAGE_DESCRIPTORS,
|
143
151
|
errors: Google::Gax::Grpc::API_ERRORS,
|
144
|
-
|
152
|
+
metadata: headers
|
145
153
|
)
|
146
154
|
end
|
147
155
|
|
148
156
|
# Allow overriding the service path/port in subclasses.
|
149
157
|
service_path = self.class::SERVICE_ADDRESS
|
150
158
|
port = self.class::DEFAULT_SERVICE_PORT
|
159
|
+
interceptors = self.class::GRPC_INTERCEPTORS
|
151
160
|
@job_controller_stub = Google::Gax::Grpc.create_stub(
|
152
161
|
service_path,
|
153
162
|
port,
|
@@ -155,32 +164,39 @@ module Google
|
|
155
164
|
channel: channel,
|
156
165
|
updater_proc: updater_proc,
|
157
166
|
scopes: scopes,
|
167
|
+
interceptors: interceptors,
|
158
168
|
&Google::Cloud::Dataproc::V1::JobController::Stub.method(:new)
|
159
169
|
)
|
160
170
|
|
161
171
|
@submit_job = Google::Gax.create_api_call(
|
162
172
|
@job_controller_stub.method(:submit_job),
|
163
|
-
defaults["submit_job"]
|
173
|
+
defaults["submit_job"],
|
174
|
+
exception_transformer: exception_transformer
|
164
175
|
)
|
165
176
|
@get_job = Google::Gax.create_api_call(
|
166
177
|
@job_controller_stub.method(:get_job),
|
167
|
-
defaults["get_job"]
|
178
|
+
defaults["get_job"],
|
179
|
+
exception_transformer: exception_transformer
|
168
180
|
)
|
169
181
|
@list_jobs = Google::Gax.create_api_call(
|
170
182
|
@job_controller_stub.method(:list_jobs),
|
171
|
-
defaults["list_jobs"]
|
183
|
+
defaults["list_jobs"],
|
184
|
+
exception_transformer: exception_transformer
|
172
185
|
)
|
173
186
|
@update_job = Google::Gax.create_api_call(
|
174
187
|
@job_controller_stub.method(:update_job),
|
175
|
-
defaults["update_job"]
|
188
|
+
defaults["update_job"],
|
189
|
+
exception_transformer: exception_transformer
|
176
190
|
)
|
177
191
|
@cancel_job = Google::Gax.create_api_call(
|
178
192
|
@job_controller_stub.method(:cancel_job),
|
179
|
-
defaults["cancel_job"]
|
193
|
+
defaults["cancel_job"],
|
194
|
+
exception_transformer: exception_transformer
|
180
195
|
)
|
181
196
|
@delete_job = Google::Gax.create_api_call(
|
182
197
|
@job_controller_stub.method(:delete_job),
|
183
|
-
defaults["delete_job"]
|
198
|
+
defaults["delete_job"],
|
199
|
+
exception_transformer: exception_transformer
|
184
200
|
)
|
185
201
|
end
|
186
202
|
|
@@ -200,14 +216,23 @@ module Google
|
|
200
216
|
# @param options [Google::Gax::CallOptions]
|
201
217
|
# Overrides the default settings for this call, e.g, timeout,
|
202
218
|
# retries, etc.
|
219
|
+
# @yield [result, operation] Access the result along with the RPC operation
|
220
|
+
# @yieldparam result [Google::Cloud::Dataproc::V1::Job]
|
221
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
203
222
|
# @return [Google::Cloud::Dataproc::V1::Job]
|
204
223
|
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
205
224
|
# @example
|
206
|
-
# require "google/cloud/dataproc
|
225
|
+
# require "google/cloud/dataproc"
|
226
|
+
#
|
227
|
+
# job_controller_client = Google::Cloud::Dataproc::JobController.new(version: :v1)
|
207
228
|
#
|
208
|
-
#
|
229
|
+
# # TODO: Initialize +project_id+:
|
209
230
|
# project_id = ''
|
231
|
+
#
|
232
|
+
# # TODO: Initialize +region+:
|
210
233
|
# region = ''
|
234
|
+
#
|
235
|
+
# # TODO: Initialize +job+:
|
211
236
|
# job = {}
|
212
237
|
# response = job_controller_client.submit_job(project_id, region, job)
|
213
238
|
|
@@ -215,14 +240,15 @@ module Google
|
|
215
240
|
project_id,
|
216
241
|
region,
|
217
242
|
job,
|
218
|
-
options: nil
|
243
|
+
options: nil,
|
244
|
+
&block
|
219
245
|
req = {
|
220
246
|
project_id: project_id,
|
221
247
|
region: region,
|
222
248
|
job: job
|
223
249
|
}.delete_if { |_, v| v.nil? }
|
224
250
|
req = Google::Gax::to_proto(req, Google::Cloud::Dataproc::V1::SubmitJobRequest)
|
225
|
-
@submit_job.call(req, options)
|
251
|
+
@submit_job.call(req, options, &block)
|
226
252
|
end
|
227
253
|
|
228
254
|
# Gets the resource representation for a job in a project.
|
@@ -237,14 +263,23 @@ module Google
|
|
237
263
|
# @param options [Google::Gax::CallOptions]
|
238
264
|
# Overrides the default settings for this call, e.g, timeout,
|
239
265
|
# retries, etc.
|
266
|
+
# @yield [result, operation] Access the result along with the RPC operation
|
267
|
+
# @yieldparam result [Google::Cloud::Dataproc::V1::Job]
|
268
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
240
269
|
# @return [Google::Cloud::Dataproc::V1::Job]
|
241
270
|
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
242
271
|
# @example
|
243
|
-
# require "google/cloud/dataproc
|
272
|
+
# require "google/cloud/dataproc"
|
273
|
+
#
|
274
|
+
# job_controller_client = Google::Cloud::Dataproc::JobController.new(version: :v1)
|
244
275
|
#
|
245
|
-
#
|
276
|
+
# # TODO: Initialize +project_id+:
|
246
277
|
# project_id = ''
|
278
|
+
#
|
279
|
+
# # TODO: Initialize +region+:
|
247
280
|
# region = ''
|
281
|
+
#
|
282
|
+
# # TODO: Initialize +job_id+:
|
248
283
|
# job_id = ''
|
249
284
|
# response = job_controller_client.get_job(project_id, region, job_id)
|
250
285
|
|
@@ -252,14 +287,15 @@ module Google
|
|
252
287
|
project_id,
|
253
288
|
region,
|
254
289
|
job_id,
|
255
|
-
options: nil
|
290
|
+
options: nil,
|
291
|
+
&block
|
256
292
|
req = {
|
257
293
|
project_id: project_id,
|
258
294
|
region: region,
|
259
295
|
job_id: job_id
|
260
296
|
}.delete_if { |_, v| v.nil? }
|
261
297
|
req = Google::Gax::to_proto(req, Google::Cloud::Dataproc::V1::GetJobRequest)
|
262
|
-
@get_job.call(req, options)
|
298
|
+
@get_job.call(req, options, &block)
|
263
299
|
end
|
264
300
|
|
265
301
|
# Lists regions/{region}/jobs in a project.
|
@@ -301,6 +337,9 @@ module Google
|
|
301
337
|
# @param options [Google::Gax::CallOptions]
|
302
338
|
# Overrides the default settings for this call, e.g, timeout,
|
303
339
|
# retries, etc.
|
340
|
+
# @yield [result, operation] Access the result along with the RPC operation
|
341
|
+
# @yieldparam result [Google::Gax::PagedEnumerable<Google::Cloud::Dataproc::V1::Job>]
|
342
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
304
343
|
# @return [Google::Gax::PagedEnumerable<Google::Cloud::Dataproc::V1::Job>]
|
305
344
|
# An enumerable of Google::Cloud::Dataproc::V1::Job instances.
|
306
345
|
# See Google::Gax::PagedEnumerable documentation for other
|
@@ -308,10 +347,14 @@ module Google
|
|
308
347
|
# object.
|
309
348
|
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
310
349
|
# @example
|
311
|
-
# require "google/cloud/dataproc
|
350
|
+
# require "google/cloud/dataproc"
|
351
|
+
#
|
352
|
+
# job_controller_client = Google::Cloud::Dataproc::JobController.new(version: :v1)
|
312
353
|
#
|
313
|
-
#
|
354
|
+
# # TODO: Initialize +project_id+:
|
314
355
|
# project_id = ''
|
356
|
+
#
|
357
|
+
# # TODO: Initialize +region+:
|
315
358
|
# region = ''
|
316
359
|
#
|
317
360
|
# # Iterate over all results.
|
@@ -334,7 +377,8 @@ module Google
|
|
334
377
|
cluster_name: nil,
|
335
378
|
job_state_matcher: nil,
|
336
379
|
filter: nil,
|
337
|
-
options: nil
|
380
|
+
options: nil,
|
381
|
+
&block
|
338
382
|
req = {
|
339
383
|
project_id: project_id,
|
340
384
|
region: region,
|
@@ -344,7 +388,7 @@ module Google
|
|
344
388
|
filter: filter
|
345
389
|
}.delete_if { |_, v| v.nil? }
|
346
390
|
req = Google::Gax::to_proto(req, Google::Cloud::Dataproc::V1::ListJobsRequest)
|
347
|
-
@list_jobs.call(req, options)
|
391
|
+
@list_jobs.call(req, options, &block)
|
348
392
|
end
|
349
393
|
|
350
394
|
# Updates a job in a project.
|
@@ -372,16 +416,29 @@ module Google
|
|
372
416
|
# @param options [Google::Gax::CallOptions]
|
373
417
|
# Overrides the default settings for this call, e.g, timeout,
|
374
418
|
# retries, etc.
|
419
|
+
# @yield [result, operation] Access the result along with the RPC operation
|
420
|
+
# @yieldparam result [Google::Cloud::Dataproc::V1::Job]
|
421
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
375
422
|
# @return [Google::Cloud::Dataproc::V1::Job]
|
376
423
|
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
377
424
|
# @example
|
378
|
-
# require "google/cloud/dataproc
|
425
|
+
# require "google/cloud/dataproc"
|
426
|
+
#
|
427
|
+
# job_controller_client = Google::Cloud::Dataproc::JobController.new(version: :v1)
|
379
428
|
#
|
380
|
-
#
|
429
|
+
# # TODO: Initialize +project_id+:
|
381
430
|
# project_id = ''
|
431
|
+
#
|
432
|
+
# # TODO: Initialize +region+:
|
382
433
|
# region = ''
|
434
|
+
#
|
435
|
+
# # TODO: Initialize +job_id+:
|
383
436
|
# job_id = ''
|
437
|
+
#
|
438
|
+
# # TODO: Initialize +job+:
|
384
439
|
# job = {}
|
440
|
+
#
|
441
|
+
# # TODO: Initialize +update_mask+:
|
385
442
|
# update_mask = {}
|
386
443
|
# response = job_controller_client.update_job(project_id, region, job_id, job, update_mask)
|
387
444
|
|
@@ -391,7 +448,8 @@ module Google
|
|
391
448
|
job_id,
|
392
449
|
job,
|
393
450
|
update_mask,
|
394
|
-
options: nil
|
451
|
+
options: nil,
|
452
|
+
&block
|
395
453
|
req = {
|
396
454
|
project_id: project_id,
|
397
455
|
region: region,
|
@@ -400,7 +458,7 @@ module Google
|
|
400
458
|
update_mask: update_mask
|
401
459
|
}.delete_if { |_, v| v.nil? }
|
402
460
|
req = Google::Gax::to_proto(req, Google::Cloud::Dataproc::V1::UpdateJobRequest)
|
403
|
-
@update_job.call(req, options)
|
461
|
+
@update_job.call(req, options, &block)
|
404
462
|
end
|
405
463
|
|
406
464
|
# Starts a job cancellation request. To access the job resource
|
@@ -418,14 +476,23 @@ module Google
|
|
418
476
|
# @param options [Google::Gax::CallOptions]
|
419
477
|
# Overrides the default settings for this call, e.g, timeout,
|
420
478
|
# retries, etc.
|
479
|
+
# @yield [result, operation] Access the result along with the RPC operation
|
480
|
+
# @yieldparam result [Google::Cloud::Dataproc::V1::Job]
|
481
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
421
482
|
# @return [Google::Cloud::Dataproc::V1::Job]
|
422
483
|
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
423
484
|
# @example
|
424
|
-
# require "google/cloud/dataproc
|
485
|
+
# require "google/cloud/dataproc"
|
486
|
+
#
|
487
|
+
# job_controller_client = Google::Cloud::Dataproc::JobController.new(version: :v1)
|
425
488
|
#
|
426
|
-
#
|
489
|
+
# # TODO: Initialize +project_id+:
|
427
490
|
# project_id = ''
|
491
|
+
#
|
492
|
+
# # TODO: Initialize +region+:
|
428
493
|
# region = ''
|
494
|
+
#
|
495
|
+
# # TODO: Initialize +job_id+:
|
429
496
|
# job_id = ''
|
430
497
|
# response = job_controller_client.cancel_job(project_id, region, job_id)
|
431
498
|
|
@@ -433,14 +500,15 @@ module Google
|
|
433
500
|
project_id,
|
434
501
|
region,
|
435
502
|
job_id,
|
436
|
-
options: nil
|
503
|
+
options: nil,
|
504
|
+
&block
|
437
505
|
req = {
|
438
506
|
project_id: project_id,
|
439
507
|
region: region,
|
440
508
|
job_id: job_id
|
441
509
|
}.delete_if { |_, v| v.nil? }
|
442
510
|
req = Google::Gax::to_proto(req, Google::Cloud::Dataproc::V1::CancelJobRequest)
|
443
|
-
@cancel_job.call(req, options)
|
511
|
+
@cancel_job.call(req, options, &block)
|
444
512
|
end
|
445
513
|
|
446
514
|
# Deletes the job from the project. If the job is active, the delete fails,
|
@@ -456,13 +524,22 @@ module Google
|
|
456
524
|
# @param options [Google::Gax::CallOptions]
|
457
525
|
# Overrides the default settings for this call, e.g, timeout,
|
458
526
|
# retries, etc.
|
527
|
+
# @yield [result, operation] Access the result along with the RPC operation
|
528
|
+
# @yieldparam result []
|
529
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
459
530
|
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
460
531
|
# @example
|
461
|
-
# require "google/cloud/dataproc
|
532
|
+
# require "google/cloud/dataproc"
|
533
|
+
#
|
534
|
+
# job_controller_client = Google::Cloud::Dataproc::JobController.new(version: :v1)
|
462
535
|
#
|
463
|
-
#
|
536
|
+
# # TODO: Initialize +project_id+:
|
464
537
|
# project_id = ''
|
538
|
+
#
|
539
|
+
# # TODO: Initialize +region+:
|
465
540
|
# region = ''
|
541
|
+
#
|
542
|
+
# # TODO: Initialize +job_id+:
|
466
543
|
# job_id = ''
|
467
544
|
# job_controller_client.delete_job(project_id, region, job_id)
|
468
545
|
|
@@ -470,14 +547,15 @@ module Google
|
|
470
547
|
project_id,
|
471
548
|
region,
|
472
549
|
job_id,
|
473
|
-
options: nil
|
550
|
+
options: nil,
|
551
|
+
&block
|
474
552
|
req = {
|
475
553
|
project_id: project_id,
|
476
554
|
region: region,
|
477
555
|
job_id: job_id
|
478
556
|
}.delete_if { |_, v| v.nil? }
|
479
557
|
req = Google::Gax::to_proto(req, Google::Cloud::Dataproc::V1::DeleteJobRequest)
|
480
|
-
@delete_job.call(req, options)
|
558
|
+
@delete_job.call(req, options, &block)
|
481
559
|
nil
|
482
560
|
end
|
483
561
|
end
|