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
// ================================================================= // // * WARNING * // // This file is generated! // // Changes made to this file will be overwritten. If changes are // required to the generated code, the service_crategen project // must be updated to generate the changes. // // ================================================================= use std::error::Error; use std::fmt; #[allow(warnings)] use futures::future; use futures::Future; use rusoto_core::credential::ProvideAwsCredentials; use rusoto_core::region; use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest}; use rusoto_core::{Client, RusotoError, RusotoFuture}; use rusoto_core::proto; use rusoto_core::signature::SignedRequest; use serde_json; /// <p>An object representing an AWS Batch array job.</p> #[derive(Default, Debug, Clone, PartialEq, Serialize)] pub struct ArrayProperties { /// <p>The size of the array job.</p> #[serde(rename = "size")] #[serde(skip_serializing_if = "Option::is_none")] pub size: Option<i64>, } /// <p>An object representing the array properties of a job.</p> #[derive(Default, Debug, Clone, PartialEq, Deserialize)] #[cfg_attr(test, derive(Serialize))] pub struct ArrayPropertiesDetail { /// <p>The job index within the array that is associated with this job. This parameter is returned for array job children.</p> #[serde(rename = "index")] #[serde(skip_serializing_if = "Option::is_none")] pub index: Option<i64>, /// <p>The size of the array job. This parameter is returned for parent array jobs.</p> #[serde(rename = "size")] #[serde(skip_serializing_if = "Option::is_none")] pub size: Option<i64>, /// <p>A summary of the number of array job children in each available job status. This parameter is returned for parent array jobs.</p> #[serde(rename = "statusSummary")] #[serde(skip_serializing_if = "Option::is_none")] pub status_summary: Option<::std::collections::HashMap<String, i64>>, } /// <p>An object representing the array properties of a job.</p> #[derive(Default, Debug, Clone, PartialEq, Deserialize)] #[cfg_attr(test, derive(Serialize))] pub struct ArrayPropertiesSummary { /// <p>The job index within the array that is associated with this job. This parameter is returned for children of array jobs.</p> #[serde(rename = "index")] #[serde(skip_serializing_if = "Option::is_none")] pub index: Option<i64>, /// <p>The size of the array job. This parameter is returned for parent array jobs.</p> #[serde(rename = "size")] #[serde(skip_serializing_if = "Option::is_none")] pub size: Option<i64>, } /// <p>An object representing the details of a container that is part of a job attempt.</p> #[derive(Default, Debug, Clone, PartialEq, Deserialize)] #[cfg_attr(test, derive(Serialize))] pub struct AttemptContainerDetail { /// <p>The Amazon Resource Name (ARN) of the Amazon ECS container instance that hosts the job attempt.</p> #[serde(rename = "containerInstanceArn")] #[serde(skip_serializing_if = "Option::is_none")] pub container_instance_arn: Option<String>, /// <p>The exit code for the job attempt. A non-zero exit code is considered a failure.</p> #[serde(rename = "exitCode")] #[serde(skip_serializing_if = "Option::is_none")] pub exit_code: Option<i64>, /// <p>The name of the CloudWatch Logs log stream associated with the container. The log group for AWS Batch jobs is <code>/aws/batch/job</code>. Each container attempt receives a log stream name when they reach the <code>RUNNING</code> status.</p> #[serde(rename = "logStreamName")] #[serde(skip_serializing_if = "Option::is_none")] pub log_stream_name: Option<String>, /// <p>The network interfaces associated with the job attempt.</p> #[serde(rename = "networkInterfaces")] #[serde(skip_serializing_if = "Option::is_none")] pub network_interfaces: Option<Vec<NetworkInterface>>, /// <p>A short (255 max characters) human-readable string to provide additional details about a running or stopped container.</p> #[serde(rename = "reason")] #[serde(skip_serializing_if = "Option::is_none")] pub reason: Option<String>, /// <p>The Amazon Resource Name (ARN) of the Amazon ECS task that is associated with the job attempt. Each container attempt receives a task ARN when they reach the <code>STARTING</code> status.</p> #[serde(rename = "taskArn")] #[serde(skip_serializing_if = "Option::is_none")] pub task_arn: Option<String>, } /// <p>An object representing a job attempt.</p> #[derive(Default, Debug, Clone, PartialEq, Deserialize)] #[cfg_attr(test, derive(Serialize))] pub struct AttemptDetail { /// <p>Details about the container in this job attempt.</p> #[serde(rename = "container")] #[serde(skip_serializing_if = "Option::is_none")] pub container: Option<AttemptContainerDetail>, /// <p>The Unix timestamp (in seconds and milliseconds) for when the attempt was started (when the attempt transitioned from the <code>STARTING</code> state to the <code>RUNNING</code> state).</p> #[serde(rename = "startedAt")] #[serde(skip_serializing_if = "Option::is_none")] pub started_at: Option<i64>, /// <p>A short, human-readable string to provide additional details about the current status of the job attempt.</p> #[serde(rename = "statusReason")] #[serde(skip_serializing_if = "Option::is_none")] pub status_reason: Option<String>, /// <p>The Unix timestamp (in seconds and milliseconds) for when the attempt was stopped (when the attempt transitioned from the <code>RUNNING</code> state to a terminal state, such as <code>SUCCEEDED</code> or <code>FAILED</code>).</p> #[serde(rename = "stoppedAt")] #[serde(skip_serializing_if = "Option::is_none")] pub stopped_at: Option<i64>, } #[derive(Default, Debug, Clone, PartialEq, Serialize)] pub struct CancelJobRequest { /// <p>The AWS Batch job ID of the job to cancel.</p> #[serde(rename = "jobId")] pub job_id: String, /// <p>A message to attach to the job that explains the reason for canceling it. This message is returned by future <a>DescribeJobs</a> operations on the job. This message is also recorded in the AWS Batch activity logs. </p> #[serde(rename = "reason")] pub reason: String, } #[derive(Default, Debug, Clone, PartialEq, Deserialize)] #[cfg_attr(test, derive(Serialize))] pub struct CancelJobResponse {} /// <p>An object representing an AWS Batch compute environment.</p> #[derive(Default, Debug, Clone, PartialEq, Deserialize)] #[cfg_attr(test, derive(Serialize))] pub struct ComputeEnvironmentDetail { /// <p>The Amazon Resource Name (ARN) of the compute environment. </p> #[serde(rename = "computeEnvironmentArn")] pub compute_environment_arn: String, /// <p>The name of the compute environment. </p> #[serde(rename = "computeEnvironmentName")] pub compute_environment_name: String, /// <p>The compute resources defined for the compute environment. </p> #[serde(rename = "computeResources")] #[serde(skip_serializing_if = "Option::is_none")] pub compute_resources: Option<ComputeResource>, /// <p>The Amazon Resource Name (ARN) of the underlying Amazon ECS cluster used by the compute environment. </p> #[serde(rename = "ecsClusterArn")] pub ecs_cluster_arn: String, /// <p>The service role associated with the compute environment that allows AWS Batch to make calls to AWS API operations on your behalf.</p> #[serde(rename = "serviceRole")] #[serde(skip_serializing_if = "Option::is_none")] pub service_role: Option<String>, /// <p>The state of the compute environment. The valid values are <code>ENABLED</code> or <code>DISABLED</code>. </p> <p>If the state is <code>ENABLED</code>, then the AWS Batch scheduler can attempt to place jobs from an associated job queue on the compute resources within the environment. If the compute environment is managed, then it can scale its instances out or in automatically, based on the job queue demand.</p> <p>If the state is <code>DISABLED</code>, then the AWS Batch scheduler does not attempt to place jobs within the environment. Jobs in a <code>STARTING</code> or <code>RUNNING</code> state continue to progress normally. Managed compute environments in the <code>DISABLED</code> state do not scale out. However, they scale in to <code>minvCpus</code> value after instances become idle.</p> #[serde(rename = "state")] #[serde(skip_serializing_if = "Option::is_none")] pub state: Option<String>, /// <p>The current status of the compute environment (for example, <code>CREATING</code> or <code>VALID</code>).</p> #[serde(rename = "status")] #[serde(skip_serializing_if = "Option::is_none")] pub status: Option<String>, /// <p>A short, human-readable string to provide additional details about the current status of the compute environment.</p> #[serde(rename = "statusReason")] #[serde(skip_serializing_if = "Option::is_none")] pub status_reason: Option<String>, /// <p>The type of the compute environment.</p> #[serde(rename = "type")] #[serde(skip_serializing_if = "Option::is_none")] pub type_: Option<String>, } /// <p>The order in which compute environments are tried for job placement within a queue. Compute environments are tried in ascending order. For example, if two compute environments are associated with a job queue, the compute environment with a lower order integer value is tried for job placement first.</p> #[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct ComputeEnvironmentOrder { /// <p>The Amazon Resource Name (ARN) of the compute environment.</p> #[serde(rename = "computeEnvironment")] pub compute_environment: String, /// <p>The order of the compute environment.</p> #[serde(rename = "order")] pub order: i64, } /// <p>An object representing an AWS Batch compute resource.</p> #[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct ComputeResource { /// <p>The maximum percentage that a Spot Instance price can be when compared with the On-Demand price for that instance type before instances are launched. For example, if your maximum percentage is 20%, then the Spot price must be below 20% of the current On-Demand price for that EC2 instance. You always pay the lowest (market) price and never more than your maximum percentage. If you leave this field empty, the default value is 100% of the On-Demand price.</p> #[serde(rename = "bidPercentage")] #[serde(skip_serializing_if = "Option::is_none")] pub bid_percentage: Option<i64>, /// <p>The desired number of EC2 vCPUS in the compute environment. </p> #[serde(rename = "desiredvCpus")] #[serde(skip_serializing_if = "Option::is_none")] pub desiredv_cpus: Option<i64>, /// <p>The EC2 key pair that is used for instances launched in the compute environment.</p> #[serde(rename = "ec2KeyPair")] #[serde(skip_serializing_if = "Option::is_none")] pub ec_2_key_pair: Option<String>, /// <p>The Amazon Machine Image (AMI) ID used for instances launched in the compute environment.</p> #[serde(rename = "imageId")] #[serde(skip_serializing_if = "Option::is_none")] pub image_id: Option<String>, /// <p>The Amazon ECS instance profile applied to Amazon EC2 instances in a compute environment. You can specify the short name or full Amazon Resource Name (ARN) of an instance profile. For example, <code> <i>ecsInstanceRole</i> </code> or <code>arn:aws:iam::<i><aws_account_id></i>:instance-profile/<i>ecsInstanceRole</i> </code>. For more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/instance_IAM_role.html">Amazon ECS Instance Role</a> in the <i>AWS Batch User Guide</i>.</p> #[serde(rename = "instanceRole")] pub instance_role: String, /// <p>The instances types that may be launched. You can specify instance families to launch any instance type within those families (for example, <code>c4</code> or <code>p3</code>), or you can specify specific sizes within a family (such as <code>c4.8xlarge</code>). You can also choose <code>optimal</code> to pick instance types (from the C, M, and R instance families) on the fly that match the demand of your job queues.</p> #[serde(rename = "instanceTypes")] pub instance_types: Vec<String>, /// <p>The launch template to use for your compute resources. Any other compute resource parameters that you specify in a <a>CreateComputeEnvironment</a> API operation override the same parameters in the launch template. You must specify either the launch template ID or launch template name in the request, but not both. For more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/launch-templates.html">Launch Template Support</a> in the <i>AWS Batch User Guide</i>.</p> #[serde(rename = "launchTemplate")] #[serde(skip_serializing_if = "Option::is_none")] pub launch_template: Option<LaunchTemplateSpecification>, /// <p>The maximum number of EC2 vCPUs that an environment can reach. </p> #[serde(rename = "maxvCpus")] pub maxv_cpus: i64, /// <p>The minimum number of EC2 vCPUs that an environment should maintain (even if the compute environment is <code>DISABLED</code>). </p> #[serde(rename = "minvCpus")] pub minv_cpus: i64, /// <p>The Amazon EC2 placement group to associate with your compute resources. If you intend to submit multi-node parallel jobs to your compute environment, you should consider creating a cluster placement group and associate it with your compute resources. This keeps your multi-node parallel job on a logical grouping of instances within a single Availability Zone with high network flow potential. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html">Placement Groups</a> in the <i>Amazon EC2 User Guide for Linux Instances</i>.</p> #[serde(rename = "placementGroup")] #[serde(skip_serializing_if = "Option::is_none")] pub placement_group: Option<String>, /// <p>The EC2 security group that is associated with instances launched in the compute environment. </p> #[serde(rename = "securityGroupIds")] #[serde(skip_serializing_if = "Option::is_none")] pub security_group_ids: Option<Vec<String>>, /// <p>The Amazon Resource Name (ARN) of the Amazon EC2 Spot Fleet IAM role applied to a <code>SPOT</code> compute environment. For more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/spot_fleet_IAM_role.html">Amazon EC2 Spot Fleet Role</a> in the <i>AWS Batch User Guide</i>.</p> #[serde(rename = "spotIamFleetRole")] #[serde(skip_serializing_if = "Option::is_none")] pub spot_iam_fleet_role: Option<String>, /// <p>The VPC subnets into which the compute resources are launched. </p> #[serde(rename = "subnets")] pub subnets: Vec<String>, /// <p>Key-value pair tags to be applied to resources that are launched in the compute environment. For AWS Batch, these take the form of "String1": "String2", where String1 is the tag key and String2 is the tag value—for example, { "Name": "AWS Batch Instance - C4OnDemand" }.</p> #[serde(rename = "tags")] #[serde(skip_serializing_if = "Option::is_none")] pub tags: Option<::std::collections::HashMap<String, String>>, /// <p>The type of compute environment: EC2 or SPOT.</p> #[serde(rename = "type")] pub type_: String, } /// <p>An object representing the attributes of a compute environment that can be updated.</p> #[derive(Default, Debug, Clone, PartialEq, Serialize)] pub struct ComputeResourceUpdate { /// <p>The desired number of EC2 vCPUS in the compute environment.</p> #[serde(rename = "desiredvCpus")] #[serde(skip_serializing_if = "Option::is_none")] pub desiredv_cpus: Option<i64>, /// <p>The maximum number of EC2 vCPUs that an environment can reach.</p> #[serde(rename = "maxvCpus")] #[serde(skip_serializing_if = "Option::is_none")] pub maxv_cpus: Option<i64>, /// <p>The minimum number of EC2 vCPUs that an environment should maintain.</p> #[serde(rename = "minvCpus")] #[serde(skip_serializing_if = "Option::is_none")] pub minv_cpus: Option<i64>, } /// <p>An object representing the details of a container that is part of a job.</p> #[derive(Default, Debug, Clone, PartialEq, Deserialize)] #[cfg_attr(test, derive(Serialize))] pub struct ContainerDetail { /// <p>The command that is passed to the container. </p> #[serde(rename = "command")] #[serde(skip_serializing_if = "Option::is_none")] pub command: Option<Vec<String>>, /// <p>The Amazon Resource Name (ARN) of the container instance on which the container is running.</p> #[serde(rename = "containerInstanceArn")] #[serde(skip_serializing_if = "Option::is_none")] pub container_instance_arn: Option<String>, /// <p><p>The environment variables to pass to a container.</p> <note> <p>Environment variables must not start with <code>AWS_BATCH</code>; this naming convention is reserved for variables that are set by the AWS Batch service.</p> </note></p> #[serde(rename = "environment")] #[serde(skip_serializing_if = "Option::is_none")] pub environment: Option<Vec<KeyValuePair>>, /// <p>The exit code to return upon completion.</p> #[serde(rename = "exitCode")] #[serde(skip_serializing_if = "Option::is_none")] pub exit_code: Option<i64>, /// <p>The image used to start the container.</p> #[serde(rename = "image")] #[serde(skip_serializing_if = "Option::is_none")] pub image: Option<String>, /// <p>The instance type of the underlying host infrastructure of a multi-node parallel job.</p> #[serde(rename = "instanceType")] #[serde(skip_serializing_if = "Option::is_none")] pub instance_type: Option<String>, /// <p>The Amazon Resource Name (ARN) associated with the job upon execution. </p> #[serde(rename = "jobRoleArn")] #[serde(skip_serializing_if = "Option::is_none")] pub job_role_arn: Option<String>, /// <p>The name of the CloudWatch Logs log stream associated with the container. The log group for AWS Batch jobs is <code>/aws/batch/job</code>. Each container attempt receives a log stream name when they reach the <code>RUNNING</code> status.</p> #[serde(rename = "logStreamName")] #[serde(skip_serializing_if = "Option::is_none")] pub log_stream_name: Option<String>, /// <p>The number of MiB of memory reserved for the job.</p> #[serde(rename = "memory")] #[serde(skip_serializing_if = "Option::is_none")] pub memory: Option<i64>, /// <p>The mount points for data volumes in your container.</p> #[serde(rename = "mountPoints")] #[serde(skip_serializing_if = "Option::is_none")] pub mount_points: Option<Vec<MountPoint>>, /// <p>The network interfaces associated with the job.</p> #[serde(rename = "networkInterfaces")] #[serde(skip_serializing_if = "Option::is_none")] pub network_interfaces: Option<Vec<NetworkInterface>>, /// <p>When this parameter is true, the container is given elevated privileges on the host container instance (similar to the <code>root</code> user).</p> #[serde(rename = "privileged")] #[serde(skip_serializing_if = "Option::is_none")] pub privileged: Option<bool>, /// <p>When this parameter is true, the container is given read-only access to its root file system.</p> #[serde(rename = "readonlyRootFilesystem")] #[serde(skip_serializing_if = "Option::is_none")] pub readonly_root_filesystem: Option<bool>, /// <p>A short (255 max characters) human-readable string to provide additional details about a running or stopped container.</p> #[serde(rename = "reason")] #[serde(skip_serializing_if = "Option::is_none")] pub reason: Option<String>, /// <p>The type and amount of a resource to assign to a container. Currently, the only supported resource is <code>GPU</code>.</p> #[serde(rename = "resourceRequirements")] #[serde(skip_serializing_if = "Option::is_none")] pub resource_requirements: Option<Vec<ResourceRequirement>>, /// <p>The Amazon Resource Name (ARN) of the Amazon ECS task that is associated with the container job. Each container attempt receives a task ARN when they reach the <code>STARTING</code> status.</p> #[serde(rename = "taskArn")] #[serde(skip_serializing_if = "Option::is_none")] pub task_arn: Option<String>, /// <p>A list of <code>ulimit</code> values to set in the container.</p> #[serde(rename = "ulimits")] #[serde(skip_serializing_if = "Option::is_none")] pub ulimits: Option<Vec<Ulimit>>, /// <p>The user name to use inside the container.</p> #[serde(rename = "user")] #[serde(skip_serializing_if = "Option::is_none")] pub user: Option<String>, /// <p>The number of VCPUs allocated for the job. </p> #[serde(rename = "vcpus")] #[serde(skip_serializing_if = "Option::is_none")] pub vcpus: Option<i64>, /// <p>A list of volumes associated with the job.</p> #[serde(rename = "volumes")] #[serde(skip_serializing_if = "Option::is_none")] pub volumes: Option<Vec<Volume>>, } /// <p>The overrides that should be sent to a container.</p> #[derive(Default, Debug, Clone, PartialEq, Serialize)] pub struct ContainerOverrides { /// <p>The command to send to the container that overrides the default command from the Docker image or the job definition.</p> #[serde(rename = "command")] #[serde(skip_serializing_if = "Option::is_none")] pub command: Option<Vec<String>>, /// <p><p>The environment variables to send to the container. You can add new environment variables, which are added to the container at launch, or you can override the existing environment variables from the Docker image or the job definition.</p> <note> <p>Environment variables must not start with <code>AWS_BATCH</code>; this naming convention is reserved for variables that are set by the AWS Batch service.</p> </note></p> #[serde(rename = "environment")] #[serde(skip_serializing_if = "Option::is_none")] pub environment: Option<Vec<KeyValuePair>>, /// <p>The instance type to use for a multi-node parallel job. This parameter is not valid for single-node container jobs.</p> #[serde(rename = "instanceType")] #[serde(skip_serializing_if = "Option::is_none")] pub instance_type: Option<String>, /// <p>The number of MiB of memory reserved for the job. This value overrides the value set in the job definition.</p> #[serde(rename = "memory")] #[serde(skip_serializing_if = "Option::is_none")] pub memory: Option<i64>, /// <p>The type and amount of a resource to assign to a container. This value overrides the value set in the job definition. Currently, the only supported resource is <code>GPU</code>.</p> #[serde(rename = "resourceRequirements")] #[serde(skip_serializing_if = "Option::is_none")] pub resource_requirements: Option<Vec<ResourceRequirement>>, /// <p>The number of vCPUs to reserve for the container. This value overrides the value set in the job definition.</p> #[serde(rename = "vcpus")] #[serde(skip_serializing_if = "Option::is_none")] pub vcpus: Option<i64>, } /// <p>Container properties are used in job definitions to describe the container that is launched as part of a job.</p> #[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct ContainerProperties { /// <p>The command that is passed to the container. This parameter maps to <code>Cmd</code> in the <a href="https://docs.docker.com/engine/api/v1.23/#create-a-container">Create a container</a> section of the <a href="https://docs.docker.com/engine/api/v1.23/">Docker Remote API</a> and the <code>COMMAND</code> parameter to <a href="https://docs.docker.com/engine/reference/run/">docker run</a>. For more information, see <a href="https://docs.docker.com/engine/reference/builder/#cmd">https://docs.docker.com/engine/reference/builder/#cmd</a>.</p> #[serde(rename = "command")] #[serde(skip_serializing_if = "Option::is_none")] pub command: Option<Vec<String>>, /// <p><p>The environment variables to pass to a container. This parameter maps to <code>Env</code> in the <a href="https://docs.docker.com/engine/api/v1.23/#create-a-container">Create a container</a> section of the <a href="https://docs.docker.com/engine/api/v1.23/">Docker Remote API</a> and the <code>--env</code> option to <a href="https://docs.docker.com/engine/reference/run/">docker run</a>.</p> <important> <p>We do not recommend using plaintext environment variables for sensitive information, such as credential data.</p> </important> <note> <p>Environment variables must not start with <code>AWS_BATCH</code>; this naming convention is reserved for variables that are set by the AWS Batch service.</p> </note></p> #[serde(rename = "environment")] #[serde(skip_serializing_if = "Option::is_none")] pub environment: Option<Vec<KeyValuePair>>, /// <p><p>The image used to start a container. This string is passed directly to the Docker daemon. Images in the Docker Hub registry are available by default. Other repositories are specified with <code> <i>repository-url</i>/<i>image</i>:<i>tag</i> </code>. Up to 255 letters (uppercase and lowercase), numbers, hyphens, underscores, colons, periods, forward slashes, and number signs are allowed. This parameter maps to <code>Image</code> in the <a href="https://docs.docker.com/engine/api/v1.23/#create-a-container">Create a container</a> section of the <a href="https://docs.docker.com/engine/api/v1.23/">Docker Remote API</a> and the <code>IMAGE</code> parameter of <a href="https://docs.docker.com/engine/reference/run/">docker run</a>.</p> <ul> <li> <p>Images in Amazon ECR repositories use the full registry and repository URI (for example, <code>012345678910.dkr.ecr.<region-name>.amazonaws.com/<repository-name></code>).</p> </li> <li> <p>Images in official repositories on Docker Hub use a single name (for example, <code>ubuntu</code> or <code>mongo</code>).</p> </li> <li> <p>Images in other repositories on Docker Hub are qualified with an organization name (for example, <code>amazon/amazon-ecs-agent</code>).</p> </li> <li> <p>Images in other online repositories are qualified further by a domain name (for example, <code>quay.io/assemblyline/ubuntu</code>).</p> </li> </ul></p> #[serde(rename = "image")] #[serde(skip_serializing_if = "Option::is_none")] pub image: Option<String>, /// <p>The instance type to use for a multi-node parallel job. Currently all node groups in a multi-node parallel job must use the same instance type. This parameter is not valid for single-node container jobs.</p> #[serde(rename = "instanceType")] #[serde(skip_serializing_if = "Option::is_none")] pub instance_type: Option<String>, /// <p>The Amazon Resource Name (ARN) of the IAM role that the container can assume for AWS permissions.</p> #[serde(rename = "jobRoleArn")] #[serde(skip_serializing_if = "Option::is_none")] pub job_role_arn: Option<String>, /// <p><p>The hard limit (in MiB) of memory to present to the container. If your container attempts to exceed the memory specified here, the container is killed. This parameter maps to <code>Memory</code> in the <a href="https://docs.docker.com/engine/api/v1.23/#create-a-container">Create a container</a> section of the <a href="https://docs.docker.com/engine/api/v1.23/">Docker Remote API</a> and the <code>--memory</code> option to <a href="https://docs.docker.com/engine/reference/run/">docker run</a>. You must specify at least 4 MiB of memory for a job.</p> <note> <p>If you are trying to maximize your resource utilization by providing your jobs as much memory as possible for a particular instance type, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/memory-management.html">Memory Management</a> in the <i>AWS Batch User Guide</i>.</p> </note></p> #[serde(rename = "memory")] #[serde(skip_serializing_if = "Option::is_none")] pub memory: Option<i64>, /// <p>The mount points for data volumes in your container. This parameter maps to <code>Volumes</code> in the <a href="https://docs.docker.com/engine/api/v1.23/#create-a-container">Create a container</a> section of the <a href="https://docs.docker.com/engine/api/v1.23/">Docker Remote API</a> and the <code>--volume</code> option to <a href="https://docs.docker.com/engine/reference/run/">docker run</a>.</p> #[serde(rename = "mountPoints")] #[serde(skip_serializing_if = "Option::is_none")] pub mount_points: Option<Vec<MountPoint>>, /// <p>When this parameter is true, the container is given elevated privileges on the host container instance (similar to the <code>root</code> user). This parameter maps to <code>Privileged</code> in the <a href="https://docs.docker.com/engine/api/v1.23/#create-a-container">Create a container</a> section of the <a href="https://docs.docker.com/engine/api/v1.23/">Docker Remote API</a> and the <code>--privileged</code> option to <a href="https://docs.docker.com/engine/reference/run/">docker run</a>.</p> #[serde(rename = "privileged")] #[serde(skip_serializing_if = "Option::is_none")] pub privileged: Option<bool>, /// <p>When this parameter is true, the container is given read-only access to its root file system. This parameter maps to <code>ReadonlyRootfs</code> in the <a href="https://docs.docker.com/engine/api/v1.23/#create-a-container">Create a container</a> section of the <a href="https://docs.docker.com/engine/api/v1.23/">Docker Remote API</a> and the <code>--read-only</code> option to <code>docker run</code>.</p> #[serde(rename = "readonlyRootFilesystem")] #[serde(skip_serializing_if = "Option::is_none")] pub readonly_root_filesystem: Option<bool>, /// <p>The type and amount of a resource to assign to a container. Currently, the only supported resource is <code>GPU</code>.</p> #[serde(rename = "resourceRequirements")] #[serde(skip_serializing_if = "Option::is_none")] pub resource_requirements: Option<Vec<ResourceRequirement>>, /// <p>A list of <code>ulimits</code> to set in the container. This parameter maps to <code>Ulimits</code> in the <a href="https://docs.docker.com/engine/api/v1.23/#create-a-container">Create a container</a> section of the <a href="https://docs.docker.com/engine/api/v1.23/">Docker Remote API</a> and the <code>--ulimit</code> option to <a href="https://docs.docker.com/engine/reference/run/">docker run</a>.</p> #[serde(rename = "ulimits")] #[serde(skip_serializing_if = "Option::is_none")] pub ulimits: Option<Vec<Ulimit>>, /// <p>The user name to use inside the container. This parameter maps to <code>User</code> in the <a href="https://docs.docker.com/engine/api/v1.23/#create-a-container">Create a container</a> section of the <a href="https://docs.docker.com/engine/api/v1.23/">Docker Remote API</a> and the <code>--user</code> option to <a href="https://docs.docker.com/engine/reference/run/">docker run</a>.</p> #[serde(rename = "user")] #[serde(skip_serializing_if = "Option::is_none")] pub user: Option<String>, /// <p>The number of vCPUs reserved for the container. This parameter maps to <code>CpuShares</code> in the <a href="https://docs.docker.com/engine/api/v1.23/#create-a-container">Create a container</a> section of the <a href="https://docs.docker.com/engine/api/v1.23/">Docker Remote API</a> and the <code>--cpu-shares</code> option to <a href="https://docs.docker.com/engine/reference/run/">docker run</a>. Each vCPU is equivalent to 1,024 CPU shares. You must specify at least one vCPU.</p> #[serde(rename = "vcpus")] #[serde(skip_serializing_if = "Option::is_none")] pub vcpus: Option<i64>, /// <p>A list of data volumes used in a job.</p> #[serde(rename = "volumes")] #[serde(skip_serializing_if = "Option::is_none")] pub volumes: Option<Vec<Volume>>, } /// <p>An object representing summary details of a container within a job.</p> #[derive(Default, Debug, Clone, PartialEq, Deserialize)] #[cfg_attr(test, derive(Serialize))] pub struct ContainerSummary { /// <p>The exit code to return upon completion.</p> #[serde(rename = "exitCode")] #[serde(skip_serializing_if = "Option::is_none")] pub exit_code: Option<i64>, /// <p>A short (255 max characters) human-readable string to provide additional details about a running or stopped container.</p> #[serde(rename = "reason")] #[serde(skip_serializing_if = "Option::is_none")] pub reason: Option<String>, } #[derive(Default, Debug, Clone, PartialEq, Serialize)] pub struct CreateComputeEnvironmentRequest { /// <p>The name for your compute environment. Up to 128 letters (uppercase and lowercase), numbers, hyphens, and underscores are allowed.</p> #[serde(rename = "computeEnvironmentName")] pub compute_environment_name: String, /// <p>Details of the compute resources managed by the compute environment. This parameter is required for managed compute environments. For more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/compute_environments.html">Compute Environments</a> in the <i>AWS Batch User Guide</i>.</p> #[serde(rename = "computeResources")] #[serde(skip_serializing_if = "Option::is_none")] pub compute_resources: Option<ComputeResource>, /// <p><p>The full Amazon Resource Name (ARN) of the IAM role that allows AWS Batch to make calls to other AWS services on your behalf.</p> <p>If your specified role has a path other than <code>/</code>, then you must either specify the full role ARN (this is recommended) or prefix the role name with the path.</p> <note> <p>Depending on how you created your AWS Batch service role, its ARN may contain the <code>service-role</code> path prefix. When you only specify the name of the service role, AWS Batch assumes that your ARN does not use the <code>service-role</code> path prefix. Because of this, we recommend that you specify the full ARN of your service role when you create compute environments.</p> </note></p> #[serde(rename = "serviceRole")] pub service_role: String, /// <p>The state of the compute environment. If the state is <code>ENABLED</code>, then the compute environment accepts jobs from a queue and can scale out automatically based on queues.</p> #[serde(rename = "state")] #[serde(skip_serializing_if = "Option::is_none")] pub state: Option<String>, /// <p>The type of the compute environment. For more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/compute_environments.html">Compute Environments</a> in the <i>AWS Batch User Guide</i>.</p> #[serde(rename = "type")] pub type_: String, } #[derive(Default, Debug, Clone, PartialEq, Deserialize)] #[cfg_attr(test, derive(Serialize))] pub struct CreateComputeEnvironmentResponse { /// <p>The Amazon Resource Name (ARN) of the compute environment. </p> #[serde(rename = "computeEnvironmentArn")] #[serde(skip_serializing_if = "Option::is_none")] pub compute_environment_arn: Option<String>, /// <p>The name of the compute environment.</p> #[serde(rename = "computeEnvironmentName")] #[serde(skip_serializing_if = "Option::is_none")] pub compute_environment_name: Option<String>, } #[derive(Default, Debug, Clone, PartialEq, Serialize)] pub struct CreateJobQueueRequest { /// <p>The set of compute environments mapped to a job queue and their order relative to each other. The job scheduler uses this parameter to determine which compute environment should execute a given job. Compute environments must be in the <code>VALID</code> state before you can associate them with a job queue. You can associate up to three compute environments with a job queue.</p> #[serde(rename = "computeEnvironmentOrder")] pub compute_environment_order: Vec<ComputeEnvironmentOrder>, /// <p>The name of the job queue.</p> #[serde(rename = "jobQueueName")] pub job_queue_name: String, /// <p>The priority of the job queue. Job queues with a higher priority (or a higher integer value for the <code>priority</code> parameter) are evaluated first when associated with the same compute environment. Priority is determined in descending order, for example, a job queue with a priority value of <code>10</code> is given scheduling preference over a job queue with a priority value of <code>1</code>.</p> #[serde(rename = "priority")] pub priority: i64, /// <p>The state of the job queue. If the job queue state is <code>ENABLED</code>, it is able to accept jobs.</p> #[serde(rename = "state")] #[serde(skip_serializing_if = "Option::is_none")] pub state: Option<String>, } #[derive(Default, Debug, Clone, PartialEq, Deserialize)] #[cfg_attr(test, derive(Serialize))] pub struct CreateJobQueueResponse { /// <p>The Amazon Resource Name (ARN) of the job queue.</p> #[serde(rename = "jobQueueArn")] pub job_queue_arn: String, /// <p>The name of the job queue.</p> #[serde(rename = "jobQueueName")] pub job_queue_name: String, } #[derive(Default, Debug, Clone, PartialEq, Serialize)] pub struct DeleteComputeEnvironmentRequest { /// <p>The name or Amazon Resource Name (ARN) of the compute environment to delete. </p> #[serde(rename = "computeEnvironment")] pub compute_environment: String, } #[derive(Default, Debug, Clone, PartialEq, Deserialize)] #[cfg_attr(test, derive(Serialize))] pub struct DeleteComputeEnvironmentResponse {} #[derive(Default, Debug, Clone, PartialEq, Serialize)] pub struct DeleteJobQueueRequest { /// <p>The short name or full Amazon Resource Name (ARN) of the queue to delete. </p> #[serde(rename = "jobQueue")] pub job_queue: String, } #[derive(Default, Debug, Clone, PartialEq, Deserialize)] #[cfg_attr(test, derive(Serialize))] pub struct DeleteJobQueueResponse {} #[derive(Default, Debug, Clone, PartialEq, Serialize)] pub struct DeregisterJobDefinitionRequest { /// <p>The name and revision (<code>name:revision</code>) or full Amazon Resource Name (ARN) of the job definition to deregister. </p> #[serde(rename = "jobDefinition")] pub job_definition: String, } #[derive(Default, Debug, Clone, PartialEq, Deserialize)] #[cfg_attr(test, derive(Serialize))] pub struct DeregisterJobDefinitionResponse {} #[derive(Default, Debug, Clone, PartialEq, Serialize)] pub struct DescribeComputeEnvironmentsRequest { /// <p>A list of up to 100 compute environment names or full Amazon Resource Name (ARN) entries. </p> #[serde(rename = "computeEnvironments")] #[serde(skip_serializing_if = "Option::is_none")] pub compute_environments: Option<Vec<String>>, /// <p>The maximum number of cluster results returned by <code>DescribeComputeEnvironments</code> in paginated output. When this parameter is used, <code>DescribeComputeEnvironments</code> only returns <code>maxResults</code> results in a single page along with a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>DescribeComputeEnvironments</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If this parameter is not used, then <code>DescribeComputeEnvironments</code> returns up to 100 results and a <code>nextToken</code> value if applicable.</p> #[serde(rename = "maxResults")] #[serde(skip_serializing_if = "Option::is_none")] pub max_results: Option<i64>, /// <p><p>The <code>nextToken</code> value returned from a previous paginated <code>DescribeComputeEnvironments</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value. This value is <code>null</code> when there are no more results to return.</p> <note> <p>This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.</p> </note></p> #[serde(rename = "nextToken")] #[serde(skip_serializing_if = "Option::is_none")] pub next_token: Option<String>, } #[derive(Default, Debug, Clone, PartialEq, Deserialize)] #[cfg_attr(test, derive(Serialize))] pub struct DescribeComputeEnvironmentsResponse { /// <p>The list of compute environments.</p> #[serde(rename = "computeEnvironments")] #[serde(skip_serializing_if = "Option::is_none")] pub compute_environments: Option<Vec<ComputeEnvironmentDetail>>, /// <p>The <code>nextToken</code> value to include in a future <code>DescribeComputeEnvironments</code> request. When the results of a <code>DescribeJobDefinitions</code> request exceed <code>maxResults</code>, this value can be used to retrieve the next page of results. This value is <code>null</code> when there are no more results to return.</p> #[serde(rename = "nextToken")] #[serde(skip_serializing_if = "Option::is_none")] pub next_token: Option<String>, } #[derive(Default, Debug, Clone, PartialEq, Serialize)] pub struct DescribeJobDefinitionsRequest { /// <p>The name of the job definition to describe.</p> #[serde(rename = "jobDefinitionName")] #[serde(skip_serializing_if = "Option::is_none")] pub job_definition_name: Option<String>, /// <p>A list of up to 100 job definition names or full Amazon Resource Name (ARN) entries.</p> #[serde(rename = "jobDefinitions")] #[serde(skip_serializing_if = "Option::is_none")] pub job_definitions: Option<Vec<String>>, /// <p>The maximum number of results returned by <code>DescribeJobDefinitions</code> in paginated output. When this parameter is used, <code>DescribeJobDefinitions</code> only returns <code>maxResults</code> results in a single page along with a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>DescribeJobDefinitions</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If this parameter is not used, then <code>DescribeJobDefinitions</code> returns up to 100 results and a <code>nextToken</code> value if applicable.</p> #[serde(rename = "maxResults")] #[serde(skip_serializing_if = "Option::is_none")] pub max_results: Option<i64>, /// <p><p>The <code>nextToken</code> value returned from a previous paginated <code>DescribeJobDefinitions</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value. This value is <code>null</code> when there are no more results to return.</p> <note> <p>This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.</p> </note></p> #[serde(rename = "nextToken")] #[serde(skip_serializing_if = "Option::is_none")] pub next_token: Option<String>, /// <p>The status with which to filter job definitions.</p> #[serde(rename = "status")] #[serde(skip_serializing_if = "Option::is_none")] pub status: Option<String>, } #[derive(Default, Debug, Clone, PartialEq, Deserialize)] #[cfg_attr(test, derive(Serialize))] pub struct DescribeJobDefinitionsResponse { /// <p>The list of job definitions. </p> #[serde(rename = "jobDefinitions")] #[serde(skip_serializing_if = "Option::is_none")] pub job_definitions: Option<Vec<JobDefinition>>, /// <p>The <code>nextToken</code> value to include in a future <code>DescribeJobDefinitions</code> request. When the results of a <code>DescribeJobDefinitions</code> request exceed <code>maxResults</code>, this value can be used to retrieve the next page of results. This value is <code>null</code> when there are no more results to return.</p> #[serde(rename = "nextToken")] #[serde(skip_serializing_if = "Option::is_none")] pub next_token: Option<String>, } #[derive(Default, Debug, Clone, PartialEq, Serialize)] pub struct DescribeJobQueuesRequest { /// <p>A list of up to 100 queue names or full queue Amazon Resource Name (ARN) entries.</p> #[serde(rename = "jobQueues")] #[serde(skip_serializing_if = "Option::is_none")] pub job_queues: Option<Vec<String>>, /// <p>The maximum number of results returned by <code>DescribeJobQueues</code> in paginated output. When this parameter is used, <code>DescribeJobQueues</code> only returns <code>maxResults</code> results in a single page along with a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>DescribeJobQueues</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If this parameter is not used, then <code>DescribeJobQueues</code> returns up to 100 results and a <code>nextToken</code> value if applicable.</p> #[serde(rename = "maxResults")] #[serde(skip_serializing_if = "Option::is_none")] pub max_results: Option<i64>, /// <p><p>The <code>nextToken</code> value returned from a previous paginated <code>DescribeJobQueues</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value. This value is <code>null</code> when there are no more results to return.</p> <note> <p>This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.</p> </note></p> #[serde(rename = "nextToken")] #[serde(skip_serializing_if = "Option::is_none")] pub next_token: Option<String>, } #[derive(Default, Debug, Clone, PartialEq, Deserialize)] #[cfg_attr(test, derive(Serialize))] pub struct DescribeJobQueuesResponse { /// <p>The list of job queues. </p> #[serde(rename = "jobQueues")] #[serde(skip_serializing_if = "Option::is_none")] pub job_queues: Option<Vec<JobQueueDetail>>, /// <p>The <code>nextToken</code> value to include in a future <code>DescribeJobQueues</code> request. When the results of a <code>DescribeJobQueues</code> request exceed <code>maxResults</code>, this value can be used to retrieve the next page of results. This value is <code>null</code> when there are no more results to return.</p> #[serde(rename = "nextToken")] #[serde(skip_serializing_if = "Option::is_none")] pub next_token: Option<String>, } #[derive(Default, Debug, Clone, PartialEq, Serialize)] pub struct DescribeJobsRequest { /// <p>A list of up to 100 job IDs.</p> #[serde(rename = "jobs")] pub jobs: Vec<String>, } #[derive(Default, Debug, Clone, PartialEq, Deserialize)] #[cfg_attr(test, derive(Serialize))] pub struct DescribeJobsResponse { /// <p>The list of jobs. </p> #[serde(rename = "jobs")] #[serde(skip_serializing_if = "Option::is_none")] pub jobs: Option<Vec<JobDetail>>, } /// <p>Determine whether your data volume persists on the host container instance and where it is stored. If this parameter is empty, then the Docker daemon assigns a host path for your data volume, but the data is not guaranteed to persist after the containers associated with it stop running.</p> #[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct Host { /// <p>The path on the host container instance that is presented to the container. If this parameter is empty, then the Docker daemon has assigned a host path for you. If this parameter contains a file location, then the data volume persists at the specified location on the host container instance until you delete it manually. If the source path location does not exist on the host container instance, the Docker daemon creates it. If the location does exist, the contents of the source path folder are exported.</p> #[serde(rename = "sourcePath")] #[serde(skip_serializing_if = "Option::is_none")] pub source_path: Option<String>, } /// <p>An object representing an AWS Batch job definition.</p> #[derive(Default, Debug, Clone, PartialEq, Deserialize)] #[cfg_attr(test, derive(Serialize))] pub struct JobDefinition { /// <p>An object with various properties specific to container-based jobs. </p> #[serde(rename = "containerProperties")] #[serde(skip_serializing_if = "Option::is_none")] pub container_properties: Option<ContainerProperties>, /// <p>The Amazon Resource Name (ARN) for the job definition. </p> #[serde(rename = "jobDefinitionArn")] pub job_definition_arn: String, /// <p>The name of the job definition. </p> #[serde(rename = "jobDefinitionName")] pub job_definition_name: String, /// <p>An object with various properties specific to multi-node parallel jobs.</p> #[serde(rename = "nodeProperties")] #[serde(skip_serializing_if = "Option::is_none")] pub node_properties: Option<NodeProperties>, /// <p>Default parameters or parameter substitution placeholders that are set in the job definition. Parameters are specified as a key-value pair mapping. Parameters in a <code>SubmitJob</code> request override any corresponding parameter defaults from the job definition. For more information about specifying parameters, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/job_definition_parameters.html">Job Definition Parameters</a> in the <i>AWS Batch User Guide</i>.</p> #[serde(rename = "parameters")] #[serde(skip_serializing_if = "Option::is_none")] pub parameters: Option<::std::collections::HashMap<String, String>>, /// <p>The retry strategy to use for failed jobs that are submitted with this job definition.</p> #[serde(rename = "retryStrategy")] #[serde(skip_serializing_if = "Option::is_none")] pub retry_strategy: Option<RetryStrategy>, /// <p>The revision of the job definition.</p> #[serde(rename = "revision")] pub revision: i64, /// <p>The status of the job definition.</p> #[serde(rename = "status")] #[serde(skip_serializing_if = "Option::is_none")] pub status: Option<String>, /// <p>The timeout configuration for jobs that are submitted with this job definition. You can specify a timeout duration after which AWS Batch terminates your jobs if they have not finished.</p> #[serde(rename = "timeout")] #[serde(skip_serializing_if = "Option::is_none")] pub timeout: Option<JobTimeout>, /// <p>The type of job definition.</p> #[serde(rename = "type")] pub type_: String, } /// <p>An object representing an AWS Batch job dependency.</p> #[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct JobDependency { /// <p>The job ID of the AWS Batch job associated with this dependency.</p> #[serde(rename = "jobId")] #[serde(skip_serializing_if = "Option::is_none")] pub job_id: Option<String>, /// <p>The type of the job dependency.</p> #[serde(rename = "type")] #[serde(skip_serializing_if = "Option::is_none")] pub type_: Option<String>, } /// <p>An object representing an AWS Batch job.</p> #[derive(Default, Debug, Clone, PartialEq, Deserialize)] #[cfg_attr(test, derive(Serialize))] pub struct JobDetail { /// <p>The array properties of the job, if it is an array job.</p> #[serde(rename = "arrayProperties")] #[serde(skip_serializing_if = "Option::is_none")] pub array_properties: Option<ArrayPropertiesDetail>, /// <p>A list of job attempts associated with this job.</p> #[serde(rename = "attempts")] #[serde(skip_serializing_if = "Option::is_none")] pub attempts: Option<Vec<AttemptDetail>>, /// <p>An object representing the details of the container that is associated with the job.</p> #[serde(rename = "container")] #[serde(skip_serializing_if = "Option::is_none")] pub container: Option<ContainerDetail>, /// <p>The Unix timestamp (in seconds and milliseconds) for when the job was created. For non-array jobs and parent array jobs, this is when the job entered the <code>SUBMITTED</code> state (at the time <a>SubmitJob</a> was called). For array child jobs, this is when the child job was spawned by its parent and entered the <code>PENDING</code> state.</p> #[serde(rename = "createdAt")] #[serde(skip_serializing_if = "Option::is_none")] pub created_at: Option<i64>, /// <p>A list of job names or IDs on which this job depends.</p> #[serde(rename = "dependsOn")] #[serde(skip_serializing_if = "Option::is_none")] pub depends_on: Option<Vec<JobDependency>>, /// <p>The job definition that is used by this job.</p> #[serde(rename = "jobDefinition")] pub job_definition: String, /// <p>The ID for the job.</p> #[serde(rename = "jobId")] pub job_id: String, /// <p>The name of the job.</p> #[serde(rename = "jobName")] pub job_name: String, /// <p>The Amazon Resource Name (ARN) of the job queue with which the job is associated.</p> #[serde(rename = "jobQueue")] pub job_queue: String, /// <p>An object representing the details of a node that is associated with a multi-node parallel job.</p> #[serde(rename = "nodeDetails")] #[serde(skip_serializing_if = "Option::is_none")] pub node_details: Option<NodeDetails>, /// <p>An object representing the node properties of a multi-node parallel job.</p> #[serde(rename = "nodeProperties")] #[serde(skip_serializing_if = "Option::is_none")] pub node_properties: Option<NodeProperties>, /// <p>Additional parameters passed to the job that replace parameter substitution placeholders or override any corresponding parameter defaults from the job definition. </p> #[serde(rename = "parameters")] #[serde(skip_serializing_if = "Option::is_none")] pub parameters: Option<::std::collections::HashMap<String, String>>, /// <p>The retry strategy to use for this job if an attempt fails.</p> #[serde(rename = "retryStrategy")] #[serde(skip_serializing_if = "Option::is_none")] pub retry_strategy: Option<RetryStrategy>, /// <p>The Unix timestamp (in seconds and milliseconds) for when the job was started (when the job transitioned from the <code>STARTING</code> state to the <code>RUNNING</code> state).</p> #[serde(rename = "startedAt")] pub started_at: i64, /// <p><p>The current status for the job. </p> <note> <p>If your jobs do not progress to <code>STARTING</code>, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/troubleshooting.html#job_stuck_in_runnable">Jobs Stuck in <code>RUNNABLE</code> Status</a> in the troubleshooting section of the <i>AWS Batch User Guide</i>.</p> </note></p> #[serde(rename = "status")] pub status: String, /// <p>A short, human-readable string to provide additional details about the current status of the job. </p> #[serde(rename = "statusReason")] #[serde(skip_serializing_if = "Option::is_none")] pub status_reason: Option<String>, /// <p>The Unix timestamp (in seconds and milliseconds) for when the job was stopped (when the job transitioned from the <code>RUNNING</code> state to a terminal state, such as <code>SUCCEEDED</code> or <code>FAILED</code>).</p> #[serde(rename = "stoppedAt")] #[serde(skip_serializing_if = "Option::is_none")] pub stopped_at: Option<i64>, /// <p>The timeout configuration for the job. </p> #[serde(rename = "timeout")] #[serde(skip_serializing_if = "Option::is_none")] pub timeout: Option<JobTimeout>, } /// <p>An object representing the details of an AWS Batch job queue.</p> #[derive(Default, Debug, Clone, PartialEq, Deserialize)] #[cfg_attr(test, derive(Serialize))] pub struct JobQueueDetail { /// <p>The compute environments that are attached to the job queue and the order in which job placement is preferred. Compute environments are selected for job placement in ascending order.</p> #[serde(rename = "computeEnvironmentOrder")] pub compute_environment_order: Vec<ComputeEnvironmentOrder>, /// <p>The Amazon Resource Name (ARN) of the job queue.</p> #[serde(rename = "jobQueueArn")] pub job_queue_arn: String, /// <p>The name of the job queue.</p> #[serde(rename = "jobQueueName")] pub job_queue_name: String, /// <p>The priority of the job queue. </p> #[serde(rename = "priority")] pub priority: i64, /// <p>Describes the ability of the queue to accept new jobs.</p> #[serde(rename = "state")] pub state: String, /// <p>The status of the job queue (for example, <code>CREATING</code> or <code>VALID</code>).</p> #[serde(rename = "status")] #[serde(skip_serializing_if = "Option::is_none")] pub status: Option<String>, /// <p>A short, human-readable string to provide additional details about the current status of the job queue.</p> #[serde(rename = "statusReason")] #[serde(skip_serializing_if = "Option::is_none")] pub status_reason: Option<String>, } /// <p>An object representing summary details of a job.</p> #[derive(Default, Debug, Clone, PartialEq, Deserialize)] #[cfg_attr(test, derive(Serialize))] pub struct JobSummary { /// <p>The array properties of the job, if it is an array job.</p> #[serde(rename = "arrayProperties")] #[serde(skip_serializing_if = "Option::is_none")] pub array_properties: Option<ArrayPropertiesSummary>, /// <p>An object representing the details of the container that is associated with the job.</p> #[serde(rename = "container")] #[serde(skip_serializing_if = "Option::is_none")] pub container: Option<ContainerSummary>, /// <p>The Unix timestamp for when the job was created. For non-array jobs and parent array jobs, this is when the job entered the <code>SUBMITTED</code> state (at the time <a>SubmitJob</a> was called). For array child jobs, this is when the child job was spawned by its parent and entered the <code>PENDING</code> state.</p> #[serde(rename = "createdAt")] #[serde(skip_serializing_if = "Option::is_none")] pub created_at: Option<i64>, /// <p>The ID of the job.</p> #[serde(rename = "jobId")] pub job_id: String, /// <p>The name of the job.</p> #[serde(rename = "jobName")] pub job_name: String, /// <p>The node properties for a single node in a job summary list.</p> #[serde(rename = "nodeProperties")] #[serde(skip_serializing_if = "Option::is_none")] pub node_properties: Option<NodePropertiesSummary>, /// <p>The Unix timestamp for when the job was started (when the job transitioned from the <code>STARTING</code> state to the <code>RUNNING</code> state).</p> #[serde(rename = "startedAt")] #[serde(skip_serializing_if = "Option::is_none")] pub started_at: Option<i64>, /// <p>The current status for the job.</p> #[serde(rename = "status")] #[serde(skip_serializing_if = "Option::is_none")] pub status: Option<String>, /// <p>A short, human-readable string to provide additional details about the current status of the job.</p> #[serde(rename = "statusReason")] #[serde(skip_serializing_if = "Option::is_none")] pub status_reason: Option<String>, /// <p>The Unix timestamp for when the job was stopped (when the job transitioned from the <code>RUNNING</code> state to a terminal state, such as <code>SUCCEEDED</code> or <code>FAILED</code>).</p> #[serde(rename = "stoppedAt")] #[serde(skip_serializing_if = "Option::is_none")] pub stopped_at: Option<i64>, } /// <p>An object representing a job timeout configuration.</p> #[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct JobTimeout { /// <p>The time duration in seconds (measured from the job attempt's <code>startedAt</code> timestamp) after which AWS Batch terminates your jobs if they have not finished.</p> #[serde(rename = "attemptDurationSeconds")] #[serde(skip_serializing_if = "Option::is_none")] pub attempt_duration_seconds: Option<i64>, } /// <p>A key-value pair object.</p> #[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct KeyValuePair { /// <p>The name of the key-value pair. For environment variables, this is the name of the environment variable.</p> #[serde(rename = "name")] #[serde(skip_serializing_if = "Option::is_none")] pub name: Option<String>, /// <p>The value of the key-value pair. For environment variables, this is the value of the environment variable.</p> #[serde(rename = "value")] #[serde(skip_serializing_if = "Option::is_none")] pub value: Option<String>, } /// <p>An object representing a launch template associated with a compute resource. You must specify either the launch template ID or launch template name in the request, but not both. </p> #[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct LaunchTemplateSpecification { /// <p>The ID of the launch template.</p> #[serde(rename = "launchTemplateId")] #[serde(skip_serializing_if = "Option::is_none")] pub launch_template_id: Option<String>, /// <p>The name of the launch template.</p> #[serde(rename = "launchTemplateName")] #[serde(skip_serializing_if = "Option::is_none")] pub launch_template_name: Option<String>, /// <p>The version number of the launch template.</p> <p>Default: The default version of the launch template.</p> #[serde(rename = "version")] #[serde(skip_serializing_if = "Option::is_none")] pub version: Option<String>, } #[derive(Default, Debug, Clone, PartialEq, Serialize)] pub struct ListJobsRequest { /// <p>The job ID for an array job. Specifying an array job ID with this parameter lists all child jobs from within the specified array.</p> #[serde(rename = "arrayJobId")] #[serde(skip_serializing_if = "Option::is_none")] pub array_job_id: Option<String>, /// <p>The name or full Amazon Resource Name (ARN) of the job queue with which to list jobs.</p> #[serde(rename = "jobQueue")] #[serde(skip_serializing_if = "Option::is_none")] pub job_queue: Option<String>, /// <p>The job status with which to filter jobs in the specified queue. If you do not specify a status, only <code>RUNNING</code> jobs are returned.</p> #[serde(rename = "jobStatus")] #[serde(skip_serializing_if = "Option::is_none")] pub job_status: Option<String>, /// <p>The maximum number of results returned by <code>ListJobs</code> in paginated output. When this parameter is used, <code>ListJobs</code> only returns <code>maxResults</code> results in a single page along with a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>ListJobs</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If this parameter is not used, then <code>ListJobs</code> returns up to 100 results and a <code>nextToken</code> value if applicable.</p> #[serde(rename = "maxResults")] #[serde(skip_serializing_if = "Option::is_none")] pub max_results: Option<i64>, /// <p>The job ID for a multi-node parallel job. Specifying a multi-node parallel job ID with this parameter lists all nodes that are associated with the specified job.</p> #[serde(rename = "multiNodeJobId")] #[serde(skip_serializing_if = "Option::is_none")] pub multi_node_job_id: Option<String>, /// <p><p>The <code>nextToken</code> value returned from a previous paginated <code>ListJobs</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value. This value is <code>null</code> when there are no more results to return.</p> <note> <p>This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.</p> </note></p> #[serde(rename = "nextToken")] #[serde(skip_serializing_if = "Option::is_none")] pub next_token: Option<String>, } #[derive(Default, Debug, Clone, PartialEq, Deserialize)] #[cfg_attr(test, derive(Serialize))] pub struct ListJobsResponse { /// <p>A list of job summaries that match the request.</p> #[serde(rename = "jobSummaryList")] pub job_summary_list: Vec<JobSummary>, /// <p>The <code>nextToken</code> value to include in a future <code>ListJobs</code> request. When the results of a <code>ListJobs</code> request exceed <code>maxResults</code>, this value can be used to retrieve the next page of results. This value is <code>null</code> when there are no more results to return.</p> #[serde(rename = "nextToken")] #[serde(skip_serializing_if = "Option::is_none")] pub next_token: Option<String>, } /// <p>Details on a Docker volume mount point that is used in a job's container properties. This parameter maps to <code>Volumes</code> in the <a href="https://docs.docker.com/engine/reference/api/docker_remote_api_v1.19/#create-a-container">Create a container</a> section of the Docker Remote API and the <code>--volume</code> option to docker run.</p> #[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct MountPoint { /// <p>The path on the container at which to mount the host volume.</p> #[serde(rename = "containerPath")] #[serde(skip_serializing_if = "Option::is_none")] pub container_path: Option<String>, /// <p>If this value is <code>true</code>, the container has read-only access to the volume; otherwise, the container can write to the volume. The default value is <code>false</code>.</p> #[serde(rename = "readOnly")] #[serde(skip_serializing_if = "Option::is_none")] pub read_only: Option<bool>, /// <p>The name of the volume to mount.</p> #[serde(rename = "sourceVolume")] #[serde(skip_serializing_if = "Option::is_none")] pub source_volume: Option<String>, } /// <p>An object representing the elastic network interface for a multi-node parallel job node.</p> #[derive(Default, Debug, Clone, PartialEq, Deserialize)] #[cfg_attr(test, derive(Serialize))] pub struct NetworkInterface { /// <p>The attachment ID for the network interface.</p> #[serde(rename = "attachmentId")] #[serde(skip_serializing_if = "Option::is_none")] pub attachment_id: Option<String>, /// <p>The private IPv6 address for the network interface.</p> #[serde(rename = "ipv6Address")] #[serde(skip_serializing_if = "Option::is_none")] pub ipv_6_address: Option<String>, /// <p>The private IPv4 address for the network interface.</p> #[serde(rename = "privateIpv4Address")] #[serde(skip_serializing_if = "Option::is_none")] pub private_ipv_4_address: Option<String>, } /// <p>An object representing the details of a multi-node parallel job node.</p> #[derive(Default, Debug, Clone, PartialEq, Deserialize)] #[cfg_attr(test, derive(Serialize))] pub struct NodeDetails { /// <p>Specifies whether the current node is the main node for a multi-node parallel job.</p> #[serde(rename = "isMainNode")] #[serde(skip_serializing_if = "Option::is_none")] pub is_main_node: Option<bool>, /// <p>The node index for the node. Node index numbering begins at zero. This index is also available on the node with the <code>AWS_BATCH_JOB_NODE_INDEX</code> environment variable.</p> #[serde(rename = "nodeIndex")] #[serde(skip_serializing_if = "Option::is_none")] pub node_index: Option<i64>, } /// <p>Object representing any node overrides to a job definition that is used in a <a>SubmitJob</a> API operation.</p> #[derive(Default, Debug, Clone, PartialEq, Serialize)] pub struct NodeOverrides { /// <p>The node property overrides for the job.</p> #[serde(rename = "nodePropertyOverrides")] #[serde(skip_serializing_if = "Option::is_none")] pub node_property_overrides: Option<Vec<NodePropertyOverride>>, /// <p><p>The number of nodes to use with a multi-node parallel job. This value overrides the number of nodes that are specified in the job definition. To use this override:</p> <ul> <li> <p>There must be at least one node range in your job definition that has an open upper boundary (such as <code>:</code> or <code>n:</code>).</p> </li> <li> <p>The lower boundary of the node range specified in the job definition must be fewer than the number of nodes specified in the override.</p> </li> <li> <p>The main node index specified in the job definition must be fewer than the number of nodes specified in the override.</p> </li> </ul></p> #[serde(rename = "numNodes")] #[serde(skip_serializing_if = "Option::is_none")] pub num_nodes: Option<i64>, } /// <p>An object representing the node properties of a multi-node parallel job.</p> #[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct NodeProperties { /// <p>Specifies the node index for the main node of a multi-node parallel job. This node index value must be fewer than the number of nodes.</p> #[serde(rename = "mainNode")] pub main_node: i64, /// <p>A list of node ranges and their properties associated with a multi-node parallel job.</p> #[serde(rename = "nodeRangeProperties")] pub node_range_properties: Vec<NodeRangeProperty>, /// <p>The number of nodes associated with a multi-node parallel job.</p> #[serde(rename = "numNodes")] pub num_nodes: i64, } /// <p>An object representing the properties of a node that is associated with a multi-node parallel job.</p> #[derive(Default, Debug, Clone, PartialEq, Deserialize)] #[cfg_attr(test, derive(Serialize))] pub struct NodePropertiesSummary { /// <p>Specifies whether the current node is the main node for a multi-node parallel job.</p> #[serde(rename = "isMainNode")] #[serde(skip_serializing_if = "Option::is_none")] pub is_main_node: Option<bool>, /// <p>The node index for the node. Node index numbering begins at zero. This index is also available on the node with the <code>AWS_BATCH_JOB_NODE_INDEX</code> environment variable.</p> #[serde(rename = "nodeIndex")] #[serde(skip_serializing_if = "Option::is_none")] pub node_index: Option<i64>, /// <p>The number of nodes associated with a multi-node parallel job.</p> #[serde(rename = "numNodes")] #[serde(skip_serializing_if = "Option::is_none")] pub num_nodes: Option<i64>, } /// <p>Object representing any node overrides to a job definition that is used in a <a>SubmitJob</a> API operation.</p> #[derive(Default, Debug, Clone, PartialEq, Serialize)] pub struct NodePropertyOverride { /// <p>The overrides that should be sent to a node range.</p> #[serde(rename = "containerOverrides")] #[serde(skip_serializing_if = "Option::is_none")] pub container_overrides: Option<ContainerOverrides>, /// <p>The range of nodes, using node index values, with which to override. A range of <code>0:3</code> indicates nodes with index values of <code>0</code> through <code>3</code>. If the starting range value is omitted (<code>:n</code>), then <code>0</code> is used to start the range. If the ending range value is omitted (<code>n:</code>), then the highest possible node index is used to end the range.</p> #[serde(rename = "targetNodes")] pub target_nodes: String, } /// <p>An object representing the properties of the node range for a multi-node parallel job.</p> #[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct NodeRangeProperty { /// <p>The container details for the node range.</p> #[serde(rename = "container")] #[serde(skip_serializing_if = "Option::is_none")] pub container: Option<ContainerProperties>, /// <p>The range of nodes, using node index values. A range of <code>0:3</code> indicates nodes with index values of <code>0</code> through <code>3</code>. If the starting range value is omitted (<code>:n</code>), then <code>0</code> is used to start the range. If the ending range value is omitted (<code>n:</code>), then the highest possible node index is used to end the range. Your accumulative node ranges must account for all nodes (0:n). You may nest node ranges, for example 0:10 and 4:5, in which case the 4:5 range properties override the 0:10 properties. </p> #[serde(rename = "targetNodes")] pub target_nodes: String, } #[derive(Default, Debug, Clone, PartialEq, Serialize)] pub struct RegisterJobDefinitionRequest { /// <p>An object with various properties specific to single-node container-based jobs. If the job definition's <code>type</code> parameter is <code>container</code>, then you must specify either <code>containerProperties</code> or <code>nodeProperties</code>.</p> #[serde(rename = "containerProperties")] #[serde(skip_serializing_if = "Option::is_none")] pub container_properties: Option<ContainerProperties>, /// <p>The name of the job definition to register. Up to 128 letters (uppercase and lowercase), numbers, hyphens, and underscores are allowed.</p> #[serde(rename = "jobDefinitionName")] pub job_definition_name: String, /// <p>An object with various properties specific to multi-node parallel jobs. If you specify node properties for a job, it becomes a multi-node parallel job. For more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/multi-node-parallel-jobs.html">Multi-node Parallel Jobs</a> in the <i>AWS Batch User Guide</i>. If the job definition's <code>type</code> parameter is <code>container</code>, then you must specify either <code>containerProperties</code> or <code>nodeProperties</code>.</p> #[serde(rename = "nodeProperties")] #[serde(skip_serializing_if = "Option::is_none")] pub node_properties: Option<NodeProperties>, /// <p>Default parameter substitution placeholders to set in the job definition. Parameters are specified as a key-value pair mapping. Parameters in a <code>SubmitJob</code> request override any corresponding parameter defaults from the job definition.</p> #[serde(rename = "parameters")] #[serde(skip_serializing_if = "Option::is_none")] pub parameters: Option<::std::collections::HashMap<String, String>>, /// <p>The retry strategy to use for failed jobs that are submitted with this job definition. Any retry strategy that is specified during a <a>SubmitJob</a> operation overrides the retry strategy defined here. If a job is terminated due to a timeout, it is not retried. </p> #[serde(rename = "retryStrategy")] #[serde(skip_serializing_if = "Option::is_none")] pub retry_strategy: Option<RetryStrategy>, /// <p>The timeout configuration for jobs that are submitted with this job definition, after which AWS Batch terminates your jobs if they have not finished. If a job is terminated due to a timeout, it is not retried. The minimum value for the timeout is 60 seconds. Any timeout configuration that is specified during a <a>SubmitJob</a> operation overrides the timeout configuration defined here. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/job_timeouts.html">Job Timeouts</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p> #[serde(rename = "timeout")] #[serde(skip_serializing_if = "Option::is_none")] pub timeout: Option<JobTimeout>, /// <p>The type of job definition.</p> #[serde(rename = "type")] pub type_: String, } #[derive(Default, Debug, Clone, PartialEq, Deserialize)] #[cfg_attr(test, derive(Serialize))] pub struct RegisterJobDefinitionResponse { /// <p>The Amazon Resource Name (ARN) of the job definition. </p> #[serde(rename = "jobDefinitionArn")] pub job_definition_arn: String, /// <p>The name of the job definition.</p> #[serde(rename = "jobDefinitionName")] pub job_definition_name: String, /// <p>The revision of the job definition.</p> #[serde(rename = "revision")] pub revision: i64, } /// <p>The type and amount of a resource to assign to a container. Currently, the only supported resource type is <code>GPU</code>.</p> #[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct ResourceRequirement { /// <p>The type of resource to assign to a container. Currently, the only supported resource type is <code>GPU</code>.</p> #[serde(rename = "type")] pub type_: String, /// <p>The number of physical GPUs to reserve for the container. The number of GPUs reserved for all containers in a job should not exceed the number of available GPUs on the compute resource that the job is launched on.</p> #[serde(rename = "value")] pub value: String, } /// <p>The retry strategy associated with a job.</p> #[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct RetryStrategy { /// <p>The number of times to move a job to the <code>RUNNABLE</code> status. You may specify between 1 and 10 attempts. If the value of <code>attempts</code> is greater than one, the job is retried on failure the same number of attempts as the value.</p> #[serde(rename = "attempts")] #[serde(skip_serializing_if = "Option::is_none")] pub attempts: Option<i64>, } #[derive(Default, Debug, Clone, PartialEq, Serialize)] pub struct SubmitJobRequest { /// <p>The array properties for the submitted job, such as the size of the array. The array size can be between 2 and 10,000. If you specify array properties for a job, it becomes an array job. For more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/array_jobs.html">Array Jobs</a> in the <i>AWS Batch User Guide</i>.</p> #[serde(rename = "arrayProperties")] #[serde(skip_serializing_if = "Option::is_none")] pub array_properties: Option<ArrayProperties>, /// <p>A list of container overrides in JSON format that specify the name of a container in the specified job definition and the overrides it should receive. You can override the default command for a container (that is specified in the job definition or the Docker image) with a <code>command</code> override. You can also override existing environment variables (that are specified in the job definition or Docker image) on a container or add new environment variables to it with an <code>environment</code> override.</p> #[serde(rename = "containerOverrides")] #[serde(skip_serializing_if = "Option::is_none")] pub container_overrides: Option<ContainerOverrides>, /// <p>A list of dependencies for the job. A job can depend upon a maximum of 20 jobs. You can specify a <code>SEQUENTIAL</code> type dependency without specifying a job ID for array jobs so that each child array job completes sequentially, starting at index 0. You can also specify an <code>N_TO_N</code> type dependency with a job ID for array jobs. In that case, each index child of this job must wait for the corresponding index child of each dependency to complete before it can begin.</p> #[serde(rename = "dependsOn")] #[serde(skip_serializing_if = "Option::is_none")] pub depends_on: Option<Vec<JobDependency>>, /// <p>The job definition used by this job. This value can be either a <code>name:revision</code> or the Amazon Resource Name (ARN) for the job definition.</p> #[serde(rename = "jobDefinition")] pub job_definition: String, /// <p>The name of the job. The first character must be alphanumeric, and up to 128 letters (uppercase and lowercase), numbers, hyphens, and underscores are allowed. </p> #[serde(rename = "jobName")] pub job_name: String, /// <p>The job queue into which the job is submitted. You can specify either the name or the Amazon Resource Name (ARN) of the queue. </p> #[serde(rename = "jobQueue")] pub job_queue: String, /// <p>A list of node overrides in JSON format that specify the node range to target and the container overrides for that node range.</p> #[serde(rename = "nodeOverrides")] #[serde(skip_serializing_if = "Option::is_none")] pub node_overrides: Option<NodeOverrides>, /// <p>Additional parameters passed to the job that replace parameter substitution placeholders that are set in the job definition. Parameters are specified as a key and value pair mapping. Parameters in a <code>SubmitJob</code> request override any corresponding parameter defaults from the job definition.</p> #[serde(rename = "parameters")] #[serde(skip_serializing_if = "Option::is_none")] pub parameters: Option<::std::collections::HashMap<String, String>>, /// <p>The retry strategy to use for failed jobs from this <a>SubmitJob</a> operation. When a retry strategy is specified here, it overrides the retry strategy defined in the job definition.</p> #[serde(rename = "retryStrategy")] #[serde(skip_serializing_if = "Option::is_none")] pub retry_strategy: Option<RetryStrategy>, /// <p>The timeout configuration for this <a>SubmitJob</a> operation. You can specify a timeout duration after which AWS Batch terminates your jobs if they have not finished. If a job is terminated due to a timeout, it is not retried. The minimum value for the timeout is 60 seconds. This configuration overrides any timeout configuration specified in the job definition. For array jobs, child jobs have the same timeout configuration as the parent job. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/job_timeouts.html">Job Timeouts</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p> #[serde(rename = "timeout")] #[serde(skip_serializing_if = "Option::is_none")] pub timeout: Option<JobTimeout>, } #[derive(Default, Debug, Clone, PartialEq, Deserialize)] #[cfg_attr(test, derive(Serialize))] pub struct SubmitJobResponse { /// <p>The unique identifier for the job.</p> #[serde(rename = "jobId")] pub job_id: String, /// <p>The name of the job. </p> #[serde(rename = "jobName")] pub job_name: String, } #[derive(Default, Debug, Clone, PartialEq, Serialize)] pub struct TerminateJobRequest { /// <p>The AWS Batch job ID of the job to terminate.</p> #[serde(rename = "jobId")] pub job_id: String, /// <p>A message to attach to the job that explains the reason for canceling it. This message is returned by future <a>DescribeJobs</a> operations on the job. This message is also recorded in the AWS Batch activity logs. </p> #[serde(rename = "reason")] pub reason: String, } #[derive(Default, Debug, Clone, PartialEq, Deserialize)] #[cfg_attr(test, derive(Serialize))] pub struct TerminateJobResponse {} /// <p>The <code>ulimit</code> settings to pass to the container.</p> #[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct Ulimit { /// <p>The hard limit for the <code>ulimit</code> type.</p> #[serde(rename = "hardLimit")] pub hard_limit: i64, /// <p>The <code>type</code> of the <code>ulimit</code>.</p> #[serde(rename = "name")] pub name: String, /// <p>The soft limit for the <code>ulimit</code> type.</p> #[serde(rename = "softLimit")] pub soft_limit: i64, } #[derive(Default, Debug, Clone, PartialEq, Serialize)] pub struct UpdateComputeEnvironmentRequest { /// <p>The name or full Amazon Resource Name (ARN) of the compute environment to update.</p> #[serde(rename = "computeEnvironment")] pub compute_environment: String, /// <p>Details of the compute resources managed by the compute environment. Required for a managed compute environment.</p> #[serde(rename = "computeResources")] #[serde(skip_serializing_if = "Option::is_none")] pub compute_resources: Option<ComputeResourceUpdate>, /// <p><p>The full Amazon Resource Name (ARN) of the IAM role that allows AWS Batch to make calls to other AWS services on your behalf.</p> <p>If your specified role has a path other than <code>/</code>, then you must either specify the full role ARN (this is recommended) or prefix the role name with the path.</p> <note> <p>Depending on how you created your AWS Batch service role, its ARN may contain the <code>service-role</code> path prefix. When you only specify the name of the service role, AWS Batch assumes that your ARN does not use the <code>service-role</code> path prefix. Because of this, we recommend that you specify the full ARN of your service role when you create compute environments.</p> </note></p> #[serde(rename = "serviceRole")] #[serde(skip_serializing_if = "Option::is_none")] pub service_role: Option<String>, /// <p>The state of the compute environment. Compute environments in the <code>ENABLED</code> state can accept jobs from a queue and scale in or out automatically based on the workload demand of its associated queues.</p> #[serde(rename = "state")] #[serde(skip_serializing_if = "Option::is_none")] pub state: Option<String>, } #[derive(Default, Debug, Clone, PartialEq, Deserialize)] #[cfg_attr(test, derive(Serialize))] pub struct UpdateComputeEnvironmentResponse { /// <p>The Amazon Resource Name (ARN) of the compute environment. </p> #[serde(rename = "computeEnvironmentArn")] #[serde(skip_serializing_if = "Option::is_none")] pub compute_environment_arn: Option<String>, /// <p>The name of the compute environment.</p> #[serde(rename = "computeEnvironmentName")] #[serde(skip_serializing_if = "Option::is_none")] pub compute_environment_name: Option<String>, } #[derive(Default, Debug, Clone, PartialEq, Serialize)] pub struct UpdateJobQueueRequest { /// <p>Details the set of compute environments mapped to a job queue and their order relative to each other. This is one of the parameters used by the job scheduler to determine which compute environment should execute a given job. </p> #[serde(rename = "computeEnvironmentOrder")] #[serde(skip_serializing_if = "Option::is_none")] pub compute_environment_order: Option<Vec<ComputeEnvironmentOrder>>, /// <p>The name or the Amazon Resource Name (ARN) of the job queue.</p> #[serde(rename = "jobQueue")] pub job_queue: String, /// <p>The priority of the job queue. Job queues with a higher priority (or a higher integer value for the <code>priority</code> parameter) are evaluated first when associated with the same compute environment. Priority is determined in descending order, for example, a job queue with a priority value of <code>10</code> is given scheduling preference over a job queue with a priority value of <code>1</code>.</p> #[serde(rename = "priority")] #[serde(skip_serializing_if = "Option::is_none")] pub priority: Option<i64>, /// <p>Describes the queue's ability to accept new jobs.</p> #[serde(rename = "state")] #[serde(skip_serializing_if = "Option::is_none")] pub state: Option<String>, } #[derive(Default, Debug, Clone, PartialEq, Deserialize)] #[cfg_attr(test, derive(Serialize))] pub struct UpdateJobQueueResponse { /// <p>The Amazon Resource Name (ARN) of the job queue.</p> #[serde(rename = "jobQueueArn")] #[serde(skip_serializing_if = "Option::is_none")] pub job_queue_arn: Option<String>, /// <p>The name of the job queue.</p> #[serde(rename = "jobQueueName")] #[serde(skip_serializing_if = "Option::is_none")] pub job_queue_name: Option<String>, } /// <p>A data volume used in a job's container properties.</p> #[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct Volume { /// <p>The contents of the <code>host</code> parameter determine whether your data volume persists on the host container instance and where it is stored. If the host parameter is empty, then the Docker daemon assigns a host path for your data volume. However, the data is not guaranteed to persist after the containers associated with it stop running.</p> #[serde(rename = "host")] #[serde(skip_serializing_if = "Option::is_none")] pub host: Option<Host>, /// <p>The name of the volume. Up to 255 letters (uppercase and lowercase), numbers, hyphens, and underscores are allowed. This name is referenced in the <code>sourceVolume</code> parameter of container definition <code>mountPoints</code>.</p> #[serde(rename = "name")] #[serde(skip_serializing_if = "Option::is_none")] pub name: Option<String>, } /// Errors returned by CancelJob #[derive(Debug, PartialEq)] pub enum CancelJobError { /// <p>These errors are usually caused by a client action, such as using an action or resource on behalf of a user that doesn't have permissions to use the action or resource, or specifying an identifier that is not valid. </p> Client(String), /// <p>These errors are usually caused by a server issue.</p> Server(String), } impl CancelJobError { pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CancelJobError> { if let Some(err) = proto::json::Error::parse_rest(&res) { match err.typ.as_str() { "ClientException" => return RusotoError::Service(CancelJobError::Client(err.msg)), "ServerException" => return RusotoError::Service(CancelJobError::Server(err.msg)), "ValidationException" => return RusotoError::Validation(err.msg), _ => {} } } return RusotoError::Unknown(res); } } impl fmt::Display for CancelJobError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}", self.description()) } } impl Error for CancelJobError { fn description(&self) -> &str { match *self { CancelJobError::Client(ref cause) => cause, CancelJobError::Server(ref cause) => cause, } } } /// Errors returned by CreateComputeEnvironment #[derive(Debug, PartialEq)] pub enum CreateComputeEnvironmentError { /// <p>These errors are usually caused by a client action, such as using an action or resource on behalf of a user that doesn't have permissions to use the action or resource, or specifying an identifier that is not valid. </p> Client(String), /// <p>These errors are usually caused by a server issue.</p> Server(String), } impl CreateComputeEnvironmentError { pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateComputeEnvironmentError> { if let Some(err) = proto::json::Error::parse_rest(&res) { match err.typ.as_str() { "ClientException" => { return RusotoError::Service(CreateComputeEnvironmentError::Client(err.msg)) } "ServerException" => { return RusotoError::Service(CreateComputeEnvironmentError::Server(err.msg)) } "ValidationException" => return RusotoError::Validation(err.msg), _ => {} } } return RusotoError::Unknown(res); } } impl fmt::Display for CreateComputeEnvironmentError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}", self.description()) } } impl Error for CreateComputeEnvironmentError { fn description(&self) -> &str { match *self { CreateComputeEnvironmentError::Client(ref cause) => cause, CreateComputeEnvironmentError::Server(ref cause) => cause, } } } /// Errors returned by CreateJobQueue #[derive(Debug, PartialEq)] pub enum CreateJobQueueError { /// <p>These errors are usually caused by a client action, such as using an action or resource on behalf of a user that doesn't have permissions to use the action or resource, or specifying an identifier that is not valid. </p> Client(String), /// <p>These errors are usually caused by a server issue.</p> Server(String), } impl CreateJobQueueError { pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateJobQueueError> { if let Some(err) = proto::json::Error::parse_rest(&res) { match err.typ.as_str() { "ClientException" => { return RusotoError::Service(CreateJobQueueError::Client(err.msg)) } "ServerException" => { return RusotoError::Service(CreateJobQueueError::Server(err.msg)) } "ValidationException" => return RusotoError::Validation(err.msg), _ => {} } } return RusotoError::Unknown(res); } } impl fmt::Display for CreateJobQueueError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}", self.description()) } } impl Error for CreateJobQueueError { fn description(&self) -> &str { match *self { CreateJobQueueError::Client(ref cause) => cause, CreateJobQueueError::Server(ref cause) => cause, } } } /// Errors returned by DeleteComputeEnvironment #[derive(Debug, PartialEq)] pub enum DeleteComputeEnvironmentError { /// <p>These errors are usually caused by a client action, such as using an action or resource on behalf of a user that doesn't have permissions to use the action or resource, or specifying an identifier that is not valid. </p> Client(String), /// <p>These errors are usually caused by a server issue.</p> Server(String), } impl DeleteComputeEnvironmentError { pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteComputeEnvironmentError> { if let Some(err) = proto::json::Error::parse_rest(&res) { match err.typ.as_str() { "ClientException" => { return RusotoError::Service(DeleteComputeEnvironmentError::Client(err.msg)) } "ServerException" => { return RusotoError::Service(DeleteComputeEnvironmentError::Server(err.msg)) } "ValidationException" => return RusotoError::Validation(err.msg), _ => {} } } return RusotoError::Unknown(res); } } impl fmt::Display for DeleteComputeEnvironmentError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}", self.description()) } } impl Error for DeleteComputeEnvironmentError { fn description(&self) -> &str { match *self { DeleteComputeEnvironmentError::Client(ref cause) => cause, DeleteComputeEnvironmentError::Server(ref cause) => cause, } } } /// Errors returned by DeleteJobQueue #[derive(Debug, PartialEq)] pub enum DeleteJobQueueError { /// <p>These errors are usually caused by a client action, such as using an action or resource on behalf of a user that doesn't have permissions to use the action or resource, or specifying an identifier that is not valid. </p> Client(String), /// <p>These errors are usually caused by a server issue.</p> Server(String), } impl DeleteJobQueueError { pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteJobQueueError> { if let Some(err) = proto::json::Error::parse_rest(&res) { match err.typ.as_str() { "ClientException" => { return RusotoError::Service(DeleteJobQueueError::Client(err.msg)) } "ServerException" => { return RusotoError::Service(DeleteJobQueueError::Server(err.msg)) } "ValidationException" => return RusotoError::Validation(err.msg), _ => {} } } return RusotoError::Unknown(res); } } impl fmt::Display for DeleteJobQueueError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}", self.description()) } } impl Error for DeleteJobQueueError { fn description(&self) -> &str { match *self { DeleteJobQueueError::Client(ref cause) => cause, DeleteJobQueueError::Server(ref cause) => cause, } } } /// Errors returned by DeregisterJobDefinition #[derive(Debug, PartialEq)] pub enum DeregisterJobDefinitionError { /// <p>These errors are usually caused by a client action, such as using an action or resource on behalf of a user that doesn't have permissions to use the action or resource, or specifying an identifier that is not valid. </p> Client(String), /// <p>These errors are usually caused by a server issue.</p> Server(String), } impl DeregisterJobDefinitionError { pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeregisterJobDefinitionError> { if let Some(err) = proto::json::Error::parse_rest(&res) { match err.typ.as_str() { "ClientException" => { return RusotoError::Service(DeregisterJobDefinitionError::Client(err.msg)) } "ServerException" => { return RusotoError::Service(DeregisterJobDefinitionError::Server(err.msg)) } "ValidationException" => return RusotoError::Validation(err.msg), _ => {} } } return RusotoError::Unknown(res); } } impl fmt::Display for DeregisterJobDefinitionError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}", self.description()) } } impl Error for DeregisterJobDefinitionError { fn description(&self) -> &str { match *self { DeregisterJobDefinitionError::Client(ref cause) => cause, DeregisterJobDefinitionError::Server(ref cause) => cause, } } } /// Errors returned by DescribeComputeEnvironments #[derive(Debug, PartialEq)] pub enum DescribeComputeEnvironmentsError { /// <p>These errors are usually caused by a client action, such as using an action or resource on behalf of a user that doesn't have permissions to use the action or resource, or specifying an identifier that is not valid. </p> Client(String), /// <p>These errors are usually caused by a server issue.</p> Server(String), } impl DescribeComputeEnvironmentsError { pub fn from_response( res: BufferedHttpResponse, ) -> RusotoError<DescribeComputeEnvironmentsError> { if let Some(err) = proto::json::Error::parse_rest(&res) { match err.typ.as_str() { "ClientException" => { return RusotoError::Service(DescribeComputeEnvironmentsError::Client(err.msg)) } "ServerException" => { return RusotoError::Service(DescribeComputeEnvironmentsError::Server(err.msg)) } "ValidationException" => return RusotoError::Validation(err.msg), _ => {} } } return RusotoError::Unknown(res); } } impl fmt::Display for DescribeComputeEnvironmentsError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}", self.description()) } } impl Error for DescribeComputeEnvironmentsError { fn description(&self) -> &str { match *self { DescribeComputeEnvironmentsError::Client(ref cause) => cause, DescribeComputeEnvironmentsError::Server(ref cause) => cause, } } } /// Errors returned by DescribeJobDefinitions #[derive(Debug, PartialEq)] pub enum DescribeJobDefinitionsError { /// <p>These errors are usually caused by a client action, such as using an action or resource on behalf of a user that doesn't have permissions to use the action or resource, or specifying an identifier that is not valid. </p> Client(String), /// <p>These errors are usually caused by a server issue.</p> Server(String), } impl DescribeJobDefinitionsError { pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeJobDefinitionsError> { if let Some(err) = proto::json::Error::parse_rest(&res) { match err.typ.as_str() { "ClientException" => { return RusotoError::Service(DescribeJobDefinitionsError::Client(err.msg)) } "ServerException" => { return RusotoError::Service(DescribeJobDefinitionsError::Server(err.msg)) } "ValidationException" => return RusotoError::Validation(err.msg), _ => {} } } return RusotoError::Unknown(res); } } impl fmt::Display for DescribeJobDefinitionsError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}", self.description()) } } impl Error for DescribeJobDefinitionsError { fn description(&self) -> &str { match *self { DescribeJobDefinitionsError::Client(ref cause) => cause, DescribeJobDefinitionsError::Server(ref cause) => cause, } } } /// Errors returned by DescribeJobQueues #[derive(Debug, PartialEq)] pub enum DescribeJobQueuesError { /// <p>These errors are usually caused by a client action, such as using an action or resource on behalf of a user that doesn't have permissions to use the action or resource, or specifying an identifier that is not valid. </p> Client(String), /// <p>These errors are usually caused by a server issue.</p> Server(String), } impl DescribeJobQueuesError { pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeJobQueuesError> { if let Some(err) = proto::json::Error::parse_rest(&res) { match err.typ.as_str() { "ClientException" => { return RusotoError::Service(DescribeJobQueuesError::Client(err.msg)) } "ServerException" => { return RusotoError::Service(DescribeJobQueuesError::Server(err.msg)) } "ValidationException" => return RusotoError::Validation(err.msg), _ => {} } } return RusotoError::Unknown(res); } } impl fmt::Display for DescribeJobQueuesError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}", self.description()) } } impl Error for DescribeJobQueuesError { fn description(&self) -> &str { match *self { DescribeJobQueuesError::Client(ref cause) => cause, DescribeJobQueuesError::Server(ref cause) => cause, } } } /// Errors returned by DescribeJobs #[derive(Debug, PartialEq)] pub enum DescribeJobsError { /// <p>These errors are usually caused by a client action, such as using an action or resource on behalf of a user that doesn't have permissions to use the action or resource, or specifying an identifier that is not valid. </p> Client(String), /// <p>These errors are usually caused by a server issue.</p> Server(String), } impl DescribeJobsError { pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeJobsError> { if let Some(err) = proto::json::Error::parse_rest(&res) { match err.typ.as_str() { "ClientException" => { return RusotoError::Service(DescribeJobsError::Client(err.msg)) } "ServerException" => { return RusotoError::Service(DescribeJobsError::Server(err.msg)) } "ValidationException" => return RusotoError::Validation(err.msg), _ => {} } } return RusotoError::Unknown(res); } } impl fmt::Display for DescribeJobsError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}", self.description()) } } impl Error for DescribeJobsError { fn description(&self) -> &str { match *self { DescribeJobsError::Client(ref cause) => cause, DescribeJobsError::Server(ref cause) => cause, } } } /// Errors returned by ListJobs #[derive(Debug, PartialEq)] pub enum ListJobsError { /// <p>These errors are usually caused by a client action, such as using an action or resource on behalf of a user that doesn't have permissions to use the action or resource, or specifying an identifier that is not valid. </p> Client(String), /// <p>These errors are usually caused by a server issue.</p> Server(String), } impl ListJobsError { pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListJobsError> { if let Some(err) = proto::json::Error::parse_rest(&res) { match err.typ.as_str() { "ClientException" => return RusotoError::Service(ListJobsError::Client(err.msg)), "ServerException" => return RusotoError::Service(ListJobsError::Server(err.msg)), "ValidationException" => return RusotoError::Validation(err.msg), _ => {} } } return RusotoError::Unknown(res); } } impl fmt::Display for ListJobsError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}", self.description()) } } impl Error for ListJobsError { fn description(&self) -> &str { match *self { ListJobsError::Client(ref cause) => cause, ListJobsError::Server(ref cause) => cause, } } } /// Errors returned by RegisterJobDefinition #[derive(Debug, PartialEq)] pub enum RegisterJobDefinitionError { /// <p>These errors are usually caused by a client action, such as using an action or resource on behalf of a user that doesn't have permissions to use the action or resource, or specifying an identifier that is not valid. </p> Client(String), /// <p>These errors are usually caused by a server issue.</p> Server(String), } impl RegisterJobDefinitionError { pub fn from_response(res: BufferedHttpResponse) -> RusotoError<RegisterJobDefinitionError> { if let Some(err) = proto::json::Error::parse_rest(&res) { match err.typ.as_str() { "ClientException" => { return RusotoError::Service(RegisterJobDefinitionError::Client(err.msg)) } "ServerException" => { return RusotoError::Service(RegisterJobDefinitionError::Server(err.msg)) } "ValidationException" => return RusotoError::Validation(err.msg), _ => {} } } return RusotoError::Unknown(res); } } impl fmt::Display for RegisterJobDefinitionError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}", self.description()) } } impl Error for RegisterJobDefinitionError { fn description(&self) -> &str { match *self { RegisterJobDefinitionError::Client(ref cause) => cause, RegisterJobDefinitionError::Server(ref cause) => cause, } } } /// Errors returned by SubmitJob #[derive(Debug, PartialEq)] pub enum SubmitJobError { /// <p>These errors are usually caused by a client action, such as using an action or resource on behalf of a user that doesn't have permissions to use the action or resource, or specifying an identifier that is not valid. </p> Client(String), /// <p>These errors are usually caused by a server issue.</p> Server(String), } impl SubmitJobError { pub fn from_response(res: BufferedHttpResponse) -> RusotoError<SubmitJobError> { if let Some(err) = proto::json::Error::parse_rest(&res) { match err.typ.as_str() { "ClientException" => return RusotoError::Service(SubmitJobError::Client(err.msg)), "ServerException" => return RusotoError::Service(SubmitJobError::Server(err.msg)), "ValidationException" => return RusotoError::Validation(err.msg), _ => {} } } return RusotoError::Unknown(res); } } impl fmt::Display for SubmitJobError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}", self.description()) } } impl Error for SubmitJobError { fn description(&self) -> &str { match *self { SubmitJobError::Client(ref cause) => cause, SubmitJobError::Server(ref cause) => cause, } } } /// Errors returned by TerminateJob #[derive(Debug, PartialEq)] pub enum TerminateJobError { /// <p>These errors are usually caused by a client action, such as using an action or resource on behalf of a user that doesn't have permissions to use the action or resource, or specifying an identifier that is not valid. </p> Client(String), /// <p>These errors are usually caused by a server issue.</p> Server(String), } impl TerminateJobError { pub fn from_response(res: BufferedHttpResponse) -> RusotoError<TerminateJobError> { if let Some(err) = proto::json::Error::parse_rest(&res) { match err.typ.as_str() { "ClientException" => { return RusotoError::Service(TerminateJobError::Client(err.msg)) } "ServerException" => { return RusotoError::Service(TerminateJobError::Server(err.msg)) } "ValidationException" => return RusotoError::Validation(err.msg), _ => {} } } return RusotoError::Unknown(res); } } impl fmt::Display for TerminateJobError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}", self.description()) } } impl Error for TerminateJobError { fn description(&self) -> &str { match *self { TerminateJobError::Client(ref cause) => cause, TerminateJobError::Server(ref cause) => cause, } } } /// Errors returned by UpdateComputeEnvironment #[derive(Debug, PartialEq)] pub enum UpdateComputeEnvironmentError { /// <p>These errors are usually caused by a client action, such as using an action or resource on behalf of a user that doesn't have permissions to use the action or resource, or specifying an identifier that is not valid. </p> Client(String), /// <p>These errors are usually caused by a server issue.</p> Server(String), } impl UpdateComputeEnvironmentError { pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateComputeEnvironmentError> { if let Some(err) = proto::json::Error::parse_rest(&res) { match err.typ.as_str() { "ClientException" => { return RusotoError::Service(UpdateComputeEnvironmentError::Client(err.msg)) } "ServerException" => { return RusotoError::Service(UpdateComputeEnvironmentError::Server(err.msg)) } "ValidationException" => return RusotoError::Validation(err.msg), _ => {} } } return RusotoError::Unknown(res); } } impl fmt::Display for UpdateComputeEnvironmentError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}", self.description()) } } impl Error for UpdateComputeEnvironmentError { fn description(&self) -> &str { match *self { UpdateComputeEnvironmentError::Client(ref cause) => cause, UpdateComputeEnvironmentError::Server(ref cause) => cause, } } } /// Errors returned by UpdateJobQueue #[derive(Debug, PartialEq)] pub enum UpdateJobQueueError { /// <p>These errors are usually caused by a client action, such as using an action or resource on behalf of a user that doesn't have permissions to use the action or resource, or specifying an identifier that is not valid. </p> Client(String), /// <p>These errors are usually caused by a server issue.</p> Server(String), } impl UpdateJobQueueError { pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateJobQueueError> { if let Some(err) = proto::json::Error::parse_rest(&res) { match err.typ.as_str() { "ClientException" => { return RusotoError::Service(UpdateJobQueueError::Client(err.msg)) } "ServerException" => { return RusotoError::Service(UpdateJobQueueError::Server(err.msg)) } "ValidationException" => return RusotoError::Validation(err.msg), _ => {} } } return RusotoError::Unknown(res); } } impl fmt::Display for UpdateJobQueueError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}", self.description()) } } impl Error for UpdateJobQueueError { fn description(&self) -> &str { match *self { UpdateJobQueueError::Client(ref cause) => cause, UpdateJobQueueError::Server(ref cause) => cause, } } } /// Trait representing the capabilities of the AWS Batch API. AWS Batch clients implement this trait. pub trait Batch { /// <p>Cancels a job in an AWS Batch job queue. Jobs that are in the <code>SUBMITTED</code>, <code>PENDING</code>, or <code>RUNNABLE</code> state are cancelled. Jobs that have progressed to <code>STARTING</code> or <code>RUNNING</code> are not cancelled (but the API operation still succeeds, even if no job is cancelled); these jobs must be terminated with the <a>TerminateJob</a> operation.</p> fn cancel_job( &self, input: CancelJobRequest, ) -> RusotoFuture<CancelJobResponse, CancelJobError>; /// <p><p>Creates an AWS Batch compute environment. You can create <code>MANAGED</code> or <code>UNMANAGED</code> compute environments.</p> <p>In a managed compute environment, AWS Batch manages the capacity and instance types of the compute resources within the environment. This is based on the compute resource specification that you define or the <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html">launch template</a> that you specify when you create the compute environment. You can choose to use Amazon EC2 On-Demand Instances or Spot Instances in your managed compute environment. You can optionally set a maximum price so that Spot Instances only launch when the Spot Instance price is below a specified percentage of the On-Demand price.</p> <note> <p>Multi-node parallel jobs are not supported on Spot Instances.</p> </note> <p>In an unmanaged compute environment, you can manage your own compute resources. This provides more compute resource configuration options, such as using a custom AMI, but you must ensure that your AMI meets the Amazon ECS container instance AMI specification. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/container_instance_AMIs.html">Container Instance AMIs</a> in the <i>Amazon Elastic Container Service Developer Guide</i>. After you have created your unmanaged compute environment, you can use the <a>DescribeComputeEnvironments</a> operation to find the Amazon ECS cluster that is associated with it. Then, manually launch your container instances into that Amazon ECS cluster. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_container_instance.html">Launching an Amazon ECS Container Instance</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p> <note> <p>AWS Batch does not upgrade the AMIs in a compute environment after it is created (for example, when a newer version of the Amazon ECS-optimized AMI is available). You are responsible for the management of the guest operating system (including updates and security patches) and any additional application software or utilities that you install on the compute resources. To use a new AMI for your AWS Batch jobs:</p> <ol> <li> <p>Create a new compute environment with the new AMI.</p> </li> <li> <p>Add the compute environment to an existing job queue.</p> </li> <li> <p>Remove the old compute environment from your job queue.</p> </li> <li> <p>Delete the old compute environment.</p> </li> </ol> </note></p> fn create_compute_environment( &self, input: CreateComputeEnvironmentRequest, ) -> RusotoFuture<CreateComputeEnvironmentResponse, CreateComputeEnvironmentError>; /// <p>Creates an AWS Batch job queue. When you create a job queue, you associate one or more compute environments to the queue and assign an order of preference for the compute environments.</p> <p>You also set a priority to the job queue that determines the order in which the AWS Batch scheduler places jobs onto its associated compute environments. For example, if a compute environment is associated with more than one job queue, the job queue with a higher priority is given preference for scheduling jobs to that compute environment.</p> fn create_job_queue( &self, input: CreateJobQueueRequest, ) -> RusotoFuture<CreateJobQueueResponse, CreateJobQueueError>; /// <p>Deletes an AWS Batch compute environment.</p> <p>Before you can delete a compute environment, you must set its state to <code>DISABLED</code> with the <a>UpdateComputeEnvironment</a> API operation and disassociate it from any job queues with the <a>UpdateJobQueue</a> API operation.</p> fn delete_compute_environment( &self, input: DeleteComputeEnvironmentRequest, ) -> RusotoFuture<DeleteComputeEnvironmentResponse, DeleteComputeEnvironmentError>; /// <p>Deletes the specified job queue. You must first disable submissions for a queue with the <a>UpdateJobQueue</a> operation. All jobs in the queue are terminated when you delete a job queue.</p> <p>It is not necessary to disassociate compute environments from a queue before submitting a <code>DeleteJobQueue</code> request. </p> fn delete_job_queue( &self, input: DeleteJobQueueRequest, ) -> RusotoFuture<DeleteJobQueueResponse, DeleteJobQueueError>; /// <p>Deregisters an AWS Batch job definition.</p> fn deregister_job_definition( &self, input: DeregisterJobDefinitionRequest, ) -> RusotoFuture<DeregisterJobDefinitionResponse, DeregisterJobDefinitionError>; /// <p>Describes one or more of your compute environments.</p> <p>If you are using an unmanaged compute environment, you can use the <code>DescribeComputeEnvironment</code> operation to determine the <code>ecsClusterArn</code> that you should launch your Amazon ECS container instances into.</p> fn describe_compute_environments( &self, input: DescribeComputeEnvironmentsRequest, ) -> RusotoFuture<DescribeComputeEnvironmentsResponse, DescribeComputeEnvironmentsError>; /// <p>Describes a list of job definitions. You can specify a <code>status</code> (such as <code>ACTIVE</code>) to only return job definitions that match that status.</p> fn describe_job_definitions( &self, input: DescribeJobDefinitionsRequest, ) -> RusotoFuture<DescribeJobDefinitionsResponse, DescribeJobDefinitionsError>; /// <p>Describes one or more of your job queues.</p> fn describe_job_queues( &self, input: DescribeJobQueuesRequest, ) -> RusotoFuture<DescribeJobQueuesResponse, DescribeJobQueuesError>; /// <p>Describes a list of AWS Batch jobs.</p> fn describe_jobs( &self, input: DescribeJobsRequest, ) -> RusotoFuture<DescribeJobsResponse, DescribeJobsError>; /// <p>Returns a list of AWS Batch jobs.</p> <p>You must specify only one of the following:</p> <ul> <li> <p>a job queue ID to return a list of jobs in that job queue</p> </li> <li> <p>a multi-node parallel job ID to return a list of that job's nodes</p> </li> <li> <p>an array job ID to return a list of that job's children</p> </li> </ul> <p>You can filter the results by job status with the <code>jobStatus</code> parameter. If you do not specify a status, only <code>RUNNING</code> jobs are returned.</p> fn list_jobs(&self, input: ListJobsRequest) -> RusotoFuture<ListJobsResponse, ListJobsError>; /// <p>Registers an AWS Batch job definition. </p> fn register_job_definition( &self, input: RegisterJobDefinitionRequest, ) -> RusotoFuture<RegisterJobDefinitionResponse, RegisterJobDefinitionError>; /// <p>Submits an AWS Batch job from a job definition. Parameters specified during <a>SubmitJob</a> override parameters defined in the job definition. </p> fn submit_job( &self, input: SubmitJobRequest, ) -> RusotoFuture<SubmitJobResponse, SubmitJobError>; /// <p>Terminates a job in a job queue. Jobs that are in the <code>STARTING</code> or <code>RUNNING</code> state are terminated, which causes them to transition to <code>FAILED</code>. Jobs that have not progressed to the <code>STARTING</code> state are cancelled.</p> fn terminate_job( &self, input: TerminateJobRequest, ) -> RusotoFuture<TerminateJobResponse, TerminateJobError>; /// <p>Updates an AWS Batch compute environment.</p> fn update_compute_environment( &self, input: UpdateComputeEnvironmentRequest, ) -> RusotoFuture<UpdateComputeEnvironmentResponse, UpdateComputeEnvironmentError>; /// <p>Updates a job queue.</p> fn update_job_queue( &self, input: UpdateJobQueueRequest, ) -> RusotoFuture<UpdateJobQueueResponse, UpdateJobQueueError>; } /// A client for the AWS Batch API. #[derive(Clone)] pub struct BatchClient { client: Client, region: region::Region, } impl BatchClient { /// Creates a client backed by the default tokio event loop. /// /// The client will use the default credentials provider and tls client. pub fn new(region: region::Region) -> BatchClient { BatchClient { client: Client::shared(), region, } } pub fn new_with<P, D>( request_dispatcher: D, credentials_provider: P, region: region::Region, ) -> BatchClient where P: ProvideAwsCredentials + Send + Sync + 'static, P::Future: Send, D: DispatchSignedRequest + Send + Sync + 'static, D::Future: Send, { BatchClient { client: Client::new_with(credentials_provider, request_dispatcher), region, } } } impl Batch for BatchClient { /// <p>Cancels a job in an AWS Batch job queue. Jobs that are in the <code>SUBMITTED</code>, <code>PENDING</code>, or <code>RUNNABLE</code> state are cancelled. Jobs that have progressed to <code>STARTING</code> or <code>RUNNING</code> are not cancelled (but the API operation still succeeds, even if no job is cancelled); these jobs must be terminated with the <a>TerminateJob</a> operation.</p> fn cancel_job( &self, input: CancelJobRequest, ) -> RusotoFuture<CancelJobResponse, CancelJobError> { let request_uri = "/v1/canceljob"; let mut request = SignedRequest::new("POST", "batch", &self.region, &request_uri); request.set_content_type("application/x-amz-json-1.1".to_owned()); let encoded = Some(serde_json::to_vec(&input).unwrap()); request.set_payload(encoded); self.client.sign_and_dispatch(request, |response| { if response.status.is_success() { Box::new(response.buffer().from_err().and_then(|response| { let result = proto::json::ResponsePayload::new(&response) .deserialize::<CancelJobResponse, _>()?; Ok(result) })) } else { Box::new( response .buffer() .from_err() .and_then(|response| Err(CancelJobError::from_response(response))), ) } }) } /// <p><p>Creates an AWS Batch compute environment. You can create <code>MANAGED</code> or <code>UNMANAGED</code> compute environments.</p> <p>In a managed compute environment, AWS Batch manages the capacity and instance types of the compute resources within the environment. This is based on the compute resource specification that you define or the <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html">launch template</a> that you specify when you create the compute environment. You can choose to use Amazon EC2 On-Demand Instances or Spot Instances in your managed compute environment. You can optionally set a maximum price so that Spot Instances only launch when the Spot Instance price is below a specified percentage of the On-Demand price.</p> <note> <p>Multi-node parallel jobs are not supported on Spot Instances.</p> </note> <p>In an unmanaged compute environment, you can manage your own compute resources. This provides more compute resource configuration options, such as using a custom AMI, but you must ensure that your AMI meets the Amazon ECS container instance AMI specification. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/container_instance_AMIs.html">Container Instance AMIs</a> in the <i>Amazon Elastic Container Service Developer Guide</i>. After you have created your unmanaged compute environment, you can use the <a>DescribeComputeEnvironments</a> operation to find the Amazon ECS cluster that is associated with it. Then, manually launch your container instances into that Amazon ECS cluster. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_container_instance.html">Launching an Amazon ECS Container Instance</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p> <note> <p>AWS Batch does not upgrade the AMIs in a compute environment after it is created (for example, when a newer version of the Amazon ECS-optimized AMI is available). You are responsible for the management of the guest operating system (including updates and security patches) and any additional application software or utilities that you install on the compute resources. To use a new AMI for your AWS Batch jobs:</p> <ol> <li> <p>Create a new compute environment with the new AMI.</p> </li> <li> <p>Add the compute environment to an existing job queue.</p> </li> <li> <p>Remove the old compute environment from your job queue.</p> </li> <li> <p>Delete the old compute environment.</p> </li> </ol> </note></p> fn create_compute_environment( &self, input: CreateComputeEnvironmentRequest, ) -> RusotoFuture<CreateComputeEnvironmentResponse, CreateComputeEnvironmentError> { let request_uri = "/v1/createcomputeenvironment"; let mut request = SignedRequest::new("POST", "batch", &self.region, &request_uri); request.set_content_type("application/x-amz-json-1.1".to_owned()); let encoded = Some(serde_json::to_vec(&input).unwrap()); request.set_payload(encoded); self.client.sign_and_dispatch(request, |response| { if response.status.is_success() { Box::new(response.buffer().from_err().and_then(|response| { let result = proto::json::ResponsePayload::new(&response) .deserialize::<CreateComputeEnvironmentResponse, _>()?; Ok(result) })) } else { Box::new(response.buffer().from_err().and_then(|response| { Err(CreateComputeEnvironmentError::from_response(response)) })) } }) } /// <p>Creates an AWS Batch job queue. When you create a job queue, you associate one or more compute environments to the queue and assign an order of preference for the compute environments.</p> <p>You also set a priority to the job queue that determines the order in which the AWS Batch scheduler places jobs onto its associated compute environments. For example, if a compute environment is associated with more than one job queue, the job queue with a higher priority is given preference for scheduling jobs to that compute environment.</p> fn create_job_queue( &self, input: CreateJobQueueRequest, ) -> RusotoFuture<CreateJobQueueResponse, CreateJobQueueError> { let request_uri = "/v1/createjobqueue"; let mut request = SignedRequest::new("POST", "batch", &self.region, &request_uri); request.set_content_type("application/x-amz-json-1.1".to_owned()); let encoded = Some(serde_json::to_vec(&input).unwrap()); request.set_payload(encoded); self.client.sign_and_dispatch(request, |response| { if response.status.is_success() { Box::new(response.buffer().from_err().and_then(|response| { let result = proto::json::ResponsePayload::new(&response) .deserialize::<CreateJobQueueResponse, _>()?; Ok(result) })) } else { Box::new( response .buffer() .from_err() .and_then(|response| Err(CreateJobQueueError::from_response(response))), ) } }) } /// <p>Deletes an AWS Batch compute environment.</p> <p>Before you can delete a compute environment, you must set its state to <code>DISABLED</code> with the <a>UpdateComputeEnvironment</a> API operation and disassociate it from any job queues with the <a>UpdateJobQueue</a> API operation.</p> fn delete_compute_environment( &self, input: DeleteComputeEnvironmentRequest, ) -> RusotoFuture<DeleteComputeEnvironmentResponse, DeleteComputeEnvironmentError> { let request_uri = "/v1/deletecomputeenvironment"; let mut request = SignedRequest::new("POST", "batch", &self.region, &request_uri); request.set_content_type("application/x-amz-json-1.1".to_owned()); let encoded = Some(serde_json::to_vec(&input).unwrap()); request.set_payload(encoded); self.client.sign_and_dispatch(request, |response| { if response.status.is_success() { Box::new(response.buffer().from_err().and_then(|response| { let result = proto::json::ResponsePayload::new(&response) .deserialize::<DeleteComputeEnvironmentResponse, _>()?; Ok(result) })) } else { Box::new(response.buffer().from_err().and_then(|response| { Err(DeleteComputeEnvironmentError::from_response(response)) })) } }) } /// <p>Deletes the specified job queue. You must first disable submissions for a queue with the <a>UpdateJobQueue</a> operation. All jobs in the queue are terminated when you delete a job queue.</p> <p>It is not necessary to disassociate compute environments from a queue before submitting a <code>DeleteJobQueue</code> request. </p> fn delete_job_queue( &self, input: DeleteJobQueueRequest, ) -> RusotoFuture<DeleteJobQueueResponse, DeleteJobQueueError> { let request_uri = "/v1/deletejobqueue"; let mut request = SignedRequest::new("POST", "batch", &self.region, &request_uri); request.set_content_type("application/x-amz-json-1.1".to_owned()); let encoded = Some(serde_json::to_vec(&input).unwrap()); request.set_payload(encoded); self.client.sign_and_dispatch(request, |response| { if response.status.is_success() { Box::new(response.buffer().from_err().and_then(|response| { let result = proto::json::ResponsePayload::new(&response) .deserialize::<DeleteJobQueueResponse, _>()?; Ok(result) })) } else { Box::new( response .buffer() .from_err() .and_then(|response| Err(DeleteJobQueueError::from_response(response))), ) } }) } /// <p>Deregisters an AWS Batch job definition.</p> fn deregister_job_definition( &self, input: DeregisterJobDefinitionRequest, ) -> RusotoFuture<DeregisterJobDefinitionResponse, DeregisterJobDefinitionError> { let request_uri = "/v1/deregisterjobdefinition"; let mut request = SignedRequest::new("POST", "batch", &self.region, &request_uri); request.set_content_type("application/x-amz-json-1.1".to_owned()); let encoded = Some(serde_json::to_vec(&input).unwrap()); request.set_payload(encoded); self.client.sign_and_dispatch(request, |response| { if response.status.is_success() { Box::new(response.buffer().from_err().and_then(|response| { let result = proto::json::ResponsePayload::new(&response) .deserialize::<DeregisterJobDefinitionResponse, _>()?; Ok(result) })) } else { Box::new(response.buffer().from_err().and_then(|response| { Err(DeregisterJobDefinitionError::from_response(response)) })) } }) } /// <p>Describes one or more of your compute environments.</p> <p>If you are using an unmanaged compute environment, you can use the <code>DescribeComputeEnvironment</code> operation to determine the <code>ecsClusterArn</code> that you should launch your Amazon ECS container instances into.</p> fn describe_compute_environments( &self, input: DescribeComputeEnvironmentsRequest, ) -> RusotoFuture<DescribeComputeEnvironmentsResponse, DescribeComputeEnvironmentsError> { let request_uri = "/v1/describecomputeenvironments"; let mut request = SignedRequest::new("POST", "batch", &self.region, &request_uri); request.set_content_type("application/x-amz-json-1.1".to_owned()); let encoded = Some(serde_json::to_vec(&input).unwrap()); request.set_payload(encoded); self.client.sign_and_dispatch(request, |response| { if response.status.is_success() { Box::new(response.buffer().from_err().and_then(|response| { let result = proto::json::ResponsePayload::new(&response) .deserialize::<DescribeComputeEnvironmentsResponse, _>()?; Ok(result) })) } else { Box::new(response.buffer().from_err().and_then(|response| { Err(DescribeComputeEnvironmentsError::from_response(response)) })) } }) } /// <p>Describes a list of job definitions. You can specify a <code>status</code> (such as <code>ACTIVE</code>) to only return job definitions that match that status.</p> fn describe_job_definitions( &self, input: DescribeJobDefinitionsRequest, ) -> RusotoFuture<DescribeJobDefinitionsResponse, DescribeJobDefinitionsError> { let request_uri = "/v1/describejobdefinitions"; let mut request = SignedRequest::new("POST", "batch", &self.region, &request_uri); request.set_content_type("application/x-amz-json-1.1".to_owned()); let encoded = Some(serde_json::to_vec(&input).unwrap()); request.set_payload(encoded); self.client.sign_and_dispatch(request, |response| { if response.status.is_success() { Box::new(response.buffer().from_err().and_then(|response| { let result = proto::json::ResponsePayload::new(&response) .deserialize::<DescribeJobDefinitionsResponse, _>()?; Ok(result) })) } else { Box::new( response.buffer().from_err().and_then(|response| { Err(DescribeJobDefinitionsError::from_response(response)) }), ) } }) } /// <p>Describes one or more of your job queues.</p> fn describe_job_queues( &self, input: DescribeJobQueuesRequest, ) -> RusotoFuture<DescribeJobQueuesResponse, DescribeJobQueuesError> { let request_uri = "/v1/describejobqueues"; let mut request = SignedRequest::new("POST", "batch", &self.region, &request_uri); request.set_content_type("application/x-amz-json-1.1".to_owned()); let encoded = Some(serde_json::to_vec(&input).unwrap()); request.set_payload(encoded); self.client.sign_and_dispatch(request, |response| { if response.status.is_success() { Box::new(response.buffer().from_err().and_then(|response| { let result = proto::json::ResponsePayload::new(&response) .deserialize::<DescribeJobQueuesResponse, _>()?; Ok(result) })) } else { Box::new( response .buffer() .from_err() .and_then(|response| Err(DescribeJobQueuesError::from_response(response))), ) } }) } /// <p>Describes a list of AWS Batch jobs.</p> fn describe_jobs( &self, input: DescribeJobsRequest, ) -> RusotoFuture<DescribeJobsResponse, DescribeJobsError> { let request_uri = "/v1/describejobs"; let mut request = SignedRequest::new("POST", "batch", &self.region, &request_uri); request.set_content_type("application/x-amz-json-1.1".to_owned()); let encoded = Some(serde_json::to_vec(&input).unwrap()); request.set_payload(encoded); self.client.sign_and_dispatch(request, |response| { if response.status.is_success() { Box::new(response.buffer().from_err().and_then(|response| { let result = proto::json::ResponsePayload::new(&response) .deserialize::<DescribeJobsResponse, _>()?; Ok(result) })) } else { Box::new( response .buffer() .from_err() .and_then(|response| Err(DescribeJobsError::from_response(response))), ) } }) } /// <p>Returns a list of AWS Batch jobs.</p> <p>You must specify only one of the following:</p> <ul> <li> <p>a job queue ID to return a list of jobs in that job queue</p> </li> <li> <p>a multi-node parallel job ID to return a list of that job's nodes</p> </li> <li> <p>an array job ID to return a list of that job's children</p> </li> </ul> <p>You can filter the results by job status with the <code>jobStatus</code> parameter. If you do not specify a status, only <code>RUNNING</code> jobs are returned.</p> fn list_jobs(&self, input: ListJobsRequest) -> RusotoFuture<ListJobsResponse, ListJobsError> { let request_uri = "/v1/listjobs"; let mut request = SignedRequest::new("POST", "batch", &self.region, &request_uri); request.set_content_type("application/x-amz-json-1.1".to_owned()); let encoded = Some(serde_json::to_vec(&input).unwrap()); request.set_payload(encoded); self.client.sign_and_dispatch(request, |response| { if response.status.is_success() { Box::new(response.buffer().from_err().and_then(|response| { let result = proto::json::ResponsePayload::new(&response) .deserialize::<ListJobsResponse, _>()?; Ok(result) })) } else { Box::new( response .buffer() .from_err() .and_then(|response| Err(ListJobsError::from_response(response))), ) } }) } /// <p>Registers an AWS Batch job definition. </p> fn register_job_definition( &self, input: RegisterJobDefinitionRequest, ) -> RusotoFuture<RegisterJobDefinitionResponse, RegisterJobDefinitionError> { let request_uri = "/v1/registerjobdefinition"; let mut request = SignedRequest::new("POST", "batch", &self.region, &request_uri); request.set_content_type("application/x-amz-json-1.1".to_owned()); let encoded = Some(serde_json::to_vec(&input).unwrap()); request.set_payload(encoded); self.client.sign_and_dispatch(request, |response| { if response.status.is_success() { Box::new(response.buffer().from_err().and_then(|response| { let result = proto::json::ResponsePayload::new(&response) .deserialize::<RegisterJobDefinitionResponse, _>()?; Ok(result) })) } else { Box::new( response.buffer().from_err().and_then(|response| { Err(RegisterJobDefinitionError::from_response(response)) }), ) } }) } /// <p>Submits an AWS Batch job from a job definition. Parameters specified during <a>SubmitJob</a> override parameters defined in the job definition. </p> fn submit_job( &self, input: SubmitJobRequest, ) -> RusotoFuture<SubmitJobResponse, SubmitJobError> { let request_uri = "/v1/submitjob"; let mut request = SignedRequest::new("POST", "batch", &self.region, &request_uri); request.set_content_type("application/x-amz-json-1.1".to_owned()); let encoded = Some(serde_json::to_vec(&input).unwrap()); request.set_payload(encoded); self.client.sign_and_dispatch(request, |response| { if response.status.is_success() { Box::new(response.buffer().from_err().and_then(|response| { let result = proto::json::ResponsePayload::new(&response) .deserialize::<SubmitJobResponse, _>()?; Ok(result) })) } else { Box::new( response .buffer() .from_err() .and_then(|response| Err(SubmitJobError::from_response(response))), ) } }) } /// <p>Terminates a job in a job queue. Jobs that are in the <code>STARTING</code> or <code>RUNNING</code> state are terminated, which causes them to transition to <code>FAILED</code>. Jobs that have not progressed to the <code>STARTING</code> state are cancelled.</p> fn terminate_job( &self, input: TerminateJobRequest, ) -> RusotoFuture<TerminateJobResponse, TerminateJobError> { let request_uri = "/v1/terminatejob"; let mut request = SignedRequest::new("POST", "batch", &self.region, &request_uri); request.set_content_type("application/x-amz-json-1.1".to_owned()); let encoded = Some(serde_json::to_vec(&input).unwrap()); request.set_payload(encoded); self.client.sign_and_dispatch(request, |response| { if response.status.is_success() { Box::new(response.buffer().from_err().and_then(|response| { let result = proto::json::ResponsePayload::new(&response) .deserialize::<TerminateJobResponse, _>()?; Ok(result) })) } else { Box::new( response .buffer() .from_err() .and_then(|response| Err(TerminateJobError::from_response(response))), ) } }) } /// <p>Updates an AWS Batch compute environment.</p> fn update_compute_environment( &self, input: UpdateComputeEnvironmentRequest, ) -> RusotoFuture<UpdateComputeEnvironmentResponse, UpdateComputeEnvironmentError> { let request_uri = "/v1/updatecomputeenvironment"; let mut request = SignedRequest::new("POST", "batch", &self.region, &request_uri); request.set_content_type("application/x-amz-json-1.1".to_owned()); let encoded = Some(serde_json::to_vec(&input).unwrap()); request.set_payload(encoded); self.client.sign_and_dispatch(request, |response| { if response.status.is_success() { Box::new(response.buffer().from_err().and_then(|response| { let result = proto::json::ResponsePayload::new(&response) .deserialize::<UpdateComputeEnvironmentResponse, _>()?; Ok(result) })) } else { Box::new(response.buffer().from_err().and_then(|response| { Err(UpdateComputeEnvironmentError::from_response(response)) })) } }) } /// <p>Updates a job queue.</p> fn update_job_queue( &self, input: UpdateJobQueueRequest, ) -> RusotoFuture<UpdateJobQueueResponse, UpdateJobQueueError> { let request_uri = "/v1/updatejobqueue"; let mut request = SignedRequest::new("POST", "batch", &self.region, &request_uri); request.set_content_type("application/x-amz-json-1.1".to_owned()); let encoded = Some(serde_json::to_vec(&input).unwrap()); request.set_payload(encoded); self.client.sign_and_dispatch(request, |response| { if response.status.is_success() { Box::new(response.buffer().from_err().and_then(|response| { let result = proto::json::ResponsePayload::new(&response) .deserialize::<UpdateJobQueueResponse, _>()?; Ok(result) })) } else { Box::new( response .buffer() .from_err() .and_then(|response| Err(UpdateJobQueueError::from_response(response))), ) } }) } }