google-cloud-dataproc-v1beta2 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.yardopts +12 -0
- data/AUTHENTICATION.md +169 -0
- data/LICENSE.md +203 -0
- data/README.md +71 -0
- data/lib/google-cloud-dataproc-v1beta2.rb +21 -0
- data/lib/google/cloud/common_resources_pb.rb +15 -0
- data/lib/google/cloud/dataproc/v1beta2.rb +38 -0
- data/lib/google/cloud/dataproc/v1beta2/autoscaling_policies_pb.rb +81 -0
- data/lib/google/cloud/dataproc/v1beta2/autoscaling_policies_services_pb.rb +58 -0
- data/lib/google/cloud/dataproc/v1beta2/autoscaling_policy_service.rb +50 -0
- data/lib/google/cloud/dataproc/v1beta2/autoscaling_policy_service/client.rb +734 -0
- data/lib/google/cloud/dataproc/v1beta2/autoscaling_policy_service/credentials.rb +51 -0
- data/lib/google/cloud/dataproc/v1beta2/autoscaling_policy_service/paths.rb +110 -0
- data/lib/google/cloud/dataproc/v1beta2/cluster_controller.rb +50 -0
- data/lib/google/cloud/dataproc/v1beta2/cluster_controller/client.rb +979 -0
- data/lib/google/cloud/dataproc/v1beta2/cluster_controller/credentials.rb +51 -0
- data/lib/google/cloud/dataproc/v1beta2/cluster_controller/operations.rb +564 -0
- data/lib/google/cloud/dataproc/v1beta2/clusters_pb.rb +255 -0
- data/lib/google/cloud/dataproc/v1beta2/clusters_services_pb.rb +68 -0
- data/lib/google/cloud/dataproc/v1beta2/job_controller.rb +49 -0
- data/lib/google/cloud/dataproc/v1beta2/job_controller/client.rb +980 -0
- data/lib/google/cloud/dataproc/v1beta2/job_controller/credentials.rb +51 -0
- data/lib/google/cloud/dataproc/v1beta2/job_controller/operations.rb +564 -0
- data/lib/google/cloud/dataproc/v1beta2/jobs_pb.rb +283 -0
- data/lib/google/cloud/dataproc/v1beta2/jobs_services_pb.rb +62 -0
- data/lib/google/cloud/dataproc/v1beta2/operations_pb.rb +45 -0
- data/lib/google/cloud/dataproc/v1beta2/shared_pb.rb +35 -0
- data/lib/google/cloud/dataproc/v1beta2/version.rb +28 -0
- data/lib/google/cloud/dataproc/v1beta2/workflow_template_service.rb +51 -0
- data/lib/google/cloud/dataproc/v1beta2/workflow_template_service/client.rb +1028 -0
- data/lib/google/cloud/dataproc/v1beta2/workflow_template_service/credentials.rb +51 -0
- data/lib/google/cloud/dataproc/v1beta2/workflow_template_service/operations.rb +564 -0
- data/lib/google/cloud/dataproc/v1beta2/workflow_template_service/paths.rb +110 -0
- data/lib/google/cloud/dataproc/v1beta2/workflow_templates_pb.rb +189 -0
- data/lib/google/cloud/dataproc/v1beta2/workflow_templates_services_pb.rb +104 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/api/field_behavior.rb +59 -0
- data/proto_docs/google/api/resource.rb +247 -0
- data/proto_docs/google/cloud/dataproc/v1beta2/autoscaling_policies.rb +272 -0
- data/proto_docs/google/cloud/dataproc/v1beta2/clusters.rb +1032 -0
- data/proto_docs/google/cloud/dataproc/v1beta2/jobs.rb +984 -0
- data/proto_docs/google/cloud/dataproc/v1beta2/operations.rb +98 -0
- data/proto_docs/google/cloud/dataproc/v1beta2/shared.rb +68 -0
- data/proto_docs/google/cloud/dataproc/v1beta2/workflow_templates.rb +706 -0
- data/proto_docs/google/longrunning/operations.rb +150 -0
- data/proto_docs/google/protobuf/any.rb +138 -0
- data/proto_docs/google/protobuf/duration.rb +98 -0
- data/proto_docs/google/protobuf/empty.rb +36 -0
- data/proto_docs/google/protobuf/field_mask.rb +229 -0
- data/proto_docs/google/protobuf/timestamp.rb +120 -0
- data/proto_docs/google/rpc/status.rb +46 -0
- metadata +205 -0
@@ -0,0 +1,255 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# source: google/cloud/dataproc/v1beta2/clusters.proto
|
3
|
+
|
4
|
+
require 'google/protobuf'
|
5
|
+
|
6
|
+
require 'google/api/annotations_pb'
|
7
|
+
require 'google/api/client_pb'
|
8
|
+
require 'google/api/field_behavior_pb'
|
9
|
+
require 'google/api/resource_pb'
|
10
|
+
require 'google/cloud/dataproc/v1beta2/shared_pb'
|
11
|
+
require 'google/longrunning/operations_pb'
|
12
|
+
require 'google/protobuf/duration_pb'
|
13
|
+
require 'google/protobuf/field_mask_pb'
|
14
|
+
require 'google/protobuf/timestamp_pb'
|
15
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
16
|
+
add_file("google/cloud/dataproc/v1beta2/clusters.proto", :syntax => :proto3) do
|
17
|
+
add_message "google.cloud.dataproc.v1beta2.Cluster" do
|
18
|
+
optional :project_id, :string, 1
|
19
|
+
optional :cluster_name, :string, 2
|
20
|
+
optional :config, :message, 3, "google.cloud.dataproc.v1beta2.ClusterConfig"
|
21
|
+
map :labels, :string, :string, 8
|
22
|
+
optional :status, :message, 4, "google.cloud.dataproc.v1beta2.ClusterStatus"
|
23
|
+
repeated :status_history, :message, 7, "google.cloud.dataproc.v1beta2.ClusterStatus"
|
24
|
+
optional :cluster_uuid, :string, 6
|
25
|
+
optional :metrics, :message, 9, "google.cloud.dataproc.v1beta2.ClusterMetrics"
|
26
|
+
end
|
27
|
+
add_message "google.cloud.dataproc.v1beta2.ClusterConfig" do
|
28
|
+
optional :config_bucket, :string, 1
|
29
|
+
optional :gce_cluster_config, :message, 8, "google.cloud.dataproc.v1beta2.GceClusterConfig"
|
30
|
+
optional :master_config, :message, 9, "google.cloud.dataproc.v1beta2.InstanceGroupConfig"
|
31
|
+
optional :worker_config, :message, 10, "google.cloud.dataproc.v1beta2.InstanceGroupConfig"
|
32
|
+
optional :secondary_worker_config, :message, 12, "google.cloud.dataproc.v1beta2.InstanceGroupConfig"
|
33
|
+
optional :software_config, :message, 13, "google.cloud.dataproc.v1beta2.SoftwareConfig"
|
34
|
+
optional :lifecycle_config, :message, 14, "google.cloud.dataproc.v1beta2.LifecycleConfig"
|
35
|
+
repeated :initialization_actions, :message, 11, "google.cloud.dataproc.v1beta2.NodeInitializationAction"
|
36
|
+
optional :encryption_config, :message, 15, "google.cloud.dataproc.v1beta2.EncryptionConfig"
|
37
|
+
optional :autoscaling_config, :message, 16, "google.cloud.dataproc.v1beta2.AutoscalingConfig"
|
38
|
+
optional :endpoint_config, :message, 17, "google.cloud.dataproc.v1beta2.EndpointConfig"
|
39
|
+
optional :security_config, :message, 18, "google.cloud.dataproc.v1beta2.SecurityConfig"
|
40
|
+
optional :gke_cluster_config, :message, 19, "google.cloud.dataproc.v1beta2.GkeClusterConfig"
|
41
|
+
end
|
42
|
+
add_message "google.cloud.dataproc.v1beta2.GkeClusterConfig" do
|
43
|
+
optional :namespaced_gke_deployment_target, :message, 1, "google.cloud.dataproc.v1beta2.GkeClusterConfig.NamespacedGkeDeploymentTarget"
|
44
|
+
end
|
45
|
+
add_message "google.cloud.dataproc.v1beta2.GkeClusterConfig.NamespacedGkeDeploymentTarget" do
|
46
|
+
optional :target_gke_cluster, :string, 1
|
47
|
+
optional :cluster_namespace, :string, 2
|
48
|
+
end
|
49
|
+
add_message "google.cloud.dataproc.v1beta2.EndpointConfig" do
|
50
|
+
map :http_ports, :string, :string, 1
|
51
|
+
optional :enable_http_port_access, :bool, 2
|
52
|
+
end
|
53
|
+
add_message "google.cloud.dataproc.v1beta2.AutoscalingConfig" do
|
54
|
+
optional :policy_uri, :string, 1
|
55
|
+
end
|
56
|
+
add_message "google.cloud.dataproc.v1beta2.EncryptionConfig" do
|
57
|
+
optional :gce_pd_kms_key_name, :string, 1
|
58
|
+
end
|
59
|
+
add_message "google.cloud.dataproc.v1beta2.GceClusterConfig" do
|
60
|
+
optional :zone_uri, :string, 1
|
61
|
+
optional :network_uri, :string, 2
|
62
|
+
optional :subnetwork_uri, :string, 6
|
63
|
+
optional :internal_ip_only, :bool, 7
|
64
|
+
optional :service_account, :string, 8
|
65
|
+
repeated :service_account_scopes, :string, 3
|
66
|
+
repeated :tags, :string, 4
|
67
|
+
map :metadata, :string, :string, 5
|
68
|
+
optional :reservation_affinity, :message, 11, "google.cloud.dataproc.v1beta2.ReservationAffinity"
|
69
|
+
end
|
70
|
+
add_message "google.cloud.dataproc.v1beta2.InstanceGroupConfig" do
|
71
|
+
optional :num_instances, :int32, 1
|
72
|
+
repeated :instance_names, :string, 2
|
73
|
+
optional :image_uri, :string, 3
|
74
|
+
optional :machine_type_uri, :string, 4
|
75
|
+
optional :disk_config, :message, 5, "google.cloud.dataproc.v1beta2.DiskConfig"
|
76
|
+
optional :is_preemptible, :bool, 6
|
77
|
+
optional :managed_group_config, :message, 7, "google.cloud.dataproc.v1beta2.ManagedGroupConfig"
|
78
|
+
repeated :accelerators, :message, 8, "google.cloud.dataproc.v1beta2.AcceleratorConfig"
|
79
|
+
optional :min_cpu_platform, :string, 9
|
80
|
+
end
|
81
|
+
add_message "google.cloud.dataproc.v1beta2.ManagedGroupConfig" do
|
82
|
+
optional :instance_template_name, :string, 1
|
83
|
+
optional :instance_group_manager_name, :string, 2
|
84
|
+
end
|
85
|
+
add_message "google.cloud.dataproc.v1beta2.AcceleratorConfig" do
|
86
|
+
optional :accelerator_type_uri, :string, 1
|
87
|
+
optional :accelerator_count, :int32, 2
|
88
|
+
end
|
89
|
+
add_message "google.cloud.dataproc.v1beta2.DiskConfig" do
|
90
|
+
optional :boot_disk_type, :string, 3
|
91
|
+
optional :boot_disk_size_gb, :int32, 1
|
92
|
+
optional :num_local_ssds, :int32, 2
|
93
|
+
end
|
94
|
+
add_message "google.cloud.dataproc.v1beta2.LifecycleConfig" do
|
95
|
+
optional :idle_delete_ttl, :message, 1, "google.protobuf.Duration"
|
96
|
+
optional :idle_start_time, :message, 4, "google.protobuf.Timestamp"
|
97
|
+
oneof :ttl do
|
98
|
+
optional :auto_delete_time, :message, 2, "google.protobuf.Timestamp"
|
99
|
+
optional :auto_delete_ttl, :message, 3, "google.protobuf.Duration"
|
100
|
+
end
|
101
|
+
end
|
102
|
+
add_message "google.cloud.dataproc.v1beta2.SecurityConfig" do
|
103
|
+
optional :kerberos_config, :message, 1, "google.cloud.dataproc.v1beta2.KerberosConfig"
|
104
|
+
end
|
105
|
+
add_message "google.cloud.dataproc.v1beta2.KerberosConfig" do
|
106
|
+
optional :enable_kerberos, :bool, 1
|
107
|
+
optional :root_principal_password_uri, :string, 2
|
108
|
+
optional :kms_key_uri, :string, 3
|
109
|
+
optional :keystore_uri, :string, 4
|
110
|
+
optional :truststore_uri, :string, 5
|
111
|
+
optional :keystore_password_uri, :string, 6
|
112
|
+
optional :key_password_uri, :string, 7
|
113
|
+
optional :truststore_password_uri, :string, 8
|
114
|
+
optional :cross_realm_trust_realm, :string, 9
|
115
|
+
optional :cross_realm_trust_kdc, :string, 10
|
116
|
+
optional :cross_realm_trust_admin_server, :string, 11
|
117
|
+
optional :cross_realm_trust_shared_password_uri, :string, 12
|
118
|
+
optional :kdc_db_key_uri, :string, 13
|
119
|
+
optional :tgt_lifetime_hours, :int32, 14
|
120
|
+
optional :realm, :string, 15
|
121
|
+
end
|
122
|
+
add_message "google.cloud.dataproc.v1beta2.NodeInitializationAction" do
|
123
|
+
optional :executable_file, :string, 1
|
124
|
+
optional :execution_timeout, :message, 2, "google.protobuf.Duration"
|
125
|
+
end
|
126
|
+
add_message "google.cloud.dataproc.v1beta2.ClusterStatus" do
|
127
|
+
optional :state, :enum, 1, "google.cloud.dataproc.v1beta2.ClusterStatus.State"
|
128
|
+
optional :detail, :string, 2
|
129
|
+
optional :state_start_time, :message, 3, "google.protobuf.Timestamp"
|
130
|
+
optional :substate, :enum, 4, "google.cloud.dataproc.v1beta2.ClusterStatus.Substate"
|
131
|
+
end
|
132
|
+
add_enum "google.cloud.dataproc.v1beta2.ClusterStatus.State" do
|
133
|
+
value :UNKNOWN, 0
|
134
|
+
value :CREATING, 1
|
135
|
+
value :RUNNING, 2
|
136
|
+
value :ERROR, 3
|
137
|
+
value :DELETING, 4
|
138
|
+
value :UPDATING, 5
|
139
|
+
value :STOPPING, 6
|
140
|
+
value :STOPPED, 7
|
141
|
+
value :STARTING, 8
|
142
|
+
end
|
143
|
+
add_enum "google.cloud.dataproc.v1beta2.ClusterStatus.Substate" do
|
144
|
+
value :UNSPECIFIED, 0
|
145
|
+
value :UNHEALTHY, 1
|
146
|
+
value :STALE_STATUS, 2
|
147
|
+
end
|
148
|
+
add_message "google.cloud.dataproc.v1beta2.SoftwareConfig" do
|
149
|
+
optional :image_version, :string, 1
|
150
|
+
map :properties, :string, :string, 2
|
151
|
+
repeated :optional_components, :enum, 3, "google.cloud.dataproc.v1beta2.Component"
|
152
|
+
end
|
153
|
+
add_message "google.cloud.dataproc.v1beta2.ClusterMetrics" do
|
154
|
+
map :hdfs_metrics, :string, :int64, 1
|
155
|
+
map :yarn_metrics, :string, :int64, 2
|
156
|
+
end
|
157
|
+
add_message "google.cloud.dataproc.v1beta2.CreateClusterRequest" do
|
158
|
+
optional :project_id, :string, 1
|
159
|
+
optional :region, :string, 3
|
160
|
+
optional :cluster, :message, 2, "google.cloud.dataproc.v1beta2.Cluster"
|
161
|
+
optional :request_id, :string, 4
|
162
|
+
end
|
163
|
+
add_message "google.cloud.dataproc.v1beta2.UpdateClusterRequest" do
|
164
|
+
optional :project_id, :string, 1
|
165
|
+
optional :region, :string, 5
|
166
|
+
optional :cluster_name, :string, 2
|
167
|
+
optional :cluster, :message, 3, "google.cloud.dataproc.v1beta2.Cluster"
|
168
|
+
optional :graceful_decommission_timeout, :message, 6, "google.protobuf.Duration"
|
169
|
+
optional :update_mask, :message, 4, "google.protobuf.FieldMask"
|
170
|
+
optional :request_id, :string, 7
|
171
|
+
end
|
172
|
+
add_message "google.cloud.dataproc.v1beta2.DeleteClusterRequest" do
|
173
|
+
optional :project_id, :string, 1
|
174
|
+
optional :region, :string, 3
|
175
|
+
optional :cluster_name, :string, 2
|
176
|
+
optional :cluster_uuid, :string, 4
|
177
|
+
optional :request_id, :string, 5
|
178
|
+
end
|
179
|
+
add_message "google.cloud.dataproc.v1beta2.GetClusterRequest" do
|
180
|
+
optional :project_id, :string, 1
|
181
|
+
optional :region, :string, 3
|
182
|
+
optional :cluster_name, :string, 2
|
183
|
+
end
|
184
|
+
add_message "google.cloud.dataproc.v1beta2.ListClustersRequest" do
|
185
|
+
optional :project_id, :string, 1
|
186
|
+
optional :region, :string, 4
|
187
|
+
optional :filter, :string, 5
|
188
|
+
optional :page_size, :int32, 2
|
189
|
+
optional :page_token, :string, 3
|
190
|
+
end
|
191
|
+
add_message "google.cloud.dataproc.v1beta2.ListClustersResponse" do
|
192
|
+
repeated :clusters, :message, 1, "google.cloud.dataproc.v1beta2.Cluster"
|
193
|
+
optional :next_page_token, :string, 2
|
194
|
+
end
|
195
|
+
add_message "google.cloud.dataproc.v1beta2.DiagnoseClusterRequest" do
|
196
|
+
optional :project_id, :string, 1
|
197
|
+
optional :region, :string, 3
|
198
|
+
optional :cluster_name, :string, 2
|
199
|
+
end
|
200
|
+
add_message "google.cloud.dataproc.v1beta2.DiagnoseClusterResults" do
|
201
|
+
optional :output_uri, :string, 1
|
202
|
+
end
|
203
|
+
add_message "google.cloud.dataproc.v1beta2.ReservationAffinity" do
|
204
|
+
optional :consume_reservation_type, :enum, 1, "google.cloud.dataproc.v1beta2.ReservationAffinity.Type"
|
205
|
+
optional :key, :string, 2
|
206
|
+
repeated :values, :string, 3
|
207
|
+
end
|
208
|
+
add_enum "google.cloud.dataproc.v1beta2.ReservationAffinity.Type" do
|
209
|
+
value :TYPE_UNSPECIFIED, 0
|
210
|
+
value :NO_RESERVATION, 1
|
211
|
+
value :ANY_RESERVATION, 2
|
212
|
+
value :SPECIFIC_RESERVATION, 3
|
213
|
+
end
|
214
|
+
end
|
215
|
+
end
|
216
|
+
|
217
|
+
module Google
|
218
|
+
module Cloud
|
219
|
+
module Dataproc
|
220
|
+
module V1beta2
|
221
|
+
Cluster = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1beta2.Cluster").msgclass
|
222
|
+
ClusterConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1beta2.ClusterConfig").msgclass
|
223
|
+
GkeClusterConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1beta2.GkeClusterConfig").msgclass
|
224
|
+
GkeClusterConfig::NamespacedGkeDeploymentTarget = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1beta2.GkeClusterConfig.NamespacedGkeDeploymentTarget").msgclass
|
225
|
+
EndpointConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1beta2.EndpointConfig").msgclass
|
226
|
+
AutoscalingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1beta2.AutoscalingConfig").msgclass
|
227
|
+
EncryptionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1beta2.EncryptionConfig").msgclass
|
228
|
+
GceClusterConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1beta2.GceClusterConfig").msgclass
|
229
|
+
InstanceGroupConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1beta2.InstanceGroupConfig").msgclass
|
230
|
+
ManagedGroupConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1beta2.ManagedGroupConfig").msgclass
|
231
|
+
AcceleratorConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1beta2.AcceleratorConfig").msgclass
|
232
|
+
DiskConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1beta2.DiskConfig").msgclass
|
233
|
+
LifecycleConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1beta2.LifecycleConfig").msgclass
|
234
|
+
SecurityConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1beta2.SecurityConfig").msgclass
|
235
|
+
KerberosConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1beta2.KerberosConfig").msgclass
|
236
|
+
NodeInitializationAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1beta2.NodeInitializationAction").msgclass
|
237
|
+
ClusterStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1beta2.ClusterStatus").msgclass
|
238
|
+
ClusterStatus::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1beta2.ClusterStatus.State").enummodule
|
239
|
+
ClusterStatus::Substate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1beta2.ClusterStatus.Substate").enummodule
|
240
|
+
SoftwareConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1beta2.SoftwareConfig").msgclass
|
241
|
+
ClusterMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1beta2.ClusterMetrics").msgclass
|
242
|
+
CreateClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1beta2.CreateClusterRequest").msgclass
|
243
|
+
UpdateClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1beta2.UpdateClusterRequest").msgclass
|
244
|
+
DeleteClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1beta2.DeleteClusterRequest").msgclass
|
245
|
+
GetClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1beta2.GetClusterRequest").msgclass
|
246
|
+
ListClustersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1beta2.ListClustersRequest").msgclass
|
247
|
+
ListClustersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1beta2.ListClustersResponse").msgclass
|
248
|
+
DiagnoseClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1beta2.DiagnoseClusterRequest").msgclass
|
249
|
+
DiagnoseClusterResults = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1beta2.DiagnoseClusterResults").msgclass
|
250
|
+
ReservationAffinity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1beta2.ReservationAffinity").msgclass
|
251
|
+
ReservationAffinity::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dataproc.v1beta2.ReservationAffinity.Type").enummodule
|
252
|
+
end
|
253
|
+
end
|
254
|
+
end
|
255
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# Source: google/cloud/dataproc/v1beta2/clusters.proto for package 'google.cloud.dataproc.v1beta2'
|
3
|
+
# Original file comments:
|
4
|
+
# Copyright 2020 Google LLC
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
#
|
18
|
+
|
19
|
+
require 'grpc'
|
20
|
+
require 'google/cloud/dataproc/v1beta2/clusters_pb'
|
21
|
+
|
22
|
+
module Google
|
23
|
+
module Cloud
|
24
|
+
module Dataproc
|
25
|
+
module V1beta2
|
26
|
+
module ClusterController
|
27
|
+
# The ClusterControllerService provides methods to manage clusters
|
28
|
+
# of Compute Engine instances.
|
29
|
+
class Service
|
30
|
+
|
31
|
+
include GRPC::GenericService
|
32
|
+
|
33
|
+
self.marshal_class_method = :encode
|
34
|
+
self.unmarshal_class_method = :decode
|
35
|
+
self.service_name = 'google.cloud.dataproc.v1beta2.ClusterController'
|
36
|
+
|
37
|
+
# Creates a cluster in a project. The returned
|
38
|
+
# [Operation.metadata][google.longrunning.Operation.metadata] will be
|
39
|
+
# [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#clusteroperationmetadata).
|
40
|
+
rpc :CreateCluster, CreateClusterRequest, Google::Longrunning::Operation
|
41
|
+
# Updates a cluster in a project. The returned
|
42
|
+
# [Operation.metadata][google.longrunning.Operation.metadata] will be
|
43
|
+
# [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#clusteroperationmetadata).
|
44
|
+
rpc :UpdateCluster, UpdateClusterRequest, Google::Longrunning::Operation
|
45
|
+
# Deletes a cluster in a project. The returned
|
46
|
+
# [Operation.metadata][google.longrunning.Operation.metadata] will be
|
47
|
+
# [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#clusteroperationmetadata).
|
48
|
+
rpc :DeleteCluster, DeleteClusterRequest, Google::Longrunning::Operation
|
49
|
+
# Gets the resource representation for a cluster in a project.
|
50
|
+
rpc :GetCluster, GetClusterRequest, Cluster
|
51
|
+
# Lists all regions/{region}/clusters in a project alphabetically.
|
52
|
+
rpc :ListClusters, ListClustersRequest, ListClustersResponse
|
53
|
+
# Gets cluster diagnostic information. The returned
|
54
|
+
# [Operation.metadata][google.longrunning.Operation.metadata] will be
|
55
|
+
# [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#clusteroperationmetadata).
|
56
|
+
# After the operation completes,
|
57
|
+
# [Operation.response][google.longrunning.Operation.response]
|
58
|
+
# contains
|
59
|
+
# [Empty][google.protobuf.Empty].
|
60
|
+
rpc :DiagnoseCluster, DiagnoseClusterRequest, Google::Longrunning::Operation
|
61
|
+
end
|
62
|
+
|
63
|
+
Stub = Service.rpc_stub_class
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1,49 @@
|
|
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
|
+
require "gapic/common"
|
20
|
+
require "gapic/config"
|
21
|
+
require "gapic/config/method"
|
22
|
+
|
23
|
+
require "google/cloud/dataproc/v1beta2/version"
|
24
|
+
|
25
|
+
require "google/cloud/dataproc/v1beta2/job_controller/credentials"
|
26
|
+
require "google/cloud/dataproc/v1beta2/job_controller/operations"
|
27
|
+
require "google/cloud/dataproc/v1beta2/job_controller/client"
|
28
|
+
|
29
|
+
module Google
|
30
|
+
module Cloud
|
31
|
+
module Dataproc
|
32
|
+
module V1beta2
|
33
|
+
##
|
34
|
+
# The JobController provides methods to manage jobs.
|
35
|
+
#
|
36
|
+
# To load this service and instantiate a client:
|
37
|
+
#
|
38
|
+
# require "google/cloud/dataproc/v1beta2/job_controller"
|
39
|
+
# client = Google::Cloud::Dataproc::V1beta2::JobController::Client.new
|
40
|
+
#
|
41
|
+
module JobController
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
helper_path = ::File.join __dir__, "job_controller", "helpers.rb"
|
49
|
+
require "google/cloud/dataproc/v1beta2/job_controller/helpers" if ::File.file? helper_path
|
@@ -0,0 +1,980 @@
|
|
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
|
+
require "google/cloud/errors"
|
20
|
+
require "google/cloud/dataproc/v1beta2/jobs_pb"
|
21
|
+
|
22
|
+
module Google
|
23
|
+
module Cloud
|
24
|
+
module Dataproc
|
25
|
+
module V1beta2
|
26
|
+
module JobController
|
27
|
+
##
|
28
|
+
# Client for the JobController service.
|
29
|
+
#
|
30
|
+
# The JobController provides methods to manage jobs.
|
31
|
+
#
|
32
|
+
class Client
|
33
|
+
# @private
|
34
|
+
attr_reader :job_controller_stub
|
35
|
+
|
36
|
+
##
|
37
|
+
# Configure the JobController Client class.
|
38
|
+
#
|
39
|
+
# See {Google::Cloud::Dataproc::V1beta2::JobController::Client::Configuration}
|
40
|
+
# for a description of the configuration fields.
|
41
|
+
#
|
42
|
+
# ## Example
|
43
|
+
#
|
44
|
+
# To modify the configuration for all JobController clients:
|
45
|
+
#
|
46
|
+
# Google::Cloud::Dataproc::V1beta2::JobController::Client.configure do |config|
|
47
|
+
# config.timeout = 10_000
|
48
|
+
# end
|
49
|
+
#
|
50
|
+
# @yield [config] Configure the Client client.
|
51
|
+
# @yieldparam config [Client::Configuration]
|
52
|
+
#
|
53
|
+
# @return [Client::Configuration]
|
54
|
+
#
|
55
|
+
def self.configure
|
56
|
+
@configure ||= begin
|
57
|
+
namespace = ["Google", "Cloud", "Dataproc", "V1beta2"]
|
58
|
+
parent_config = while namespace.any?
|
59
|
+
parent_name = namespace.join "::"
|
60
|
+
parent_const = const_get parent_name
|
61
|
+
break parent_const.configure if parent_const&.respond_to? :configure
|
62
|
+
namespace.pop
|
63
|
+
end
|
64
|
+
default_config = Client::Configuration.new parent_config
|
65
|
+
|
66
|
+
default_config.rpcs.submit_job.timeout = 900.0
|
67
|
+
default_config.rpcs.submit_job.retry_policy = {
|
68
|
+
initial_delay: 0.1,
|
69
|
+
max_delay: 60.0,
|
70
|
+
multiplier: 1.3,
|
71
|
+
retry_codes: ["UNAVAILABLE"]
|
72
|
+
}
|
73
|
+
|
74
|
+
default_config.rpcs.submit_job_as_operation.timeout = 900.0
|
75
|
+
default_config.rpcs.submit_job_as_operation.retry_policy = {
|
76
|
+
initial_delay: 0.1,
|
77
|
+
max_delay: 60.0,
|
78
|
+
multiplier: 1.3,
|
79
|
+
retry_codes: ["UNAVAILABLE"]
|
80
|
+
}
|
81
|
+
|
82
|
+
default_config.rpcs.get_job.timeout = 900.0
|
83
|
+
default_config.rpcs.get_job.retry_policy = {
|
84
|
+
initial_delay: 0.1,
|
85
|
+
max_delay: 60.0,
|
86
|
+
multiplier: 1.3,
|
87
|
+
retry_codes: ["DEADLINE_EXCEEDED", "INTERNAL", "UNAVAILABLE"]
|
88
|
+
}
|
89
|
+
|
90
|
+
default_config.rpcs.list_jobs.timeout = 900.0
|
91
|
+
default_config.rpcs.list_jobs.retry_policy = {
|
92
|
+
initial_delay: 0.1,
|
93
|
+
max_delay: 60.0,
|
94
|
+
multiplier: 1.3,
|
95
|
+
retry_codes: ["DEADLINE_EXCEEDED", "INTERNAL", "UNAVAILABLE"]
|
96
|
+
}
|
97
|
+
|
98
|
+
default_config.rpcs.update_job.timeout = 900.0
|
99
|
+
default_config.rpcs.update_job.retry_policy = {
|
100
|
+
initial_delay: 0.1,
|
101
|
+
max_delay: 60.0,
|
102
|
+
multiplier: 1.3,
|
103
|
+
retry_codes: ["UNAVAILABLE"]
|
104
|
+
}
|
105
|
+
|
106
|
+
default_config.rpcs.cancel_job.timeout = 900.0
|
107
|
+
default_config.rpcs.cancel_job.retry_policy = {
|
108
|
+
initial_delay: 0.1,
|
109
|
+
max_delay: 60.0,
|
110
|
+
multiplier: 1.3,
|
111
|
+
retry_codes: ["DEADLINE_EXCEEDED", "INTERNAL", "UNAVAILABLE"]
|
112
|
+
}
|
113
|
+
|
114
|
+
default_config.rpcs.delete_job.timeout = 900.0
|
115
|
+
default_config.rpcs.delete_job.retry_policy = {
|
116
|
+
initial_delay: 0.1,
|
117
|
+
max_delay: 60.0,
|
118
|
+
multiplier: 1.3,
|
119
|
+
retry_codes: ["UNAVAILABLE"]
|
120
|
+
}
|
121
|
+
|
122
|
+
default_config
|
123
|
+
end
|
124
|
+
yield @configure if block_given?
|
125
|
+
@configure
|
126
|
+
end
|
127
|
+
|
128
|
+
##
|
129
|
+
# Configure the JobController Client instance.
|
130
|
+
#
|
131
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
132
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
133
|
+
# should be made on {Client.configure}.
|
134
|
+
#
|
135
|
+
# See {Google::Cloud::Dataproc::V1beta2::JobController::Client::Configuration}
|
136
|
+
# for a description of the configuration fields.
|
137
|
+
#
|
138
|
+
# @yield [config] Configure the Client client.
|
139
|
+
# @yieldparam config [Client::Configuration]
|
140
|
+
#
|
141
|
+
# @return [Client::Configuration]
|
142
|
+
#
|
143
|
+
def configure
|
144
|
+
yield @config if block_given?
|
145
|
+
@config
|
146
|
+
end
|
147
|
+
|
148
|
+
##
|
149
|
+
# Create a new JobController client object.
|
150
|
+
#
|
151
|
+
# ## Examples
|
152
|
+
#
|
153
|
+
# To create a new JobController client with the default
|
154
|
+
# configuration:
|
155
|
+
#
|
156
|
+
# client = Google::Cloud::Dataproc::V1beta2::JobController::Client.new
|
157
|
+
#
|
158
|
+
# To create a new JobController client with a custom
|
159
|
+
# configuration:
|
160
|
+
#
|
161
|
+
# client = Google::Cloud::Dataproc::V1beta2::JobController::Client.new do |config|
|
162
|
+
# config.timeout = 10_000
|
163
|
+
# end
|
164
|
+
#
|
165
|
+
# @yield [config] Configure the JobController client.
|
166
|
+
# @yieldparam config [Client::Configuration]
|
167
|
+
#
|
168
|
+
def initialize
|
169
|
+
# These require statements are intentionally placed here to initialize
|
170
|
+
# the gRPC module only when it's required.
|
171
|
+
# See https://github.com/googleapis/toolkit/issues/446
|
172
|
+
require "gapic/grpc"
|
173
|
+
require "google/cloud/dataproc/v1beta2/jobs_services_pb"
|
174
|
+
|
175
|
+
# Create the configuration object
|
176
|
+
@config = Configuration.new Client.configure
|
177
|
+
|
178
|
+
# Yield the configuration if needed
|
179
|
+
yield @config if block_given?
|
180
|
+
|
181
|
+
# Create credentials
|
182
|
+
credentials = @config.credentials
|
183
|
+
credentials ||= Credentials.default scope: @config.scope
|
184
|
+
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
185
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
186
|
+
end
|
187
|
+
@quota_project_id = credentials.respond_to?(:quota_project_id) ? credentials.quota_project_id : nil
|
188
|
+
|
189
|
+
@operations_client = Operations.new do |config|
|
190
|
+
config.credentials = credentials
|
191
|
+
config.endpoint = @config.endpoint
|
192
|
+
end
|
193
|
+
|
194
|
+
@job_controller_stub = Gapic::ServiceStub.new(
|
195
|
+
Google::Cloud::Dataproc::V1beta2::JobController::Stub,
|
196
|
+
credentials: credentials,
|
197
|
+
endpoint: @config.endpoint,
|
198
|
+
channel_args: @config.channel_args,
|
199
|
+
interceptors: @config.interceptors
|
200
|
+
)
|
201
|
+
end
|
202
|
+
|
203
|
+
##
|
204
|
+
# Get the associated client for long-running operations.
|
205
|
+
#
|
206
|
+
# @return [Google::Cloud::Dataproc::V1beta2::JobController::Operations]
|
207
|
+
#
|
208
|
+
attr_reader :operations_client
|
209
|
+
|
210
|
+
# Service calls
|
211
|
+
|
212
|
+
##
|
213
|
+
# Submits a job to a cluster.
|
214
|
+
#
|
215
|
+
# @overload submit_job(request, options = nil)
|
216
|
+
# Pass arguments to `submit_job` via a request object, either of type
|
217
|
+
# {Google::Cloud::Dataproc::V1beta2::SubmitJobRequest} or an equivalent Hash.
|
218
|
+
#
|
219
|
+
# @param request [Google::Cloud::Dataproc::V1beta2::SubmitJobRequest, Hash]
|
220
|
+
# A request object representing the call parameters. Required. To specify no
|
221
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
222
|
+
# @param options [Gapic::CallOptions, Hash]
|
223
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
224
|
+
#
|
225
|
+
# @overload submit_job(project_id: nil, region: nil, job: nil, request_id: nil)
|
226
|
+
# Pass arguments to `submit_job` via keyword arguments. Note that at
|
227
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
228
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
229
|
+
#
|
230
|
+
# @param project_id [String]
|
231
|
+
# Required. The ID of the Google Cloud Platform project that the job
|
232
|
+
# belongs to.
|
233
|
+
# @param region [String]
|
234
|
+
# Required. The Dataproc region in which to handle the request.
|
235
|
+
# @param job [Google::Cloud::Dataproc::V1beta2::Job, Hash]
|
236
|
+
# Required. The job resource.
|
237
|
+
# @param request_id [String]
|
238
|
+
# Optional. A unique id used to identify the request. If the server
|
239
|
+
# receives two {Google::Cloud::Dataproc::V1beta2::SubmitJobRequest SubmitJobRequest} requests with the same
|
240
|
+
# id, then the second request will be ignored and the
|
241
|
+
# first {Google::Cloud::Dataproc::V1beta2::Job Job} created and stored in the backend
|
242
|
+
# is returned.
|
243
|
+
#
|
244
|
+
# It is recommended to always set this value to a
|
245
|
+
# [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
|
246
|
+
#
|
247
|
+
# The id must contain only letters (a-z, A-Z), numbers (0-9),
|
248
|
+
# underscores (_), and hyphens (-). The maximum length is 40 characters.
|
249
|
+
#
|
250
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
251
|
+
# @yieldparam response [Google::Cloud::Dataproc::V1beta2::Job]
|
252
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
253
|
+
#
|
254
|
+
# @return [Google::Cloud::Dataproc::V1beta2::Job]
|
255
|
+
#
|
256
|
+
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
257
|
+
#
|
258
|
+
def submit_job request, options = nil
|
259
|
+
raise ArgumentError, "request must be provided" if request.nil?
|
260
|
+
|
261
|
+
request = Gapic::Protobuf.coerce request, to: Google::Cloud::Dataproc::V1beta2::SubmitJobRequest
|
262
|
+
|
263
|
+
# Converts hash and nil to an options object
|
264
|
+
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
265
|
+
|
266
|
+
# Customize the options with defaults
|
267
|
+
metadata = @config.rpcs.submit_job.metadata.to_h
|
268
|
+
|
269
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
270
|
+
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
271
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
272
|
+
gapic_version: ::Google::Cloud::Dataproc::V1beta2::VERSION
|
273
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
274
|
+
|
275
|
+
header_params = {
|
276
|
+
"project_id" => request.project_id,
|
277
|
+
"region" => request.region
|
278
|
+
}
|
279
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
280
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
281
|
+
|
282
|
+
options.apply_defaults timeout: @config.rpcs.submit_job.timeout,
|
283
|
+
metadata: metadata,
|
284
|
+
retry_policy: @config.rpcs.submit_job.retry_policy
|
285
|
+
options.apply_defaults metadata: @config.metadata,
|
286
|
+
retry_policy: @config.retry_policy
|
287
|
+
|
288
|
+
@job_controller_stub.call_rpc :submit_job, request, options: options do |response, operation|
|
289
|
+
yield response, operation if block_given?
|
290
|
+
return response
|
291
|
+
end
|
292
|
+
rescue GRPC::BadStatus => e
|
293
|
+
raise Google::Cloud::Error.from_error(e)
|
294
|
+
end
|
295
|
+
|
296
|
+
##
|
297
|
+
# Submits job to a cluster.
|
298
|
+
#
|
299
|
+
# @overload submit_job_as_operation(request, options = nil)
|
300
|
+
# Pass arguments to `submit_job_as_operation` via a request object, either of type
|
301
|
+
# {Google::Cloud::Dataproc::V1beta2::SubmitJobRequest} or an equivalent Hash.
|
302
|
+
#
|
303
|
+
# @param request [Google::Cloud::Dataproc::V1beta2::SubmitJobRequest, Hash]
|
304
|
+
# A request object representing the call parameters. Required. To specify no
|
305
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
306
|
+
# @param options [Gapic::CallOptions, Hash]
|
307
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
308
|
+
#
|
309
|
+
# @overload submit_job_as_operation(project_id: nil, region: nil, job: nil, request_id: nil)
|
310
|
+
# Pass arguments to `submit_job_as_operation` via keyword arguments. Note that at
|
311
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
312
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
313
|
+
#
|
314
|
+
# @param project_id [String]
|
315
|
+
# Required. The ID of the Google Cloud Platform project that the job
|
316
|
+
# belongs to.
|
317
|
+
# @param region [String]
|
318
|
+
# Required. The Dataproc region in which to handle the request.
|
319
|
+
# @param job [Google::Cloud::Dataproc::V1beta2::Job, Hash]
|
320
|
+
# Required. The job resource.
|
321
|
+
# @param request_id [String]
|
322
|
+
# Optional. A unique id used to identify the request. If the server
|
323
|
+
# receives two {Google::Cloud::Dataproc::V1beta2::SubmitJobRequest SubmitJobRequest} requests with the same
|
324
|
+
# id, then the second request will be ignored and the
|
325
|
+
# first {Google::Cloud::Dataproc::V1beta2::Job Job} created and stored in the backend
|
326
|
+
# is returned.
|
327
|
+
#
|
328
|
+
# It is recommended to always set this value to a
|
329
|
+
# [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
|
330
|
+
#
|
331
|
+
# The id must contain only letters (a-z, A-Z), numbers (0-9),
|
332
|
+
# underscores (_), and hyphens (-). The maximum length is 40 characters.
|
333
|
+
#
|
334
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
335
|
+
# @yieldparam response [Gapic::Operation]
|
336
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
337
|
+
#
|
338
|
+
# @return [Gapic::Operation]
|
339
|
+
#
|
340
|
+
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
341
|
+
#
|
342
|
+
def submit_job_as_operation request, options = nil
|
343
|
+
raise ArgumentError, "request must be provided" if request.nil?
|
344
|
+
|
345
|
+
request = Gapic::Protobuf.coerce request, to: Google::Cloud::Dataproc::V1beta2::SubmitJobRequest
|
346
|
+
|
347
|
+
# Converts hash and nil to an options object
|
348
|
+
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
349
|
+
|
350
|
+
# Customize the options with defaults
|
351
|
+
metadata = @config.rpcs.submit_job_as_operation.metadata.to_h
|
352
|
+
|
353
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
354
|
+
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
355
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
356
|
+
gapic_version: ::Google::Cloud::Dataproc::V1beta2::VERSION
|
357
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
358
|
+
|
359
|
+
header_params = {
|
360
|
+
"project_id" => request.project_id,
|
361
|
+
"region" => request.region
|
362
|
+
}
|
363
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
364
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
365
|
+
|
366
|
+
options.apply_defaults timeout: @config.rpcs.submit_job_as_operation.timeout,
|
367
|
+
metadata: metadata,
|
368
|
+
retry_policy: @config.rpcs.submit_job_as_operation.retry_policy
|
369
|
+
options.apply_defaults metadata: @config.metadata,
|
370
|
+
retry_policy: @config.retry_policy
|
371
|
+
|
372
|
+
@job_controller_stub.call_rpc :submit_job_as_operation, request, options: options do |response, operation|
|
373
|
+
response = Gapic::Operation.new response, @operations_client, options: options
|
374
|
+
yield response, operation if block_given?
|
375
|
+
return response
|
376
|
+
end
|
377
|
+
rescue GRPC::BadStatus => e
|
378
|
+
raise Google::Cloud::Error.from_error(e)
|
379
|
+
end
|
380
|
+
|
381
|
+
##
|
382
|
+
# Gets the resource representation for a job in a project.
|
383
|
+
#
|
384
|
+
# @overload get_job(request, options = nil)
|
385
|
+
# Pass arguments to `get_job` via a request object, either of type
|
386
|
+
# {Google::Cloud::Dataproc::V1beta2::GetJobRequest} or an equivalent Hash.
|
387
|
+
#
|
388
|
+
# @param request [Google::Cloud::Dataproc::V1beta2::GetJobRequest, Hash]
|
389
|
+
# A request object representing the call parameters. Required. To specify no
|
390
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
391
|
+
# @param options [Gapic::CallOptions, Hash]
|
392
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
393
|
+
#
|
394
|
+
# @overload get_job(project_id: nil, region: nil, job_id: nil)
|
395
|
+
# Pass arguments to `get_job` via keyword arguments. Note that at
|
396
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
397
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
398
|
+
#
|
399
|
+
# @param project_id [String]
|
400
|
+
# Required. The ID of the Google Cloud Platform project that the job
|
401
|
+
# belongs to.
|
402
|
+
# @param region [String]
|
403
|
+
# Required. The Dataproc region in which to handle the request.
|
404
|
+
# @param job_id [String]
|
405
|
+
# Required. The job ID.
|
406
|
+
#
|
407
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
408
|
+
# @yieldparam response [Google::Cloud::Dataproc::V1beta2::Job]
|
409
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
410
|
+
#
|
411
|
+
# @return [Google::Cloud::Dataproc::V1beta2::Job]
|
412
|
+
#
|
413
|
+
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
414
|
+
#
|
415
|
+
def get_job request, options = nil
|
416
|
+
raise ArgumentError, "request must be provided" if request.nil?
|
417
|
+
|
418
|
+
request = Gapic::Protobuf.coerce request, to: Google::Cloud::Dataproc::V1beta2::GetJobRequest
|
419
|
+
|
420
|
+
# Converts hash and nil to an options object
|
421
|
+
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
422
|
+
|
423
|
+
# Customize the options with defaults
|
424
|
+
metadata = @config.rpcs.get_job.metadata.to_h
|
425
|
+
|
426
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
427
|
+
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
428
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
429
|
+
gapic_version: ::Google::Cloud::Dataproc::V1beta2::VERSION
|
430
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
431
|
+
|
432
|
+
header_params = {
|
433
|
+
"project_id" => request.project_id,
|
434
|
+
"region" => request.region,
|
435
|
+
"job_id" => request.job_id
|
436
|
+
}
|
437
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
438
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
439
|
+
|
440
|
+
options.apply_defaults timeout: @config.rpcs.get_job.timeout,
|
441
|
+
metadata: metadata,
|
442
|
+
retry_policy: @config.rpcs.get_job.retry_policy
|
443
|
+
options.apply_defaults metadata: @config.metadata,
|
444
|
+
retry_policy: @config.retry_policy
|
445
|
+
|
446
|
+
@job_controller_stub.call_rpc :get_job, request, options: options do |response, operation|
|
447
|
+
yield response, operation if block_given?
|
448
|
+
return response
|
449
|
+
end
|
450
|
+
rescue GRPC::BadStatus => e
|
451
|
+
raise Google::Cloud::Error.from_error(e)
|
452
|
+
end
|
453
|
+
|
454
|
+
##
|
455
|
+
# Lists regions/\\{region}/jobs in a project.
|
456
|
+
#
|
457
|
+
# @overload list_jobs(request, options = nil)
|
458
|
+
# Pass arguments to `list_jobs` via a request object, either of type
|
459
|
+
# {Google::Cloud::Dataproc::V1beta2::ListJobsRequest} or an equivalent Hash.
|
460
|
+
#
|
461
|
+
# @param request [Google::Cloud::Dataproc::V1beta2::ListJobsRequest, Hash]
|
462
|
+
# A request object representing the call parameters. Required. To specify no
|
463
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
464
|
+
# @param options [Gapic::CallOptions, Hash]
|
465
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
466
|
+
#
|
467
|
+
# @overload list_jobs(project_id: nil, region: nil, page_size: nil, page_token: nil, cluster_name: nil, job_state_matcher: nil, filter: nil)
|
468
|
+
# Pass arguments to `list_jobs` via keyword arguments. Note that at
|
469
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
470
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
471
|
+
#
|
472
|
+
# @param project_id [String]
|
473
|
+
# Required. The ID of the Google Cloud Platform project that the job
|
474
|
+
# belongs to.
|
475
|
+
# @param region [String]
|
476
|
+
# Required. The Dataproc region in which to handle the request.
|
477
|
+
# @param page_size [Integer]
|
478
|
+
# Optional. The number of results to return in each response.
|
479
|
+
# @param page_token [String]
|
480
|
+
# Optional. The page token, returned by a previous call, to request the
|
481
|
+
# next page of results.
|
482
|
+
# @param cluster_name [String]
|
483
|
+
# Optional. If set, the returned jobs list includes only jobs that were
|
484
|
+
# submitted to the named cluster.
|
485
|
+
# @param job_state_matcher [Google::Cloud::Dataproc::V1beta2::ListJobsRequest::JobStateMatcher]
|
486
|
+
# Optional. Specifies enumerated categories of jobs to list.
|
487
|
+
# (default = match ALL jobs).
|
488
|
+
#
|
489
|
+
# If `filter` is provided, `jobStateMatcher` will be ignored.
|
490
|
+
# @param filter [String]
|
491
|
+
# Optional. A filter constraining the jobs to list. Filters are
|
492
|
+
# case-sensitive and have the following syntax:
|
493
|
+
#
|
494
|
+
# [field = value] AND [field [= value]] ...
|
495
|
+
#
|
496
|
+
# where **field** is `status.state` or `labels.[KEY]`, and `[KEY]` is a label
|
497
|
+
# key. **value** can be `*` to match all values.
|
498
|
+
# `status.state` can be either `ACTIVE` or `NON_ACTIVE`.
|
499
|
+
# Only the logical `AND` operator is supported; space-separated items are
|
500
|
+
# treated as having an implicit `AND` operator.
|
501
|
+
#
|
502
|
+
# Example filter:
|
503
|
+
#
|
504
|
+
# status.state = ACTIVE AND labels.env = staging AND labels.starred = *
|
505
|
+
#
|
506
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
507
|
+
# @yieldparam response [Gapic::PagedEnumerable<Google::Cloud::Dataproc::V1beta2::Job>]
|
508
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
509
|
+
#
|
510
|
+
# @return [Gapic::PagedEnumerable<Google::Cloud::Dataproc::V1beta2::Job>]
|
511
|
+
#
|
512
|
+
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
513
|
+
#
|
514
|
+
def list_jobs request, options = nil
|
515
|
+
raise ArgumentError, "request must be provided" if request.nil?
|
516
|
+
|
517
|
+
request = Gapic::Protobuf.coerce request, to: Google::Cloud::Dataproc::V1beta2::ListJobsRequest
|
518
|
+
|
519
|
+
# Converts hash and nil to an options object
|
520
|
+
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
521
|
+
|
522
|
+
# Customize the options with defaults
|
523
|
+
metadata = @config.rpcs.list_jobs.metadata.to_h
|
524
|
+
|
525
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
526
|
+
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
527
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
528
|
+
gapic_version: ::Google::Cloud::Dataproc::V1beta2::VERSION
|
529
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
530
|
+
|
531
|
+
header_params = {
|
532
|
+
"project_id" => request.project_id,
|
533
|
+
"region" => request.region
|
534
|
+
}
|
535
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
536
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
537
|
+
|
538
|
+
options.apply_defaults timeout: @config.rpcs.list_jobs.timeout,
|
539
|
+
metadata: metadata,
|
540
|
+
retry_policy: @config.rpcs.list_jobs.retry_policy
|
541
|
+
options.apply_defaults metadata: @config.metadata,
|
542
|
+
retry_policy: @config.retry_policy
|
543
|
+
|
544
|
+
@job_controller_stub.call_rpc :list_jobs, request, options: options do |response, operation|
|
545
|
+
response = Gapic::PagedEnumerable.new @job_controller_stub, :list_jobs, request, response, operation, options
|
546
|
+
yield response, operation if block_given?
|
547
|
+
return response
|
548
|
+
end
|
549
|
+
rescue GRPC::BadStatus => e
|
550
|
+
raise Google::Cloud::Error.from_error(e)
|
551
|
+
end
|
552
|
+
|
553
|
+
##
|
554
|
+
# Updates a job in a project.
|
555
|
+
#
|
556
|
+
# @overload update_job(request, options = nil)
|
557
|
+
# Pass arguments to `update_job` via a request object, either of type
|
558
|
+
# {Google::Cloud::Dataproc::V1beta2::UpdateJobRequest} or an equivalent Hash.
|
559
|
+
#
|
560
|
+
# @param request [Google::Cloud::Dataproc::V1beta2::UpdateJobRequest, Hash]
|
561
|
+
# A request object representing the call parameters. Required. To specify no
|
562
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
563
|
+
# @param options [Gapic::CallOptions, Hash]
|
564
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
565
|
+
#
|
566
|
+
# @overload update_job(project_id: nil, region: nil, job_id: nil, job: nil, update_mask: nil)
|
567
|
+
# Pass arguments to `update_job` via keyword arguments. Note that at
|
568
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
569
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
570
|
+
#
|
571
|
+
# @param project_id [String]
|
572
|
+
# Required. The ID of the Google Cloud Platform project that the job
|
573
|
+
# belongs to.
|
574
|
+
# @param region [String]
|
575
|
+
# Required. The Dataproc region in which to handle the request.
|
576
|
+
# @param job_id [String]
|
577
|
+
# Required. The job ID.
|
578
|
+
# @param job [Google::Cloud::Dataproc::V1beta2::Job, Hash]
|
579
|
+
# Required. The changes to the job.
|
580
|
+
# @param update_mask [Google::Protobuf::FieldMask, Hash]
|
581
|
+
# Required. Specifies the path, relative to <code>Job</code>, of
|
582
|
+
# the field to update. For example, to update the labels of a Job the
|
583
|
+
# <code>update_mask</code> parameter would be specified as
|
584
|
+
# <code>labels</code>, and the `PATCH` request body would specify the new
|
585
|
+
# value. <strong>Note:</strong> Currently, <code>labels</code> is the only
|
586
|
+
# field that can be updated.
|
587
|
+
#
|
588
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
589
|
+
# @yieldparam response [Google::Cloud::Dataproc::V1beta2::Job]
|
590
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
591
|
+
#
|
592
|
+
# @return [Google::Cloud::Dataproc::V1beta2::Job]
|
593
|
+
#
|
594
|
+
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
595
|
+
#
|
596
|
+
def update_job request, options = nil
|
597
|
+
raise ArgumentError, "request must be provided" if request.nil?
|
598
|
+
|
599
|
+
request = Gapic::Protobuf.coerce request, to: Google::Cloud::Dataproc::V1beta2::UpdateJobRequest
|
600
|
+
|
601
|
+
# Converts hash and nil to an options object
|
602
|
+
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
603
|
+
|
604
|
+
# Customize the options with defaults
|
605
|
+
metadata = @config.rpcs.update_job.metadata.to_h
|
606
|
+
|
607
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
608
|
+
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
609
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
610
|
+
gapic_version: ::Google::Cloud::Dataproc::V1beta2::VERSION
|
611
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
612
|
+
|
613
|
+
header_params = {
|
614
|
+
"project_id" => request.project_id,
|
615
|
+
"region" => request.region,
|
616
|
+
"job_id" => request.job_id
|
617
|
+
}
|
618
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
619
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
620
|
+
|
621
|
+
options.apply_defaults timeout: @config.rpcs.update_job.timeout,
|
622
|
+
metadata: metadata,
|
623
|
+
retry_policy: @config.rpcs.update_job.retry_policy
|
624
|
+
options.apply_defaults metadata: @config.metadata,
|
625
|
+
retry_policy: @config.retry_policy
|
626
|
+
|
627
|
+
@job_controller_stub.call_rpc :update_job, request, options: options do |response, operation|
|
628
|
+
yield response, operation if block_given?
|
629
|
+
return response
|
630
|
+
end
|
631
|
+
rescue GRPC::BadStatus => e
|
632
|
+
raise Google::Cloud::Error.from_error(e)
|
633
|
+
end
|
634
|
+
|
635
|
+
##
|
636
|
+
# Starts a job cancellation request. To access the job resource
|
637
|
+
# after cancellation, call
|
638
|
+
# [regions/\\{region}/jobs.list](https://cloud.google.com/dataproc/docs/reference/rest/v1beta2/projects.regions.jobs/list)
|
639
|
+
# or
|
640
|
+
# [regions/\\{region}/jobs.get](https://cloud.google.com/dataproc/docs/reference/rest/v1beta2/projects.regions.jobs/get).
|
641
|
+
#
|
642
|
+
# @overload cancel_job(request, options = nil)
|
643
|
+
# Pass arguments to `cancel_job` via a request object, either of type
|
644
|
+
# {Google::Cloud::Dataproc::V1beta2::CancelJobRequest} or an equivalent Hash.
|
645
|
+
#
|
646
|
+
# @param request [Google::Cloud::Dataproc::V1beta2::CancelJobRequest, Hash]
|
647
|
+
# A request object representing the call parameters. Required. To specify no
|
648
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
649
|
+
# @param options [Gapic::CallOptions, Hash]
|
650
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
651
|
+
#
|
652
|
+
# @overload cancel_job(project_id: nil, region: nil, job_id: nil)
|
653
|
+
# Pass arguments to `cancel_job` via keyword arguments. Note that at
|
654
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
655
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
656
|
+
#
|
657
|
+
# @param project_id [String]
|
658
|
+
# Required. The ID of the Google Cloud Platform project that the job
|
659
|
+
# belongs to.
|
660
|
+
# @param region [String]
|
661
|
+
# Required. The Dataproc region in which to handle the request.
|
662
|
+
# @param job_id [String]
|
663
|
+
# Required. The job ID.
|
664
|
+
#
|
665
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
666
|
+
# @yieldparam response [Google::Cloud::Dataproc::V1beta2::Job]
|
667
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
668
|
+
#
|
669
|
+
# @return [Google::Cloud::Dataproc::V1beta2::Job]
|
670
|
+
#
|
671
|
+
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
672
|
+
#
|
673
|
+
def cancel_job request, options = nil
|
674
|
+
raise ArgumentError, "request must be provided" if request.nil?
|
675
|
+
|
676
|
+
request = Gapic::Protobuf.coerce request, to: Google::Cloud::Dataproc::V1beta2::CancelJobRequest
|
677
|
+
|
678
|
+
# Converts hash and nil to an options object
|
679
|
+
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
680
|
+
|
681
|
+
# Customize the options with defaults
|
682
|
+
metadata = @config.rpcs.cancel_job.metadata.to_h
|
683
|
+
|
684
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
685
|
+
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
686
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
687
|
+
gapic_version: ::Google::Cloud::Dataproc::V1beta2::VERSION
|
688
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
689
|
+
|
690
|
+
header_params = {
|
691
|
+
"project_id" => request.project_id,
|
692
|
+
"region" => request.region,
|
693
|
+
"job_id" => request.job_id
|
694
|
+
}
|
695
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
696
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
697
|
+
|
698
|
+
options.apply_defaults timeout: @config.rpcs.cancel_job.timeout,
|
699
|
+
metadata: metadata,
|
700
|
+
retry_policy: @config.rpcs.cancel_job.retry_policy
|
701
|
+
options.apply_defaults metadata: @config.metadata,
|
702
|
+
retry_policy: @config.retry_policy
|
703
|
+
|
704
|
+
@job_controller_stub.call_rpc :cancel_job, request, options: options do |response, operation|
|
705
|
+
yield response, operation if block_given?
|
706
|
+
return response
|
707
|
+
end
|
708
|
+
rescue GRPC::BadStatus => e
|
709
|
+
raise Google::Cloud::Error.from_error(e)
|
710
|
+
end
|
711
|
+
|
712
|
+
##
|
713
|
+
# Deletes the job from the project. If the job is active, the delete fails,
|
714
|
+
# and the response returns `FAILED_PRECONDITION`.
|
715
|
+
#
|
716
|
+
# @overload delete_job(request, options = nil)
|
717
|
+
# Pass arguments to `delete_job` via a request object, either of type
|
718
|
+
# {Google::Cloud::Dataproc::V1beta2::DeleteJobRequest} or an equivalent Hash.
|
719
|
+
#
|
720
|
+
# @param request [Google::Cloud::Dataproc::V1beta2::DeleteJobRequest, Hash]
|
721
|
+
# A request object representing the call parameters. Required. To specify no
|
722
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
723
|
+
# @param options [Gapic::CallOptions, Hash]
|
724
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
725
|
+
#
|
726
|
+
# @overload delete_job(project_id: nil, region: nil, job_id: nil)
|
727
|
+
# Pass arguments to `delete_job` via keyword arguments. Note that at
|
728
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
729
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
730
|
+
#
|
731
|
+
# @param project_id [String]
|
732
|
+
# Required. The ID of the Google Cloud Platform project that the job
|
733
|
+
# belongs to.
|
734
|
+
# @param region [String]
|
735
|
+
# Required. The Dataproc region in which to handle the request.
|
736
|
+
# @param job_id [String]
|
737
|
+
# Required. The job ID.
|
738
|
+
#
|
739
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
740
|
+
# @yieldparam response [Google::Protobuf::Empty]
|
741
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
742
|
+
#
|
743
|
+
# @return [Google::Protobuf::Empty]
|
744
|
+
#
|
745
|
+
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
746
|
+
#
|
747
|
+
def delete_job request, options = nil
|
748
|
+
raise ArgumentError, "request must be provided" if request.nil?
|
749
|
+
|
750
|
+
request = Gapic::Protobuf.coerce request, to: Google::Cloud::Dataproc::V1beta2::DeleteJobRequest
|
751
|
+
|
752
|
+
# Converts hash and nil to an options object
|
753
|
+
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
754
|
+
|
755
|
+
# Customize the options with defaults
|
756
|
+
metadata = @config.rpcs.delete_job.metadata.to_h
|
757
|
+
|
758
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
759
|
+
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
760
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
761
|
+
gapic_version: ::Google::Cloud::Dataproc::V1beta2::VERSION
|
762
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
763
|
+
|
764
|
+
header_params = {
|
765
|
+
"project_id" => request.project_id,
|
766
|
+
"region" => request.region,
|
767
|
+
"job_id" => request.job_id
|
768
|
+
}
|
769
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
770
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
771
|
+
|
772
|
+
options.apply_defaults timeout: @config.rpcs.delete_job.timeout,
|
773
|
+
metadata: metadata,
|
774
|
+
retry_policy: @config.rpcs.delete_job.retry_policy
|
775
|
+
options.apply_defaults metadata: @config.metadata,
|
776
|
+
retry_policy: @config.retry_policy
|
777
|
+
|
778
|
+
@job_controller_stub.call_rpc :delete_job, request, options: options do |response, operation|
|
779
|
+
yield response, operation if block_given?
|
780
|
+
return response
|
781
|
+
end
|
782
|
+
rescue GRPC::BadStatus => e
|
783
|
+
raise Google::Cloud::Error.from_error(e)
|
784
|
+
end
|
785
|
+
|
786
|
+
##
|
787
|
+
# Configuration class for the JobController API.
|
788
|
+
#
|
789
|
+
# This class represents the configuration for JobController,
|
790
|
+
# providing control over timeouts, retry behavior, logging, transport
|
791
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
792
|
+
# applied individually to specific RPCs. See
|
793
|
+
# {Google::Cloud::Dataproc::V1beta2::JobController::Client::Configuration::Rpcs}
|
794
|
+
# for a list of RPCs that can be configured independently.
|
795
|
+
#
|
796
|
+
# Configuration can be applied globally to all clients, or to a single client
|
797
|
+
# on construction.
|
798
|
+
#
|
799
|
+
# # Examples
|
800
|
+
#
|
801
|
+
# To modify the global config, setting the timeout for submit_job
|
802
|
+
# to 20 seconds, and all remaining timeouts to 10 seconds:
|
803
|
+
#
|
804
|
+
# Google::Cloud::Dataproc::V1beta2::JobController::Client.configure do |config|
|
805
|
+
# config.timeout = 10_000
|
806
|
+
# config.rpcs.submit_job.timeout = 20_000
|
807
|
+
# end
|
808
|
+
#
|
809
|
+
# To apply the above configuration only to a new client:
|
810
|
+
#
|
811
|
+
# client = Google::Cloud::Dataproc::V1beta2::JobController::Client.new do |config|
|
812
|
+
# config.timeout = 10_000
|
813
|
+
# config.rpcs.submit_job.timeout = 20_000
|
814
|
+
# end
|
815
|
+
#
|
816
|
+
# @!attribute [rw] endpoint
|
817
|
+
# The hostname or hostname:port of the service endpoint.
|
818
|
+
# Defaults to `"dataproc.googleapis.com"`.
|
819
|
+
# @return [String]
|
820
|
+
# @!attribute [rw] credentials
|
821
|
+
# Credentials to send with calls. You may provide any of the following types:
|
822
|
+
# * (`String`) The path to a service account key file in JSON format
|
823
|
+
# * (`Hash`) A service account key as a Hash
|
824
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
825
|
+
# (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
|
826
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
827
|
+
# (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
|
828
|
+
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
829
|
+
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
830
|
+
# * (`nil`) indicating no credentials
|
831
|
+
# @return [Object]
|
832
|
+
# @!attribute [rw] scope
|
833
|
+
# The OAuth scopes
|
834
|
+
# @return [Array<String>]
|
835
|
+
# @!attribute [rw] lib_name
|
836
|
+
# The library name as recorded in instrumentation and logging
|
837
|
+
# @return [String]
|
838
|
+
# @!attribute [rw] lib_version
|
839
|
+
# The library version as recorded in instrumentation and logging
|
840
|
+
# @return [String]
|
841
|
+
# @!attribute [rw] channel_args
|
842
|
+
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
843
|
+
# `GRPC::Core::Channel` object is provided as the credential.
|
844
|
+
# @return [Hash]
|
845
|
+
# @!attribute [rw] interceptors
|
846
|
+
# An array of interceptors that are run before calls are executed.
|
847
|
+
# @return [Array<GRPC::ClientInterceptor>]
|
848
|
+
# @!attribute [rw] timeout
|
849
|
+
# The call timeout in milliseconds.
|
850
|
+
# @return [Numeric]
|
851
|
+
# @!attribute [rw] metadata
|
852
|
+
# Additional gRPC headers to be sent with the call.
|
853
|
+
# @return [Hash{Symbol=>String}]
|
854
|
+
# @!attribute [rw] retry_policy
|
855
|
+
# The retry policy. The value is a hash with the following keys:
|
856
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
857
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
858
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
859
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
860
|
+
# trigger a retry.
|
861
|
+
# @return [Hash]
|
862
|
+
#
|
863
|
+
class Configuration
|
864
|
+
extend Gapic::Config
|
865
|
+
|
866
|
+
config_attr :endpoint, "dataproc.googleapis.com", String
|
867
|
+
config_attr :credentials, nil do |value|
|
868
|
+
allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
869
|
+
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
870
|
+
allowed.any? { |klass| klass === value }
|
871
|
+
end
|
872
|
+
config_attr :scope, nil, String, Array, nil
|
873
|
+
config_attr :lib_name, nil, String, nil
|
874
|
+
config_attr :lib_version, nil, String, nil
|
875
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, Hash, nil)
|
876
|
+
config_attr :interceptors, nil, Array, nil
|
877
|
+
config_attr :timeout, nil, Numeric, nil
|
878
|
+
config_attr :metadata, nil, Hash, nil
|
879
|
+
config_attr :retry_policy, nil, Hash, Proc, nil
|
880
|
+
|
881
|
+
# @private
|
882
|
+
def initialize parent_config = nil
|
883
|
+
@parent_config = parent_config unless parent_config.nil?
|
884
|
+
|
885
|
+
yield self if block_given?
|
886
|
+
end
|
887
|
+
|
888
|
+
##
|
889
|
+
# Configurations for individual RPCs
|
890
|
+
# @return [Rpcs]
|
891
|
+
#
|
892
|
+
def rpcs
|
893
|
+
@rpcs ||= begin
|
894
|
+
parent_rpcs = nil
|
895
|
+
parent_rpcs = @parent_config.rpcs if @parent_config&.respond_to? :rpcs
|
896
|
+
Rpcs.new parent_rpcs
|
897
|
+
end
|
898
|
+
end
|
899
|
+
|
900
|
+
##
|
901
|
+
# Configuration RPC class for the JobController API.
|
902
|
+
#
|
903
|
+
# Includes fields providing the configuration for each RPC in this service.
|
904
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
905
|
+
# the following configuration fields:
|
906
|
+
#
|
907
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
|
908
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
909
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
910
|
+
# include the following keys:
|
911
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
912
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
913
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
914
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
915
|
+
# trigger a retry.
|
916
|
+
#
|
917
|
+
class Rpcs
|
918
|
+
##
|
919
|
+
# RPC-specific configuration for `submit_job`
|
920
|
+
# @return [Gapic::Config::Method]
|
921
|
+
#
|
922
|
+
attr_reader :submit_job
|
923
|
+
##
|
924
|
+
# RPC-specific configuration for `submit_job_as_operation`
|
925
|
+
# @return [Gapic::Config::Method]
|
926
|
+
#
|
927
|
+
attr_reader :submit_job_as_operation
|
928
|
+
##
|
929
|
+
# RPC-specific configuration for `get_job`
|
930
|
+
# @return [Gapic::Config::Method]
|
931
|
+
#
|
932
|
+
attr_reader :get_job
|
933
|
+
##
|
934
|
+
# RPC-specific configuration for `list_jobs`
|
935
|
+
# @return [Gapic::Config::Method]
|
936
|
+
#
|
937
|
+
attr_reader :list_jobs
|
938
|
+
##
|
939
|
+
# RPC-specific configuration for `update_job`
|
940
|
+
# @return [Gapic::Config::Method]
|
941
|
+
#
|
942
|
+
attr_reader :update_job
|
943
|
+
##
|
944
|
+
# RPC-specific configuration for `cancel_job`
|
945
|
+
# @return [Gapic::Config::Method]
|
946
|
+
#
|
947
|
+
attr_reader :cancel_job
|
948
|
+
##
|
949
|
+
# RPC-specific configuration for `delete_job`
|
950
|
+
# @return [Gapic::Config::Method]
|
951
|
+
#
|
952
|
+
attr_reader :delete_job
|
953
|
+
|
954
|
+
# @private
|
955
|
+
def initialize parent_rpcs = nil
|
956
|
+
submit_job_config = parent_rpcs&.submit_job if parent_rpcs&.respond_to? :submit_job
|
957
|
+
@submit_job = Gapic::Config::Method.new submit_job_config
|
958
|
+
submit_job_as_operation_config = parent_rpcs&.submit_job_as_operation if parent_rpcs&.respond_to? :submit_job_as_operation
|
959
|
+
@submit_job_as_operation = Gapic::Config::Method.new submit_job_as_operation_config
|
960
|
+
get_job_config = parent_rpcs&.get_job if parent_rpcs&.respond_to? :get_job
|
961
|
+
@get_job = Gapic::Config::Method.new get_job_config
|
962
|
+
list_jobs_config = parent_rpcs&.list_jobs if parent_rpcs&.respond_to? :list_jobs
|
963
|
+
@list_jobs = Gapic::Config::Method.new list_jobs_config
|
964
|
+
update_job_config = parent_rpcs&.update_job if parent_rpcs&.respond_to? :update_job
|
965
|
+
@update_job = Gapic::Config::Method.new update_job_config
|
966
|
+
cancel_job_config = parent_rpcs&.cancel_job if parent_rpcs&.respond_to? :cancel_job
|
967
|
+
@cancel_job = Gapic::Config::Method.new cancel_job_config
|
968
|
+
delete_job_config = parent_rpcs&.delete_job if parent_rpcs&.respond_to? :delete_job
|
969
|
+
@delete_job = Gapic::Config::Method.new delete_job_config
|
970
|
+
|
971
|
+
yield self if block_given?
|
972
|
+
end
|
973
|
+
end
|
974
|
+
end
|
975
|
+
end
|
976
|
+
end
|
977
|
+
end
|
978
|
+
end
|
979
|
+
end
|
980
|
+
end
|