google-cloud-dataproc-v1beta2 0.2.4 → 0.5.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.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +64 -0
  3. data/lib/google/cloud/dataproc/v1beta2.rb +3 -0
  4. data/lib/google/cloud/dataproc/v1beta2/autoscaling_policies_services_pb.rb +5 -5
  5. data/lib/google/cloud/dataproc/v1beta2/autoscaling_policy_service/client.rb +9 -3
  6. data/lib/google/cloud/dataproc/v1beta2/cluster_controller.rb +1 -0
  7. data/lib/google/cloud/dataproc/v1beta2/cluster_controller/client.rb +26 -15
  8. data/lib/google/cloud/dataproc/v1beta2/cluster_controller/operations.rb +90 -5
  9. data/lib/google/cloud/dataproc/v1beta2/cluster_controller/paths.rb +52 -0
  10. data/lib/google/cloud/dataproc/v1beta2/clusters_pb.rb +8 -0
  11. data/lib/google/cloud/dataproc/v1beta2/clusters_services_pb.rb +6 -6
  12. data/lib/google/cloud/dataproc/v1beta2/job_controller/client.rb +9 -3
  13. data/lib/google/cloud/dataproc/v1beta2/job_controller/operations.rb +90 -5
  14. data/lib/google/cloud/dataproc/v1beta2/jobs_services_pb.rb +7 -7
  15. data/lib/google/cloud/dataproc/v1beta2/shared_pb.rb +1 -2
  16. data/lib/google/cloud/dataproc/v1beta2/version.rb +1 -1
  17. data/lib/google/cloud/dataproc/v1beta2/workflow_template_service/client.rb +11 -4
  18. data/lib/google/cloud/dataproc/v1beta2/workflow_template_service/operations.rb +90 -5
  19. data/lib/google/cloud/dataproc/v1beta2/workflow_template_service/paths.rb +19 -0
  20. data/lib/google/cloud/dataproc/v1beta2/workflow_templates_pb.rb +5 -0
  21. data/lib/google/cloud/dataproc/v1beta2/workflow_templates_services_pb.rb +9 -8
  22. data/proto_docs/google/api/field_behavior.rb +6 -0
  23. data/proto_docs/google/api/resource.rb +50 -14
  24. data/proto_docs/google/cloud/dataproc/v1beta2/autoscaling_policies.rb +13 -7
  25. data/proto_docs/google/cloud/dataproc/v1beta2/clusters.rb +64 -21
  26. data/proto_docs/google/cloud/dataproc/v1beta2/jobs.rb +14 -13
  27. data/proto_docs/google/cloud/dataproc/v1beta2/shared.rb +3 -6
  28. data/proto_docs/google/cloud/dataproc/v1beta2/workflow_templates.rb +42 -8
  29. data/proto_docs/google/longrunning/operations.rb +17 -3
  30. data/proto_docs/google/protobuf/any.rb +5 -2
  31. data/proto_docs/google/protobuf/timestamp.rb +10 -1
  32. metadata +8 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e72dbf2e472f68f8b4124dd1aae8cb8172480d81c16410b014e563f545d6e583
4
- data.tar.gz: 70e2ab47a163520c7203cb8e5f1cf92deae732b97a97519ca4de5d321597d478
3
+ metadata.gz: dd905b358282cbadaf58357992b047548c14624aeaffbe088e382ba3e0e6d45a
4
+ data.tar.gz: f5562dcddddae23c2efd386c640c097c95164efd3641cbfe931b3ea1170ebe7b
5
5
  SHA512:
