google-cloud-dataproc-v1 0.5.0 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (26) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +8 -8
  3. data/README.md +1 -1
  4. data/lib/google/cloud/dataproc/v1/autoscaling_policy_service/client.rb +48 -54
  5. data/lib/google/cloud/dataproc/v1/cluster_controller.rb +1 -0
  6. data/lib/google/cloud/dataproc/v1/cluster_controller/client.rb +261 -72
  7. data/lib/google/cloud/dataproc/v1/cluster_controller/operations.rb +34 -25
  8. data/lib/google/cloud/dataproc/v1/cluster_controller/paths.rb +71 -0
  9. data/lib/google/cloud/dataproc/v1/clusters_pb.rb +60 -0
  10. data/lib/google/cloud/dataproc/v1/clusters_services_pb.rb +4 -0
  11. data/lib/google/cloud/dataproc/v1/job_controller/client.rb +64 -76
  12. data/lib/google/cloud/dataproc/v1/job_controller/operations.rb +34 -25
  13. data/lib/google/cloud/dataproc/v1/jobs_pb.rb +2 -0
  14. data/lib/google/cloud/dataproc/v1/shared_pb.rb +7 -0
  15. data/lib/google/cloud/dataproc/v1/version.rb +1 -1
  16. data/lib/google/cloud/dataproc/v1/workflow_template_service/client.rb +61 -74
  17. data/lib/google/cloud/dataproc/v1/workflow_template_service/operations.rb +34 -25
  18. data/lib/google/cloud/dataproc/v1/workflow_template_service/paths.rb +38 -0
  19. data/lib/google/cloud/dataproc/v1/workflow_templates_pb.rb +5 -0
  20. data/lib/google/cloud/dataproc/v1/workflow_templates_services_pb.rb +2 -1
  21. data/proto_docs/google/api/field_behavior.rb +7 -1
  22. data/proto_docs/google/cloud/dataproc/v1/clusters.rb +240 -16
  23. data/proto_docs/google/cloud/dataproc/v1/jobs.rb +29 -10
  24. data/proto_docs/google/cloud/dataproc/v1/shared.rb +24 -1
  25. data/proto_docs/google/cloud/dataproc/v1/workflow_templates.rb +34 -7
  26. metadata +14 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d8f513311372852777147dc4acadea0053ab1c1b49f8005ec4fe4176016a58aa
4
- data.tar.gz: 1028ed0af3f6035b7b3ff5bfcfee9546e563ab8154ce13b46c371d5787e473ff
3
+ metadata.gz: 9df93f6bd1d83e69b00a66aafaac208f41268c4e426556242014353c6acfcc80
4
+ data.tar.gz: 8034f237fcfff16df053a9c5dd26e8b52bacc26f23d8ee4a4ddafe639b716fa4
5
5
  SHA512:
6
- metadata.gz: f2a9885f4e2b1ced87eab958361b137a33f9528885e4cfe6882bdfbe5a0902d0f5aa8c8e2efa7f7264936900e94b752459b9d2315a474febe4e02b311fdd8cab
7
- data.tar.gz: a1cf6046ba3c50b12518073fa76b7df496449ba505ccf580f1233d59b0779d01cd139d798c6567a782269771f8a55690e4627d3fd18167ab143e04459cf6022a
6
+ metadata.gz: 2007015632c66ae71352f90689f23ca1ccee4f6c0aa45c7c20ce214f3a9cb6e896d3c57654737135de2d42d1a74969dbef4aa8f041e20a20b352e4792958eaec
7
+ data.tar.gz: 2d88207eb2471725760b0ef449f8f58fdca93432190a806486e05ffcf27d705ceeb6a069f147b65cbca68dae645aa451e512e7a36625c706f1e9a7912a85f8ba
data/AUTHENTICATION.md CHANGED
@@ -66,11 +66,11 @@ The environment variables that google-cloud-dataproc-v1
66
66
  checks for credentials are configured on the service Credentials class (such as
67
67
  {::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Credentials}):
68
68
 
69
- 1. `DATAPROC_CREDENTIALS` - Path to JSON file, or JSON contents
70
- 2. `DATAPROC_KEYFILE` - Path to JSON file, or JSON contents
71
- 3. `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
72
- 4. `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
73
- 5. `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
69
+ * `DATAPROC_CREDENTIALS` - Path to JSON file, or JSON contents
70
+ * `DATAPROC_KEYFILE` - Path to JSON file, or JSON contents
71
+ * `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
72
+ * `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
73
+ * `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
74
74
 
