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
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
// This file is @generated by prost-build.
/// Request message for submitting a Build.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubmitBuildRequest {
/// Required. The project and location to build in. Location must be a region,
/// e.g., 'us-central1' or 'global' if the global builder is to be used.
/// Format:
/// `projects/{project}/locations/{location}`
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// Required. Artifact Registry URI to store the built image.
#[prost(string, tag = "3")]
pub image_uri: ::prost::alloc::string::String,
/// Optional. The service account to use for the build. If not set, the default
/// Cloud Build service account for the project will be used.
#[prost(string, tag = "6")]
pub service_account: ::prost::alloc::string::String,
/// Optional. Name of the Cloud Build Custom Worker Pool that should be used to
/// build the function. The format of this field is
/// `projects/{project}/locations/{region}/workerPools/{workerPool}` where
/// `{project}` and `{region}` are the project id and region respectively where
/// the worker pool is defined and `{workerPool}` is the short name of the
/// worker pool.
#[prost(string, tag = "7")]
pub worker_pool: ::prost::alloc::string::String,
/// Optional. Additional tags to annotate the build.
#[prost(string, repeated, tag = "8")]
pub tags: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Optional. The machine type from default pool to use for the build. If left
/// blank, cloudbuild will use a sensible default. Currently only E2_HIGHCPU_8
/// is supported. If worker_pool is set, this field will be ignored.
#[prost(string, tag = "9")]
pub machine_type: ::prost::alloc::string::String,
/// Optional. The release track of the client that initiated the build request.
#[prost(enumeration = "super::super::super::api::LaunchStage", tag = "10")]
pub release_track: i32,
/// Optional. The client that initiated the build request.
#[prost(string, tag = "11")]
pub client: ::prost::alloc::string::String,
/// Location of source.
#[prost(oneof = "submit_build_request::Source", tags = "2")]
pub source: ::core::option::Option<submit_build_request::Source>,
/// Build type must be one of the following.
#[prost(oneof = "submit_build_request::BuildType", tags = "4, 5")]
pub build_type: ::core::option::Option<submit_build_request::BuildType>,
}
/// Nested message and enum types in `SubmitBuildRequest`.
pub mod submit_build_request {
/// Build the source using Docker. This means the source has a Dockerfile.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DockerBuild {}
/// Build the source using Buildpacks.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BuildpacksBuild {
/// The runtime name, e.g. 'go113'. Leave blank for generic builds.
#[deprecated]
#[prost(string, tag = "1")]
pub runtime: ::prost::alloc::string::String,
/// Optional. Name of the function target if the source is a function source.
/// Required for function builds.
#[prost(string, tag = "2")]
pub function_target: ::prost::alloc::string::String,
/// Optional. cache_image_uri is the GCR/AR URL where the cache image will be
/// stored. cache_image_uri is optional and omitting it will disable caching.
/// This URL must be stable across builds. It is used to derive a
/// build-specific temporary URL by substituting the tag with the build ID.
/// The build will clean up the temporary image on a best-effort basis.
#[prost(string, tag = "3")]
pub cache_image_uri: ::prost::alloc::string::String,
/// Optional. The base image to use for the build.
#[prost(string, tag = "4")]
pub base_image: ::prost::alloc::string::String,
/// Optional. User-provided build-time environment variables.
#[prost(map = "string, string", tag = "5")]
pub environment_variables: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// Optional. Whether or not the application container will be enrolled in
/// automatic base image updates. When true, the application will be built on
/// a scratch base image, so the base layers can be appended at run time.
#[prost(bool, tag = "6")]
pub enable_automatic_updates: bool,
/// Optional. project_descriptor stores the path to the project descriptor
/// file. When empty, it means that there is no project descriptor file in
/// the source.
#[prost(string, tag = "7")]
pub project_descriptor: ::prost::alloc::string::String,
}
/// Location of source.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum Source {
/// Required. Source for the build.
#[prost(message, tag = "2")]
StorageSource(super::StorageSource),
}
/// Build type must be one of the following.
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum BuildType {
/// Build the source using Buildpacks.
#[prost(message, tag = "4")]
BuildpackBuild(BuildpacksBuild),
/// Build the source using Docker. This means the source has a Dockerfile.
#[prost(message, tag = "5")]
DockerBuild(DockerBuild),
}
}
/// Response message for submitting a Build.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubmitBuildResponse {
/// Cloud Build operation to be polled via CloudBuild API.
#[prost(message, optional, tag = "1")]
pub build_operation: ::core::option::Option<
super::super::super::longrunning::Operation,
>,
/// URI of the base builder image in Artifact Registry being used in the build.
/// Used to opt into automatic base image updates.
#[prost(string, tag = "2")]
pub base_image_uri: ::prost::alloc::string::String,
/// Warning message for the base image.
#[prost(string, tag = "3")]
pub base_image_warning: ::prost::alloc::string::String,
}
/// Location of the source in an archive file in Google Cloud Storage.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StorageSource {
/// Required. Google Cloud Storage bucket containing the source (see
/// [Bucket Name
/// Requirements](<https://cloud.google.com/storage/docs/bucket-naming#requirements>)).
#[prost(string, tag = "1")]
pub bucket: ::prost::alloc::string::String,
/// Required. Google Cloud Storage object containing the source.
///
/// This object must be a gzipped archive file (`.tar.gz`) containing source to
/// build.
#[prost(string, tag = "2")]
pub object: ::prost::alloc::string::String,
/// Optional. Google Cloud Storage generation for the object. If the generation
/// is omitted, the latest generation will be used.
#[prost(int64, tag = "3")]
pub generation: i64,
}
/// Generated client implementations.
pub mod builds_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
/// Cloud Run Build Control Plane API
#[derive(Debug, Clone)]
pub struct BuildsClient<T> {
inner: tonic::client::Grpc<T>,
}
impl BuildsClient<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> BuildsClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::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,
) -> BuildsClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
BuildsClient::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
}
/// Submits a build in a given project.
pub async fn submit_build(
&mut self,
request: impl tonic::IntoRequest<super::SubmitBuildRequest>,
) -> std::result::Result<
tonic::Response<super::SubmitBuildResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.run.v2.Builds/SubmitBuild",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("google.cloud.run.v2.Builds", "SubmitBuild"));
self.inner.unary(req, path, codec).await
}
}
}
/// Defines a status condition for a resource.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Condition {
/// type is used to communicate the status of the reconciliation process.
/// See also:
/// <https://github.com/knative/serving/blob/main/docs/spec/errors.md#error-conditions-and-reporting>
/// Types common to all resources include:
///
/// * "Ready": True when the Resource is ready.
#[prost(string, tag = "1")]
pub r#type: ::prost::alloc::string::String,
/// State of the condition.
#[prost(enumeration = "condition::State", tag = "2")]
pub state: i32,
/// Human readable message indicating details about the current status.
#[prost(string, tag = "3")]
pub message: ::prost::alloc::string::String,
/// Last time the condition transitioned from one status to another.
#[prost(message, optional, tag = "4")]
pub last_transition_time: ::core::option::Option<::prost_types::Timestamp>,
/// How to interpret failures of this condition, one of Error, Warning, Info
#[prost(enumeration = "condition::Severity", tag = "5")]
pub severity: i32,
/// The reason for this condition. Depending on the condition type,
/// it will populate one of these fields.
/// Successful conditions cannot have a reason.
#[prost(oneof = "condition::Reasons", tags = "6, 9, 11")]
pub reasons: ::core::option::Option<condition::Reasons>,
}
/// Nested message and enum types in `Condition`.
pub mod condition {
/// Represents the possible Condition states.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum State {
/// The default value. This value is used if the state is omitted.
Unspecified = 0,
/// Transient state: Reconciliation has not started yet.
ConditionPending = 1,
/// Transient state: reconciliation is still in progress.
ConditionReconciling = 2,
/// Terminal state: Reconciliation did not succeed.
ConditionFailed = 3,
/// Terminal state: Reconciliation completed successfully.
ConditionSucceeded = 4,
}
impl State {
/// 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 {
Self::Unspecified => "STATE_UNSPECIFIED",
Self::ConditionPending => "CONDITION_PENDING",
Self::ConditionReconciling => "CONDITION_RECONCILING",
Self::ConditionFailed => "CONDITION_FAILED",
Self::ConditionSucceeded => "CONDITION_SUCCEEDED",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"STATE_UNSPECIFIED" => Some(Self::Unspecified),
"CONDITION_PENDING" => Some(Self::ConditionPending),
"CONDITION_RECONCILING" => Some(Self::ConditionReconciling),
"CONDITION_FAILED" => Some(Self::ConditionFailed),
"CONDITION_SUCCEEDED" => Some(Self::ConditionSucceeded),
_ => None,
}
}
}
/// Represents the severity of the condition failures.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Severity {
/// Unspecified severity
Unspecified = 0,
/// Error severity.
Error = 1,
/// Warning severity.
Warning = 2,
/// Info severity.
Info = 3,
}
impl Severity {
/// 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 {
Self::Unspecified => "SEVERITY_UNSPECIFIED",
Self::Error => "ERROR",
Self::Warning => "WARNING",
Self::Info => "INFO",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SEVERITY_UNSPECIFIED" => Some(Self::Unspecified),
"ERROR" => Some(Self::Error),
"WARNING" => Some(Self::Warning),
"INFO" => Some(Self::Info),
_ => None,
}
}
}
/// Reasons common to all types of conditions.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum CommonReason {
/// Default value.
Undefined = 0,
/// Reason unknown. Further details will be in message.
Unknown = 1,
/// Revision creation process failed.
RevisionFailed = 3,
/// Timed out waiting for completion.
ProgressDeadlineExceeded = 4,
/// The container image path is incorrect.
ContainerMissing = 6,
/// Insufficient permissions on the container image.
ContainerPermissionDenied = 7,
/// Container image is not authorized by policy.
ContainerImageUnauthorized = 8,
/// Container image policy authorization check failed.
ContainerImageAuthorizationCheckFailed = 9,
/// Insufficient permissions on encryption key.
EncryptionKeyPermissionDenied = 10,
/// Permission check on encryption key failed.
EncryptionKeyCheckFailed = 11,
/// At least one Access check on secrets failed.
SecretsAccessCheckFailed = 12,
/// Waiting for operation to complete.
WaitingForOperation = 13,
/// System will retry immediately.
ImmediateRetry = 14,
/// System will retry later; current attempt failed.
PostponedRetry = 15,
/// An internal error occurred. Further information may be in the message.
Internal = 16,
/// User-provided VPC network was not found.
VpcNetworkNotFound = 17,
}
impl CommonReason {
/// 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 {
Self::Undefined => "COMMON_REASON_UNDEFINED",
Self::Unknown => "UNKNOWN",
Self::RevisionFailed => "REVISION_FAILED",
Self::ProgressDeadlineExceeded => "PROGRESS_DEADLINE_EXCEEDED",
Self::ContainerMissing => "CONTAINER_MISSING",
Self::ContainerPermissionDenied => "CONTAINER_PERMISSION_DENIED",
Self::ContainerImageUnauthorized => "CONTAINER_IMAGE_UNAUTHORIZED",
Self::ContainerImageAuthorizationCheckFailed => {
"CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED"
}
Self::EncryptionKeyPermissionDenied => "ENCRYPTION_KEY_PERMISSION_DENIED",
Self::EncryptionKeyCheckFailed => "ENCRYPTION_KEY_CHECK_FAILED",
Self::SecretsAccessCheckFailed => "SECRETS_ACCESS_CHECK_FAILED",
Self::WaitingForOperation => "WAITING_FOR_OPERATION",
Self::ImmediateRetry => "IMMEDIATE_RETRY",
Self::PostponedRetry => "POSTPONED_RETRY",
Self::Internal => "INTERNAL",
Self::VpcNetworkNotFound => "VPC_NETWORK_NOT_FOUND",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"COMMON_REASON_UNDEFINED" => Some(Self::Undefined),
"UNKNOWN" => Some(Self::Unknown),
"REVISION_FAILED" => Some(Self::RevisionFailed),
"PROGRESS_DEADLINE_EXCEEDED" => Some(Self::ProgressDeadlineExceeded),
"CONTAINER_MISSING" => Some(Self::ContainerMissing),
"CONTAINER_PERMISSION_DENIED" => Some(Self::ContainerPermissionDenied),
"CONTAINER_IMAGE_UNAUTHORIZED" => Some(Self::ContainerImageUnauthorized),
"CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED" => {
Some(Self::ContainerImageAuthorizationCheckFailed)
}
"ENCRYPTION_KEY_PERMISSION_DENIED" => {
Some(Self::EncryptionKeyPermissionDenied)
}
"ENCRYPTION_KEY_CHECK_FAILED" => Some(Self::EncryptionKeyCheckFailed),
"SECRETS_ACCESS_CHECK_FAILED" => Some(Self::SecretsAccessCheckFailed),
"WAITING_FOR_OPERATION" => Some(Self::WaitingForOperation),
"IMMEDIATE_RETRY" => Some(Self::ImmediateRetry),
"POSTPONED_RETRY" => Some(Self::PostponedRetry),
"INTERNAL" => Some(Self::Internal),
"VPC_NETWORK_NOT_FOUND" => Some(Self::VpcNetworkNotFound),
_ => None,
}
}
}
/// Reasons specific to Revision resource.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum RevisionReason {
/// Default value.
Undefined = 0,
/// Revision in Pending state.
Pending = 1,
/// Revision is in Reserve state.
Reserve = 2,
/// Revision is Retired.
Retired = 3,
/// Revision is being retired.
Retiring = 4,
/// Revision is being recreated.
Recreating = 5,
/// There was a health check error.
HealthCheckContainerError = 6,
/// Health check failed due to user error from customized path of the
/// container. System will retry.
CustomizedPathResponsePending = 7,
/// A revision with min_instance_count > 0 was created and is reserved, but
/// it was not configured to serve traffic, so it's not live. This can also
/// happen momentarily during traffic migration.
MinInstancesNotProvisioned = 8,
/// The maximum allowed number of active revisions has been reached.
ActiveRevisionLimitReached = 9,
/// There was no deployment defined.
/// This value is no longer used, but Services created in older versions of
/// the API might contain this value.
NoDeployment = 10,
/// A revision's container has no port specified since the revision is of a
/// manually scaled service with 0 instance count
HealthCheckSkipped = 11,
/// A revision with min_instance_count > 0 was created and is waiting for
/// enough instances to begin a traffic migration.
MinInstancesWarming = 12,
}
impl RevisionReason {
/// 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 {
Self::Undefined => "REVISION_REASON_UNDEFINED",
Self::Pending => "PENDING",
Self::Reserve => "RESERVE",
Self::Retired => "RETIRED",
Self::Retiring => "RETIRING",
Self::Recreating => "RECREATING",
Self::HealthCheckContainerError => "HEALTH_CHECK_CONTAINER_ERROR",
Self::CustomizedPathResponsePending => "CUSTOMIZED_PATH_RESPONSE_PENDING",
Self::MinInstancesNotProvisioned => "MIN_INSTANCES_NOT_PROVISIONED",
Self::ActiveRevisionLimitReached => "ACTIVE_REVISION_LIMIT_REACHED",
Self::NoDeployment => "NO_DEPLOYMENT",
Self::HealthCheckSkipped => "HEALTH_CHECK_SKIPPED",
Self::MinInstancesWarming => "MIN_INSTANCES_WARMING",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"REVISION_REASON_UNDEFINED" => Some(Self::Undefined),
"PENDING" => Some(Self::Pending),
"RESERVE" => Some(Self::Reserve),
"RETIRED" => Some(Self::Retired),
"RETIRING" => Some(Self::Retiring),
"RECREATING" => Some(Self::Recreating),
"HEALTH_CHECK_CONTAINER_ERROR" => Some(Self::HealthCheckContainerError),
"CUSTOMIZED_PATH_RESPONSE_PENDING" => {
Some(Self::CustomizedPathResponsePending)
}
"MIN_INSTANCES_NOT_PROVISIONED" => Some(Self::MinInstancesNotProvisioned),
"ACTIVE_REVISION_LIMIT_REACHED" => Some(Self::ActiveRevisionLimitReached),
"NO_DEPLOYMENT" => Some(Self::NoDeployment),
"HEALTH_CHECK_SKIPPED" => Some(Self::HealthCheckSkipped),
"MIN_INSTANCES_WARMING" => Some(Self::MinInstancesWarming),
_ => None,
}
}
}
/// Reasons specific to Execution resource.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum ExecutionReason {
/// Default value.
Undefined = 0,
/// Internal system error getting execution status. System will retry.
JobStatusServicePollingError = 1,
/// A task reached its retry limit and the last attempt failed due to the
/// user container exiting with a non-zero exit code.
NonZeroExitCode = 2,
/// The execution was cancelled by users.
Cancelled = 3,
/// The execution is in the process of being cancelled.
Cancelling = 4,
/// The execution was deleted.
Deleted = 5,
/// A delayed execution is waiting for a start time.
DelayedStartPending = 6,
}
impl ExecutionReason {
/// 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 {
Self::Undefined => "EXECUTION_REASON_UNDEFINED",
Self::JobStatusServicePollingError => "JOB_STATUS_SERVICE_POLLING_ERROR",
Self::NonZeroExitCode => "NON_ZERO_EXIT_CODE",
Self::Cancelled => "CANCELLED",
Self::Cancelling => "CANCELLING",
Self::Deleted => "DELETED",
Self::DelayedStartPending => "DELAYED_START_PENDING",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"EXECUTION_REASON_UNDEFINED" => Some(Self::Undefined),
"JOB_STATUS_SERVICE_POLLING_ERROR" => {
Some(Self::JobStatusServicePollingError)
}
"NON_ZERO_EXIT_CODE" => Some(Self::NonZeroExitCode),
"CANCELLED" => Some(Self::Cancelled),
"CANCELLING" => Some(Self::Cancelling),
"DELETED" => Some(Self::Deleted),
"DELAYED_START_PENDING" => Some(Self::DelayedStartPending),
_ => None,
}
}
}
/// The reason for this condition. Depending on the condition type,
/// it will populate one of these fields.
/// Successful conditions cannot have a reason.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum Reasons {
/// Output only. A common (service-level) reason for this condition.
#[prost(enumeration = "CommonReason", tag = "6")]
Reason(i32),
/// Output only. A reason for the revision condition.
#[prost(enumeration = "RevisionReason", tag = "9")]
RevisionReason(i32),
/// Output only. A reason for the execution condition.
#[prost(enumeration = "ExecutionReason", tag = "11")]
ExecutionReason(i32),
}
}
/// ContainerStatus holds the information of container name and image digest
/// value.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ContainerStatus {
/// The name of the container, if specified.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// ImageDigest holds the resolved digest for the image specified and resolved
/// during the creation of Revision. This field holds the digest value
/// regardless of whether a tag or digest was originally specified in the
/// Container object.
#[prost(string, tag = "2")]
pub image_digest: ::prost::alloc::string::String,
}
/// A single application container.
/// This specifies both the container to run, the command to run in the container
/// and the arguments to supply to it.
/// Note that additional arguments can be supplied by the system to the container
/// at runtime.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Container {
/// Name of the container specified as a DNS_LABEL (RFC 1123).
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Required. Name of the container image in Dockerhub, Google Artifact
/// Registry, or Google Container Registry. If the host is not provided,
/// Dockerhub is assumed.
#[prost(string, tag = "2")]
pub image: ::prost::alloc::string::String,
/// Optional. Location of the source.
#[prost(message, optional, tag = "17")]
pub source_code: ::core::option::Option<SourceCode>,
/// Entrypoint array. Not executed within a shell.
/// The docker image's ENTRYPOINT is used if this is not provided.
#[prost(string, repeated, tag = "3")]
pub command: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Arguments to the entrypoint.
/// The docker image's CMD is used if this is not provided.
#[prost(string, repeated, tag = "4")]
pub args: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// List of environment variables to set in the container.
#[prost(message, repeated, tag = "5")]
pub env: ::prost::alloc::vec::Vec<EnvVar>,
/// Compute Resource requirements by this container.
#[prost(message, optional, tag = "6")]
pub resources: ::core::option::Option<ResourceRequirements>,
/// List of ports to expose from the container. Only a single port can be
/// specified. The specified ports must be listening on all interfaces
/// (0.0.0.0) within the container to be accessible.
///
/// If omitted, a port number will be chosen and passed to the container
/// through the PORT environment variable for the container to listen on.
#[prost(message, repeated, tag = "7")]
pub ports: ::prost::alloc::vec::Vec<ContainerPort>,
/// Volume to mount into the container's filesystem.
#[prost(message, repeated, tag = "8")]
pub volume_mounts: ::prost::alloc::vec::Vec<VolumeMount>,
/// Container's working directory.
/// If not specified, the container runtime's default will be used, which
/// might be configured in the container image.
#[prost(string, tag = "9")]
pub working_dir: ::prost::alloc::string::String,
/// Periodic probe of container liveness.
/// Container will be restarted if the probe fails.
#[prost(message, optional, tag = "10")]
pub liveness_probe: ::core::option::Option<Probe>,
/// Startup probe of application within the container.
/// All other probes are disabled if a startup probe is provided, until it
/// succeeds. Container will not be added to service endpoints if the probe
/// fails.
#[prost(message, optional, tag = "11")]
pub startup_probe: ::core::option::Option<Probe>,
/// Readiness probe to be used for health checks.
#[prost(message, optional, tag = "14")]
pub readiness_probe: ::core::option::Option<Probe>,
/// Names of the containers that must start before this container.
#[prost(string, repeated, tag = "12")]
pub depends_on: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Base image for this container. Only supported for services. If set, it
/// indicates that the service is enrolled into automatic base image update.
#[prost(string, tag = "13")]
pub base_image_uri: ::prost::alloc::string::String,
/// Output only. The build info of the container image.
#[prost(message, optional, tag = "15")]
pub build_info: ::core::option::Option<BuildInfo>,
}
/// ResourceRequirements describes the compute resource requirements.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResourceRequirements {
/// Only `memory`, `cpu` and `nvidia.com/gpu` keys in the map are supported.
///
/// <p>Notes:
/// * The only supported values for CPU are '1', '2', '4', and '8'. Setting 4
/// CPU requires at least 2Gi of memory. For more information, go to
/// <https://cloud.google.com/run/docs/configuring/cpu.>
/// * For supported 'memory' values and syntax, go to
/// <https://cloud.google.com/run/docs/configuring/memory-limits>
/// * The only supported 'nvidia.com/gpu' value is '1'.
#[prost(map = "string, string", tag = "1")]
pub limits: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// Determines whether CPU is only allocated during requests (true by default).
/// However, if ResourceRequirements is set, the caller must explicitly
/// set this field to true to preserve the default behavior.
#[prost(bool, tag = "2")]
pub cpu_idle: bool,
/// Determines whether CPU should be boosted on startup of a new container
/// instance above the requested CPU threshold, this can help reduce cold-start
/// latency.
#[prost(bool, tag = "3")]
pub startup_cpu_boost: bool,
}
/// EnvVar represents an environment variable present in a Container.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct EnvVar {
/// Required. Name of the environment variable. Must not exceed 32768
/// characters.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(oneof = "env_var::Values", tags = "2, 3")]
pub values: ::core::option::Option<env_var::Values>,
}
/// Nested message and enum types in `EnvVar`.
pub mod env_var {
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum Values {
/// Literal value of the environment variable.
/// Defaults to "", and the maximum length is 32768 bytes.
/// Variable references are not supported in Cloud Run.
#[prost(string, tag = "2")]
Value(::prost::alloc::string::String),
/// Source for the environment variable's value.
#[prost(message, tag = "3")]
ValueSource(super::EnvVarSource),
}
}
/// EnvVarSource represents a source for the value of an EnvVar.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct EnvVarSource {
/// Selects a secret and a specific version from Cloud Secret Manager.
#[prost(message, optional, tag = "1")]
pub secret_key_ref: ::core::option::Option<SecretKeySelector>,
}
/// SecretEnvVarSource represents a source for the value of an EnvVar.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SecretKeySelector {
/// Required. The name of the secret in Cloud Secret Manager.
/// Format: {secret_name} if the secret is in the same project.
/// projects/{project}/secrets/{secret_name} if the secret is
/// in a different project.
#[prost(string, tag = "1")]
pub secret: ::prost::alloc::string::String,
/// The Cloud Secret Manager secret version.
/// Can be 'latest' for the latest version, an integer for a specific version,
/// or a version alias.
#[prost(string, tag = "2")]
pub version: ::prost::alloc::string::String,
}
/// ContainerPort represents a network port in a single container.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ContainerPort {
/// If specified, used to specify which protocol to use.
/// Allowed values are "http1" and "h2c".
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Port number the container listens on.
/// This must be a valid TCP port number, 0 \< container_port \< 65536.
#[prost(int32, tag = "3")]
pub container_port: i32,
}
/// VolumeMount describes a mounting of a Volume within a container.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct VolumeMount {
/// Required. This must match the Name of a Volume.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Required. Path within the container at which the volume should be mounted.
/// Must not contain ':'. For Cloud SQL volumes, it can be left empty, or must
/// otherwise be `/cloudsql`. All instances defined in the Volume will be
/// available as `/cloudsql/\[instance\]`. For more information on Cloud SQL
/// volumes, visit <https://cloud.google.com/sql/docs/mysql/connect-run>
#[prost(string, tag = "3")]
pub mount_path: ::prost::alloc::string::String,
/// Optional. Path within the volume from which the container's volume should
/// be mounted. Defaults to "" (volume's root).
#[prost(string, tag = "4")]
pub sub_path: ::prost::alloc::string::String,
}
/// Volume represents a named volume in a container.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Volume {
/// Required. Volume's name.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(oneof = "volume::VolumeType", tags = "2, 3, 4, 5, 6")]
pub volume_type: ::core::option::Option<volume::VolumeType>,
}
/// Nested message and enum types in `Volume`.
pub mod volume {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum VolumeType {
/// Secret represents a secret that should populate this volume.
#[prost(message, tag = "2")]
Secret(super::SecretVolumeSource),
/// For Cloud SQL volumes, contains the specific instances that should be
/// mounted. Visit <https://cloud.google.com/sql/docs/mysql/connect-run> for
/// more information on how to connect Cloud SQL and Cloud Run.
#[prost(message, tag = "3")]
CloudSqlInstance(super::CloudSqlInstance),
/// Ephemeral storage used as a shared volume.
#[prost(message, tag = "4")]
EmptyDir(super::EmptyDirVolumeSource),
/// For NFS Voumes, contains the path to the nfs Volume
#[prost(message, tag = "5")]
Nfs(super::NfsVolumeSource),
/// Persistent storage backed by a Google Cloud Storage bucket.
#[prost(message, tag = "6")]
Gcs(super::GcsVolumeSource),
}
}
/// The secret's value will be presented as the content of a file whose
/// name is defined in the item path. If no items are defined, the name of
/// the file is the secret.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SecretVolumeSource {
/// Required. The name of the secret in Cloud Secret Manager.
/// Format: {secret} if the secret is in the same project.
/// projects/{project}/secrets/{secret} if the secret is
/// in a different project.
#[prost(string, tag = "1")]
pub secret: ::prost::alloc::string::String,
/// If unspecified, the volume will expose a file whose name is the
/// secret, relative to VolumeMount.mount_path + VolumeMount.sub_path.
/// If specified, the key will be used as the version to fetch from Cloud
/// Secret Manager and the path will be the name of the file exposed in the
/// volume. When items are defined, they must specify a path and a version.
#[prost(message, repeated, tag = "2")]
pub items: ::prost::alloc::vec::Vec<VersionToPath>,
/// Integer representation of mode bits to use on created files by default.
/// Must be a value between 0000 and 0777 (octal), defaulting to 0444.
/// Directories within the path are not affected by this setting.
///
/// Notes
///
/// * Internally, a umask of 0222 will be applied to any non-zero value.
/// * This is an integer representation of the mode bits. So, the octal
/// integer value should look exactly as the chmod numeric notation with a
/// leading zero. Some examples: for chmod 640 (u=rw,g=r), set to 0640 (octal)
/// or 416 (base-10). For chmod 755 (u=rwx,g=rx,o=rx), set to 0755 (octal) or
/// 493 (base-10).
/// * This might be in conflict with other options that affect the
/// file mode, like fsGroup, and the result can be other mode bits set.
///
/// This might be in conflict with other options that affect the
/// file mode, like fsGroup, and as a result, other mode bits could be set.
#[prost(int32, tag = "3")]
pub default_mode: i32,
}
/// VersionToPath maps a specific version of a secret to a relative file to mount
/// to, relative to VolumeMount's mount_path.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct VersionToPath {
/// Required. The relative path of the secret in the container.
#[prost(string, tag = "1")]
pub path: ::prost::alloc::string::String,
/// The Cloud Secret Manager secret version.
/// Can be 'latest' for the latest value, or an integer or a secret alias for a
/// specific version.
#[prost(string, tag = "2")]
pub version: ::prost::alloc::string::String,
/// Integer octal mode bits to use on this file, must be a value between
/// 01 and 0777 (octal). If 0 or not set, the Volume's default mode will be
/// used.
///
/// Notes
///
/// * Internally, a umask of 0222 will be applied to any non-zero value.
/// * This is an integer representation of the mode bits. So, the octal
/// integer value should look exactly as the chmod numeric notation with a
/// leading zero. Some examples: for chmod 640 (u=rw,g=r), set to 0640 (octal)
/// or 416 (base-10). For chmod 755 (u=rwx,g=rx,o=rx), set to 0755 (octal) or
/// 493 (base-10).
/// * This might be in conflict with other options that affect the
/// file mode, like fsGroup, and the result can be other mode bits set.
#[prost(int32, tag = "3")]
pub mode: i32,
}
/// Represents a set of Cloud SQL instances. Each one will be available under
/// /cloudsql/\[instance\]. Visit
/// <https://cloud.google.com/sql/docs/mysql/connect-run> for more information on
/// how to connect Cloud SQL and Cloud Run.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CloudSqlInstance {
/// The Cloud SQL instance connection names, as can be found in
/// <https://console.cloud.google.com/sql/instances.> Visit
/// <https://cloud.google.com/sql/docs/mysql/connect-run> for more information on
/// how to connect Cloud SQL and Cloud Run. Format:
/// {project}:{location}:{instance}
#[prost(string, repeated, tag = "1")]
pub instances: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// In memory (tmpfs) ephemeral storage.
/// It is ephemeral in the sense that when the sandbox is taken down, the data is
/// destroyed with it (it does not persist across sandbox runs).
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct EmptyDirVolumeSource {
/// The medium on which the data is stored. Acceptable values today is only
/// MEMORY or none. When none, the default will currently be backed by memory
/// but could change over time. +optional
#[prost(enumeration = "empty_dir_volume_source::Medium", tag = "1")]
pub medium: i32,
/// Limit on the storage usable by this EmptyDir volume.
/// The size limit is also applicable for memory medium.
/// The maximum usage on memory medium EmptyDir would be the minimum value
/// between the SizeLimit specified here and the sum of memory limits of all
/// containers. The default is nil which means that the limit is undefined.
/// More info:
/// <https://cloud.google.com/run/docs/configuring/in-memory-volumes#configure-volume.>
/// Info in Kubernetes:
/// <https://kubernetes.io/docs/concepts/storage/volumes/#emptydir>
#[prost(string, tag = "2")]
pub size_limit: ::prost::alloc::string::String,
}
/// Nested message and enum types in `EmptyDirVolumeSource`.
pub mod empty_dir_volume_source {
/// The different types of medium supported for EmptyDir.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Medium {
/// When not specified, falls back to the default implementation which
/// is currently in memory (this may change over time).
Unspecified = 0,
/// Explicitly set the EmptyDir to be in memory. Uses tmpfs.
Memory = 1,
}
impl Medium {
/// 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 {
Self::Unspecified => "MEDIUM_UNSPECIFIED",
Self::Memory => "MEMORY",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"MEDIUM_UNSPECIFIED" => Some(Self::Unspecified),
"MEMORY" => Some(Self::Memory),
_ => None,
}
}
}
}
/// Represents an NFS mount.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct NfsVolumeSource {
/// Hostname or IP address of the NFS server
#[prost(string, tag = "1")]
pub server: ::prost::alloc::string::String,
/// Path that is exported by the NFS server.
#[prost(string, tag = "2")]
pub path: ::prost::alloc::string::String,
/// If true, the volume will be mounted as read only for all mounts.
#[prost(bool, tag = "3")]
pub read_only: bool,
}
/// Represents a volume backed by a Cloud Storage bucket using Cloud Storage
/// FUSE.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GcsVolumeSource {
/// Cloud Storage Bucket name.
#[prost(string, tag = "1")]
pub bucket: ::prost::alloc::string::String,
/// If true, the volume will be mounted as read only for all mounts.
#[prost(bool, tag = "2")]
pub read_only: bool,
/// A list of additional flags to pass to the gcsfuse CLI.
/// Options should be specified without the leading "--".
#[prost(string, repeated, tag = "3")]
pub mount_options: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Probe describes a health check to be performed against a container to
/// determine whether it is alive or ready to receive traffic.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Probe {
/// Optional. Number of seconds after the container has started before the
/// probe is initiated. Defaults to 0 seconds. Minimum value is 0. Maximum
/// value for liveness probe is 3600. Maximum value for startup probe is 240.
#[prost(int32, tag = "1")]
pub initial_delay_seconds: i32,
/// Optional. Number of seconds after which the probe times out.
/// Defaults to 1 second. Minimum value is 1. Maximum value is 3600.
/// Must be smaller than period_seconds.
#[prost(int32, tag = "2")]
pub timeout_seconds: i32,
/// Optional. How often (in seconds) to perform the probe.
/// Default to 10 seconds. Minimum value is 1. Maximum value for liveness probe
/// is 3600. Maximum value for startup probe is 240.
/// Must be greater or equal than timeout_seconds.
#[prost(int32, tag = "3")]
pub period_seconds: i32,
/// Optional. Minimum consecutive failures for the probe to be considered
/// failed after having succeeded. Defaults to 3. Minimum value is 1.
#[prost(int32, tag = "4")]
pub failure_threshold: i32,
#[prost(oneof = "probe::ProbeType", tags = "5, 6, 7")]
pub probe_type: ::core::option::Option<probe::ProbeType>,
}
/// Nested message and enum types in `Probe`.
pub mod probe {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum ProbeType {
/// Optional. HTTPGet specifies the http request to perform.
/// Exactly one of httpGet, tcpSocket, or grpc must be specified.
#[prost(message, tag = "5")]
HttpGet(super::HttpGetAction),
/// Optional. TCPSocket specifies an action involving a TCP port.
/// Exactly one of httpGet, tcpSocket, or grpc must be specified.
#[prost(message, tag = "6")]
TcpSocket(super::TcpSocketAction),
/// Optional. GRPC specifies an action involving a gRPC port.
/// Exactly one of httpGet, tcpSocket, or grpc must be specified.
#[prost(message, tag = "7")]
Grpc(super::GrpcAction),
}
}
/// HTTPGetAction describes an action based on HTTP Get requests.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HttpGetAction {
/// Optional. Path to access on the HTTP server. Defaults to '/'.
#[prost(string, tag = "1")]
pub path: ::prost::alloc::string::String,
/// Optional. Custom headers to set in the request. HTTP allows repeated
/// headers.
#[prost(message, repeated, tag = "4")]
pub http_headers: ::prost::alloc::vec::Vec<HttpHeader>,
/// Optional. Port number to access on the container. Must be in the range 1 to
/// 65535. If not specified, defaults to the exposed port of the container,
/// which is the value of container.ports\[0\].containerPort.
#[prost(int32, tag = "5")]
pub port: i32,
}
/// HTTPHeader describes a custom header to be used in HTTP probes
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct HttpHeader {
/// Required. The header field name
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Optional. The header field value
#[prost(string, tag = "2")]
pub value: ::prost::alloc::string::String,
}
/// TCPSocketAction describes an action based on opening a socket
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct TcpSocketAction {
/// Optional. Port number to access on the container. Must be in the range 1 to
/// 65535. If not specified, defaults to the exposed port of the container,
/// which is the value of container.ports\[0\].containerPort.
#[prost(int32, tag = "1")]
pub port: i32,
}
/// GRPCAction describes an action involving a GRPC port.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GrpcAction {
/// Optional. Port number of the gRPC service. Number must be in the range 1 to
/// 65535. If not specified, defaults to the exposed port of the container,
/// which is the value of container.ports\[0\].containerPort.
#[prost(int32, tag = "1")]
pub port: i32,
/// Optional. Service is the name of the service to place in the gRPC
/// HealthCheckRequest (see
/// <https://github.com/grpc/grpc/blob/master/doc/health-checking.md> ). If this
/// is not specified, the default behavior is defined by gRPC.
#[prost(string, tag = "2")]
pub service: ::prost::alloc::string::String,
}
/// Build information of the image.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct BuildInfo {
/// Output only. Entry point of the function when the image is a Cloud Run
/// function.
#[prost(string, tag = "1")]
pub function_target: ::prost::alloc::string::String,
/// Output only. Source code location of the image.
#[prost(string, tag = "2")]
pub source_location: ::prost::alloc::string::String,
}
/// Source type for the container.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SourceCode {
/// The source type.
#[prost(oneof = "source_code::SourceType", tags = "1")]
pub source_type: ::core::option::Option<source_code::SourceType>,
}
/// Nested message and enum types in `SourceCode`.
pub mod source_code {
/// Cloud Storage source.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CloudStorageSource {
/// Required. The Cloud Storage bucket name.
#[prost(string, tag = "1")]
pub bucket: ::prost::alloc::string::String,
/// Required. The Cloud Storage object name.
#[prost(string, tag = "2")]
pub object: ::prost::alloc::string::String,
/// Optional. The Cloud Storage object generation.
#[prost(int64, tag = "3")]
pub generation: i64,
}
/// The source type.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum SourceType {
/// The source is a Cloud Storage bucket.
#[prost(message, tag = "1")]
CloudStorageSource(CloudStorageSource),
}
}
/// VPC Access settings. For more information on sending traffic to a VPC
/// network, visit <https://cloud.google.com/run/docs/configuring/connecting-vpc.>
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VpcAccess {
/// VPC Access connector name.
/// Format: `projects/{project}/locations/{location}/connectors/{connector}`,
/// where `{project}` can be project id or number.
/// For more information on sending traffic to a VPC network via a connector,
/// visit <https://cloud.google.com/run/docs/configuring/vpc-connectors.>
#[prost(string, tag = "1")]
pub connector: ::prost::alloc::string::String,
/// Optional. Traffic VPC egress settings. If not provided, it defaults to
/// PRIVATE_RANGES_ONLY.
#[prost(enumeration = "vpc_access::VpcEgress", tag = "2")]
pub egress: i32,
/// Optional. Direct VPC egress settings. Currently only single network
/// interface is supported.
#[prost(message, repeated, tag = "3")]
pub network_interfaces: ::prost::alloc::vec::Vec<vpc_access::NetworkInterface>,
}
/// Nested message and enum types in `VpcAccess`.
pub mod vpc_access {
/// Direct VPC egress settings.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct NetworkInterface {
/// Optional. The VPC network that the Cloud Run resource will be able to
/// send traffic to. At least one of network or subnetwork must be specified.
/// If both network and subnetwork are specified, the given VPC subnetwork
/// must belong to the given VPC network. If network is not specified, it
/// will be looked up from the subnetwork.
#[prost(string, tag = "1")]
pub network: ::prost::alloc::string::String,
/// Optional. The VPC subnetwork that the Cloud Run resource will get IPs
/// from. At least one of network or subnetwork must be specified. If both
/// network and subnetwork are specified, the given VPC subnetwork must
/// belong to the given VPC network. If subnetwork is not specified, the
/// subnetwork with the same name with the network will be used.
#[prost(string, tag = "2")]
pub subnetwork: ::prost::alloc::string::String,
/// Optional. Network tags applied to this Cloud Run resource.
#[prost(string, repeated, tag = "3")]
pub tags: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Egress options for VPC access.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum VpcEgress {
/// Unspecified
Unspecified = 0,
/// All outbound traffic is routed through the VPC connector.
AllTraffic = 1,
/// Only private IP ranges are routed through the VPC connector.
PrivateRangesOnly = 2,
}
impl VpcEgress {
/// 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 {
Self::Unspecified => "VPC_EGRESS_UNSPECIFIED",
Self::AllTraffic => "ALL_TRAFFIC",
Self::PrivateRangesOnly => "PRIVATE_RANGES_ONLY",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"VPC_EGRESS_UNSPECIFIED" => Some(Self::Unspecified),
"ALL_TRAFFIC" => Some(Self::AllTraffic),
"PRIVATE_RANGES_ONLY" => Some(Self::PrivateRangesOnly),
_ => None,
}
}
}
}
/// Settings for Binary Authorization feature.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct BinaryAuthorization {
/// Optional. If present, indicates to use Breakglass using this justification.
/// If use_default is False, then it must be empty.
/// For more information on breakglass, see
/// <https://cloud.google.com/binary-authorization/docs/using-breakglass>
#[prost(string, tag = "2")]
pub breakglass_justification: ::prost::alloc::string::String,
#[prost(oneof = "binary_authorization::BinauthzMethod", tags = "1, 3")]
pub binauthz_method: ::core::option::Option<binary_authorization::BinauthzMethod>,
}
/// Nested message and enum types in `BinaryAuthorization`.
pub mod binary_authorization {
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum BinauthzMethod {
/// Optional. If True, indicates to use the default project's binary
/// authorization policy. If False, binary authorization will be disabled.
#[prost(bool, tag = "1")]
UseDefault(bool),
/// Optional. The path to a binary authorization policy.
/// Format: `projects/{project}/platforms/cloudRun/{policy-name}`
#[prost(string, tag = "3")]
Policy(::prost::alloc::string::String),
}
}
/// Settings for revision-level scaling settings.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RevisionScaling {
/// Optional. Minimum number of serving instances that this resource should
/// have.
#[prost(int32, tag = "1")]
pub min_instance_count: i32,
/// Optional. Maximum number of serving instances that this resource should
/// have. When unspecified, the field is set to the server default value of
/// 100. For more information see
/// <https://cloud.google.com/run/docs/configuring/max-instances>
#[prost(int32, tag = "2")]
pub max_instance_count: i32,
}
/// Settings for Cloud Service Mesh. For more information see
/// <https://cloud.google.com/service-mesh/docs/overview.>
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ServiceMesh {
/// The Mesh resource name. Format:
/// `projects/{project}/locations/global/meshes/{mesh}`, where `{project}` can
/// be project id or number.
#[prost(string, tag = "1")]
pub mesh: ::prost::alloc::string::String,
}
/// Scaling settings applied at the service level rather than
/// at the revision level.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ServiceScaling {
/// Optional. total min instances for the service. This number of instances is
/// divided among all revisions with specified traffic based on the percent
/// of traffic they are receiving.
#[prost(int32, tag = "1")]
pub min_instance_count: i32,
/// Optional. The scaling mode for the service.
#[prost(enumeration = "service_scaling::ScalingMode", tag = "3")]
pub scaling_mode: i32,
/// Optional. total max instances for the service. This number of instances is
/// divided among all revisions with specified traffic based on the percent
/// of traffic they are receiving.
#[prost(int32, tag = "4")]
pub max_instance_count: i32,
/// Optional. total instance count for the service in manual scaling mode. This
/// number of instances is divided among all revisions with specified traffic
/// based on the percent of traffic they are receiving.
#[prost(int32, optional, tag = "6")]
pub manual_instance_count: ::core::option::Option<i32>,
}
/// Nested message and enum types in `ServiceScaling`.
pub mod service_scaling {
/// The scaling mode for the service. If not provided, it defaults to
/// AUTOMATIC.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum ScalingMode {
/// Unspecified.
Unspecified = 0,
/// Scale based on traffic between min and max instances.
Automatic = 1,
/// Scale to exactly min instances and ignore max instances.
Manual = 2,
}
impl ScalingMode {
/// 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 {
Self::Unspecified => "SCALING_MODE_UNSPECIFIED",
Self::Automatic => "AUTOMATIC",
Self::Manual => "MANUAL",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SCALING_MODE_UNSPECIFIED" => Some(Self::Unspecified),
"AUTOMATIC" => Some(Self::Automatic),
"MANUAL" => Some(Self::Manual),
_ => None,
}
}
}
}
/// Worker pool scaling settings.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct WorkerPoolScaling {
/// Optional. The total number of instances in manual scaling mode.
#[prost(int32, optional, tag = "6")]
pub manual_instance_count: ::core::option::Option<i32>,
}
/// Hardware constraints configuration.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct NodeSelector {
/// Required. GPU accelerator type to attach to an instance.
#[prost(string, tag = "1")]
pub accelerator: ::prost::alloc::string::String,
}
/// Describes the Build step of the function that builds a container from the
/// given source.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BuildConfig {
/// Output only. The Cloud Build name of the latest successful deployment of
/// the function.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// The Cloud Storage bucket URI where the function source code is located.
#[prost(string, tag = "2")]
pub source_location: ::prost::alloc::string::String,
/// Optional. The name of the function (as defined in source code) that will be
/// executed. Defaults to the resource name suffix, if not specified. For
/// backward compatibility, if function with given name is not found, then the
/// system will try to use function named "function".
#[prost(string, tag = "3")]
pub function_target: ::prost::alloc::string::String,
/// Optional. Artifact Registry URI to store the built image.
#[prost(string, tag = "4")]
pub image_uri: ::prost::alloc::string::String,
/// Optional. The base image used to build the function.
#[prost(string, tag = "5")]
pub base_image: ::prost::alloc::string::String,
/// Optional. Sets whether the function will receive automatic base image
/// updates.
#[prost(bool, tag = "6")]
pub enable_automatic_updates: bool,
/// Optional. Name of the Cloud Build Custom Worker Pool that should be used to
/// build the Cloud Run function. The format of this field is
/// `projects/{project}/locations/{region}/workerPools/{workerPool}` where
/// `{project}` and `{region}` are the project id and region respectively where
/// the worker pool is defined and `{workerPool}` is the short name of the
/// worker pool.
#[prost(string, tag = "7")]
pub worker_pool: ::prost::alloc::string::String,
/// Optional. User-provided build-time environment variables for the function
#[prost(map = "string, string", tag = "8")]
pub environment_variables: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// Optional. Service account to be used for building the container. The format
/// of this field is
/// `projects/{projectId}/serviceAccounts/{serviceAccountEmail}`.
#[prost(string, tag = "9")]
pub service_account: ::prost::alloc::string::String,
}
/// Allowed ingress traffic for the Container.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum IngressTraffic {
/// Unspecified
Unspecified = 0,
/// All inbound traffic is allowed.
All = 1,
/// Only internal traffic is allowed.
InternalOnly = 2,
/// Both internal and Google Cloud Load Balancer traffic is allowed.
InternalLoadBalancer = 3,
/// No ingress traffic is allowed.
None = 4,
}
impl IngressTraffic {
/// 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 {
Self::Unspecified => "INGRESS_TRAFFIC_UNSPECIFIED",
Self::All => "INGRESS_TRAFFIC_ALL",
Self::InternalOnly => "INGRESS_TRAFFIC_INTERNAL_ONLY",
Self::InternalLoadBalancer => "INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER",
Self::None => "INGRESS_TRAFFIC_NONE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"INGRESS_TRAFFIC_UNSPECIFIED" => Some(Self::Unspecified),
"INGRESS_TRAFFIC_ALL" => Some(Self::All),
"INGRESS_TRAFFIC_INTERNAL_ONLY" => Some(Self::InternalOnly),
"INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER" => Some(Self::InternalLoadBalancer),
"INGRESS_TRAFFIC_NONE" => Some(Self::None),
_ => None,
}
}
}
/// Alternatives for execution environments.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ExecutionEnvironment {
/// Unspecified
Unspecified = 0,
/// Uses the First Generation environment.
Gen1 = 1,
/// Uses Second Generation environment.
Gen2 = 2,
}
impl ExecutionEnvironment {
/// 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 {
Self::Unspecified => "EXECUTION_ENVIRONMENT_UNSPECIFIED",
Self::Gen1 => "EXECUTION_ENVIRONMENT_GEN1",
Self::Gen2 => "EXECUTION_ENVIRONMENT_GEN2",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"EXECUTION_ENVIRONMENT_UNSPECIFIED" => Some(Self::Unspecified),
"EXECUTION_ENVIRONMENT_GEN1" => Some(Self::Gen1),
"EXECUTION_ENVIRONMENT_GEN2" => Some(Self::Gen2),
_ => None,
}
}
}
/// Specifies behavior if an encryption key used by a resource is revoked.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum EncryptionKeyRevocationAction {
/// Unspecified
Unspecified = 0,
/// Prevents the creation of new instances.
PreventNew = 1,
/// Shuts down existing instances, and prevents creation of new ones.
Shutdown = 2,
}
impl EncryptionKeyRevocationAction {
/// 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 {
Self::Unspecified => "ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED",
Self::PreventNew => "PREVENT_NEW",
Self::Shutdown => "SHUTDOWN",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED" => Some(Self::Unspecified),
"PREVENT_NEW" => Some(Self::PreventNew),
"SHUTDOWN" => Some(Self::Shutdown),
_ => None,
}
}
}
/// TaskTemplate describes the data a task should have when created
/// from a template.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TaskTemplate {
/// Holds the single container that defines the unit of execution for this
/// task.
#[prost(message, repeated, tag = "1")]
pub containers: ::prost::alloc::vec::Vec<Container>,
/// Optional. A list of Volumes to make available to containers.
#[prost(message, repeated, tag = "2")]
pub volumes: ::prost::alloc::vec::Vec<Volume>,
/// Optional. Max allowed time duration the Task may be active before the
/// system will actively try to mark it failed and kill associated containers.
/// This applies per attempt of a task, meaning each retry can run for the full
/// timeout. Defaults to 600 seconds.
#[prost(message, optional, tag = "4")]
pub timeout: ::core::option::Option<::prost_types::Duration>,
/// Optional. Email address of the IAM service account associated with the Task
/// of a Job. The service account represents the identity of the running task,
/// and determines what permissions the task has. If not provided, the task
/// will use the project's default service account.
#[prost(string, tag = "5")]
pub service_account: ::prost::alloc::string::String,
/// Optional. The execution environment being used to host this Task.
#[prost(enumeration = "ExecutionEnvironment", tag = "6")]
pub execution_environment: i32,
/// A reference to a customer managed encryption key (CMEK) to use to encrypt
/// this container image. For more information, go to
/// <https://cloud.google.com/run/docs/securing/using-cmek>
#[prost(string, tag = "7")]
pub encryption_key: ::prost::alloc::string::String,
/// Optional. VPC Access configuration to use for this Task. For more
/// information, visit
/// <https://cloud.google.com/run/docs/configuring/connecting-vpc.>
#[prost(message, optional, tag = "8")]
pub vpc_access: ::core::option::Option<VpcAccess>,
/// Optional. The node selector for the task template.
#[prost(message, optional, tag = "11")]
pub node_selector: ::core::option::Option<NodeSelector>,
/// Optional. True if GPU zonal redundancy is disabled on this task template.
#[prost(bool, optional, tag = "12")]
pub gpu_zonal_redundancy_disabled: ::core::option::Option<bool>,
#[prost(oneof = "task_template::Retries", tags = "3")]
pub retries: ::core::option::Option<task_template::Retries>,
}
/// Nested message and enum types in `TaskTemplate`.
pub mod task_template {
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum Retries {
/// Number of retries allowed per Task, before marking this Task failed.
/// Defaults to 3.
#[prost(int32, tag = "3")]
MaxRetries(i32),
}
}
/// Request message for obtaining a Execution by its full name.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetExecutionRequest {
/// Required. The full name of the Execution.
/// Format:
/// `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`,
/// where `{project}` can be project id or number.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// Request message for retrieving a list of Executions.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListExecutionsRequest {
/// Required. The Execution from which the Executions should be listed.
/// To list all Executions across Jobs, use "-" instead of Job name.
/// Format: `projects/{project}/locations/{location}/jobs/{job}`, where
/// `{project}` can be project id or number.
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// Maximum number of Executions to return in this call.
#[prost(int32, tag = "2")]
pub page_size: i32,
/// A page token received from a previous call to ListExecutions.
/// All other parameters must match.
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
/// If true, returns deleted (but unexpired) resources along with active ones.
#[prost(bool, tag = "4")]
pub show_deleted: bool,
}
/// Response message containing a list of Executions.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListExecutionsResponse {
/// The resulting list of Executions.
#[prost(message, repeated, tag = "1")]
pub executions: ::prost::alloc::vec::Vec<Execution>,
/// A token indicating there are more items than page_size. Use it in the next
/// ListExecutions request to continue.
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
/// Request message for deleting an Execution.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteExecutionRequest {
/// Required. The name of the Execution to delete.
/// Format:
/// `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`,
/// where `{project}` can be project id or number.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Indicates that the request should be validated without actually
/// deleting any resources.
#[prost(bool, tag = "2")]
pub validate_only: bool,
/// A system-generated fingerprint for this version of the resource.
/// This may be used to detect modification conflict during updates.
#[prost(string, tag = "3")]
pub etag: ::prost::alloc::string::String,
}
/// Request message for deleting an Execution.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CancelExecutionRequest {
/// Required. The name of the Execution to cancel.
/// Format:
/// `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`,
/// where `{project}` can be project id or number.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Indicates that the request should be validated without actually
/// cancelling any resources.
#[prost(bool, tag = "2")]
pub validate_only: bool,
/// A system-generated fingerprint for this version of the resource.
/// This may be used to detect modification conflict during updates.
#[prost(string, tag = "3")]
pub etag: ::prost::alloc::string::String,
}
/// Execution represents the configuration of a single execution. A execution an
/// immutable resource that references a container image which is run to
/// completion.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Execution {
/// Output only. The unique name of this Execution.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Output only. Server assigned unique identifier for the Execution. The value
/// is a UUID4 string and guaranteed to remain unchanged until the resource is
/// deleted.
#[prost(string, tag = "2")]
pub uid: ::prost::alloc::string::String,
/// Output only. Email address of the authenticated creator.
#[prost(string, tag = "32")]
pub creator: ::prost::alloc::string::String,
/// Output only. A number that monotonically increases every time the user
/// modifies the desired state.
#[prost(int64, tag = "3")]
pub generation: i64,
/// Output only. Unstructured key value map that can be used to organize and
/// categorize objects. User-provided labels are shared with Google's billing
/// system, so they can be used to filter, or break down billing charges by
/// team, component, environment, state, etc. For more information, visit
/// <https://cloud.google.com/resource-manager/docs/creating-managing-labels> or
/// <https://cloud.google.com/run/docs/configuring/labels>
#[prost(map = "string, string", tag = "4")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// Output only. Unstructured key value map that may
/// be set by external tools to store and arbitrary metadata.
/// They are not queryable and should be preserved
/// when modifying objects.
#[prost(map = "string, string", tag = "5")]
pub annotations: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// Output only. Represents time when the execution was acknowledged by the
/// execution controller. It is not guaranteed to be set in happens-before
/// order across separate operations.
#[prost(message, optional, tag = "6")]
pub create_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. Represents time when the execution started to run.
/// It is not guaranteed to be set in happens-before order across separate
/// operations.
#[prost(message, optional, tag = "22")]
pub start_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. Represents time when the execution was completed. It is not
/// guaranteed to be set in happens-before order across separate operations.
#[prost(message, optional, tag = "7")]
pub completion_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. The last-modified time.
#[prost(message, optional, tag = "8")]
pub update_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. For a deleted resource, the deletion time. It is only
/// populated as a response to a Delete request.
#[prost(message, optional, tag = "9")]
pub delete_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. For a deleted resource, the time after which it will be
/// permamently deleted. It is only populated as a response to a Delete
/// request.
#[prost(message, optional, tag = "10")]
pub expire_time: ::core::option::Option<::prost_types::Timestamp>,
/// The least stable launch stage needed to create this resource, as defined by
/// [Google Cloud Platform Launch
/// Stages](<https://cloud.google.com/terms/launch-stages>). Cloud Run supports
/// `ALPHA`, `BETA`, and `GA`.
///
/// Note that this value might not be what was used
/// as input. For example, if ALPHA was provided as input in the parent
/// resource, but only BETA and GA-level features are were, this field will be
/// BETA.
#[prost(enumeration = "super::super::super::api::LaunchStage", tag = "11")]
pub launch_stage: i32,
/// Output only. The name of the parent Job.
#[prost(string, tag = "12")]
pub job: ::prost::alloc::string::String,
/// Output only. Specifies the maximum desired number of tasks the execution
/// should run at any given time. Must be \<= task_count. The actual number of
/// tasks running in steady state will be less than this number when
/// ((.spec.task_count - .status.successful) \< .spec.parallelism), i.e. when
/// the work left to do is less than max parallelism.
#[prost(int32, tag = "13")]
pub parallelism: i32,
/// Output only. Specifies the desired number of tasks the execution should
/// run. Setting to 1 means that parallelism is limited to 1 and the success of
/// that task signals the success of the execution.
#[prost(int32, tag = "14")]
pub task_count: i32,
/// Output only. The template used to create tasks for this execution.
#[prost(message, optional, tag = "15")]
pub template: ::core::option::Option<TaskTemplate>,
/// Output only. Indicates whether the resource's reconciliation is still in
/// progress. See comments in `Job.reconciling` for additional information on
/// reconciliation process in Cloud Run.
#[prost(bool, tag = "16")]
pub reconciling: bool,
/// Output only. The Condition of this Execution, containing its readiness
/// status, and detailed error information in case it did not reach the desired
/// state.
#[prost(message, repeated, tag = "17")]
pub conditions: ::prost::alloc::vec::Vec<Condition>,
/// Output only. The generation of this Execution. See comments in
/// `reconciling` for additional information on reconciliation process in Cloud
/// Run.
#[prost(int64, tag = "18")]
pub observed_generation: i64,
/// Output only. The number of actively running tasks.
#[prost(int32, tag = "19")]
pub running_count: i32,
/// Output only. The number of tasks which reached phase Succeeded.
#[prost(int32, tag = "20")]
pub succeeded_count: i32,
/// Output only. The number of tasks which reached phase Failed.
#[prost(int32, tag = "21")]
pub failed_count: i32,
/// Output only. The number of tasks which reached phase Cancelled.
#[prost(int32, tag = "24")]
pub cancelled_count: i32,
/// Output only. The number of tasks which have retried at least once.
#[prost(int32, tag = "25")]
pub retried_count: i32,
/// Output only. URI where logs for this execution can be found in Cloud
/// Console.
#[prost(string, tag = "26")]
pub log_uri: ::prost::alloc::string::String,
/// Output only. Reserved for future use.
#[prost(bool, tag = "27")]
pub satisfies_pzs: bool,
/// Output only. A system-generated fingerprint for this version of the
/// resource. May be used to detect modification conflict during updates.
#[prost(string, tag = "99")]
pub etag: ::prost::alloc::string::String,
}
/// Generated client implementations.
pub mod executions_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
/// Cloud Run Execution Control Plane API.
#[derive(Debug, Clone)]
pub struct ExecutionsClient<T> {
inner: tonic::client::Grpc<T>,
}
impl ExecutionsClient<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> ExecutionsClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::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,
) -> ExecutionsClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
ExecutionsClient::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
}
/// Gets information about an Execution.
pub async fn get_execution(
&mut self,
request: impl tonic::IntoRequest<super::GetExecutionRequest>,
) -> std::result::Result<tonic::Response<super::Execution>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.run.v2.Executions/GetExecution",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("google.cloud.run.v2.Executions", "GetExecution"),
);
self.inner.unary(req, path, codec).await
}
/// Lists Executions from a Job. Results are sorted by creation time,
/// descending.
pub async fn list_executions(
&mut self,
request: impl tonic::IntoRequest<super::ListExecutionsRequest>,
) -> std::result::Result<
tonic::Response<super::ListExecutionsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.run.v2.Executions/ListExecutions",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("google.cloud.run.v2.Executions", "ListExecutions"),
);
self.inner.unary(req, path, codec).await
}
/// Deletes an Execution.
pub async fn delete_execution(
&mut self,
request: impl tonic::IntoRequest<super::DeleteExecutionRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.run.v2.Executions/DeleteExecution",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("google.cloud.run.v2.Executions", "DeleteExecution"),
);
self.inner.unary(req, path, codec).await
}
/// Cancels an Execution.
pub async fn cancel_execution(
&mut self,
request: impl tonic::IntoRequest<super::CancelExecutionRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.run.v2.Executions/CancelExecution",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("google.cloud.run.v2.Executions", "CancelExecution"),
);
self.inner.unary(req, path, codec).await
}
}
}
/// ExecutionTemplate describes the data an execution should have when created
/// from a template.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecutionTemplate {
/// Unstructured key value map that can be used to organize and categorize
/// objects.
/// User-provided labels are shared with Google's billing system, so they can
/// be used to filter, or break down billing charges by team, component,
/// environment, state, etc. For more information, visit
/// <https://cloud.google.com/resource-manager/docs/creating-managing-labels> or
/// <https://cloud.google.com/run/docs/configuring/labels.>
///
/// <p>Cloud Run API v2 does not support labels with `run.googleapis.com`,
/// `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev`
/// namespaces, and they will be rejected. All system labels in v1 now have a
/// corresponding field in v2 ExecutionTemplate.
#[prost(map = "string, string", tag = "1")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// Unstructured key value map that may be set by external tools to store and
/// arbitrary metadata. They are not queryable and should be preserved
/// when modifying objects.
///
/// <p>Cloud Run API v2 does not support annotations with `run.googleapis.com`,
/// `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev`
/// namespaces, and they will be rejected. All system annotations in v1 now
/// have a corresponding field in v2 ExecutionTemplate.
///
/// <p>This field follows Kubernetes annotations' namespacing, limits, and
/// rules.
#[prost(map = "string, string", tag = "2")]
pub annotations: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// Optional. Specifies the maximum desired number of tasks the execution
/// should run at given time. When the job is run, if this field is 0 or unset,
/// the maximum possible value will be used for that execution. The actual
/// number of tasks running in steady state will be less than this number when
/// there are fewer tasks waiting to be completed remaining, i.e. when the work
/// left to do is less than max parallelism.
#[prost(int32, tag = "3")]
pub parallelism: i32,
/// Specifies the desired number of tasks the execution should run.
/// Setting to 1 means that parallelism is limited to 1 and the success of
/// that task signals the success of the execution. Defaults to 1.
#[prost(int32, tag = "4")]
pub task_count: i32,
/// Required. Describes the task(s) that will be created when executing an
/// execution.
#[prost(message, optional, tag = "5")]
pub template: ::core::option::Option<TaskTemplate>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateInstanceRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub instance: ::core::option::Option<Instance>,
/// Required. The unique identifier for the Instance. It must begin with
/// letter, and cannot end with hyphen; must contain fewer than 50 characters.
/// The name of the instance becomes {parent}/instances/{instance_id}.
#[prost(string, tag = "3")]
pub instance_id: ::prost::alloc::string::String,
/// Optional. Indicates that the request should be validated and default values
/// populated, without persisting the request or creating any resources.
#[prost(bool, tag = "4")]
pub validate_only: bool,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetInstanceRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteInstanceRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Optional. Indicates that the request should be validated without actually
/// deleting any resources.
#[prost(bool, tag = "2")]
pub validate_only: bool,
/// Optional. A system-generated fingerprint for this version of the
/// resource. May be used to detect modification conflict during updates.
#[prost(string, tag = "3")]
pub etag: ::prost::alloc::string::String,
}
/// Request message for retrieving a list of Instances.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListInstancesRequest {
/// Required. The location and project to list resources on.
/// Format: projects/{project}/locations/{location}, where {project} can be
/// project id or number.
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// Optional. Maximum number of Instances to return in this call.
#[prost(int32, tag = "2")]
pub page_size: i32,
/// Optional. A page token received from a previous call to ListInstances.
/// All other parameters must match.
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
/// Optional. If true, returns deleted (but unexpired) resources along with
/// active ones.
#[prost(bool, tag = "4")]
pub show_deleted: bool,
}
/// Response message containing a list of Instances.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListInstancesResponse {
/// The resulting list of Instances.
#[prost(message, repeated, tag = "1")]
pub instances: ::prost::alloc::vec::Vec<Instance>,
/// A token indicating there are more items than page_size. Use it in the next
/// ListInstances request to continue.
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
/// Request message for deleting an Instance.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StopInstanceRequest {
/// Required. The name of the Instance to stop.
/// Format:
/// `projects/{project}/locations/{location}/instances/{instance}`,
/// where `{project}` can be project id or number.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Optional. Indicates that the request should be validated without actually
/// stopping any resources.
#[prost(bool, tag = "2")]
pub validate_only: bool,
/// Optional. A system-generated fingerprint for this version of the resource.
/// This may be used to detect modification conflict during updates.
#[prost(string, tag = "3")]
pub etag: ::prost::alloc::string::String,
}
/// Request message for starting an Instance.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StartInstanceRequest {
/// Required. The name of the Instance to stop.
/// Format:
/// `projects/{project}/locations/{location}/instances/{instance}`,
/// where `{project}` can be project id or number.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Optional. Indicates that the request should be validated without actually
/// stopping any resources.
#[prost(bool, tag = "2")]
pub validate_only: bool,
/// Optional. A system-generated fingerprint for this version of the resource.
/// This may be used to detect modification conflict during updates.
#[prost(string, tag = "3")]
pub etag: ::prost::alloc::string::String,
}
/// A Cloud Run Instance represents a single group of containers running in a
/// region.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Instance {
/// The fully qualified name of this Instance. In CreateInstanceRequest, this
/// field is ignored, and instead composed from CreateInstanceRequest.parent
/// and CreateInstanceRequest.instance_id.
///
/// Format:
/// projects/{project}/locations/{location}/instances/{instance_id}
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// User-provided description of the Instance. This field currently has a
/// 512-character limit.
#[prost(string, tag = "3")]
pub description: ::prost::alloc::string::String,
/// Output only. Server assigned unique identifier for the trigger. The value
/// is a UUID4 string and guaranteed to remain unchanged until the resource is
/// deleted.
#[prost(string, tag = "4")]
pub uid: ::prost::alloc::string::String,
/// Output only. A number that monotonically increases every time the user
/// modifies the desired state.
/// Please note that unlike v1, this is an int64 value. As with most Google
/// APIs, its JSON representation will be a `string` instead of an `integer`.
#[prost(int64, tag = "5")]
pub generation: i64,
#[prost(map = "string, string", tag = "6")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(map = "string, string", tag = "7")]
pub annotations: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// Output only. The creation time.
#[prost(message, optional, tag = "8")]
pub create_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. The last-modified time.
#[prost(message, optional, tag = "9")]
pub update_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. The deletion time.
#[prost(message, optional, tag = "10")]
pub delete_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. For a deleted resource, the time after which it will be
/// permamently deleted.
#[prost(message, optional, tag = "11")]
pub expire_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. Email address of the authenticated creator.
#[prost(string, tag = "12")]
pub creator: ::prost::alloc::string::String,
/// Output only. Email address of the last authenticated modifier.
#[prost(string, tag = "13")]
pub last_modifier: ::prost::alloc::string::String,
/// Arbitrary identifier for the API client.
#[prost(string, tag = "14")]
pub client: ::prost::alloc::string::String,
/// Arbitrary version identifier for the API client.
#[prost(string, tag = "15")]
pub client_version: ::prost::alloc::string::String,
/// The launch stage as defined by [Google Cloud Platform
/// Launch Stages](<https://cloud.google.com/terms/launch-stages>).
/// Cloud Run supports `ALPHA`, `BETA`, and `GA`. If no value is specified, GA
/// is assumed.
/// Set the launch stage to a preview stage on input to allow use of preview
/// features in that stage. On read (or output), describes whether the
/// resource uses preview features.
///
/// <p>
/// For example, if ALPHA is provided as input, but only BETA and GA-level
/// features are used, this field will be BETA on output.
#[prost(enumeration = "super::super::super::api::LaunchStage", tag = "16")]
pub launch_stage: i32,
/// Settings for the Binary Authorization feature.
#[prost(message, optional, tag = "17")]
pub binary_authorization: ::core::option::Option<BinaryAuthorization>,
/// Optional. VPC Access configuration to use for this Revision. For more
/// information, visit
/// <https://cloud.google.com/run/docs/configuring/connecting-vpc.>
#[prost(message, optional, tag = "18")]
pub vpc_access: ::core::option::Option<VpcAccess>,
#[prost(string, tag = "19")]
pub service_account: ::prost::alloc::string::String,
/// Required. Holds the single container that defines the unit of execution for
/// this Instance.
#[prost(message, repeated, tag = "20")]
pub containers: ::prost::alloc::vec::Vec<Container>,
/// A list of Volumes to make available to containers.
#[prost(message, repeated, tag = "21")]
pub volumes: ::prost::alloc::vec::Vec<Volume>,
/// A reference to a customer managed encryption key (CMEK) to use to encrypt
/// this container image. For more information, go to
/// <https://cloud.google.com/run/docs/securing/using-cmek>
#[prost(string, tag = "22")]
pub encryption_key: ::prost::alloc::string::String,
/// The action to take if the encryption key is revoked.
#[prost(enumeration = "EncryptionKeyRevocationAction", tag = "24")]
pub encryption_key_revocation_action: i32,
/// If encryption_key_revocation_action is SHUTDOWN, the duration before
/// shutting down all instances. The minimum increment is 1 hour.
#[prost(message, optional, tag = "25")]
pub encryption_key_shutdown_duration: ::core::option::Option<
::prost_types::Duration,
>,
/// Optional. The node selector for the instance.
#[prost(message, optional, tag = "26")]
pub node_selector: ::core::option::Option<NodeSelector>,
/// Optional. True if GPU zonal redundancy is disabled on this instance.
#[prost(bool, optional, tag = "27")]
pub gpu_zonal_redundancy_disabled: ::core::option::Option<bool>,
/// Optional. Provides the ingress settings for this Instance. On output,
/// returns the currently observed ingress settings, or
/// INGRESS_TRAFFIC_UNSPECIFIED if no revision is active.
#[prost(enumeration = "IngressTraffic", tag = "28")]
pub ingress: i32,
/// Optional. Disables IAM permission check for run.routes.invoke for callers
/// of this Instance. For more information, visit
/// <https://cloud.google.com/run/docs/securing/managing-access#invoker_check.>
#[prost(bool, tag = "29")]
pub invoker_iam_disabled: bool,
/// Optional. IAP settings on the Instance.
#[prost(bool, tag = "30")]
pub iap_enabled: bool,
/// Output only. The generation of this Instance currently serving traffic. See
/// comments in `reconciling` for additional information on reconciliation
/// process in Cloud Run. Please note that unlike v1, this is an int64 value.
/// As with most Google APIs, its JSON representation will be a `string`
/// instead of an `integer`.
#[prost(int64, tag = "40")]
pub observed_generation: i64,
/// Output only. The Google Console URI to obtain logs for the Instance.
#[prost(string, tag = "41")]
pub log_uri: ::prost::alloc::string::String,
/// Output only. The Condition of this Instance, containing its readiness
/// status, and detailed error information in case it did not reach a serving
/// state. See comments in `reconciling` for additional information on
/// reconciliation process in Cloud Run.
#[prost(message, optional, tag = "42")]
pub terminal_condition: ::core::option::Option<Condition>,
/// Output only. The Conditions of all other associated sub-resources. They
/// contain additional diagnostics information in case the Instance does not
/// reach its Serving state. See comments in `reconciling` for additional
/// information on reconciliation process in Cloud Run.
#[prost(message, repeated, tag = "43")]
pub conditions: ::prost::alloc::vec::Vec<Condition>,
/// Output only. Status information for each of the specified containers. The
/// status includes the resolved digest for specified images.
#[prost(message, repeated, tag = "44")]
pub container_statuses: ::prost::alloc::vec::Vec<ContainerStatus>,
/// Output only. Reserved for future use.
#[prost(bool, tag = "46")]
pub satisfies_pzs: bool,
/// Output only. All URLs serving traffic for this Instance.
#[prost(string, repeated, tag = "45")]
pub urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Output only. Returns true if the Instance is currently being acted upon by
/// the system to bring it into the desired state.
///
/// When a new Instance is created, or an existing one is updated, Cloud Run
/// will asynchronously perform all necessary steps to bring the Instance to
/// the desired serving state. This process is called reconciliation. While
/// reconciliation is in process, `observed_generation` will have a transient
/// value that might mismatch the intended state.
/// Once reconciliation is over (and this field is false), there are two
/// possible outcomes: reconciliation succeeded and the serving state matches
/// the Instance, or there was an error, and reconciliation failed. This state
/// can be found in `terminal_condition.state`.
#[prost(bool, tag = "98")]
pub reconciling: bool,
/// Optional. A system-generated fingerprint for this version of the
/// resource. May be used to detect modification conflict during updates.
#[prost(string, tag = "99")]
pub etag: ::prost::alloc::string::String,
}
/// Generated client implementations.
pub mod instances_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
/// The Cloud Run Instances API allows you to manage Cloud Run Instances.
#[derive(Debug, Clone)]
pub struct InstancesClient<T> {
inner: tonic::client::Grpc<T>,
}
impl InstancesClient<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> InstancesClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::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,
) -> InstancesClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
InstancesClient::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
}
/// Creates an Instance.
pub async fn create_instance(
&mut self,
request: impl tonic::IntoRequest<super::CreateInstanceRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.run.v2.Instances/CreateInstance",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("google.cloud.run.v2.Instances", "CreateInstance"),
);
self.inner.unary(req, path, codec).await
}
/// Deletes a Instance
pub async fn delete_instance(
&mut self,
request: impl tonic::IntoRequest<super::DeleteInstanceRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.run.v2.Instances/DeleteInstance",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("google.cloud.run.v2.Instances", "DeleteInstance"),
);
self.inner.unary(req, path, codec).await
}
/// Gets a Instance
pub async fn get_instance(
&mut self,
request: impl tonic::IntoRequest<super::GetInstanceRequest>,
) -> std::result::Result<tonic::Response<super::Instance>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.run.v2.Instances/GetInstance",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("google.cloud.run.v2.Instances", "GetInstance"));
self.inner.unary(req, path, codec).await
}
/// Lists Instances. Results are sorted by creation time, descending.
pub async fn list_instances(
&mut self,
request: impl tonic::IntoRequest<super::ListInstancesRequest>,
) -> std::result::Result<
tonic::Response<super::ListInstancesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.run.v2.Instances/ListInstances",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("google.cloud.run.v2.Instances", "ListInstances"),
);
self.inner.unary(req, path, codec).await
}
/// Stops an Instance.
pub async fn stop_instance(
&mut self,
request: impl tonic::IntoRequest<super::StopInstanceRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.run.v2.Instances/StopInstance",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("google.cloud.run.v2.Instances", "StopInstance"),
);
self.inner.unary(req, path, codec).await
}
/// Starts an Instance.
pub async fn start_instance(
&mut self,
request: impl tonic::IntoRequest<super::StartInstanceRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.run.v2.Instances/StartInstance",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("google.cloud.run.v2.Instances", "StartInstance"),
);
self.inner.unary(req, path, codec).await
}
}
}
/// Holds a single instance split entry for the Worker. Allocations can be done
/// to a specific Revision name, or pointing to the latest Ready Revision.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct InstanceSplit {
/// The allocation type for this instance split.
#[prost(enumeration = "InstanceSplitAllocationType", tag = "1")]
pub r#type: i32,
/// Revision to which to assign this portion of instances, if split allocation
/// is by revision.
#[prost(string, tag = "2")]
pub revision: ::prost::alloc::string::String,
/// Specifies percent of the instance split to this Revision.
/// This defaults to zero if unspecified.
#[prost(int32, tag = "3")]
pub percent: i32,
}
/// Represents the observed state of a single `InstanceSplit` entry.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct InstanceSplitStatus {
/// The allocation type for this instance split.
#[prost(enumeration = "InstanceSplitAllocationType", tag = "1")]
pub r#type: i32,
/// Revision to which this instance split is assigned.
#[prost(string, tag = "2")]
pub revision: ::prost::alloc::string::String,
/// Specifies percent of the instance split to this Revision.
#[prost(int32, tag = "3")]
pub percent: i32,
}
/// The type of instance split allocation.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum InstanceSplitAllocationType {
/// Unspecified instance allocation type.
Unspecified = 0,
/// Allocates instances to the Service's latest ready Revision.
Latest = 1,
/// Allocates instances to a Revision by name.
Revision = 2,
}
impl InstanceSplitAllocationType {
/// 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 {
Self::Unspecified => "INSTANCE_SPLIT_ALLOCATION_TYPE_UNSPECIFIED",
Self::Latest => "INSTANCE_SPLIT_ALLOCATION_TYPE_LATEST",
Self::Revision => "INSTANCE_SPLIT_ALLOCATION_TYPE_REVISION",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"INSTANCE_SPLIT_ALLOCATION_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"INSTANCE_SPLIT_ALLOCATION_TYPE_LATEST" => Some(Self::Latest),
"INSTANCE_SPLIT_ALLOCATION_TYPE_REVISION" => Some(Self::Revision),
_ => None,
}
}
}
/// Request message for creating a Job.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateJobRequest {
/// Required. The location and project in which this Job should be created.
/// Format: projects/{project}/locations/{location}, where {project} can be
/// project id or number.
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// Required. The Job instance to create.
#[prost(message, optional, tag = "2")]
pub job: ::core::option::Option<Job>,
/// Required. The unique identifier for the Job. The name of the job becomes
/// {parent}/jobs/{job_id}.
#[prost(string, tag = "3")]
pub job_id: ::prost::alloc::string::String,
/// Indicates that the request should be validated and default values
/// populated, without persisting the request or creating any resources.
#[prost(bool, tag = "4")]
pub validate_only: bool,
}
/// Request message for obtaining a Job by its full name.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetJobRequest {
/// Required. The full name of the Job.
/// Format: projects/{project}/locations/{location}/jobs/{job}, where {project}
/// can be project id or number.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// Request message for updating a Job.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateJobRequest {
/// Required. The Job to be updated.
#[prost(message, optional, tag = "1")]
pub job: ::core::option::Option<Job>,
/// Indicates that the request should be validated and default values
/// populated, without persisting the request or updating any resources.
#[prost(bool, tag = "3")]
pub validate_only: bool,
/// Optional. If set to true, and if the Job does not exist, it will create a
/// new one. Caller must have both create and update permissions for this call
/// if this is set to true.
#[prost(bool, tag = "4")]
pub allow_missing: bool,
}
/// Request message for retrieving a list of Jobs.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListJobsRequest {
/// Required. The location and project to list resources on.
/// Format: projects/{project}/locations/{location}, where {project} can be
/// project id or number.
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// Maximum number of Jobs to return in this call.
#[prost(int32, tag = "2")]
pub page_size: i32,
/// A page token received from a previous call to ListJobs.
/// All other parameters must match.
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
/// If true, returns deleted (but unexpired) resources along with active ones.
#[prost(bool, tag = "4")]
pub show_deleted: bool,
}
/// Response message containing a list of Jobs.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListJobsResponse {
/// The resulting list of Jobs.
#[prost(message, repeated, tag = "1")]
pub jobs: ::prost::alloc::vec::Vec<Job>,
/// A token indicating there are more items than page_size. Use it in the next
/// ListJobs request to continue.
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
/// Request message to delete a Job by its full name.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteJobRequest {
/// Required. The full name of the Job.
/// Format: projects/{project}/locations/{location}/jobs/{job}, where {project}
/// can be project id or number.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Indicates that the request should be validated without actually
/// deleting any resources.
#[prost(bool, tag = "3")]
pub validate_only: bool,
/// A system-generated fingerprint for this version of the
/// resource. May be used to detect modification conflict during updates.
#[prost(string, tag = "4")]
pub etag: ::prost::alloc::string::String,
}
/// Request message to create a new Execution of a Job.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RunJobRequest {
/// Required. The full name of the Job.
/// Format: projects/{project}/locations/{location}/jobs/{job}, where {project}
/// can be project id or number.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Indicates that the request should be validated without actually
/// deleting any resources.
#[prost(bool, tag = "2")]
pub validate_only: bool,
/// A system-generated fingerprint for this version of the
/// resource. May be used to detect modification conflict during updates.
#[prost(string, tag = "3")]
pub etag: ::prost::alloc::string::String,
/// Overrides specification for a given execution of a job. If provided,
/// overrides will be applied to update the execution or task spec.
#[prost(message, optional, tag = "4")]
pub overrides: ::core::option::Option<run_job_request::Overrides>,
}
/// Nested message and enum types in `RunJobRequest`.
pub mod run_job_request {
/// RunJob Overrides that contains Execution fields to be overridden.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Overrides {
/// Per container override specification.
#[prost(message, repeated, tag = "1")]
pub container_overrides: ::prost::alloc::vec::Vec<overrides::ContainerOverride>,
/// Optional. The desired number of tasks the execution should run. Will
/// replace existing task_count value.
#[prost(int32, tag = "2")]
pub task_count: i32,
/// Duration in seconds the task may be active before the system will
/// actively try to mark it failed and kill associated containers. Will
/// replace existing timeout_seconds value.
#[prost(message, optional, tag = "4")]
pub timeout: ::core::option::Option<::prost_types::Duration>,
}
/// Nested message and enum types in `Overrides`.
pub mod overrides {
/// Per-container override specification.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ContainerOverride {
/// The name of the container specified as a DNS_LABEL.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Optional. Arguments to the entrypoint. Will replace existing args for
/// override.
#[prost(string, repeated, tag = "2")]
pub args: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// List of environment variables to set in the container. Will be merged
/// with existing env for override.
#[prost(message, repeated, tag = "3")]
pub env: ::prost::alloc::vec::Vec<super::super::EnvVar>,
/// Optional. True if the intention is to clear out existing args list.
#[prost(bool, tag = "4")]
pub clear_args: bool,
}
}
}
/// Job represents the configuration of a single job, which references a
/// container image that is run to completion.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Job {
/// The fully qualified name of this Job.
///
/// Format:
/// projects/{project}/locations/{location}/jobs/{job}
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Output only. Server assigned unique identifier for the Execution. The value
/// is a UUID4 string and guaranteed to remain unchanged until the resource is
/// deleted.
#[prost(string, tag = "2")]
pub uid: ::prost::alloc::string::String,
/// Output only. A number that monotonically increases every time the user
/// modifies the desired state.
#[prost(int64, tag = "3")]
pub generation: i64,
/// Unstructured key value map that can be used to organize and categorize
/// objects.
/// User-provided labels are shared with Google's billing system, so they can
/// be used to filter, or break down billing charges by team, component,
/// environment, state, etc. For more information, visit
/// <https://cloud.google.com/resource-manager/docs/creating-managing-labels> or
/// <https://cloud.google.com/run/docs/configuring/labels.>
///
/// <p>Cloud Run API v2 does not support labels with `run.googleapis.com`,
/// `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev`
/// namespaces, and they will be rejected. All system labels in v1 now have a
/// corresponding field in v2 Job.
#[prost(map = "string, string", tag = "4")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// Unstructured key value map that may
/// be set by external tools to store and arbitrary metadata.
/// They are not queryable and should be preserved
/// when modifying objects.
///
/// <p>Cloud Run API v2 does not support annotations with `run.googleapis.com`,
/// `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev`
/// namespaces, and they will be rejected on new resources. All system
/// annotations in v1 now have a corresponding field in v2 Job.
///
/// <p>This field follows Kubernetes annotations' namespacing, limits, and
/// rules.
#[prost(map = "string, string", tag = "5")]
pub annotations: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// Output only. The creation time.
#[prost(message, optional, tag = "6")]
pub create_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. The last-modified time.
#[prost(message, optional, tag = "7")]
pub update_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. The deletion time. It is only populated as a response to a
/// Delete request.
#[prost(message, optional, tag = "8")]
pub delete_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. For a deleted resource, the time after which it will be
/// permamently deleted.
#[prost(message, optional, tag = "9")]
pub expire_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. Email address of the authenticated creator.
#[prost(string, tag = "10")]
pub creator: ::prost::alloc::string::String,
/// Output only. Email address of the last authenticated modifier.
#[prost(string, tag = "11")]
pub last_modifier: ::prost::alloc::string::String,
/// Arbitrary identifier for the API client.
#[prost(string, tag = "12")]
pub client: ::prost::alloc::string::String,
/// Arbitrary version identifier for the API client.
#[prost(string, tag = "13")]
pub client_version: ::prost::alloc::string::String,
/// The launch stage as defined by [Google Cloud Platform
/// Launch Stages](<https://cloud.google.com/terms/launch-stages>).
/// Cloud Run supports `ALPHA`, `BETA`, and `GA`. If no value is specified, GA
/// is assumed.
/// Set the launch stage to a preview stage on input to allow use of preview
/// features in that stage. On read (or output), describes whether the resource
/// uses preview features.
///
/// For example, if ALPHA is provided as input, but only BETA and GA-level
/// features are used, this field will be BETA on output.
#[prost(enumeration = "super::super::super::api::LaunchStage", tag = "14")]
pub launch_stage: i32,
/// Settings for the Binary Authorization feature.
#[prost(message, optional, tag = "15")]
pub binary_authorization: ::core::option::Option<BinaryAuthorization>,
/// Required. The template used to create executions for this Job.
#[prost(message, optional, tag = "16")]
pub template: ::core::option::Option<ExecutionTemplate>,
/// Output only. The generation of this Job. See comments in `reconciling` for
/// additional information on reconciliation process in Cloud Run.
#[prost(int64, tag = "17")]
pub observed_generation: i64,
/// Output only. The Condition of this Job, containing its readiness status,
/// and detailed error information in case it did not reach the desired state.
#[prost(message, optional, tag = "18")]
pub terminal_condition: ::core::option::Option<Condition>,
/// Output only. The Conditions of all other associated sub-resources. They
/// contain additional diagnostics information in case the Job does not reach
/// its desired state. See comments in `reconciling` for additional information
/// on reconciliation process in Cloud Run.
#[prost(message, repeated, tag = "19")]
pub conditions: ::prost::alloc::vec::Vec<Condition>,
/// Output only. Number of executions created for this job.
#[prost(int32, tag = "20")]
pub execution_count: i32,
/// Output only. Name of the last created execution.
#[prost(message, optional, tag = "22")]
pub latest_created_execution: ::core::option::Option<ExecutionReference>,
/// Output only. Returns true if the Job is currently being acted upon by the
/// system to bring it into the desired state.
///
/// When a new Job is created, or an existing one is updated, Cloud Run
/// will asynchronously perform all necessary steps to bring the Job to the
/// desired state. This process is called reconciliation.
/// While reconciliation is in process, `observed_generation` and
/// `latest_succeeded_execution`, will have transient values that might
/// mismatch the intended state: Once reconciliation is over (and this field is
/// false), there are two possible outcomes: reconciliation succeeded and the
/// state matches the Job, or there was an error, and reconciliation failed.
/// This state can be found in `terminal_condition.state`.
///
/// If reconciliation succeeded, the following fields will match:
/// `observed_generation` and `generation`, `latest_succeeded_execution` and
/// `latest_created_execution`.
///
/// If reconciliation failed, `observed_generation` and
/// `latest_succeeded_execution` will have the state of the last succeeded
/// execution or empty for newly created Job. Additional information on the
/// failure can be found in `terminal_condition` and `conditions`.
#[prost(bool, tag = "23")]
pub reconciling: bool,
/// Output only. Reserved for future use.
#[prost(bool, tag = "25")]
pub satisfies_pzs: bool,
/// Optional. A system-generated fingerprint for this version of the
/// resource. May be used to detect modification conflict during updates.
#[prost(string, tag = "99")]
pub etag: ::prost::alloc::string::String,
#[prost(oneof = "job::CreateExecution", tags = "26, 27")]
pub create_execution: ::core::option::Option<job::CreateExecution>,
}
/// Nested message and enum types in `Job`.
pub mod job {
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum CreateExecution {
/// A unique string used as a suffix creating a new execution. The Job will
/// become ready when the execution is successfully started.
/// The sum of job name and token length must be fewer than 63 characters.
#[prost(string, tag = "26")]
StartExecutionToken(::prost::alloc::string::String),
/// A unique string used as a suffix for creating a new execution. The Job
/// will become ready when the execution is successfully completed.
/// The sum of job name and token length must be fewer than 63 characters.
#[prost(string, tag = "27")]
RunExecutionToken(::prost::alloc::string::String),
}
}
/// Reference to an Execution. Use /Executions.GetExecution with the given name
/// to get full execution including the latest status.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ExecutionReference {
/// Name of the execution.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Creation timestamp of the execution.
#[prost(message, optional, tag = "2")]
pub create_time: ::core::option::Option<::prost_types::Timestamp>,
/// Creation timestamp of the execution.
#[prost(message, optional, tag = "3")]
pub completion_time: ::core::option::Option<::prost_types::Timestamp>,
/// The deletion time of the execution. It is only
/// populated as a response to a Delete request.
#[prost(message, optional, tag = "5")]
pub delete_time: ::core::option::Option<::prost_types::Timestamp>,
/// Status for the execution completion.
#[prost(enumeration = "execution_reference::CompletionStatus", tag = "4")]
pub completion_status: i32,
}
/// Nested message and enum types in `ExecutionReference`.
pub mod execution_reference {
/// Possible execution completion status.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum CompletionStatus {
/// The default value. This value is used if the state is omitted.
Unspecified = 0,
/// Job execution has succeeded.
ExecutionSucceeded = 1,
/// Job execution has failed.
ExecutionFailed = 2,
/// Job execution is running normally.
ExecutionRunning = 3,
/// Waiting for backing resources to be provisioned.
ExecutionPending = 4,
/// Job execution has been cancelled by the user.
ExecutionCancelled = 5,
}
impl CompletionStatus {
/// 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 {
Self::Unspecified => "COMPLETION_STATUS_UNSPECIFIED",
Self::ExecutionSucceeded => "EXECUTION_SUCCEEDED",
Self::ExecutionFailed => "EXECUTION_FAILED",
Self::ExecutionRunning => "EXECUTION_RUNNING",
Self::ExecutionPending => "EXECUTION_PENDING",
Self::ExecutionCancelled => "EXECUTION_CANCELLED",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"COMPLETION_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
"EXECUTION_SUCCEEDED" => Some(Self::ExecutionSucceeded),
"EXECUTION_FAILED" => Some(Self::ExecutionFailed),
"EXECUTION_RUNNING" => Some(Self::ExecutionRunning),
"EXECUTION_PENDING" => Some(Self::ExecutionPending),
"EXECUTION_CANCELLED" => Some(Self::ExecutionCancelled),
_ => None,
}
}
}
}
/// Generated client implementations.
pub mod jobs_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
/// Cloud Run Job Control Plane API.
#[derive(Debug, Clone)]
pub struct JobsClient<T> {
inner: tonic::client::Grpc<T>,
}
impl JobsClient<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> JobsClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::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,
) -> JobsClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
JobsClient::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
}
/// Creates a Job.
pub async fn create_job(
&mut self,
request: impl tonic::IntoRequest<super::CreateJobRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.run.v2.Jobs/CreateJob",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("google.cloud.run.v2.Jobs", "CreateJob"));
self.inner.unary(req, path, codec).await
}
/// Gets information about a Job.
pub async fn get_job(
&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::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.run.v2.Jobs/GetJob",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("google.cloud.run.v2.Jobs", "GetJob"));
self.inner.unary(req, path, codec).await
}
/// Lists Jobs. Results are sorted by creation time, descending.
pub async fn list_jobs(
&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::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.run.v2.Jobs/ListJobs",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("google.cloud.run.v2.Jobs", "ListJobs"));
self.inner.unary(req, path, codec).await
}
/// Updates a Job.
pub async fn update_job(
&mut self,
request: impl tonic::IntoRequest<super::UpdateJobRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.run.v2.Jobs/UpdateJob",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("google.cloud.run.v2.Jobs", "UpdateJob"));
self.inner.unary(req, path, codec).await
}
/// Deletes a Job.
pub async fn delete_job(
&mut self,
request: impl tonic::IntoRequest<super::DeleteJobRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.run.v2.Jobs/DeleteJob",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("google.cloud.run.v2.Jobs", "DeleteJob"));
self.inner.unary(req, path, codec).await
}
/// Triggers creation of a new Execution of this Job.
pub async fn run_job(
&mut self,
request: impl tonic::IntoRequest<super::RunJobRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.run.v2.Jobs/RunJob",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("google.cloud.run.v2.Jobs", "RunJob"));
self.inner.unary(req, path, codec).await
}
/// Gets the IAM Access Control policy currently in effect for the given Job.
/// This result does not include any inherited policies.
pub async fn get_iam_policy(
&mut self,
request: impl tonic::IntoRequest<
super::super::super::super::iam::v1::GetIamPolicyRequest,
>,
) -> std::result::Result<
tonic::Response<super::super::super::super::iam::v1::Policy>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.run.v2.Jobs/GetIamPolicy",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("google.cloud.run.v2.Jobs", "GetIamPolicy"));
self.inner.unary(req, path, codec).await
}
/// Sets the IAM Access control policy for the specified Job. Overwrites
/// any existing policy.
pub async fn set_iam_policy(
&mut self,
request: impl tonic::IntoRequest<
super::super::super::super::iam::v1::SetIamPolicyRequest,
>,
) -> std::result::Result<
tonic::Response<super::super::super::super::iam::v1::Policy>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.run.v2.Jobs/SetIamPolicy",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("google.cloud.run.v2.Jobs", "SetIamPolicy"));
self.inner.unary(req, path, codec).await
}
/// Returns permissions that a caller has on the specified Project.
///
/// There are no permissions required for making this API call.
pub async fn test_iam_permissions(
&mut self,
request: impl tonic::IntoRequest<
super::super::super::super::iam::v1::TestIamPermissionsRequest,
>,
) -> std::result::Result<
tonic::Response<
super::super::super::super::iam::v1::TestIamPermissionsResponse,
>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.run.v2.Jobs/TestIamPermissions",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("google.cloud.run.v2.Jobs", "TestIamPermissions"),
);
self.inner.unary(req, path, codec).await
}
}
}
/// Effective settings for the current revision
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RevisionScalingStatus {
/// The current number of min instances provisioned for this revision.
#[prost(int32, tag = "1")]
pub desired_min_instance_count: i32,
}
/// Request message for obtaining a Revision by its full name.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetRevisionRequest {
/// Required. The full name of the Revision.
/// Format:
/// projects/{project}/locations/{location}/services/{service}/revisions/{revision}
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// Request message for retrieving a list of Revisions.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListRevisionsRequest {
/// Required. The Service from which the Revisions should be listed.
/// To list all Revisions across Services, use "-" instead of Service name.
/// Format:
/// projects/{project}/locations/{location}/services/{service}
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// Maximum number of revisions to return in this call.
#[prost(int32, tag = "2")]
pub page_size: i32,
/// A page token received from a previous call to ListRevisions.
/// All other parameters must match.
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
/// If true, returns deleted (but unexpired) resources along with active ones.
#[prost(bool, tag = "4")]
pub show_deleted: bool,
}
/// Response message containing a list of Revisions.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListRevisionsResponse {
/// The resulting list of Revisions.
#[prost(message, repeated, tag = "1")]
pub revisions: ::prost::alloc::vec::Vec<Revision>,
/// A token indicating there are more items than page_size. Use it in the next
/// ListRevisions request to continue.
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
/// Request message for deleting a retired Revision.
/// Revision lifecycle is usually managed by making changes to the parent
/// Service. Only retired revisions can be deleted with this API.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteRevisionRequest {
/// Required. The name of the Revision to delete.
/// Format:
/// projects/{project}/locations/{location}/services/{service}/revisions/{revision}
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Indicates that the request should be validated without actually
/// deleting any resources.
#[prost(bool, tag = "2")]
pub validate_only: bool,
/// A system-generated fingerprint for this version of the
/// resource. This may be used to detect modification conflict during updates.
#[prost(string, tag = "3")]
pub etag: ::prost::alloc::string::String,
}
/// A Revision is an immutable snapshot of code and configuration. A Revision
/// references a container image. Revisions are only created by updates to its
/// parent Service.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Revision {
/// Output only. The unique name of this Revision.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Output only. Server assigned unique identifier for the Revision. The value
/// is a UUID4 string and guaranteed to remain unchanged until the resource is
/// deleted.
#[prost(string, tag = "2")]
pub uid: ::prost::alloc::string::String,
/// Output only. A number that monotonically increases every time the user
/// modifies the desired state.
#[prost(int64, tag = "3")]
pub generation: i64,
/// Output only. Unstructured key value map that can be used to organize and
/// categorize objects. User-provided labels are shared with Google's billing
/// system, so they can be used to filter, or break down billing charges by
/// team, component, environment, state, etc. For more information, visit
/// <https://cloud.google.com/resource-manager/docs/creating-managing-labels> or
/// <https://cloud.google.com/run/docs/configuring/labels.>
#[prost(map = "string, string", tag = "4")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// Output only. Unstructured key value map that may
/// be set by external tools to store and arbitrary metadata.
/// They are not queryable and should be preserved
/// when modifying objects.
#[prost(map = "string, string", tag = "5")]
pub annotations: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// Output only. The creation time.
#[prost(message, optional, tag = "6")]
pub create_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. The last-modified time.
#[prost(message, optional, tag = "7")]
pub update_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. For a deleted resource, the deletion time. It is only
/// populated as a response to a Delete request.
#[prost(message, optional, tag = "8")]
pub delete_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. For a deleted resource, the time after which it will be
/// permamently deleted. It is only populated as a response to a Delete
/// request.
#[prost(message, optional, tag = "9")]
pub expire_time: ::core::option::Option<::prost_types::Timestamp>,
/// The least stable launch stage needed to create this resource, as defined by
/// [Google Cloud Platform Launch
/// Stages](<https://cloud.google.com/terms/launch-stages>). Cloud Run supports
/// `ALPHA`, `BETA`, and `GA`.
///
/// Note that this value might not be what was used
/// as input. For example, if ALPHA was provided as input in the parent
/// resource, but only BETA and GA-level features are were, this field will be
/// BETA.
#[prost(enumeration = "super::super::super::api::LaunchStage", tag = "10")]
pub launch_stage: i32,
/// Output only. The name of the parent service.
#[prost(string, tag = "11")]
pub service: ::prost::alloc::string::String,
/// Scaling settings for this revision.
#[prost(message, optional, tag = "12")]
pub scaling: ::core::option::Option<RevisionScaling>,
/// VPC Access configuration for this Revision. For more information, visit
/// <https://cloud.google.com/run/docs/configuring/connecting-vpc.>
#[prost(message, optional, tag = "13")]
pub vpc_access: ::core::option::Option<VpcAccess>,
/// Sets the maximum number of requests that each serving instance can receive.
#[prost(int32, tag = "34")]
pub max_instance_request_concurrency: i32,
/// Max allowed time for an instance to respond to a request.
#[prost(message, optional, tag = "15")]
pub timeout: ::core::option::Option<::prost_types::Duration>,
/// Email address of the IAM service account associated with the revision of
/// the service. The service account represents the identity of the running
/// revision, and determines what permissions the revision has.
#[prost(string, tag = "16")]
pub service_account: ::prost::alloc::string::String,
/// Holds the single container that defines the unit of execution for this
/// Revision.
#[prost(message, repeated, tag = "17")]
pub containers: ::prost::alloc::vec::Vec<Container>,
/// A list of Volumes to make available to containers.
#[prost(message, repeated, tag = "18")]
pub volumes: ::prost::alloc::vec::Vec<Volume>,
/// The execution environment being used to host this Revision.
#[prost(enumeration = "ExecutionEnvironment", tag = "20")]
pub execution_environment: i32,
/// A reference to a customer managed encryption key (CMEK) to use to encrypt
/// this container image. For more information, go to
/// <https://cloud.google.com/run/docs/securing/using-cmek>
#[prost(string, tag = "21")]
pub encryption_key: ::prost::alloc::string::String,
/// Enables service mesh connectivity.
#[prost(message, optional, tag = "22")]
pub service_mesh: ::core::option::Option<ServiceMesh>,
/// The action to take if the encryption key is revoked.
#[prost(enumeration = "EncryptionKeyRevocationAction", tag = "23")]
pub encryption_key_revocation_action: i32,
/// If encryption_key_revocation_action is SHUTDOWN, the duration before
/// shutting down all instances. The minimum increment is 1 hour.
#[prost(message, optional, tag = "24")]
pub encryption_key_shutdown_duration: ::core::option::Option<
::prost_types::Duration,
>,
/// Output only. Indicates whether the resource's reconciliation is still in
/// progress. See comments in `Service.reconciling` for additional information
/// on reconciliation process in Cloud Run.
#[prost(bool, tag = "30")]
pub reconciling: bool,
/// Output only. The Condition of this Revision, containing its readiness
/// status, and detailed error information in case it did not reach a serving
/// state.
#[prost(message, repeated, tag = "31")]
pub conditions: ::prost::alloc::vec::Vec<Condition>,
/// Output only. The generation of this Revision currently serving traffic. See
/// comments in `reconciling` for additional information on reconciliation
/// process in Cloud Run.
#[prost(int64, tag = "32")]
pub observed_generation: i64,
/// Output only. The Google Console URI to obtain logs for the Revision.
#[prost(string, tag = "33")]
pub log_uri: ::prost::alloc::string::String,
/// Output only. Reserved for future use.
#[prost(bool, tag = "37")]
pub satisfies_pzs: bool,
/// Enable session affinity.
#[prost(bool, tag = "38")]
pub session_affinity: bool,
/// Output only. The current effective scaling settings for the revision.
#[prost(message, optional, tag = "39")]
pub scaling_status: ::core::option::Option<RevisionScalingStatus>,
/// The node selector for the revision.
#[prost(message, optional, tag = "40")]
pub node_selector: ::core::option::Option<NodeSelector>,
/// Optional. Output only. True if GPU zonal redundancy is disabled on this
/// revision.
#[prost(bool, optional, tag = "48")]
pub gpu_zonal_redundancy_disabled: ::core::option::Option<bool>,
/// Output only. Email address of the authenticated creator.
#[prost(string, tag = "49")]
pub creator: ::prost::alloc::string::String,
/// Output only. A system-generated fingerprint for this version of the
/// resource. May be used to detect modification conflict during updates.
#[prost(string, tag = "99")]
pub etag: ::prost::alloc::string::String,
}
/// Generated client implementations.
pub mod revisions_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
/// Cloud Run Revision Control Plane API.
#[derive(Debug, Clone)]
pub struct RevisionsClient<T> {
inner: tonic::client::Grpc<T>,
}
impl RevisionsClient<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> RevisionsClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::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,
) -> RevisionsClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
RevisionsClient::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
}
/// Gets information about a Revision.
pub async fn get_revision(
&mut self,
request: impl tonic::IntoRequest<super::GetRevisionRequest>,
) -> std::result::Result<tonic::Response<super::Revision>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.run.v2.Revisions/GetRevision",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("google.cloud.run.v2.Revisions", "GetRevision"));
self.inner.unary(req, path, codec).await
}
/// Lists Revisions from a given Service, or from a given location. Results
/// are sorted by creation time, descending.
pub async fn list_revisions(
&mut self,
request: impl tonic::IntoRequest<super::ListRevisionsRequest>,
) -> std::result::Result<
tonic::Response<super::ListRevisionsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.run.v2.Revisions/ListRevisions",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("google.cloud.run.v2.Revisions", "ListRevisions"),
);
self.inner.unary(req, path, codec).await
}
/// Deletes a Revision.
pub async fn delete_revision(
&mut self,
request: impl tonic::IntoRequest<super::DeleteRevisionRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.run.v2.Revisions/DeleteRevision",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("google.cloud.run.v2.Revisions", "DeleteRevision"),
);
self.inner.unary(req, path, codec).await
}
}
}
/// RevisionTemplate describes the data a revision should have when created from
/// a template.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RevisionTemplate {
/// Optional. The unique name for the revision. If this field is omitted, it
/// will be automatically generated based on the Service name.
#[prost(string, tag = "1")]
pub revision: ::prost::alloc::string::String,
/// Optional. Unstructured key value map that can be used to organize and
/// categorize objects. User-provided labels are shared with Google's billing
/// system, so they can be used to filter, or break down billing charges by
/// team, component, environment, state, etc. For more information, visit
/// <https://cloud.google.com/resource-manager/docs/creating-managing-labels> or
/// <https://cloud.google.com/run/docs/configuring/labels.>
///
/// <p>Cloud Run API v2 does not support labels with `run.googleapis.com`,
/// `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev`
/// namespaces, and they will be rejected. All system labels in v1 now have a
/// corresponding field in v2 RevisionTemplate.
#[prost(map = "string, string", tag = "2")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// Optional. Unstructured key value map that may be set by external tools to
/// store and arbitrary metadata. They are not queryable and should be
/// preserved when modifying objects.
///
/// <p>Cloud Run API v2 does not support annotations with `run.googleapis.com`,
/// `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev`
/// namespaces, and they will be rejected. All system annotations in v1 now
/// have a corresponding field in v2 RevisionTemplate.
///
/// <p>This field follows Kubernetes annotations' namespacing, limits, and
/// rules.
#[prost(map = "string, string", tag = "3")]
pub annotations: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// Optional. Scaling settings for this Revision.
#[prost(message, optional, tag = "4")]
pub scaling: ::core::option::Option<RevisionScaling>,
/// Optional. VPC Access configuration to use for this Revision. For more
/// information, visit
/// <https://cloud.google.com/run/docs/configuring/connecting-vpc.>
#[prost(message, optional, tag = "6")]
pub vpc_access: ::core::option::Option<VpcAccess>,
/// Optional. Max allowed time for an instance to respond to a request.
#[prost(message, optional, tag = "8")]
pub timeout: ::core::option::Option<::prost_types::Duration>,
/// Optional. Email address of the IAM service account associated with the
/// revision of the service. The service account represents the identity of the
/// running revision, and determines what permissions the revision has. If not
/// provided, the revision will use the project's default service account.
#[prost(string, tag = "9")]
pub service_account: ::prost::alloc::string::String,
/// Holds the single container that defines the unit of execution for this
/// Revision.
#[prost(message, repeated, tag = "10")]
pub containers: ::prost::alloc::vec::Vec<Container>,
/// Optional. A list of Volumes to make available to containers.
#[prost(message, repeated, tag = "11")]
pub volumes: ::prost::alloc::vec::Vec<Volume>,
/// Optional. The sandbox environment to host this Revision.
#[prost(enumeration = "ExecutionEnvironment", tag = "13")]
pub execution_environment: i32,
/// A reference to a customer managed encryption key (CMEK) to use to encrypt
/// this container image. For more information, go to
/// <https://cloud.google.com/run/docs/securing/using-cmek>
#[prost(string, tag = "14")]
pub encryption_key: ::prost::alloc::string::String,
/// Optional. Sets the maximum number of requests that each serving instance
/// can receive. If not specified or 0, concurrency defaults to 80 when
/// requested `CPU >= 1` and defaults to 1 when requested `CPU < 1`.
#[prost(int32, tag = "15")]
pub max_instance_request_concurrency: i32,
/// Optional. Enables service mesh connectivity.
#[prost(message, optional, tag = "16")]
pub service_mesh: ::core::option::Option<ServiceMesh>,
/// Optional. The action to take if the encryption key is revoked.
#[prost(enumeration = "EncryptionKeyRevocationAction", tag = "17")]
pub encryption_key_revocation_action: i32,
/// Optional. If encryption_key_revocation_action is SHUTDOWN, the duration
/// before shutting down all instances. The minimum increment is 1 hour.
#[prost(message, optional, tag = "18")]
pub encryption_key_shutdown_duration: ::core::option::Option<
::prost_types::Duration,
>,
/// Optional. Enable session affinity.
#[prost(bool, tag = "19")]
pub session_affinity: bool,
/// Optional. Disables health checking containers during deployment.
#[prost(bool, tag = "20")]
pub health_check_disabled: bool,
/// Optional. The node selector for the revision template.
#[prost(message, optional, tag = "21")]
pub node_selector: ::core::option::Option<NodeSelector>,
/// Optional. True if GPU zonal redundancy is disabled on this revision.
#[prost(bool, optional, tag = "24")]
pub gpu_zonal_redundancy_disabled: ::core::option::Option<bool>,
}
/// Holds a single traffic routing entry for the Service. Allocations can be done
/// to a specific Revision name, or pointing to the latest Ready Revision.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct TrafficTarget {
/// The allocation type for this traffic target.
#[prost(enumeration = "TrafficTargetAllocationType", tag = "1")]
pub r#type: i32,
/// Revision to which to send this portion of traffic, if traffic allocation is
/// by revision.
#[prost(string, tag = "2")]
pub revision: ::prost::alloc::string::String,
/// Specifies percent of the traffic to this Revision.
/// This defaults to zero if unspecified.
#[prost(int32, tag = "3")]
pub percent: i32,
/// Indicates a string to be part of the URI to exclusively reference this
/// target.
#[prost(string, tag = "4")]
pub tag: ::prost::alloc::string::String,
}
/// Represents the observed state of a single `TrafficTarget` entry.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct TrafficTargetStatus {
/// The allocation type for this traffic target.
#[prost(enumeration = "TrafficTargetAllocationType", tag = "1")]
pub r#type: i32,
/// Revision to which this traffic is sent.
#[prost(string, tag = "2")]
pub revision: ::prost::alloc::string::String,
/// Specifies percent of the traffic to this Revision.
#[prost(int32, tag = "3")]
pub percent: i32,
/// Indicates the string used in the URI to exclusively reference this target.
#[prost(string, tag = "4")]
pub tag: ::prost::alloc::string::String,
/// Displays the target URI.
#[prost(string, tag = "5")]
pub uri: ::prost::alloc::string::String,
}
/// The type of instance allocation.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum TrafficTargetAllocationType {
/// Unspecified instance allocation type.
Unspecified = 0,
/// Allocates instances to the Service's latest ready Revision.
Latest = 1,
/// Allocates instances to a Revision by name.
Revision = 2,
}
impl TrafficTargetAllocationType {
/// 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 {
Self::Unspecified => "TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED",
Self::Latest => "TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST",
Self::Revision => "TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"TRAFFIC_TARGET_ALLOCATION_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST" => Some(Self::Latest),
"TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION" => Some(Self::Revision),
_ => None,
}
}
}
/// Request message for creating a Service.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateServiceRequest {
/// Required. The location and project in which this service should be created.
/// Format: projects/{project}/locations/{location}, where {project} can be
/// project id or number. Only lowercase characters, digits, and hyphens.
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// Required. The Service instance to create.
#[prost(message, optional, tag = "2")]
pub service: ::core::option::Option<Service>,
/// Required. The unique identifier for the Service. It must begin with letter,
/// and cannot end with hyphen; must contain fewer than 50 characters.
/// The name of the service becomes {parent}/services/{service_id}.
#[prost(string, tag = "3")]
pub service_id: ::prost::alloc::string::String,
/// Indicates that the request should be validated and default values
/// populated, without persisting the request or creating any resources.
#[prost(bool, tag = "4")]
pub validate_only: bool,
}
/// Request message for updating a service.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateServiceRequest {
/// Optional. The list of fields to be updated.
#[prost(message, optional, tag = "2")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
/// Required. The Service to be updated.
#[prost(message, optional, tag = "1")]
pub service: ::core::option::Option<Service>,
/// Indicates that the request should be validated and default values
/// populated, without persisting the request or updating any resources.
#[prost(bool, tag = "3")]
pub validate_only: bool,
/// Optional. If set to true, and if the Service does not exist, it will create
/// a new one. The caller must have 'run.services.create' permissions if this
/// is set to true and the Service does not exist.
#[prost(bool, tag = "4")]
pub allow_missing: bool,
}
/// Request message for retrieving a list of Services.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListServicesRequest {
/// Required. The location and project to list resources on.
/// Location must be a valid Google Cloud region, and cannot be the "-"
/// wildcard. Format: projects/{project}/locations/{location}, where {project}
/// can be project id or number.
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// Maximum number of Services to return in this call.
#[prost(int32, tag = "2")]
pub page_size: i32,
/// A page token received from a previous call to ListServices.
/// All other parameters must match.
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
/// If true, returns deleted (but unexpired) resources along with active ones.
#[prost(bool, tag = "4")]
pub show_deleted: bool,
}
/// Response message containing a list of Services.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListServicesResponse {
/// The resulting list of Services.
#[prost(message, repeated, tag = "1")]
pub services: ::prost::alloc::vec::Vec<Service>,
/// A token indicating there are more items than page_size. Use it in the next
/// ListServices request to continue.
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
/// Output only. For global requests, returns the list of regions that could
/// not be reached within the deadline.
#[prost(string, repeated, tag = "3")]
pub unreachable: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Request message for obtaining a Service by its full name.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetServiceRequest {
/// Required. The full name of the Service.
/// Format: projects/{project}/locations/{location}/services/{service}, where
/// {project} can be project id or number.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// Request message to delete a Service by its full name.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteServiceRequest {
/// Required. The full name of the Service.
/// Format: projects/{project}/locations/{location}/services/{service}, where
/// {project} can be project id or number.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Indicates that the request should be validated without actually
/// deleting any resources.
#[prost(bool, tag = "2")]
pub validate_only: bool,
/// A system-generated fingerprint for this version of the
/// resource. May be used to detect modification conflict during updates.
#[prost(string, tag = "3")]
pub etag: ::prost::alloc::string::String,
}
/// Service acts as a top-level container that manages a set of
/// configurations and revision templates which implement a network service.
/// Service exists to provide a singular abstraction which can be access
/// controlled, reasoned about, and which encapsulates software lifecycle
/// decisions such as rollout policy and team resource ownership.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Service {
/// Identifier. The fully qualified name of this Service. In
/// CreateServiceRequest, this field is ignored, and instead composed from
/// CreateServiceRequest.parent and CreateServiceRequest.service_id.
///
/// Format:
/// projects/{project}/locations/{location}/services/{service_id}
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// User-provided description of the Service. This field currently has a
/// 512-character limit.
#[prost(string, tag = "2")]
pub description: ::prost::alloc::string::String,
/// Output only. Server assigned unique identifier for the trigger. The value
/// is a UUID4 string and guaranteed to remain unchanged until the resource is
/// deleted.
#[prost(string, tag = "3")]
pub uid: ::prost::alloc::string::String,
/// Output only. A number that monotonically increases every time the user
/// modifies the desired state.
/// Please note that unlike v1, this is an int64 value. As with most Google
/// APIs, its JSON representation will be a `string` instead of an `integer`.
#[prost(int64, tag = "4")]
pub generation: i64,
/// Optional. Unstructured key value map that can be used to organize and
/// categorize objects. User-provided labels are shared with Google's billing
/// system, so they can be used to filter, or break down billing charges by
/// team, component, environment, state, etc. For more information, visit
/// <https://cloud.google.com/resource-manager/docs/creating-managing-labels> or
/// <https://cloud.google.com/run/docs/configuring/labels.>
///
/// <p>Cloud Run API v2 does not support labels with `run.googleapis.com`,
/// `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev`
/// namespaces, and they will be rejected. All system labels in v1 now have a
/// corresponding field in v2 Service.
#[prost(map = "string, string", tag = "5")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// Optional. Unstructured key value map that may be set by external tools to
/// store and arbitrary metadata. They are not queryable and should be
/// preserved when modifying objects.
///
/// <p>Cloud Run API v2 does not support annotations with `run.googleapis.com`,
/// `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev`
/// namespaces, and they will be rejected in new resources. All system
/// annotations in v1 now have a corresponding field in v2 Service.
///
/// <p>This field follows Kubernetes
/// annotations' namespacing, limits, and rules.
#[prost(map = "string, string", tag = "6")]
pub annotations: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// Output only. The creation time.
#[prost(message, optional, tag = "7")]
pub create_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. The last-modified time.
#[prost(message, optional, tag = "8")]
pub update_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. The deletion time. It is only populated as a response to a
/// Delete request.
#[prost(message, optional, tag = "9")]
pub delete_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. For a deleted resource, the time after which it will be
/// permanently deleted.
#[prost(message, optional, tag = "10")]
pub expire_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. Email address of the authenticated creator.
#[prost(string, tag = "11")]
pub creator: ::prost::alloc::string::String,
/// Output only. Email address of the last authenticated modifier.
#[prost(string, tag = "12")]
pub last_modifier: ::prost::alloc::string::String,
/// Arbitrary identifier for the API client.
#[prost(string, tag = "13")]
pub client: ::prost::alloc::string::String,
/// Arbitrary version identifier for the API client.
#[prost(string, tag = "14")]
pub client_version: ::prost::alloc::string::String,
/// Optional. Provides the ingress settings for this Service. On output,
/// returns the currently observed ingress settings, or
/// INGRESS_TRAFFIC_UNSPECIFIED if no revision is active.
#[prost(enumeration = "IngressTraffic", tag = "15")]
pub ingress: i32,
/// Optional. The launch stage as defined by [Google Cloud Platform
/// Launch Stages](<https://cloud.google.com/terms/launch-stages>).
/// Cloud Run supports `ALPHA`, `BETA`, and `GA`. If no value is specified, GA
/// is assumed.
/// Set the launch stage to a preview stage on input to allow use of preview
/// features in that stage. On read (or output), describes whether the resource
/// uses preview features.
///
/// For example, if ALPHA is provided as input, but only BETA and GA-level
/// features are used, this field will be BETA on output.
#[prost(enumeration = "super::super::super::api::LaunchStage", tag = "16")]
pub launch_stage: i32,
/// Optional. Settings for the Binary Authorization feature.
#[prost(message, optional, tag = "17")]
pub binary_authorization: ::core::option::Option<BinaryAuthorization>,
/// Required. The template used to create revisions for this Service.
#[prost(message, optional, tag = "18")]
pub template: ::core::option::Option<RevisionTemplate>,
/// Optional. Specifies how to distribute traffic over a collection of
/// Revisions belonging to the Service. If traffic is empty or not provided,
/// defaults to 100% traffic to the latest `Ready` Revision.
#[prost(message, repeated, tag = "19")]
pub traffic: ::prost::alloc::vec::Vec<TrafficTarget>,
/// Optional. Specifies service-level scaling settings
#[prost(message, optional, tag = "20")]
pub scaling: ::core::option::Option<ServiceScaling>,
/// Optional. Disables IAM permission check for run.routes.invoke for callers
/// of this service. For more information, visit
/// <https://cloud.google.com/run/docs/securing/managing-access#invoker_check.>
#[prost(bool, tag = "21")]
pub invoker_iam_disabled: bool,
/// Optional. Disables public resolution of the default URI of this service.
#[prost(bool, tag = "22")]
pub default_uri_disabled: bool,
/// Output only. All URLs serving traffic for this Service.
#[prost(string, repeated, tag = "24")]
pub urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Optional. IAP settings on the Service.
#[prost(bool, tag = "25")]
pub iap_enabled: bool,
/// Optional. Settings for multi-region deployment.
#[prost(message, optional, tag = "26")]
pub multi_region_settings: ::core::option::Option<service::MultiRegionSettings>,
/// One or more custom audiences that you want this service to support. Specify
/// each custom audience as the full URL in a string. The custom audiences are
/// encoded in the token and used to authenticate requests. For more
/// information, see
/// <https://cloud.google.com/run/docs/configuring/custom-audiences.>
#[prost(string, repeated, tag = "37")]
pub custom_audiences: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Output only. The generation of this Service currently serving traffic. See
/// comments in `reconciling` for additional information on reconciliation
/// process in Cloud Run. Please note that unlike v1, this is an int64 value.
/// As with most Google APIs, its JSON representation will be a `string`
/// instead of an `integer`.
#[prost(int64, tag = "30")]
pub observed_generation: i64,
/// Output only. The Condition of this Service, containing its readiness
/// status, and detailed error information in case it did not reach a serving
/// state. See comments in `reconciling` for additional information on
/// reconciliation process in Cloud Run.
#[prost(message, optional, tag = "31")]
pub terminal_condition: ::core::option::Option<Condition>,
/// Output only. The Conditions of all other associated sub-resources. They
/// contain additional diagnostics information in case the Service does not
/// reach its Serving state. See comments in `reconciling` for additional
/// information on reconciliation process in Cloud Run.
#[prost(message, repeated, tag = "32")]
pub conditions: ::prost::alloc::vec::Vec<Condition>,
/// Output only. Name of the latest revision that is serving traffic. See
/// comments in `reconciling` for additional information on reconciliation
/// process in Cloud Run.
#[prost(string, tag = "33")]
pub latest_ready_revision: ::prost::alloc::string::String,
/// Output only. Name of the last created revision. See comments in
/// `reconciling` for additional information on reconciliation process in Cloud
/// Run.
#[prost(string, tag = "34")]
pub latest_created_revision: ::prost::alloc::string::String,
/// Output only. Detailed status information for corresponding traffic targets.
/// See comments in `reconciling` for additional information on reconciliation
/// process in Cloud Run.
#[prost(message, repeated, tag = "35")]
pub traffic_statuses: ::prost::alloc::vec::Vec<TrafficTargetStatus>,
/// Output only. The main URI in which this Service is serving traffic.
#[prost(string, tag = "36")]
pub uri: ::prost::alloc::string::String,
/// Output only. Reserved for future use.
#[prost(bool, tag = "38")]
pub satisfies_pzs: bool,
/// Output only. True if Cloud Run Threat Detection monitoring is enabled for
/// the parent project of this Service.
#[prost(bool, tag = "40")]
pub threat_detection_enabled: bool,
/// Optional. Configuration for building a Cloud Run function.
#[prost(message, optional, tag = "41")]
pub build_config: ::core::option::Option<BuildConfig>,
/// Output only. Returns true if the Service is currently being acted upon by
/// the system to bring it into the desired state.
///
/// When a new Service is created, or an existing one is updated, Cloud Run
/// will asynchronously perform all necessary steps to bring the Service to the
/// desired serving state. This process is called reconciliation.
/// While reconciliation is in process, `observed_generation`,
/// `latest_ready_revision`, `traffic_statuses`, and `uri` will have transient
/// values that might mismatch the intended state: Once reconciliation is over
/// (and this field is false), there are two possible outcomes: reconciliation
/// succeeded and the serving state matches the Service, or there was an error,
/// and reconciliation failed. This state can be found in
/// `terminal_condition.state`.
///
/// If reconciliation succeeded, the following fields will match: `traffic` and
/// `traffic_statuses`, `observed_generation` and `generation`,
/// `latest_ready_revision` and `latest_created_revision`.
///
/// If reconciliation failed, `traffic_statuses`, `observed_generation`, and
/// `latest_ready_revision` will have the state of the last serving revision,
/// or empty for newly created Services. Additional information on the failure
/// can be found in `terminal_condition` and `conditions`.
#[prost(bool, tag = "98")]
pub reconciling: bool,
/// Optional. A system-generated fingerprint for this version of the
/// resource. May be used to detect modification conflict during updates.
#[prost(string, tag = "99")]
pub etag: ::prost::alloc::string::String,
}
/// Nested message and enum types in `Service`.
pub mod service {
/// Settings for multi-region deployment.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct MultiRegionSettings {
/// Required. List of regions to deploy to, including primary region.
#[prost(string, repeated, tag = "1")]
pub regions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Optional. System-generated unique id for the multi-region Service.
#[prost(string, tag = "2")]
pub multi_region_id: ::prost::alloc::string::String,
}
}
/// Generated client implementations.
pub mod services_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
/// Cloud Run Service Control Plane API
#[derive(Debug, Clone)]
pub struct ServicesClient<T> {
inner: tonic::client::Grpc<T>,
}
impl ServicesClient<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> ServicesClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::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,
) -> ServicesClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
ServicesClient::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
}
/// Creates a new Service in a given project and location.
pub async fn create_service(
&mut self,
request: impl tonic::IntoRequest<super::CreateServiceRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.run.v2.Services/CreateService",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("google.cloud.run.v2.Services", "CreateService"),
);
self.inner.unary(req, path, codec).await
}
/// Gets information about a Service.
pub async fn get_service(
&mut self,
request: impl tonic::IntoRequest<super::GetServiceRequest>,
) -> std::result::Result<tonic::Response<super::Service>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.run.v2.Services/GetService",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("google.cloud.run.v2.Services", "GetService"));
self.inner.unary(req, path, codec).await
}
/// Lists Services. Results are sorted by creation time, descending.
pub async fn list_services(
&mut self,
request: impl tonic::IntoRequest<super::ListServicesRequest>,
) -> std::result::Result<
tonic::Response<super::ListServicesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.run.v2.Services/ListServices",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("google.cloud.run.v2.Services", "ListServices"));
self.inner.unary(req, path, codec).await
}
/// Updates a Service.
pub async fn update_service(
&mut self,
request: impl tonic::IntoRequest<super::UpdateServiceRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.run.v2.Services/UpdateService",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("google.cloud.run.v2.Services", "UpdateService"),
);
self.inner.unary(req, path, codec).await
}
/// Deletes a Service.
/// This will cause the Service to stop serving traffic and will delete all
/// revisions.
pub async fn delete_service(
&mut self,
request: impl tonic::IntoRequest<super::DeleteServiceRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.run.v2.Services/DeleteService",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("google.cloud.run.v2.Services", "DeleteService"),
);
self.inner.unary(req, path, codec).await
}
/// Gets the IAM Access Control policy currently in effect for the given
/// Cloud Run Service. This result does not include any inherited policies.
pub async fn get_iam_policy(
&mut self,
request: impl tonic::IntoRequest<
super::super::super::super::iam::v1::GetIamPolicyRequest,
>,
) -> std::result::Result<
tonic::Response<super::super::super::super::iam::v1::Policy>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.run.v2.Services/GetIamPolicy",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("google.cloud.run.v2.Services", "GetIamPolicy"));
self.inner.unary(req, path, codec).await
}
/// Sets the IAM Access control policy for the specified Service. Overwrites
/// any existing policy.
pub async fn set_iam_policy(
&mut self,
request: impl tonic::IntoRequest<
super::super::super::super::iam::v1::SetIamPolicyRequest,
>,
) -> std::result::Result<
tonic::Response<super::super::super::super::iam::v1::Policy>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.run.v2.Services/SetIamPolicy",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("google.cloud.run.v2.Services", "SetIamPolicy"));
self.inner.unary(req, path, codec).await
}
/// Returns permissions that a caller has on the specified Project.
///
/// There are no permissions required for making this API call.
pub async fn test_iam_permissions(
&mut self,
request: impl tonic::IntoRequest<
super::super::super::super::iam::v1::TestIamPermissionsRequest,
>,
) -> std::result::Result<
tonic::Response<
super::super::super::super::iam::v1::TestIamPermissionsResponse,
>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.run.v2.Services/TestIamPermissions",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("google.cloud.run.v2.Services", "TestIamPermissions"),
);
self.inner.unary(req, path, codec).await
}
}
}
/// Request message for obtaining a Task by its full name.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetTaskRequest {
/// Required. The full name of the Task.
/// Format:
/// projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task}
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// Request message for retrieving a list of Tasks.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListTasksRequest {
/// Required. The Execution from which the Tasks should be listed.
/// To list all Tasks across Executions of a Job, use "-" instead of Execution
/// name. To list all Tasks across Jobs, use "-" instead of Job name. Format:
/// projects/{project}/locations/{location}/jobs/{job}/executions/{execution}
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// Maximum number of Tasks to return in this call.
#[prost(int32, tag = "2")]
pub page_size: i32,
/// A page token received from a previous call to ListTasks.
/// All other parameters must match.
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
/// If true, returns deleted (but unexpired) resources along with active ones.
#[prost(bool, tag = "4")]
pub show_deleted: bool,
}
/// Response message containing a list of Tasks.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListTasksResponse {
/// The resulting list of Tasks.
#[prost(message, repeated, tag = "1")]
pub tasks: ::prost::alloc::vec::Vec<Task>,
/// A token indicating there are more items than page_size. Use it in the next
/// ListTasks request to continue.
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
/// Task represents a single run of a container to completion.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Task {
/// Output only. The unique name of this Task.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Output only. Server assigned unique identifier for the Task. The value is a
/// UUID4 string and guaranteed to remain unchanged until the resource is
/// deleted.
#[prost(string, tag = "2")]
pub uid: ::prost::alloc::string::String,
/// Output only. A number that monotonically increases every time the user
/// modifies the desired state.
#[prost(int64, tag = "3")]
pub generation: i64,
/// Output only. Unstructured key value map that can be used to organize and
/// categorize objects. User-provided labels are shared with Google's billing
/// system, so they can be used to filter, or break down billing charges by
/// team, component, environment, state, etc. For more information, visit
/// <https://cloud.google.com/resource-manager/docs/creating-managing-labels> or
/// <https://cloud.google.com/run/docs/configuring/labels>
#[prost(map = "string, string", tag = "4")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// Output only. Unstructured key value map that may
/// be set by external tools to store and arbitrary metadata.
/// They are not queryable and should be preserved
/// when modifying objects.
#[prost(map = "string, string", tag = "5")]
pub annotations: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// Output only. Represents time when the task was created by the system.
/// It is not guaranteed to be set in happens-before order across separate
/// operations.
#[prost(message, optional, tag = "6")]
pub create_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. Represents time when the task was scheduled to run by the
/// system. It is not guaranteed to be set in happens-before order across
/// separate operations.
#[prost(message, optional, tag = "34")]
pub scheduled_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. Represents time when the task started to run.
/// It is not guaranteed to be set in happens-before order across separate
/// operations.
#[prost(message, optional, tag = "27")]
pub start_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. Represents time when the Task was completed. It is not
/// guaranteed to be set in happens-before order across separate operations.
#[prost(message, optional, tag = "7")]
pub completion_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. The last-modified time.
#[prost(message, optional, tag = "8")]
pub update_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. For a deleted resource, the deletion time. It is only
/// populated as a response to a Delete request.
#[prost(message, optional, tag = "9")]
pub delete_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. For a deleted resource, the time after which it will be
/// permamently deleted. It is only populated as a response to a Delete
/// request.
#[prost(message, optional, tag = "10")]
pub expire_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. The name of the parent Job.
#[prost(string, tag = "12")]
pub job: ::prost::alloc::string::String,
/// Output only. The name of the parent Execution.
#[prost(string, tag = "13")]
pub execution: ::prost::alloc::string::String,
/// Holds the single container that defines the unit of execution for this
/// task.
#[prost(message, repeated, tag = "14")]
pub containers: ::prost::alloc::vec::Vec<Container>,
/// A list of Volumes to make available to containers.
#[prost(message, repeated, tag = "15")]
pub volumes: ::prost::alloc::vec::Vec<Volume>,
/// Number of retries allowed per Task, before marking this Task failed.
#[prost(int32, tag = "16")]
pub max_retries: i32,
/// Max allowed time duration the Task may be active before the system will
/// actively try to mark it failed and kill associated containers. This applies
/// per attempt of a task, meaning each retry can run for the full timeout.
#[prost(message, optional, tag = "17")]
pub timeout: ::core::option::Option<::prost_types::Duration>,
/// Email address of the IAM service account associated with the Task of a
/// Job. The service account represents the identity of the
/// running task, and determines what permissions the task has. If
/// not provided, the task will use the project's default service account.
#[prost(string, tag = "18")]
pub service_account: ::prost::alloc::string::String,
/// The execution environment being used to host this Task.
#[prost(enumeration = "ExecutionEnvironment", tag = "20")]
pub execution_environment: i32,
/// Output only. Indicates whether the resource's reconciliation is still in
/// progress. See comments in `Job.reconciling` for additional information on
/// reconciliation process in Cloud Run.
#[prost(bool, tag = "21")]
pub reconciling: bool,
/// Output only. The Condition of this Task, containing its readiness status,
/// and detailed error information in case it did not reach the desired state.
#[prost(message, repeated, tag = "22")]
pub conditions: ::prost::alloc::vec::Vec<Condition>,
/// Output only. The generation of this Task. See comments in `Job.reconciling`
/// for additional information on reconciliation process in Cloud Run.
#[prost(int64, tag = "23")]
pub observed_generation: i64,
/// Output only. Index of the Task, unique per execution, and beginning at 0.
#[prost(int32, tag = "24")]
pub index: i32,
/// Output only. The number of times this Task was retried.
/// Tasks are retried when they fail up to the maxRetries limit.
#[prost(int32, tag = "25")]
pub retried: i32,
/// Output only. Result of the last attempt of this Task.
#[prost(message, optional, tag = "26")]
pub last_attempt_result: ::core::option::Option<TaskAttemptResult>,
/// Output only. A reference to a customer managed encryption key (CMEK) to use
/// to encrypt this container image. For more information, go to
/// <https://cloud.google.com/run/docs/securing/using-cmek>
#[prost(string, tag = "28")]
pub encryption_key: ::prost::alloc::string::String,
/// Output only. VPC Access configuration to use for this Task. For more
/// information, visit
/// <https://cloud.google.com/run/docs/configuring/connecting-vpc.>
#[prost(message, optional, tag = "29")]
pub vpc_access: ::core::option::Option<VpcAccess>,
/// Output only. URI where logs for this execution can be found in Cloud
/// Console.
#[prost(string, tag = "32")]
pub log_uri: ::prost::alloc::string::String,
/// Output only. Reserved for future use.
#[prost(bool, tag = "33")]
pub satisfies_pzs: bool,
/// Output only. The node selector for the task.
#[prost(message, optional, tag = "36")]
pub node_selector: ::core::option::Option<NodeSelector>,
/// Optional. Output only. True if GPU zonal redundancy is disabled on this
/// task.
#[prost(bool, optional, tag = "37")]
pub gpu_zonal_redundancy_disabled: ::core::option::Option<bool>,
/// Output only. A system-generated fingerprint for this version of the
/// resource. May be used to detect modification conflict during updates.
#[prost(string, tag = "99")]
pub etag: ::prost::alloc::string::String,
}
/// Result of a task attempt.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TaskAttemptResult {
/// Output only. The status of this attempt.
/// If the status code is OK, then the attempt succeeded.
#[prost(message, optional, tag = "1")]
pub status: ::core::option::Option<super::super::super::rpc::Status>,
/// Output only. The exit code of this attempt.
/// This may be unset if the container was unable to exit cleanly with a code
/// due to some other failure.
/// See status field for possible failure details.
///
/// At most one of exit_code or term_signal will be set.
#[prost(int32, tag = "2")]
pub exit_code: i32,
/// Output only. Termination signal of the container. This is set to non-zero
/// if the container is terminated by the system.
///
/// At most one of exit_code or term_signal will be set.
#[prost(int32, tag = "3")]
pub term_signal: i32,
}
/// Generated client implementations.
pub mod tasks_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
/// Cloud Run Task Control Plane API.
#[derive(Debug, Clone)]
pub struct TasksClient<T> {
inner: tonic::client::Grpc<T>,
}
impl TasksClient<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> TasksClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::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,
) -> TasksClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
TasksClient::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
}
/// Gets information about a Task.
pub async fn get_task(
&mut self,
request: impl tonic::IntoRequest<super::GetTaskRequest>,
) -> std::result::Result<tonic::Response<super::Task>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.run.v2.Tasks/GetTask",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("google.cloud.run.v2.Tasks", "GetTask"));
self.inner.unary(req, path, codec).await
}
/// Lists Tasks from an Execution of a Job.
pub async fn list_tasks(
&mut self,
request: impl tonic::IntoRequest<super::ListTasksRequest>,
) -> std::result::Result<
tonic::Response<super::ListTasksResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.run.v2.Tasks/ListTasks",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("google.cloud.run.v2.Tasks", "ListTasks"));
self.inner.unary(req, path, codec).await
}
}
}
/// WorkerPoolRevisionTemplate describes the data a worker pool revision should
/// have when created from a template.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WorkerPoolRevisionTemplate {
/// Optional. The unique name for the revision. If this field is omitted, it
/// will be automatically generated based on the WorkerPool name.
#[prost(string, tag = "1")]
pub revision: ::prost::alloc::string::String,
/// Optional. Unstructured key value map that can be used to organize and
/// categorize objects. User-provided labels are shared with Google's billing
/// system, so they can be used to filter, or break down billing charges by
/// team, component, environment, state, etc. For more information, visit
/// <https://cloud.google.com/resource-manager/docs/creating-managing-labels> or
/// <https://cloud.google.com/run/docs/configuring/labels.>
///
/// Cloud Run API v2 does not support labels with `run.googleapis.com`,
/// `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev`
/// namespaces, and they will be rejected. All system labels in v1 now have a
/// corresponding field in v2 WorkerPoolRevisionTemplate.
#[prost(map = "string, string", tag = "2")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// Optional. Unstructured key value map that may be set by external tools to
/// store and arbitrary metadata. They are not queryable and should be
/// preserved when modifying objects.
///
/// Cloud Run API v2 does not support annotations with `run.googleapis.com`,
/// `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev`
/// namespaces, and they will be rejected. All system annotations in v1 now
/// have a corresponding field in v2 WorkerPoolRevisionTemplate.
///
/// This field follows Kubernetes annotations' namespacing, limits, and
/// rules.
#[prost(map = "string, string", tag = "3")]
pub annotations: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// Optional. VPC Access configuration to use for this Revision. For more
/// information, visit
/// <https://cloud.google.com/run/docs/configuring/connecting-vpc.>
#[prost(message, optional, tag = "4")]
pub vpc_access: ::core::option::Option<VpcAccess>,
/// Optional. Email address of the IAM service account associated with the
/// revision of the service. The service account represents the identity of the
/// running revision, and determines what permissions the revision has. If not
/// provided, the revision will use the project's default service account.
#[prost(string, tag = "5")]
pub service_account: ::prost::alloc::string::String,
/// Holds list of the containers that defines the unit of execution for this
/// Revision.
#[prost(message, repeated, tag = "6")]
pub containers: ::prost::alloc::vec::Vec<Container>,
/// Optional. A list of Volumes to make available to containers.
#[prost(message, repeated, tag = "7")]
pub volumes: ::prost::alloc::vec::Vec<Volume>,
/// A reference to a customer managed encryption key (CMEK) to use to encrypt
/// this container image. For more information, go to
/// <https://cloud.google.com/run/docs/securing/using-cmek>
#[prost(string, tag = "8")]
pub encryption_key: ::prost::alloc::string::String,
/// Optional. Enables service mesh connectivity.
#[prost(message, optional, tag = "9")]
pub service_mesh: ::core::option::Option<ServiceMesh>,
/// Optional. The action to take if the encryption key is revoked.
#[prost(enumeration = "EncryptionKeyRevocationAction", tag = "10")]
pub encryption_key_revocation_action: i32,
/// Optional. If encryption_key_revocation_action is SHUTDOWN, the duration
/// before shutting down all instances. The minimum increment is 1 hour.
#[prost(message, optional, tag = "11")]
pub encryption_key_shutdown_duration: ::core::option::Option<
::prost_types::Duration,
>,
/// Optional. The node selector for the revision template.
#[prost(message, optional, tag = "13")]
pub node_selector: ::core::option::Option<NodeSelector>,
/// Optional. True if GPU zonal redundancy is disabled on this worker pool.
#[prost(bool, optional, tag = "16")]
pub gpu_zonal_redundancy_disabled: ::core::option::Option<bool>,
}
/// Request message for creating a WorkerPool.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateWorkerPoolRequest {
/// Required. The location and project in which this worker pool should be
/// created. Format: `projects/{project}/locations/{location}`, where
/// `{project}` can be project id or number. Only lowercase characters, digits,
/// and hyphens.
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// Required. The WorkerPool instance to create.
#[prost(message, optional, tag = "2")]
pub worker_pool: ::core::option::Option<WorkerPool>,
/// Required. The unique identifier for the WorkerPool. It must begin with
/// letter, and cannot end with hyphen; must contain fewer than 50 characters.
/// The name of the worker pool becomes
/// `{parent}/workerPools/{worker_pool_id}`.
#[prost(string, tag = "3")]
pub worker_pool_id: ::prost::alloc::string::String,
/// Optional. Indicates that the request should be validated and default values
/// populated, without persisting the request or creating any resources.
#[prost(bool, tag = "4")]
pub validate_only: bool,
}
/// Request message for updating a worker pool.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateWorkerPoolRequest {
/// Optional. The list of fields to be updated.
#[prost(message, optional, tag = "2")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
/// Required. The WorkerPool to be updated.
#[prost(message, optional, tag = "1")]
pub worker_pool: ::core::option::Option<WorkerPool>,
/// Optional. Indicates that the request should be validated and default values
/// populated, without persisting the request or updating any resources.
#[prost(bool, tag = "3")]
pub validate_only: bool,
/// Optional. If set to true, and if the WorkerPool does not exist, it will
/// create a new one. The caller must have 'run.workerpools.create' permissions
/// if this is set to true and the WorkerPool does not exist.
#[prost(bool, tag = "4")]
pub allow_missing: bool,
/// Optional. If set to true, a new revision will be created from the template
/// even if the system doesn't detect any changes from the previously deployed
/// revision.
///
/// This may be useful for cases where the underlying resources need to be
/// recreated or reinitialized. For example if the image is specified by label,
/// but the underlying image digest has changed) or if the container performs
/// deployment initialization work that needs to be performed again.
#[prost(bool, tag = "5")]
pub force_new_revision: bool,
}
/// Request message for retrieving a list of WorkerPools.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListWorkerPoolsRequest {
/// Required. The location and project to list resources on.
/// Location must be a valid Google Cloud region, and cannot be the "-"
/// wildcard. Format: `projects/{project}/locations/{location}`, where
/// `{project}` can be project id or number.
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// Maximum number of WorkerPools to return in this call.
#[prost(int32, tag = "2")]
pub page_size: i32,
/// A page token received from a previous call to ListWorkerPools.
/// All other parameters must match.
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
/// If true, returns deleted (but unexpired) resources along with active ones.
#[prost(bool, tag = "4")]
pub show_deleted: bool,
}
/// Response message containing a list of WorkerPools.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListWorkerPoolsResponse {
/// The resulting list of WorkerPools.
#[prost(message, repeated, tag = "1")]
pub worker_pools: ::prost::alloc::vec::Vec<WorkerPool>,
/// A token indicating there are more items than page_size. Use it in the next
/// ListWorkerPools request to continue.
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
/// Request message for obtaining a WorkerPool by its full name.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetWorkerPoolRequest {
/// Required. The full name of the WorkerPool.
/// Format:
/// `projects/{project}/locations/{location}/workerPools/{worker_pool}`, where
/// `{project}` can be project id or number.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// Request message to delete a WorkerPool by its full name.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteWorkerPoolRequest {
/// Required. The full name of the WorkerPool.
/// Format:
/// `projects/{project}/locations/{location}/workerPools/{worker_pool}`, where
/// `{project}` can be project id or number.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Optional. Indicates that the request should be validated without actually
/// deleting any resources.
#[prost(bool, tag = "2")]
pub validate_only: bool,
/// A system-generated fingerprint for this version of the
/// resource. May be used to detect modification conflict during updates.
#[prost(string, tag = "3")]
pub etag: ::prost::alloc::string::String,
}
/// WorkerPool acts as a top-level container that manages a set of
/// configurations and revision templates which implement a pull-based workload.
/// WorkerPool exists to provide a singular abstraction which can be access
/// controlled, reasoned about, and which encapsulates software lifecycle
/// decisions such as rollout policy and team resource ownership.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WorkerPool {
/// The fully qualified name of this WorkerPool. In CreateWorkerPoolRequest,
/// this field is ignored, and instead composed from
/// CreateWorkerPoolRequest.parent and CreateWorkerPoolRequest.worker_id.
///
/// Format:
/// `projects/{project}/locations/{location}/workerPools/{worker_id}`
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// User-provided description of the WorkerPool. This field currently has a
/// 512-character limit.
#[prost(string, tag = "2")]
pub description: ::prost::alloc::string::String,
/// Output only. Server assigned unique identifier for the trigger. The value
/// is a UUID4 string and guaranteed to remain unchanged until the resource is
/// deleted.
#[prost(string, tag = "3")]
pub uid: ::prost::alloc::string::String,
/// Output only. A number that monotonically increases every time the user
/// modifies the desired state.
/// Please note that unlike v1, this is an int64 value. As with most Google
/// APIs, its JSON representation will be a `string` instead of an `integer`.
#[prost(int64, tag = "4")]
pub generation: i64,
/// Optional. Unstructured key value map that can be used to organize and
/// categorize objects. User-provided labels are shared with Google's billing
/// system, so they can be used to filter, or break down billing charges by
/// team, component, environment, state, etc. For more information, visit
/// <https://cloud.google.com/resource-manager/docs/creating-managing-labels> or
/// <https://cloud.google.com/run/docs/configuring/labels.>
///
/// Cloud Run API v2 does not support labels with `run.googleapis.com`,
/// `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev`
/// namespaces, and they will be rejected. All system labels in v1 now have a
/// corresponding field in v2 WorkerPool.
#[prost(map = "string, string", tag = "5")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// Optional. Unstructured key value map that may be set by external tools to
/// store and arbitrary metadata. They are not queryable and should be
/// preserved when modifying objects.
///
/// Cloud Run API v2 does not support annotations with `run.googleapis.com`,
/// `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev`
/// namespaces, and they will be rejected in new resources. All system
/// annotations in v1 now have a corresponding field in v2 WorkerPool.
///
/// <p>This field follows Kubernetes
/// annotations' namespacing, limits, and rules.
#[prost(map = "string, string", tag = "6")]
pub annotations: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// Output only. The creation time.
#[prost(message, optional, tag = "7")]
pub create_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. The last-modified time.
#[prost(message, optional, tag = "8")]
pub update_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. The deletion time. It is only populated as a response to a
/// Delete request.
#[prost(message, optional, tag = "9")]
pub delete_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. For a deleted resource, the time after which it will be
/// permamently deleted.
#[prost(message, optional, tag = "10")]
pub expire_time: ::core::option::Option<::prost_types::Timestamp>,
/// Output only. Email address of the authenticated creator.
#[prost(string, tag = "11")]
pub creator: ::prost::alloc::string::String,
/// Output only. Email address of the last authenticated modifier.
#[prost(string, tag = "12")]
pub last_modifier: ::prost::alloc::string::String,
/// Arbitrary identifier for the API client.
#[prost(string, tag = "13")]
pub client: ::prost::alloc::string::String,
/// Arbitrary version identifier for the API client.
#[prost(string, tag = "14")]
pub client_version: ::prost::alloc::string::String,
/// Optional. The launch stage as defined by [Google Cloud Platform
/// Launch Stages](<https://cloud.google.com/terms/launch-stages>).
/// Cloud Run supports `ALPHA`, `BETA`, and `GA`. If no value is specified, GA
/// is assumed.
/// Set the launch stage to a preview stage on input to allow use of preview
/// features in that stage. On read (or output), describes whether the
/// resource uses preview features.
///
/// For example, if ALPHA is provided as input, but only BETA and GA-level
/// features are used, this field will be BETA on output.
#[prost(enumeration = "super::super::super::api::LaunchStage", tag = "16")]
pub launch_stage: i32,
/// Optional. Settings for the Binary Authorization feature.
#[prost(message, optional, tag = "17")]
pub binary_authorization: ::core::option::Option<BinaryAuthorization>,
/// Required. The template used to create revisions for this WorkerPool.
#[prost(message, optional, tag = "18")]
pub template: ::core::option::Option<WorkerPoolRevisionTemplate>,
/// Optional. Specifies how to distribute instances over a collection of
/// Revisions belonging to the WorkerPool. If instance split is empty or not
/// provided, defaults to 100% instances assigned to the latest `Ready`
/// Revision.
#[prost(message, repeated, tag = "26")]
pub instance_splits: ::prost::alloc::vec::Vec<InstanceSplit>,
/// Optional. Specifies worker-pool-level scaling settings
#[prost(message, optional, tag = "20")]
pub scaling: ::core::option::Option<WorkerPoolScaling>,
/// Output only. The generation of this WorkerPool currently serving workloads.
/// See comments in `reconciling` for additional information on reconciliation
/// process in Cloud Run. Please note that unlike v1, this is an int64 value.
/// As with most Google APIs, its JSON representation will be a `string`
/// instead of an `integer`.
#[prost(int64, tag = "30")]
pub observed_generation: i64,
/// Output only. The Condition of this WorkerPool, containing its readiness
/// status, and detailed error information in case it did not reach a serving
/// state. See comments in `reconciling` for additional information on
/// reconciliation process in Cloud Run.
#[prost(message, optional, tag = "31")]
pub terminal_condition: ::core::option::Option<Condition>,
/// Output only. The Conditions of all other associated sub-resources. They
/// contain additional diagnostics information in case the WorkerPool does not
/// reach its Serving state. See comments in `reconciling` for additional
/// information on reconciliation process in Cloud Run.
#[prost(message, repeated, tag = "32")]
pub conditions: ::prost::alloc::vec::Vec<Condition>,
/// Output only. Name of the latest revision that is serving workloads. See
/// comments in `reconciling` for additional information on reconciliation
/// process in Cloud Run.
#[prost(string, tag = "33")]
pub latest_ready_revision: ::prost::alloc::string::String,
/// Output only. Name of the last created revision. See comments in
/// `reconciling` for additional information on reconciliation process in Cloud
/// Run.
#[prost(string, tag = "34")]
pub latest_created_revision: ::prost::alloc::string::String,
/// Output only. Detailed status information for corresponding instance splits.
/// See comments in `reconciling` for additional information on reconciliation
/// process in Cloud Run.
#[prost(message, repeated, tag = "27")]
pub instance_split_statuses: ::prost::alloc::vec::Vec<InstanceSplitStatus>,
/// Output only. Indicates whether Cloud Run Threat Detection monitoring is
/// enabled for the parent project of this worker pool.
#[prost(bool, tag = "28")]
pub threat_detection_enabled: bool,
/// Deprecated: Not supported, and ignored by Cloud Run.
#[deprecated]
#[prost(string, repeated, tag = "37")]
pub custom_audiences: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Output only. Reserved for future use.
#[prost(bool, tag = "38")]
pub satisfies_pzs: bool,
/// Output only. Returns true if the WorkerPool is currently being acted upon
/// by the system to bring it into the desired state.
///
/// When a new WorkerPool is created, or an existing one is updated, Cloud Run
/// will asynchronously perform all necessary steps to bring the WorkerPool to
/// the desired serving state. This process is called reconciliation. While
/// reconciliation is in process, `observed_generation`,
/// `latest_ready_revison`, `instance_split_statuses`, and `uri` will have
/// transient values that might mismatch the intended state: Once
/// reconciliation is over (and this field is false), there are two possible
/// outcomes: reconciliation succeeded and the serving state matches the
/// WorkerPool, or there was an error, and reconciliation failed. This state
/// can be found in `terminal_condition.state`.
///
/// If reconciliation succeeded, the following fields will match:
/// `instance_splits` and `instance_split_statuses`, `observed_generation` and
/// `generation`, `latest_ready_revision` and `latest_created_revision`.
///
/// If reconciliation failed, `instance_split_statuses`, `observed_generation`,
/// and `latest_ready_revision` will have the state of the last serving
/// revision, or empty for newly created WorkerPools. Additional information on
/// the failure can be found in `terminal_condition` and `conditions`.
#[prost(bool, tag = "98")]
pub reconciling: bool,
/// Optional. A system-generated fingerprint for this version of the
/// resource. May be used to detect modification conflict during updates.
#[prost(string, tag = "99")]
pub etag: ::prost::alloc::string::String,
}
/// Generated client implementations.
pub mod worker_pools_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
/// Cloud Run WorkerPool Control Plane API.
#[derive(Debug, Clone)]
pub struct WorkerPoolsClient<T> {
inner: tonic::client::Grpc<T>,
}
impl WorkerPoolsClient<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> WorkerPoolsClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::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,
) -> WorkerPoolsClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
WorkerPoolsClient::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
}
/// Creates a new WorkerPool in a given project and location.
pub async fn create_worker_pool(
&mut self,
request: impl tonic::IntoRequest<super::CreateWorkerPoolRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.run.v2.WorkerPools/CreateWorkerPool",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.run.v2.WorkerPools",
"CreateWorkerPool",
),
);
self.inner.unary(req, path, codec).await
}
/// Gets information about a WorkerPool.
pub async fn get_worker_pool(
&mut self,
request: impl tonic::IntoRequest<super::GetWorkerPoolRequest>,
) -> std::result::Result<tonic::Response<super::WorkerPool>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.run.v2.WorkerPools/GetWorkerPool",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("google.cloud.run.v2.WorkerPools", "GetWorkerPool"),
);
self.inner.unary(req, path, codec).await
}
/// Lists WorkerPools. Results are sorted by creation time, descending.
pub async fn list_worker_pools(
&mut self,
request: impl tonic::IntoRequest<super::ListWorkerPoolsRequest>,
) -> std::result::Result<
tonic::Response<super::ListWorkerPoolsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.run.v2.WorkerPools/ListWorkerPools",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("google.cloud.run.v2.WorkerPools", "ListWorkerPools"),
);
self.inner.unary(req, path, codec).await
}
/// Updates a WorkerPool.
pub async fn update_worker_pool(
&mut self,
request: impl tonic::IntoRequest<super::UpdateWorkerPoolRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.run.v2.WorkerPools/UpdateWorkerPool",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.run.v2.WorkerPools",
"UpdateWorkerPool",
),
);
self.inner.unary(req, path, codec).await
}
/// Deletes a WorkerPool.
pub async fn delete_worker_pool(
&mut self,
request: impl tonic::IntoRequest<super::DeleteWorkerPoolRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.run.v2.WorkerPools/DeleteWorkerPool",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.run.v2.WorkerPools",
"DeleteWorkerPool",
),
);
self.inner.unary(req, path, codec).await
}
/// Gets the IAM Access Control policy currently in effect for the given
/// Cloud Run WorkerPool. This result does not include any inherited policies.
pub async fn get_iam_policy(
&mut self,
request: impl tonic::IntoRequest<
super::super::super::super::iam::v1::GetIamPolicyRequest,
>,
) -> std::result::Result<
tonic::Response<super::super::super::super::iam::v1::Policy>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.run.v2.WorkerPools/GetIamPolicy",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("google.cloud.run.v2.WorkerPools", "GetIamPolicy"),
);
self.inner.unary(req, path, codec).await
}
/// Sets the IAM Access control policy for the specified WorkerPool. Overwrites
/// any existing policy.
pub async fn set_iam_policy(
&mut self,
request: impl tonic::IntoRequest<
super::super::super::super::iam::v1::SetIamPolicyRequest,
>,
) -> std::result::Result<
tonic::Response<super::super::super::super::iam::v1::Policy>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.run.v2.WorkerPools/SetIamPolicy",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("google.cloud.run.v2.WorkerPools", "SetIamPolicy"),
);
self.inner.unary(req, path, codec).await
}
/// Returns permissions that a caller has on the specified Project.
///
/// There are no permissions required for making this API call.
pub async fn test_iam_permissions(
&mut self,
request: impl tonic::IntoRequest<
super::super::super::super::iam::v1::TestIamPermissionsRequest,
>,
) -> std::result::Result<
tonic::Response<
super::super::super::super::iam::v1::TestIamPermissionsResponse,
>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.run.v2.WorkerPools/TestIamPermissions",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.run.v2.WorkerPools",
"TestIamPermissions",
),
);
self.inner.unary(req, path, codec).await
}
}
}