6
- metadata.gz: 39bc6c1402fb9047ac0dec37c20bd066980ed69094cf19e47228fec06618b5161a79c60ef781951d1cb6057765a65089caeba99fcffa9fa745d3eed7676b377f
7
- data.tar.gz: cb6537c9bcdf037e4f2bcbe436d208e97f47254e6b7ebd81bf25e92fb4b2f7e75713018ec18db0bf3c0c559009dc779311c0a726ba34c48cdc6acb5f5923bb14
6
+ metadata.gz: 17c20d78f1156a0a92ec4d67abbf958e3b1363ec606e0ee373ebfd31377a12bcf4750d1cf3fa5cca7d8fbd56396371d6bcf67fe3459fd1d4d94e3cd5fb74c247
7
+ data.tar.gz: 8ccbe81c8f4401ebeff90cde546c63fcbfec3246d860a350d4d26a48beb23baf2cd31749e4de2bd108c774657b6a4565da09a9901b539bda2f517e99b850aa5f
data/README.md CHANGED
@@ -6,6 +6,12 @@ Manages Hadoop-based clusters and jobs on Google Cloud Platform.
6
6
 
7
7
  https://github.com/googleapis/google-cloud-ruby
8
8
 
9
+ This gem is a _versioned_ client. It provides basic client classes for a
10
+ specific version of the Cloud Dataproc V1beta2 API. Most users should consider using
11
+ the main client gem,
12
+ [google-cloud-dataproc](https://rubygems.org/gems/google-cloud-dataproc).
13
+ See the section below titled *Which client should I use?* for more information.
14
+
9
15
  ## Installation
10
16
 
11
17
  ```
@@ -73,3 +79,61 @@ in security maintenance, and not end of life. Currently, this means Ruby 2.4
73
79
  and later. Older versions of Ruby _may_ still work, but are unsupported and not
74
80
  recommended. See https://www.ruby-lang.org/en/downloads/branches/ for details
75
81
  about the Ruby support schedule.
82
+
83
+ ## Which client should I use?
84
+
85
+ Most modern Ruby client libraries for Google APIs come in two flavors: the main
86
+ client library with a name such as `google-cloud-dataproc`,
87
+ and lower-level _versioned_ client libraries with names such as
88
+ `google-cloud-dataproc-v1beta2`.
89
+ _In most cases, you should install the main client._
90
+
91
+ ### What's the difference between the main client and a versioned client?
92
+
93
+ A _versioned client_ provides a basic set of data types and client classes for
94
+ a _single version_ of a specific service. (That is, for a service with multiple
95
+ versions, there might be a separate versioned client for each service version.)
96
+ Most versioned clients are written and maintained by a code generator.
97
+
98
+ The _main client_ is designed to provide you with the _recommended_ client
99
+ interfaces for the service. There will be only one main client for any given
100
+ service, even a service with multiple versions. The main client includes
101
+ factory methods for constructing the client objects we recommend for most
102
+ users. In some cases, those will be classes provided by an underlying versioned
103
+ client; in other cases, they will be handwritten higher-level client objects
104
+ with additional capabilities, convenience methods, or best practices built in.
105
+ Generally, the main client will default to a recommended service version,
106
+ although in some cases you can override this if you need to talk to a specific
107
+ service version.
108
+
109
+ ### Why would I want to use the main client?
110
+
111
+ We recommend that most users install the main client gem for a service. You can
112
+ identify this gem as the one _without_ a version in its name, e.g.
113
+ `google-cloud-dataproc`.
114
+ The main client is recommended because it will embody the best practices for
115
+ accessing the service, and may also provide more convenient interfaces or
116
+ tighter integration into frameworks and third-party libraries. In addition, the
117
+ documentation and samples published by Google will generally demonstrate use of
118
+ the main client.
119
+
120
+ ### Why would I want to use a versioned client?
121
+
122
+ You can use a versioned client if you are content with a possibly lower-level
123
+ class interface, you explicitly want to avoid features provided by the main
124
+ client, or you want to access a specific service version not be covered by the
125
+ main client. You can identify versioned client gems because the service version
126
+ is part of the name, e.g. `google-cloud-dataproc-v1beta2`.
127
+
128
+ ### What about the google-apis-<name> clients?
129
+
130
+ Client library gems with names that begin with `google-apis-` are based on an
131
+ older code generation technology. They talk to a REST/JSON backend (whereas
132
+ most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may
133
+ not offer the same performance, features, and ease of use provided by more
134
+ modern clients.
135
+
136
+ The `google-apis-` clients have wide coverage across Google services, so you
137
+ might need to use one if there is no modern client available for the service.
138
+ However, if a modern client is available, we generally recommend it over the
139
+ older `google-apis-` clients.
@@ -36,3 +36,6 @@ module Google
36
36
  end
37
37
  end
38
38
  end
39
+
40
+ helper_path = ::File.join __dir__, "v1beta2", "_helpers.rb"
41
+ require "google/cloud/dataproc/v1beta2/_helpers" if ::File.file? helper_path
@@ -35,19 +35,19 @@ module Google
35
35
  self.service_name = 'google.cloud.dataproc.v1beta2.AutoscalingPolicyService'
36
36
 
37
37
  # Creates new autoscaling policy.
38
- rpc :CreateAutoscalingPolicy, Google::Cloud::Dataproc::V1beta2::CreateAutoscalingPolicyRequest, Google::Cloud::Dataproc::V1beta2::AutoscalingPolicy
38
+ rpc :CreateAutoscalingPolicy, ::Google::Cloud::Dataproc::V1beta2::CreateAutoscalingPolicyRequest, ::Google::Cloud::Dataproc::V1beta2::AutoscalingPolicy
39
39
  # Updates (replaces) autoscaling policy.
40
40
  #
41
41
  # Disabled check for update_mask, because all updates will be full
42
42
  # replacements.
43
- rpc :UpdateAutoscalingPolicy, Google::Cloud::Dataproc::V1beta2::UpdateAutoscalingPolicyRequest, Google::Cloud::Dataproc::V1beta2::AutoscalingPolicy
43
+ rpc :UpdateAutoscalingPolicy, ::Google::Cloud::Dataproc::V1beta2::UpdateAutoscalingPolicyRequest, ::Google::Cloud::Dataproc::V1beta2::AutoscalingPolicy
44
44
  # Retrieves autoscaling policy.
45
- rpc :GetAutoscalingPolicy, Google::Cloud::Dataproc::V1beta2::GetAutoscalingPolicyRequest, Google::Cloud::Dataproc::V1beta2::AutoscalingPolicy
45
+ rpc :GetAutoscalingPolicy, ::Google::Cloud::Dataproc::V1beta2::GetAutoscalingPolicyRequest, ::Google::Cloud::Dataproc::V1beta2::AutoscalingPolicy
46
46
  # Lists autoscaling policies in the project.
47
- rpc :ListAutoscalingPolicies, Google::Cloud::Dataproc::V1beta2::ListAutoscalingPoliciesRequest, Google::Cloud::Dataproc::V1beta2::ListAutoscalingPoliciesResponse
47
+ rpc :ListAutoscalingPolicies, ::Google::Cloud::Dataproc::V1beta2::ListAutoscalingPoliciesRequest, ::Google::Cloud::Dataproc::V1beta2::ListAutoscalingPoliciesResponse
48
48
  # Deletes an autoscaling policy. It is an error to delete an autoscaling
49
49
  # policy that is in use by one or more clusters.
50
- rpc :DeleteAutoscalingPolicy, Google::Cloud::Dataproc::V1beta2::DeleteAutoscalingPolicyRequest, Google::Protobuf::Empty
50
+ rpc :DeleteAutoscalingPolicy, ::Google::Cloud::Dataproc::V1beta2::DeleteAutoscalingPolicyRequest, ::Google::Protobuf::Empty
51
51
  end
52
52
 
53
53
  Stub = Service.rpc_stub_class
@@ -155,7 +155,13 @@ module Google
155
155
 
156
156
  # Create credentials
157
157
  credentials = @config.credentials
158
- credentials ||= Credentials.default scope: @config.scope
158
+ # Use self-signed JWT if the scope and endpoint are unchanged from default,
159
+ # but only if the default endpoint does not have a region prefix.
160
+ enable_self_signed_jwt = @config.scope == Client.configure.scope &&
161
+ @config.endpoint == Client.configure.endpoint &&
162
+ !@config.endpoint.split(".").first.include?("-")
163
+ credentials ||= Credentials.default scope: @config.scope,
164
+ enable_self_signed_jwt: enable_self_signed_jwt
159
165
  if credentials.is_a?(String) || credentials.is_a?(Hash)
160
166
  credentials = Credentials.new credentials, scope: @config.scope
161
167
  end
@@ -637,7 +643,7 @@ module Google
637
643
 
638
644
  config_attr :endpoint, "dataproc.googleapis.com", ::String
639
645
  config_attr :credentials, nil do |value|
640
- allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
646
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
641
647
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
642
648
  allowed.any? { |klass| klass === value }
643
649
  end
@@ -677,7 +683,7 @@ module Google
677
683
  # Each configuration object is of type `Gapic::Config::Method` and includes
678
684
  # the following configuration fields:
679
685
  #
680
- # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
686
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
681
687
  # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
682
688
  # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
683
689
  # include the following keys:
@@ -23,6 +23,7 @@ require "gapic/config/method"
23
23
  require "google/cloud/dataproc/v1beta2/version"
24
24
 
25
25
  require "google/cloud/dataproc/v1beta2/cluster_controller/credentials"
26
+ require "google/cloud/dataproc/v1beta2/cluster_controller/paths"
26
27
  require "google/cloud/dataproc/v1beta2/cluster_controller/operations"
27
28
  require "google/cloud/dataproc/v1beta2/cluster_controller/client"
28
29
 
@@ -31,6 +31,8 @@ module Google
31
31
  # of Compute Engine instances.
32
32
  #
33
33
  class Client
34
+ include Paths
35
+
34
36
  # @private
35
37
  attr_reader :cluster_controller_stub
36
38
 
@@ -173,7 +175,13 @@ module Google
173
175
 
174
176
  # Create credentials
175
177
  credentials = @config.credentials
176
- credentials ||= Credentials.default scope: @config.scope
178
+ # Use self-signed JWT if the scope and endpoint are unchanged from default,
179
+ # but only if the default endpoint does not have a region prefix.
180
+ enable_self_signed_jwt = @config.scope == Client.configure.scope &&
181
+ @config.endpoint == Client.configure.endpoint &&
182
+ !@config.endpoint.split(".").first.include?("-")
183
+ credentials ||= Credentials.default scope: @config.scope,
184
+ enable_self_signed_jwt: enable_self_signed_jwt
177
185
  if credentials.is_a?(String) || credentials.is_a?(Hash)
178
186
  credentials = Credentials.new credentials, scope: @config.scope
179
187
  end
@@ -232,10 +240,11 @@ module Google
232
240
  # Required. The cluster to create.
233
241
  # @param request_id [::String]
234
242
  # Optional. A unique id used to identify the request. If the server
235
- # receives two {::Google::Cloud::Dataproc::V1beta2::CreateClusterRequest CreateClusterRequest} requests with the same
236
- # id, then the second request will be ignored and the
237
- # first {::Google::Longrunning::Operation google.longrunning.Operation} created and stored in the backend
238
- # is returned.
243
+ # receives two
244
+ # {::Google::Cloud::Dataproc::V1beta2::CreateClusterRequest CreateClusterRequest}
245
+ # requests with the same id, then the second request will be ignored and the
246
+ # first {::Google::Longrunning::Operation google.longrunning.Operation} created
247
+ # and stored in the backend is returned.
239
248
  #
240
249
  # It is recommended to always set this value to a
241
250
  # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
@@ -392,10 +401,11 @@ module Google
392
401
  # </table>
393
402
  # @param request_id [::String]
394
403
  # Optional. A unique id used to identify the request. If the server
395
- # receives two {::Google::Cloud::Dataproc::V1beta2::UpdateClusterRequest UpdateClusterRequest} requests with the same
396
- # id, then the second request will be ignored and the
397
- # first {::Google::Longrunning::Operation google.longrunning.Operation} created and stored in the
398
- # backend is returned.
404
+ # receives two
405
+ # {::Google::Cloud::Dataproc::V1beta2::UpdateClusterRequest UpdateClusterRequest}
406
+ # requests with the same id, then the second request will be ignored and the
407
+ # first {::Google::Longrunning::Operation google.longrunning.Operation} created
408
+ # and stored in the backend is returned.
399
409
  #
400
410
  # It is recommended to always set this value to a
401
411
  # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
@@ -483,10 +493,11 @@ module Google
483
493
  # (with error NOT_FOUND) if cluster with specified UUID does not exist.
484
494
  # @param request_id [::String]
485
495
  # Optional. A unique id used to identify the request. If the server
486
- # receives two {::Google::Cloud::Dataproc::V1beta2::DeleteClusterRequest DeleteClusterRequest} requests with the same
487
- # id, then the second request will be ignored and the
488
- # first {::Google::Longrunning::Operation google.longrunning.Operation} created and stored in the
489
- # backend is returned.
496
+ # receives two
497
+ # {::Google::Cloud::Dataproc::V1beta2::DeleteClusterRequest DeleteClusterRequest}
498
+ # requests with the same id, then the second request will be ignored and the
499
+ # first {::Google::Longrunning::Operation google.longrunning.Operation} created
500
+ # and stored in the backend is returned.
490
501
  #
491
502
  # It is recommended to always set this value to a
492
503
  # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
@@ -875,7 +886,7 @@ module Google
875
886
 
876
887
  config_attr :endpoint, "dataproc.googleapis.com", ::String
877
888
  config_attr :credentials, nil do |value|
878
- allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
889
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
879
890
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
880
891
  allowed.any? { |klass| klass === value }
881
892
  end
@@ -915,7 +926,7 @@ module Google
915
926
  # Each configuration object is of type `Gapic::Config::Method` and includes
916
927
  # the following configuration fields:
917
928
  #
918
- # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
929
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
919
930
  # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
920
931
  # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
921
932
  # include the following keys:
@@ -103,8 +103,13 @@ module Google
103
103
  # Lists operations that match the specified filter in the request. If the
104
104
  # server doesn't support this method, it returns `UNIMPLEMENTED`.
105
105
  #
106
- # NOTE: the `name` binding below allows API services to override the binding
107
- # to use different resource name schemes, such as `users/*/operations`.
106
+ # NOTE: the `name` binding allows API services to override the binding
107
+ # to use different resource name schemes, such as `users/*/operations`. To
108
+ # override the binding, API services can add a binding such as
109
+ # `"/v1/{name=users/*}/operations"` to their service configuration.
110
+ # For backwards compatibility, the default name includes the operations
111
+ # collection id, however overriding users must ensure the name binding
112
+ # is the parent resource, without the operations collection id.
108
113
  #
109
114
  # @overload list_operations(request, options = nil)
110
115
  # Pass arguments to `list_operations` via a request object, either of type
@@ -122,7 +127,7 @@ module Google
122
127
  # the default parameter values, pass an empty Hash as a request object (see above).
123
128
  #
124
129
  # @param name [::String]
125
- # The name of the operation collection.
130
+ # The name of the operation's parent resource.
126
131
  # @param filter [::String]
127
132
  # The standard list filter.
128
133
  # @param page_size [::Integer]
@@ -390,6 +395,79 @@ module Google
390
395
  raise ::Google::Cloud::Error.from_error(e)
391
396
  end
392
397
 
398
+ ##
399
+ # Waits for the specified long-running operation until it is done or reaches
400
+ # at most a specified timeout, returning the latest state. If the operation
401
+ # is already done, the latest state is immediately returned. If the timeout
402
+ # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC
403
+ # timeout is used. If the server does not support this method, it returns
404
+ # `google.rpc.Code.UNIMPLEMENTED`.
405
+ # Note that this method is on a best-effort basis. It may return the latest
406
+ # state before the specified timeout (including immediately), meaning even an
407
+ # immediate response is no guarantee that the operation is done.
408
+ #
409
+ # @overload wait_operation(request, options = nil)
410
+ # Pass arguments to `wait_operation` via a request object, either of type
411
+ # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash.
412
+ #
413
+ # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash]
414
+ # A request object representing the call parameters. Required. To specify no
415
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
416
+ # @param options [::Gapic::CallOptions, ::Hash]
417
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
418
+ #
419
+ # @overload wait_operation(name: nil, timeout: nil)
420
+ # Pass arguments to `wait_operation` via keyword arguments. Note that at
421
+ # least one keyword argument is required. To specify no parameters, or to keep all
422
+ # the default parameter values, pass an empty Hash as a request object (see above).
423
+ #
424
+ # @param name [::String]
425
+ # The name of the operation resource to wait on.
426
+ # @param timeout [::Google::Protobuf::Duration, ::Hash]
427
+ # The maximum duration to wait before timing out. If left blank, the wait
428
+ # will be at most the time permitted by the underlying HTTP/RPC protocol.
429
+ # If RPC context deadline is also specified, the shorter one will be used.
430
+ #
431
+ # @yield [response, operation] Access the result along with the RPC operation
432
+ # @yieldparam response [::Gapic::Operation]
433
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
434
+ #
435
+ # @return [::Gapic::Operation]
436
+ #
437
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
438
+ #
439
+ def wait_operation request, options = nil
440
+ raise ::ArgumentError, "request must be provided" if request.nil?
441
+
442
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest
443
+
444
+ # Converts hash and nil to an options object
445
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
446
+
447
+ # Customize the options with defaults
448
+ metadata = @config.rpcs.wait_operation.metadata.to_h
449
+
450
+ # Set x-goog-api-client and x-goog-user-project headers
451
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
452
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
453
+ gapic_version: ::Google::Cloud::Dataproc::V1beta2::VERSION
454
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
455
+
456
+ options.apply_defaults timeout: @config.rpcs.wait_operation.timeout,
457
+ metadata: metadata,
458
+ retry_policy: @config.rpcs.wait_operation.retry_policy
459
+ options.apply_defaults metadata: @config.metadata,
460
+ retry_policy: @config.retry_policy
461
+
462
+ @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
463
+ response = ::Gapic::Operation.new response, @operations_client, options: options
464
+ yield response, operation if block_given?
465
+ return response
466
+ end
467
+ rescue ::GRPC::BadStatus => e
468
+ raise ::Google::Cloud::Error.from_error(e)
469
+ end
470
+
393
471
  ##
394
472
  # Configuration class for the Operations API.
395
473
  #
@@ -475,7 +553,7 @@ module Google
475
553
 
476
554
  config_attr :endpoint, "dataproc.googleapis.com", ::String
477
555
  config_attr :credentials, nil do |value|
478
- allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
556
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
479
557
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
480
558
  allowed.any? { |klass| klass === value }
481
559
  end
@@ -515,7 +593,7 @@ module Google
515
593
  # Each configuration object is of type `Gapic::Config::Method` and includes
516
594
  # the following configuration fields:
517
595
  #
518
- # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
596
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
519
597
  # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
520
598
  # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
521
599
  # include the following keys:
@@ -546,6 +624,11 @@ module Google
546
624
  # @return [::Gapic::Config::Method]
547
625
  #
548
626
  attr_reader :cancel_operation
627
+ ##
628
+ # RPC-specific configuration for `wait_operation`
629
+ # @return [::Gapic::Config::Method]
630
+ #
631
+ attr_reader :wait_operation
549
632
 
550
633
  # @private
551
634
  def initialize parent_rpcs = nil
@@ -557,6 +640,8 @@ module Google
557
640
  @delete_operation = ::Gapic::Config::Method.new delete_operation_config
558
641
  cancel_operation_config = parent_rpcs&.cancel_operation if parent_rpcs&.respond_to? :cancel_operation
559
642
  @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config
643
+ wait_operation_config = parent_rpcs&.wait_operation if parent_rpcs&.respond_to? :wait_operation
644
+ @wait_operation = ::Gapic::Config::Method.new wait_operation_config
560
645
 
561
646
  yield self if block_given?
562
647
  end
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module Dataproc
23
+ module V1beta2
24
+ module ClusterController
25
+ # Path helper methods for the ClusterController API.
26
+ module Paths
27
+ ##
28
+ # Create a fully-qualified Cluster resource string.
29
+ #
30
+ # The resource will be in the following format:
31
+ #
32
+ # `projects/{project}/locations/{location}/clusters/{cluster}`
33
+ #
34
+ # @param project [String]
35
+ # @param location [String]
36
+ # @param cluster [String]
37
+ #
38
+ # @return [::String]
39
+ def cluster_path project:, location:, cluster:
40
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
41
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
42
+
43
+ "projects/#{project}/locations/#{location}/clusters/#{cluster}"
44
+ end
45
+
46
+ extend self
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
@@ -26,6 +26,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
26
26
  end
27
27
  add_message "google.cloud.dataproc.v1beta2.ClusterConfig" do
28
28
  optional :config_bucket, :string, 1
29
+ optional :temp_bucket, :string, 2
29
30
  optional :gce_cluster_config, :message, 8, "google.cloud.dataproc.v1beta2.GceClusterConfig"
30
31
  optional :master_config, :message, 9, "google.cloud.dataproc.v1beta2.InstanceGroupConfig"
31
32
  optional :worker_config, :message, 10, "google.cloud.dataproc.v1beta2.InstanceGroupConfig"
@@ -74,10 +75,16 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
74
75
  optional :machine_type_uri, :string, 4
75
76
  optional :disk_config, :message, 5, "google.cloud.dataproc.v1beta2.DiskConfig"
76
77
  optional :is_preemptible, :bool, 6
78
+ optional :preemptibility, :enum, 10, "google.cloud.dataproc.v1beta2.InstanceGroupConfig.Preemptibility"
77
79
  optional :managed_group_config, :message, 7, "google.cloud.dataproc.v1beta2.ManagedGroupConfig"
78
80
  repeated :accelerators, :message, 8, "google.cloud.dataproc.v1beta2.AcceleratorConfig"
79
81
  optional :min_cpu_platform, :string, 9
80
82
  end
83
+ add_enum "google.cloud.dataproc.v1beta2.InstanceGroupConfig.Preemptibility" do
84
+ value :PREEMPTIBILITY_UNSPECIFIED, 0
85
+ value :NON_PREEMPTIBLE, 1
86
+ value :PREEMPTIBLE, 2
87
+ end
81
88
  add_message "google.cloud.dataproc.v1beta2.ManagedGroupConfig" do
82
89
  optional :instance_template_name, :string, 1
83
90
  optional :instance_group_manager_name, :string, 2
@@ -227,6 +234,7 @@ module Google
227
234
  EncryptionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1beta2.EncryptionConfig").msgclass
228
235
  GceClusterConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1beta2.GceClusterConfig").msgclass
229
236
  InstanceGroupConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1beta2.InstanceGroupConfig").msgclass
237
+ InstanceGroupConfig::Preemptibility = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1beta2.InstanceGroupConfig.Preemptibility").enummodule
230
238
  ManagedGroupConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1beta2.ManagedGroupConfig").msgclass
231
239
  AcceleratorConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1beta2.AcceleratorConfig").msgclass
232
240
  DiskConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1beta2.DiskConfig").msgclass