google-cloud-dataproc 0.10.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +3 -2
- data/AUTHENTICATION.md +51 -59
- data/LICENSE.md +203 -0
- data/MIGRATING.md +310 -0
- data/README.md +33 -44
- data/lib/{google/cloud/dataproc/v1/doc/google/protobuf/empty.rb → google-cloud-dataproc.rb} +4 -14
- data/lib/google/cloud/dataproc.rb +167 -305
- data/lib/google/cloud/dataproc/version.rb +6 -2
- metadata +97 -100
- data/LICENSE +0 -201
- data/lib/google/cloud/dataproc/v1.rb +0 -371
- data/lib/google/cloud/dataproc/v1/autoscaling_policies_pb.rb +0 -80
- data/lib/google/cloud/dataproc/v1/autoscaling_policies_services_pb.rb +0 -59
- data/lib/google/cloud/dataproc/v1/autoscaling_policy_service_client.rb +0 -494
- data/lib/google/cloud/dataproc/v1/autoscaling_policy_service_client_config.json +0 -51
- data/lib/google/cloud/dataproc/v1/cluster_controller_client.rb +0 -824
- data/lib/google/cloud/dataproc/v1/cluster_controller_client_config.json +0 -59
- data/lib/google/cloud/dataproc/v1/clusters_pb.rb +0 -234
- data/lib/google/cloud/dataproc/v1/clusters_services_pb.rb +0 -69
- data/lib/google/cloud/dataproc/v1/credentials.rb +0 -41
- data/lib/google/cloud/dataproc/v1/doc/google/cloud/dataproc/v1/autoscaling_policies.rb +0 -238
- data/lib/google/cloud/dataproc/v1/doc/google/cloud/dataproc/v1/clusters.rb +0 -819
- data/lib/google/cloud/dataproc/v1/doc/google/cloud/dataproc/v1/jobs.rb +0 -759
- data/lib/google/cloud/dataproc/v1/doc/google/cloud/dataproc/v1/workflow_templates.rb +0 -566
- data/lib/google/cloud/dataproc/v1/doc/google/longrunning/operations.rb +0 -51
- data/lib/google/cloud/dataproc/v1/doc/google/protobuf/any.rb +0 -131
- data/lib/google/cloud/dataproc/v1/doc/google/protobuf/duration.rb +0 -91
- data/lib/google/cloud/dataproc/v1/doc/google/protobuf/field_mask.rb +0 -222
- data/lib/google/cloud/dataproc/v1/doc/google/protobuf/timestamp.rb +0 -113
- data/lib/google/cloud/dataproc/v1/doc/google/rpc/status.rb +0 -39
- data/lib/google/cloud/dataproc/v1/job_controller_client.rb +0 -592
- data/lib/google/cloud/dataproc/v1/job_controller_client_config.json +0 -59
- data/lib/google/cloud/dataproc/v1/jobs_pb.rb +0 -273
- data/lib/google/cloud/dataproc/v1/jobs_services_pb.rb +0 -61
- data/lib/google/cloud/dataproc/v1/operations_pb.rb +0 -45
- data/lib/google/cloud/dataproc/v1/shared_pb.rb +0 -26
- data/lib/google/cloud/dataproc/v1/workflow_template_service_client.rb +0 -770
- data/lib/google/cloud/dataproc/v1/workflow_template_service_client_config.json +0 -64
- data/lib/google/cloud/dataproc/v1/workflow_templates_pb.rb +0 -184
- data/lib/google/cloud/dataproc/v1/workflow_templates_services_pb.rb +0 -105
- data/lib/google/cloud/dataproc/v1beta2.rb +0 -371
- data/lib/google/cloud/dataproc/v1beta2/autoscaling_policies_pb.rb +0 -80
- data/lib/google/cloud/dataproc/v1beta2/autoscaling_policies_services_pb.rb +0 -59
- data/lib/google/cloud/dataproc/v1beta2/autoscaling_policy_service_client.rb +0 -494
- data/lib/google/cloud/dataproc/v1beta2/autoscaling_policy_service_client_config.json +0 -51
- data/lib/google/cloud/dataproc/v1beta2/cluster_controller_client.rb +0 -833
- data/lib/google/cloud/dataproc/v1beta2/cluster_controller_client_config.json +0 -59
- data/lib/google/cloud/dataproc/v1beta2/clusters_pb.rb +0 -241
- data/lib/google/cloud/dataproc/v1beta2/clusters_services_pb.rb +0 -69
- data/lib/google/cloud/dataproc/v1beta2/credentials.rb +0 -41
- data/lib/google/cloud/dataproc/v1beta2/doc/google/cloud/dataproc/v1beta2/autoscaling_policies.rb +0 -238
- data/lib/google/cloud/dataproc/v1beta2/doc/google/cloud/dataproc/v1beta2/clusters.rb +0 -841
- data/lib/google/cloud/dataproc/v1beta2/doc/google/cloud/dataproc/v1beta2/jobs.rb +0 -728
- data/lib/google/cloud/dataproc/v1beta2/doc/google/cloud/dataproc/v1beta2/workflow_templates.rb +0 -579
- data/lib/google/cloud/dataproc/v1beta2/doc/google/longrunning/operations.rb +0 -51
- data/lib/google/cloud/dataproc/v1beta2/doc/google/protobuf/any.rb +0 -131
- data/lib/google/cloud/dataproc/v1beta2/doc/google/protobuf/duration.rb +0 -91
- data/lib/google/cloud/dataproc/v1beta2/doc/google/protobuf/empty.rb +0 -29
- data/lib/google/cloud/dataproc/v1beta2/doc/google/protobuf/field_mask.rb +0 -222
- data/lib/google/cloud/dataproc/v1beta2/doc/google/protobuf/timestamp.rb +0 -113
- data/lib/google/cloud/dataproc/v1beta2/doc/google/rpc/status.rb +0 -39
- data/lib/google/cloud/dataproc/v1beta2/job_controller_client.rb +0 -592
- data/lib/google/cloud/dataproc/v1beta2/job_controller_client_config.json +0 -59
- data/lib/google/cloud/dataproc/v1beta2/jobs_pb.rb +0 -261
- data/lib/google/cloud/dataproc/v1beta2/jobs_services_pb.rb +0 -61
- data/lib/google/cloud/dataproc/v1beta2/operations_pb.rb +0 -44
- data/lib/google/cloud/dataproc/v1beta2/shared_pb.rb +0 -30
- data/lib/google/cloud/dataproc/v1beta2/workflow_template_service_client.rb +0 -778
- data/lib/google/cloud/dataproc/v1beta2/workflow_template_service_client_config.json +0 -64
- data/lib/google/cloud/dataproc/v1beta2/workflow_templates_pb.rb +0 -186
- data/lib/google/cloud/dataproc/v1beta2/workflow_templates_services_pb.rb +0 -105
@@ -1,113 +0,0 @@
|
|
1
|
-
# Copyright 2020 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
|
-
|
16
|
-
module Google
|
17
|
-
module Protobuf
|
18
|
-
# A Timestamp represents a point in time independent of any time zone or local
|
19
|
-
# calendar, encoded as a count of seconds and fractions of seconds at
|
20
|
-
# nanosecond resolution. The count is relative to an epoch at UTC midnight on
|
21
|
-
# January 1, 1970, in the proleptic Gregorian calendar which extends the
|
22
|
-
# Gregorian calendar backwards to year one.
|
23
|
-
#
|
24
|
-
# All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
|
25
|
-
# second table is needed for interpretation, using a [24-hour linear
|
26
|
-
# smear](https://developers.google.com/time/smear).
|
27
|
-
#
|
28
|
-
# The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
|
29
|
-
# restricting to that range, we ensure that we can convert to and from [RFC
|
30
|
-
# 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
|
31
|
-
#
|
32
|
-
# = Examples
|
33
|
-
#
|
34
|
-
# Example 1: Compute Timestamp from POSIX `time()`.
|
35
|
-
#
|
36
|
-
# Timestamp timestamp;
|
37
|
-
# timestamp.set_seconds(time(NULL));
|
38
|
-
# timestamp.set_nanos(0);
|
39
|
-
#
|
40
|
-
# Example 2: Compute Timestamp from POSIX `gettimeofday()`.
|
41
|
-
#
|
42
|
-
# struct timeval tv;
|
43
|
-
# gettimeofday(&tv, NULL);
|
44
|
-
#
|
45
|
-
# Timestamp timestamp;
|
46
|
-
# timestamp.set_seconds(tv.tv_sec);
|
47
|
-
# timestamp.set_nanos(tv.tv_usec * 1000);
|
48
|
-
#
|
49
|
-
# Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
|
50
|
-
#
|
51
|
-
# FILETIME ft;
|
52
|
-
# GetSystemTimeAsFileTime(&ft);
|
53
|
-
# UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
|
54
|
-
#
|
55
|
-
# // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
|
56
|
-
# // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
|
57
|
-
# Timestamp timestamp;
|
58
|
-
# timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
|
59
|
-
# timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
|
60
|
-
#
|
61
|
-
# Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
|
62
|
-
#
|
63
|
-
# long millis = System.currentTimeMillis();
|
64
|
-
#
|
65
|
-
# Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
|
66
|
-
# .setNanos((int) ((millis % 1000) * 1000000)).build();
|
67
|
-
#
|
68
|
-
#
|
69
|
-
# Example 5: Compute Timestamp from current time in Python.
|
70
|
-
#
|
71
|
-
# timestamp = Timestamp()
|
72
|
-
# timestamp.GetCurrentTime()
|
73
|
-
#
|
74
|
-
# = JSON Mapping
|
75
|
-
#
|
76
|
-
# In JSON format, the Timestamp type is encoded as a string in the
|
77
|
-
# [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
|
78
|
-
# format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z"
|
79
|
-
# where \\{year} is always expressed using four digits while \\{month}, \\{day},
|
80
|
-
# \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional
|
81
|
-
# seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
|
82
|
-
# are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
|
83
|
-
# is required. A proto3 JSON serializer should always use UTC (as indicated by
|
84
|
-
# "Z") when printing the Timestamp type and a proto3 JSON parser should be
|
85
|
-
# able to accept both UTC and other timezones (as indicated by an offset).
|
86
|
-
#
|
87
|
-
# For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
|
88
|
-
# 01:30 UTC on January 15, 2017.
|
89
|
-
#
|
90
|
-
# In JavaScript, one can convert a Date object to this format using the
|
91
|
-
# standard
|
92
|
-
# [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
|
93
|
-
# method. In Python, a standard `datetime.datetime` object can be converted
|
94
|
-
# to this format using
|
95
|
-
# [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
|
96
|
-
# the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
|
97
|
-
# the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
98
|
-
# http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
|
99
|
-
# ) to obtain a formatter capable of generating timestamps in this format.
|
100
|
-
# @!attribute [rw] seconds
|
101
|
-
# @return [Integer]
|
102
|
-
# Represents seconds of UTC time since Unix epoch
|
103
|
-
# 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
|
104
|
-
# 9999-12-31T23:59:59Z inclusive.
|
105
|
-
# @!attribute [rw] nanos
|
106
|
-
# @return [Integer]
|
107
|
-
# Non-negative fractions of a second at nanosecond resolution. Negative
|
108
|
-
# second values with fractions must still have non-negative nanos values
|
109
|
-
# that count forward in time. Must be from 0 to 999,999,999
|
110
|
-
# inclusive.
|
111
|
-
class Timestamp; end
|
112
|
-
end
|
113
|
-
end
|
@@ -1,39 +0,0 @@
|
|
1
|
-
# Copyright 2020 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
|
-
|
16
|
-
module Google
|
17
|
-
module Rpc
|
18
|
-
# The `Status` type defines a logical error model that is suitable for
|
19
|
-
# different programming environments, including REST APIs and RPC APIs. It is
|
20
|
-
# used by [gRPC](https://github.com/grpc). Each `Status` message contains
|
21
|
-
# three pieces of data: error code, error message, and error details.
|
22
|
-
#
|
23
|
-
# You can find out more about this error model and how to work with it in the
|
24
|
-
# [API Design Guide](https://cloud.google.com/apis/design/errors).
|
25
|
-
# @!attribute [rw] code
|
26
|
-
# @return [Integer]
|
27
|
-
# The status code, which should be an enum value of {Google::Rpc::Code}.
|
28
|
-
# @!attribute [rw] message
|
29
|
-
# @return [String]
|
30
|
-
# A developer-facing error message, which should be in English. Any
|
31
|
-
# user-facing error message should be localized and sent in the
|
32
|
-
# {Google::Rpc::Status#details} field, or localized by the client.
|
33
|
-
# @!attribute [rw] details
|
34
|
-
# @return [Array<Google::Protobuf::Any>]
|
35
|
-
# A list of messages that carry the error details. There is a common set of
|
36
|
-
# message types for APIs to use.
|
37
|
-
class Status; end
|
38
|
-
end
|
39
|
-
end
|
@@ -1,592 +0,0 @@
|
|
1
|
-
# Copyright 2020 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
|
-
# EDITING INSTRUCTIONS
|
16
|
-
# This file was generated from the file
|
17
|
-
# https://github.com/googleapis/googleapis/blob/master/google/cloud/dataproc/v1/jobs.proto,
|
18
|
-
# and updates to that file get reflected here through a refresh process.
|
19
|
-
# For the short term, the refresh process will only be runnable by Google
|
20
|
-
# engineers.
|
21
|
-
|
22
|
-
|
23
|
-
require "json"
|
24
|
-
require "pathname"
|
25
|
-
|
26
|
-
require "google/gax"
|
27
|
-
|
28
|
-
require "google/cloud/dataproc/v1/jobs_pb"
|
29
|
-
require "google/cloud/dataproc/v1/credentials"
|
30
|
-
require "google/cloud/dataproc/version"
|
31
|
-
|
32
|
-
module Google
|
33
|
-
module Cloud
|
34
|
-
module Dataproc
|
35
|
-
module V1
|
36
|
-
# The JobController provides methods to manage jobs.
|
37
|
-
#
|
38
|
-
# @!attribute [r] job_controller_stub
|
39
|
-
# @return [Google::Cloud::Dataproc::V1::JobController::Stub]
|
40
|
-
class JobControllerClient
|
41
|
-
# @private
|
42
|
-
attr_reader :job_controller_stub
|
43
|
-
|
44
|
-
# The default address of the service.
|
45
|
-
SERVICE_ADDRESS = "dataproc.googleapis.com".freeze
|
46
|
-
|
47
|
-
# The default port of the service.
|
48
|
-
DEFAULT_SERVICE_PORT = 443
|
49
|
-
|
50
|
-
# The default set of gRPC interceptors.
|
51
|
-
GRPC_INTERCEPTORS = []
|
52
|
-
|
53
|
-
DEFAULT_TIMEOUT = 30
|
54
|
-
|
55
|
-
PAGE_DESCRIPTORS = {
|
56
|
-
"list_jobs" => Google::Gax::PageDescriptor.new(
|
57
|
-
"page_token",
|
58
|
-
"next_page_token",
|
59
|
-
"jobs")
|
60
|
-
}.freeze
|
61
|
-
|
62
|
-
private_constant :PAGE_DESCRIPTORS
|
63
|
-
|
64
|
-
# The scopes needed to make gRPC calls to all of the methods defined in
|
65
|
-
# this service.
|
66
|
-
ALL_SCOPES = [
|
67
|
-
"https://www.googleapis.com/auth/cloud-platform"
|
68
|
-
].freeze
|
69
|
-
|
70
|
-
|
71
|
-
# @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
|
72
|
-
# Provides the means for authenticating requests made by the client. This parameter can
|
73
|
-
# be many types.
|
74
|
-
# A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
|
75
|
-
# authenticating requests made by this client.
|
76
|
-
# A `String` will be treated as the path to the keyfile to be used for the construction of
|
77
|
-
# credentials for this client.
|
78
|
-
# A `Hash` will be treated as the contents of a keyfile to be used for the construction of
|
79
|
-
# credentials for this client.
|
80
|
-
# A `GRPC::Core::Channel` will be used to make calls through.
|
81
|
-
# A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
|
82
|
-
# should already be composed with a `GRPC::Core::CallCredentials` object.
|
83
|
-
# A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
|
84
|
-
# metadata for requests, generally, to give OAuth credentials.
|
85
|
-
# @param scopes [Array<String>]
|
86
|
-
# The OAuth scopes for this service. This parameter is ignored if
|
87
|
-
# an updater_proc is supplied.
|
88
|
-
# @param client_config [Hash]
|
89
|
-
# A Hash for call options for each method. See
|
90
|
-
# Google::Gax#construct_settings for the structure of
|
91
|
-
# this data. Falls back to the default config if not specified
|
92
|
-
# or the specified config is missing data points.
|
93
|
-
# @param timeout [Numeric]
|
94
|
-
# The default timeout, in seconds, for calls made through this client.
|
95
|
-
# @param metadata [Hash]
|
96
|
-
# Default metadata to be sent with each request. This can be overridden on a per call basis.
|
97
|
-
# @param service_address [String]
|
98
|
-
# Override for the service hostname, or `nil` to leave as the default.
|
99
|
-
# @param service_port [Integer]
|
100
|
-
# Override for the service port, or `nil` to leave as the default.
|
101
|
-
# @param exception_transformer [Proc]
|
102
|
-
# An optional proc that intercepts any exceptions raised during an API call to inject
|
103
|
-
# custom error handling.
|
104
|
-
def initialize \
|
105
|
-
credentials: nil,
|
106
|
-
scopes: ALL_SCOPES,
|
107
|
-
client_config: {},
|
108
|
-
timeout: DEFAULT_TIMEOUT,
|
109
|
-
metadata: nil,
|
110
|
-
service_address: nil,
|
111
|
-
service_port: nil,
|
112
|
-
exception_transformer: nil,
|
113
|
-
lib_name: nil,
|
114
|
-
lib_version: ""
|
115
|
-
# These require statements are intentionally placed here to initialize
|
116
|
-
# the gRPC module only when it's required.
|
117
|
-
# See https://github.com/googleapis/toolkit/issues/446
|
118
|
-
require "google/gax/grpc"
|
119
|
-
require "google/cloud/dataproc/v1/jobs_services_pb"
|
120
|
-
|
121
|
-
credentials ||= Google::Cloud::Dataproc::V1::Credentials.default
|
122
|
-
|
123
|
-
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
124
|
-
updater_proc = Google::Cloud::Dataproc::V1::Credentials.new(credentials).updater_proc
|
125
|
-
end
|
126
|
-
if credentials.is_a?(GRPC::Core::Channel)
|
127
|
-
channel = credentials
|
128
|
-
end
|
129
|
-
if credentials.is_a?(GRPC::Core::ChannelCredentials)
|
130
|
-
chan_creds = credentials
|
131
|
-
end
|
132
|
-
if credentials.is_a?(Proc)
|
133
|
-
updater_proc = credentials
|
134
|
-
end
|
135
|
-
if credentials.is_a?(Google::Auth::Credentials)
|
136
|
-
updater_proc = credentials.updater_proc
|
137
|
-
end
|
138
|
-
|
139
|
-
package_version = Google::Cloud::Dataproc::VERSION
|
140
|
-
|
141
|
-
google_api_client = "gl-ruby/#{RUBY_VERSION}"
|
142
|
-
google_api_client << " #{lib_name}/#{lib_version}" if lib_name
|
143
|
-
google_api_client << " gapic/#{package_version} gax/#{Google::Gax::VERSION}"
|
144
|
-
google_api_client << " grpc/#{GRPC::VERSION}"
|
145
|
-
google_api_client.freeze
|
146
|
-
|
147
|
-
headers = { :"x-goog-api-client" => google_api_client }
|
148
|
-
if credentials.respond_to?(:quota_project_id) && credentials.quota_project_id
|
149
|
-
headers[:"x-goog-user-project"] = credentials.quota_project_id
|
150
|
-
end
|
151
|
-
headers.merge!(metadata) unless metadata.nil?
|
152
|
-
client_config_file = Pathname.new(__dir__).join(
|
153
|
-
"job_controller_client_config.json"
|
154
|
-
)
|
155
|
-
defaults = client_config_file.open do |f|
|
156
|
-
Google::Gax.construct_settings(
|
157
|
-
"google.cloud.dataproc.v1.JobController",
|
158
|
-
JSON.parse(f.read),
|
159
|
-
client_config,
|
160
|
-
Google::Gax::Grpc::STATUS_CODE_NAMES,
|
161
|
-
timeout,
|
162
|
-
page_descriptors: PAGE_DESCRIPTORS,
|
163
|
-
errors: Google::Gax::Grpc::API_ERRORS,
|
164
|
-
metadata: headers
|
165
|
-
)
|
166
|
-
end
|
167
|
-
|
168
|
-
# Allow overriding the service path/port in subclasses.
|
169
|
-
service_path = service_address || self.class::SERVICE_ADDRESS
|
170
|
-
port = service_port || self.class::DEFAULT_SERVICE_PORT
|
171
|
-
interceptors = self.class::GRPC_INTERCEPTORS
|
172
|
-
@job_controller_stub = Google::Gax::Grpc.create_stub(
|
173
|
-
service_path,
|
174
|
-
port,
|
175
|
-
chan_creds: chan_creds,
|
176
|
-
channel: channel,
|
177
|
-
updater_proc: updater_proc,
|
178
|
-
scopes: scopes,
|
179
|
-
interceptors: interceptors,
|
180
|
-
&Google::Cloud::Dataproc::V1::JobController::Stub.method(:new)
|
181
|
-
)
|
182
|
-
|
183
|
-
@submit_job = Google::Gax.create_api_call(
|
184
|
-
@job_controller_stub.method(:submit_job),
|
185
|
-
defaults["submit_job"],
|
186
|
-
exception_transformer: exception_transformer
|
187
|
-
)
|
188
|
-
@get_job = Google::Gax.create_api_call(
|
189
|
-
@job_controller_stub.method(:get_job),
|
190
|
-
defaults["get_job"],
|
191
|
-
exception_transformer: exception_transformer
|
192
|
-
)
|
193
|
-
@list_jobs = Google::Gax.create_api_call(
|
194
|
-
@job_controller_stub.method(:list_jobs),
|
195
|
-
defaults["list_jobs"],
|
196
|
-
exception_transformer: exception_transformer
|
197
|
-
)
|
198
|
-
@update_job = Google::Gax.create_api_call(
|
199
|
-
@job_controller_stub.method(:update_job),
|
200
|
-
defaults["update_job"],
|
201
|
-
exception_transformer: exception_transformer
|
202
|
-
)
|
203
|
-
@cancel_job = Google::Gax.create_api_call(
|
204
|
-
@job_controller_stub.method(:cancel_job),
|
205
|
-
defaults["cancel_job"],
|
206
|
-
exception_transformer: exception_transformer
|
207
|
-
)
|
208
|
-
@delete_job = Google::Gax.create_api_call(
|
209
|
-
@job_controller_stub.method(:delete_job),
|
210
|
-
defaults["delete_job"],
|
211
|
-
exception_transformer: exception_transformer
|
212
|
-
)
|
213
|
-
end
|
214
|
-
|
215
|
-
# Service calls
|
216
|
-
|
217
|
-
# Submits a job to a cluster.
|
218
|
-
#
|
219
|
-
# @param project_id [String]
|
220
|
-
# Required. The ID of the Google Cloud Platform project that the job
|
221
|
-
# belongs to.
|
222
|
-
# @param region [String]
|
223
|
-
# Required. The Dataproc region in which to handle the request.
|
224
|
-
# @param job [Google::Cloud::Dataproc::V1::Job | Hash]
|
225
|
-
# Required. The job resource.
|
226
|
-
# A hash of the same form as `Google::Cloud::Dataproc::V1::Job`
|
227
|
-
# can also be provided.
|
228
|
-
# @param request_id [String]
|
229
|
-
# Optional. A unique id used to identify the request. If the server
|
230
|
-
# receives two {Google::Cloud::Dataproc::V1::SubmitJobRequest SubmitJobRequest} requests with the same
|
231
|
-
# id, then the second request will be ignored and the
|
232
|
-
# first {Google::Cloud::Dataproc::V1::Job Job} created and stored in the backend
|
233
|
-
# is returned.
|
234
|
-
#
|
235
|
-
# It is recommended to always set this value to a
|
236
|
-
# [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
|
237
|
-
#
|
238
|
-
# The id must contain only letters (a-z, A-Z), numbers (0-9),
|
239
|
-
# underscores (_), and hyphens (-). The maximum length is 40 characters.
|
240
|
-
# @param options [Google::Gax::CallOptions]
|
241
|
-
# Overrides the default settings for this call, e.g, timeout,
|
242
|
-
# retries, etc.
|
243
|
-
# @yield [result, operation] Access the result along with the RPC operation
|
244
|
-
# @yieldparam result [Google::Cloud::Dataproc::V1::Job]
|
245
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
246
|
-
# @return [Google::Cloud::Dataproc::V1::Job]
|
247
|
-
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
248
|
-
# @example
|
249
|
-
# require "google/cloud/dataproc"
|
250
|
-
#
|
251
|
-
# job_controller_client = Google::Cloud::Dataproc::JobController.new(version: :v1)
|
252
|
-
#
|
253
|
-
# # TODO: Initialize `project_id`:
|
254
|
-
# project_id = ''
|
255
|
-
#
|
256
|
-
# # TODO: Initialize `region`:
|
257
|
-
# region = ''
|
258
|
-
#
|
259
|
-
# # TODO: Initialize `job`:
|
260
|
-
# job = {}
|
261
|
-
# response = job_controller_client.submit_job(project_id, region, job)
|
262
|
-
|
263
|
-
def submit_job \
|
264
|
-
project_id,
|
265
|
-
region,
|
266
|
-
job,
|
267
|
-
request_id: nil,
|
268
|
-
options: nil,
|
269
|
-
&block
|
270
|
-
req = {
|
271
|
-
project_id: project_id,
|
272
|
-
region: region,
|
273
|
-
job: job,
|
274
|
-
request_id: request_id
|
275
|
-
}.delete_if { |_, v| v.nil? }
|
276
|
-
req = Google::Gax::to_proto(req, Google::Cloud::Dataproc::V1::SubmitJobRequest)
|
277
|
-
@submit_job.call(req, options, &block)
|
278
|
-
end
|
279
|
-
|
280
|
-
# Gets the resource representation for a job in a project.
|
281
|
-
#
|
282
|
-
# @param project_id [String]
|
283
|
-
# Required. The ID of the Google Cloud Platform project that the job
|
284
|
-
# belongs to.
|
285
|
-
# @param region [String]
|
286
|
-
# Required. The Dataproc region in which to handle the request.
|
287
|
-
# @param job_id [String]
|
288
|
-
# Required. The job ID.
|
289
|
-
# @param options [Google::Gax::CallOptions]
|
290
|
-
# Overrides the default settings for this call, e.g, timeout,
|
291
|
-
# retries, etc.
|
292
|
-
# @yield [result, operation] Access the result along with the RPC operation
|
293
|
-
# @yieldparam result [Google::Cloud::Dataproc::V1::Job]
|
294
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
295
|
-
# @return [Google::Cloud::Dataproc::V1::Job]
|
296
|
-
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
297
|
-
# @example
|
298
|
-
# require "google/cloud/dataproc"
|
299
|
-
#
|
300
|
-
# job_controller_client = Google::Cloud::Dataproc::JobController.new(version: :v1)
|
301
|
-
#
|
302
|
-
# # TODO: Initialize `project_id`:
|
303
|
-
# project_id = ''
|
304
|
-
#
|
305
|
-
# # TODO: Initialize `region`:
|
306
|
-
# region = ''
|
307
|
-
#
|
308
|
-
# # TODO: Initialize `job_id`:
|
309
|
-
# job_id = ''
|
310
|
-
# response = job_controller_client.get_job(project_id, region, job_id)
|
311
|
-
|
312
|
-
def get_job \
|
313
|
-
project_id,
|
314
|
-
region,
|
315
|
-
job_id,
|
316
|
-
options: nil,
|
317
|
-
&block
|
318
|
-
req = {
|
319
|
-
project_id: project_id,
|
320
|
-
region: region,
|
321
|
-
job_id: job_id
|
322
|
-
}.delete_if { |_, v| v.nil? }
|
323
|
-
req = Google::Gax::to_proto(req, Google::Cloud::Dataproc::V1::GetJobRequest)
|
324
|
-
@get_job.call(req, options, &block)
|
325
|
-
end
|
326
|
-
|
327
|
-
# Lists regions/\\{region}/jobs in a project.
|
328
|
-
#
|
329
|
-
# @param project_id [String]
|
330
|
-
# Required. The ID of the Google Cloud Platform project that the job
|
331
|
-
# belongs to.
|
332
|
-
# @param region [String]
|
333
|
-
# Required. The Dataproc region in which to handle the request.
|
334
|
-
# @param page_size [Integer]
|
335
|
-
# The maximum number of resources contained in the underlying API
|
336
|
-
# response. If page streaming is performed per-resource, this
|
337
|
-
# parameter does not affect the return value. If page streaming is
|
338
|
-
# performed per-page, this determines the maximum number of
|
339
|
-
# resources in a page.
|
340
|
-
# @param cluster_name [String]
|
341
|
-
# Optional. If set, the returned jobs list includes only jobs that were
|
342
|
-
# submitted to the named cluster.
|
343
|
-
# @param job_state_matcher [Google::Cloud::Dataproc::V1::ListJobsRequest::JobStateMatcher]
|
344
|
-
# Optional. Specifies enumerated categories of jobs to list.
|
345
|
-
# (default = match ALL jobs).
|
346
|
-
#
|
347
|
-
# If `filter` is provided, `jobStateMatcher` will be ignored.
|
348
|
-
# @param filter [String]
|
349
|
-
# Optional. A filter constraining the jobs to list. Filters are
|
350
|
-
# case-sensitive and have the following syntax:
|
351
|
-
#
|
352
|
-
# [field = value] AND [field [= value]] ...
|
353
|
-
#
|
354
|
-
# where **field** is `status.state` or `labels.[KEY]`, and `[KEY]` is a label
|
355
|
-
# key. **value** can be `*` to match all values.
|
356
|
-
# `status.state` can be either `ACTIVE` or `NON_ACTIVE`.
|
357
|
-
# Only the logical `AND` operator is supported; space-separated items are
|
358
|
-
# treated as having an implicit `AND` operator.
|
359
|
-
#
|
360
|
-
# Example filter:
|
361
|
-
#
|
362
|
-
# status.state = ACTIVE AND labels.env = staging AND labels.starred = *
|
363
|
-
# @param options [Google::Gax::CallOptions]
|
364
|
-
# Overrides the default settings for this call, e.g, timeout,
|
365
|
-
# retries, etc.
|
366
|
-
# @yield [result, operation] Access the result along with the RPC operation
|
367
|
-
# @yieldparam result [Google::Gax::PagedEnumerable<Google::Cloud::Dataproc::V1::Job>]
|
368
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
369
|
-
# @return [Google::Gax::PagedEnumerable<Google::Cloud::Dataproc::V1::Job>]
|
370
|
-
# An enumerable of Google::Cloud::Dataproc::V1::Job instances.
|
371
|
-
# See Google::Gax::PagedEnumerable documentation for other
|
372
|
-
# operations such as per-page iteration or access to the response
|
373
|
-
# object.
|
374
|
-
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
375
|
-
# @example
|
376
|
-
# require "google/cloud/dataproc"
|
377
|
-
#
|
378
|
-
# job_controller_client = Google::Cloud::Dataproc::JobController.new(version: :v1)
|
379
|
-
#
|
380
|
-
# # TODO: Initialize `project_id`:
|
381
|
-
# project_id = ''
|
382
|
-
#
|
383
|
-
# # TODO: Initialize `region`:
|
384
|
-
# region = ''
|
385
|
-
#
|
386
|
-
# # Iterate over all results.
|
387
|
-
# job_controller_client.list_jobs(project_id, region).each do |element|
|
388
|
-
# # Process element.
|
389
|
-
# end
|
390
|
-
#
|
391
|
-
# # Or iterate over results one page at a time.
|
392
|
-
# job_controller_client.list_jobs(project_id, region).each_page do |page|
|
393
|
-
# # Process each page at a time.
|
394
|
-
# page.each do |element|
|
395
|
-
# # Process element.
|
396
|
-
# end
|
397
|
-
# end
|
398
|
-
|
399
|
-
def list_jobs \
|
400
|
-
project_id,
|
401
|
-
region,
|
402
|
-
page_size: nil,
|
403
|
-
cluster_name: nil,
|
404
|
-
job_state_matcher: nil,
|
405
|
-
filter: nil,
|
406
|
-
options: nil,
|
407
|
-
&block
|
408
|
-
req = {
|
409
|
-
project_id: project_id,
|
410
|
-
region: region,
|
411
|
-
page_size: page_size,
|
412
|
-
cluster_name: cluster_name,
|
413
|
-
job_state_matcher: job_state_matcher,
|
414
|
-
filter: filter
|
415
|
-
}.delete_if { |_, v| v.nil? }
|
416
|
-
req = Google::Gax::to_proto(req, Google::Cloud::Dataproc::V1::ListJobsRequest)
|
417
|
-
@list_jobs.call(req, options, &block)
|
418
|
-
end
|
419
|
-
|
420
|
-
# Updates a job in a project.
|
421
|
-
#
|
422
|
-
# @param project_id [String]
|
423
|
-
# Required. The ID of the Google Cloud Platform project that the job
|
424
|
-
# belongs to.
|
425
|
-
# @param region [String]
|
426
|
-
# Required. The Dataproc region in which to handle the request.
|
427
|
-
# @param job_id [String]
|
428
|
-
# Required. The job ID.
|
429
|
-
# @param job [Google::Cloud::Dataproc::V1::Job | Hash]
|
430
|
-
# Required. The changes to the job.
|
431
|
-
# A hash of the same form as `Google::Cloud::Dataproc::V1::Job`
|
432
|
-
# can also be provided.
|
433
|
-
# @param update_mask [Google::Protobuf::FieldMask | Hash]
|
434
|
-
# Required. Specifies the path, relative to <code>Job</code>, of
|
435
|
-
# the field to update. For example, to update the labels of a Job the
|
436
|
-
# <code>update_mask</code> parameter would be specified as
|
437
|
-
# <code>labels</code>, and the `PATCH` request body would specify the new
|
438
|
-
# value. <strong>Note:</strong> Currently, <code>labels</code> is the only
|
439
|
-
# field that can be updated.
|
440
|
-
# A hash of the same form as `Google::Protobuf::FieldMask`
|
441
|
-
# can also be provided.
|
442
|
-
# @param options [Google::Gax::CallOptions]
|
443
|
-
# Overrides the default settings for this call, e.g, timeout,
|
444
|
-
# retries, etc.
|
445
|
-
# @yield [result, operation] Access the result along with the RPC operation
|
446
|
-
# @yieldparam result [Google::Cloud::Dataproc::V1::Job]
|
447
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
448
|
-
# @return [Google::Cloud::Dataproc::V1::Job]
|
449
|
-
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
450
|
-
# @example
|
451
|
-
# require "google/cloud/dataproc"
|
452
|
-
#
|
453
|
-
# job_controller_client = Google::Cloud::Dataproc::JobController.new(version: :v1)
|
454
|
-
#
|
455
|
-
# # TODO: Initialize `project_id`:
|
456
|
-
# project_id = ''
|
457
|
-
#
|
458
|
-
# # TODO: Initialize `region`:
|
459
|
-
# region = ''
|
460
|
-
#
|
461
|
-
# # TODO: Initialize `job_id`:
|
462
|
-
# job_id = ''
|
463
|
-
#
|
464
|
-
# # TODO: Initialize `job`:
|
465
|
-
# job = {}
|
466
|
-
#
|
467
|
-
# # TODO: Initialize `update_mask`:
|
468
|
-
# update_mask = {}
|
469
|
-
# response = job_controller_client.update_job(project_id, region, job_id, job, update_mask)
|
470
|
-
|
471
|
-
def update_job \
|
472
|
-
project_id,
|
473
|
-
region,
|
474
|
-
job_id,
|
475
|
-
job,
|
476
|
-
update_mask,
|
477
|
-
options: nil,
|
478
|
-
&block
|
479
|
-
req = {
|
480
|
-
project_id: project_id,
|
481
|
-
region: region,
|
482
|
-
job_id: job_id,
|
483
|
-
job: job,
|
484
|
-
update_mask: update_mask
|
485
|
-
}.delete_if { |_, v| v.nil? }
|
486
|
-
req = Google::Gax::to_proto(req, Google::Cloud::Dataproc::V1::UpdateJobRequest)
|
487
|
-
@update_job.call(req, options, &block)
|
488
|
-
end
|
489
|
-
|
490
|
-
# Starts a job cancellation request. To access the job resource
|
491
|
-
# after cancellation, call
|
492
|
-
# [regions/\\{region}/jobs.list](https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/list)
|
493
|
-
# or
|
494
|
-
# [regions/\\{region}/jobs.get](https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/get).
|
495
|
-
#
|
496
|
-
# @param project_id [String]
|
497
|
-
# Required. The ID of the Google Cloud Platform project that the job
|
498
|
-
# belongs to.
|
499
|
-
# @param region [String]
|
500
|
-
# Required. The Dataproc region in which to handle the request.
|
501
|
-
# @param job_id [String]
|
502
|
-
# Required. The job ID.
|
503
|
-
# @param options [Google::Gax::CallOptions]
|
504
|
-
# Overrides the default settings for this call, e.g, timeout,
|
505
|
-
# retries, etc.
|
506
|
-
# @yield [result, operation] Access the result along with the RPC operation
|
507
|
-
# @yieldparam result [Google::Cloud::Dataproc::V1::Job]
|
508
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
509
|
-
# @return [Google::Cloud::Dataproc::V1::Job]
|
510
|
-
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
511
|
-
# @example
|
512
|
-
# require "google/cloud/dataproc"
|
513
|
-
#
|
514
|
-
# job_controller_client = Google::Cloud::Dataproc::JobController.new(version: :v1)
|
515
|
-
#
|
516
|
-
# # TODO: Initialize `project_id`:
|
517
|
-
# project_id = ''
|
518
|
-
#
|
519
|
-
# # TODO: Initialize `region`:
|
520
|
-
# region = ''
|
521
|
-
#
|
522
|
-
# # TODO: Initialize `job_id`:
|
523
|
-
# job_id = ''
|
524
|
-
# response = job_controller_client.cancel_job(project_id, region, job_id)
|
525
|
-
|
526
|
-
def cancel_job \
|
527
|
-
project_id,
|
528
|
-
region,
|
529
|
-
job_id,
|
530
|
-
options: nil,
|
531
|
-
&block
|
532
|
-
req = {
|
533
|
-
project_id: project_id,
|
534
|
-
region: region,
|
535
|
-
job_id: job_id
|
536
|
-
}.delete_if { |_, v| v.nil? }
|
537
|
-
req = Google::Gax::to_proto(req, Google::Cloud::Dataproc::V1::CancelJobRequest)
|
538
|
-
@cancel_job.call(req, options, &block)
|
539
|
-
end
|
540
|
-
|
541
|
-
# Deletes the job from the project. If the job is active, the delete fails,
|
542
|
-
# and the response returns `FAILED_PRECONDITION`.
|
543
|
-
#
|
544
|
-
# @param project_id [String]
|
545
|
-
# Required. The ID of the Google Cloud Platform project that the job
|
546
|
-
# belongs to.
|
547
|
-
# @param region [String]
|
548
|
-
# Required. The Dataproc region in which to handle the request.
|
549
|
-
# @param job_id [String]
|
550
|
-
# Required. The job ID.
|
551
|
-
# @param options [Google::Gax::CallOptions]
|
552
|
-
# Overrides the default settings for this call, e.g, timeout,
|
553
|
-
# retries, etc.
|
554
|
-
# @yield [result, operation] Access the result along with the RPC operation
|
555
|
-
# @yieldparam result []
|
556
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
557
|
-
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
558
|
-
# @example
|
559
|
-
# require "google/cloud/dataproc"
|
560
|
-
#
|
561
|
-
# job_controller_client = Google::Cloud::Dataproc::JobController.new(version: :v1)
|
562
|
-
#
|
563
|
-
# # TODO: Initialize `project_id`:
|
564
|
-
# project_id = ''
|
565
|
-
#
|
566
|
-
# # TODO: Initialize `region`:
|
567
|
-
# region = ''
|
568
|
-
#
|
569
|
-
# # TODO: Initialize `job_id`:
|
570
|
-
# job_id = ''
|
571
|
-
# job_controller_client.delete_job(project_id, region, job_id)
|
572
|
-
|
573
|
-
def delete_job \
|
574
|
-
project_id,
|
575
|
-
region,
|
576
|
-
job_id,
|
577
|
-
options: nil,
|
578
|
-
&block
|
579
|
-
req = {
|
580
|
-
project_id: project_id,
|
581
|
-
region: region,
|
582
|
-
job_id: job_id
|
583
|
-
}.delete_if { |_, v| v.nil? }
|
584
|
-
req = Google::Gax::to_proto(req, Google::Cloud::Dataproc::V1::DeleteJobRequest)
|
585
|
-
@delete_job.call(req, options, &block)
|
586
|
-
nil
|
587
|
-
end
|
588
|
-
end
|
589
|
-
end
|
590
|
-
end
|
591
|
-
end
|
592
|
-
end
|