google-cloud-dataproc 0.10.0 → 1.0.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 +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
data/README.md
CHANGED
|
@@ -1,64 +1,53 @@
|
|
|
1
|
-
# Ruby Client for
|
|
1
|
+
# Ruby Client for the Cloud Dataproc API
|
|
2
|
+
|
|
3
|
+
API Client library for the Cloud Dataproc API
|
|
2
4
|
|
|
3
|
-
[Google Cloud Dataproc API][Product Documentation]:
|
|
4
5
|
Manages Hadoop-based clusters and jobs on Google Cloud Platform.
|
|
5
|
-
- [Client Library Documentation][]
|
|
6
|
-
- [Product Documentation][]
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
Actual client classes for the various versions of this API are defined in
|
|
8
|
+
_versioned_ client gems, with names of the form `google-cloud-dataproc-v*`.
|
|
9
|
+
The gem `google-cloud-dataproc` is a convenience wrapper library that brings the
|
|
10
|
+
verisoned gems in as dependencies, and provides high-level methods for
|
|
11
|
+
constructing clients.
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
View the [Client Library Documentation](https://googleapis.dev/ruby/google-cloud-dataproc/latest)
|
|
14
|
+
for this library, google-cloud-dataproc, to see the convenience methods for
|
|
15
|
+
constructing client objects. Reference documentation for the client objects
|
|
16
|
+
themselves can be found in the client library documentation for the versioned
|
|
17
|
+
client gems:
|
|
18
|
+
[google-cloud-dataproc-v1](https://googleapis.dev/ruby/google-cloud-dataproc-v1/latest),
|
|
19
|
+
[google-cloud-dataproc-v1beta2](https://googleapis.dev/ruby/google-cloud-dataproc-v1beta2/latest).
|
|
20
|
+
|
|
21
|
+
See also the [Product Documentation](https://cloud.google.com/dataproc)
|
|
22
|
+
for more usage information.
|
|
23
|
+
|
|
24
|
+
## Quick Start
|
|
16
25
|
|
|
17
|
-
### Installation
|
|
18
26
|
```
|
|
19
27
|
$ gem install google-cloud-dataproc
|
|
20
28
|
```
|
|
21
29
|
|
|
22
|
-
|
|
23
|
-
#### ClusterControllerClient
|
|
24
|
-
```rb
|
|
25
|
-
require "google/cloud/dataproc"
|
|
26
|
-
|
|
27
|
-
cluster_controller_client = Google::Cloud::Dataproc::ClusterController.new
|
|
28
|
-
project_id_2 = project_id
|
|
29
|
-
region = "global"
|
|
30
|
+
In order to use this library, you first need to go through the following steps:
|
|
30
31
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
# Or iterate over results one page at a time.
|
|
37
|
-
cluster_controller_client.list_clusters(project_id_2, region).each_page do |page|
|
|
38
|
-
# Process each page at a time.
|
|
39
|
-
page.each do |element|
|
|
40
|
-
# Process element.
|
|
41
|
-
end
|
|
42
|
-
end
|
|
43
|
-
```
|
|
32
|
+
1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
|
|
33
|
+
1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
|
|
34
|
+
1. [Enable the API.](https://console.cloud.google.com/apis/library/dataproc.googleapis.com)
|
|
35
|
+
1. {file:AUTHENTICATION.md Set up authentication.}
|
|
44
36
|
|
|
45
|
-
|
|
46
|
-
- Read the [Client Library Documentation][] for Google Cloud Dataproc API
|
|
47
|
-
to see other available methods on the client.
|
|
48
|
-
- Read the [Google Cloud Dataproc API Product documentation][Product Documentation]
|
|
49
|
-
to learn more about the product and see How-to Guides.
|
|
50
|
-
- View this [repository's main README](https://github.com/googleapis/google-cloud-ruby/blob/master/README.md)
|
|
51
|
-
to see the full list of Cloud APIs that we cover.
|
|
37
|
+
## Migrating from 0.x versions
|
|
52
38
|
|
|
53
|
-
|
|
54
|
-
[
|
|
39
|
+
The 1.0 release of the google-cloud-dataproc client is a significant upgrade
|
|
40
|
+
based on a [next-gen code generator](https://github.com/googleapis/gapic-generator-ruby),
|
|
41
|
+
and includes substantial interface changes. Existing code written for earlier
|
|
42
|
+
versions of this library will likely require updates to use this version.
|
|
43
|
+
See the {file:MIGRATING.md MIGRATING.md} document for more information.
|
|
55
44
|
|
|
56
45
|
## Enabling Logging
|
|
57
46
|
|
|
58
47
|
To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
|
|
59
|
-
The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib
|
|
48
|
+
The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib/libdoc/logger/rdoc/Logger.html) as shown below,
|
|
60
49
|
or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
|
|
61
|
-
that will write logs to [
|
|
50
|
+
that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
|
|
62
51
|
and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
|
|
63
52
|
|
|
64
53
|
Configuring a Ruby stdlib logger:
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
# Copyright 2020 Google LLC
|
|
2
4
|
#
|
|
3
5
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -12,18 +14,6 @@
|
|
|
12
14
|
# See the License for the specific language governing permissions and
|
|
13
15
|
# limitations under the License.
|
|
14
16
|
|
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
|
15
18
|
|
|
16
|
-
|
|
17
|
-
module Protobuf
|
|
18
|
-
# A generic empty message that you can re-use to avoid defining duplicated
|
|
19
|
-
# empty messages in your APIs. A typical example is to use it as the request
|
|
20
|
-
# or the response type of an API method. For instance:
|
|
21
|
-
#
|
|
22
|
-
# service Foo {
|
|
23
|
-
# rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
|
|
24
|
-
# }
|
|
25
|
-
#
|
|
26
|
-
# The JSON representation for `Empty` is empty JSON object `{}`.
|
|
27
|
-
class Empty; end
|
|
28
|
-
end
|
|
29
|
-
end
|
|
19
|
+
require "google/cloud/dataproc" unless defined? Google::Cloud::Dataproc::VERSION
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
# Copyright 2020 Google LLC
|
|
2
4
|
#
|
|
3
5
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -12,328 +14,188 @@
|
|
|
12
14
|
# See the License for the specific language governing permissions and
|
|
13
15
|
# limitations under the License.
|
|
14
16
|
|
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
|
18
|
+
|
|
19
|
+
# Require this file early so that the version constant gets defined before
|
|
20
|
+
# requiring "google/cloud". This is because google-cloud-core will load the
|
|
21
|
+
# entrypoint (gem name) file, which in turn re-requires this file (hence
|
|
22
|
+
# causing a require cycle) unless the version constant is already defined.
|
|
23
|
+
require "google/cloud/dataproc/version"
|
|
15
24
|
|
|
16
|
-
require "
|
|
17
|
-
|
|
25
|
+
require "googleauth"
|
|
26
|
+
gem "google-cloud-core"
|
|
27
|
+
require "google/cloud" unless defined? ::Google::Cloud.new
|
|
28
|
+
require "google/cloud/config"
|
|
29
|
+
|
|
30
|
+
# Set the default configuration
|
|
31
|
+
::Google::Cloud.configure.add_config! :dataproc do |config|
|
|
32
|
+
config.add_field! :credentials, nil, match: [::String, ::Hash, ::Google::Auth::Credentials]
|
|
33
|
+
config.add_field! :lib_name, nil, match: ::String
|
|
34
|
+
config.add_field! :lib_version, nil, match: ::String
|
|
35
|
+
config.add_field! :interceptors, nil, match: ::Array
|
|
36
|
+
config.add_field! :timeout, nil, match: ::Numeric
|
|
37
|
+
config.add_field! :metadata, nil, match: ::Hash
|
|
38
|
+
config.add_field! :retry_policy, nil, match: [::Hash, ::Proc]
|
|
39
|
+
end
|
|
18
40
|
|
|
19
41
|
module Google
|
|
20
42
|
module Cloud
|
|
21
|
-
# rubocop:disable LineLength
|
|
22
|
-
|
|
23
|
-
##
|
|
24
|
-
# # Ruby Client for Google Cloud Dataproc API
|
|
25
|
-
#
|
|
26
|
-
# [Google Cloud Dataproc API][Product Documentation]:
|
|
27
|
-
# Manages Hadoop-based clusters and jobs on Google Cloud Platform.
|
|
28
|
-
# - [Product Documentation][]
|
|
29
|
-
#
|
|
30
|
-
# ## Quick Start
|
|
31
|
-
# In order to use this library, you first need to go through the following
|
|
32
|
-
# steps:
|
|
33
|
-
#
|
|
34
|
-
# 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
|
|
35
|
-
# 2. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
|
|
36
|
-
# 3. [Enable the Google Cloud Dataproc API.](https://console.cloud.google.com/apis/library/dataproc.googleapis.com)
|
|
37
|
-
# 4. [Setup Authentication.](https://googleapis.dev/ruby/google-cloud-dataproc/latest/file.AUTHENTICATION.html)
|
|
38
|
-
#
|
|
39
|
-
# ### Installation
|
|
40
|
-
# ```
|
|
41
|
-
# $ gem install google-cloud-dataproc
|
|
42
|
-
# ```
|
|
43
|
-
#
|
|
44
|
-
# ### Preview
|
|
45
|
-
# #### ClusterControllerClient
|
|
46
|
-
# ```rb
|
|
47
|
-
# require "google/cloud/dataproc"
|
|
48
|
-
#
|
|
49
|
-
# cluster_controller_client = Google::Cloud::Dataproc::ClusterController.new
|
|
50
|
-
# project_id_2 = project_id
|
|
51
|
-
# region = "global"
|
|
52
|
-
#
|
|
53
|
-
# # Iterate over all results.
|
|
54
|
-
# cluster_controller_client.list_clusters(project_id_2, region).each do |element|
|
|
55
|
-
# # Process element.
|
|
56
|
-
# end
|
|
57
|
-
#
|
|
58
|
-
# # Or iterate over results one page at a time.
|
|
59
|
-
# cluster_controller_client.list_clusters(project_id_2, region).each_page do |page|
|
|
60
|
-
# # Process each page at a time.
|
|
61
|
-
# page.each do |element|
|
|
62
|
-
# # Process element.
|
|
63
|
-
# end
|
|
64
|
-
# end
|
|
65
|
-
# ```
|
|
66
|
-
#
|
|
67
|
-
# ### Next Steps
|
|
68
|
-
# - Read the [Google Cloud Dataproc API Product documentation][Product Documentation]
|
|
69
|
-
# to learn more about the product and see How-to Guides.
|
|
70
|
-
# - View this [repository's main README](https://github.com/googleapis/google-cloud-ruby/blob/master/README.md)
|
|
71
|
-
# to see the full list of Cloud APIs that we cover.
|
|
72
|
-
#
|
|
73
|
-
# [Product Documentation]: https://cloud.google.com/dataproc
|
|
74
|
-
#
|
|
75
|
-
# ## Enabling Logging
|
|
76
|
-
#
|
|
77
|
-
# To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
|
|
78
|
-
# 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,
|
|
79
|
-
# or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
|
|
80
|
-
# 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)
|
|
81
|
-
# and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
|
|
82
|
-
#
|
|
83
|
-
# Configuring a Ruby stdlib logger:
|
|
84
|
-
#
|
|
85
|
-
# ```ruby
|
|
86
|
-
# require "logger"
|
|
87
|
-
#
|
|
88
|
-
# module MyLogger
|
|
89
|
-
# LOGGER = Logger.new $stderr, level: Logger::WARN
|
|
90
|
-
# def logger
|
|
91
|
-
# LOGGER
|
|
92
|
-
# end
|
|
93
|
-
# end
|
|
94
|
-
#
|
|
95
|
-
# # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
|
|
96
|
-
# module GRPC
|
|
97
|
-
# extend MyLogger
|
|
98
|
-
# end
|
|
99
|
-
# ```
|
|
100
|
-
#
|
|
101
43
|
module Dataproc
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
44
|
+
##
|
|
45
|
+
# Create a new client object for AutoscalingPolicyService.
|
|
46
|
+
#
|
|
47
|
+
# By default, this returns an instance of
|
|
48
|
+
# [Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client](https://googleapis.dev/ruby/google-cloud-dataproc-v1/latest/Google/Cloud/Dataproc/V1/AutoscalingPolicyService/Client.html)
|
|
49
|
+
# for version V1 of the API.
|
|
50
|
+
# However, you can specify specify a different API version by passing it in the
|
|
51
|
+
# `version` parameter. If the AutoscalingPolicyService service is
|
|
52
|
+
# supported by that API version, and the corresponding gem is available, the
|
|
53
|
+
# appropriate versioned client will be returned.
|
|
54
|
+
#
|
|
55
|
+
# ## About AutoscalingPolicyService
|
|
56
|
+
#
|
|
57
|
+
# The API interface for managing autoscaling policies in the
|
|
58
|
+
# Dataproc API.
|
|
59
|
+
#
|
|
60
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
|
61
|
+
# Defaults to `:v1`.
|
|
62
|
+
# @return [AutoscalingPolicyService::Client] A client object for the specified version.
|
|
63
|
+
#
|
|
64
|
+
def self.autoscaling_policy_service version: :v1, &block
|
|
65
|
+
require "google/cloud/dataproc/#{version.to_s.downcase}"
|
|
105
66
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
67
|
+
package_name = Google::Cloud::Dataproc
|
|
68
|
+
.constants
|
|
69
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
|
70
|
+
.first
|
|
71
|
+
package_module = Google::Cloud::Dataproc.const_get package_name
|
|
72
|
+
package_module.const_get(:AutoscalingPolicyService).const_get(:Client).new(&block)
|
|
73
|
+
end
|
|
111
74
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
# metadata for requests, generally, to give OAuth credentials.
|
|
135
|
-
# @param scopes [Array<String>]
|
|
136
|
-
# The OAuth scopes for this service. This parameter is ignored if
|
|
137
|
-
# an updater_proc is supplied.
|
|
138
|
-
# @param client_config [Hash]
|
|
139
|
-
# A Hash for call options for each method. See
|
|
140
|
-
# Google::Gax#construct_settings for the structure of
|
|
141
|
-
# this data. Falls back to the default config if not specified
|
|
142
|
-
# or the specified config is missing data points.
|
|
143
|
-
# @param timeout [Numeric]
|
|
144
|
-
# The default timeout, in seconds, for calls made through this client.
|
|
145
|
-
# @param metadata [Hash]
|
|
146
|
-
# Default metadata to be sent with each request. This can be overridden on a per call basis.
|
|
147
|
-
# @param service_address [String]
|
|
148
|
-
# Override for the service hostname, or `nil` to leave as the default.
|
|
149
|
-
# @param service_port [Integer]
|
|
150
|
-
# Override for the service port, or `nil` to leave as the default.
|
|
151
|
-
# @param exception_transformer [Proc]
|
|
152
|
-
# An optional proc that intercepts any exceptions raised during an API call to inject
|
|
153
|
-
# custom error handling.
|
|
154
|
-
def self.new(*args, version: :v1, **kwargs)
|
|
155
|
-
unless AVAILABLE_VERSIONS.include?(version.to_s.downcase)
|
|
156
|
-
raise "The version: #{version} is not available. The available versions " \
|
|
157
|
-
"are: [#{AVAILABLE_VERSIONS.join(", ")}]"
|
|
158
|
-
end
|
|
75
|
+
##
|
|
76
|
+
# Create a new client object for ClusterController.
|
|
77
|
+
#
|
|
78
|
+
# By default, this returns an instance of
|
|
79
|
+
# [Google::Cloud::Dataproc::V1::ClusterController::Client](https://googleapis.dev/ruby/google-cloud-dataproc-v1/latest/Google/Cloud/Dataproc/V1/ClusterController/Client.html)
|
|
80
|
+
# for version V1 of the API.
|
|
81
|
+
# However, you can specify specify a different API version by passing it in the
|
|
82
|
+
# `version` parameter. If the ClusterController service is
|
|
83
|
+
# supported by that API version, and the corresponding gem is available, the
|
|
84
|
+
# appropriate versioned client will be returned.
|
|
85
|
+
#
|
|
86
|
+
# ## About ClusterController
|
|
87
|
+
#
|
|
88
|
+
# The ClusterControllerService provides methods to manage clusters
|
|
89
|
+
# of Compute Engine instances.
|
|
90
|
+
#
|
|
91
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
|
92
|
+
# Defaults to `:v1`.
|
|
93
|
+
# @return [ClusterController::Client] A client object for the specified version.
|
|
94
|
+
#
|
|
95
|
+
def self.cluster_controller version: :v1, &block
|
|
96
|
+
require "google/cloud/dataproc/#{version.to_s.downcase}"
|
|
159
97
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
end
|
|
98
|
+
package_name = Google::Cloud::Dataproc
|
|
99
|
+
.constants
|
|
100
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
|
101
|
+
.first
|
|
102
|
+
package_module = Google::Cloud::Dataproc.const_get package_name
|
|
103
|
+
package_module.const_get(:ClusterController).const_get(:Client).new(&block)
|
|
167
104
|
end
|
|
168
105
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
# A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
|
|
191
|
-
# metadata for requests, generally, to give OAuth credentials.
|
|
192
|
-
# @param scopes [Array<String>]
|
|
193
|
-
# The OAuth scopes for this service. This parameter is ignored if
|
|
194
|
-
# an updater_proc is supplied.
|
|
195
|
-
# @param client_config [Hash]
|
|
196
|
-
# A Hash for call options for each method. See
|
|
197
|
-
# Google::Gax#construct_settings for the structure of
|
|
198
|
-
# this data. Falls back to the default config if not specified
|
|
199
|
-
# or the specified config is missing data points.
|
|
200
|
-
# @param timeout [Numeric]
|
|
201
|
-
# The default timeout, in seconds, for calls made through this client.
|
|
202
|
-
# @param metadata [Hash]
|
|
203
|
-
# Default metadata to be sent with each request. This can be overridden on a per call basis.
|
|
204
|
-
# @param service_address [String]
|
|
205
|
-
# Override for the service hostname, or `nil` to leave as the default.
|
|
206
|
-
# @param service_port [Integer]
|
|
207
|
-
# Override for the service port, or `nil` to leave as the default.
|
|
208
|
-
# @param exception_transformer [Proc]
|
|
209
|
-
# An optional proc that intercepts any exceptions raised during an API call to inject
|
|
210
|
-
# custom error handling.
|
|
211
|
-
def self.new(*args, version: :v1, **kwargs)
|
|
212
|
-
unless AVAILABLE_VERSIONS.include?(version.to_s.downcase)
|
|
213
|
-
raise "The version: #{version} is not available. The available versions " \
|
|
214
|
-
"are: [#{AVAILABLE_VERSIONS.join(", ")}]"
|
|
215
|
-
end
|
|
106
|
+
##
|
|
107
|
+
# Create a new client object for JobController.
|
|
108
|
+
#
|
|
109
|
+
# By default, this returns an instance of
|
|
110
|
+
# [Google::Cloud::Dataproc::V1::JobController::Client](https://googleapis.dev/ruby/google-cloud-dataproc-v1/latest/Google/Cloud/Dataproc/V1/JobController/Client.html)
|
|
111
|
+
# for version V1 of the API.
|
|
112
|
+
# However, you can specify specify a different API version by passing it in the
|
|
113
|
+
# `version` parameter. If the JobController service is
|
|
114
|
+
# supported by that API version, and the corresponding gem is available, the
|
|
115
|
+
# appropriate versioned client will be returned.
|
|
116
|
+
#
|
|
117
|
+
# ## About JobController
|
|
118
|
+
#
|
|
119
|
+
# The JobController provides methods to manage jobs.
|
|
120
|
+
#
|
|
121
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
|
122
|
+
# Defaults to `:v1`.
|
|
123
|
+
# @return [JobController::Client] A client object for the specified version.
|
|
124
|
+
#
|
|
125
|
+
def self.job_controller version: :v1, &block
|
|
126
|
+
require "google/cloud/dataproc/#{version.to_s.downcase}"
|
|
216
127
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
end
|
|
128
|
+
package_name = Google::Cloud::Dataproc
|
|
129
|
+
.constants
|
|
130
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
|
131
|
+
.first
|
|
132
|
+
package_module = Google::Cloud::Dataproc.const_get package_name
|
|
133
|
+
package_module.const_get(:JobController).const_get(:Client).new(&block)
|
|
224
134
|
end
|
|
225
135
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
# @param scopes [Array<String>]
|
|
249
|
-
# The OAuth scopes for this service. This parameter is ignored if
|
|
250
|
-
# an updater_proc is supplied.
|
|
251
|
-
# @param client_config [Hash]
|
|
252
|
-
# A Hash for call options for each method. See
|
|
253
|
-
# Google::Gax#construct_settings for the structure of
|
|
254
|
-
# this data. Falls back to the default config if not specified
|
|
255
|
-
# or the specified config is missing data points.
|
|
256
|
-
# @param timeout [Numeric]
|
|
257
|
-
# The default timeout, in seconds, for calls made through this client.
|
|
258
|
-
# @param metadata [Hash]
|
|
259
|
-
# Default metadata to be sent with each request. This can be overridden on a per call basis.
|
|
260
|
-
# @param service_address [String]
|
|
261
|
-
# Override for the service hostname, or `nil` to leave as the default.
|
|
262
|
-
# @param service_port [Integer]
|
|
263
|
-
# Override for the service port, or `nil` to leave as the default.
|
|
264
|
-
# @param exception_transformer [Proc]
|
|
265
|
-
# An optional proc that intercepts any exceptions raised during an API call to inject
|
|
266
|
-
# custom error handling.
|
|
267
|
-
def self.new(*args, version: :v1, **kwargs)
|
|
268
|
-
unless AVAILABLE_VERSIONS.include?(version.to_s.downcase)
|
|
269
|
-
raise "The version: #{version} is not available. The available versions " \
|
|
270
|
-
"are: [#{AVAILABLE_VERSIONS.join(", ")}]"
|
|
271
|
-
end
|
|
136
|
+
##
|
|
137
|
+
# Create a new client object for WorkflowTemplateService.
|
|
138
|
+
#
|
|
139
|
+
# By default, this returns an instance of
|
|
140
|
+
# [Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client](https://googleapis.dev/ruby/google-cloud-dataproc-v1/latest/Google/Cloud/Dataproc/V1/WorkflowTemplateService/Client.html)
|
|
141
|
+
# for version V1 of the API.
|
|
142
|
+
# However, you can specify specify a different API version by passing it in the
|
|
143
|
+
# `version` parameter. If the WorkflowTemplateService service is
|
|
144
|
+
# supported by that API version, and the corresponding gem is available, the
|
|
145
|
+
# appropriate versioned client will be returned.
|
|
146
|
+
#
|
|
147
|
+
# ## About WorkflowTemplateService
|
|
148
|
+
#
|
|
149
|
+
# The API interface for managing Workflow Templates in the
|
|
150
|
+
# Dataproc API.
|
|
151
|
+
#
|
|
152
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
|
153
|
+
# Defaults to `:v1`.
|
|
154
|
+
# @return [WorkflowTemplateService::Client] A client object for the specified version.
|
|
155
|
+
#
|
|
156
|
+
def self.workflow_template_service version: :v1, &block
|
|
157
|
+
require "google/cloud/dataproc/#{version.to_s.downcase}"
|
|
272
158
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
end
|
|
159
|
+
package_name = Google::Cloud::Dataproc
|
|
160
|
+
.constants
|
|
161
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
|
162
|
+
.first
|
|
163
|
+
package_module = Google::Cloud::Dataproc.const_get package_name
|
|
164
|
+
package_module.const_get(:WorkflowTemplateService).const_get(:Client).new(&block)
|
|
280
165
|
end
|
|
281
166
|
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
# or the specified config is missing data points.
|
|
313
|
-
# @param timeout [Numeric]
|
|
314
|
-
# The default timeout, in seconds, for calls made through this client.
|
|
315
|
-
# @param metadata [Hash]
|
|
316
|
-
# Default metadata to be sent with each request. This can be overridden on a per call basis.
|
|
317
|
-
# @param service_address [String]
|
|
318
|
-
# Override for the service hostname, or `nil` to leave as the default.
|
|
319
|
-
# @param service_port [Integer]
|
|
320
|
-
# Override for the service port, or `nil` to leave as the default.
|
|
321
|
-
# @param exception_transformer [Proc]
|
|
322
|
-
# An optional proc that intercepts any exceptions raised during an API call to inject
|
|
323
|
-
# custom error handling.
|
|
324
|
-
def self.new(*args, version: :v1, **kwargs)
|
|
325
|
-
unless AVAILABLE_VERSIONS.include?(version.to_s.downcase)
|
|
326
|
-
raise "The version: #{version} is not available. The available versions " \
|
|
327
|
-
"are: [#{AVAILABLE_VERSIONS.join(", ")}]"
|
|
328
|
-
end
|
|
167
|
+
##
|
|
168
|
+
# Configure the google-cloud-dataproc library.
|
|
169
|
+
#
|
|
170
|
+
# The following configuration parameters are supported:
|
|
171
|
+
#
|
|
172
|
+
# * `credentials` (*type:* `String, Hash, Google::Auth::Credentials`) -
|
|
173
|
+
# The path to the keyfile as a String, the contents of the keyfile as a
|
|
174
|
+
# Hash, or a Google::Auth::Credentials object.
|
|
175
|
+
# * `lib_name` (*type:* `String`) -
|
|
176
|
+
# The library name as recorded in instrumentation and logging.
|
|
177
|
+
# * `lib_version` (*type:* `String`) -
|
|
178
|
+
# The library version as recorded in instrumentation and logging.
|
|
179
|
+
# * `interceptors` (*type:* `Array<GRPC::ClientInterceptor>`) -
|
|
180
|
+
# An array of interceptors that are run before calls are executed.
|
|
181
|
+
# * `timeout` (*type:* `Integer`) -
|
|
182
|
+
# Default timeout in milliseconds.
|
|
183
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) -
|
|
184
|
+
# Additional gRPC headers to be sent with the call.
|
|
185
|
+
# * `retry_policy` (*type:* `Hash`) -
|
|
186
|
+
# The retry policy. The value is a hash with the following keys:
|
|
187
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
|
188
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
|
189
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
|
190
|
+
# * `:retry_codes` (*type:* `Array<String>`) -
|
|
191
|
+
# The error codes that should trigger a retry.
|
|
192
|
+
#
|
|
193
|
+
# @return [::Google::Cloud::Config] The default configuration used by this library
|
|
194
|
+
#
|
|
195
|
+
def self.configure
|
|
196
|
+
yield ::Google::Cloud.configure.dataproc if block_given?
|
|
329
197
|
|
|
330
|
-
|
|
331
|
-
version_module = Google::Cloud::Dataproc
|
|
332
|
-
.constants
|
|
333
|
-
.select {|sym| sym.to_s.downcase == version.to_s.downcase}
|
|
334
|
-
.first
|
|
335
|
-
Google::Cloud::Dataproc.const_get(version_module)::WorkflowTemplateService.new(*args, **kwargs)
|
|
336
|
-
end
|
|
198
|
+
::Google::Cloud.configure.dataproc
|
|
337
199
|
end
|
|
338
200
|
end
|
|
339
201
|
end
|