75
75
  ```ruby
76
76
  require "google/cloud/dataproc/v1"
@@ -82,8 +82,8 @@ client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new
82
82
 
83
83
  ### Configuration
84
84
 
85
- The **Credentials JSON** can be configured instead of placing them in
86
- environment variables. Either on an individual client initialization:
85
+ The path to the **Credentials JSON** file can be configured instead of storing
86
+ it in an environment variable. Either on an individual client initialization:
87
87
 
88
88
  ```ruby
89
89
  require "google/cloud/dataproc/v1"
@@ -93,7 +93,7 @@ client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new do
93
93
  end
94
94
  ```
95
95
 
96
- Or configured globally for all clients:
96
+ Or globally for all clients:
97
97
 
98
98
  ```ruby
99
99
  require "google/cloud/dataproc/v1"
data/README.md CHANGED
@@ -33,7 +33,7 @@ In order to use this library, you first need to go through the following steps:
33
33
  require "google/cloud/dataproc/v1"
34
34
 
35
35
  client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new
36
- request = my_create_request
36
+ request = ::Google::Cloud::Dataproc::V1::CreateAutoscalingPolicyRequest.new # (request fields as keyword arguments...)
37
37
  response = client.create_autoscaling_policy request
38
38
  ```
39
39
 
@@ -42,13 +42,12 @@ module Google
42
42
  # See {::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client::Configuration}
43
43
  # for a description of the configuration fields.
44
44
  #
45
- # ## Example
45
+ # @example
46
46
  #
47
- # To modify the configuration for all AutoscalingPolicyService clients:
48
- #
49
- # ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.configure do |config|
50
- # config.timeout = 10.0
51
- # end
47
+ # # Modify the configuration for all AutoscalingPolicyService clients
48
+ # ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.configure do |config|
49
+ # config.timeout = 10.0
50
+ # end
52
51
  #
53
52
  # @yield [config] Configure the Client client.
54
53
  # @yieldparam config [Client::Configuration]
@@ -70,26 +69,17 @@ module Google
70
69
 
71
70
  default_config.rpcs.update_autoscaling_policy.timeout = 600.0
72
71
  default_config.rpcs.update_autoscaling_policy.retry_policy = {
73
- initial_delay: 0.1,
74
- max_delay: 60.0,
75
- multiplier: 1.3,
76
- retry_codes: [4, 14]
72
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
77
73
  }
78
74
 
79
75
  default_config.rpcs.get_autoscaling_policy.timeout = 600.0
80
76
  default_config.rpcs.get_autoscaling_policy.retry_policy = {
81
- initial_delay: 0.1,
82
- max_delay: 60.0,
83
- multiplier: 1.3,
84
- retry_codes: [4, 14]
77
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
85
78
  }
86
79
 
87
80
  default_config.rpcs.list_autoscaling_policies.timeout = 600.0
88
81
  default_config.rpcs.list_autoscaling_policies.retry_policy = {
89
- initial_delay: 0.1,
90
- max_delay: 60.0,
91
- multiplier: 1.3,
92
- retry_codes: [4, 14]
82
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
93
83
  }
94
84
 
95
85
  default_config.rpcs.delete_autoscaling_policy.timeout = 600.0
@@ -123,19 +113,15 @@ module Google
123
113
  ##
124
114
  # Create a new AutoscalingPolicyService client object.
125
115
  #
126
- # ## Examples
127
- #
128
- # To create a new AutoscalingPolicyService client with the default
129
- # configuration:
130
- #
131
- # client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new
116
+ # @example
132
117
  #
133
- # To create a new AutoscalingPolicyService client with a custom
134
- # configuration:
118
+ # # Create a client using the default configuration
119
+ # client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new
135
120
  #
136
- # client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new do |config|
137
- # config.timeout = 10.0
138
- # end
121
+ # # Create a client using a custom configuration
122
+ # client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new do |config|
123
+ # config.timeout = 10.0
124
+ # end
139
125
  #
140
126
  # @yield [config] Configure the AutoscalingPolicyService client.
141
127
  # @yieldparam config [Client::Configuration]
@@ -155,14 +141,13 @@ module Google
155
141
 
156
142
  # Create credentials
157
143
  credentials = @config.credentials
158
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
144
+ # Use self-signed JWT if the endpoint is unchanged from default,
159
145
  # 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 &&
146
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
162
147
  !@config.endpoint.split(".").first.include?("-")
163
148
  credentials ||= Credentials.default scope: @config.scope,
164
149
  enable_self_signed_jwt: enable_self_signed_jwt
165
- if credentials.is_a?(String) || credentials.is_a?(Hash)
150
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
166
151
  credentials = Credentials.new credentials, scope: @config.scope
167
152
  end
168
153
  @quota_project_id = @config.quota_project
@@ -245,7 +230,9 @@ module Google
245
230
  options.apply_defaults timeout: @config.rpcs.create_autoscaling_policy.timeout,
246
231
  metadata: metadata,
247
232
  retry_policy: @config.rpcs.create_autoscaling_policy.retry_policy
248
- options.apply_defaults metadata: @config.metadata,
233
+
234
+ options.apply_defaults timeout: @config.timeout,
235
+ metadata: @config.metadata,
249
236
  retry_policy: @config.retry_policy
250
237
 
251
238
  @autoscaling_policy_service_stub.call_rpc :create_autoscaling_policy, request, options: options do |response, operation|
@@ -314,7 +301,9 @@ module Google
314
301
  options.apply_defaults timeout: @config.rpcs.update_autoscaling_policy.timeout,
315
302
  metadata: metadata,
316
303
  retry_policy: @config.rpcs.update_autoscaling_policy.retry_policy
317
- options.apply_defaults metadata: @config.metadata,
304
+
305
+ options.apply_defaults timeout: @config.timeout,
306
+ metadata: @config.metadata,
318
307
  retry_policy: @config.retry_policy
319
308
 
320
309
  @autoscaling_policy_service_stub.call_rpc :update_autoscaling_policy, request, options: options do |response, operation|
@@ -389,7 +378,9 @@ module Google
389
378
  options.apply_defaults timeout: @config.rpcs.get_autoscaling_policy.timeout,
390
379
  metadata: metadata,
391
380
  retry_policy: @config.rpcs.get_autoscaling_policy.retry_policy
392
- options.apply_defaults metadata: @config.metadata,
381
+
382
+ options.apply_defaults timeout: @config.timeout,
383
+ metadata: @config.metadata,
393
384
  retry_policy: @config.retry_policy
394
385
 
395
386
  @autoscaling_policy_service_stub.call_rpc :get_autoscaling_policy, request, options: options do |response, operation|
@@ -470,7 +461,9 @@ module Google
470
461
  options.apply_defaults timeout: @config.rpcs.list_autoscaling_policies.timeout,
471
462
  metadata: metadata,
472
463
  retry_policy: @config.rpcs.list_autoscaling_policies.retry_policy
473
- options.apply_defaults metadata: @config.metadata,
464
+
465
+ options.apply_defaults timeout: @config.timeout,
466
+ metadata: @config.metadata,
474
467
  retry_policy: @config.retry_policy
475
468
 
476
469
  @autoscaling_policy_service_stub.call_rpc :list_autoscaling_policies, request, options: options do |response, operation|
@@ -547,7 +540,9 @@ module Google
547
540
  options.apply_defaults timeout: @config.rpcs.delete_autoscaling_policy.timeout,
548
541
  metadata: metadata,
549
542
  retry_policy: @config.rpcs.delete_autoscaling_policy.retry_policy
550
- options.apply_defaults metadata: @config.metadata,
543
+
544
+ options.apply_defaults timeout: @config.timeout,
545
+ metadata: @config.metadata,
551
546
  retry_policy: @config.retry_policy
552
547
 
553
548
  @autoscaling_policy_service_stub.call_rpc :delete_autoscaling_policy, request, options: options do |response, operation|
@@ -571,22 +566,21 @@ module Google
571
566
  # Configuration can be applied globally to all clients, or to a single client
572
567
  # on construction.
573
568
  #
574
- # # Examples
575
- #
576
- # To modify the global config, setting the timeout for create_autoscaling_policy
577
- # to 20 seconds, and all remaining timeouts to 10 seconds:
578
- #
579
- # ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.configure do |config|
580
- # config.timeout = 10.0
581
- # config.rpcs.create_autoscaling_policy.timeout = 20.0
582
- # end
583
- #
584
- # To apply the above configuration only to a new client:
585
- #
586
- # client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new do |config|
587
- # config.timeout = 10.0
588
- # config.rpcs.create_autoscaling_policy.timeout = 20.0
589
- # end
569
+ # @example
570
+ #
571
+ # # Modify the global config, setting the timeout for
572
+ # # create_autoscaling_policy to 20 seconds,
573
+ # # and all remaining timeouts to 10 seconds.
574
+ # ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.configure do |config|
575
+ # config.timeout = 10.0
576
+ # config.rpcs.create_autoscaling_policy.timeout = 20.0
577
+ # end
578
+ #
579
+ # # Apply the above configuration only to a new client.
580
+ # client = ::Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new do |config|
581
+ # config.timeout = 10.0
582
+ # config.rpcs.create_autoscaling_policy.timeout = 20.0
583
+ # end
590
584
  #
591
585
  # @!attribute [rw] endpoint
592
586
  # The hostname or hostname:port of the service endpoint.
@@ -23,6 +23,7 @@ require "gapic/config/method"
23
23
  require "google/cloud/dataproc/v1/version"
24
24
 
25
25
  require "google/cloud/dataproc/v1/cluster_controller/credentials"
26
+ require "google/cloud/dataproc/v1/cluster_controller/paths"
26
27
  require "google/cloud/dataproc/v1/cluster_controller/operations"
27
28
  require "google/cloud/dataproc/v1/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
 
@@ -40,13 +42,12 @@ module Google
40
42
  # See {::Google::Cloud::Dataproc::V1::ClusterController::Client::Configuration}
41
43
  # for a description of the configuration fields.
42
44
  #
43
- # ## Example
44
- #
45
- # To modify the configuration for all ClusterController clients:
45
+ # @example
46
46
  #
47
- # ::Google::Cloud::Dataproc::V1::ClusterController::Client.configure do |config|
48
- # config.timeout = 10.0
49
- # end
47
+ # # Modify the configuration for all ClusterController clients
48
+ # ::Google::Cloud::Dataproc::V1::ClusterController::Client.configure do |config|
49
+ # config.timeout = 10.0
50
+ # end
50
51
  #
51
52
  # @yield [config] Configure the Client client.
52
53
  # @yieldparam config [Client::Configuration]
@@ -66,50 +67,32 @@ module Google
66
67
 
67
68
  default_config.rpcs.create_cluster.timeout = 300.0
68
69
  default_config.rpcs.create_cluster.retry_policy = {
69
- initial_delay: 0.1,
70
- max_delay: 60.0,
71
- multiplier: 1.3,
72
- retry_codes: [14]
70
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
73
71
  }
74
72
 
75
73
  default_config.rpcs.update_cluster.timeout = 300.0
76
74
  default_config.rpcs.update_cluster.retry_policy = {
77
- initial_delay: 0.1,
78
- max_delay: 60.0,
79
- multiplier: 1.3,
80
- retry_codes: [14]
75
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
81
76
  }
82
77
 
83
78
  default_config.rpcs.delete_cluster.timeout = 300.0
84
79
  default_config.rpcs.delete_cluster.retry_policy = {
85
- initial_delay: 0.1,
86
- max_delay: 60.0,
87
- multiplier: 1.3,
88
- retry_codes: [14]
80
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
89
81
  }
90
82
 
91
83
  default_config.rpcs.get_cluster.timeout = 300.0
92
84
  default_config.rpcs.get_cluster.retry_policy = {
93
- initial_delay: 0.1,
94
- max_delay: 60.0,
95
- multiplier: 1.3,
96
- retry_codes: [13, 4, 14]
85
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [13, 4, 14]
97
86
  }
98
87
 
99
88
  default_config.rpcs.list_clusters.timeout = 300.0
100
89
  default_config.rpcs.list_clusters.retry_policy = {
101
- initial_delay: 0.1,
102
- max_delay: 60.0,
103
- multiplier: 1.3,
104
- retry_codes: [13, 4, 14]
90
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [13, 4, 14]
105
91
  }
106
92
 
107
93
  default_config.rpcs.diagnose_cluster.timeout = 300.0
108
94
  default_config.rpcs.diagnose_cluster.retry_policy = {
109
- initial_delay: 0.1,
110
- max_delay: 60.0,
111
- multiplier: 1.3,
112
- retry_codes: [14]
95
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
113
96
  }
114
97
 
115
98
  default_config
@@ -141,19 +124,15 @@ module Google
141
124
  ##
142
125
  # Create a new ClusterController client object.
143
126
  #
144
- # ## Examples
145
- #
146
- # To create a new ClusterController client with the default
147
- # configuration:
127
+ # @example
148
128
  #
149
- # client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new
129
+ # # Create a client using the default configuration
130
+ # client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new
150
131
  #
151
- # To create a new ClusterController client with a custom
152
- # configuration:
153
- #
154
- # client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new do |config|
155
- # config.timeout = 10.0
156
- # end
132
+ # # Create a client using a custom configuration
133
+ # client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new do |config|
134
+ # config.timeout = 10.0
135
+ # end
157
136
  #
158
137
  # @yield [config] Configure the ClusterController client.
159
138
  # @yieldparam config [Client::Configuration]
@@ -173,14 +152,13 @@ module Google
173
152
 
174
153
  # Create credentials
175
154
  credentials = @config.credentials
176
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
155
+ # Use self-signed JWT if the endpoint is unchanged from default,
177
156
  # but only if the default endpoint does not have a region prefix.
178
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
179
- @config.endpoint == Client.configure.endpoint &&
157
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
180
158
  !@config.endpoint.split(".").first.include?("-")
181
159
  credentials ||= Credentials.default scope: @config.scope,
182
160
  enable_self_signed_jwt: enable_self_signed_jwt
183
- if credentials.is_a?(String) || credentials.is_a?(Hash)
161
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
184
162
  credentials = Credentials.new credentials, scope: @config.scope
185
163
  end
186
164
  @quota_project_id = @config.quota_project
@@ -237,9 +215,9 @@ module Google
237
215
  # @param cluster [::Google::Cloud::Dataproc::V1::Cluster, ::Hash]
238
216
  # Required. The cluster to create.
239
217
  # @param request_id [::String]
240
- # Optional. A unique id used to identify the request. If the server
241
- # receives two {::Google::Cloud::Dataproc::V1::CreateClusterRequest CreateClusterRequest} requests with the same
242
- # id, then the second request will be ignored and the
218
+ # Optional. A unique id used to identify the request. If the server receives two
219
+ # [CreateClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateClusterRequest)s
220
+ # with the same id, then the second request will be ignored and the
243
221
  # first {::Google::Longrunning::Operation google.longrunning.Operation} created and stored in the backend
244
222
  # is returned.
245
223
  #
@@ -284,7 +262,9 @@ module Google
284
262
  options.apply_defaults timeout: @config.rpcs.create_cluster.timeout,
285
263
  metadata: metadata,
286
264
  retry_policy: @config.rpcs.create_cluster.retry_policy
287
- options.apply_defaults metadata: @config.metadata,
265
+
266
+ options.apply_defaults timeout: @config.timeout,
267
+ metadata: @config.metadata,
288
268
  retry_policy: @config.retry_policy
289
269
 
290
270
  @cluster_controller_stub.call_rpc :create_cluster, request, options: options do |response, operation|
@@ -389,8 +369,9 @@ module Google
389
369
  # </table>
390
370
  # @param request_id [::String]
391
371
  # Optional. A unique id used to identify the request. If the server
392
- # receives two {::Google::Cloud::Dataproc::V1::UpdateClusterRequest UpdateClusterRequest} requests with the same
393
- # id, then the second request will be ignored and the
372
+ # receives two
373
+ # [UpdateClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.UpdateClusterRequest)s
374
+ # with the same id, then the second request will be ignored and the
394
375
  # first {::Google::Longrunning::Operation google.longrunning.Operation} created and stored in the
395
376
  # backend is returned.
396
377
  #
@@ -436,7 +417,9 @@ module Google
436
417
  options.apply_defaults timeout: @config.rpcs.update_cluster.timeout,
437
418
  metadata: metadata,
438
419
  retry_policy: @config.rpcs.update_cluster.retry_policy
439
- options.apply_defaults metadata: @config.metadata,
420
+
421
+ options.apply_defaults timeout: @config.timeout,
422
+ metadata: @config.metadata,
440
423
  retry_policy: @config.retry_policy
441
424
 
442
425
  @cluster_controller_stub.call_rpc :update_cluster, request, options: options do |response, operation|
@@ -448,6 +431,190 @@ module Google
448
431
  raise ::Google::Cloud::Error.from_error(e)
449
432
  end
450
433
 
434
+ ##
435
+ # Stops a cluster in a project.
436
+ #
437
+ # @overload stop_cluster(request, options = nil)
438
+ # Pass arguments to `stop_cluster` via a request object, either of type
439
+ # {::Google::Cloud::Dataproc::V1::StopClusterRequest} or an equivalent Hash.
440
+ #
441
+ # @param request [::Google::Cloud::Dataproc::V1::StopClusterRequest, ::Hash]
442
+ # A request object representing the call parameters. Required. To specify no
443
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
444
+ # @param options [::Gapic::CallOptions, ::Hash]
445
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
446
+ #
447
+ # @overload stop_cluster(project_id: nil, region: nil, cluster_name: nil, cluster_uuid: nil, request_id: nil)
448
+ # Pass arguments to `stop_cluster` via keyword arguments. Note that at
449
+ # least one keyword argument is required. To specify no parameters, or to keep all
450
+ # the default parameter values, pass an empty Hash as a request object (see above).
451
+ #
452
+ # @param project_id [::String]
453
+ # Required. The ID of the Google Cloud Platform project the
454
+ # cluster belongs to.
455
+ # @param region [::String]
456
+ # Required. The Dataproc region in which to handle the request.
457
+ # @param cluster_name [::String]
458
+ # Required. The cluster name.
459
+ # @param cluster_uuid [::String]
460
+ # Optional. Specifying the `cluster_uuid` means the RPC will fail
461
+ # (with error NOT_FOUND) if a cluster with the specified UUID does not exist.
462
+ # @param request_id [::String]
463
+ # Optional. A unique id used to identify the request. If the server
464
+ # receives two
465
+ # [StopClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.StopClusterRequest)s
466
+ # with the same id, then the second request will be ignored and the
467
+ # first {::Google::Longrunning::Operation google.longrunning.Operation} created and stored in the
468
+ # backend is returned.
469
+ #
470
+ # Recommendation: Set this value to a
471
+ # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
472
+ #
473
+ # The id must contain only letters (a-z, A-Z), numbers (0-9),
474
+ # underscores (_), and hyphens (-). The maximum length is 40 characters.
475
+ #
476
+ # @yield [response, operation] Access the result along with the RPC operation
477
+ # @yieldparam response [::Gapic::Operation]
478
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
479
+ #
480
+ # @return [::Gapic::Operation]
481
+ #
482
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
483
+ #
484
+ def stop_cluster request, options = nil
485
+ raise ::ArgumentError, "request must be provided" if request.nil?
486
+
487
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::StopClusterRequest
488
+
489
+ # Converts hash and nil to an options object
490
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
491
+
492
+ # Customize the options with defaults
493
+ metadata = @config.rpcs.stop_cluster.metadata.to_h
494
+
495
+ # Set x-goog-api-client and x-goog-user-project headers
496
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
497
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
498
+ gapic_version: ::Google::Cloud::Dataproc::V1::VERSION
499
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
500
+
501
+ header_params = {
502
+ "project_id" => request.project_id,
503
+ "region" => request.region,
504
+ "cluster_name" => request.cluster_name
505
+ }
506
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
507
+ metadata[:"x-goog-request-params"] ||= request_params_header
508
+
509
+ options.apply_defaults timeout: @config.rpcs.stop_cluster.timeout,
510
+ metadata: metadata,
511
+ retry_policy: @config.rpcs.stop_cluster.retry_policy
512
+
513
+ options.apply_defaults timeout: @config.timeout,
514
+ metadata: @config.metadata,
515
+ retry_policy: @config.retry_policy
516
+
517
+ @cluster_controller_stub.call_rpc :stop_cluster, request, options: options do |response, operation|
518
+ response = ::Gapic::Operation.new response, @operations_client, options: options
519
+ yield response, operation if block_given?
520
+ return response
521
+ end
522
+ rescue ::GRPC::BadStatus => e
523
+ raise ::Google::Cloud::Error.from_error(e)
524
+ end
525
+
526
+ ##
527
+ # Starts a cluster in a project.
528
+ #
529
+ # @overload start_cluster(request, options = nil)
530
+ # Pass arguments to `start_cluster` via a request object, either of type
531
+ # {::Google::Cloud::Dataproc::V1::StartClusterRequest} or an equivalent Hash.
532
+ #
533
+ # @param request [::Google::Cloud::Dataproc::V1::StartClusterRequest, ::Hash]
534
+ # A request object representing the call parameters. Required. To specify no
535
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
536
+ # @param options [::Gapic::CallOptions, ::Hash]
537
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
538
+ #
539
+ # @overload start_cluster(project_id: nil, region: nil, cluster_name: nil, cluster_uuid: nil, request_id: nil)
540
+ # Pass arguments to `start_cluster` via keyword arguments. Note that at
541
+ # least one keyword argument is required. To specify no parameters, or to keep all
542
+ # the default parameter values, pass an empty Hash as a request object (see above).
543
+ #
544
+ # @param project_id [::String]
545
+ # Required. The ID of the Google Cloud Platform project the
546
+ # cluster belongs to.
547
+ # @param region [::String]
548
+ # Required. The Dataproc region in which to handle the request.
549
+ # @param cluster_name [::String]
550
+ # Required. The cluster name.
551
+ # @param cluster_uuid [::String]
552
+ # Optional. Specifying the `cluster_uuid` means the RPC will fail
553
+ # (with error NOT_FOUND) if a cluster with the specified UUID does not exist.
554
+ # @param request_id [::String]
555
+ # Optional. A unique id used to identify the request. If the server
556
+ # receives two
557
+ # [StartClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.StartClusterRequest)s
558
+ # with the same id, then the second request will be ignored and the
559
+ # first {::Google::Longrunning::Operation google.longrunning.Operation} created and stored in the
560
+ # backend is returned.
561
+ #
562
+ # Recommendation: Set this value to a
563
+ # [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
564
+ #
565
+ # The id must contain only letters (a-z, A-Z), numbers (0-9),
566
+ # underscores (_), and hyphens (-). The maximum length is 40 characters.
567
+ #
568
+ # @yield [response, operation] Access the result along with the RPC operation
569
+ # @yieldparam response [::Gapic::Operation]
570
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
571
+ #
572
+ # @return [::Gapic::Operation]
573
+ #
574
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
575
+ #
576
+ def start_cluster request, options = nil
577
+ raise ::ArgumentError, "request must be provided" if request.nil?
578
+
579
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dataproc::V1::StartClusterRequest
580
+
581
+ # Converts hash and nil to an options object
582
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
583
+
584
+ # Customize the options with defaults
585
+ metadata = @config.rpcs.start_cluster.metadata.to_h
586
+
587
+ # Set x-goog-api-client and x-goog-user-project headers
588
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
589
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
590
+ gapic_version: ::Google::Cloud::Dataproc::V1::VERSION
591
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
592
+
593
+ header_params = {
594
+ "project_id" => request.project_id,
595
+ "region" => request.region,
596
+ "cluster_name" => request.cluster_name
597
+ }
598
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
599
+ metadata[:"x-goog-request-params"] ||= request_params_header
600
+
601
+ options.apply_defaults timeout: @config.rpcs.start_cluster.timeout,
602
+ metadata: metadata,
603
+ retry_policy: @config.rpcs.start_cluster.retry_policy
604
+
605
+ options.apply_defaults timeout: @config.timeout,
606
+ metadata: @config.metadata,
607
+ retry_policy: @config.retry_policy
608
+
609
+ @cluster_controller_stub.call_rpc :start_cluster, request, options: options do |response, operation|
610
+ response = ::Gapic::Operation.new response, @operations_client, options: options
611
+ yield response, operation if block_given?
612
+ return response
613
+ end
614
+ rescue ::GRPC::BadStatus => e
615
+ raise ::Google::Cloud::Error.from_error(e)
616
+ end
617
+
451
618
  ##
452
619
  # Deletes a cluster in a project. The returned
453
620
  # {::Google::Longrunning::Operation#metadata Operation.metadata} will be
@@ -480,8 +647,9 @@ module Google
480
647
  # (with error NOT_FOUND) if cluster with specified UUID does not exist.
481
648
  # @param request_id [::String]
482
649
  # Optional. A unique id used to identify the request. If the server
483
- # receives two {::Google::Cloud::Dataproc::V1::DeleteClusterRequest DeleteClusterRequest} requests with the same
484
- # id, then the second request will be ignored and the
650
+ # receives two
651
+ # [DeleteClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.DeleteClusterRequest)s
652
+ # with the same id, then the second request will be ignored and the
485
653
  # first {::Google::Longrunning::Operation google.longrunning.Operation} created and stored in the
486
654
  # backend is returned.
487
655
  #
@@ -527,7 +695,9 @@ module Google
527
695
  options.apply_defaults timeout: @config.rpcs.delete_cluster.timeout,
528
696
  metadata: metadata,
529
697
  retry_policy: @config.rpcs.delete_cluster.retry_policy
530
- options.apply_defaults metadata: @config.metadata,
698
+
699
+ options.apply_defaults timeout: @config.timeout,
700
+ metadata: @config.metadata,
531
701
  retry_policy: @config.retry_policy
532
702
 
533
703
  @cluster_controller_stub.call_rpc :delete_cluster, request, options: options do |response, operation|
@@ -601,7 +771,9 @@ module Google
601
771
  options.apply_defaults timeout: @config.rpcs.get_cluster.timeout,
602
772
  metadata: metadata,
603
773
  retry_policy: @config.rpcs.get_cluster.retry_policy
604
- options.apply_defaults metadata: @config.metadata,
774
+
775
+ options.apply_defaults timeout: @config.timeout,
776
+ metadata: @config.metadata,
605
777
  retry_policy: @config.retry_policy
606
778
 
607
779
  @cluster_controller_stub.call_rpc :get_cluster, request, options: options do |response, operation|
@@ -695,7 +867,9 @@ module Google
695
867
  options.apply_defaults timeout: @config.rpcs.list_clusters.timeout,
696
868
  metadata: metadata,
697
869
  retry_policy: @config.rpcs.list_clusters.retry_policy
698
- options.apply_defaults metadata: @config.metadata,
870
+
871
+ options.apply_defaults timeout: @config.timeout,
872
+ metadata: @config.metadata,
699
873
  retry_policy: @config.retry_policy
700
874
 
701
875
  @cluster_controller_stub.call_rpc :list_clusters, request, options: options do |response, operation|
@@ -775,7 +949,9 @@ module Google
775
949
  options.apply_defaults timeout: @config.rpcs.diagnose_cluster.timeout,
776
950
  metadata: metadata,
777
951
  retry_policy: @config.rpcs.diagnose_cluster.retry_policy
778
- options.apply_defaults metadata: @config.metadata,
952
+
953
+ options.apply_defaults timeout: @config.timeout,
954
+ metadata: @config.metadata,
779
955
  retry_policy: @config.retry_policy
780
956
 
781
957
  @cluster_controller_stub.call_rpc :diagnose_cluster, request, options: options do |response, operation|
@@ -800,22 +976,21 @@ module Google
800
976
  # Configuration can be applied globally to all clients, or to a single client
801
977
  # on construction.
802
978
  #
803
- # # Examples
804
- #
805
- # To modify the global config, setting the timeout for create_cluster
806
- # to 20 seconds, and all remaining timeouts to 10 seconds:
979
+ # @example
807
980
  #
808
- # ::Google::Cloud::Dataproc::V1::ClusterController::Client.configure do |config|
809
- # config.timeout = 10.0
810
- # config.rpcs.create_cluster.timeout = 20.0
811
- # end
981
+ # # Modify the global config, setting the timeout for
982
+ # # create_cluster to 20 seconds,
983
+ # # and all remaining timeouts to 10 seconds.
984
+ # ::Google::Cloud::Dataproc::V1::ClusterController::Client.configure do |config|
985
+ # config.timeout = 10.0
986
+ # config.rpcs.create_cluster.timeout = 20.0
987
+ # end
812
988
  #
813
- # To apply the above configuration only to a new client:
814
- #
815
- # client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new do |config|
816
- # config.timeout = 10.0
817
- # config.rpcs.create_cluster.timeout = 20.0
818
- # end
989
+ # # Apply the above configuration only to a new client.
990
+ # client = ::Google::Cloud::Dataproc::V1::ClusterController::Client.new do |config|
991
+ # config.timeout = 10.0
992
+ # config.rpcs.create_cluster.timeout = 20.0
993
+ # end
819
994
  #
820
995
  # @!attribute [rw] endpoint
821
996
  # The hostname or hostname:port of the service endpoint.
@@ -934,6 +1109,16 @@ module Google
934
1109
  #
935
1110
  attr_reader :update_cluster
936
1111
  ##
1112
+ # RPC-specific configuration for `stop_cluster`
1113
+ # @return [::Gapic::Config::Method]
1114
+ #
1115
+ attr_reader :stop_cluster
1116
+ ##
1117
+ # RPC-specific configuration for `start_cluster`
1118
+ # @return [::Gapic::Config::Method]
1119
+ #
1120
+ attr_reader :start_cluster
1121
+ ##
937
1122
  # RPC-specific configuration for `delete_cluster`
938
1123
  # @return [::Gapic::Config::Method]
939
1124
  #
@@ -960,6 +1145,10 @@ module Google
960
1145
  @create_cluster = ::Gapic::Config::Method.new create_cluster_config
961
1146
  update_cluster_config = parent_rpcs.update_cluster if parent_rpcs.respond_to? :update_cluster
962
1147
  @update_cluster = ::Gapic::Config::Method.new update_cluster_config
1148
+ stop_cluster_config = parent_rpcs.stop_cluster if parent_rpcs.respond_to? :stop_cluster
1149
+ @stop_cluster = ::Gapic::Config::Method.new stop_cluster_config
1150
+ start_cluster_config = parent_rpcs.start_cluster if parent_rpcs.respond_to? :start_cluster
1151
+ @start_cluster = ::Gapic::Config::Method.new start_cluster_config
963
1152
  delete_cluster_config = parent_rpcs.delete_cluster if parent_rpcs.respond_to? :delete_cluster
964
1153
  @delete_cluster = ::Gapic::Config::Method.new delete_cluster_config
965
1154
  get_cluster_config = parent_rpcs.get_cluster if parent_rpcs.respond_to? :get_cluster