1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Resources {
/// ID of the resource preset for computational resources available to a host (CPU, memory etc.).
/// All available presets are listed in the \[documentation\](/docs/data-proc/concepts/instance-types).
#[prost(string, tag = "1")]
pub resource_preset_id: ::prost::alloc::string::String,
/// Type of the storage environment for the host.
/// Possible values:
/// * network-hdd - network HDD drive,
/// * network-ssd - network SSD drive.
#[prost(string, tag = "2")]
pub disk_type_id: ::prost::alloc::string::String,
/// Volume of the storage available to a host, in bytes.
#[prost(int64, tag = "3")]
pub disk_size: i64,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Health {
/// Object is in unknown state (we have no data).
Unknown = 0,
/// Object is alive and well (for example, all hosts of the cluster are alive).
Alive = 1,
/// Object is inoperable (it cannot perform any of its essential functions).
Dead = 2,
/// Object is partially alive (it can perform some of its essential functions).
Degraded = 3,
}
impl Health {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Health::Unknown => "HEALTH_UNKNOWN",
Health::Alive => "ALIVE",
Health::Dead => "DEAD",
Health::Degraded => "DEGRADED",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"HEALTH_UNKNOWN" => Some(Self::Unknown),
"ALIVE" => Some(Self::Alive),
"DEAD" => Some(Self::Dead),
"DEGRADED" => Some(Self::Degraded),
_ => None,
}
}
}
/// A Yandex Data Processing cluster. For details about the concept, see \[documentation\](/docs/data-proc/concepts/).
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Cluster {
/// ID of the cluster. Generated at creation time.
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
/// ID of the folder that the cluster belongs to.
#[prost(string, tag = "2")]
pub folder_id: ::prost::alloc::string::String,
/// Creation timestamp.
#[prost(message, optional, tag = "3")]
pub created_at: ::core::option::Option<::prost_types::Timestamp>,
/// Name of the cluster. The name is unique within the folder.
#[prost(string, tag = "4")]
pub name: ::prost::alloc::string::String,
/// Description of the cluster.
#[prost(string, tag = "5")]
pub description: ::prost::alloc::string::String,
/// Cluster labels as `key:value` pairs.
#[prost(map = "string, string", tag = "6")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// Monitoring systems relevant to the cluster.
#[prost(message, repeated, tag = "7")]
pub monitoring: ::prost::alloc::vec::Vec<Monitoring>,
/// Configuration of the cluster.
#[prost(message, optional, tag = "8")]
pub config: ::core::option::Option<ClusterConfig>,
/// Aggregated cluster health.
#[prost(enumeration = "Health", tag = "9")]
pub health: i32,
/// Cluster status.
#[prost(enumeration = "cluster::Status", tag = "10")]
pub status: i32,
/// ID of the availability zone where the cluster resides.
#[prost(string, tag = "11")]
pub zone_id: ::prost::alloc::string::String,
/// ID of service account for the Yandex Data Processing manager agent.
#[prost(string, tag = "12")]
pub service_account_id: ::prost::alloc::string::String,
/// Object Storage bucket to be used for Yandex Data Processing jobs that are run in the cluster.
#[prost(string, tag = "13")]
pub bucket: ::prost::alloc::string::String,
/// Whether UI Proxy feature is enabled.
#[prost(bool, tag = "14")]
pub ui_proxy: bool,
/// User security groups.
#[prost(string, repeated, tag = "15")]
pub security_group_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Host groups hosting VMs of the cluster.
#[prost(string, repeated, tag = "16")]
pub host_group_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Deletion Protection inhibits deletion of the cluster
#[prost(bool, tag = "17")]
pub deletion_protection: bool,
/// ID of the cloud logging log group to write logs. If not set, default log group for the folder will be used.
/// To prevent logs from being sent to the cloud set cluster property dataproc:disable_cloud_logging = true
#[prost(string, tag = "18")]
pub log_group_id: ::prost::alloc::string::String,
/// Environment of the cluster
#[prost(enumeration = "cluster::Environment", tag = "19")]
pub environment: i32,
}
/// Nested message and enum types in `Cluster`.
pub mod cluster {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Status {
/// Cluster state is unknown.
Unknown = 0,
/// Cluster is being created.
Creating = 1,
/// Cluster is running normally.
Running = 2,
/// Cluster encountered a problem and cannot operate.
Error = 3,
/// Cluster is stopping.
Stopping = 4,
/// Cluster stopped.
Stopped = 5,
/// Cluster is starting.
Starting = 6,
}
impl Status {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Status::Unknown => "STATUS_UNKNOWN",
Status::Creating => "CREATING",
Status::Running => "RUNNING",
Status::Error => "ERROR",
Status::Stopping => "STOPPING",
Status::Stopped => "STOPPED",
Status::Starting => "STARTING",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"STATUS_UNKNOWN" => Some(Self::Unknown),
"CREATING" => Some(Self::Creating),
"RUNNING" => Some(Self::Running),
"ERROR" => Some(Self::Error),
"STOPPING" => Some(Self::Stopping),
"STOPPED" => Some(Self::Stopped),
"STARTING" => Some(Self::Starting),
_ => None,
}
}
}
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Environment {
Unspecified = 0,
Production = 1,
Prestable = 2,
}
impl Environment {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Environment::Unspecified => "ENVIRONMENT_UNSPECIFIED",
Environment::Production => "PRODUCTION",
Environment::Prestable => "PRESTABLE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ENVIRONMENT_UNSPECIFIED" => Some(Self::Unspecified),
"PRODUCTION" => Some(Self::Production),
"PRESTABLE" => Some(Self::Prestable),
_ => None,
}
}
}
}
/// Metadata of a monitoring system for a Yandex Data Processing cluster.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Monitoring {
/// Name of the monitoring system.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Description of the monitoring system.
#[prost(string, tag = "2")]
pub description: ::prost::alloc::string::String,
/// Link to the monitoring system.
#[prost(string, tag = "3")]
pub link: ::prost::alloc::string::String,
}
/// Hadoop configuration that describes services installed in a cluster,
/// their properties and settings.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HadoopConfig {
/// Set of services used in the cluster (if empty, the default set is used).
#[prost(enumeration = "hadoop_config::Service", repeated, tag = "1")]
pub services: ::prost::alloc::vec::Vec<i32>,
/// Properties set for all hosts in `*-site.xml` configurations. The key should indicate
/// the service and the property.
///
/// For example, use the key 'hdfs:dfs.replication' to set the `dfs.replication` property
/// in the file `/etc/hadoop/conf/hdfs-site.xml`.
#[prost(map = "string, string", tag = "2")]
pub properties: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// List of public SSH keys to access to cluster hosts.
#[prost(string, repeated, tag = "3")]
pub ssh_public_keys: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Set of init-actions
#[prost(message, repeated, tag = "4")]
pub initialization_actions: ::prost::alloc::vec::Vec<InitializationAction>,
}
/// Nested message and enum types in `HadoopConfig`.
pub mod hadoop_config {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Service {
Unspecified = 0,
Hdfs = 1,
Yarn = 2,
Mapreduce = 3,
Hive = 4,
Tez = 5,
Zookeeper = 6,
Hbase = 7,
Sqoop = 8,
Flume = 9,
Spark = 10,
Zeppelin = 11,
Oozie = 12,
Livy = 13,
}
impl Service {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Service::Unspecified => "SERVICE_UNSPECIFIED",
Service::Hdfs => "HDFS",
Service::Yarn => "YARN",
Service::Mapreduce => "MAPREDUCE",
Service::Hive => "HIVE",
Service::Tez => "TEZ",
Service::Zookeeper => "ZOOKEEPER",
Service::Hbase => "HBASE",
Service::Sqoop => "SQOOP",
Service::Flume => "FLUME",
Service::Spark => "SPARK",
Service::Zeppelin => "ZEPPELIN",
Service::Oozie => "OOZIE",
Service::Livy => "LIVY",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SERVICE_UNSPECIFIED" => Some(Self::Unspecified),
"HDFS" => Some(Self::Hdfs),
"YARN" => Some(Self::Yarn),
"MAPREDUCE" => Some(Self::Mapreduce),
"HIVE" => Some(Self::Hive),
"TEZ" => Some(Self::Tez),
"ZOOKEEPER" => Some(Self::Zookeeper),
"HBASE" => Some(Self::Hbase),
"SQOOP" => Some(Self::Sqoop),
"FLUME" => Some(Self::Flume),
"SPARK" => Some(Self::Spark),
"ZEPPELIN" => Some(Self::Zeppelin),
"OOZIE" => Some(Self::Oozie),
"LIVY" => Some(Self::Livy),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ClusterConfig {
/// Image version for cluster provisioning.
/// All available versions are listed in the \[documentation\](/docs/data-proc/concepts/environment).
#[prost(string, tag = "1")]
pub version_id: ::prost::alloc::string::String,
/// Yandex Data Processing specific configuration options.
#[prost(message, optional, tag = "2")]
pub hadoop: ::core::option::Option<HadoopConfig>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InitializationAction {
/// URI of the executable file
#[prost(string, tag = "1")]
pub uri: ::prost::alloc::string::String,
/// Arguments to the initialization action
#[prost(string, repeated, tag = "2")]
pub args: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Execution timeout
#[prost(int64, tag = "3")]
pub timeout: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AutoscalingConfig {
/// Upper limit for total instance subcluster count.
#[prost(int64, tag = "1")]
pub max_hosts_count: i64,
/// Preemptible instances are stopped at least once every 24 hours, and can be stopped at any time
/// if their resources are needed by Compute.
/// For more information, see [Preemptible Virtual Machines](/docs/compute/concepts/preemptible-vm).
#[prost(bool, tag = "2")]
pub preemptible: bool,
/// Time in seconds allotted for averaging metrics.
#[prost(message, optional, tag = "3")]
pub measurement_duration: ::core::option::Option<::prost_types::Duration>,
/// The warmup time of the instance in seconds. During this time,
/// traffic is sent to the instance, but instance metrics are not collected.
#[prost(message, optional, tag = "4")]
pub warmup_duration: ::core::option::Option<::prost_types::Duration>,
/// Minimum amount of time in seconds allotted for monitoring before
/// Instance Groups can reduce the number of instances in the group.
/// During this time, the group size doesn't decrease, even if the new metric values
/// indicate that it should.
#[prost(message, optional, tag = "5")]
pub stabilization_duration: ::core::option::Option<::prost_types::Duration>,
/// Defines an autoscaling rule based on the average CPU utilization of the instance group.
#[prost(double, tag = "6")]
pub cpu_utilization_target: f64,
/// Timeout to gracefully decommission nodes during downscaling. In seconds. Default value: 120
#[prost(int64, tag = "7")]
pub decommission_timeout: i64,
}
/// A Yandex Data Processing subcluster. For details about the concept, see \[documentation\](/docs/data-proc/concepts/).
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Subcluster {
/// ID of the subcluster. Generated at creation time.
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
/// ID of the Yandex Data Processing cluster that the subcluster belongs to.
#[prost(string, tag = "2")]
pub cluster_id: ::prost::alloc::string::String,
/// Creation timestamp.
#[prost(message, optional, tag = "3")]
pub created_at: ::core::option::Option<::prost_types::Timestamp>,
/// Name of the subcluster. The name is unique within the cluster.
#[prost(string, tag = "4")]
pub name: ::prost::alloc::string::String,
/// Role that is fulfilled by hosts of the subcluster.
#[prost(enumeration = "Role", tag = "5")]
pub role: i32,
/// Resources allocated for each host in the subcluster.
#[prost(message, optional, tag = "6")]
pub resources: ::core::option::Option<Resources>,
/// ID of the VPC subnet used for hosts in the subcluster.
#[prost(string, tag = "7")]
pub subnet_id: ::prost::alloc::string::String,
/// Number of hosts in the subcluster.
#[prost(int64, tag = "8")]
pub hosts_count: i64,
/// Assign public ip addresses for all hosts in subcluter.
#[prost(bool, tag = "9")]
pub assign_public_ip: bool,
/// Configuration for instance group based subclusters
#[prost(message, optional, tag = "10")]
pub autoscaling_config: ::core::option::Option<AutoscalingConfig>,
/// ID of Compute Instance Group for autoscaling subclusters
#[prost(string, tag = "11")]
pub instance_group_id: ::prost::alloc::string::String,
}
/// A Yandex Data Processing host. For details about the concept, see \[documentation\](/docs/data-proc/concepts/).
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Host {
/// Name of the Yandex Data Processing host. The host name is assigned by Yandex Data Processing at creation time
/// and cannot be changed. The name is generated to be unique across all Yandex Data Processing
/// hosts that exist on the platform, as it defines the FQDN of the host.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// ID of the Yandex Data Processing subcluster that the host belongs to.
#[prost(string, tag = "2")]
pub subcluster_id: ::prost::alloc::string::String,
/// Status code of the aggregated health of the host.
#[prost(enumeration = "Health", tag = "3")]
pub health: i32,
/// ID of the Compute virtual machine that is used as the Yandex Data Processing host.
#[prost(string, tag = "4")]
pub compute_instance_id: ::prost::alloc::string::String,
/// Role of the host in the cluster.
#[prost(enumeration = "Role", tag = "5")]
pub role: i32,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Role {
Unspecified = 0,
/// The subcluster fulfills the master role.
///
/// Master can run the following services, depending on the requested components:
/// * HDFS: Namenode, Secondary Namenode
/// * YARN: ResourceManager, Timeline Server
/// * HBase Master
/// * Hive: Server, Metastore, HCatalog
/// * Spark History Server
/// * Zeppelin
/// * ZooKeeper
Masternode = 1,
/// The subcluster is a DATANODE in a Yandex Data Processing cluster.
///
/// DATANODE can run the following services, depending on the requested components:
/// * HDFS DataNode
/// * YARN NodeManager
/// * HBase RegionServer
/// * Spark libraries
Datanode = 2,
/// The subcluster is a COMPUTENODE in a Yandex Data Processing cluster.
///
/// COMPUTENODE can run the following services, depending on the requested components:
/// * YARN NodeManager
/// * Spark libraries
Computenode = 3,
}
impl Role {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Role::Unspecified => "ROLE_UNSPECIFIED",
Role::Masternode => "MASTERNODE",
Role::Datanode => "DATANODE",
Role::Computenode => "COMPUTENODE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ROLE_UNSPECIFIED" => Some(Self::Unspecified),
"MASTERNODE" => Some(Self::Masternode),
"DATANODE" => Some(Self::Datanode),
"COMPUTENODE" => Some(Self::Computenode),
_ => None,
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetClusterRequest {
/// ID of the Yandex Data Processing cluster.
///
/// To get a cluster ID make a \[ClusterService.List\] request.
#[prost(string, tag = "1")]
pub cluster_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListClustersRequest {
/// ID of the folder to list clusters in.
///
/// To get the folder ID make a \[yandex.cloud.resourcemanager.v1.FolderService.List\] request.
#[prost(string, tag = "1")]
pub folder_id: ::prost::alloc::string::String,
/// The maximum number of results per page to return. If the number of available
/// results is larger than \[page_size\], the service returns a \[ListClustersResponse.next_page_token\]
/// that can be used to get the next page of results in subsequent list requests.
/// Default value: 100.
#[prost(int64, tag = "2")]
pub page_size: i64,
/// Page token. To get the next page of results, set `page_token` to the
/// \[ListClustersResponse.next_page_token\] returned by a previous list request.
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
/// A filter expression that filters clusters listed in the response.
///
/// The expression must specify:
/// 1. The field name. Currently you can use filtering only on \[Cluster.name\] field.
/// 2. An `=` operator.
/// 3. The value in double quotes (`"`). Must be 3-63 characters long and match the regular expression `\[a-z][-a-z0-9]{1,61}[a-z0-9\]`.
/// Example of a filter: `name=my-cluster`.
#[prost(string, tag = "4")]
pub filter: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListClustersResponse {
/// List of clusters in the specified folder.
#[prost(message, repeated, tag = "1")]
pub clusters: ::prost::alloc::vec::Vec<Cluster>,
/// Token for getting the next page of the list. If the number of results is greater than
/// the specified \[ListClustersRequest.page_size\], use `next_page_token` as the value
/// for the \[ListClustersRequest.page_token\] parameter in the next list request.
///
/// Each subsequent page will have its own `next_page_token` to continue paging through the results.
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateSubclusterConfigSpec {
/// Name of the subcluster.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Role of the subcluster in the Yandex Data Processing cluster.
#[prost(enumeration = "Role", tag = "2")]
pub role: i32,
/// Resource configuration for hosts in the subcluster.
#[prost(message, optional, tag = "3")]
pub resources: ::core::option::Option<Resources>,
/// ID of the VPC subnet used for hosts in the subcluster.
#[prost(string, tag = "4")]
pub subnet_id: ::prost::alloc::string::String,
/// Number of hosts in the subcluster.
#[prost(int64, tag = "5")]
pub hosts_count: i64,
/// Assign public ip addresses for all hosts in subcluter.
#[prost(bool, tag = "6")]
pub assign_public_ip: bool,
/// Configuration for instance group based subclusters
#[prost(message, optional, tag = "7")]
pub autoscaling_config: ::core::option::Option<AutoscalingConfig>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateSubclusterConfigSpec {
/// ID of the subcluster to update.
///
/// To get the subcluster ID make a \[SubclusterService.List\] request.
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
/// Name of the subcluster.
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
/// Resource configuration for each host in the subcluster.
#[prost(message, optional, tag = "3")]
pub resources: ::core::option::Option<Resources>,
/// Number of hosts in the subcluster.
#[prost(int64, tag = "4")]
pub hosts_count: i64,
/// Configuration for instance group based subclusters
#[prost(message, optional, tag = "5")]
pub autoscaling_config: ::core::option::Option<AutoscalingConfig>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateClusterConfigSpec {
/// Version of the image for cluster provisioning.
///
/// All available versions are listed in the \[documentation\](/docs/data-proc/concepts/environment).
#[prost(string, tag = "1")]
pub version_id: ::prost::alloc::string::String,
/// Yandex Data Processing specific options.
#[prost(message, optional, tag = "2")]
pub hadoop: ::core::option::Option<HadoopConfig>,
/// Specification for creating subclusters.
#[prost(message, repeated, tag = "3")]
pub subclusters_spec: ::prost::alloc::vec::Vec<CreateSubclusterConfigSpec>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateClusterConfigSpec {
/// New configuration for subclusters in a cluster.
#[prost(message, repeated, tag = "1")]
pub subclusters_spec: ::prost::alloc::vec::Vec<UpdateSubclusterConfigSpec>,
/// Hadoop specific options
#[prost(message, optional, tag = "2")]
pub hadoop: ::core::option::Option<HadoopConfig>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateClusterRequest {
/// ID of the folder to create a cluster in.
///
/// To get a folder ID make a \[yandex.cloud.resourcemanager.v1.FolderService.List\] request.
#[prost(string, tag = "1")]
pub folder_id: ::prost::alloc::string::String,
/// Name of the cluster. The name must be unique within the folder.
/// The name can't be changed after the Yandex Data Processing cluster is created.
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
/// Description of the cluster.
#[prost(string, tag = "3")]
pub description: ::prost::alloc::string::String,
/// Cluster labels as `key:value` pairs.
#[prost(map = "string, string", tag = "4")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// Configuration and resources for hosts that should be created with the cluster.
#[prost(message, optional, tag = "6")]
pub config_spec: ::core::option::Option<CreateClusterConfigSpec>,
/// ID of the availability zone where the cluster should be placed.
///
/// To get the list of available zones make a \[yandex.cloud.compute.v1.ZoneService.List\] request.
#[prost(string, tag = "7")]
pub zone_id: ::prost::alloc::string::String,
/// ID of the service account to be used by the Yandex Data Processing manager agent.
#[prost(string, tag = "8")]
pub service_account_id: ::prost::alloc::string::String,
/// Name of the Object Storage bucket to use for Yandex Data Processing jobs.
#[prost(string, tag = "9")]
pub bucket: ::prost::alloc::string::String,
/// Enable UI Proxy feature.
#[prost(bool, tag = "10")]
pub ui_proxy: bool,
/// User security groups.
#[prost(string, repeated, tag = "11")]
pub security_group_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Host groups to place VMs of cluster on.
#[prost(string, repeated, tag = "12")]
pub host_group_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Deletion Protection inhibits deletion of the cluster
#[prost(bool, tag = "13")]
pub deletion_protection: bool,
/// ID of the cloud logging log group to write logs. If not set, logs will not be sent to logging service
#[prost(string, tag = "14")]
pub log_group_id: ::prost::alloc::string::String,
/// Environment of the cluster
#[prost(enumeration = "cluster::Environment", tag = "15")]
pub environment: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateClusterMetadata {
/// ID of the cluster that is being created.
#[prost(string, tag = "1")]
pub cluster_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateClusterRequest {
/// ID of the cluster to update.
///
/// To get the cluster ID, make a \[ClusterService.List\] request.
#[prost(string, tag = "1")]
pub cluster_id: ::prost::alloc::string::String,
/// Field mask that specifies which attributes of the cluster should be updated.
#[prost(message, optional, tag = "2")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
/// New description for the cluster.
#[prost(string, tag = "3")]
pub description: ::prost::alloc::string::String,
/// A new set of cluster labels as `key:value` pairs.
#[prost(map = "string, string", tag = "4")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// Configuration and resources for hosts that should be created with the Yandex Data Processing cluster.
#[prost(message, optional, tag = "5")]
pub config_spec: ::core::option::Option<UpdateClusterConfigSpec>,
/// New name for the Yandex Data Processing cluster. The name must be unique within the folder.
#[prost(string, tag = "6")]
pub name: ::prost::alloc::string::String,
/// ID of the new service account to be used by the Yandex Data Processing manager agent.
#[prost(string, tag = "7")]
pub service_account_id: ::prost::alloc::string::String,
/// Name of the new Object Storage bucket to use for Yandex Data Processing jobs.
#[prost(string, tag = "8")]
pub bucket: ::prost::alloc::string::String,
/// Timeout to gracefully decommission nodes. In seconds. Default value: 0
#[prost(int64, tag = "9")]
pub decommission_timeout: i64,
/// Enable UI Proxy feature.
#[prost(bool, tag = "10")]
pub ui_proxy: bool,
/// User security groups.
#[prost(string, repeated, tag = "11")]
pub security_group_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Deletion Protection inhibits deletion of the cluster
#[prost(bool, tag = "12")]
pub deletion_protection: bool,
/// ID of the cloud logging log group to write logs. If not set, logs will not be sent to logging service
#[prost(string, tag = "13")]
pub log_group_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateClusterMetadata {
/// ID of the cluster that is being updated.
#[prost(string, tag = "1")]
pub cluster_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteClusterRequest {
/// ID of the cluster to delete.
///
/// To get a cluster ID, make a \[ClusterService.List\] request.
#[prost(string, tag = "1")]
pub cluster_id: ::prost::alloc::string::String,
/// Timeout to gracefully decommission nodes. In seconds. Default value: 0
#[prost(int64, tag = "2")]
pub decommission_timeout: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteClusterMetadata {
/// ID of the Yandex Data Processing cluster that is being deleted.
#[prost(string, tag = "1")]
pub cluster_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StartClusterRequest {
/// ID of the cluster to start.
///
/// To get a cluster ID, make a \[ClusterService.List\] request.
#[prost(string, tag = "1")]
pub cluster_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StartClusterMetadata {
/// ID of the Yandex Data Processing cluster that is being started.
#[prost(string, tag = "1")]
pub cluster_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StopClusterRequest {
/// ID of the cluster to stop.
///
/// To get a cluster ID, make a \[ClusterService.List\] request.
#[prost(string, tag = "1")]
pub cluster_id: ::prost::alloc::string::String,
/// Timeout to gracefully decommission nodes. In seconds. Default value: 0
#[prost(int64, tag = "2")]
pub decommission_timeout: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StopClusterMetadata {
/// ID of the Yandex Data Processing cluster that is being stopped.
#[prost(string, tag = "1")]
pub cluster_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListClusterOperationsRequest {
/// ID of the cluster to list operations for.
#[prost(string, tag = "1")]
pub cluster_id: ::prost::alloc::string::String,
/// The maximum number of results per page to return. If the number of available
/// results is larger than \[page_size\], the service returns a \[ListClusterOperationsResponse.next_page_token\]
/// that can be used to get the next page of results in subsequent list requests.
/// Default value: 100.
#[prost(int64, tag = "2")]
pub page_size: i64,
/// Page token. To get the next page of results, set \[page_token\] to the
/// \[ListClusterOperationsResponse.next_page_token\] returned by a previous list request.
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListClusterOperationsResponse {
/// List of operations for the specified cluster.
#[prost(message, repeated, tag = "1")]
pub operations: ::prost::alloc::vec::Vec<super::super::operation::Operation>,
/// Token for getting the next page of the list. If the number of results is greater than
/// the specified \[ListClusterOperationsRequest.page_size\], use `next_page_token` as the value
/// for the \[ListClusterOperationsRequest.page_token\] parameter in the next list request.
///
/// Each subsequent page will have its own `next_page_token` to continue paging through the results.
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListClusterHostsRequest {
/// ID of the cluster to list hosts for.
///
/// To get a cluster ID, make a \[ClusterService.List\] request.
#[prost(string, tag = "1")]
pub cluster_id: ::prost::alloc::string::String,
/// The maximum number of results per page to return. If the number of available
/// results is larger than \[page_size\], the service returns a \[ListClusterHostsResponse.next_page_token\]
/// that can be used to get the next page of results in subsequent list requests.
/// Default value: 100.
#[prost(int64, tag = "2")]
pub page_size: i64,
/// Page token. To get the next page of results, set \[page_token\] to the
/// \[ListClusterHostsResponse.next_page_token\] returned by a previous list request.
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
/// A filter expression that filters hosts listed in the response.
///
/// The expression must specify:
/// 1. The field name. Currently you can use filtering only on \[Cluster.name\] field.
/// 2. An `=` operator.
/// 3. The value in double quotes (`"`). Must be 3-63 characters long and match the regular expression `\[a-z][-a-z0-9]{1,61}[a-z0-9\]`.
/// Example of a filter: `name=my-host`
#[prost(string, tag = "4")]
pub filter: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListClusterHostsResponse {
/// Requested list of hosts.
#[prost(message, repeated, tag = "1")]
pub hosts: ::prost::alloc::vec::Vec<Host>,
/// Token for getting the next page of the list. If the number of results is greater than
/// the specified \[ListClusterHostsRequest.page_size\], use `next_page_token` as the value
/// for the \[ListClusterHostsRequest.page_token\] parameter in the next list request.
///
/// Each subsequent page will have its own `next_page_token` to continue paging through the results.
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListUiLinksRequest {
/// Required. ID of the Hadoop cluster.
#[prost(string, tag = "1")]
pub cluster_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UiLink {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub url: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListUiLinksResponse {
/// Requested list of ui links.
#[prost(message, repeated, tag = "1")]
pub links: ::prost::alloc::vec::Vec<UiLink>,
}
/// Generated client implementations.
pub mod cluster_service_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
/// A set of methods for managing Yandex Data Processing clusters.
#[derive(Debug, Clone)]
pub struct ClusterServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl ClusterServiceClient<tonic::transport::Channel> {
/// Attempt to create a new client by connecting to a given endpoint.
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> ClusterServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> ClusterServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
ClusterServiceClient::new(InterceptedService::new(inner, interceptor))
}
/// Compress requests with the given encoding.
///
/// This requires the server to support it otherwise it might respond with an
/// error.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
/// Enable decompressing responses.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
/// Limits the maximum size of a decoded message.
///
/// Default: `4MB`
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
/// Limits the maximum size of an encoded message.
///
/// Default: `usize::MAX`
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
/// Returns the specified cluster.
///
/// To get the list of all available clusters, make a [ClusterService.List] request.
pub async fn get(
&mut self,
request: impl tonic::IntoRequest<super::GetClusterRequest>,
) -> std::result::Result<tonic::Response<super::Cluster>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.dataproc.v1.ClusterService/Get",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.dataproc.v1.ClusterService", "Get"),
);
self.inner.unary(req, path, codec).await
}
/// Retrieves the list of clusters in the specified folder.
pub async fn list(
&mut self,
request: impl tonic::IntoRequest<super::ListClustersRequest>,
) -> std::result::Result<
tonic::Response<super::ListClustersResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.dataproc.v1.ClusterService/List",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.dataproc.v1.ClusterService", "List"),
);
self.inner.unary(req, path, codec).await
}
/// Creates a cluster in the specified folder.
pub async fn create(
&mut self,
request: impl tonic::IntoRequest<super::CreateClusterRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::operation::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.dataproc.v1.ClusterService/Create",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.dataproc.v1.ClusterService", "Create"),
);
self.inner.unary(req, path, codec).await
}
/// Updates the configuration of the specified cluster.
pub async fn update(
&mut self,
request: impl tonic::IntoRequest<super::UpdateClusterRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::operation::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.dataproc.v1.ClusterService/Update",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.dataproc.v1.ClusterService", "Update"),
);
self.inner.unary(req, path, codec).await
}
/// Deletes the specified cluster.
pub async fn delete(
&mut self,
request: impl tonic::IntoRequest<super::DeleteClusterRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::operation::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.dataproc.v1.ClusterService/Delete",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.dataproc.v1.ClusterService", "Delete"),
);
self.inner.unary(req, path, codec).await
}
/// Starts the specified cluster.
pub async fn start(
&mut self,
request: impl tonic::IntoRequest<super::StartClusterRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::operation::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.dataproc.v1.ClusterService/Start",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.dataproc.v1.ClusterService", "Start"),
);
self.inner.unary(req, path, codec).await
}
/// Stops the specified cluster.
pub async fn stop(
&mut self,
request: impl tonic::IntoRequest<super::StopClusterRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::operation::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.dataproc.v1.ClusterService/Stop",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.dataproc.v1.ClusterService", "Stop"),
);
self.inner.unary(req, path, codec).await
}
/// Lists operations for the specified cluster.
pub async fn list_operations(
&mut self,
request: impl tonic::IntoRequest<super::ListClusterOperationsRequest>,
) -> std::result::Result<
tonic::Response<super::ListClusterOperationsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.dataproc.v1.ClusterService/ListOperations",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.dataproc.v1.ClusterService",
"ListOperations",
),
);
self.inner.unary(req, path, codec).await
}
/// Retrieves the list of hosts in the specified cluster.
pub async fn list_hosts(
&mut self,
request: impl tonic::IntoRequest<super::ListClusterHostsRequest>,
) -> std::result::Result<
tonic::Response<super::ListClusterHostsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.dataproc.v1.ClusterService/ListHosts",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.dataproc.v1.ClusterService",
"ListHosts",
),
);
self.inner.unary(req, path, codec).await
}
/// Retrieves a list of links to web interfaces being proxied by Yandex Data Processing UI Proxy.
pub async fn list_ui_links(
&mut self,
request: impl tonic::IntoRequest<super::ListUiLinksRequest>,
) -> std::result::Result<
tonic::Response<super::ListUiLinksResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.dataproc.v1.ClusterService/ListUILinks",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.dataproc.v1.ClusterService",
"ListUILinks",
),
);
self.inner.unary(req, path, codec).await
}
}
}
/// A Yandex Data Processing job. For details about the concept, see \[documentation\](/docs/data-proc/concepts/jobs).
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Job {
/// ID of the job. Generated at creation time.
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
/// ID of the Yandex Data Processing cluster that the job belongs to.
#[prost(string, tag = "2")]
pub cluster_id: ::prost::alloc::string::String,
/// Creation timestamp.
#[prost(message, optional, tag = "3")]
pub created_at: ::core::option::Option<::prost_types::Timestamp>,
/// The time when the job was started.
#[prost(message, optional, tag = "4")]
pub started_at: ::core::option::Option<::prost_types::Timestamp>,
/// The time when the job was finished.
#[prost(message, optional, tag = "5")]
pub finished_at: ::core::option::Option<::prost_types::Timestamp>,
/// Name of the job, specified in the \[JobService.Create\] request.
#[prost(string, tag = "6")]
pub name: ::prost::alloc::string::String,
/// The id of the user who created the job
#[prost(string, tag = "12")]
pub created_by: ::prost::alloc::string::String,
/// Job status.
#[prost(enumeration = "job::Status", tag = "7")]
pub status: i32,
/// Attributes of YARN application.
#[prost(message, optional, tag = "13")]
pub application_info: ::core::option::Option<ApplicationInfo>,
/// Specification for the job.
#[prost(oneof = "job::JobSpec", tags = "8, 9, 10, 11")]
pub job_spec: ::core::option::Option<job::JobSpec>,
}
/// Nested message and enum types in `Job`.
pub mod job {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Status {
Unspecified = 0,
/// Job is logged in the database and is waiting for the agent to run it.
Provisioning = 1,
/// Job is acquired by the agent and is in the queue for execution.
Pending = 2,
/// Job is being run in the cluster.
Running = 3,
/// Job failed to finish the run properly.
Error = 4,
/// Job is finished.
Done = 5,
/// Job is cancelled.
Cancelled = 6,
/// Job is waiting for cancellation.
Cancelling = 7,
}
impl Status {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Status::Unspecified => "STATUS_UNSPECIFIED",
Status::Provisioning => "PROVISIONING",
Status::Pending => "PENDING",
Status::Running => "RUNNING",
Status::Error => "ERROR",
Status::Done => "DONE",
Status::Cancelled => "CANCELLED",
Status::Cancelling => "CANCELLING",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"STATUS_UNSPECIFIED" => Some(Self::Unspecified),
"PROVISIONING" => Some(Self::Provisioning),
"PENDING" => Some(Self::Pending),
"RUNNING" => Some(Self::Running),
"ERROR" => Some(Self::Error),
"DONE" => Some(Self::Done),
"CANCELLED" => Some(Self::Cancelled),
"CANCELLING" => Some(Self::Cancelling),
_ => None,
}
}
}
/// Specification for the job.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum JobSpec {
/// Specification for a MapReduce job.
#[prost(message, tag = "8")]
MapreduceJob(super::MapreduceJob),
/// Specification for a Spark job.
#[prost(message, tag = "9")]
SparkJob(super::SparkJob),
/// Specification for a PySpark job.
#[prost(message, tag = "10")]
PysparkJob(super::PysparkJob),
/// Specification for a Hive job.
#[prost(message, tag = "11")]
HiveJob(super::HiveJob),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ApplicationAttempt {
/// ID of YARN application attempt
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
/// ID of YARN Application Master container
#[prost(string, tag = "2")]
pub am_container_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ApplicationInfo {
/// ID of YARN application
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
/// YARN application attempts
#[prost(message, repeated, tag = "2")]
pub application_attempts: ::prost::alloc::vec::Vec<ApplicationAttempt>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MapreduceJob {
/// Optional arguments to pass to the driver.
#[prost(string, repeated, tag = "1")]
pub args: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// JAR file URIs to add to CLASSPATH of the Yandex Data Processing driver and each task.
#[prost(string, repeated, tag = "2")]
pub jar_file_uris: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// URIs of resource files to be copied to the working directory of Yandex Data Processing drivers
/// and distributed Hadoop tasks.
#[prost(string, repeated, tag = "3")]
pub file_uris: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// URIs of archives to be extracted to the working directory of Yandex Data Processing drivers and tasks.
#[prost(string, repeated, tag = "4")]
pub archive_uris: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Property names and values, used to configure Yandex Data Processing and MapReduce.
#[prost(map = "string, string", tag = "5")]
pub properties: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(oneof = "mapreduce_job::Driver", tags = "6, 7")]
pub driver: ::core::option::Option<mapreduce_job::Driver>,
}
/// Nested message and enum types in `MapreduceJob`.
pub mod mapreduce_job {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Driver {
/// HCFS URI of the .jar file containing the driver class.
#[prost(string, tag = "6")]
MainJarFileUri(::prost::alloc::string::String),
/// The name of the driver class.
#[prost(string, tag = "7")]
MainClass(::prost::alloc::string::String),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SparkJob {
/// Optional arguments to pass to the driver.
#[prost(string, repeated, tag = "1")]
pub args: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// JAR file URIs to add to CLASSPATH of the Yandex Data Processing driver and each task.
#[prost(string, repeated, tag = "2")]
pub jar_file_uris: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// URIs of resource files to be copied to the working directory of Yandex Data Processing drivers
/// and distributed Hadoop tasks.
#[prost(string, repeated, tag = "3")]
pub file_uris: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// URIs of archives to be extracted to the working directory of Yandex Data Processing drivers and tasks.
#[prost(string, repeated, tag = "4")]
pub archive_uris: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Property names and values, used to configure Yandex Data Processing and Spark.
#[prost(map = "string, string", tag = "5")]
pub properties: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// The HCFS URI of the JAR file containing the `main` class for the job.
#[prost(string, tag = "6")]
pub main_jar_file_uri: ::prost::alloc::string::String,
/// The name of the driver class.
#[prost(string, tag = "7")]
pub main_class: ::prost::alloc::string::String,
/// List of maven coordinates of jars to include on the driver and executor classpaths.
#[prost(string, repeated, tag = "8")]
pub packages: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// List of additional remote repositories to search for the maven coordinates given with --packages.
#[prost(string, repeated, tag = "9")]
pub repositories: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// List of groupId:artifactId, to exclude while resolving the dependencies provided in --packages to avoid dependency conflicts.
#[prost(string, repeated, tag = "10")]
pub exclude_packages: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PysparkJob {
/// Optional arguments to pass to the driver.
#[prost(string, repeated, tag = "1")]
pub args: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// JAR file URIs to add to CLASSPATH of the Yandex Data Processing driver and each task.
#[prost(string, repeated, tag = "2")]
pub jar_file_uris: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// URIs of resource files to be copied to the working directory of Yandex Data Processing drivers
/// and distributed Hadoop tasks.
#[prost(string, repeated, tag = "3")]
pub file_uris: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// URIs of archives to be extracted to the working directory of Yandex Data Processing drivers and tasks.
#[prost(string, repeated, tag = "4")]
pub archive_uris: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Property names and values, used to configure Yandex Data Processing and PySpark.
#[prost(map = "string, string", tag = "5")]
pub properties: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// URI of the file with the driver code. Must be a .py file.
#[prost(string, tag = "6")]
pub main_python_file_uri: ::prost::alloc::string::String,
/// URIs of Python files to pass to the PySpark framework.
#[prost(string, repeated, tag = "7")]
pub python_file_uris: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// List of maven coordinates of jars to include on the driver and executor classpaths.
#[prost(string, repeated, tag = "8")]
pub packages: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// List of additional remote repositories to search for the maven coordinates given with --packages.
#[prost(string, repeated, tag = "9")]
pub repositories: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// List of groupId:artifactId, to exclude while resolving the dependencies provided in --packages to avoid dependency conflicts.
#[prost(string, repeated, tag = "10")]
pub exclude_packages: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryList {
/// List of Hive queries.
#[prost(string, repeated, tag = "1")]
pub queries: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HiveJob {
/// Property names and values, used to configure Yandex Data Processing and Hive.
#[prost(map = "string, string", tag = "1")]
pub properties: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// Flag indicating whether a job should continue to run if a query fails.
#[prost(bool, tag = "2")]
pub continue_on_failure: bool,
/// Query variables and their values.
#[prost(map = "string, string", tag = "3")]
pub script_variables: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// JAR file URIs to add to CLASSPATH of the Hive driver and each task.
#[prost(string, repeated, tag = "4")]
pub jar_file_uris: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(oneof = "hive_job::QueryType", tags = "5, 6")]
pub query_type: ::core::option::Option<hive_job::QueryType>,
}
/// Nested message and enum types in `HiveJob`.
pub mod hive_job {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum QueryType {
/// URI of the script with all the necessary Hive queries.
#[prost(string, tag = "5")]
QueryFileUri(::prost::alloc::string::String),
/// List of Hive queries to be used in the job.
#[prost(message, tag = "6")]
QueryList(super::QueryList),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetJobRequest {
/// ID of the cluster to request a job from.
#[prost(string, tag = "1")]
pub cluster_id: ::prost::alloc::string::String,
/// ID of the job to return.
///
/// To get a job ID make a \[JobService.List\] request.
#[prost(string, tag = "2")]
pub job_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListJobsRequest {
/// ID of the cluster to list jobs for.
#[prost(string, tag = "1")]
pub cluster_id: ::prost::alloc::string::String,
/// The maximum number of results per page to return. If the number of available
/// results is larger than \[page_size\], the service returns a \[ListJobsResponse.next_page_token\]
/// that can be used to get the next page of results in subsequent list requests.
/// Default value: 100.
#[prost(int64, tag = "2")]
pub page_size: i64,
/// Page token. To get the next page of results, set `page_token` to the
/// \[ListJobsResponse.next_page_token\] returned by a previous list request.
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
/// A filter expression that filters jobs listed in the response.
///
/// The expression must specify:
/// 1. The field name. Currently you can use filtering only on \[Job.name\] field.
/// 2. An `=` operator.
/// 3. The value in double quotes (`"`). Must be 3-63 characters long and match the regular expression `\[a-z][-a-z0-9]{1,61}[a-z0-9\]`.
/// Example of a filter: `name=my-job`.
#[prost(string, tag = "4")]
pub filter: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListJobsResponse {
/// List of jobs for the specified cluster.
#[prost(message, repeated, tag = "1")]
pub jobs: ::prost::alloc::vec::Vec<Job>,
/// Token for getting the next page of the list. If the number of results is greater than
/// the specified \[ListJobsRequest.page_size\], use `next_page_token` as the value
/// for the \[ListJobsRequest.page_token\] parameter in the next list request.
///
/// Each subsequent page will have its own `next_page_token` to continue paging through the results.
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateJobRequest {
/// ID of the cluster to create a job for.
#[prost(string, tag = "1")]
pub cluster_id: ::prost::alloc::string::String,
/// Name of the job.
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
/// Specification for the job.
#[prost(oneof = "create_job_request::JobSpec", tags = "3, 4, 5, 6")]
pub job_spec: ::core::option::Option<create_job_request::JobSpec>,
}
/// Nested message and enum types in `CreateJobRequest`.
pub mod create_job_request {
/// Specification for the job.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum JobSpec {
/// Specification for a MapReduce job.
#[prost(message, tag = "3")]
MapreduceJob(super::MapreduceJob),
/// Specification for a Spark job.
#[prost(message, tag = "4")]
SparkJob(super::SparkJob),
/// Specification for a PySpark job.
#[prost(message, tag = "5")]
PysparkJob(super::PysparkJob),
/// Specification for a Hive job.
#[prost(message, tag = "6")]
HiveJob(super::HiveJob),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateJobMetadata {
/// ID of the cluster that the job is being created for.
#[prost(string, tag = "1")]
pub cluster_id: ::prost::alloc::string::String,
/// ID of the job being created.
#[prost(string, tag = "2")]
pub job_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CancelJobRequest {
/// Required. ID of the Yandex Data Processing cluster.
#[prost(string, tag = "1")]
pub cluster_id: ::prost::alloc::string::String,
/// Required. ID of the Yandex Data Processing job to cancel.
#[prost(string, tag = "2")]
pub job_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListJobLogRequest {
/// ID of the cluster that the job is being created for.
#[prost(string, tag = "1")]
pub cluster_id: ::prost::alloc::string::String,
/// ID of the job being created.
#[prost(string, tag = "2")]
pub job_id: ::prost::alloc::string::String,
/// The maximum bytes of job log per response to return. If the number of available
/// bytes is larger than \[page_size\], the service returns a \[ListJobLogResponse.next_page_token\]
/// that can be used to get the next page of output in subsequent list requests.
/// Default value: 1048576.
#[prost(int64, tag = "3")]
pub page_size: i64,
/// Page token. To get the next page of results, set `page_token` to the
/// \[ListJobLogResponse.next_page_token\] returned by a previous list request.
#[prost(string, tag = "4")]
pub page_token: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListJobLogResponse {
/// Requested part of Yandex Data Processing Job log.
#[prost(string, tag = "1")]
pub content: ::prost::alloc::string::String,
/// This token allows you to get the next page of results for ListLog requests,
/// if the number of results is larger than `page_size` specified in the request.
/// To get the next page, specify the value of `next_page_token` as a value for
/// the `page_token` parameter in the next ListLog request. Subsequent ListLog
/// requests will have their own `next_page_token` to continue paging through the results.
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
/// Generated client implementations.
pub mod job_service_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
/// A set of methods for managing Yandex Data Processing jobs.
#[derive(Debug, Clone)]
pub struct JobServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl JobServiceClient<tonic::transport::Channel> {
/// Attempt to create a new client by connecting to a given endpoint.
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> JobServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> JobServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
JobServiceClient::new(InterceptedService::new(inner, interceptor))
}
/// Compress requests with the given encoding.
///
/// This requires the server to support it otherwise it might respond with an
/// error.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
/// Enable decompressing responses.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
/// Limits the maximum size of a decoded message.
///
/// Default: `4MB`
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
/// Limits the maximum size of an encoded message.
///
/// Default: `usize::MAX`
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
/// Retrieves a list of jobs for a cluster.
pub async fn list(
&mut self,
request: impl tonic::IntoRequest<super::ListJobsRequest>,
) -> std::result::Result<
tonic::Response<super::ListJobsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.dataproc.v1.JobService/List",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("yandex.cloud.dataproc.v1.JobService", "List"));
self.inner.unary(req, path, codec).await
}
/// Creates a job for a cluster.
pub async fn create(
&mut self,
request: impl tonic::IntoRequest<super::CreateJobRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::operation::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.dataproc.v1.JobService/Create",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.dataproc.v1.JobService", "Create"),
);
self.inner.unary(req, path, codec).await
}
/// Returns the specified job.
pub async fn get(
&mut self,
request: impl tonic::IntoRequest<super::GetJobRequest>,
) -> std::result::Result<tonic::Response<super::Job>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.dataproc.v1.JobService/Get",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("yandex.cloud.dataproc.v1.JobService", "Get"));
self.inner.unary(req, path, codec).await
}
/// Returns a log for specified job.
pub async fn list_log(
&mut self,
request: impl tonic::IntoRequest<super::ListJobLogRequest>,
) -> std::result::Result<
tonic::Response<super::ListJobLogResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.dataproc.v1.JobService/ListLog",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.dataproc.v1.JobService", "ListLog"),
);
self.inner.unary(req, path, codec).await
}
/// Cancels the specified Yandex Data Processing job.
pub async fn cancel(
&mut self,
request: impl tonic::IntoRequest<super::CancelJobRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::operation::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.dataproc.v1.JobService/Cancel",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.dataproc.v1.JobService", "Cancel"),
);
self.inner.unary(req, path, codec).await
}
}
}
/// A ResourcePreset resource for describing hardware configuration presets.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResourcePreset {
/// ID of the ResourcePreset resource.
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
/// IDs of availability zones where the resource preset is available.
#[prost(string, repeated, tag = "2")]
pub zone_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Number of CPU cores for a Yandex Data Processing host created with the preset.
#[prost(int64, tag = "3")]
pub cores: i64,
/// RAM volume for a Yandex Data Processing host created with the preset, in bytes.
#[prost(int64, tag = "4")]
pub memory: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetResourcePresetRequest {
/// Required. ID of the resource preset to return.
/// To get the resource preset ID, use a \[ResourcePresetService.List\] request.
#[prost(string, tag = "1")]
pub resource_preset_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListResourcePresetsRequest {
/// The maximum number of results per page to return. If the number of available
/// results is larger than \[page_size\], the service returns a \[ListResourcePresetsResponse.next_page_token\]
/// that can be used to get the next page of results in subsequent list requests.
#[prost(int64, tag = "1")]
pub page_size: i64,
/// Page token. To get the next page of results, set \[page_token\] to the \[ListResourcePresetsResponse.next_page_token\]
/// returned by a previous list request.
#[prost(string, tag = "2")]
pub page_token: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListResourcePresetsResponse {
/// List of ResourcePreset resources.
#[prost(message, repeated, tag = "1")]
pub resource_presets: ::prost::alloc::vec::Vec<ResourcePreset>,
/// This token allows you to get the next page of results for list requests. If the number of results
/// is larger than \[ListResourcePresetsRequest.page_size\], use the \[next_page_token\] as the value
/// for the \[ListResourcePresetsRequest.page_token\] parameter in the next list request. Each subsequent
/// list request will have its own \[next_page_token\] to continue paging through the results.
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
/// Generated client implementations.
pub mod resource_preset_service_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
/// A set of methods for managing ResourcePreset resources.
#[derive(Debug, Clone)]
pub struct ResourcePresetServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl ResourcePresetServiceClient<tonic::transport::Channel> {
/// Attempt to create a new client by connecting to a given endpoint.
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> ResourcePresetServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> ResourcePresetServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
ResourcePresetServiceClient::new(InterceptedService::new(inner, interceptor))
}
/// Compress requests with the given encoding.
///
/// This requires the server to support it otherwise it might respond with an
/// error.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
/// Enable decompressing responses.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
/// Limits the maximum size of a decoded message.
///
/// Default: `4MB`
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
/// Limits the maximum size of an encoded message.
///
/// Default: `usize::MAX`
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
/// Returns the specified ResourcePreset resource.
///
/// To get the list of available ResourcePreset resources, make a [List] request.
pub async fn get(
&mut self,
request: impl tonic::IntoRequest<super::GetResourcePresetRequest>,
) -> std::result::Result<tonic::Response<super::ResourcePreset>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.dataproc.v1.ResourcePresetService/Get",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.dataproc.v1.ResourcePresetService",
"Get",
),
);
self.inner.unary(req, path, codec).await
}
/// Retrieves the list of available ResourcePreset resources.
pub async fn list(
&mut self,
request: impl tonic::IntoRequest<super::ListResourcePresetsRequest>,
) -> std::result::Result<
tonic::Response<super::ListResourcePresetsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.dataproc.v1.ResourcePresetService/List",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.dataproc.v1.ResourcePresetService",
"List",
),
);
self.inner.unary(req, path, codec).await
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetSubclusterRequest {
/// ID of the Yandex Data Processing cluster that the subcluster belongs to.
#[prost(string, tag = "1")]
pub cluster_id: ::prost::alloc::string::String,
/// ID of the subcluster to return.
///
/// To get a subcluster ID make a \[SubclusterService.List\] request.
#[prost(string, tag = "2")]
pub subcluster_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListSubclustersRequest {
/// ID of the Yandex Data Processing cluster to list subclusters in.
#[prost(string, tag = "1")]
pub cluster_id: ::prost::alloc::string::String,
/// The maximum number of results per page to return. If the number of available
/// results is larger than \[page_size\], the service returns a \[ListSubclustersResponse.next_page_token\]
/// that can be used to get the next page of results in subsequent list requests.
/// Default value: 100.
#[prost(int64, tag = "2")]
pub page_size: i64,
/// Page token. To get the next page of results, set `page_token` to the
/// \[ListSubclustersResponse.next_page_token\] returned by a previous list request.
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
/// A filter expression that filters subclusters listed in the response.
///
/// The expression must specify:
/// 1. The field name. Currently you can use filtering only on \[Subcluster.name\] field.
/// 2. An `=` operator.
/// 3. The value in double quotes (`"`). Must be 3-63 characters long and match the regular expression `\[a-z][-a-z0-9]{1,61}[a-z0-9\]`.
/// Example of a filter: `name=dataproc123_subcluster456`.
#[prost(string, tag = "4")]
pub filter: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListSubclustersResponse {
/// List of subclusters in the specified cluster.
#[prost(message, repeated, tag = "1")]
pub subclusters: ::prost::alloc::vec::Vec<Subcluster>,
/// Token for getting the next page of the list. If the number of results is greater than
/// the specified \[ListSubclustersRequest.page_size\], use `next_page_token` as the value
/// for the \[ListSubclustersRequest.page_token\] parameter in the next list request.
///
/// Each subsequent page will have its own `next_page_token` to continue paging through the results.
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateSubclusterRequest {
/// ID of the Yandex Data Processing cluster to create a subcluster in.
///
/// To get a cluster ID, make a \[ClusterService.List\] request.
#[prost(string, tag = "1")]
pub cluster_id: ::prost::alloc::string::String,
/// Name of the subcluster. The name must be unique within the cluster. The name can't be
/// changed when the subcluster is created.
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
/// Role that is fulfilled by hosts of the subcluster.
#[prost(enumeration = "Role", tag = "3")]
pub role: i32,
/// Resources allocated for each host in the subcluster.
#[prost(message, optional, tag = "4")]
pub resources: ::core::option::Option<Resources>,
/// ID of the VPC subnet used for hosts in the subcluster.
#[prost(string, tag = "5")]
pub subnet_id: ::prost::alloc::string::String,
/// Number of hosts in the subcluster.
#[prost(int64, tag = "6")]
pub hosts_count: i64,
/// Configuration for instance group based subclusters
#[prost(message, optional, tag = "7")]
pub autoscaling_config: ::core::option::Option<AutoscalingConfig>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateSubclusterMetadata {
/// ID of the cluster that the subcluster is being added to.
#[prost(string, tag = "1")]
pub cluster_id: ::prost::alloc::string::String,
/// ID of the subcluster that is being created.
#[prost(string, tag = "2")]
pub subcluster_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateSubclusterRequest {
/// ID of the cluster to update a subcluster in.
///
/// To get a cluster ID, make a \[ClusterService.List\] request.
#[prost(string, tag = "1")]
pub cluster_id: ::prost::alloc::string::String,
/// ID of the subcluster to update.
///
/// To get a subcluster ID, make a \[SubclusterService.List\] request.
#[prost(string, tag = "2")]
pub subcluster_id: ::prost::alloc::string::String,
/// Field mask that specifies which attributes of the subcluster should be updated.
#[prost(message, optional, tag = "3")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
/// New configuration of resources that should be allocated for each host in the subcluster.
#[prost(message, optional, tag = "4")]
pub resources: ::core::option::Option<Resources>,
/// New name for the subcluster. The name must be unique within the cluster.
#[prost(string, tag = "5")]
pub name: ::prost::alloc::string::String,
/// New number of hosts in the subcluster.
#[prost(int64, tag = "6")]
pub hosts_count: i64,
/// Timeout to gracefully decommission nodes. In seconds. Default value: 0
#[prost(int64, tag = "7")]
pub decommission_timeout: i64,
/// Configuration for instance group based subclusters
#[prost(message, optional, tag = "8")]
pub autoscaling_config: ::core::option::Option<AutoscalingConfig>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateSubclusterMetadata {
/// ID of the cluster whose subcluster is being updated.
#[prost(string, tag = "1")]
pub cluster_id: ::prost::alloc::string::String,
/// ID of the subcluster that is being updated.
#[prost(string, tag = "2")]
pub subcluster_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteSubclusterRequest {
/// ID of the cluster to remove a subcluster from.
///
/// To get a cluster ID, make a \[ClusterService.List\] request.
#[prost(string, tag = "1")]
pub cluster_id: ::prost::alloc::string::String,
/// ID of the subcluster to delete.
#[prost(string, tag = "2")]
pub subcluster_id: ::prost::alloc::string::String,
/// Timeout to gracefully decommission nodes. In seconds. Default value: 0
#[prost(int64, tag = "3")]
pub decommission_timeout: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteSubclusterMetadata {
/// ID of the cluster whose subcluster is being deleted.
#[prost(string, tag = "1")]
pub cluster_id: ::prost::alloc::string::String,
/// ID of the subcluster that is being deleted.
#[prost(string, tag = "2")]
pub subcluster_id: ::prost::alloc::string::String,
}
/// Generated client implementations.
pub mod subcluster_service_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
/// A set of methods for managing Yandex Data Processing subclusters.
#[derive(Debug, Clone)]
pub struct SubclusterServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl SubclusterServiceClient<tonic::transport::Channel> {
/// Attempt to create a new client by connecting to a given endpoint.
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> SubclusterServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> SubclusterServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
SubclusterServiceClient::new(InterceptedService::new(inner, interceptor))
}
/// Compress requests with the given encoding.
///
/// This requires the server to support it otherwise it might respond with an
/// error.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
/// Enable decompressing responses.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
/// Limits the maximum size of a decoded message.
///
/// Default: `4MB`
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
/// Limits the maximum size of an encoded message.
///
/// Default: `usize::MAX`
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
/// Returns the specified subcluster.
///
/// To get the list of all available subclusters, make a [SubclusterService.List] request.
pub async fn get(
&mut self,
request: impl tonic::IntoRequest<super::GetSubclusterRequest>,
) -> std::result::Result<tonic::Response<super::Subcluster>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.dataproc.v1.SubclusterService/Get",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.dataproc.v1.SubclusterService", "Get"),
);
self.inner.unary(req, path, codec).await
}
/// Retrieves a list of subclusters in the specified cluster.
pub async fn list(
&mut self,
request: impl tonic::IntoRequest<super::ListSubclustersRequest>,
) -> std::result::Result<
tonic::Response<super::ListSubclustersResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.dataproc.v1.SubclusterService/List",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.dataproc.v1.SubclusterService", "List"),
);
self.inner.unary(req, path, codec).await
}
/// Creates a subcluster in the specified cluster.
pub async fn create(
&mut self,
request: impl tonic::IntoRequest<super::CreateSubclusterRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::operation::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.dataproc.v1.SubclusterService/Create",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.dataproc.v1.SubclusterService",
"Create",
),
);
self.inner.unary(req, path, codec).await
}
/// Updates the specified subcluster.
pub async fn update(
&mut self,
request: impl tonic::IntoRequest<super::UpdateSubclusterRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::operation::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.dataproc.v1.SubclusterService/Update",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.dataproc.v1.SubclusterService",
"Update",
),
);
self.inner.unary(req, path, codec).await
}
/// Deletes the specified subcluster.
pub async fn delete(
&mut self,
request: impl tonic::IntoRequest<super::DeleteSubclusterRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::operation::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/yandex.cloud.dataproc.v1.SubclusterService/Delete",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.dataproc.v1.SubclusterService",
"Delete",
),
);
self.inner.unary(req, path, codec).await
}
}
}