1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[derive(Debug)]
pub(crate) struct Handle<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
pub(crate) client: aws_smithy_client::Client<C, M, R>,
pub(crate) conf: crate::Config,
}
/// Client for Amazon CloudWatch
///
/// Client for invoking operations on Amazon CloudWatch. Each operation on Amazon CloudWatch is a method on this
/// this struct. `.send()` MUST be invoked on the generated operations to dispatch the request to the service.
///
/// # Examples
/// **Constructing a client and invoking an operation**
/// ```rust,no_run
/// # async fn docs() {
/// // create a shared configuration. This can be used & shared between multiple service clients.
/// let shared_config = aws_config::load_from_env().await;
/// let client = aws_sdk_cloudwatch::Client::new(&shared_config);
/// // invoke an operation
/// /* let rsp = client
/// .<operation_name>().
/// .<param>("some value")
/// .send().await; */
/// # }
/// ```
/// **Constructing a client with custom configuration**
/// ```rust,no_run
/// use aws_config::RetryConfig;
/// # async fn docs() {
/// let shared_config = aws_config::load_from_env().await;
/// let config = aws_sdk_cloudwatch::config::Builder::from(&shared_config)
/// .retry_config(RetryConfig::disabled())
/// .build();
/// let client = aws_sdk_cloudwatch::Client::from_conf(config);
/// # }
#[derive(std::fmt::Debug)]
pub struct Client<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<Handle<C, M, R>>,
}
impl<C, M, R> std::clone::Clone for Client<C, M, R> {
fn clone(&self) -> Self {
Self {
handle: self.handle.clone(),
}
}
}
#[doc(inline)]
pub use aws_smithy_client::Builder;
impl<C, M, R> From<aws_smithy_client::Client<C, M, R>> for Client<C, M, R> {
fn from(client: aws_smithy_client::Client<C, M, R>) -> Self {
Self::with_config(client, crate::Config::builder().build())
}
}
impl<C, M, R> Client<C, M, R> {
/// Creates a client with the given service configuration.
pub fn with_config(client: aws_smithy_client::Client<C, M, R>, conf: crate::Config) -> Self {
Self {
handle: std::sync::Arc::new(Handle { client, conf }),
}
}
/// Returns the client's configuration.
pub fn conf(&self) -> &crate::Config {
&self.handle.conf
}
}
impl<C, M, R> Client<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Constructs a fluent builder for the [`DeleteAlarms`](crate::client::fluent_builders::DeleteAlarms) operation.
///
/// - The fluent builder is configurable:
/// - [`alarm_names(Vec<String>)`](crate::client::fluent_builders::DeleteAlarms::alarm_names) / [`set_alarm_names(Option<Vec<String>>)`](crate::client::fluent_builders::DeleteAlarms::set_alarm_names): <p>The alarms to be deleted.</p>
/// - On success, responds with [`DeleteAlarmsOutput`](crate::output::DeleteAlarmsOutput)
/// - On failure, responds with [`SdkError<DeleteAlarmsError>`](crate::error::DeleteAlarmsError)
pub fn delete_alarms(&self) -> fluent_builders::DeleteAlarms<C, M, R> {
fluent_builders::DeleteAlarms::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`DeleteAnomalyDetector`](crate::client::fluent_builders::DeleteAnomalyDetector) operation.
///
/// - The fluent builder is configurable:
/// - [`namespace(impl Into<String>)`](crate::client::fluent_builders::DeleteAnomalyDetector::namespace) / [`set_namespace(Option<String>)`](crate::client::fluent_builders::DeleteAnomalyDetector::set_namespace): <p>The namespace associated with the anomaly detection model to delete.</p>
/// - [`metric_name(impl Into<String>)`](crate::client::fluent_builders::DeleteAnomalyDetector::metric_name) / [`set_metric_name(Option<String>)`](crate::client::fluent_builders::DeleteAnomalyDetector::set_metric_name): <p>The metric name associated with the anomaly detection model to delete.</p>
/// - [`dimensions(Vec<Dimension>)`](crate::client::fluent_builders::DeleteAnomalyDetector::dimensions) / [`set_dimensions(Option<Vec<Dimension>>)`](crate::client::fluent_builders::DeleteAnomalyDetector::set_dimensions): <p>The metric dimensions associated with the anomaly detection model to delete.</p>
/// - [`stat(impl Into<String>)`](crate::client::fluent_builders::DeleteAnomalyDetector::stat) / [`set_stat(Option<String>)`](crate::client::fluent_builders::DeleteAnomalyDetector::set_stat): <p>The statistic associated with the anomaly detection model to delete.</p>
/// - [`single_metric_anomaly_detector(SingleMetricAnomalyDetector)`](crate::client::fluent_builders::DeleteAnomalyDetector::single_metric_anomaly_detector) / [`set_single_metric_anomaly_detector(Option<SingleMetricAnomalyDetector>)`](crate::client::fluent_builders::DeleteAnomalyDetector::set_single_metric_anomaly_detector): <p>A single metric anomaly detector to be deleted.</p> <p>When using <code>SingleMetricAnomalyDetector</code>, you cannot include the following parameters in the same operation:</p> <ul> <li> <p> <code>Dimensions</code>,</p> </li> <li> <p> <code>MetricName</code> </p> </li> <li> <p> <code>Namespace</code> </p> </li> <li> <p> <code>Stat</code> </p> </li> <li> <p>the <code>MetricMathAnomalyDetector</code> parameters of <code>DeleteAnomalyDetectorInput</code> </p> </li> </ul> <p>Instead, specify the single metric anomaly detector attributes as part of the <code>SingleMetricAnomalyDetector</code> property.</p>
/// - [`metric_math_anomaly_detector(MetricMathAnomalyDetector)`](crate::client::fluent_builders::DeleteAnomalyDetector::metric_math_anomaly_detector) / [`set_metric_math_anomaly_detector(Option<MetricMathAnomalyDetector>)`](crate::client::fluent_builders::DeleteAnomalyDetector::set_metric_math_anomaly_detector): <p>The metric math anomaly detector to be deleted.</p> <p>When using <code>MetricMathAnomalyDetector</code>, you cannot include following parameters in the same operation:</p> <ul> <li> <p> <code>Dimensions</code>,</p> </li> <li> <p> <code>MetricName</code> </p> </li> <li> <p> <code>Namespace</code> </p> </li> <li> <p> <code>Stat</code> </p> </li> <li> <p>the <code>SingleMetricAnomalyDetector</code> parameters of <code>DeleteAnomalyDetectorInput</code> </p> </li> </ul> <p>Instead, specify the metric math anomaly detector attributes as part of the <code>MetricMathAnomalyDetector</code> property.</p>
/// - On success, responds with [`DeleteAnomalyDetectorOutput`](crate::output::DeleteAnomalyDetectorOutput)
/// - On failure, responds with [`SdkError<DeleteAnomalyDetectorError>`](crate::error::DeleteAnomalyDetectorError)
pub fn delete_anomaly_detector(&self) -> fluent_builders::DeleteAnomalyDetector<C, M, R> {
fluent_builders::DeleteAnomalyDetector::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`DeleteDashboards`](crate::client::fluent_builders::DeleteDashboards) operation.
///
/// - The fluent builder is configurable:
/// - [`dashboard_names(Vec<String>)`](crate::client::fluent_builders::DeleteDashboards::dashboard_names) / [`set_dashboard_names(Option<Vec<String>>)`](crate::client::fluent_builders::DeleteDashboards::set_dashboard_names): <p>The dashboards to be deleted. This parameter is required.</p>
/// - On success, responds with [`DeleteDashboardsOutput`](crate::output::DeleteDashboardsOutput)
/// - On failure, responds with [`SdkError<DeleteDashboardsError>`](crate::error::DeleteDashboardsError)
pub fn delete_dashboards(&self) -> fluent_builders::DeleteDashboards<C, M, R> {
fluent_builders::DeleteDashboards::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`DeleteInsightRules`](crate::client::fluent_builders::DeleteInsightRules) operation.
///
/// - The fluent builder is configurable:
/// - [`rule_names(Vec<String>)`](crate::client::fluent_builders::DeleteInsightRules::rule_names) / [`set_rule_names(Option<Vec<String>>)`](crate::client::fluent_builders::DeleteInsightRules::set_rule_names): <p>An array of the rule names to delete. If you need to find out the names of your rules, use <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeInsightRules.html">DescribeInsightRules</a>.</p>
/// - On success, responds with [`DeleteInsightRulesOutput`](crate::output::DeleteInsightRulesOutput) with field(s):
/// - [`failures(Option<Vec<PartialFailure>>)`](crate::output::DeleteInsightRulesOutput::failures): <p>An array listing the rules that could not be deleted. You cannot delete built-in rules.</p>
/// - On failure, responds with [`SdkError<DeleteInsightRulesError>`](crate::error::DeleteInsightRulesError)
pub fn delete_insight_rules(&self) -> fluent_builders::DeleteInsightRules<C, M, R> {
fluent_builders::DeleteInsightRules::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`DeleteMetricStream`](crate::client::fluent_builders::DeleteMetricStream) operation.
///
/// - The fluent builder is configurable:
/// - [`name(impl Into<String>)`](crate::client::fluent_builders::DeleteMetricStream::name) / [`set_name(Option<String>)`](crate::client::fluent_builders::DeleteMetricStream::set_name): <p>The name of the metric stream to delete.</p>
/// - On success, responds with [`DeleteMetricStreamOutput`](crate::output::DeleteMetricStreamOutput)
/// - On failure, responds with [`SdkError<DeleteMetricStreamError>`](crate::error::DeleteMetricStreamError)
pub fn delete_metric_stream(&self) -> fluent_builders::DeleteMetricStream<C, M, R> {
fluent_builders::DeleteMetricStream::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`DescribeAlarmHistory`](crate::client::fluent_builders::DescribeAlarmHistory) operation.
/// This operation supports pagination; See [`into_paginator()`](crate::client::fluent_builders::DescribeAlarmHistory::into_paginator).
///
/// - The fluent builder is configurable:
/// - [`alarm_name(impl Into<String>)`](crate::client::fluent_builders::DescribeAlarmHistory::alarm_name) / [`set_alarm_name(Option<String>)`](crate::client::fluent_builders::DescribeAlarmHistory::set_alarm_name): <p>The name of the alarm.</p>
/// - [`alarm_types(Vec<AlarmType>)`](crate::client::fluent_builders::DescribeAlarmHistory::alarm_types) / [`set_alarm_types(Option<Vec<AlarmType>>)`](crate::client::fluent_builders::DescribeAlarmHistory::set_alarm_types): <p>Use this parameter to specify whether you want the operation to return metric alarms or composite alarms. If you omit this parameter, only metric alarms are returned.</p>
/// - [`history_item_type(HistoryItemType)`](crate::client::fluent_builders::DescribeAlarmHistory::history_item_type) / [`set_history_item_type(Option<HistoryItemType>)`](crate::client::fluent_builders::DescribeAlarmHistory::set_history_item_type): <p>The type of alarm histories to retrieve.</p>
/// - [`start_date(DateTime)`](crate::client::fluent_builders::DescribeAlarmHistory::start_date) / [`set_start_date(Option<DateTime>)`](crate::client::fluent_builders::DescribeAlarmHistory::set_start_date): <p>The starting date to retrieve alarm history.</p>
/// - [`end_date(DateTime)`](crate::client::fluent_builders::DescribeAlarmHistory::end_date) / [`set_end_date(Option<DateTime>)`](crate::client::fluent_builders::DescribeAlarmHistory::set_end_date): <p>The ending date to retrieve alarm history.</p>
/// - [`max_records(i32)`](crate::client::fluent_builders::DescribeAlarmHistory::max_records) / [`set_max_records(Option<i32>)`](crate::client::fluent_builders::DescribeAlarmHistory::set_max_records): <p>The maximum number of alarm history records to retrieve.</p>
/// - [`next_token(impl Into<String>)`](crate::client::fluent_builders::DescribeAlarmHistory::next_token) / [`set_next_token(Option<String>)`](crate::client::fluent_builders::DescribeAlarmHistory::set_next_token): <p>The token returned by a previous call to indicate that there is more data available.</p>
/// - [`scan_by(ScanBy)`](crate::client::fluent_builders::DescribeAlarmHistory::scan_by) / [`set_scan_by(Option<ScanBy>)`](crate::client::fluent_builders::DescribeAlarmHistory::set_scan_by): <p>Specified whether to return the newest or oldest alarm history first. Specify <code>TimestampDescending</code> to have the newest event history returned first, and specify <code>TimestampAscending</code> to have the oldest history returned first.</p>
/// - On success, responds with [`DescribeAlarmHistoryOutput`](crate::output::DescribeAlarmHistoryOutput) with field(s):
/// - [`alarm_history_items(Option<Vec<AlarmHistoryItem>>)`](crate::output::DescribeAlarmHistoryOutput::alarm_history_items): <p>The alarm histories, in JSON format.</p>
/// - [`next_token(Option<String>)`](crate::output::DescribeAlarmHistoryOutput::next_token): <p>The token that marks the start of the next batch of returned results.</p>
/// - On failure, responds with [`SdkError<DescribeAlarmHistoryError>`](crate::error::DescribeAlarmHistoryError)
pub fn describe_alarm_history(&self) -> fluent_builders::DescribeAlarmHistory<C, M, R> {
fluent_builders::DescribeAlarmHistory::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`DescribeAlarms`](crate::client::fluent_builders::DescribeAlarms) operation.
/// This operation supports pagination; See [`into_paginator()`](crate::client::fluent_builders::DescribeAlarms::into_paginator).
///
/// - The fluent builder is configurable:
/// - [`alarm_names(Vec<String>)`](crate::client::fluent_builders::DescribeAlarms::alarm_names) / [`set_alarm_names(Option<Vec<String>>)`](crate::client::fluent_builders::DescribeAlarms::set_alarm_names): <p>The names of the alarms to retrieve information about.</p>
/// - [`alarm_name_prefix(impl Into<String>)`](crate::client::fluent_builders::DescribeAlarms::alarm_name_prefix) / [`set_alarm_name_prefix(Option<String>)`](crate::client::fluent_builders::DescribeAlarms::set_alarm_name_prefix): <p>An alarm name prefix. If you specify this parameter, you receive information about all alarms that have names that start with this prefix.</p> <p>If this parameter is specified, you cannot specify <code>AlarmNames</code>.</p>
/// - [`alarm_types(Vec<AlarmType>)`](crate::client::fluent_builders::DescribeAlarms::alarm_types) / [`set_alarm_types(Option<Vec<AlarmType>>)`](crate::client::fluent_builders::DescribeAlarms::set_alarm_types): <p>Use this parameter to specify whether you want the operation to return metric alarms or composite alarms. If you omit this parameter, only metric alarms are returned.</p>
/// - [`children_of_alarm_name(impl Into<String>)`](crate::client::fluent_builders::DescribeAlarms::children_of_alarm_name) / [`set_children_of_alarm_name(Option<String>)`](crate::client::fluent_builders::DescribeAlarms::set_children_of_alarm_name): <p>If you use this parameter and specify the name of a composite alarm, the operation returns information about the "children" alarms of the alarm you specify. These are the metric alarms and composite alarms referenced in the <code>AlarmRule</code> field of the composite alarm that you specify in <code>ChildrenOfAlarmName</code>. Information about the composite alarm that you name in <code>ChildrenOfAlarmName</code> is not returned.</p> <p>If you specify <code>ChildrenOfAlarmName</code>, you cannot specify any other parameters in the request except for <code>MaxRecords</code> and <code>NextToken</code>. If you do so, you receive a validation error.</p> <note> <p>Only the <code>Alarm Name</code>, <code>ARN</code>, <code>StateValue</code> (OK/ALARM/INSUFFICIENT_DATA), and <code>StateUpdatedTimestamp</code> information are returned by this operation when you use this parameter. To get complete information about these alarms, perform another <code>DescribeAlarms</code> operation and specify the parent alarm names in the <code>AlarmNames</code> parameter.</p> </note>
/// - [`parents_of_alarm_name(impl Into<String>)`](crate::client::fluent_builders::DescribeAlarms::parents_of_alarm_name) / [`set_parents_of_alarm_name(Option<String>)`](crate::client::fluent_builders::DescribeAlarms::set_parents_of_alarm_name): <p>If you use this parameter and specify the name of a metric or composite alarm, the operation returns information about the "parent" alarms of the alarm you specify. These are the composite alarms that have <code>AlarmRule</code> parameters that reference the alarm named in <code>ParentsOfAlarmName</code>. Information about the alarm that you specify in <code>ParentsOfAlarmName</code> is not returned.</p> <p>If you specify <code>ParentsOfAlarmName</code>, you cannot specify any other parameters in the request except for <code>MaxRecords</code> and <code>NextToken</code>. If you do so, you receive a validation error.</p> <note> <p>Only the Alarm Name and ARN are returned by this operation when you use this parameter. To get complete information about these alarms, perform another <code>DescribeAlarms</code> operation and specify the parent alarm names in the <code>AlarmNames</code> parameter.</p> </note>
/// - [`state_value(StateValue)`](crate::client::fluent_builders::DescribeAlarms::state_value) / [`set_state_value(Option<StateValue>)`](crate::client::fluent_builders::DescribeAlarms::set_state_value): <p>Specify this parameter to receive information only about alarms that are currently in the state that you specify.</p>
/// - [`action_prefix(impl Into<String>)`](crate::client::fluent_builders::DescribeAlarms::action_prefix) / [`set_action_prefix(Option<String>)`](crate::client::fluent_builders::DescribeAlarms::set_action_prefix): <p>Use this parameter to filter the results of the operation to only those alarms that use a certain alarm action. For example, you could specify the ARN of an SNS topic to find all alarms that send notifications to that topic.</p>
/// - [`max_records(i32)`](crate::client::fluent_builders::DescribeAlarms::max_records) / [`set_max_records(Option<i32>)`](crate::client::fluent_builders::DescribeAlarms::set_max_records): <p>The maximum number of alarm descriptions to retrieve.</p>
/// - [`next_token(impl Into<String>)`](crate::client::fluent_builders::DescribeAlarms::next_token) / [`set_next_token(Option<String>)`](crate::client::fluent_builders::DescribeAlarms::set_next_token): <p>The token returned by a previous call to indicate that there is more data available.</p>
/// - On success, responds with [`DescribeAlarmsOutput`](crate::output::DescribeAlarmsOutput) with field(s):
/// - [`composite_alarms(Option<Vec<CompositeAlarm>>)`](crate::output::DescribeAlarmsOutput::composite_alarms): <p>The information about any composite alarms returned by the operation.</p>
/// - [`metric_alarms(Option<Vec<MetricAlarm>>)`](crate::output::DescribeAlarmsOutput::metric_alarms): <p>The information about any metric alarms returned by the operation.</p>
/// - [`next_token(Option<String>)`](crate::output::DescribeAlarmsOutput::next_token): <p>The token that marks the start of the next batch of returned results.</p>
/// - On failure, responds with [`SdkError<DescribeAlarmsError>`](crate::error::DescribeAlarmsError)
pub fn describe_alarms(&self) -> fluent_builders::DescribeAlarms<C, M, R> {
fluent_builders::DescribeAlarms::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`DescribeAlarmsForMetric`](crate::client::fluent_builders::DescribeAlarmsForMetric) operation.
///
/// - The fluent builder is configurable:
/// - [`metric_name(impl Into<String>)`](crate::client::fluent_builders::DescribeAlarmsForMetric::metric_name) / [`set_metric_name(Option<String>)`](crate::client::fluent_builders::DescribeAlarmsForMetric::set_metric_name): <p>The name of the metric.</p>
/// - [`namespace(impl Into<String>)`](crate::client::fluent_builders::DescribeAlarmsForMetric::namespace) / [`set_namespace(Option<String>)`](crate::client::fluent_builders::DescribeAlarmsForMetric::set_namespace): <p>The namespace of the metric.</p>
/// - [`statistic(Statistic)`](crate::client::fluent_builders::DescribeAlarmsForMetric::statistic) / [`set_statistic(Option<Statistic>)`](crate::client::fluent_builders::DescribeAlarmsForMetric::set_statistic): <p>The statistic for the metric, other than percentiles. For percentile statistics, use <code>ExtendedStatistics</code>.</p>
/// - [`extended_statistic(impl Into<String>)`](crate::client::fluent_builders::DescribeAlarmsForMetric::extended_statistic) / [`set_extended_statistic(Option<String>)`](crate::client::fluent_builders::DescribeAlarmsForMetric::set_extended_statistic): <p>The percentile statistic for the metric. Specify a value between p0.0 and p100.</p>
/// - [`dimensions(Vec<Dimension>)`](crate::client::fluent_builders::DescribeAlarmsForMetric::dimensions) / [`set_dimensions(Option<Vec<Dimension>>)`](crate::client::fluent_builders::DescribeAlarmsForMetric::set_dimensions): <p>The dimensions associated with the metric. If the metric has any associated dimensions, you must specify them in order for the call to succeed.</p>
/// - [`period(i32)`](crate::client::fluent_builders::DescribeAlarmsForMetric::period) / [`set_period(Option<i32>)`](crate::client::fluent_builders::DescribeAlarmsForMetric::set_period): <p>The period, in seconds, over which the statistic is applied.</p>
/// - [`unit(StandardUnit)`](crate::client::fluent_builders::DescribeAlarmsForMetric::unit) / [`set_unit(Option<StandardUnit>)`](crate::client::fluent_builders::DescribeAlarmsForMetric::set_unit): <p>The unit for the metric.</p>
/// - On success, responds with [`DescribeAlarmsForMetricOutput`](crate::output::DescribeAlarmsForMetricOutput) with field(s):
/// - [`metric_alarms(Option<Vec<MetricAlarm>>)`](crate::output::DescribeAlarmsForMetricOutput::metric_alarms): <p>The information for each alarm with the specified metric.</p>
/// - On failure, responds with [`SdkError<DescribeAlarmsForMetricError>`](crate::error::DescribeAlarmsForMetricError)
pub fn describe_alarms_for_metric(&self) -> fluent_builders::DescribeAlarmsForMetric<C, M, R> {
fluent_builders::DescribeAlarmsForMetric::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`DescribeAnomalyDetectors`](crate::client::fluent_builders::DescribeAnomalyDetectors) operation.
///
/// - The fluent builder is configurable:
/// - [`next_token(impl Into<String>)`](crate::client::fluent_builders::DescribeAnomalyDetectors::next_token) / [`set_next_token(Option<String>)`](crate::client::fluent_builders::DescribeAnomalyDetectors::set_next_token): <p>Use the token returned by the previous operation to request the next page of results.</p>
/// - [`max_results(i32)`](crate::client::fluent_builders::DescribeAnomalyDetectors::max_results) / [`set_max_results(Option<i32>)`](crate::client::fluent_builders::DescribeAnomalyDetectors::set_max_results): <p>The maximum number of results to return in one operation. The maximum value that you can specify is 100.</p> <p>To retrieve the remaining results, make another call with the returned <code>NextToken</code> value. </p>
/// - [`namespace(impl Into<String>)`](crate::client::fluent_builders::DescribeAnomalyDetectors::namespace) / [`set_namespace(Option<String>)`](crate::client::fluent_builders::DescribeAnomalyDetectors::set_namespace): <p>Limits the results to only the anomaly detection models that are associated with the specified namespace.</p>
/// - [`metric_name(impl Into<String>)`](crate::client::fluent_builders::DescribeAnomalyDetectors::metric_name) / [`set_metric_name(Option<String>)`](crate::client::fluent_builders::DescribeAnomalyDetectors::set_metric_name): <p>Limits the results to only the anomaly detection models that are associated with the specified metric name. If there are multiple metrics with this name in different namespaces that have anomaly detection models, they're all returned.</p>
/// - [`dimensions(Vec<Dimension>)`](crate::client::fluent_builders::DescribeAnomalyDetectors::dimensions) / [`set_dimensions(Option<Vec<Dimension>>)`](crate::client::fluent_builders::DescribeAnomalyDetectors::set_dimensions): <p>Limits the results to only the anomaly detection models that are associated with the specified metric dimensions. If there are multiple metrics that have these dimensions and have anomaly detection models associated, they're all returned.</p>
/// - [`anomaly_detector_types(Vec<AnomalyDetectorType>)`](crate::client::fluent_builders::DescribeAnomalyDetectors::anomaly_detector_types) / [`set_anomaly_detector_types(Option<Vec<AnomalyDetectorType>>)`](crate::client::fluent_builders::DescribeAnomalyDetectors::set_anomaly_detector_types): <p>The anomaly detector types to request when using <code>DescribeAnomalyDetectorsInput</code>. If empty, defaults to <code>SINGLE_METRIC</code>.</p>
/// - On success, responds with [`DescribeAnomalyDetectorsOutput`](crate::output::DescribeAnomalyDetectorsOutput) with field(s):
/// - [`anomaly_detectors(Option<Vec<AnomalyDetector>>)`](crate::output::DescribeAnomalyDetectorsOutput::anomaly_detectors): <p>The list of anomaly detection models returned by the operation.</p>
/// - [`next_token(Option<String>)`](crate::output::DescribeAnomalyDetectorsOutput::next_token): <p>A token that you can use in a subsequent operation to retrieve the next set of results.</p>
/// - On failure, responds with [`SdkError<DescribeAnomalyDetectorsError>`](crate::error::DescribeAnomalyDetectorsError)
pub fn describe_anomaly_detectors(&self) -> fluent_builders::DescribeAnomalyDetectors<C, M, R> {
fluent_builders::DescribeAnomalyDetectors::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`DescribeInsightRules`](crate::client::fluent_builders::DescribeInsightRules) operation.
/// This operation supports pagination; See [`into_paginator()`](crate::client::fluent_builders::DescribeInsightRules::into_paginator).
///
/// - The fluent builder is configurable:
/// - [`next_token(impl Into<String>)`](crate::client::fluent_builders::DescribeInsightRules::next_token) / [`set_next_token(Option<String>)`](crate::client::fluent_builders::DescribeInsightRules::set_next_token): <p>Include this value, if it was returned by the previous operation, to get the next set of rules.</p>
/// - [`max_results(i32)`](crate::client::fluent_builders::DescribeInsightRules::max_results) / [`set_max_results(Option<i32>)`](crate::client::fluent_builders::DescribeInsightRules::set_max_results): <p>The maximum number of results to return in one operation. If you omit this parameter, the default of 500 is used.</p>
/// - On success, responds with [`DescribeInsightRulesOutput`](crate::output::DescribeInsightRulesOutput) with field(s):
/// - [`next_token(Option<String>)`](crate::output::DescribeInsightRulesOutput::next_token): <p>If this parameter is present, it is a token that marks the start of the next batch of returned results. </p>
/// - [`insight_rules(Option<Vec<InsightRule>>)`](crate::output::DescribeInsightRulesOutput::insight_rules): <p>The rules returned by the operation.</p>
/// - On failure, responds with [`SdkError<DescribeInsightRulesError>`](crate::error::DescribeInsightRulesError)
pub fn describe_insight_rules(&self) -> fluent_builders::DescribeInsightRules<C, M, R> {
fluent_builders::DescribeInsightRules::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`DisableAlarmActions`](crate::client::fluent_builders::DisableAlarmActions) operation.
///
/// - The fluent builder is configurable:
/// - [`alarm_names(Vec<String>)`](crate::client::fluent_builders::DisableAlarmActions::alarm_names) / [`set_alarm_names(Option<Vec<String>>)`](crate::client::fluent_builders::DisableAlarmActions::set_alarm_names): <p>The names of the alarms.</p>
/// - On success, responds with [`DisableAlarmActionsOutput`](crate::output::DisableAlarmActionsOutput)
/// - On failure, responds with [`SdkError<DisableAlarmActionsError>`](crate::error::DisableAlarmActionsError)
pub fn disable_alarm_actions(&self) -> fluent_builders::DisableAlarmActions<C, M, R> {
fluent_builders::DisableAlarmActions::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`DisableInsightRules`](crate::client::fluent_builders::DisableInsightRules) operation.
///
/// - The fluent builder is configurable:
/// - [`rule_names(Vec<String>)`](crate::client::fluent_builders::DisableInsightRules::rule_names) / [`set_rule_names(Option<Vec<String>>)`](crate::client::fluent_builders::DisableInsightRules::set_rule_names): <p>An array of the rule names to disable. If you need to find out the names of your rules, use <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeInsightRules.html">DescribeInsightRules</a>.</p>
/// - On success, responds with [`DisableInsightRulesOutput`](crate::output::DisableInsightRulesOutput) with field(s):
/// - [`failures(Option<Vec<PartialFailure>>)`](crate::output::DisableInsightRulesOutput::failures): <p>An array listing the rules that could not be disabled. You cannot disable built-in rules.</p>
/// - On failure, responds with [`SdkError<DisableInsightRulesError>`](crate::error::DisableInsightRulesError)
pub fn disable_insight_rules(&self) -> fluent_builders::DisableInsightRules<C, M, R> {
fluent_builders::DisableInsightRules::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`EnableAlarmActions`](crate::client::fluent_builders::EnableAlarmActions) operation.
///
/// - The fluent builder is configurable:
/// - [`alarm_names(Vec<String>)`](crate::client::fluent_builders::EnableAlarmActions::alarm_names) / [`set_alarm_names(Option<Vec<String>>)`](crate::client::fluent_builders::EnableAlarmActions::set_alarm_names): <p>The names of the alarms.</p>
/// - On success, responds with [`EnableAlarmActionsOutput`](crate::output::EnableAlarmActionsOutput)
/// - On failure, responds with [`SdkError<EnableAlarmActionsError>`](crate::error::EnableAlarmActionsError)
pub fn enable_alarm_actions(&self) -> fluent_builders::EnableAlarmActions<C, M, R> {
fluent_builders::EnableAlarmActions::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`EnableInsightRules`](crate::client::fluent_builders::EnableInsightRules) operation.
///
/// - The fluent builder is configurable:
/// - [`rule_names(Vec<String>)`](crate::client::fluent_builders::EnableInsightRules::rule_names) / [`set_rule_names(Option<Vec<String>>)`](crate::client::fluent_builders::EnableInsightRules::set_rule_names): <p>An array of the rule names to enable. If you need to find out the names of your rules, use <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeInsightRules.html">DescribeInsightRules</a>.</p>
/// - On success, responds with [`EnableInsightRulesOutput`](crate::output::EnableInsightRulesOutput) with field(s):
/// - [`failures(Option<Vec<PartialFailure>>)`](crate::output::EnableInsightRulesOutput::failures): <p>An array listing the rules that could not be enabled. You cannot disable or enable built-in rules.</p>
/// - On failure, responds with [`SdkError<EnableInsightRulesError>`](crate::error::EnableInsightRulesError)
pub fn enable_insight_rules(&self) -> fluent_builders::EnableInsightRules<C, M, R> {
fluent_builders::EnableInsightRules::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`GetDashboard`](crate::client::fluent_builders::GetDashboard) operation.
///
/// - The fluent builder is configurable:
/// - [`dashboard_name(impl Into<String>)`](crate::client::fluent_builders::GetDashboard::dashboard_name) / [`set_dashboard_name(Option<String>)`](crate::client::fluent_builders::GetDashboard::set_dashboard_name): <p>The name of the dashboard to be described.</p>
/// - On success, responds with [`GetDashboardOutput`](crate::output::GetDashboardOutput) with field(s):
/// - [`dashboard_arn(Option<String>)`](crate::output::GetDashboardOutput::dashboard_arn): <p>The Amazon Resource Name (ARN) of the dashboard.</p>
/// - [`dashboard_body(Option<String>)`](crate::output::GetDashboardOutput::dashboard_body): <p>The detailed information about the dashboard, including what widgets are included and their location on the dashboard. For more information about the <code>DashboardBody</code> syntax, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/CloudWatch-Dashboard-Body-Structure.html">Dashboard Body Structure and Syntax</a>. </p>
/// - [`dashboard_name(Option<String>)`](crate::output::GetDashboardOutput::dashboard_name): <p>The name of the dashboard.</p>
/// - On failure, responds with [`SdkError<GetDashboardError>`](crate::error::GetDashboardError)
pub fn get_dashboard(&self) -> fluent_builders::GetDashboard<C, M, R> {
fluent_builders::GetDashboard::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`GetInsightRuleReport`](crate::client::fluent_builders::GetInsightRuleReport) operation.
///
/// - The fluent builder is configurable:
/// - [`rule_name(impl Into<String>)`](crate::client::fluent_builders::GetInsightRuleReport::rule_name) / [`set_rule_name(Option<String>)`](crate::client::fluent_builders::GetInsightRuleReport::set_rule_name): <p>The name of the rule that you want to see data from.</p>
/// - [`start_time(DateTime)`](crate::client::fluent_builders::GetInsightRuleReport::start_time) / [`set_start_time(Option<DateTime>)`](crate::client::fluent_builders::GetInsightRuleReport::set_start_time): <p>The start time of the data to use in the report. When used in a raw HTTP Query API, it is formatted as <code>yyyy-MM-dd'T'HH:mm:ss</code>. For example, <code>2019-07-01T23:59:59</code>.</p>
/// - [`end_time(DateTime)`](crate::client::fluent_builders::GetInsightRuleReport::end_time) / [`set_end_time(Option<DateTime>)`](crate::client::fluent_builders::GetInsightRuleReport::set_end_time): <p>The end time of the data to use in the report. When used in a raw HTTP Query API, it is formatted as <code>yyyy-MM-dd'T'HH:mm:ss</code>. For example, <code>2019-07-01T23:59:59</code>.</p>
/// - [`period(i32)`](crate::client::fluent_builders::GetInsightRuleReport::period) / [`set_period(Option<i32>)`](crate::client::fluent_builders::GetInsightRuleReport::set_period): <p>The period, in seconds, to use for the statistics in the <code>InsightRuleMetricDatapoint</code> results.</p>
/// - [`max_contributor_count(i32)`](crate::client::fluent_builders::GetInsightRuleReport::max_contributor_count) / [`set_max_contributor_count(Option<i32>)`](crate::client::fluent_builders::GetInsightRuleReport::set_max_contributor_count): <p>The maximum number of contributors to include in the report. The range is 1 to 100. If you omit this, the default of 10 is used.</p>
/// - [`metrics(Vec<String>)`](crate::client::fluent_builders::GetInsightRuleReport::metrics) / [`set_metrics(Option<Vec<String>>)`](crate::client::fluent_builders::GetInsightRuleReport::set_metrics): <p>Specifies which metrics to use for aggregation of contributor values for the report. You can specify one or more of the following metrics:</p> <ul> <li> <p> <code>UniqueContributors</code> -- the number of unique contributors for each data point.</p> </li> <li> <p> <code>MaxContributorValue</code> -- the value of the top contributor for each data point. The identity of the contributor might change for each data point in the graph.</p> <p>If this rule aggregates by COUNT, the top contributor for each data point is the contributor with the most occurrences in that period. If the rule aggregates by SUM, the top contributor is the contributor with the highest sum in the log field specified by the rule's <code>Value</code>, during that period.</p> </li> <li> <p> <code>SampleCount</code> -- the number of data points matched by the rule.</p> </li> <li> <p> <code>Sum</code> -- the sum of the values from all contributors during the time period represented by that data point.</p> </li> <li> <p> <code>Minimum</code> -- the minimum value from a single observation during the time period represented by that data point.</p> </li> <li> <p> <code>Maximum</code> -- the maximum value from a single observation during the time period represented by that data point.</p> </li> <li> <p> <code>Average</code> -- the average value from all contributors during the time period represented by that data point.</p> </li> </ul>
/// - [`order_by(impl Into<String>)`](crate::client::fluent_builders::GetInsightRuleReport::order_by) / [`set_order_by(Option<String>)`](crate::client::fluent_builders::GetInsightRuleReport::set_order_by): <p>Determines what statistic to use to rank the contributors. Valid values are SUM and MAXIMUM.</p>
/// - On success, responds with [`GetInsightRuleReportOutput`](crate::output::GetInsightRuleReportOutput) with field(s):
/// - [`key_labels(Option<Vec<String>>)`](crate::output::GetInsightRuleReportOutput::key_labels): <p>An array of the strings used as the keys for this rule. The keys are the dimensions used to classify contributors. If the rule contains more than one key, then each unique combination of values for the keys is counted as a unique contributor.</p>
/// - [`aggregation_statistic(Option<String>)`](crate::output::GetInsightRuleReportOutput::aggregation_statistic): <p>Specifies whether this rule aggregates contributor data by COUNT or SUM.</p>
/// - [`aggregate_value(Option<f64>)`](crate::output::GetInsightRuleReportOutput::aggregate_value): <p>The sum of the values from all individual contributors that match the rule.</p>
/// - [`approximate_unique_count(Option<i64>)`](crate::output::GetInsightRuleReportOutput::approximate_unique_count): <p>An approximate count of the unique contributors found by this rule in this time period.</p>
/// - [`contributors(Option<Vec<InsightRuleContributor>>)`](crate::output::GetInsightRuleReportOutput::contributors): <p>An array of the unique contributors found by this rule in this time period. If the rule contains multiple keys, each combination of values for the keys counts as a unique contributor.</p>
/// - [`metric_datapoints(Option<Vec<InsightRuleMetricDatapoint>>)`](crate::output::GetInsightRuleReportOutput::metric_datapoints): <p>A time series of metric data points that matches the time period in the rule request.</p>
/// - On failure, responds with [`SdkError<GetInsightRuleReportError>`](crate::error::GetInsightRuleReportError)
pub fn get_insight_rule_report(&self) -> fluent_builders::GetInsightRuleReport<C, M, R> {
fluent_builders::GetInsightRuleReport::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`GetMetricData`](crate::client::fluent_builders::GetMetricData) operation.
/// This operation supports pagination; See [`into_paginator()`](crate::client::fluent_builders::GetMetricData::into_paginator).
///
/// - The fluent builder is configurable:
/// - [`metric_data_queries(Vec<MetricDataQuery>)`](crate::client::fluent_builders::GetMetricData::metric_data_queries) / [`set_metric_data_queries(Option<Vec<MetricDataQuery>>)`](crate::client::fluent_builders::GetMetricData::set_metric_data_queries): <p>The metric queries to be returned. A single <code>GetMetricData</code> call can include as many as 500 <code>MetricDataQuery</code> structures. Each of these structures can specify either a metric to retrieve, or a math expression to perform on retrieved data. </p>
/// - [`start_time(DateTime)`](crate::client::fluent_builders::GetMetricData::start_time) / [`set_start_time(Option<DateTime>)`](crate::client::fluent_builders::GetMetricData::set_start_time): <p>The time stamp indicating the earliest data to be returned.</p> <p>The value specified is inclusive; results include data points with the specified time stamp. </p> <p>CloudWatch rounds the specified time stamp as follows:</p> <ul> <li> <p>Start time less than 15 days ago - Round down to the nearest whole minute. For example, 12:32:34 is rounded down to 12:32:00.</p> </li> <li> <p>Start time between 15 and 63 days ago - Round down to the nearest 5-minute clock interval. For example, 12:32:34 is rounded down to 12:30:00.</p> </li> <li> <p>Start time greater than 63 days ago - Round down to the nearest 1-hour clock interval. For example, 12:32:34 is rounded down to 12:00:00.</p> </li> </ul> <p>If you set <code>Period</code> to 5, 10, or 30, the start time of your request is rounded down to the nearest time that corresponds to even 5-, 10-, or 30-second divisions of a minute. For example, if you make a query at (HH:mm:ss) 01:05:23 for the previous 10-second period, the start time of your request is rounded down and you receive data from 01:05:10 to 01:05:20. If you make a query at 15:07:17 for the previous 5 minutes of data, using a period of 5 seconds, you receive data timestamped between 15:02:15 and 15:07:15. </p> <p>For better performance, specify <code>StartTime</code> and <code>EndTime</code> values that align with the value of the metric's <code>Period</code> and sync up with the beginning and end of an hour. For example, if the <code>Period</code> of a metric is 5 minutes, specifying 12:05 or 12:30 as <code>StartTime</code> can get a faster response from CloudWatch than setting 12:07 or 12:29 as the <code>StartTime</code>.</p>
/// - [`end_time(DateTime)`](crate::client::fluent_builders::GetMetricData::end_time) / [`set_end_time(Option<DateTime>)`](crate::client::fluent_builders::GetMetricData::set_end_time): <p>The time stamp indicating the latest data to be returned.</p> <p>The value specified is exclusive; results include data points up to the specified time stamp.</p> <p>For better performance, specify <code>StartTime</code> and <code>EndTime</code> values that align with the value of the metric's <code>Period</code> and sync up with the beginning and end of an hour. For example, if the <code>Period</code> of a metric is 5 minutes, specifying 12:05 or 12:30 as <code>EndTime</code> can get a faster response from CloudWatch than setting 12:07 or 12:29 as the <code>EndTime</code>.</p>
/// - [`next_token(impl Into<String>)`](crate::client::fluent_builders::GetMetricData::next_token) / [`set_next_token(Option<String>)`](crate::client::fluent_builders::GetMetricData::set_next_token): <p>Include this value, if it was returned by the previous <code>GetMetricData</code> operation, to get the next set of data points.</p>
/// - [`scan_by(ScanBy)`](crate::client::fluent_builders::GetMetricData::scan_by) / [`set_scan_by(Option<ScanBy>)`](crate::client::fluent_builders::GetMetricData::set_scan_by): <p>The order in which data points should be returned. <code>TimestampDescending</code> returns the newest data first and paginates when the <code>MaxDatapoints</code> limit is reached. <code>TimestampAscending</code> returns the oldest data first and paginates when the <code>MaxDatapoints</code> limit is reached.</p>
/// - [`max_datapoints(i32)`](crate::client::fluent_builders::GetMetricData::max_datapoints) / [`set_max_datapoints(Option<i32>)`](crate::client::fluent_builders::GetMetricData::set_max_datapoints): <p>The maximum number of data points the request should return before paginating. If you omit this, the default of 100,800 is used.</p>
/// - [`label_options(LabelOptions)`](crate::client::fluent_builders::GetMetricData::label_options) / [`set_label_options(Option<LabelOptions>)`](crate::client::fluent_builders::GetMetricData::set_label_options): <p>This structure includes the <code>Timezone</code> parameter, which you can use to specify your time zone so that the labels of returned data display the correct time for your time zone. </p>
/// - On success, responds with [`GetMetricDataOutput`](crate::output::GetMetricDataOutput) with field(s):
/// - [`metric_data_results(Option<Vec<MetricDataResult>>)`](crate::output::GetMetricDataOutput::metric_data_results): <p>The metrics that are returned, including the metric name, namespace, and dimensions.</p>
/// - [`next_token(Option<String>)`](crate::output::GetMetricDataOutput::next_token): <p>A token that marks the next batch of returned results.</p>
/// - [`messages(Option<Vec<MessageData>>)`](crate::output::GetMetricDataOutput::messages): <p>Contains a message about this <code>GetMetricData</code> operation, if the operation results in such a message. An example of a message that might be returned is <code>Maximum number of allowed metrics exceeded</code>. If there is a message, as much of the operation as possible is still executed.</p> <p>A message appears here only if it is related to the global <code>GetMetricData</code> operation. Any message about a specific metric returned by the operation appears in the <code>MetricDataResult</code> object returned for that metric.</p>
/// - On failure, responds with [`SdkError<GetMetricDataError>`](crate::error::GetMetricDataError)
pub fn get_metric_data(&self) -> fluent_builders::GetMetricData<C, M, R> {
fluent_builders::GetMetricData::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`GetMetricStatistics`](crate::client::fluent_builders::GetMetricStatistics) operation.
///
/// - The fluent builder is configurable:
/// - [`namespace(impl Into<String>)`](crate::client::fluent_builders::GetMetricStatistics::namespace) / [`set_namespace(Option<String>)`](crate::client::fluent_builders::GetMetricStatistics::set_namespace): <p>The namespace of the metric, with or without spaces.</p>
/// - [`metric_name(impl Into<String>)`](crate::client::fluent_builders::GetMetricStatistics::metric_name) / [`set_metric_name(Option<String>)`](crate::client::fluent_builders::GetMetricStatistics::set_metric_name): <p>The name of the metric, with or without spaces.</p>
/// - [`dimensions(Vec<Dimension>)`](crate::client::fluent_builders::GetMetricStatistics::dimensions) / [`set_dimensions(Option<Vec<Dimension>>)`](crate::client::fluent_builders::GetMetricStatistics::set_dimensions): <p>The dimensions. If the metric contains multiple dimensions, you must include a value for each dimension. CloudWatch treats each unique combination of dimensions as a separate metric. If a specific combination of dimensions was not published, you can't retrieve statistics for it. You must specify the same dimensions that were used when the metrics were created. For an example, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#dimension-combinations">Dimension Combinations</a> in the <i>Amazon CloudWatch User Guide</i>. For more information about specifying dimensions, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/publishingMetrics.html">Publishing Metrics</a> in the <i>Amazon CloudWatch User Guide</i>.</p>
/// - [`start_time(DateTime)`](crate::client::fluent_builders::GetMetricStatistics::start_time) / [`set_start_time(Option<DateTime>)`](crate::client::fluent_builders::GetMetricStatistics::set_start_time): <p>The time stamp that determines the first data point to return. Start times are evaluated relative to the time that CloudWatch receives the request.</p> <p>The value specified is inclusive; results include data points with the specified time stamp. In a raw HTTP query, the time stamp must be in ISO 8601 UTC format (for example, 2016-10-03T23:00:00Z).</p> <p>CloudWatch rounds the specified time stamp as follows:</p> <ul> <li> <p>Start time less than 15 days ago - Round down to the nearest whole minute. For example, 12:32:34 is rounded down to 12:32:00.</p> </li> <li> <p>Start time between 15 and 63 days ago - Round down to the nearest 5-minute clock interval. For example, 12:32:34 is rounded down to 12:30:00.</p> </li> <li> <p>Start time greater than 63 days ago - Round down to the nearest 1-hour clock interval. For example, 12:32:34 is rounded down to 12:00:00.</p> </li> </ul> <p>If you set <code>Period</code> to 5, 10, or 30, the start time of your request is rounded down to the nearest time that corresponds to even 5-, 10-, or 30-second divisions of a minute. For example, if you make a query at (HH:mm:ss) 01:05:23 for the previous 10-second period, the start time of your request is rounded down and you receive data from 01:05:10 to 01:05:20. If you make a query at 15:07:17 for the previous 5 minutes of data, using a period of 5 seconds, you receive data timestamped between 15:02:15 and 15:07:15. </p>
/// - [`end_time(DateTime)`](crate::client::fluent_builders::GetMetricStatistics::end_time) / [`set_end_time(Option<DateTime>)`](crate::client::fluent_builders::GetMetricStatistics::set_end_time): <p>The time stamp that determines the last data point to return.</p> <p>The value specified is exclusive; results include data points up to the specified time stamp. In a raw HTTP query, the time stamp must be in ISO 8601 UTC format (for example, 2016-10-10T23:00:00Z).</p>
/// - [`period(i32)`](crate::client::fluent_builders::GetMetricStatistics::period) / [`set_period(Option<i32>)`](crate::client::fluent_builders::GetMetricStatistics::set_period): <p>The granularity, in seconds, of the returned data points. For metrics with regular resolution, a period can be as short as one minute (60 seconds) and must be a multiple of 60. For high-resolution metrics that are collected at intervals of less than one minute, the period can be 1, 5, 10, 30, 60, or any multiple of 60. High-resolution metrics are those metrics stored by a <code>PutMetricData</code> call that includes a <code>StorageResolution</code> of 1 second.</p> <p>If the <code>StartTime</code> parameter specifies a time stamp that is greater than 3 hours ago, you must specify the period as follows or no data points in that time range is returned:</p> <ul> <li> <p>Start time between 3 hours and 15 days ago - Use a multiple of 60 seconds (1 minute).</p> </li> <li> <p>Start time between 15 and 63 days ago - Use a multiple of 300 seconds (5 minutes).</p> </li> <li> <p>Start time greater than 63 days ago - Use a multiple of 3600 seconds (1 hour).</p> </li> </ul>
/// - [`statistics(Vec<Statistic>)`](crate::client::fluent_builders::GetMetricStatistics::statistics) / [`set_statistics(Option<Vec<Statistic>>)`](crate::client::fluent_builders::GetMetricStatistics::set_statistics): <p>The metric statistics, other than percentile. For percentile statistics, use <code>ExtendedStatistics</code>. When calling <code>GetMetricStatistics</code>, you must specify either <code>Statistics</code> or <code>ExtendedStatistics</code>, but not both.</p>
/// - [`extended_statistics(Vec<String>)`](crate::client::fluent_builders::GetMetricStatistics::extended_statistics) / [`set_extended_statistics(Option<Vec<String>>)`](crate::client::fluent_builders::GetMetricStatistics::set_extended_statistics): <p>The percentile statistics. Specify values between p0.0 and p100. When calling <code>GetMetricStatistics</code>, you must specify either <code>Statistics</code> or <code>ExtendedStatistics</code>, but not both. Percentile statistics are not available for metrics when any of the metric values are negative numbers.</p>
/// - [`unit(StandardUnit)`](crate::client::fluent_builders::GetMetricStatistics::unit) / [`set_unit(Option<StandardUnit>)`](crate::client::fluent_builders::GetMetricStatistics::set_unit): <p>The unit for a given metric. If you omit <code>Unit</code>, all data that was collected with any unit is returned, along with the corresponding units that were specified when the data was reported to CloudWatch. If you specify a unit, the operation returns only data that was collected with that unit specified. If you specify a unit that does not match the data collected, the results of the operation are null. CloudWatch does not perform unit conversions.</p>
/// - On success, responds with [`GetMetricStatisticsOutput`](crate::output::GetMetricStatisticsOutput) with field(s):
/// - [`label(Option<String>)`](crate::output::GetMetricStatisticsOutput::label): <p>A label for the specified metric.</p>
/// - [`datapoints(Option<Vec<Datapoint>>)`](crate::output::GetMetricStatisticsOutput::datapoints): <p>The data points for the specified metric.</p>
/// - On failure, responds with [`SdkError<GetMetricStatisticsError>`](crate::error::GetMetricStatisticsError)
pub fn get_metric_statistics(&self) -> fluent_builders::GetMetricStatistics<C, M, R> {
fluent_builders::GetMetricStatistics::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`GetMetricStream`](crate::client::fluent_builders::GetMetricStream) operation.
///
/// - The fluent builder is configurable:
/// - [`name(impl Into<String>)`](crate::client::fluent_builders::GetMetricStream::name) / [`set_name(Option<String>)`](crate::client::fluent_builders::GetMetricStream::set_name): <p>The name of the metric stream to retrieve information about.</p>
/// - On success, responds with [`GetMetricStreamOutput`](crate::output::GetMetricStreamOutput) with field(s):
/// - [`arn(Option<String>)`](crate::output::GetMetricStreamOutput::arn): <p>The ARN of the metric stream.</p>
/// - [`name(Option<String>)`](crate::output::GetMetricStreamOutput::name): <p>The name of the metric stream.</p>
/// - [`include_filters(Option<Vec<MetricStreamFilter>>)`](crate::output::GetMetricStreamOutput::include_filters): <p>If this array of metric namespaces is present, then these namespaces are the only metric namespaces that are streamed by this metric stream.</p>
/// - [`exclude_filters(Option<Vec<MetricStreamFilter>>)`](crate::output::GetMetricStreamOutput::exclude_filters): <p>If this array of metric namespaces is present, then these namespaces are the only metric namespaces that are not streamed by this metric stream. In this case, all other metric namespaces in the account are streamed by this metric stream.</p>
/// - [`firehose_arn(Option<String>)`](crate::output::GetMetricStreamOutput::firehose_arn): <p>The ARN of the Amazon Kinesis Firehose delivery stream that is used by this metric stream.</p>
/// - [`role_arn(Option<String>)`](crate::output::GetMetricStreamOutput::role_arn): <p>The ARN of the IAM role that is used by this metric stream.</p>
/// - [`state(Option<String>)`](crate::output::GetMetricStreamOutput::state): <p>The state of the metric stream. The possible values are <code>running</code> and <code>stopped</code>.</p>
/// - [`creation_date(Option<DateTime>)`](crate::output::GetMetricStreamOutput::creation_date): <p>The date that the metric stream was created.</p>
/// - [`last_update_date(Option<DateTime>)`](crate::output::GetMetricStreamOutput::last_update_date): <p>The date of the most recent update to the metric stream's configuration.</p>
/// - [`output_format(Option<MetricStreamOutputFormat>)`](crate::output::GetMetricStreamOutput::output_format): <p></p>
/// - On failure, responds with [`SdkError<GetMetricStreamError>`](crate::error::GetMetricStreamError)
pub fn get_metric_stream(&self) -> fluent_builders::GetMetricStream<C, M, R> {
fluent_builders::GetMetricStream::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`GetMetricWidgetImage`](crate::client::fluent_builders::GetMetricWidgetImage) operation.
///
/// - The fluent builder is configurable:
/// - [`metric_widget(impl Into<String>)`](crate::client::fluent_builders::GetMetricWidgetImage::metric_widget) / [`set_metric_widget(Option<String>)`](crate::client::fluent_builders::GetMetricWidgetImage::set_metric_widget): <p>A JSON string that defines the bitmap graph to be retrieved. The string includes the metrics to include in the graph, statistics, annotations, title, axis limits, and so on. You can include only one <code>MetricWidget</code> parameter in each <code>GetMetricWidgetImage</code> call.</p> <p>For more information about the syntax of <code>MetricWidget</code> see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/CloudWatch-Metric-Widget-Structure.html">GetMetricWidgetImage: Metric Widget Structure and Syntax</a>.</p> <p>If any metric on the graph could not load all the requested data points, an orange triangle with an exclamation point appears next to the graph legend.</p>
/// - [`output_format(impl Into<String>)`](crate::client::fluent_builders::GetMetricWidgetImage::output_format) / [`set_output_format(Option<String>)`](crate::client::fluent_builders::GetMetricWidgetImage::set_output_format): <p>The format of the resulting image. Only PNG images are supported.</p> <p>The default is <code>png</code>. If you specify <code>png</code>, the API returns an HTTP response with the content-type set to <code>text/xml</code>. The image data is in a <code>MetricWidgetImage</code> field. For example:</p> <p> <code> <getmetricwidgetimageresponse xmlns="<URLstring"> > </getmetricwidgetimageresponse></code> </p> <p> <code> <getmetricwidgetimageresult></getmetricwidgetimageresult></code> </p> <p> <code> <metricwidgetimage></metricwidgetimage></code> </p> <p> <code> iVBORw0KGgoAAAANSUhEUgAAAlgAAAGQEAYAAAAip...</code> </p> <p> <code> </code> </p> <p> <code> </code> </p> <p> <code> <responsemetadata></responsemetadata></code> </p> <p> <code> <requestid> 6f0d4192-4d42-11e8-82c1-f539a07e0e3b </requestid></code> </p> <p> <code> </code> </p> <p> <code></code> </p> <p>The <code>image/png</code> setting is intended only for custom HTTP requests. For most use cases, and all actions using an Amazon Web Services SDK, you should use <code>png</code>. If you specify <code>image/png</code>, the HTTP response has a content-type set to <code>image/png</code>, and the body of the response is a PNG image. </p>
/// - On success, responds with [`GetMetricWidgetImageOutput`](crate::output::GetMetricWidgetImageOutput) with field(s):
/// - [`metric_widget_image(Option<Blob>)`](crate::output::GetMetricWidgetImageOutput::metric_widget_image): <p>The image of the graph, in the output format specified. The output is base64-encoded.</p>
/// - On failure, responds with [`SdkError<GetMetricWidgetImageError>`](crate::error::GetMetricWidgetImageError)
pub fn get_metric_widget_image(&self) -> fluent_builders::GetMetricWidgetImage<C, M, R> {
fluent_builders::GetMetricWidgetImage::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`ListDashboards`](crate::client::fluent_builders::ListDashboards) operation.
/// This operation supports pagination; See [`into_paginator()`](crate::client::fluent_builders::ListDashboards::into_paginator).
///
/// - The fluent builder is configurable:
/// - [`dashboard_name_prefix(impl Into<String>)`](crate::client::fluent_builders::ListDashboards::dashboard_name_prefix) / [`set_dashboard_name_prefix(Option<String>)`](crate::client::fluent_builders::ListDashboards::set_dashboard_name_prefix): <p>If you specify this parameter, only the dashboards with names starting with the specified string are listed. The maximum length is 255, and valid characters are A-Z, a-z, 0-9, ".", "-", and "_". </p>
/// - [`next_token(impl Into<String>)`](crate::client::fluent_builders::ListDashboards::next_token) / [`set_next_token(Option<String>)`](crate::client::fluent_builders::ListDashboards::set_next_token): <p>The token returned by a previous call to indicate that there is more data available.</p>
/// - On success, responds with [`ListDashboardsOutput`](crate::output::ListDashboardsOutput) with field(s):
/// - [`dashboard_entries(Option<Vec<DashboardEntry>>)`](crate::output::ListDashboardsOutput::dashboard_entries): <p>The list of matching dashboards.</p>
/// - [`next_token(Option<String>)`](crate::output::ListDashboardsOutput::next_token): <p>The token that marks the start of the next batch of returned results.</p>
/// - On failure, responds with [`SdkError<ListDashboardsError>`](crate::error::ListDashboardsError)
pub fn list_dashboards(&self) -> fluent_builders::ListDashboards<C, M, R> {
fluent_builders::ListDashboards::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`ListMetrics`](crate::client::fluent_builders::ListMetrics) operation.
/// This operation supports pagination; See [`into_paginator()`](crate::client::fluent_builders::ListMetrics::into_paginator).
///
/// - The fluent builder is configurable:
/// - [`namespace(impl Into<String>)`](crate::client::fluent_builders::ListMetrics::namespace) / [`set_namespace(Option<String>)`](crate::client::fluent_builders::ListMetrics::set_namespace): <p>The metric namespace to filter against. Only the namespace that matches exactly will be returned.</p>
/// - [`metric_name(impl Into<String>)`](crate::client::fluent_builders::ListMetrics::metric_name) / [`set_metric_name(Option<String>)`](crate::client::fluent_builders::ListMetrics::set_metric_name): <p>The name of the metric to filter against. Only the metrics with names that match exactly will be returned.</p>
/// - [`dimensions(Vec<DimensionFilter>)`](crate::client::fluent_builders::ListMetrics::dimensions) / [`set_dimensions(Option<Vec<DimensionFilter>>)`](crate::client::fluent_builders::ListMetrics::set_dimensions): <p>The dimensions to filter against. Only the dimensions that match exactly will be returned.</p>
/// - [`next_token(impl Into<String>)`](crate::client::fluent_builders::ListMetrics::next_token) / [`set_next_token(Option<String>)`](crate::client::fluent_builders::ListMetrics::set_next_token): <p>The token returned by a previous call to indicate that there is more data available.</p>
/// - [`recently_active(RecentlyActive)`](crate::client::fluent_builders::ListMetrics::recently_active) / [`set_recently_active(Option<RecentlyActive>)`](crate::client::fluent_builders::ListMetrics::set_recently_active): <p>To filter the results to show only metrics that have had data points published in the past three hours, specify this parameter with a value of <code>PT3H</code>. This is the only valid value for this parameter.</p> <p>The results that are returned are an approximation of the value you specify. There is a low probability that the returned results include metrics with last published data as much as 40 minutes more than the specified time interval.</p>
/// - On success, responds with [`ListMetricsOutput`](crate::output::ListMetricsOutput) with field(s):
/// - [`metrics(Option<Vec<Metric>>)`](crate::output::ListMetricsOutput::metrics): <p>The metrics that match your request. </p>
/// - [`next_token(Option<String>)`](crate::output::ListMetricsOutput::next_token): <p>The token that marks the start of the next batch of returned results. </p>
/// - On failure, responds with [`SdkError<ListMetricsError>`](crate::error::ListMetricsError)
pub fn list_metrics(&self) -> fluent_builders::ListMetrics<C, M, R> {
fluent_builders::ListMetrics::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`ListMetricStreams`](crate::client::fluent_builders::ListMetricStreams) operation.
/// This operation supports pagination; See [`into_paginator()`](crate::client::fluent_builders::ListMetricStreams::into_paginator).
///
/// - The fluent builder is configurable:
/// - [`next_token(impl Into<String>)`](crate::client::fluent_builders::ListMetricStreams::next_token) / [`set_next_token(Option<String>)`](crate::client::fluent_builders::ListMetricStreams::set_next_token): <p>Include this value, if it was returned by the previous call, to get the next set of metric streams.</p>
/// - [`max_results(i32)`](crate::client::fluent_builders::ListMetricStreams::max_results) / [`set_max_results(Option<i32>)`](crate::client::fluent_builders::ListMetricStreams::set_max_results): <p>The maximum number of results to return in one operation.</p>
/// - On success, responds with [`ListMetricStreamsOutput`](crate::output::ListMetricStreamsOutput) with field(s):
/// - [`next_token(Option<String>)`](crate::output::ListMetricStreamsOutput::next_token): <p>The token that marks the start of the next batch of returned results. You can use this token in a subsequent operation to get the next batch of results.</p>
/// - [`entries(Option<Vec<MetricStreamEntry>>)`](crate::output::ListMetricStreamsOutput::entries): <p>The array of metric stream information.</p>
/// - On failure, responds with [`SdkError<ListMetricStreamsError>`](crate::error::ListMetricStreamsError)
pub fn list_metric_streams(&self) -> fluent_builders::ListMetricStreams<C, M, R> {
fluent_builders::ListMetricStreams::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`ListTagsForResource`](crate::client::fluent_builders::ListTagsForResource) operation.
///
/// - The fluent builder is configurable:
/// - [`resource_arn(impl Into<String>)`](crate::client::fluent_builders::ListTagsForResource::resource_arn) / [`set_resource_arn(Option<String>)`](crate::client::fluent_builders::ListTagsForResource::set_resource_arn): <p>The ARN of the CloudWatch resource that you want to view tags for.</p> <p>The ARN format of an alarm is <code>arn:aws:cloudwatch:<i>Region</i>:<i>account-id</i>:alarm:<i>alarm-name</i> </code> </p> <p>The ARN format of a Contributor Insights rule is <code>arn:aws:cloudwatch:<i>Region</i>:<i>account-id</i>:insight-rule:<i>insight-rule-name</i> </code> </p> <p>For more information about ARN format, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/list_amazoncloudwatch.html#amazoncloudwatch-resources-for-iam-policies"> Resource Types Defined by Amazon CloudWatch</a> in the <i>Amazon Web Services General Reference</i>.</p>
/// - On success, responds with [`ListTagsForResourceOutput`](crate::output::ListTagsForResourceOutput) with field(s):
/// - [`tags(Option<Vec<Tag>>)`](crate::output::ListTagsForResourceOutput::tags): <p>The list of tag keys and values associated with the resource you specified.</p>
/// - On failure, responds with [`SdkError<ListTagsForResourceError>`](crate::error::ListTagsForResourceError)
pub fn list_tags_for_resource(&self) -> fluent_builders::ListTagsForResource<C, M, R> {
fluent_builders::ListTagsForResource::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`PutAnomalyDetector`](crate::client::fluent_builders::PutAnomalyDetector) operation.
///
/// - The fluent builder is configurable:
/// - [`namespace(impl Into<String>)`](crate::client::fluent_builders::PutAnomalyDetector::namespace) / [`set_namespace(Option<String>)`](crate::client::fluent_builders::PutAnomalyDetector::set_namespace): <p>The namespace of the metric to create the anomaly detection model for.</p>
/// - [`metric_name(impl Into<String>)`](crate::client::fluent_builders::PutAnomalyDetector::metric_name) / [`set_metric_name(Option<String>)`](crate::client::fluent_builders::PutAnomalyDetector::set_metric_name): <p>The name of the metric to create the anomaly detection model for.</p>
/// - [`dimensions(Vec<Dimension>)`](crate::client::fluent_builders::PutAnomalyDetector::dimensions) / [`set_dimensions(Option<Vec<Dimension>>)`](crate::client::fluent_builders::PutAnomalyDetector::set_dimensions): <p>The metric dimensions to create the anomaly detection model for.</p>
/// - [`stat(impl Into<String>)`](crate::client::fluent_builders::PutAnomalyDetector::stat) / [`set_stat(Option<String>)`](crate::client::fluent_builders::PutAnomalyDetector::set_stat): <p>The statistic to use for the metric and the anomaly detection model.</p>
/// - [`configuration(AnomalyDetectorConfiguration)`](crate::client::fluent_builders::PutAnomalyDetector::configuration) / [`set_configuration(Option<AnomalyDetectorConfiguration>)`](crate::client::fluent_builders::PutAnomalyDetector::set_configuration): <p>The configuration specifies details about how the anomaly detection model is to be trained, including time ranges to exclude when training and updating the model. You can specify as many as 10 time ranges.</p> <p>The configuration can also include the time zone to use for the metric.</p>
/// - [`single_metric_anomaly_detector(SingleMetricAnomalyDetector)`](crate::client::fluent_builders::PutAnomalyDetector::single_metric_anomaly_detector) / [`set_single_metric_anomaly_detector(Option<SingleMetricAnomalyDetector>)`](crate::client::fluent_builders::PutAnomalyDetector::set_single_metric_anomaly_detector): <p>A single metric anomaly detector to be created.</p> <p>When using <code>SingleMetricAnomalyDetector</code>, you cannot include the following parameters in the same operation:</p> <ul> <li> <p> <code>Dimensions</code> </p> </li> <li> <p> <code>MetricName</code> </p> </li> <li> <p> <code>Namespace</code> </p> </li> <li> <p> <code>Stat</code> </p> </li> <li> <p>the <code>MetricMatchAnomalyDetector</code> parameters of <code>PutAnomalyDetectorInput</code> </p> </li> </ul> <p>Instead, specify the single metric anomaly detector attributes as part of the property <code>SingleMetricAnomalyDetector</code>.</p>
/// - [`metric_math_anomaly_detector(MetricMathAnomalyDetector)`](crate::client::fluent_builders::PutAnomalyDetector::metric_math_anomaly_detector) / [`set_metric_math_anomaly_detector(Option<MetricMathAnomalyDetector>)`](crate::client::fluent_builders::PutAnomalyDetector::set_metric_math_anomaly_detector): <p>The metric math anomaly detector to be created.</p> <p>When using <code>MetricMathAnomalyDetector</code>, you cannot include the following parameters in the same operation:</p> <ul> <li> <p> <code>Dimensions</code> </p> </li> <li> <p> <code>MetricName</code> </p> </li> <li> <p> <code>Namespace</code> </p> </li> <li> <p> <code>Stat</code> </p> </li> <li> <p>the <code>SingleMetricAnomalyDetector</code> parameters of <code>PutAnomalyDetectorInput</code> </p> </li> </ul> <p>Instead, specify the metric math anomaly detector attributes as part of the property <code>MetricMathAnomalyDetector</code>.</p>
/// - On success, responds with [`PutAnomalyDetectorOutput`](crate::output::PutAnomalyDetectorOutput)
/// - On failure, responds with [`SdkError<PutAnomalyDetectorError>`](crate::error::PutAnomalyDetectorError)
pub fn put_anomaly_detector(&self) -> fluent_builders::PutAnomalyDetector<C, M, R> {
fluent_builders::PutAnomalyDetector::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`PutCompositeAlarm`](crate::client::fluent_builders::PutCompositeAlarm) operation.
///
/// - The fluent builder is configurable:
/// - [`actions_enabled(bool)`](crate::client::fluent_builders::PutCompositeAlarm::actions_enabled) / [`set_actions_enabled(Option<bool>)`](crate::client::fluent_builders::PutCompositeAlarm::set_actions_enabled): <p>Indicates whether actions should be executed during any changes to the alarm state of the composite alarm. The default is <code>TRUE</code>.</p>
/// - [`alarm_actions(Vec<String>)`](crate::client::fluent_builders::PutCompositeAlarm::alarm_actions) / [`set_alarm_actions(Option<Vec<String>>)`](crate::client::fluent_builders::PutCompositeAlarm::set_alarm_actions): <p>The actions to execute when this alarm transitions to the <code>ALARM</code> state from any other state. Each action is specified as an Amazon Resource Name (ARN).</p> <p>Valid Values: <code>arn:aws:sns:<i>region</i>:<i>account-id</i>:<i>sns-topic-name</i> </code> | <code>arn:aws:ssm:<i>region</i>:<i>account-id</i>:opsitem:<i>severity</i> </code> </p>
/// - [`alarm_description(impl Into<String>)`](crate::client::fluent_builders::PutCompositeAlarm::alarm_description) / [`set_alarm_description(Option<String>)`](crate::client::fluent_builders::PutCompositeAlarm::set_alarm_description): <p>The description for the composite alarm.</p>
/// - [`alarm_name(impl Into<String>)`](crate::client::fluent_builders::PutCompositeAlarm::alarm_name) / [`set_alarm_name(Option<String>)`](crate::client::fluent_builders::PutCompositeAlarm::set_alarm_name): <p>The name for the composite alarm. This name must be unique within the Region.</p>
/// - [`alarm_rule(impl Into<String>)`](crate::client::fluent_builders::PutCompositeAlarm::alarm_rule) / [`set_alarm_rule(Option<String>)`](crate::client::fluent_builders::PutCompositeAlarm::set_alarm_rule): <p>An expression that specifies which other alarms are to be evaluated to determine this composite alarm's state. For each alarm that you reference, you designate a function that specifies whether that alarm needs to be in ALARM state, OK state, or INSUFFICIENT_DATA state. You can use operators (AND, OR and NOT) to combine multiple functions in a single expression. You can use parenthesis to logically group the functions in your expression.</p> <p>You can use either alarm names or ARNs to reference the other alarms that are to be evaluated.</p> <p>Functions can include the following:</p> <ul> <li> <p> <code>ALARM("<i>alarm-name</i> or <i>alarm-ARN</i>")</code> is TRUE if the named alarm is in ALARM state.</p> </li> <li> <p> <code>OK("<i>alarm-name</i> or <i>alarm-ARN</i>")</code> is TRUE if the named alarm is in OK state.</p> </li> <li> <p> <code>INSUFFICIENT_DATA("<i>alarm-name</i> or <i>alarm-ARN</i>")</code> is TRUE if the named alarm is in INSUFFICIENT_DATA state.</p> </li> <li> <p> <code>TRUE</code> always evaluates to TRUE.</p> </li> <li> <p> <code>FALSE</code> always evaluates to FALSE.</p> </li> </ul> <p>TRUE and FALSE are useful for testing a complex <code>AlarmRule</code> structure, and for testing your alarm actions.</p> <p>Alarm names specified in <code>AlarmRule</code> can be surrounded with double-quotes ("), but do not have to be.</p> <p>The following are some examples of <code>AlarmRule</code>:</p> <ul> <li> <p> <code>ALARM(CPUUtilizationTooHigh) AND ALARM(DiskReadOpsTooHigh)</code> specifies that the composite alarm goes into ALARM state only if both CPUUtilizationTooHigh and DiskReadOpsTooHigh alarms are in ALARM state.</p> </li> <li> <p> <code>ALARM(CPUUtilizationTooHigh) AND NOT ALARM(DeploymentInProgress)</code> specifies that the alarm goes to ALARM state if CPUUtilizationTooHigh is in ALARM state and DeploymentInProgress is not in ALARM state. This example reduces alarm noise during a known deployment window.</p> </li> <li> <p> <code>(ALARM(CPUUtilizationTooHigh) OR ALARM(DiskReadOpsTooHigh)) AND OK(NetworkOutTooHigh)</code> goes into ALARM state if CPUUtilizationTooHigh OR DiskReadOpsTooHigh is in ALARM state, and if NetworkOutTooHigh is in OK state. This provides another example of using a composite alarm to prevent noise. This rule ensures that you are not notified with an alarm action on high CPU or disk usage if a known network problem is also occurring.</p> </li> </ul> <p>The <code>AlarmRule</code> can specify as many as 100 "children" alarms. The <code>AlarmRule</code> expression can have as many as 500 elements. Elements are child alarms, TRUE or FALSE statements, and parentheses.</p>
/// - [`insufficient_data_actions(Vec<String>)`](crate::client::fluent_builders::PutCompositeAlarm::insufficient_data_actions) / [`set_insufficient_data_actions(Option<Vec<String>>)`](crate::client::fluent_builders::PutCompositeAlarm::set_insufficient_data_actions): <p>The actions to execute when this alarm transitions to the <code>INSUFFICIENT_DATA</code> state from any other state. Each action is specified as an Amazon Resource Name (ARN).</p> <p>Valid Values: <code>arn:aws:sns:<i>region</i>:<i>account-id</i>:<i>sns-topic-name</i> </code> </p>
/// - [`ok_actions(Vec<String>)`](crate::client::fluent_builders::PutCompositeAlarm::ok_actions) / [`set_ok_actions(Option<Vec<String>>)`](crate::client::fluent_builders::PutCompositeAlarm::set_ok_actions): <p>The actions to execute when this alarm transitions to an <code>OK</code> state from any other state. Each action is specified as an Amazon Resource Name (ARN).</p> <p>Valid Values: <code>arn:aws:sns:<i>region</i>:<i>account-id</i>:<i>sns-topic-name</i> </code> </p>
/// - [`tags(Vec<Tag>)`](crate::client::fluent_builders::PutCompositeAlarm::tags) / [`set_tags(Option<Vec<Tag>>)`](crate::client::fluent_builders::PutCompositeAlarm::set_tags): <p>A list of key-value pairs to associate with the composite alarm. You can associate as many as 50 tags with an alarm.</p> <p>Tags can help you organize and categorize your resources. You can also use them to scope user permissions, by granting a user permission to access or change only resources with certain tag values.</p>
/// - On success, responds with [`PutCompositeAlarmOutput`](crate::output::PutCompositeAlarmOutput)
/// - On failure, responds with [`SdkError<PutCompositeAlarmError>`](crate::error::PutCompositeAlarmError)
pub fn put_composite_alarm(&self) -> fluent_builders::PutCompositeAlarm<C, M, R> {
fluent_builders::PutCompositeAlarm::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`PutDashboard`](crate::client::fluent_builders::PutDashboard) operation.
///
/// - The fluent builder is configurable:
/// - [`dashboard_name(impl Into<String>)`](crate::client::fluent_builders::PutDashboard::dashboard_name) / [`set_dashboard_name(Option<String>)`](crate::client::fluent_builders::PutDashboard::set_dashboard_name): <p>The name of the dashboard. If a dashboard with this name already exists, this call modifies that dashboard, replacing its current contents. Otherwise, a new dashboard is created. The maximum length is 255, and valid characters are A-Z, a-z, 0-9, "-", and "_". This parameter is required.</p>
/// - [`dashboard_body(impl Into<String>)`](crate::client::fluent_builders::PutDashboard::dashboard_body) / [`set_dashboard_body(Option<String>)`](crate::client::fluent_builders::PutDashboard::set_dashboard_body): <p>The detailed information about the dashboard in JSON format, including the widgets to include and their location on the dashboard. This parameter is required.</p> <p>For more information about the syntax, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/CloudWatch-Dashboard-Body-Structure.html">Dashboard Body Structure and Syntax</a>.</p>
/// - On success, responds with [`PutDashboardOutput`](crate::output::PutDashboardOutput) with field(s):
/// - [`dashboard_validation_messages(Option<Vec<DashboardValidationMessage>>)`](crate::output::PutDashboardOutput::dashboard_validation_messages): <p>If the input for <code>PutDashboard</code> was correct and the dashboard was successfully created or modified, this result is empty.</p> <p>If this result includes only warning messages, then the input was valid enough for the dashboard to be created or modified, but some elements of the dashboard might not render.</p> <p>If this result includes error messages, the input was not valid and the operation failed.</p>
/// - On failure, responds with [`SdkError<PutDashboardError>`](crate::error::PutDashboardError)
pub fn put_dashboard(&self) -> fluent_builders::PutDashboard<C, M, R> {
fluent_builders::PutDashboard::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`PutInsightRule`](crate::client::fluent_builders::PutInsightRule) operation.
///
/// - The fluent builder is configurable:
/// - [`rule_name(impl Into<String>)`](crate::client::fluent_builders::PutInsightRule::rule_name) / [`set_rule_name(Option<String>)`](crate::client::fluent_builders::PutInsightRule::set_rule_name): <p>A unique name for the rule.</p>
/// - [`rule_state(impl Into<String>)`](crate::client::fluent_builders::PutInsightRule::rule_state) / [`set_rule_state(Option<String>)`](crate::client::fluent_builders::PutInsightRule::set_rule_state): <p>The state of the rule. Valid values are ENABLED and DISABLED.</p>
/// - [`rule_definition(impl Into<String>)`](crate::client::fluent_builders::PutInsightRule::rule_definition) / [`set_rule_definition(Option<String>)`](crate::client::fluent_builders::PutInsightRule::set_rule_definition): <p>The definition of the rule, as a JSON object. For details on the valid syntax, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ContributorInsights-RuleSyntax.html">Contributor Insights Rule Syntax</a>.</p>
/// - [`tags(Vec<Tag>)`](crate::client::fluent_builders::PutInsightRule::tags) / [`set_tags(Option<Vec<Tag>>)`](crate::client::fluent_builders::PutInsightRule::set_tags): <p>A list of key-value pairs to associate with the Contributor Insights rule. You can associate as many as 50 tags with a rule.</p> <p>Tags can help you organize and categorize your resources. You can also use them to scope user permissions, by granting a user permission to access or change only the resources that have certain tag values.</p> <p>To be able to associate tags with a rule, you must have the <code>cloudwatch:TagResource</code> permission in addition to the <code>cloudwatch:PutInsightRule</code> permission.</p> <p>If you are using this operation to update an existing Contributor Insights rule, any tags you specify in this parameter are ignored. To change the tags of an existing rule, use <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_TagResource.html">TagResource</a>.</p>
/// - On success, responds with [`PutInsightRuleOutput`](crate::output::PutInsightRuleOutput)
/// - On failure, responds with [`SdkError<PutInsightRuleError>`](crate::error::PutInsightRuleError)
pub fn put_insight_rule(&self) -> fluent_builders::PutInsightRule<C, M, R> {
fluent_builders::PutInsightRule::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`PutMetricAlarm`](crate::client::fluent_builders::PutMetricAlarm) operation.
///
/// - The fluent builder is configurable:
/// - [`alarm_name(impl Into<String>)`](crate::client::fluent_builders::PutMetricAlarm::alarm_name) / [`set_alarm_name(Option<String>)`](crate::client::fluent_builders::PutMetricAlarm::set_alarm_name): <p>The name for the alarm. This name must be unique within the Region.</p>
/// - [`alarm_description(impl Into<String>)`](crate::client::fluent_builders::PutMetricAlarm::alarm_description) / [`set_alarm_description(Option<String>)`](crate::client::fluent_builders::PutMetricAlarm::set_alarm_description): <p>The description for the alarm.</p>
/// - [`actions_enabled(bool)`](crate::client::fluent_builders::PutMetricAlarm::actions_enabled) / [`set_actions_enabled(Option<bool>)`](crate::client::fluent_builders::PutMetricAlarm::set_actions_enabled): <p>Indicates whether actions should be executed during any changes to the alarm state. The default is <code>TRUE</code>.</p>
/// - [`ok_actions(Vec<String>)`](crate::client::fluent_builders::PutMetricAlarm::ok_actions) / [`set_ok_actions(Option<Vec<String>>)`](crate::client::fluent_builders::PutMetricAlarm::set_ok_actions): <p>The actions to execute when this alarm transitions to an <code>OK</code> state from any other state. Each action is specified as an Amazon Resource Name (ARN).</p> <p>Valid Values: <code>arn:aws:automate:<i>region</i>:ec2:stop</code> | <code>arn:aws:automate:<i>region</i>:ec2:terminate</code> | <code>arn:aws:automate:<i>region</i>:ec2:recover</code> | <code>arn:aws:automate:<i>region</i>:ec2:reboot</code> | <code>arn:aws:sns:<i>region</i>:<i>account-id</i>:<i>sns-topic-name</i> </code> | <code>arn:aws:autoscaling:<i>region</i>:<i>account-id</i>:scalingPolicy:<i>policy-id</i>:autoScalingGroupName/<i>group-friendly-name</i>:policyName/<i>policy-friendly-name</i> </code> </p> <p>Valid Values (for use with IAM roles): <code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Stop/1.0</code> | <code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Terminate/1.0</code> | <code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Reboot/1.0</code> | <code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Recover/1.0</code> </p>
/// - [`alarm_actions(Vec<String>)`](crate::client::fluent_builders::PutMetricAlarm::alarm_actions) / [`set_alarm_actions(Option<Vec<String>>)`](crate::client::fluent_builders::PutMetricAlarm::set_alarm_actions): <p>The actions to execute when this alarm transitions to the <code>ALARM</code> state from any other state. Each action is specified as an Amazon Resource Name (ARN).</p> <p>Valid Values: <code>arn:aws:automate:<i>region</i>:ec2:stop</code> | <code>arn:aws:automate:<i>region</i>:ec2:terminate</code> | <code>arn:aws:automate:<i>region</i>:ec2:recover</code> | <code>arn:aws:automate:<i>region</i>:ec2:reboot</code> | <code>arn:aws:sns:<i>region</i>:<i>account-id</i>:<i>sns-topic-name</i> </code> | <code>arn:aws:autoscaling:<i>region</i>:<i>account-id</i>:scalingPolicy:<i>policy-id</i>:autoScalingGroupName/<i>group-friendly-name</i>:policyName/<i>policy-friendly-name</i> </code> | <code>arn:aws:ssm:<i>region</i>:<i>account-id</i>:opsitem:<i>severity</i> </code> | <code>arn:aws:ssm-incidents::<i>account-id</i>:response-plan:<i>response-plan-name</i> </code> </p> <p>Valid Values (for use with IAM roles): <code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Stop/1.0</code> | <code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Terminate/1.0</code> | <code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Reboot/1.0</code> | <code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Recover/1.0</code> </p>
/// - [`insufficient_data_actions(Vec<String>)`](crate::client::fluent_builders::PutMetricAlarm::insufficient_data_actions) / [`set_insufficient_data_actions(Option<Vec<String>>)`](crate::client::fluent_builders::PutMetricAlarm::set_insufficient_data_actions): <p>The actions to execute when this alarm transitions to the <code>INSUFFICIENT_DATA</code> state from any other state. Each action is specified as an Amazon Resource Name (ARN).</p> <p>Valid Values: <code>arn:aws:automate:<i>region</i>:ec2:stop</code> | <code>arn:aws:automate:<i>region</i>:ec2:terminate</code> | <code>arn:aws:automate:<i>region</i>:ec2:recover</code> | <code>arn:aws:automate:<i>region</i>:ec2:reboot</code> | <code>arn:aws:sns:<i>region</i>:<i>account-id</i>:<i>sns-topic-name</i> </code> | <code>arn:aws:autoscaling:<i>region</i>:<i>account-id</i>:scalingPolicy:<i>policy-id</i>:autoScalingGroupName/<i>group-friendly-name</i>:policyName/<i>policy-friendly-name</i> </code> </p> <p>Valid Values (for use with IAM roles): <code>>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Stop/1.0</code> | <code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Terminate/1.0</code> | <code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Reboot/1.0</code> </p>
/// - [`metric_name(impl Into<String>)`](crate::client::fluent_builders::PutMetricAlarm::metric_name) / [`set_metric_name(Option<String>)`](crate::client::fluent_builders::PutMetricAlarm::set_metric_name): <p>The name for the metric associated with the alarm. For each <code>PutMetricAlarm</code> operation, you must specify either <code>MetricName</code> or a <code>Metrics</code> array.</p> <p>If you are creating an alarm based on a math expression, you cannot specify this parameter, or any of the <code>Dimensions</code>, <code>Period</code>, <code>Namespace</code>, <code>Statistic</code>, or <code>ExtendedStatistic</code> parameters. Instead, you specify all this information in the <code>Metrics</code> array.</p>
/// - [`namespace(impl Into<String>)`](crate::client::fluent_builders::PutMetricAlarm::namespace) / [`set_namespace(Option<String>)`](crate::client::fluent_builders::PutMetricAlarm::set_namespace): <p>The namespace for the metric associated specified in <code>MetricName</code>.</p>
/// - [`statistic(Statistic)`](crate::client::fluent_builders::PutMetricAlarm::statistic) / [`set_statistic(Option<Statistic>)`](crate::client::fluent_builders::PutMetricAlarm::set_statistic): <p>The statistic for the metric specified in <code>MetricName</code>, other than percentile. For percentile statistics, use <code>ExtendedStatistic</code>. When you call <code>PutMetricAlarm</code> and specify a <code>MetricName</code>, you must specify either <code>Statistic</code> or <code>ExtendedStatistic,</code> but not both.</p>
/// - [`extended_statistic(impl Into<String>)`](crate::client::fluent_builders::PutMetricAlarm::extended_statistic) / [`set_extended_statistic(Option<String>)`](crate::client::fluent_builders::PutMetricAlarm::set_extended_statistic): <p>The percentile statistic for the metric specified in <code>MetricName</code>. Specify a value between p0.0 and p100. When you call <code>PutMetricAlarm</code> and specify a <code>MetricName</code>, you must specify either <code>Statistic</code> or <code>ExtendedStatistic,</code> but not both.</p>
/// - [`dimensions(Vec<Dimension>)`](crate::client::fluent_builders::PutMetricAlarm::dimensions) / [`set_dimensions(Option<Vec<Dimension>>)`](crate::client::fluent_builders::PutMetricAlarm::set_dimensions): <p>The dimensions for the metric specified in <code>MetricName</code>.</p>
/// - [`period(i32)`](crate::client::fluent_builders::PutMetricAlarm::period) / [`set_period(Option<i32>)`](crate::client::fluent_builders::PutMetricAlarm::set_period): <p>The length, in seconds, used each time the metric specified in <code>MetricName</code> is evaluated. Valid values are 10, 30, and any multiple of 60.</p> <p> <code>Period</code> is required for alarms based on static thresholds. If you are creating an alarm based on a metric math expression, you specify the period for each metric within the objects in the <code>Metrics</code> array.</p> <p>Be sure to specify 10 or 30 only for metrics that are stored by a <code>PutMetricData</code> call with a <code>StorageResolution</code> of 1. If you specify a period of 10 or 30 for a metric that does not have sub-minute resolution, the alarm still attempts to gather data at the period rate that you specify. In this case, it does not receive data for the attempts that do not correspond to a one-minute data resolution, and the alarm might often lapse into INSUFFICENT_DATA status. Specifying 10 or 30 also sets this alarm as a high-resolution alarm, which has a higher charge than other alarms. For more information about pricing, see <a href="https://aws.amazon.com/cloudwatch/pricing/">Amazon CloudWatch Pricing</a>.</p> <p>An alarm's total current evaluation period can be no longer than one day, so <code>Period</code> multiplied by <code>EvaluationPeriods</code> cannot be more than 86,400 seconds.</p>
/// - [`unit(StandardUnit)`](crate::client::fluent_builders::PutMetricAlarm::unit) / [`set_unit(Option<StandardUnit>)`](crate::client::fluent_builders::PutMetricAlarm::set_unit): <p>The unit of measure for the statistic. For example, the units for the Amazon EC2 NetworkIn metric are Bytes because NetworkIn tracks the number of bytes that an instance receives on all network interfaces. You can also specify a unit when you create a custom metric. Units help provide conceptual meaning to your data. Metric data points that specify a unit of measure, such as Percent, are aggregated separately.</p> <p>If you don't specify <code>Unit</code>, CloudWatch retrieves all unit types that have been published for the metric and attempts to evaluate the alarm. Usually, metrics are published with only one unit, so the alarm works as intended.</p> <p>However, if the metric is published with multiple types of units and you don't specify a unit, the alarm's behavior is not defined and it behaves predictably.</p> <p>We recommend omitting <code>Unit</code> so that you don't inadvertently specify an incorrect unit that is not published for this metric. Doing so causes the alarm to be stuck in the <code>INSUFFICIENT DATA</code> state.</p>
/// - [`evaluation_periods(i32)`](crate::client::fluent_builders::PutMetricAlarm::evaluation_periods) / [`set_evaluation_periods(Option<i32>)`](crate::client::fluent_builders::PutMetricAlarm::set_evaluation_periods): <p>The number of periods over which data is compared to the specified threshold. If you are setting an alarm that requires that a number of consecutive data points be breaching to trigger the alarm, this value specifies that number. If you are setting an "M out of N" alarm, this value is the N.</p> <p>An alarm's total current evaluation period can be no longer than one day, so this number multiplied by <code>Period</code> cannot be more than 86,400 seconds.</p>
/// - [`datapoints_to_alarm(i32)`](crate::client::fluent_builders::PutMetricAlarm::datapoints_to_alarm) / [`set_datapoints_to_alarm(Option<i32>)`](crate::client::fluent_builders::PutMetricAlarm::set_datapoints_to_alarm): <p>The number of data points that must be breaching to trigger the alarm. This is used only if you are setting an "M out of N" alarm. In that case, this value is the M. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarm-evaluation">Evaluating an Alarm</a> in the <i>Amazon CloudWatch User Guide</i>.</p>
/// - [`threshold(f64)`](crate::client::fluent_builders::PutMetricAlarm::threshold) / [`set_threshold(Option<f64>)`](crate::client::fluent_builders::PutMetricAlarm::set_threshold): <p>The value against which the specified statistic is compared.</p> <p>This parameter is required for alarms based on static thresholds, but should not be used for alarms based on anomaly detection models.</p>
/// - [`comparison_operator(ComparisonOperator)`](crate::client::fluent_builders::PutMetricAlarm::comparison_operator) / [`set_comparison_operator(Option<ComparisonOperator>)`](crate::client::fluent_builders::PutMetricAlarm::set_comparison_operator): <p> The arithmetic operation to use when comparing the specified statistic and threshold. The specified statistic value is used as the first operand.</p> <p>The values <code>LessThanLowerOrGreaterThanUpperThreshold</code>, <code>LessThanLowerThreshold</code>, and <code>GreaterThanUpperThreshold</code> are used only for alarms based on anomaly detection models.</p>
/// - [`treat_missing_data(impl Into<String>)`](crate::client::fluent_builders::PutMetricAlarm::treat_missing_data) / [`set_treat_missing_data(Option<String>)`](crate::client::fluent_builders::PutMetricAlarm::set_treat_missing_data): <p> Sets how this alarm is to handle missing data points. If <code>TreatMissingData</code> is omitted, the default behavior of <code>missing</code> is used. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarms-and-missing-data">Configuring How CloudWatch Alarms Treats Missing Data</a>.</p> <p>Valid Values: <code>breaching | notBreaching | ignore | missing</code> </p>
/// - [`evaluate_low_sample_count_percentile(impl Into<String>)`](crate::client::fluent_builders::PutMetricAlarm::evaluate_low_sample_count_percentile) / [`set_evaluate_low_sample_count_percentile(Option<String>)`](crate::client::fluent_builders::PutMetricAlarm::set_evaluate_low_sample_count_percentile): <p> Used only for alarms based on percentiles. If you specify <code>ignore</code>, the alarm state does not change during periods with too few data points to be statistically significant. If you specify <code>evaluate</code> or omit this parameter, the alarm is always evaluated and possibly changes state no matter how many data points are available. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#percentiles-with-low-samples">Percentile-Based CloudWatch Alarms and Low Data Samples</a>.</p> <p>Valid Values: <code>evaluate | ignore</code> </p>
/// - [`metrics(Vec<MetricDataQuery>)`](crate::client::fluent_builders::PutMetricAlarm::metrics) / [`set_metrics(Option<Vec<MetricDataQuery>>)`](crate::client::fluent_builders::PutMetricAlarm::set_metrics): <p>An array of <code>MetricDataQuery</code> structures that enable you to create an alarm based on the result of a metric math expression. For each <code>PutMetricAlarm</code> operation, you must specify either <code>MetricName</code> or a <code>Metrics</code> array.</p> <p>Each item in the <code>Metrics</code> array either retrieves a metric or performs a math expression.</p> <p>One item in the <code>Metrics</code> array is the expression that the alarm watches. You designate this expression by setting <code>ReturnData</code> to true for this object in the array. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDataQuery.html">MetricDataQuery</a>.</p> <p>If you use the <code>Metrics</code> parameter, you cannot include the <code>MetricName</code>, <code>Dimensions</code>, <code>Period</code>, <code>Namespace</code>, <code>Statistic</code>, or <code>ExtendedStatistic</code> parameters of <code>PutMetricAlarm</code> in the same operation. Instead, you retrieve the metrics you are using in your math expression as part of the <code>Metrics</code> array.</p>
/// - [`tags(Vec<Tag>)`](crate::client::fluent_builders::PutMetricAlarm::tags) / [`set_tags(Option<Vec<Tag>>)`](crate::client::fluent_builders::PutMetricAlarm::set_tags): <p>A list of key-value pairs to associate with the alarm. You can associate as many as 50 tags with an alarm.</p> <p>Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.</p> <p>If you are using this operation to update an existing alarm, any tags you specify in this parameter are ignored. To change the tags of an existing alarm, use <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_TagResource.html">TagResource</a> or <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_UntagResource.html">UntagResource</a>.</p>
/// - [`threshold_metric_id(impl Into<String>)`](crate::client::fluent_builders::PutMetricAlarm::threshold_metric_id) / [`set_threshold_metric_id(Option<String>)`](crate::client::fluent_builders::PutMetricAlarm::set_threshold_metric_id): <p>If this is an alarm based on an anomaly detection model, make this value match the ID of the <code>ANOMALY_DETECTION_BAND</code> function.</p> <p>For an example of how to use this parameter, see the <b>Anomaly Detection Model Alarm</b> example on this page.</p> <p>If your alarm uses this parameter, it cannot have Auto Scaling actions.</p>
/// - On success, responds with [`PutMetricAlarmOutput`](crate::output::PutMetricAlarmOutput)
/// - On failure, responds with [`SdkError<PutMetricAlarmError>`](crate::error::PutMetricAlarmError)
pub fn put_metric_alarm(&self) -> fluent_builders::PutMetricAlarm<C, M, R> {
fluent_builders::PutMetricAlarm::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`PutMetricData`](crate::client::fluent_builders::PutMetricData) operation.
///
/// - The fluent builder is configurable:
/// - [`namespace(impl Into<String>)`](crate::client::fluent_builders::PutMetricData::namespace) / [`set_namespace(Option<String>)`](crate::client::fluent_builders::PutMetricData::set_namespace): <p>The namespace for the metric data.</p> <p>To avoid conflicts with Amazon Web Services service namespaces, you should not specify a namespace that begins with <code>AWS/</code> </p>
/// - [`metric_data(Vec<MetricDatum>)`](crate::client::fluent_builders::PutMetricData::metric_data) / [`set_metric_data(Option<Vec<MetricDatum>>)`](crate::client::fluent_builders::PutMetricData::set_metric_data): <p>The data for the metric. The array can include no more than 20 metrics per call.</p>
/// - On success, responds with [`PutMetricDataOutput`](crate::output::PutMetricDataOutput)
/// - On failure, responds with [`SdkError<PutMetricDataError>`](crate::error::PutMetricDataError)
pub fn put_metric_data(&self) -> fluent_builders::PutMetricData<C, M, R> {
fluent_builders::PutMetricData::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`PutMetricStream`](crate::client::fluent_builders::PutMetricStream) operation.
///
/// - The fluent builder is configurable:
/// - [`name(impl Into<String>)`](crate::client::fluent_builders::PutMetricStream::name) / [`set_name(Option<String>)`](crate::client::fluent_builders::PutMetricStream::set_name): <p>If you are creating a new metric stream, this is the name for the new stream. The name must be different than the names of other metric streams in this account and Region.</p> <p>If you are updating a metric stream, specify the name of that stream here.</p> <p>Valid characters are A-Z, a-z, 0-9, "-" and "_".</p>
/// - [`include_filters(Vec<MetricStreamFilter>)`](crate::client::fluent_builders::PutMetricStream::include_filters) / [`set_include_filters(Option<Vec<MetricStreamFilter>>)`](crate::client::fluent_builders::PutMetricStream::set_include_filters): <p>If you specify this parameter, the stream sends only the metrics from the metric namespaces that you specify here.</p> <p>You cannot include <code>IncludeFilters</code> and <code>ExcludeFilters</code> in the same operation.</p>
/// - [`exclude_filters(Vec<MetricStreamFilter>)`](crate::client::fluent_builders::PutMetricStream::exclude_filters) / [`set_exclude_filters(Option<Vec<MetricStreamFilter>>)`](crate::client::fluent_builders::PutMetricStream::set_exclude_filters): <p>If you specify this parameter, the stream sends metrics from all metric namespaces except for the namespaces that you specify here.</p> <p>You cannot include <code>ExcludeFilters</code> and <code>IncludeFilters</code> in the same operation.</p>
/// - [`firehose_arn(impl Into<String>)`](crate::client::fluent_builders::PutMetricStream::firehose_arn) / [`set_firehose_arn(Option<String>)`](crate::client::fluent_builders::PutMetricStream::set_firehose_arn): <p>The ARN of the Amazon Kinesis Firehose delivery stream to use for this metric stream. This Amazon Kinesis Firehose delivery stream must already exist and must be in the same account as the metric stream.</p>
/// - [`role_arn(impl Into<String>)`](crate::client::fluent_builders::PutMetricStream::role_arn) / [`set_role_arn(Option<String>)`](crate::client::fluent_builders::PutMetricStream::set_role_arn): <p>The ARN of an IAM role that this metric stream will use to access Amazon Kinesis Firehose resources. This IAM role must already exist and must be in the same account as the metric stream. This IAM role must include the following permissions:</p> <ul> <li> <p>firehose:PutRecord</p> </li> <li> <p>firehose:PutRecordBatch</p> </li> </ul>
/// - [`output_format(MetricStreamOutputFormat)`](crate::client::fluent_builders::PutMetricStream::output_format) / [`set_output_format(Option<MetricStreamOutputFormat>)`](crate::client::fluent_builders::PutMetricStream::set_output_format): <p>The output format for the stream. Valid values are <code>json</code> and <code>opentelemetry0.7</code>. For more information about metric stream output formats, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-metric-streams-formats.html"> Metric streams output formats</a>.</p>
/// - [`tags(Vec<Tag>)`](crate::client::fluent_builders::PutMetricStream::tags) / [`set_tags(Option<Vec<Tag>>)`](crate::client::fluent_builders::PutMetricStream::set_tags): <p>A list of key-value pairs to associate with the metric stream. You can associate as many as 50 tags with a metric stream.</p> <p>Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.</p> <p>You can use this parameter only when you are creating a new metric stream. If you are using this operation to update an existing metric stream, any tags you specify in this parameter are ignored. To change the tags of an existing metric stream, use <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_TagResource.html">TagResource</a> or <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_UntagResource.html">UntagResource</a>.</p>
/// - On success, responds with [`PutMetricStreamOutput`](crate::output::PutMetricStreamOutput) with field(s):
/// - [`arn(Option<String>)`](crate::output::PutMetricStreamOutput::arn): <p>The ARN of the metric stream.</p>
/// - On failure, responds with [`SdkError<PutMetricStreamError>`](crate::error::PutMetricStreamError)
pub fn put_metric_stream(&self) -> fluent_builders::PutMetricStream<C, M, R> {
fluent_builders::PutMetricStream::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`SetAlarmState`](crate::client::fluent_builders::SetAlarmState) operation.
///
/// - The fluent builder is configurable:
/// - [`alarm_name(impl Into<String>)`](crate::client::fluent_builders::SetAlarmState::alarm_name) / [`set_alarm_name(Option<String>)`](crate::client::fluent_builders::SetAlarmState::set_alarm_name): <p>The name of the alarm.</p>
/// - [`state_value(StateValue)`](crate::client::fluent_builders::SetAlarmState::state_value) / [`set_state_value(Option<StateValue>)`](crate::client::fluent_builders::SetAlarmState::set_state_value): <p>The value of the state.</p>
/// - [`state_reason(impl Into<String>)`](crate::client::fluent_builders::SetAlarmState::state_reason) / [`set_state_reason(Option<String>)`](crate::client::fluent_builders::SetAlarmState::set_state_reason): <p>The reason that this alarm is set to this specific state, in text format.</p>
/// - [`state_reason_data(impl Into<String>)`](crate::client::fluent_builders::SetAlarmState::state_reason_data) / [`set_state_reason_data(Option<String>)`](crate::client::fluent_builders::SetAlarmState::set_state_reason_data): <p>The reason that this alarm is set to this specific state, in JSON format.</p> <p>For SNS or EC2 alarm actions, this is just informational. But for EC2 Auto Scaling or application Auto Scaling alarm actions, the Auto Scaling policy uses the information in this field to take the correct action.</p>
/// - On success, responds with [`SetAlarmStateOutput`](crate::output::SetAlarmStateOutput)
/// - On failure, responds with [`SdkError<SetAlarmStateError>`](crate::error::SetAlarmStateError)
pub fn set_alarm_state(&self) -> fluent_builders::SetAlarmState<C, M, R> {
fluent_builders::SetAlarmState::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`StartMetricStreams`](crate::client::fluent_builders::StartMetricStreams) operation.
///
/// - The fluent builder is configurable:
/// - [`names(Vec<String>)`](crate::client::fluent_builders::StartMetricStreams::names) / [`set_names(Option<Vec<String>>)`](crate::client::fluent_builders::StartMetricStreams::set_names): <p>The array of the names of metric streams to start streaming.</p> <p>This is an "all or nothing" operation. If you do not have permission to access all of the metric streams that you list here, then none of the streams that you list in the operation will start streaming.</p>
/// - On success, responds with [`StartMetricStreamsOutput`](crate::output::StartMetricStreamsOutput)
/// - On failure, responds with [`SdkError<StartMetricStreamsError>`](crate::error::StartMetricStreamsError)
pub fn start_metric_streams(&self) -> fluent_builders::StartMetricStreams<C, M, R> {
fluent_builders::StartMetricStreams::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`StopMetricStreams`](crate::client::fluent_builders::StopMetricStreams) operation.
///
/// - The fluent builder is configurable:
/// - [`names(Vec<String>)`](crate::client::fluent_builders::StopMetricStreams::names) / [`set_names(Option<Vec<String>>)`](crate::client::fluent_builders::StopMetricStreams::set_names): <p>The array of the names of metric streams to stop streaming.</p> <p>This is an "all or nothing" operation. If you do not have permission to access all of the metric streams that you list here, then none of the streams that you list in the operation will stop streaming.</p>
/// - On success, responds with [`StopMetricStreamsOutput`](crate::output::StopMetricStreamsOutput)
/// - On failure, responds with [`SdkError<StopMetricStreamsError>`](crate::error::StopMetricStreamsError)
pub fn stop_metric_streams(&self) -> fluent_builders::StopMetricStreams<C, M, R> {
fluent_builders::StopMetricStreams::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`TagResource`](crate::client::fluent_builders::TagResource) operation.
///
/// - The fluent builder is configurable:
/// - [`resource_arn(impl Into<String>)`](crate::client::fluent_builders::TagResource::resource_arn) / [`set_resource_arn(Option<String>)`](crate::client::fluent_builders::TagResource::set_resource_arn): <p>The ARN of the CloudWatch resource that you're adding tags to.</p> <p>The ARN format of an alarm is <code>arn:aws:cloudwatch:<i>Region</i>:<i>account-id</i>:alarm:<i>alarm-name</i> </code> </p> <p>The ARN format of a Contributor Insights rule is <code>arn:aws:cloudwatch:<i>Region</i>:<i>account-id</i>:insight-rule:<i>insight-rule-name</i> </code> </p> <p>For more information about ARN format, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/list_amazoncloudwatch.html#amazoncloudwatch-resources-for-iam-policies"> Resource Types Defined by Amazon CloudWatch</a> in the <i>Amazon Web Services General Reference</i>.</p>
/// - [`tags(Vec<Tag>)`](crate::client::fluent_builders::TagResource::tags) / [`set_tags(Option<Vec<Tag>>)`](crate::client::fluent_builders::TagResource::set_tags): <p>The list of key-value pairs to associate with the alarm.</p>
/// - On success, responds with [`TagResourceOutput`](crate::output::TagResourceOutput)
/// - On failure, responds with [`SdkError<TagResourceError>`](crate::error::TagResourceError)
pub fn tag_resource(&self) -> fluent_builders::TagResource<C, M, R> {
fluent_builders::TagResource::new(self.handle.clone())
}
/// Constructs a fluent builder for the [`UntagResource`](crate::client::fluent_builders::UntagResource) operation.
///
/// - The fluent builder is configurable:
/// - [`resource_arn(impl Into<String>)`](crate::client::fluent_builders::UntagResource::resource_arn) / [`set_resource_arn(Option<String>)`](crate::client::fluent_builders::UntagResource::set_resource_arn): <p>The ARN of the CloudWatch resource that you're removing tags from.</p> <p>The ARN format of an alarm is <code>arn:aws:cloudwatch:<i>Region</i>:<i>account-id</i>:alarm:<i>alarm-name</i> </code> </p> <p>The ARN format of a Contributor Insights rule is <code>arn:aws:cloudwatch:<i>Region</i>:<i>account-id</i>:insight-rule:<i>insight-rule-name</i> </code> </p> <p>For more information about ARN format, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/list_amazoncloudwatch.html#amazoncloudwatch-resources-for-iam-policies"> Resource Types Defined by Amazon CloudWatch</a> in the <i>Amazon Web Services General Reference</i>.</p>
/// - [`tag_keys(Vec<String>)`](crate::client::fluent_builders::UntagResource::tag_keys) / [`set_tag_keys(Option<Vec<String>>)`](crate::client::fluent_builders::UntagResource::set_tag_keys): <p>The list of tag keys to remove from the resource.</p>
/// - On success, responds with [`UntagResourceOutput`](crate::output::UntagResourceOutput)
/// - On failure, responds with [`SdkError<UntagResourceError>`](crate::error::UntagResourceError)
pub fn untag_resource(&self) -> fluent_builders::UntagResource<C, M, R> {
fluent_builders::UntagResource::new(self.handle.clone())
}
}
pub mod fluent_builders {
//!
//! Utilities to ergonomically construct a request to the service.
//!
//! Fluent builders are created through the [`Client`](crate::client::Client) by calling
//! one if its operation methods. After parameters are set using the builder methods,
//! the `send` method can be called to initiate the request.
//!
/// Fluent builder constructing a request to `DeleteAlarms`.
///
/// <p>Deletes the specified alarms. You can delete up to 100 alarms in one operation. However, this total can include no more than one composite alarm. For example, you could delete 99 metric alarms and one composite alarms with one operation, but you can't delete two composite alarms with one operation.</p>
/// <p> In the event of an error, no alarms are deleted.</p> <note>
/// <p>It is possible to create a loop or cycle of composite alarms, where composite alarm A depends on composite alarm B, and composite alarm B also depends on composite alarm A. In this scenario, you can't delete any composite alarm that is part of the cycle because there is always still a composite alarm that depends on that alarm that you want to delete.</p>
/// <p>To get out of such a situation, you must break the cycle by changing the rule of one of the composite alarms in the cycle to remove a dependency that creates the cycle. The simplest change to make to break a cycle is to change the <code>AlarmRule</code> of one of the alarms to <code>False</code>. </p>
/// <p>Additionally, the evaluation of composite alarms stops if CloudWatch detects a cycle in the evaluation path. </p>
/// </note>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct DeleteAlarms<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::delete_alarms_input::Builder,
}
impl<C, M, R> DeleteAlarms<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `DeleteAlarms`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::DeleteAlarmsOutput,
aws_smithy_http::result::SdkError<crate::error::DeleteAlarmsError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::DeleteAlarmsInputOperationOutputAlias,
crate::output::DeleteAlarmsOutput,
crate::error::DeleteAlarmsError,
crate::input::DeleteAlarmsInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// Appends an item to `AlarmNames`.
///
/// To override the contents of this collection use [`set_alarm_names`](Self::set_alarm_names).
///
/// <p>The alarms to be deleted.</p>
pub fn alarm_names(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.alarm_names(input.into());
self
}
/// <p>The alarms to be deleted.</p>
pub fn set_alarm_names(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.inner = self.inner.set_alarm_names(input);
self
}
}
/// Fluent builder constructing a request to `DeleteAnomalyDetector`.
///
/// <p>Deletes the specified anomaly detection model from your account.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct DeleteAnomalyDetector<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::delete_anomaly_detector_input::Builder,
}
impl<C, M, R> DeleteAnomalyDetector<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `DeleteAnomalyDetector`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::DeleteAnomalyDetectorOutput,
aws_smithy_http::result::SdkError<crate::error::DeleteAnomalyDetectorError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::DeleteAnomalyDetectorInputOperationOutputAlias,
crate::output::DeleteAnomalyDetectorOutput,
crate::error::DeleteAnomalyDetectorError,
crate::input::DeleteAnomalyDetectorInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The namespace associated with the anomaly detection model to delete.</p>
pub fn namespace(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.namespace(input.into());
self
}
/// <p>The namespace associated with the anomaly detection model to delete.</p>
pub fn set_namespace(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_namespace(input);
self
}
/// <p>The metric name associated with the anomaly detection model to delete.</p>
pub fn metric_name(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.metric_name(input.into());
self
}
/// <p>The metric name associated with the anomaly detection model to delete.</p>
pub fn set_metric_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_metric_name(input);
self
}
/// Appends an item to `Dimensions`.
///
/// To override the contents of this collection use [`set_dimensions`](Self::set_dimensions).
///
/// <p>The metric dimensions associated with the anomaly detection model to delete.</p>
pub fn dimensions(mut self, input: crate::model::Dimension) -> Self {
self.inner = self.inner.dimensions(input);
self
}
/// <p>The metric dimensions associated with the anomaly detection model to delete.</p>
pub fn set_dimensions(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Dimension>>,
) -> Self {
self.inner = self.inner.set_dimensions(input);
self
}
/// <p>The statistic associated with the anomaly detection model to delete.</p>
pub fn stat(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.stat(input.into());
self
}
/// <p>The statistic associated with the anomaly detection model to delete.</p>
pub fn set_stat(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_stat(input);
self
}
/// <p>A single metric anomaly detector to be deleted.</p>
/// <p>When using <code>SingleMetricAnomalyDetector</code>, you cannot include the following parameters in the same operation:</p>
/// <ul>
/// <li> <p> <code>Dimensions</code>,</p> </li>
/// <li> <p> <code>MetricName</code> </p> </li>
/// <li> <p> <code>Namespace</code> </p> </li>
/// <li> <p> <code>Stat</code> </p> </li>
/// <li> <p>the <code>MetricMathAnomalyDetector</code> parameters of <code>DeleteAnomalyDetectorInput</code> </p> </li>
/// </ul>
/// <p>Instead, specify the single metric anomaly detector attributes as part of the <code>SingleMetricAnomalyDetector</code> property.</p>
pub fn single_metric_anomaly_detector(
mut self,
input: crate::model::SingleMetricAnomalyDetector,
) -> Self {
self.inner = self.inner.single_metric_anomaly_detector(input);
self
}
/// <p>A single metric anomaly detector to be deleted.</p>
/// <p>When using <code>SingleMetricAnomalyDetector</code>, you cannot include the following parameters in the same operation:</p>
/// <ul>
/// <li> <p> <code>Dimensions</code>,</p> </li>
/// <li> <p> <code>MetricName</code> </p> </li>
/// <li> <p> <code>Namespace</code> </p> </li>
/// <li> <p> <code>Stat</code> </p> </li>
/// <li> <p>the <code>MetricMathAnomalyDetector</code> parameters of <code>DeleteAnomalyDetectorInput</code> </p> </li>
/// </ul>
/// <p>Instead, specify the single metric anomaly detector attributes as part of the <code>SingleMetricAnomalyDetector</code> property.</p>
pub fn set_single_metric_anomaly_detector(
mut self,
input: std::option::Option<crate::model::SingleMetricAnomalyDetector>,
) -> Self {
self.inner = self.inner.set_single_metric_anomaly_detector(input);
self
}
/// <p>The metric math anomaly detector to be deleted.</p>
/// <p>When using <code>MetricMathAnomalyDetector</code>, you cannot include following parameters in the same operation:</p>
/// <ul>
/// <li> <p> <code>Dimensions</code>,</p> </li>
/// <li> <p> <code>MetricName</code> </p> </li>
/// <li> <p> <code>Namespace</code> </p> </li>
/// <li> <p> <code>Stat</code> </p> </li>
/// <li> <p>the <code>SingleMetricAnomalyDetector</code> parameters of <code>DeleteAnomalyDetectorInput</code> </p> </li>
/// </ul>
/// <p>Instead, specify the metric math anomaly detector attributes as part of the <code>MetricMathAnomalyDetector</code> property.</p>
pub fn metric_math_anomaly_detector(
mut self,
input: crate::model::MetricMathAnomalyDetector,
) -> Self {
self.inner = self.inner.metric_math_anomaly_detector(input);
self
}
/// <p>The metric math anomaly detector to be deleted.</p>
/// <p>When using <code>MetricMathAnomalyDetector</code>, you cannot include following parameters in the same operation:</p>
/// <ul>
/// <li> <p> <code>Dimensions</code>,</p> </li>
/// <li> <p> <code>MetricName</code> </p> </li>
/// <li> <p> <code>Namespace</code> </p> </li>
/// <li> <p> <code>Stat</code> </p> </li>
/// <li> <p>the <code>SingleMetricAnomalyDetector</code> parameters of <code>DeleteAnomalyDetectorInput</code> </p> </li>
/// </ul>
/// <p>Instead, specify the metric math anomaly detector attributes as part of the <code>MetricMathAnomalyDetector</code> property.</p>
pub fn set_metric_math_anomaly_detector(
mut self,
input: std::option::Option<crate::model::MetricMathAnomalyDetector>,
) -> Self {
self.inner = self.inner.set_metric_math_anomaly_detector(input);
self
}
}
/// Fluent builder constructing a request to `DeleteDashboards`.
///
/// <p>Deletes all dashboards that you specify. You can specify up to 100 dashboards to delete. If there is an error during this call, no dashboards are deleted.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct DeleteDashboards<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::delete_dashboards_input::Builder,
}
impl<C, M, R> DeleteDashboards<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `DeleteDashboards`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::DeleteDashboardsOutput,
aws_smithy_http::result::SdkError<crate::error::DeleteDashboardsError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::DeleteDashboardsInputOperationOutputAlias,
crate::output::DeleteDashboardsOutput,
crate::error::DeleteDashboardsError,
crate::input::DeleteDashboardsInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// Appends an item to `DashboardNames`.
///
/// To override the contents of this collection use [`set_dashboard_names`](Self::set_dashboard_names).
///
/// <p>The dashboards to be deleted. This parameter is required.</p>
pub fn dashboard_names(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.dashboard_names(input.into());
self
}
/// <p>The dashboards to be deleted. This parameter is required.</p>
pub fn set_dashboard_names(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.inner = self.inner.set_dashboard_names(input);
self
}
}
/// Fluent builder constructing a request to `DeleteInsightRules`.
///
/// <p>Permanently deletes the specified Contributor Insights rules.</p>
/// <p>If you create a rule, delete it, and then re-create it with the same name, historical data from the first time the rule was created might not be available.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct DeleteInsightRules<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::delete_insight_rules_input::Builder,
}
impl<C, M, R> DeleteInsightRules<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `DeleteInsightRules`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::DeleteInsightRulesOutput,
aws_smithy_http::result::SdkError<crate::error::DeleteInsightRulesError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::DeleteInsightRulesInputOperationOutputAlias,
crate::output::DeleteInsightRulesOutput,
crate::error::DeleteInsightRulesError,
crate::input::DeleteInsightRulesInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// Appends an item to `RuleNames`.
///
/// To override the contents of this collection use [`set_rule_names`](Self::set_rule_names).
///
/// <p>An array of the rule names to delete. If you need to find out the names of your rules, use <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeInsightRules.html">DescribeInsightRules</a>.</p>
pub fn rule_names(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.rule_names(input.into());
self
}
/// <p>An array of the rule names to delete. If you need to find out the names of your rules, use <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeInsightRules.html">DescribeInsightRules</a>.</p>
pub fn set_rule_names(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.inner = self.inner.set_rule_names(input);
self
}
}
/// Fluent builder constructing a request to `DeleteMetricStream`.
///
/// <p>Permanently deletes the metric stream that you specify.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct DeleteMetricStream<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::delete_metric_stream_input::Builder,
}
impl<C, M, R> DeleteMetricStream<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `DeleteMetricStream`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::DeleteMetricStreamOutput,
aws_smithy_http::result::SdkError<crate::error::DeleteMetricStreamError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::DeleteMetricStreamInputOperationOutputAlias,
crate::output::DeleteMetricStreamOutput,
crate::error::DeleteMetricStreamError,
crate::input::DeleteMetricStreamInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The name of the metric stream to delete.</p>
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.name(input.into());
self
}
/// <p>The name of the metric stream to delete.</p>
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_name(input);
self
}
}
/// Fluent builder constructing a request to `DescribeAlarmHistory`.
///
/// <p>Retrieves the history for the specified alarm. You can filter the results by date range or item type. If an alarm name is not specified, the histories for either all metric alarms or all composite alarms are returned.</p>
/// <p>CloudWatch retains the history of an alarm even if you delete the alarm.</p>
/// <p>To use this operation and return information about a composite alarm, you must be signed on with the <code>cloudwatch:DescribeAlarmHistory</code> permission that is scoped to <code>*</code>. You can't return information about composite alarms if your <code>cloudwatch:DescribeAlarmHistory</code> permission has a narrower scope.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct DescribeAlarmHistory<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::describe_alarm_history_input::Builder,
}
impl<C, M, R> DescribeAlarmHistory<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `DescribeAlarmHistory`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::DescribeAlarmHistoryOutput,
aws_smithy_http::result::SdkError<crate::error::DescribeAlarmHistoryError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::DescribeAlarmHistoryInputOperationOutputAlias,
crate::output::DescribeAlarmHistoryOutput,
crate::error::DescribeAlarmHistoryError,
crate::input::DescribeAlarmHistoryInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// Create a paginator for this request
///
/// Paginators are used by calling [`send().await`](crate::paginator::DescribeAlarmHistoryPaginator::send) which returns a [`Stream`](tokio_stream::Stream).
pub fn into_paginator(self) -> crate::paginator::DescribeAlarmHistoryPaginator<C, M, R> {
crate::paginator::DescribeAlarmHistoryPaginator::new(self.handle, self.inner)
}
/// <p>The name of the alarm.</p>
pub fn alarm_name(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.alarm_name(input.into());
self
}
/// <p>The name of the alarm.</p>
pub fn set_alarm_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_alarm_name(input);
self
}
/// Appends an item to `AlarmTypes`.
///
/// To override the contents of this collection use [`set_alarm_types`](Self::set_alarm_types).
///
/// <p>Use this parameter to specify whether you want the operation to return metric alarms or composite alarms. If you omit this parameter, only metric alarms are returned.</p>
pub fn alarm_types(mut self, input: crate::model::AlarmType) -> Self {
self.inner = self.inner.alarm_types(input);
self
}
/// <p>Use this parameter to specify whether you want the operation to return metric alarms or composite alarms. If you omit this parameter, only metric alarms are returned.</p>
pub fn set_alarm_types(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::AlarmType>>,
) -> Self {
self.inner = self.inner.set_alarm_types(input);
self
}
/// <p>The type of alarm histories to retrieve.</p>
pub fn history_item_type(mut self, input: crate::model::HistoryItemType) -> Self {
self.inner = self.inner.history_item_type(input);
self
}
/// <p>The type of alarm histories to retrieve.</p>
pub fn set_history_item_type(
mut self,
input: std::option::Option<crate::model::HistoryItemType>,
) -> Self {
self.inner = self.inner.set_history_item_type(input);
self
}
/// <p>The starting date to retrieve alarm history.</p>
pub fn start_date(mut self, input: aws_smithy_types::DateTime) -> Self {
self.inner = self.inner.start_date(input);
self
}
/// <p>The starting date to retrieve alarm history.</p>
pub fn set_start_date(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.inner = self.inner.set_start_date(input);
self
}
/// <p>The ending date to retrieve alarm history.</p>
pub fn end_date(mut self, input: aws_smithy_types::DateTime) -> Self {
self.inner = self.inner.end_date(input);
self
}
/// <p>The ending date to retrieve alarm history.</p>
pub fn set_end_date(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.inner = self.inner.set_end_date(input);
self
}
/// <p>The maximum number of alarm history records to retrieve.</p>
pub fn max_records(mut self, input: i32) -> Self {
self.inner = self.inner.max_records(input);
self
}
/// <p>The maximum number of alarm history records to retrieve.</p>
pub fn set_max_records(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_max_records(input);
self
}
/// <p>The token returned by a previous call to indicate that there is more data available.</p>
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.next_token(input.into());
self
}
/// <p>The token returned by a previous call to indicate that there is more data available.</p>
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_next_token(input);
self
}
/// <p>Specified whether to return the newest or oldest alarm history first. Specify <code>TimestampDescending</code> to have the newest event history returned first, and specify <code>TimestampAscending</code> to have the oldest history returned first.</p>
pub fn scan_by(mut self, input: crate::model::ScanBy) -> Self {
self.inner = self.inner.scan_by(input);
self
}
/// <p>Specified whether to return the newest or oldest alarm history first. Specify <code>TimestampDescending</code> to have the newest event history returned first, and specify <code>TimestampAscending</code> to have the oldest history returned first.</p>
pub fn set_scan_by(mut self, input: std::option::Option<crate::model::ScanBy>) -> Self {
self.inner = self.inner.set_scan_by(input);
self
}
}
/// Fluent builder constructing a request to `DescribeAlarms`.
///
/// <p>Retrieves the specified alarms. You can filter the results by specifying a prefix for the alarm name, the alarm state, or a prefix for any action.</p>
/// <p>To use this operation and return information about composite alarms, you must be signed on with the <code>cloudwatch:DescribeAlarms</code> permission that is scoped to <code>*</code>. You can't return information about composite alarms if your <code>cloudwatch:DescribeAlarms</code> permission has a narrower scope.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct DescribeAlarms<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::describe_alarms_input::Builder,
}
impl<C, M, R> DescribeAlarms<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `DescribeAlarms`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::DescribeAlarmsOutput,
aws_smithy_http::result::SdkError<crate::error::DescribeAlarmsError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::DescribeAlarmsInputOperationOutputAlias,
crate::output::DescribeAlarmsOutput,
crate::error::DescribeAlarmsError,
crate::input::DescribeAlarmsInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// Create a paginator for this request
///
/// Paginators are used by calling [`send().await`](crate::paginator::DescribeAlarmsPaginator::send) which returns a [`Stream`](tokio_stream::Stream).
pub fn into_paginator(self) -> crate::paginator::DescribeAlarmsPaginator<C, M, R> {
crate::paginator::DescribeAlarmsPaginator::new(self.handle, self.inner)
}
/// Appends an item to `AlarmNames`.
///
/// To override the contents of this collection use [`set_alarm_names`](Self::set_alarm_names).
///
/// <p>The names of the alarms to retrieve information about.</p>
pub fn alarm_names(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.alarm_names(input.into());
self
}
/// <p>The names of the alarms to retrieve information about.</p>
pub fn set_alarm_names(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.inner = self.inner.set_alarm_names(input);
self
}
/// <p>An alarm name prefix. If you specify this parameter, you receive information about all alarms that have names that start with this prefix.</p>
/// <p>If this parameter is specified, you cannot specify <code>AlarmNames</code>.</p>
pub fn alarm_name_prefix(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.alarm_name_prefix(input.into());
self
}
/// <p>An alarm name prefix. If you specify this parameter, you receive information about all alarms that have names that start with this prefix.</p>
/// <p>If this parameter is specified, you cannot specify <code>AlarmNames</code>.</p>
pub fn set_alarm_name_prefix(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_alarm_name_prefix(input);
self
}
/// Appends an item to `AlarmTypes`.
///
/// To override the contents of this collection use [`set_alarm_types`](Self::set_alarm_types).
///
/// <p>Use this parameter to specify whether you want the operation to return metric alarms or composite alarms. If you omit this parameter, only metric alarms are returned.</p>
pub fn alarm_types(mut self, input: crate::model::AlarmType) -> Self {
self.inner = self.inner.alarm_types(input);
self
}
/// <p>Use this parameter to specify whether you want the operation to return metric alarms or composite alarms. If you omit this parameter, only metric alarms are returned.</p>
pub fn set_alarm_types(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::AlarmType>>,
) -> Self {
self.inner = self.inner.set_alarm_types(input);
self
}
/// <p>If you use this parameter and specify the name of a composite alarm, the operation returns information about the "children" alarms of the alarm you specify. These are the metric alarms and composite alarms referenced in the <code>AlarmRule</code> field of the composite alarm that you specify in <code>ChildrenOfAlarmName</code>. Information about the composite alarm that you name in <code>ChildrenOfAlarmName</code> is not returned.</p>
/// <p>If you specify <code>ChildrenOfAlarmName</code>, you cannot specify any other parameters in the request except for <code>MaxRecords</code> and <code>NextToken</code>. If you do so, you receive a validation error.</p> <note>
/// <p>Only the <code>Alarm Name</code>, <code>ARN</code>, <code>StateValue</code> (OK/ALARM/INSUFFICIENT_DATA), and <code>StateUpdatedTimestamp</code> information are returned by this operation when you use this parameter. To get complete information about these alarms, perform another <code>DescribeAlarms</code> operation and specify the parent alarm names in the <code>AlarmNames</code> parameter.</p>
/// </note>
pub fn children_of_alarm_name(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.children_of_alarm_name(input.into());
self
}
/// <p>If you use this parameter and specify the name of a composite alarm, the operation returns information about the "children" alarms of the alarm you specify. These are the metric alarms and composite alarms referenced in the <code>AlarmRule</code> field of the composite alarm that you specify in <code>ChildrenOfAlarmName</code>. Information about the composite alarm that you name in <code>ChildrenOfAlarmName</code> is not returned.</p>
/// <p>If you specify <code>ChildrenOfAlarmName</code>, you cannot specify any other parameters in the request except for <code>MaxRecords</code> and <code>NextToken</code>. If you do so, you receive a validation error.</p> <note>
/// <p>Only the <code>Alarm Name</code>, <code>ARN</code>, <code>StateValue</code> (OK/ALARM/INSUFFICIENT_DATA), and <code>StateUpdatedTimestamp</code> information are returned by this operation when you use this parameter. To get complete information about these alarms, perform another <code>DescribeAlarms</code> operation and specify the parent alarm names in the <code>AlarmNames</code> parameter.</p>
/// </note>
pub fn set_children_of_alarm_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_children_of_alarm_name(input);
self
}
/// <p>If you use this parameter and specify the name of a metric or composite alarm, the operation returns information about the "parent" alarms of the alarm you specify. These are the composite alarms that have <code>AlarmRule</code> parameters that reference the alarm named in <code>ParentsOfAlarmName</code>. Information about the alarm that you specify in <code>ParentsOfAlarmName</code> is not returned.</p>
/// <p>If you specify <code>ParentsOfAlarmName</code>, you cannot specify any other parameters in the request except for <code>MaxRecords</code> and <code>NextToken</code>. If you do so, you receive a validation error.</p> <note>
/// <p>Only the Alarm Name and ARN are returned by this operation when you use this parameter. To get complete information about these alarms, perform another <code>DescribeAlarms</code> operation and specify the parent alarm names in the <code>AlarmNames</code> parameter.</p>
/// </note>
pub fn parents_of_alarm_name(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.parents_of_alarm_name(input.into());
self
}
/// <p>If you use this parameter and specify the name of a metric or composite alarm, the operation returns information about the "parent" alarms of the alarm you specify. These are the composite alarms that have <code>AlarmRule</code> parameters that reference the alarm named in <code>ParentsOfAlarmName</code>. Information about the alarm that you specify in <code>ParentsOfAlarmName</code> is not returned.</p>
/// <p>If you specify <code>ParentsOfAlarmName</code>, you cannot specify any other parameters in the request except for <code>MaxRecords</code> and <code>NextToken</code>. If you do so, you receive a validation error.</p> <note>
/// <p>Only the Alarm Name and ARN are returned by this operation when you use this parameter. To get complete information about these alarms, perform another <code>DescribeAlarms</code> operation and specify the parent alarm names in the <code>AlarmNames</code> parameter.</p>
/// </note>
pub fn set_parents_of_alarm_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_parents_of_alarm_name(input);
self
}
/// <p>Specify this parameter to receive information only about alarms that are currently in the state that you specify.</p>
pub fn state_value(mut self, input: crate::model::StateValue) -> Self {
self.inner = self.inner.state_value(input);
self
}
/// <p>Specify this parameter to receive information only about alarms that are currently in the state that you specify.</p>
pub fn set_state_value(
mut self,
input: std::option::Option<crate::model::StateValue>,
) -> Self {
self.inner = self.inner.set_state_value(input);
self
}
/// <p>Use this parameter to filter the results of the operation to only those alarms that use a certain alarm action. For example, you could specify the ARN of an SNS topic to find all alarms that send notifications to that topic.</p>
pub fn action_prefix(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.action_prefix(input.into());
self
}
/// <p>Use this parameter to filter the results of the operation to only those alarms that use a certain alarm action. For example, you could specify the ARN of an SNS topic to find all alarms that send notifications to that topic.</p>
pub fn set_action_prefix(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_action_prefix(input);
self
}
/// <p>The maximum number of alarm descriptions to retrieve.</p>
pub fn max_records(mut self, input: i32) -> Self {
self.inner = self.inner.max_records(input);
self
}
/// <p>The maximum number of alarm descriptions to retrieve.</p>
pub fn set_max_records(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_max_records(input);
self
}
/// <p>The token returned by a previous call to indicate that there is more data available.</p>
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.next_token(input.into());
self
}
/// <p>The token returned by a previous call to indicate that there is more data available.</p>
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_next_token(input);
self
}
}
/// Fluent builder constructing a request to `DescribeAlarmsForMetric`.
///
/// <p>Retrieves the alarms for the specified metric. To filter the results, specify a statistic, period, or unit.</p>
/// <p>This operation retrieves only standard alarms that are based on the specified metric. It does not return alarms based on math expressions that use the specified metric, or composite alarms that use the specified metric.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct DescribeAlarmsForMetric<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::describe_alarms_for_metric_input::Builder,
}
impl<C, M, R> DescribeAlarmsForMetric<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `DescribeAlarmsForMetric`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::DescribeAlarmsForMetricOutput,
aws_smithy_http::result::SdkError<crate::error::DescribeAlarmsForMetricError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::DescribeAlarmsForMetricInputOperationOutputAlias,
crate::output::DescribeAlarmsForMetricOutput,
crate::error::DescribeAlarmsForMetricError,
crate::input::DescribeAlarmsForMetricInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The name of the metric.</p>
pub fn metric_name(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.metric_name(input.into());
self
}
/// <p>The name of the metric.</p>
pub fn set_metric_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_metric_name(input);
self
}
/// <p>The namespace of the metric.</p>
pub fn namespace(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.namespace(input.into());
self
}
/// <p>The namespace of the metric.</p>
pub fn set_namespace(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_namespace(input);
self
}
/// <p>The statistic for the metric, other than percentiles. For percentile statistics, use <code>ExtendedStatistics</code>.</p>
pub fn statistic(mut self, input: crate::model::Statistic) -> Self {
self.inner = self.inner.statistic(input);
self
}
/// <p>The statistic for the metric, other than percentiles. For percentile statistics, use <code>ExtendedStatistics</code>.</p>
pub fn set_statistic(
mut self,
input: std::option::Option<crate::model::Statistic>,
) -> Self {
self.inner = self.inner.set_statistic(input);
self
}
/// <p>The percentile statistic for the metric. Specify a value between p0.0 and p100.</p>
pub fn extended_statistic(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.extended_statistic(input.into());
self
}
/// <p>The percentile statistic for the metric. Specify a value between p0.0 and p100.</p>
pub fn set_extended_statistic(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_extended_statistic(input);
self
}
/// Appends an item to `Dimensions`.
///
/// To override the contents of this collection use [`set_dimensions`](Self::set_dimensions).
///
/// <p>The dimensions associated with the metric. If the metric has any associated dimensions, you must specify them in order for the call to succeed.</p>
pub fn dimensions(mut self, input: crate::model::Dimension) -> Self {
self.inner = self.inner.dimensions(input);
self
}
/// <p>The dimensions associated with the metric. If the metric has any associated dimensions, you must specify them in order for the call to succeed.</p>
pub fn set_dimensions(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Dimension>>,
) -> Self {
self.inner = self.inner.set_dimensions(input);
self
}
/// <p>The period, in seconds, over which the statistic is applied.</p>
pub fn period(mut self, input: i32) -> Self {
self.inner = self.inner.period(input);
self
}
/// <p>The period, in seconds, over which the statistic is applied.</p>
pub fn set_period(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_period(input);
self
}
/// <p>The unit for the metric.</p>
pub fn unit(mut self, input: crate::model::StandardUnit) -> Self {
self.inner = self.inner.unit(input);
self
}
/// <p>The unit for the metric.</p>
pub fn set_unit(mut self, input: std::option::Option<crate::model::StandardUnit>) -> Self {
self.inner = self.inner.set_unit(input);
self
}
}
/// Fluent builder constructing a request to `DescribeAnomalyDetectors`.
///
/// <p>Lists the anomaly detection models that you have created in your account. For single metric anomaly detectors, you can list all of the models in your account or filter the results to only the models that are related to a certain namespace, metric name, or metric dimension. For metric math anomaly detectors, you can list them by adding <code>METRIC_MATH</code> to the <code>AnomalyDetectorTypes</code> array. This will return all metric math anomaly detectors in your account.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct DescribeAnomalyDetectors<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::describe_anomaly_detectors_input::Builder,
}
impl<C, M, R> DescribeAnomalyDetectors<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `DescribeAnomalyDetectors`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::DescribeAnomalyDetectorsOutput,
aws_smithy_http::result::SdkError<crate::error::DescribeAnomalyDetectorsError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::DescribeAnomalyDetectorsInputOperationOutputAlias,
crate::output::DescribeAnomalyDetectorsOutput,
crate::error::DescribeAnomalyDetectorsError,
crate::input::DescribeAnomalyDetectorsInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>Use the token returned by the previous operation to request the next page of results.</p>
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.next_token(input.into());
self
}
/// <p>Use the token returned by the previous operation to request the next page of results.</p>
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_next_token(input);
self
}
/// <p>The maximum number of results to return in one operation. The maximum value that you can specify is 100.</p>
/// <p>To retrieve the remaining results, make another call with the returned <code>NextToken</code> value. </p>
pub fn max_results(mut self, input: i32) -> Self {
self.inner = self.inner.max_results(input);
self
}
/// <p>The maximum number of results to return in one operation. The maximum value that you can specify is 100.</p>
/// <p>To retrieve the remaining results, make another call with the returned <code>NextToken</code> value. </p>
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_max_results(input);
self
}
/// <p>Limits the results to only the anomaly detection models that are associated with the specified namespace.</p>
pub fn namespace(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.namespace(input.into());
self
}
/// <p>Limits the results to only the anomaly detection models that are associated with the specified namespace.</p>
pub fn set_namespace(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_namespace(input);
self
}
/// <p>Limits the results to only the anomaly detection models that are associated with the specified metric name. If there are multiple metrics with this name in different namespaces that have anomaly detection models, they're all returned.</p>
pub fn metric_name(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.metric_name(input.into());
self
}
/// <p>Limits the results to only the anomaly detection models that are associated with the specified metric name. If there are multiple metrics with this name in different namespaces that have anomaly detection models, they're all returned.</p>
pub fn set_metric_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_metric_name(input);
self
}
/// Appends an item to `Dimensions`.
///
/// To override the contents of this collection use [`set_dimensions`](Self::set_dimensions).
///
/// <p>Limits the results to only the anomaly detection models that are associated with the specified metric dimensions. If there are multiple metrics that have these dimensions and have anomaly detection models associated, they're all returned.</p>
pub fn dimensions(mut self, input: crate::model::Dimension) -> Self {
self.inner = self.inner.dimensions(input);
self
}
/// <p>Limits the results to only the anomaly detection models that are associated with the specified metric dimensions. If there are multiple metrics that have these dimensions and have anomaly detection models associated, they're all returned.</p>
pub fn set_dimensions(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Dimension>>,
) -> Self {
self.inner = self.inner.set_dimensions(input);
self
}
/// Appends an item to `AnomalyDetectorTypes`.
///
/// To override the contents of this collection use [`set_anomaly_detector_types`](Self::set_anomaly_detector_types).
///
/// <p>The anomaly detector types to request when using <code>DescribeAnomalyDetectorsInput</code>. If empty, defaults to <code>SINGLE_METRIC</code>.</p>
pub fn anomaly_detector_types(mut self, input: crate::model::AnomalyDetectorType) -> Self {
self.inner = self.inner.anomaly_detector_types(input);
self
}
/// <p>The anomaly detector types to request when using <code>DescribeAnomalyDetectorsInput</code>. If empty, defaults to <code>SINGLE_METRIC</code>.</p>
pub fn set_anomaly_detector_types(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::AnomalyDetectorType>>,
) -> Self {
self.inner = self.inner.set_anomaly_detector_types(input);
self
}
}
/// Fluent builder constructing a request to `DescribeInsightRules`.
///
/// <p>Returns a list of all the Contributor Insights rules in your account.</p>
/// <p>For more information about Contributor Insights, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ContributorInsights.html">Using Contributor Insights to Analyze High-Cardinality Data</a>.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct DescribeInsightRules<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::describe_insight_rules_input::Builder,
}
impl<C, M, R> DescribeInsightRules<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `DescribeInsightRules`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::DescribeInsightRulesOutput,
aws_smithy_http::result::SdkError<crate::error::DescribeInsightRulesError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::DescribeInsightRulesInputOperationOutputAlias,
crate::output::DescribeInsightRulesOutput,
crate::error::DescribeInsightRulesError,
crate::input::DescribeInsightRulesInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// Create a paginator for this request
///
/// Paginators are used by calling [`send().await`](crate::paginator::DescribeInsightRulesPaginator::send) which returns a [`Stream`](tokio_stream::Stream).
pub fn into_paginator(self) -> crate::paginator::DescribeInsightRulesPaginator<C, M, R> {
crate::paginator::DescribeInsightRulesPaginator::new(self.handle, self.inner)
}
/// <p>Include this value, if it was returned by the previous operation, to get the next set of rules.</p>
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.next_token(input.into());
self
}
/// <p>Include this value, if it was returned by the previous operation, to get the next set of rules.</p>
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_next_token(input);
self
}
/// <p>The maximum number of results to return in one operation. If you omit this parameter, the default of 500 is used.</p>
pub fn max_results(mut self, input: i32) -> Self {
self.inner = self.inner.max_results(input);
self
}
/// <p>The maximum number of results to return in one operation. If you omit this parameter, the default of 500 is used.</p>
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_max_results(input);
self
}
}
/// Fluent builder constructing a request to `DisableAlarmActions`.
///
/// <p>Disables the actions for the specified alarms. When an alarm's actions are disabled, the alarm actions do not execute when the alarm state changes.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct DisableAlarmActions<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::disable_alarm_actions_input::Builder,
}
impl<C, M, R> DisableAlarmActions<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `DisableAlarmActions`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::DisableAlarmActionsOutput,
aws_smithy_http::result::SdkError<crate::error::DisableAlarmActionsError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::DisableAlarmActionsInputOperationOutputAlias,
crate::output::DisableAlarmActionsOutput,
crate::error::DisableAlarmActionsError,
crate::input::DisableAlarmActionsInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// Appends an item to `AlarmNames`.
///
/// To override the contents of this collection use [`set_alarm_names`](Self::set_alarm_names).
///
/// <p>The names of the alarms.</p>
pub fn alarm_names(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.alarm_names(input.into());
self
}
/// <p>The names of the alarms.</p>
pub fn set_alarm_names(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.inner = self.inner.set_alarm_names(input);
self
}
}
/// Fluent builder constructing a request to `DisableInsightRules`.
///
/// <p>Disables the specified Contributor Insights rules. When rules are disabled, they do not analyze log groups and do not incur costs.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct DisableInsightRules<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::disable_insight_rules_input::Builder,
}
impl<C, M, R> DisableInsightRules<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `DisableInsightRules`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::DisableInsightRulesOutput,
aws_smithy_http::result::SdkError<crate::error::DisableInsightRulesError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::DisableInsightRulesInputOperationOutputAlias,
crate::output::DisableInsightRulesOutput,
crate::error::DisableInsightRulesError,
crate::input::DisableInsightRulesInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// Appends an item to `RuleNames`.
///
/// To override the contents of this collection use [`set_rule_names`](Self::set_rule_names).
///
/// <p>An array of the rule names to disable. If you need to find out the names of your rules, use <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeInsightRules.html">DescribeInsightRules</a>.</p>
pub fn rule_names(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.rule_names(input.into());
self
}
/// <p>An array of the rule names to disable. If you need to find out the names of your rules, use <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeInsightRules.html">DescribeInsightRules</a>.</p>
pub fn set_rule_names(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.inner = self.inner.set_rule_names(input);
self
}
}
/// Fluent builder constructing a request to `EnableAlarmActions`.
///
/// <p>Enables the actions for the specified alarms.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct EnableAlarmActions<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::enable_alarm_actions_input::Builder,
}
impl<C, M, R> EnableAlarmActions<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `EnableAlarmActions`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::EnableAlarmActionsOutput,
aws_smithy_http::result::SdkError<crate::error::EnableAlarmActionsError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::EnableAlarmActionsInputOperationOutputAlias,
crate::output::EnableAlarmActionsOutput,
crate::error::EnableAlarmActionsError,
crate::input::EnableAlarmActionsInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// Appends an item to `AlarmNames`.
///
/// To override the contents of this collection use [`set_alarm_names`](Self::set_alarm_names).
///
/// <p>The names of the alarms.</p>
pub fn alarm_names(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.alarm_names(input.into());
self
}
/// <p>The names of the alarms.</p>
pub fn set_alarm_names(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.inner = self.inner.set_alarm_names(input);
self
}
}
/// Fluent builder constructing a request to `EnableInsightRules`.
///
/// <p>Enables the specified Contributor Insights rules. When rules are enabled, they immediately begin analyzing log data.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct EnableInsightRules<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::enable_insight_rules_input::Builder,
}
impl<C, M, R> EnableInsightRules<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `EnableInsightRules`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::EnableInsightRulesOutput,
aws_smithy_http::result::SdkError<crate::error::EnableInsightRulesError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::EnableInsightRulesInputOperationOutputAlias,
crate::output::EnableInsightRulesOutput,
crate::error::EnableInsightRulesError,
crate::input::EnableInsightRulesInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// Appends an item to `RuleNames`.
///
/// To override the contents of this collection use [`set_rule_names`](Self::set_rule_names).
///
/// <p>An array of the rule names to enable. If you need to find out the names of your rules, use <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeInsightRules.html">DescribeInsightRules</a>.</p>
pub fn rule_names(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.rule_names(input.into());
self
}
/// <p>An array of the rule names to enable. If you need to find out the names of your rules, use <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeInsightRules.html">DescribeInsightRules</a>.</p>
pub fn set_rule_names(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.inner = self.inner.set_rule_names(input);
self
}
}
/// Fluent builder constructing a request to `GetDashboard`.
///
/// <p>Displays the details of the dashboard that you specify.</p>
/// <p>To copy an existing dashboard, use <code>GetDashboard</code>, and then use the data returned within <code>DashboardBody</code> as the template for the new dashboard when you call <code>PutDashboard</code> to create the copy.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct GetDashboard<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::get_dashboard_input::Builder,
}
impl<C, M, R> GetDashboard<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `GetDashboard`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::GetDashboardOutput,
aws_smithy_http::result::SdkError<crate::error::GetDashboardError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::GetDashboardInputOperationOutputAlias,
crate::output::GetDashboardOutput,
crate::error::GetDashboardError,
crate::input::GetDashboardInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The name of the dashboard to be described.</p>
pub fn dashboard_name(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.dashboard_name(input.into());
self
}
/// <p>The name of the dashboard to be described.</p>
pub fn set_dashboard_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_dashboard_name(input);
self
}
}
/// Fluent builder constructing a request to `GetInsightRuleReport`.
///
/// <p>This operation returns the time series data collected by a Contributor Insights rule. The data includes the identity and number of contributors to the log group.</p>
/// <p>You can also optionally return one or more statistics about each data point in the time series. These statistics can include the following:</p>
/// <ul>
/// <li> <p> <code>UniqueContributors</code> -- the number of unique contributors for each data point.</p> </li>
/// <li> <p> <code>MaxContributorValue</code> -- the value of the top contributor for each data point. The identity of the contributor might change for each data point in the graph.</p> <p>If this rule aggregates by COUNT, the top contributor for each data point is the contributor with the most occurrences in that period. If the rule aggregates by SUM, the top contributor is the contributor with the highest sum in the log field specified by the rule's <code>Value</code>, during that period.</p> </li>
/// <li> <p> <code>SampleCount</code> -- the number of data points matched by the rule.</p> </li>
/// <li> <p> <code>Sum</code> -- the sum of the values from all contributors during the time period represented by that data point.</p> </li>
/// <li> <p> <code>Minimum</code> -- the minimum value from a single observation during the time period represented by that data point.</p> </li>
/// <li> <p> <code>Maximum</code> -- the maximum value from a single observation during the time period represented by that data point.</p> </li>
/// <li> <p> <code>Average</code> -- the average value from all contributors during the time period represented by that data point.</p> </li>
/// </ul>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct GetInsightRuleReport<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::get_insight_rule_report_input::Builder,
}
impl<C, M, R> GetInsightRuleReport<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `GetInsightRuleReport`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::GetInsightRuleReportOutput,
aws_smithy_http::result::SdkError<crate::error::GetInsightRuleReportError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::GetInsightRuleReportInputOperationOutputAlias,
crate::output::GetInsightRuleReportOutput,
crate::error::GetInsightRuleReportError,
crate::input::GetInsightRuleReportInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The name of the rule that you want to see data from.</p>
pub fn rule_name(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.rule_name(input.into());
self
}
/// <p>The name of the rule that you want to see data from.</p>
pub fn set_rule_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_rule_name(input);
self
}
/// <p>The start time of the data to use in the report. When used in a raw HTTP Query API, it is formatted as <code>yyyy-MM-dd'T'HH:mm:ss</code>. For example, <code>2019-07-01T23:59:59</code>.</p>
pub fn start_time(mut self, input: aws_smithy_types::DateTime) -> Self {
self.inner = self.inner.start_time(input);
self
}
/// <p>The start time of the data to use in the report. When used in a raw HTTP Query API, it is formatted as <code>yyyy-MM-dd'T'HH:mm:ss</code>. For example, <code>2019-07-01T23:59:59</code>.</p>
pub fn set_start_time(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.inner = self.inner.set_start_time(input);
self
}
/// <p>The end time of the data to use in the report. When used in a raw HTTP Query API, it is formatted as <code>yyyy-MM-dd'T'HH:mm:ss</code>. For example, <code>2019-07-01T23:59:59</code>.</p>
pub fn end_time(mut self, input: aws_smithy_types::DateTime) -> Self {
self.inner = self.inner.end_time(input);
self
}
/// <p>The end time of the data to use in the report. When used in a raw HTTP Query API, it is formatted as <code>yyyy-MM-dd'T'HH:mm:ss</code>. For example, <code>2019-07-01T23:59:59</code>.</p>
pub fn set_end_time(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.inner = self.inner.set_end_time(input);
self
}
/// <p>The period, in seconds, to use for the statistics in the <code>InsightRuleMetricDatapoint</code> results.</p>
pub fn period(mut self, input: i32) -> Self {
self.inner = self.inner.period(input);
self
}
/// <p>The period, in seconds, to use for the statistics in the <code>InsightRuleMetricDatapoint</code> results.</p>
pub fn set_period(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_period(input);
self
}
/// <p>The maximum number of contributors to include in the report. The range is 1 to 100. If you omit this, the default of 10 is used.</p>
pub fn max_contributor_count(mut self, input: i32) -> Self {
self.inner = self.inner.max_contributor_count(input);
self
}
/// <p>The maximum number of contributors to include in the report. The range is 1 to 100. If you omit this, the default of 10 is used.</p>
pub fn set_max_contributor_count(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_max_contributor_count(input);
self
}
/// Appends an item to `Metrics`.
///
/// To override the contents of this collection use [`set_metrics`](Self::set_metrics).
///
/// <p>Specifies which metrics to use for aggregation of contributor values for the report. You can specify one or more of the following metrics:</p>
/// <ul>
/// <li> <p> <code>UniqueContributors</code> -- the number of unique contributors for each data point.</p> </li>
/// <li> <p> <code>MaxContributorValue</code> -- the value of the top contributor for each data point. The identity of the contributor might change for each data point in the graph.</p> <p>If this rule aggregates by COUNT, the top contributor for each data point is the contributor with the most occurrences in that period. If the rule aggregates by SUM, the top contributor is the contributor with the highest sum in the log field specified by the rule's <code>Value</code>, during that period.</p> </li>
/// <li> <p> <code>SampleCount</code> -- the number of data points matched by the rule.</p> </li>
/// <li> <p> <code>Sum</code> -- the sum of the values from all contributors during the time period represented by that data point.</p> </li>
/// <li> <p> <code>Minimum</code> -- the minimum value from a single observation during the time period represented by that data point.</p> </li>
/// <li> <p> <code>Maximum</code> -- the maximum value from a single observation during the time period represented by that data point.</p> </li>
/// <li> <p> <code>Average</code> -- the average value from all contributors during the time period represented by that data point.</p> </li>
/// </ul>
pub fn metrics(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.metrics(input.into());
self
}
/// <p>Specifies which metrics to use for aggregation of contributor values for the report. You can specify one or more of the following metrics:</p>
/// <ul>
/// <li> <p> <code>UniqueContributors</code> -- the number of unique contributors for each data point.</p> </li>
/// <li> <p> <code>MaxContributorValue</code> -- the value of the top contributor for each data point. The identity of the contributor might change for each data point in the graph.</p> <p>If this rule aggregates by COUNT, the top contributor for each data point is the contributor with the most occurrences in that period. If the rule aggregates by SUM, the top contributor is the contributor with the highest sum in the log field specified by the rule's <code>Value</code>, during that period.</p> </li>
/// <li> <p> <code>SampleCount</code> -- the number of data points matched by the rule.</p> </li>
/// <li> <p> <code>Sum</code> -- the sum of the values from all contributors during the time period represented by that data point.</p> </li>
/// <li> <p> <code>Minimum</code> -- the minimum value from a single observation during the time period represented by that data point.</p> </li>
/// <li> <p> <code>Maximum</code> -- the maximum value from a single observation during the time period represented by that data point.</p> </li>
/// <li> <p> <code>Average</code> -- the average value from all contributors during the time period represented by that data point.</p> </li>
/// </ul>
pub fn set_metrics(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.inner = self.inner.set_metrics(input);
self
}
/// <p>Determines what statistic to use to rank the contributors. Valid values are SUM and MAXIMUM.</p>
pub fn order_by(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.order_by(input.into());
self
}
/// <p>Determines what statistic to use to rank the contributors. Valid values are SUM and MAXIMUM.</p>
pub fn set_order_by(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_order_by(input);
self
}
}
/// Fluent builder constructing a request to `GetMetricData`.
///
/// <p>You can use the <code>GetMetricData</code> API to retrieve as many as 500 different metrics in a single request, with a total of as many as 100,800 data points. You can also optionally perform math expressions on the values of the returned statistics, to create new time series that represent new insights into your data. For example, using Lambda metrics, you could divide the Errors metric by the Invocations metric to get an error rate time series. For more information about metric math expressions, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html#metric-math-syntax">Metric Math Syntax and Functions</a> in the <i>Amazon CloudWatch User Guide</i>.</p>
/// <p>Calls to the <code>GetMetricData</code> API have a different pricing structure than calls to <code>GetMetricStatistics</code>. For more information about pricing, see <a href="https://aws.amazon.com/cloudwatch/pricing/">Amazon CloudWatch Pricing</a>.</p>
/// <p>Amazon CloudWatch retains metric data as follows:</p>
/// <ul>
/// <li> <p>Data points with a period of less than 60 seconds are available for 3 hours. These data points are high-resolution metrics and are available only for custom metrics that have been defined with a <code>StorageResolution</code> of 1.</p> </li>
/// <li> <p>Data points with a period of 60 seconds (1-minute) are available for 15 days.</p> </li>
/// <li> <p>Data points with a period of 300 seconds (5-minute) are available for 63 days.</p> </li>
/// <li> <p>Data points with a period of 3600 seconds (1 hour) are available for 455 days (15 months).</p> </li>
/// </ul>
/// <p>Data points that are initially published with a shorter period are aggregated together for long-term storage. For example, if you collect data using a period of 1 minute, the data remains available for 15 days with 1-minute resolution. After 15 days, this data is still available, but is aggregated and retrievable only with a resolution of 5 minutes. After 63 days, the data is further aggregated and is available with a resolution of 1 hour.</p>
/// <p>If you omit <code>Unit</code> in your request, all data that was collected with any unit is returned, along with the corresponding units that were specified when the data was reported to CloudWatch. If you specify a unit, the operation returns only data that was collected with that unit specified. If you specify a unit that does not match the data collected, the results of the operation are null. CloudWatch does not perform unit conversions.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct GetMetricData<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::get_metric_data_input::Builder,
}
impl<C, M, R> GetMetricData<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `GetMetricData`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::GetMetricDataOutput,
aws_smithy_http::result::SdkError<crate::error::GetMetricDataError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::GetMetricDataInputOperationOutputAlias,
crate::output::GetMetricDataOutput,
crate::error::GetMetricDataError,
crate::input::GetMetricDataInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// Create a paginator for this request
///
/// Paginators are used by calling [`send().await`](crate::paginator::GetMetricDataPaginator::send) which returns a [`Stream`](tokio_stream::Stream).
pub fn into_paginator(self) -> crate::paginator::GetMetricDataPaginator<C, M, R> {
crate::paginator::GetMetricDataPaginator::new(self.handle, self.inner)
}
/// Appends an item to `MetricDataQueries`.
///
/// To override the contents of this collection use [`set_metric_data_queries`](Self::set_metric_data_queries).
///
/// <p>The metric queries to be returned. A single <code>GetMetricData</code> call can include as many as 500 <code>MetricDataQuery</code> structures. Each of these structures can specify either a metric to retrieve, or a math expression to perform on retrieved data. </p>
pub fn metric_data_queries(mut self, input: crate::model::MetricDataQuery) -> Self {
self.inner = self.inner.metric_data_queries(input);
self
}
/// <p>The metric queries to be returned. A single <code>GetMetricData</code> call can include as many as 500 <code>MetricDataQuery</code> structures. Each of these structures can specify either a metric to retrieve, or a math expression to perform on retrieved data. </p>
pub fn set_metric_data_queries(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::MetricDataQuery>>,
) -> Self {
self.inner = self.inner.set_metric_data_queries(input);
self
}
/// <p>The time stamp indicating the earliest data to be returned.</p>
/// <p>The value specified is inclusive; results include data points with the specified time stamp. </p>
/// <p>CloudWatch rounds the specified time stamp as follows:</p>
/// <ul>
/// <li> <p>Start time less than 15 days ago - Round down to the nearest whole minute. For example, 12:32:34 is rounded down to 12:32:00.</p> </li>
/// <li> <p>Start time between 15 and 63 days ago - Round down to the nearest 5-minute clock interval. For example, 12:32:34 is rounded down to 12:30:00.</p> </li>
/// <li> <p>Start time greater than 63 days ago - Round down to the nearest 1-hour clock interval. For example, 12:32:34 is rounded down to 12:00:00.</p> </li>
/// </ul>
/// <p>If you set <code>Period</code> to 5, 10, or 30, the start time of your request is rounded down to the nearest time that corresponds to even 5-, 10-, or 30-second divisions of a minute. For example, if you make a query at (HH:mm:ss) 01:05:23 for the previous 10-second period, the start time of your request is rounded down and you receive data from 01:05:10 to 01:05:20. If you make a query at 15:07:17 for the previous 5 minutes of data, using a period of 5 seconds, you receive data timestamped between 15:02:15 and 15:07:15. </p>
/// <p>For better performance, specify <code>StartTime</code> and <code>EndTime</code> values that align with the value of the metric's <code>Period</code> and sync up with the beginning and end of an hour. For example, if the <code>Period</code> of a metric is 5 minutes, specifying 12:05 or 12:30 as <code>StartTime</code> can get a faster response from CloudWatch than setting 12:07 or 12:29 as the <code>StartTime</code>.</p>
pub fn start_time(mut self, input: aws_smithy_types::DateTime) -> Self {
self.inner = self.inner.start_time(input);
self
}
/// <p>The time stamp indicating the earliest data to be returned.</p>
/// <p>The value specified is inclusive; results include data points with the specified time stamp. </p>
/// <p>CloudWatch rounds the specified time stamp as follows:</p>
/// <ul>
/// <li> <p>Start time less than 15 days ago - Round down to the nearest whole minute. For example, 12:32:34 is rounded down to 12:32:00.</p> </li>
/// <li> <p>Start time between 15 and 63 days ago - Round down to the nearest 5-minute clock interval. For example, 12:32:34 is rounded down to 12:30:00.</p> </li>
/// <li> <p>Start time greater than 63 days ago - Round down to the nearest 1-hour clock interval. For example, 12:32:34 is rounded down to 12:00:00.</p> </li>
/// </ul>
/// <p>If you set <code>Period</code> to 5, 10, or 30, the start time of your request is rounded down to the nearest time that corresponds to even 5-, 10-, or 30-second divisions of a minute. For example, if you make a query at (HH:mm:ss) 01:05:23 for the previous 10-second period, the start time of your request is rounded down and you receive data from 01:05:10 to 01:05:20. If you make a query at 15:07:17 for the previous 5 minutes of data, using a period of 5 seconds, you receive data timestamped between 15:02:15 and 15:07:15. </p>
/// <p>For better performance, specify <code>StartTime</code> and <code>EndTime</code> values that align with the value of the metric's <code>Period</code> and sync up with the beginning and end of an hour. For example, if the <code>Period</code> of a metric is 5 minutes, specifying 12:05 or 12:30 as <code>StartTime</code> can get a faster response from CloudWatch than setting 12:07 or 12:29 as the <code>StartTime</code>.</p>
pub fn set_start_time(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.inner = self.inner.set_start_time(input);
self
}
/// <p>The time stamp indicating the latest data to be returned.</p>
/// <p>The value specified is exclusive; results include data points up to the specified time stamp.</p>
/// <p>For better performance, specify <code>StartTime</code> and <code>EndTime</code> values that align with the value of the metric's <code>Period</code> and sync up with the beginning and end of an hour. For example, if the <code>Period</code> of a metric is 5 minutes, specifying 12:05 or 12:30 as <code>EndTime</code> can get a faster response from CloudWatch than setting 12:07 or 12:29 as the <code>EndTime</code>.</p>
pub fn end_time(mut self, input: aws_smithy_types::DateTime) -> Self {
self.inner = self.inner.end_time(input);
self
}
/// <p>The time stamp indicating the latest data to be returned.</p>
/// <p>The value specified is exclusive; results include data points up to the specified time stamp.</p>
/// <p>For better performance, specify <code>StartTime</code> and <code>EndTime</code> values that align with the value of the metric's <code>Period</code> and sync up with the beginning and end of an hour. For example, if the <code>Period</code> of a metric is 5 minutes, specifying 12:05 or 12:30 as <code>EndTime</code> can get a faster response from CloudWatch than setting 12:07 or 12:29 as the <code>EndTime</code>.</p>
pub fn set_end_time(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.inner = self.inner.set_end_time(input);
self
}
/// <p>Include this value, if it was returned by the previous <code>GetMetricData</code> operation, to get the next set of data points.</p>
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.next_token(input.into());
self
}
/// <p>Include this value, if it was returned by the previous <code>GetMetricData</code> operation, to get the next set of data points.</p>
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_next_token(input);
self
}
/// <p>The order in which data points should be returned. <code>TimestampDescending</code> returns the newest data first and paginates when the <code>MaxDatapoints</code> limit is reached. <code>TimestampAscending</code> returns the oldest data first and paginates when the <code>MaxDatapoints</code> limit is reached.</p>
pub fn scan_by(mut self, input: crate::model::ScanBy) -> Self {
self.inner = self.inner.scan_by(input);
self
}
/// <p>The order in which data points should be returned. <code>TimestampDescending</code> returns the newest data first and paginates when the <code>MaxDatapoints</code> limit is reached. <code>TimestampAscending</code> returns the oldest data first and paginates when the <code>MaxDatapoints</code> limit is reached.</p>
pub fn set_scan_by(mut self, input: std::option::Option<crate::model::ScanBy>) -> Self {
self.inner = self.inner.set_scan_by(input);
self
}
/// <p>The maximum number of data points the request should return before paginating. If you omit this, the default of 100,800 is used.</p>
pub fn max_datapoints(mut self, input: i32) -> Self {
self.inner = self.inner.max_datapoints(input);
self
}
/// <p>The maximum number of data points the request should return before paginating. If you omit this, the default of 100,800 is used.</p>
pub fn set_max_datapoints(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_max_datapoints(input);
self
}
/// <p>This structure includes the <code>Timezone</code> parameter, which you can use to specify your time zone so that the labels of returned data display the correct time for your time zone. </p>
pub fn label_options(mut self, input: crate::model::LabelOptions) -> Self {
self.inner = self.inner.label_options(input);
self
}
/// <p>This structure includes the <code>Timezone</code> parameter, which you can use to specify your time zone so that the labels of returned data display the correct time for your time zone. </p>
pub fn set_label_options(
mut self,
input: std::option::Option<crate::model::LabelOptions>,
) -> Self {
self.inner = self.inner.set_label_options(input);
self
}
}
/// Fluent builder constructing a request to `GetMetricStatistics`.
///
/// <p>Gets statistics for the specified metric.</p>
/// <p>The maximum number of data points returned from a single call is 1,440. If you request more than 1,440 data points, CloudWatch returns an error. To reduce the number of data points, you can narrow the specified time range and make multiple requests across adjacent time ranges, or you can increase the specified period. Data points are not returned in chronological order.</p>
/// <p>CloudWatch aggregates data points based on the length of the period that you specify. For example, if you request statistics with a one-hour period, CloudWatch aggregates all data points with time stamps that fall within each one-hour period. Therefore, the number of values aggregated by CloudWatch is larger than the number of data points returned.</p>
/// <p>CloudWatch needs raw data points to calculate percentile statistics. If you publish data using a statistic set instead, you can only retrieve percentile statistics for this data if one of the following conditions is true:</p>
/// <ul>
/// <li> <p>The SampleCount value of the statistic set is 1.</p> </li>
/// <li> <p>The Min and the Max values of the statistic set are equal.</p> </li>
/// </ul>
/// <p>Percentile statistics are not available for metrics when any of the metric values are negative numbers.</p>
/// <p>Amazon CloudWatch retains metric data as follows:</p>
/// <ul>
/// <li> <p>Data points with a period of less than 60 seconds are available for 3 hours. These data points are high-resolution metrics and are available only for custom metrics that have been defined with a <code>StorageResolution</code> of 1.</p> </li>
/// <li> <p>Data points with a period of 60 seconds (1-minute) are available for 15 days.</p> </li>
/// <li> <p>Data points with a period of 300 seconds (5-minute) are available for 63 days.</p> </li>
/// <li> <p>Data points with a period of 3600 seconds (1 hour) are available for 455 days (15 months).</p> </li>
/// </ul>
/// <p>Data points that are initially published with a shorter period are aggregated together for long-term storage. For example, if you collect data using a period of 1 minute, the data remains available for 15 days with 1-minute resolution. After 15 days, this data is still available, but is aggregated and retrievable only with a resolution of 5 minutes. After 63 days, the data is further aggregated and is available with a resolution of 1 hour.</p>
/// <p>CloudWatch started retaining 5-minute and 1-hour metric data as of July 9, 2016.</p>
/// <p>For information about metrics and dimensions supported by Amazon Web Services services, see the <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CW_Support_For_AWS.html">Amazon CloudWatch Metrics and Dimensions Reference</a> in the <i>Amazon CloudWatch User Guide</i>.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct GetMetricStatistics<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::get_metric_statistics_input::Builder,
}
impl<C, M, R> GetMetricStatistics<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `GetMetricStatistics`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::GetMetricStatisticsOutput,
aws_smithy_http::result::SdkError<crate::error::GetMetricStatisticsError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::GetMetricStatisticsInputOperationOutputAlias,
crate::output::GetMetricStatisticsOutput,
crate::error::GetMetricStatisticsError,
crate::input::GetMetricStatisticsInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The namespace of the metric, with or without spaces.</p>
pub fn namespace(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.namespace(input.into());
self
}
/// <p>The namespace of the metric, with or without spaces.</p>
pub fn set_namespace(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_namespace(input);
self
}
/// <p>The name of the metric, with or without spaces.</p>
pub fn metric_name(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.metric_name(input.into());
self
}
/// <p>The name of the metric, with or without spaces.</p>
pub fn set_metric_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_metric_name(input);
self
}
/// Appends an item to `Dimensions`.
///
/// To override the contents of this collection use [`set_dimensions`](Self::set_dimensions).
///
/// <p>The dimensions. If the metric contains multiple dimensions, you must include a value for each dimension. CloudWatch treats each unique combination of dimensions as a separate metric. If a specific combination of dimensions was not published, you can't retrieve statistics for it. You must specify the same dimensions that were used when the metrics were created. For an example, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#dimension-combinations">Dimension Combinations</a> in the <i>Amazon CloudWatch User Guide</i>. For more information about specifying dimensions, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/publishingMetrics.html">Publishing Metrics</a> in the <i>Amazon CloudWatch User Guide</i>.</p>
pub fn dimensions(mut self, input: crate::model::Dimension) -> Self {
self.inner = self.inner.dimensions(input);
self
}
/// <p>The dimensions. If the metric contains multiple dimensions, you must include a value for each dimension. CloudWatch treats each unique combination of dimensions as a separate metric. If a specific combination of dimensions was not published, you can't retrieve statistics for it. You must specify the same dimensions that were used when the metrics were created. For an example, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#dimension-combinations">Dimension Combinations</a> in the <i>Amazon CloudWatch User Guide</i>. For more information about specifying dimensions, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/publishingMetrics.html">Publishing Metrics</a> in the <i>Amazon CloudWatch User Guide</i>.</p>
pub fn set_dimensions(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Dimension>>,
) -> Self {
self.inner = self.inner.set_dimensions(input);
self
}
/// <p>The time stamp that determines the first data point to return. Start times are evaluated relative to the time that CloudWatch receives the request.</p>
/// <p>The value specified is inclusive; results include data points with the specified time stamp. In a raw HTTP query, the time stamp must be in ISO 8601 UTC format (for example, 2016-10-03T23:00:00Z).</p>
/// <p>CloudWatch rounds the specified time stamp as follows:</p>
/// <ul>
/// <li> <p>Start time less than 15 days ago - Round down to the nearest whole minute. For example, 12:32:34 is rounded down to 12:32:00.</p> </li>
/// <li> <p>Start time between 15 and 63 days ago - Round down to the nearest 5-minute clock interval. For example, 12:32:34 is rounded down to 12:30:00.</p> </li>
/// <li> <p>Start time greater than 63 days ago - Round down to the nearest 1-hour clock interval. For example, 12:32:34 is rounded down to 12:00:00.</p> </li>
/// </ul>
/// <p>If you set <code>Period</code> to 5, 10, or 30, the start time of your request is rounded down to the nearest time that corresponds to even 5-, 10-, or 30-second divisions of a minute. For example, if you make a query at (HH:mm:ss) 01:05:23 for the previous 10-second period, the start time of your request is rounded down and you receive data from 01:05:10 to 01:05:20. If you make a query at 15:07:17 for the previous 5 minutes of data, using a period of 5 seconds, you receive data timestamped between 15:02:15 and 15:07:15. </p>
pub fn start_time(mut self, input: aws_smithy_types::DateTime) -> Self {
self.inner = self.inner.start_time(input);
self
}
/// <p>The time stamp that determines the first data point to return. Start times are evaluated relative to the time that CloudWatch receives the request.</p>
/// <p>The value specified is inclusive; results include data points with the specified time stamp. In a raw HTTP query, the time stamp must be in ISO 8601 UTC format (for example, 2016-10-03T23:00:00Z).</p>
/// <p>CloudWatch rounds the specified time stamp as follows:</p>
/// <ul>
/// <li> <p>Start time less than 15 days ago - Round down to the nearest whole minute. For example, 12:32:34 is rounded down to 12:32:00.</p> </li>
/// <li> <p>Start time between 15 and 63 days ago - Round down to the nearest 5-minute clock interval. For example, 12:32:34 is rounded down to 12:30:00.</p> </li>
/// <li> <p>Start time greater than 63 days ago - Round down to the nearest 1-hour clock interval. For example, 12:32:34 is rounded down to 12:00:00.</p> </li>
/// </ul>
/// <p>If you set <code>Period</code> to 5, 10, or 30, the start time of your request is rounded down to the nearest time that corresponds to even 5-, 10-, or 30-second divisions of a minute. For example, if you make a query at (HH:mm:ss) 01:05:23 for the previous 10-second period, the start time of your request is rounded down and you receive data from 01:05:10 to 01:05:20. If you make a query at 15:07:17 for the previous 5 minutes of data, using a period of 5 seconds, you receive data timestamped between 15:02:15 and 15:07:15. </p>
pub fn set_start_time(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.inner = self.inner.set_start_time(input);
self
}
/// <p>The time stamp that determines the last data point to return.</p>
/// <p>The value specified is exclusive; results include data points up to the specified time stamp. In a raw HTTP query, the time stamp must be in ISO 8601 UTC format (for example, 2016-10-10T23:00:00Z).</p>
pub fn end_time(mut self, input: aws_smithy_types::DateTime) -> Self {
self.inner = self.inner.end_time(input);
self
}
/// <p>The time stamp that determines the last data point to return.</p>
/// <p>The value specified is exclusive; results include data points up to the specified time stamp. In a raw HTTP query, the time stamp must be in ISO 8601 UTC format (for example, 2016-10-10T23:00:00Z).</p>
pub fn set_end_time(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.inner = self.inner.set_end_time(input);
self
}
/// <p>The granularity, in seconds, of the returned data points. For metrics with regular resolution, a period can be as short as one minute (60 seconds) and must be a multiple of 60. For high-resolution metrics that are collected at intervals of less than one minute, the period can be 1, 5, 10, 30, 60, or any multiple of 60. High-resolution metrics are those metrics stored by a <code>PutMetricData</code> call that includes a <code>StorageResolution</code> of 1 second.</p>
/// <p>If the <code>StartTime</code> parameter specifies a time stamp that is greater than 3 hours ago, you must specify the period as follows or no data points in that time range is returned:</p>
/// <ul>
/// <li> <p>Start time between 3 hours and 15 days ago - Use a multiple of 60 seconds (1 minute).</p> </li>
/// <li> <p>Start time between 15 and 63 days ago - Use a multiple of 300 seconds (5 minutes).</p> </li>
/// <li> <p>Start time greater than 63 days ago - Use a multiple of 3600 seconds (1 hour).</p> </li>
/// </ul>
pub fn period(mut self, input: i32) -> Self {
self.inner = self.inner.period(input);
self
}
/// <p>The granularity, in seconds, of the returned data points. For metrics with regular resolution, a period can be as short as one minute (60 seconds) and must be a multiple of 60. For high-resolution metrics that are collected at intervals of less than one minute, the period can be 1, 5, 10, 30, 60, or any multiple of 60. High-resolution metrics are those metrics stored by a <code>PutMetricData</code> call that includes a <code>StorageResolution</code> of 1 second.</p>
/// <p>If the <code>StartTime</code> parameter specifies a time stamp that is greater than 3 hours ago, you must specify the period as follows or no data points in that time range is returned:</p>
/// <ul>
/// <li> <p>Start time between 3 hours and 15 days ago - Use a multiple of 60 seconds (1 minute).</p> </li>
/// <li> <p>Start time between 15 and 63 days ago - Use a multiple of 300 seconds (5 minutes).</p> </li>
/// <li> <p>Start time greater than 63 days ago - Use a multiple of 3600 seconds (1 hour).</p> </li>
/// </ul>
pub fn set_period(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_period(input);
self
}
/// Appends an item to `Statistics`.
///
/// To override the contents of this collection use [`set_statistics`](Self::set_statistics).
///
/// <p>The metric statistics, other than percentile. For percentile statistics, use <code>ExtendedStatistics</code>. When calling <code>GetMetricStatistics</code>, you must specify either <code>Statistics</code> or <code>ExtendedStatistics</code>, but not both.</p>
pub fn statistics(mut self, input: crate::model::Statistic) -> Self {
self.inner = self.inner.statistics(input);
self
}
/// <p>The metric statistics, other than percentile. For percentile statistics, use <code>ExtendedStatistics</code>. When calling <code>GetMetricStatistics</code>, you must specify either <code>Statistics</code> or <code>ExtendedStatistics</code>, but not both.</p>
pub fn set_statistics(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Statistic>>,
) -> Self {
self.inner = self.inner.set_statistics(input);
self
}
/// Appends an item to `ExtendedStatistics`.
///
/// To override the contents of this collection use [`set_extended_statistics`](Self::set_extended_statistics).
///
/// <p>The percentile statistics. Specify values between p0.0 and p100. When calling <code>GetMetricStatistics</code>, you must specify either <code>Statistics</code> or <code>ExtendedStatistics</code>, but not both. Percentile statistics are not available for metrics when any of the metric values are negative numbers.</p>
pub fn extended_statistics(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.extended_statistics(input.into());
self
}
/// <p>The percentile statistics. Specify values between p0.0 and p100. When calling <code>GetMetricStatistics</code>, you must specify either <code>Statistics</code> or <code>ExtendedStatistics</code>, but not both. Percentile statistics are not available for metrics when any of the metric values are negative numbers.</p>
pub fn set_extended_statistics(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.inner = self.inner.set_extended_statistics(input);
self
}
/// <p>The unit for a given metric. If you omit <code>Unit</code>, all data that was collected with any unit is returned, along with the corresponding units that were specified when the data was reported to CloudWatch. If you specify a unit, the operation returns only data that was collected with that unit specified. If you specify a unit that does not match the data collected, the results of the operation are null. CloudWatch does not perform unit conversions.</p>
pub fn unit(mut self, input: crate::model::StandardUnit) -> Self {
self.inner = self.inner.unit(input);
self
}
/// <p>The unit for a given metric. If you omit <code>Unit</code>, all data that was collected with any unit is returned, along with the corresponding units that were specified when the data was reported to CloudWatch. If you specify a unit, the operation returns only data that was collected with that unit specified. If you specify a unit that does not match the data collected, the results of the operation are null. CloudWatch does not perform unit conversions.</p>
pub fn set_unit(mut self, input: std::option::Option<crate::model::StandardUnit>) -> Self {
self.inner = self.inner.set_unit(input);
self
}
}
/// Fluent builder constructing a request to `GetMetricStream`.
///
/// <p>Returns information about the metric stream that you specify.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct GetMetricStream<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::get_metric_stream_input::Builder,
}
impl<C, M, R> GetMetricStream<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `GetMetricStream`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::GetMetricStreamOutput,
aws_smithy_http::result::SdkError<crate::error::GetMetricStreamError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::GetMetricStreamInputOperationOutputAlias,
crate::output::GetMetricStreamOutput,
crate::error::GetMetricStreamError,
crate::input::GetMetricStreamInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The name of the metric stream to retrieve information about.</p>
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.name(input.into());
self
}
/// <p>The name of the metric stream to retrieve information about.</p>
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_name(input);
self
}
}
/// Fluent builder constructing a request to `GetMetricWidgetImage`.
///
/// <p>You can use the <code>GetMetricWidgetImage</code> API to retrieve a snapshot graph of one or more Amazon CloudWatch metrics as a bitmap image. You can then embed this image into your services and products, such as wiki pages, reports, and documents. You could also retrieve images regularly, such as every minute, and create your own custom live dashboard.</p>
/// <p>The graph you retrieve can include all CloudWatch metric graph features, including metric math and horizontal and vertical annotations.</p>
/// <p>There is a limit of 20 transactions per second for this API. Each <code>GetMetricWidgetImage</code> action has the following limits:</p>
/// <ul>
/// <li> <p>As many as 100 metrics in the graph.</p> </li>
/// <li> <p>Up to 100 KB uncompressed payload.</p> </li>
/// </ul>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct GetMetricWidgetImage<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::get_metric_widget_image_input::Builder,
}
impl<C, M, R> GetMetricWidgetImage<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `GetMetricWidgetImage`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::GetMetricWidgetImageOutput,
aws_smithy_http::result::SdkError<crate::error::GetMetricWidgetImageError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::GetMetricWidgetImageInputOperationOutputAlias,
crate::output::GetMetricWidgetImageOutput,
crate::error::GetMetricWidgetImageError,
crate::input::GetMetricWidgetImageInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>A JSON string that defines the bitmap graph to be retrieved. The string includes the metrics to include in the graph, statistics, annotations, title, axis limits, and so on. You can include only one <code>MetricWidget</code> parameter in each <code>GetMetricWidgetImage</code> call.</p>
/// <p>For more information about the syntax of <code>MetricWidget</code> see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/CloudWatch-Metric-Widget-Structure.html">GetMetricWidgetImage: Metric Widget Structure and Syntax</a>.</p>
/// <p>If any metric on the graph could not load all the requested data points, an orange triangle with an exclamation point appears next to the graph legend.</p>
pub fn metric_widget(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.metric_widget(input.into());
self
}
/// <p>A JSON string that defines the bitmap graph to be retrieved. The string includes the metrics to include in the graph, statistics, annotations, title, axis limits, and so on. You can include only one <code>MetricWidget</code> parameter in each <code>GetMetricWidgetImage</code> call.</p>
/// <p>For more information about the syntax of <code>MetricWidget</code> see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/CloudWatch-Metric-Widget-Structure.html">GetMetricWidgetImage: Metric Widget Structure and Syntax</a>.</p>
/// <p>If any metric on the graph could not load all the requested data points, an orange triangle with an exclamation point appears next to the graph legend.</p>
pub fn set_metric_widget(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_metric_widget(input);
self
}
/// <p>The format of the resulting image. Only PNG images are supported.</p>
/// <p>The default is <code>png</code>. If you specify <code>png</code>, the API returns an HTTP response with the content-type set to <code>text/xml</code>. The image data is in a <code>MetricWidgetImage</code> field. For example:</p>
/// <p> <code>
/// <getmetricwidgetimageresponse xmlns="<URLstring">
/// >
/// </getmetricwidgetimageresponse></code> </p>
/// <p> <code>
/// <getmetricwidgetimageresult></getmetricwidgetimageresult></code> </p>
/// <p> <code>
/// <metricwidgetimage></metricwidgetimage></code> </p>
/// <p> <code> iVBORw0KGgoAAAANSUhEUgAAAlgAAAGQEAYAAAAip...</code> </p>
/// <p> <code> </code> </p>
/// <p> <code> </code> </p>
/// <p> <code>
/// <responsemetadata></responsemetadata></code> </p>
/// <p> <code>
/// <requestid>
/// 6f0d4192-4d42-11e8-82c1-f539a07e0e3b
/// </requestid></code> </p>
/// <p> <code> </code> </p>
/// <p> <code></code> </p>
/// <p>The <code>image/png</code> setting is intended only for custom HTTP requests. For most use cases, and all actions using an Amazon Web Services SDK, you should use <code>png</code>. If you specify <code>image/png</code>, the HTTP response has a content-type set to <code>image/png</code>, and the body of the response is a PNG image. </p>
pub fn output_format(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.output_format(input.into());
self
}
/// <p>The format of the resulting image. Only PNG images are supported.</p>
/// <p>The default is <code>png</code>. If you specify <code>png</code>, the API returns an HTTP response with the content-type set to <code>text/xml</code>. The image data is in a <code>MetricWidgetImage</code> field. For example:</p>
/// <p> <code>
/// <getmetricwidgetimageresponse xmlns="<URLstring">
/// >
/// </getmetricwidgetimageresponse></code> </p>
/// <p> <code>
/// <getmetricwidgetimageresult></getmetricwidgetimageresult></code> </p>
/// <p> <code>
/// <metricwidgetimage></metricwidgetimage></code> </p>
/// <p> <code> iVBORw0KGgoAAAANSUhEUgAAAlgAAAGQEAYAAAAip...</code> </p>
/// <p> <code> </code> </p>
/// <p> <code> </code> </p>
/// <p> <code>
/// <responsemetadata></responsemetadata></code> </p>
/// <p> <code>
/// <requestid>
/// 6f0d4192-4d42-11e8-82c1-f539a07e0e3b
/// </requestid></code> </p>
/// <p> <code> </code> </p>
/// <p> <code></code> </p>
/// <p>The <code>image/png</code> setting is intended only for custom HTTP requests. For most use cases, and all actions using an Amazon Web Services SDK, you should use <code>png</code>. If you specify <code>image/png</code>, the HTTP response has a content-type set to <code>image/png</code>, and the body of the response is a PNG image. </p>
pub fn set_output_format(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_output_format(input);
self
}
}
/// Fluent builder constructing a request to `ListDashboards`.
///
/// <p>Returns a list of the dashboards for your account. If you include <code>DashboardNamePrefix</code>, only those dashboards with names starting with the prefix are listed. Otherwise, all dashboards in your account are listed. </p>
/// <p> <code>ListDashboards</code> returns up to 1000 results on one page. If there are more than 1000 dashboards, you can call <code>ListDashboards</code> again and include the value you received for <code>NextToken</code> in the first call, to receive the next 1000 results.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct ListDashboards<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::list_dashboards_input::Builder,
}
impl<C, M, R> ListDashboards<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `ListDashboards`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::ListDashboardsOutput,
aws_smithy_http::result::SdkError<crate::error::ListDashboardsError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::ListDashboardsInputOperationOutputAlias,
crate::output::ListDashboardsOutput,
crate::error::ListDashboardsError,
crate::input::ListDashboardsInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// Create a paginator for this request
///
/// Paginators are used by calling [`send().await`](crate::paginator::ListDashboardsPaginator::send) which returns a [`Stream`](tokio_stream::Stream).
pub fn into_paginator(self) -> crate::paginator::ListDashboardsPaginator<C, M, R> {
crate::paginator::ListDashboardsPaginator::new(self.handle, self.inner)
}
/// <p>If you specify this parameter, only the dashboards with names starting with the specified string are listed. The maximum length is 255, and valid characters are A-Z, a-z, 0-9, ".", "-", and "_". </p>
pub fn dashboard_name_prefix(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.dashboard_name_prefix(input.into());
self
}
/// <p>If you specify this parameter, only the dashboards with names starting with the specified string are listed. The maximum length is 255, and valid characters are A-Z, a-z, 0-9, ".", "-", and "_". </p>
pub fn set_dashboard_name_prefix(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_dashboard_name_prefix(input);
self
}
/// <p>The token returned by a previous call to indicate that there is more data available.</p>
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.next_token(input.into());
self
}
/// <p>The token returned by a previous call to indicate that there is more data available.</p>
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_next_token(input);
self
}
}
/// Fluent builder constructing a request to `ListMetrics`.
///
/// <p>List the specified metrics. You can use the returned metrics with <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_GetMetricData.html">GetMetricData</a> or <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_GetMetricStatistics.html">GetMetricStatistics</a> to obtain statistical data.</p>
/// <p>Up to 500 results are returned for any one call. To retrieve additional results, use the returned token with subsequent calls.</p>
/// <p>After you create a metric, allow up to 15 minutes before the metric appears. You can see statistics about the metric sooner by using <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_GetMetricData.html">GetMetricData</a> or <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_GetMetricStatistics.html">GetMetricStatistics</a>.</p>
/// <p> <code>ListMetrics</code> doesn't return information about metrics if those metrics haven't reported data in the past two weeks. To retrieve those metrics, use <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_GetMetricData.html">GetMetricData</a> or <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_GetMetricStatistics.html">GetMetricStatistics</a>.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct ListMetrics<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::list_metrics_input::Builder,
}
impl<C, M, R> ListMetrics<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `ListMetrics`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::ListMetricsOutput,
aws_smithy_http::result::SdkError<crate::error::ListMetricsError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::ListMetricsInputOperationOutputAlias,
crate::output::ListMetricsOutput,
crate::error::ListMetricsError,
crate::input::ListMetricsInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// Create a paginator for this request
///
/// Paginators are used by calling [`send().await`](crate::paginator::ListMetricsPaginator::send) which returns a [`Stream`](tokio_stream::Stream).
pub fn into_paginator(self) -> crate::paginator::ListMetricsPaginator<C, M, R> {
crate::paginator::ListMetricsPaginator::new(self.handle, self.inner)
}
/// <p>The metric namespace to filter against. Only the namespace that matches exactly will be returned.</p>
pub fn namespace(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.namespace(input.into());
self
}
/// <p>The metric namespace to filter against. Only the namespace that matches exactly will be returned.</p>
pub fn set_namespace(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_namespace(input);
self
}
/// <p>The name of the metric to filter against. Only the metrics with names that match exactly will be returned.</p>
pub fn metric_name(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.metric_name(input.into());
self
}
/// <p>The name of the metric to filter against. Only the metrics with names that match exactly will be returned.</p>
pub fn set_metric_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_metric_name(input);
self
}
/// Appends an item to `Dimensions`.
///
/// To override the contents of this collection use [`set_dimensions`](Self::set_dimensions).
///
/// <p>The dimensions to filter against. Only the dimensions that match exactly will be returned.</p>
pub fn dimensions(mut self, input: crate::model::DimensionFilter) -> Self {
self.inner = self.inner.dimensions(input);
self
}
/// <p>The dimensions to filter against. Only the dimensions that match exactly will be returned.</p>
pub fn set_dimensions(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::DimensionFilter>>,
) -> Self {
self.inner = self.inner.set_dimensions(input);
self
}
/// <p>The token returned by a previous call to indicate that there is more data available.</p>
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.next_token(input.into());
self
}
/// <p>The token returned by a previous call to indicate that there is more data available.</p>
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_next_token(input);
self
}
/// <p>To filter the results to show only metrics that have had data points published in the past three hours, specify this parameter with a value of <code>PT3H</code>. This is the only valid value for this parameter.</p>
/// <p>The results that are returned are an approximation of the value you specify. There is a low probability that the returned results include metrics with last published data as much as 40 minutes more than the specified time interval.</p>
pub fn recently_active(mut self, input: crate::model::RecentlyActive) -> Self {
self.inner = self.inner.recently_active(input);
self
}
/// <p>To filter the results to show only metrics that have had data points published in the past three hours, specify this parameter with a value of <code>PT3H</code>. This is the only valid value for this parameter.</p>
/// <p>The results that are returned are an approximation of the value you specify. There is a low probability that the returned results include metrics with last published data as much as 40 minutes more than the specified time interval.</p>
pub fn set_recently_active(
mut self,
input: std::option::Option<crate::model::RecentlyActive>,
) -> Self {
self.inner = self.inner.set_recently_active(input);
self
}
}
/// Fluent builder constructing a request to `ListMetricStreams`.
///
/// <p>Returns a list of metric streams in this account.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct ListMetricStreams<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::list_metric_streams_input::Builder,
}
impl<C, M, R> ListMetricStreams<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `ListMetricStreams`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::ListMetricStreamsOutput,
aws_smithy_http::result::SdkError<crate::error::ListMetricStreamsError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::ListMetricStreamsInputOperationOutputAlias,
crate::output::ListMetricStreamsOutput,
crate::error::ListMetricStreamsError,
crate::input::ListMetricStreamsInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// Create a paginator for this request
///
/// Paginators are used by calling [`send().await`](crate::paginator::ListMetricStreamsPaginator::send) which returns a [`Stream`](tokio_stream::Stream).
pub fn into_paginator(self) -> crate::paginator::ListMetricStreamsPaginator<C, M, R> {
crate::paginator::ListMetricStreamsPaginator::new(self.handle, self.inner)
}
/// <p>Include this value, if it was returned by the previous call, to get the next set of metric streams.</p>
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.next_token(input.into());
self
}
/// <p>Include this value, if it was returned by the previous call, to get the next set of metric streams.</p>
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_next_token(input);
self
}
/// <p>The maximum number of results to return in one operation.</p>
pub fn max_results(mut self, input: i32) -> Self {
self.inner = self.inner.max_results(input);
self
}
/// <p>The maximum number of results to return in one operation.</p>
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_max_results(input);
self
}
}
/// Fluent builder constructing a request to `ListTagsForResource`.
///
/// <p>Displays the tags associated with a CloudWatch resource. Currently, alarms and Contributor Insights rules support tagging.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct ListTagsForResource<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::list_tags_for_resource_input::Builder,
}
impl<C, M, R> ListTagsForResource<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `ListTagsForResource`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::ListTagsForResourceOutput,
aws_smithy_http::result::SdkError<crate::error::ListTagsForResourceError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::ListTagsForResourceInputOperationOutputAlias,
crate::output::ListTagsForResourceOutput,
crate::error::ListTagsForResourceError,
crate::input::ListTagsForResourceInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The ARN of the CloudWatch resource that you want to view tags for.</p>
/// <p>The ARN format of an alarm is <code>arn:aws:cloudwatch:<i>Region</i>:<i>account-id</i>:alarm:<i>alarm-name</i> </code> </p>
/// <p>The ARN format of a Contributor Insights rule is <code>arn:aws:cloudwatch:<i>Region</i>:<i>account-id</i>:insight-rule:<i>insight-rule-name</i> </code> </p>
/// <p>For more information about ARN format, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/list_amazoncloudwatch.html#amazoncloudwatch-resources-for-iam-policies"> Resource Types Defined by Amazon CloudWatch</a> in the <i>Amazon Web Services General Reference</i>.</p>
pub fn resource_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.resource_arn(input.into());
self
}
/// <p>The ARN of the CloudWatch resource that you want to view tags for.</p>
/// <p>The ARN format of an alarm is <code>arn:aws:cloudwatch:<i>Region</i>:<i>account-id</i>:alarm:<i>alarm-name</i> </code> </p>
/// <p>The ARN format of a Contributor Insights rule is <code>arn:aws:cloudwatch:<i>Region</i>:<i>account-id</i>:insight-rule:<i>insight-rule-name</i> </code> </p>
/// <p>For more information about ARN format, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/list_amazoncloudwatch.html#amazoncloudwatch-resources-for-iam-policies"> Resource Types Defined by Amazon CloudWatch</a> in the <i>Amazon Web Services General Reference</i>.</p>
pub fn set_resource_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_resource_arn(input);
self
}
}
/// Fluent builder constructing a request to `PutAnomalyDetector`.
///
/// <p>Creates an anomaly detection model for a CloudWatch metric. You can use the model to display a band of expected normal values when the metric is graphed.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Anomaly_Detection.html">CloudWatch Anomaly Detection</a>.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct PutAnomalyDetector<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::put_anomaly_detector_input::Builder,
}
impl<C, M, R> PutAnomalyDetector<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `PutAnomalyDetector`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::PutAnomalyDetectorOutput,
aws_smithy_http::result::SdkError<crate::error::PutAnomalyDetectorError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::PutAnomalyDetectorInputOperationOutputAlias,
crate::output::PutAnomalyDetectorOutput,
crate::error::PutAnomalyDetectorError,
crate::input::PutAnomalyDetectorInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The namespace of the metric to create the anomaly detection model for.</p>
pub fn namespace(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.namespace(input.into());
self
}
/// <p>The namespace of the metric to create the anomaly detection model for.</p>
pub fn set_namespace(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_namespace(input);
self
}
/// <p>The name of the metric to create the anomaly detection model for.</p>
pub fn metric_name(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.metric_name(input.into());
self
}
/// <p>The name of the metric to create the anomaly detection model for.</p>
pub fn set_metric_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_metric_name(input);
self
}
/// Appends an item to `Dimensions`.
///
/// To override the contents of this collection use [`set_dimensions`](Self::set_dimensions).
///
/// <p>The metric dimensions to create the anomaly detection model for.</p>
pub fn dimensions(mut self, input: crate::model::Dimension) -> Self {
self.inner = self.inner.dimensions(input);
self
}
/// <p>The metric dimensions to create the anomaly detection model for.</p>
pub fn set_dimensions(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Dimension>>,
) -> Self {
self.inner = self.inner.set_dimensions(input);
self
}
/// <p>The statistic to use for the metric and the anomaly detection model.</p>
pub fn stat(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.stat(input.into());
self
}
/// <p>The statistic to use for the metric and the anomaly detection model.</p>
pub fn set_stat(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_stat(input);
self
}
/// <p>The configuration specifies details about how the anomaly detection model is to be trained, including time ranges to exclude when training and updating the model. You can specify as many as 10 time ranges.</p>
/// <p>The configuration can also include the time zone to use for the metric.</p>
pub fn configuration(mut self, input: crate::model::AnomalyDetectorConfiguration) -> Self {
self.inner = self.inner.configuration(input);
self
}
/// <p>The configuration specifies details about how the anomaly detection model is to be trained, including time ranges to exclude when training and updating the model. You can specify as many as 10 time ranges.</p>
/// <p>The configuration can also include the time zone to use for the metric.</p>
pub fn set_configuration(
mut self,
input: std::option::Option<crate::model::AnomalyDetectorConfiguration>,
) -> Self {
self.inner = self.inner.set_configuration(input);
self
}
/// <p>A single metric anomaly detector to be created.</p>
/// <p>When using <code>SingleMetricAnomalyDetector</code>, you cannot include the following parameters in the same operation:</p>
/// <ul>
/// <li> <p> <code>Dimensions</code> </p> </li>
/// <li> <p> <code>MetricName</code> </p> </li>
/// <li> <p> <code>Namespace</code> </p> </li>
/// <li> <p> <code>Stat</code> </p> </li>
/// <li> <p>the <code>MetricMatchAnomalyDetector</code> parameters of <code>PutAnomalyDetectorInput</code> </p> </li>
/// </ul>
/// <p>Instead, specify the single metric anomaly detector attributes as part of the property <code>SingleMetricAnomalyDetector</code>.</p>
pub fn single_metric_anomaly_detector(
mut self,
input: crate::model::SingleMetricAnomalyDetector,
) -> Self {
self.inner = self.inner.single_metric_anomaly_detector(input);
self
}
/// <p>A single metric anomaly detector to be created.</p>
/// <p>When using <code>SingleMetricAnomalyDetector</code>, you cannot include the following parameters in the same operation:</p>
/// <ul>
/// <li> <p> <code>Dimensions</code> </p> </li>
/// <li> <p> <code>MetricName</code> </p> </li>
/// <li> <p> <code>Namespace</code> </p> </li>
/// <li> <p> <code>Stat</code> </p> </li>
/// <li> <p>the <code>MetricMatchAnomalyDetector</code> parameters of <code>PutAnomalyDetectorInput</code> </p> </li>
/// </ul>
/// <p>Instead, specify the single metric anomaly detector attributes as part of the property <code>SingleMetricAnomalyDetector</code>.</p>
pub fn set_single_metric_anomaly_detector(
mut self,
input: std::option::Option<crate::model::SingleMetricAnomalyDetector>,
) -> Self {
self.inner = self.inner.set_single_metric_anomaly_detector(input);
self
}
/// <p>The metric math anomaly detector to be created.</p>
/// <p>When using <code>MetricMathAnomalyDetector</code>, you cannot include the following parameters in the same operation:</p>
/// <ul>
/// <li> <p> <code>Dimensions</code> </p> </li>
/// <li> <p> <code>MetricName</code> </p> </li>
/// <li> <p> <code>Namespace</code> </p> </li>
/// <li> <p> <code>Stat</code> </p> </li>
/// <li> <p>the <code>SingleMetricAnomalyDetector</code> parameters of <code>PutAnomalyDetectorInput</code> </p> </li>
/// </ul>
/// <p>Instead, specify the metric math anomaly detector attributes as part of the property <code>MetricMathAnomalyDetector</code>.</p>
pub fn metric_math_anomaly_detector(
mut self,
input: crate::model::MetricMathAnomalyDetector,
) -> Self {
self.inner = self.inner.metric_math_anomaly_detector(input);
self
}
/// <p>The metric math anomaly detector to be created.</p>
/// <p>When using <code>MetricMathAnomalyDetector</code>, you cannot include the following parameters in the same operation:</p>
/// <ul>
/// <li> <p> <code>Dimensions</code> </p> </li>
/// <li> <p> <code>MetricName</code> </p> </li>
/// <li> <p> <code>Namespace</code> </p> </li>
/// <li> <p> <code>Stat</code> </p> </li>
/// <li> <p>the <code>SingleMetricAnomalyDetector</code> parameters of <code>PutAnomalyDetectorInput</code> </p> </li>
/// </ul>
/// <p>Instead, specify the metric math anomaly detector attributes as part of the property <code>MetricMathAnomalyDetector</code>.</p>
pub fn set_metric_math_anomaly_detector(
mut self,
input: std::option::Option<crate::model::MetricMathAnomalyDetector>,
) -> Self {
self.inner = self.inner.set_metric_math_anomaly_detector(input);
self
}
}
/// Fluent builder constructing a request to `PutCompositeAlarm`.
///
/// <p>Creates or updates a <i>composite alarm</i>. When you create a composite alarm, you specify a rule expression for the alarm that takes into account the alarm states of other alarms that you have created. The composite alarm goes into ALARM state only if all conditions of the rule are met.</p>
/// <p>The alarms specified in a composite alarm's rule expression can include metric alarms and other composite alarms.</p>
/// <p>Using composite alarms can reduce alarm noise. You can create multiple metric alarms, and also create a composite alarm and set up alerts only for the composite alarm. For example, you could create a composite alarm that goes into ALARM state only when more than one of the underlying metric alarms are in ALARM state.</p>
/// <p>Currently, the only alarm actions that can be taken by composite alarms are notifying SNS topics.</p> <note>
/// <p>It is possible to create a loop or cycle of composite alarms, where composite alarm A depends on composite alarm B, and composite alarm B also depends on composite alarm A. In this scenario, you can't delete any composite alarm that is part of the cycle because there is always still a composite alarm that depends on that alarm that you want to delete.</p>
/// <p>To get out of such a situation, you must break the cycle by changing the rule of one of the composite alarms in the cycle to remove a dependency that creates the cycle. The simplest change to make to break a cycle is to change the <code>AlarmRule</code> of one of the alarms to <code>False</code>. </p>
/// <p>Additionally, the evaluation of composite alarms stops if CloudWatch detects a cycle in the evaluation path. </p>
/// </note>
/// <p>When this operation creates an alarm, the alarm state is immediately set to <code>INSUFFICIENT_DATA</code>. The alarm is then evaluated and its state is set appropriately. Any actions associated with the new state are then executed. For a composite alarm, this initial time after creation is the only time that the alarm can be in <code>INSUFFICIENT_DATA</code> state.</p>
/// <p>When you update an existing alarm, its state is left unchanged, but the update completely overwrites the previous configuration of the alarm.</p>
/// <p>To use this operation, you must be signed on with the <code>cloudwatch:PutCompositeAlarm</code> permission that is scoped to <code>*</code>. You can't create a composite alarms if your <code>cloudwatch:PutCompositeAlarm</code> permission has a narrower scope.</p>
/// <p>If you are an IAM user, you must have <code>iam:CreateServiceLinkedRole</code> to create a composite alarm that has Systems Manager OpsItem actions.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct PutCompositeAlarm<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::put_composite_alarm_input::Builder,
}
impl<C, M, R> PutCompositeAlarm<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `PutCompositeAlarm`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::PutCompositeAlarmOutput,
aws_smithy_http::result::SdkError<crate::error::PutCompositeAlarmError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::PutCompositeAlarmInputOperationOutputAlias,
crate::output::PutCompositeAlarmOutput,
crate::error::PutCompositeAlarmError,
crate::input::PutCompositeAlarmInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>Indicates whether actions should be executed during any changes to the alarm state of the composite alarm. The default is <code>TRUE</code>.</p>
pub fn actions_enabled(mut self, input: bool) -> Self {
self.inner = self.inner.actions_enabled(input);
self
}
/// <p>Indicates whether actions should be executed during any changes to the alarm state of the composite alarm. The default is <code>TRUE</code>.</p>
pub fn set_actions_enabled(mut self, input: std::option::Option<bool>) -> Self {
self.inner = self.inner.set_actions_enabled(input);
self
}
/// Appends an item to `AlarmActions`.
///
/// To override the contents of this collection use [`set_alarm_actions`](Self::set_alarm_actions).
///
/// <p>The actions to execute when this alarm transitions to the <code>ALARM</code> state from any other state. Each action is specified as an Amazon Resource Name (ARN).</p>
/// <p>Valid Values: <code>arn:aws:sns:<i>region</i>:<i>account-id</i>:<i>sns-topic-name</i> </code> | <code>arn:aws:ssm:<i>region</i>:<i>account-id</i>:opsitem:<i>severity</i> </code> </p>
pub fn alarm_actions(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.alarm_actions(input.into());
self
}
/// <p>The actions to execute when this alarm transitions to the <code>ALARM</code> state from any other state. Each action is specified as an Amazon Resource Name (ARN).</p>
/// <p>Valid Values: <code>arn:aws:sns:<i>region</i>:<i>account-id</i>:<i>sns-topic-name</i> </code> | <code>arn:aws:ssm:<i>region</i>:<i>account-id</i>:opsitem:<i>severity</i> </code> </p>
pub fn set_alarm_actions(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.inner = self.inner.set_alarm_actions(input);
self
}
/// <p>The description for the composite alarm.</p>
pub fn alarm_description(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.alarm_description(input.into());
self
}
/// <p>The description for the composite alarm.</p>
pub fn set_alarm_description(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_alarm_description(input);
self
}
/// <p>The name for the composite alarm. This name must be unique within the Region.</p>
pub fn alarm_name(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.alarm_name(input.into());
self
}
/// <p>The name for the composite alarm. This name must be unique within the Region.</p>
pub fn set_alarm_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_alarm_name(input);
self
}
/// <p>An expression that specifies which other alarms are to be evaluated to determine this composite alarm's state. For each alarm that you reference, you designate a function that specifies whether that alarm needs to be in ALARM state, OK state, or INSUFFICIENT_DATA state. You can use operators (AND, OR and NOT) to combine multiple functions in a single expression. You can use parenthesis to logically group the functions in your expression.</p>
/// <p>You can use either alarm names or ARNs to reference the other alarms that are to be evaluated.</p>
/// <p>Functions can include the following:</p>
/// <ul>
/// <li> <p> <code>ALARM("<i>alarm-name</i> or <i>alarm-ARN</i>")</code> is TRUE if the named alarm is in ALARM state.</p> </li>
/// <li> <p> <code>OK("<i>alarm-name</i> or <i>alarm-ARN</i>")</code> is TRUE if the named alarm is in OK state.</p> </li>
/// <li> <p> <code>INSUFFICIENT_DATA("<i>alarm-name</i> or <i>alarm-ARN</i>")</code> is TRUE if the named alarm is in INSUFFICIENT_DATA state.</p> </li>
/// <li> <p> <code>TRUE</code> always evaluates to TRUE.</p> </li>
/// <li> <p> <code>FALSE</code> always evaluates to FALSE.</p> </li>
/// </ul>
/// <p>TRUE and FALSE are useful for testing a complex <code>AlarmRule</code> structure, and for testing your alarm actions.</p>
/// <p>Alarm names specified in <code>AlarmRule</code> can be surrounded with double-quotes ("), but do not have to be.</p>
/// <p>The following are some examples of <code>AlarmRule</code>:</p>
/// <ul>
/// <li> <p> <code>ALARM(CPUUtilizationTooHigh) AND ALARM(DiskReadOpsTooHigh)</code> specifies that the composite alarm goes into ALARM state only if both CPUUtilizationTooHigh and DiskReadOpsTooHigh alarms are in ALARM state.</p> </li>
/// <li> <p> <code>ALARM(CPUUtilizationTooHigh) AND NOT ALARM(DeploymentInProgress)</code> specifies that the alarm goes to ALARM state if CPUUtilizationTooHigh is in ALARM state and DeploymentInProgress is not in ALARM state. This example reduces alarm noise during a known deployment window.</p> </li>
/// <li> <p> <code>(ALARM(CPUUtilizationTooHigh) OR ALARM(DiskReadOpsTooHigh)) AND OK(NetworkOutTooHigh)</code> goes into ALARM state if CPUUtilizationTooHigh OR DiskReadOpsTooHigh is in ALARM state, and if NetworkOutTooHigh is in OK state. This provides another example of using a composite alarm to prevent noise. This rule ensures that you are not notified with an alarm action on high CPU or disk usage if a known network problem is also occurring.</p> </li>
/// </ul>
/// <p>The <code>AlarmRule</code> can specify as many as 100 "children" alarms. The <code>AlarmRule</code> expression can have as many as 500 elements. Elements are child alarms, TRUE or FALSE statements, and parentheses.</p>
pub fn alarm_rule(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.alarm_rule(input.into());
self
}
/// <p>An expression that specifies which other alarms are to be evaluated to determine this composite alarm's state. For each alarm that you reference, you designate a function that specifies whether that alarm needs to be in ALARM state, OK state, or INSUFFICIENT_DATA state. You can use operators (AND, OR and NOT) to combine multiple functions in a single expression. You can use parenthesis to logically group the functions in your expression.</p>
/// <p>You can use either alarm names or ARNs to reference the other alarms that are to be evaluated.</p>
/// <p>Functions can include the following:</p>
/// <ul>
/// <li> <p> <code>ALARM("<i>alarm-name</i> or <i>alarm-ARN</i>")</code> is TRUE if the named alarm is in ALARM state.</p> </li>
/// <li> <p> <code>OK("<i>alarm-name</i> or <i>alarm-ARN</i>")</code> is TRUE if the named alarm is in OK state.</p> </li>
/// <li> <p> <code>INSUFFICIENT_DATA("<i>alarm-name</i> or <i>alarm-ARN</i>")</code> is TRUE if the named alarm is in INSUFFICIENT_DATA state.</p> </li>
/// <li> <p> <code>TRUE</code> always evaluates to TRUE.</p> </li>
/// <li> <p> <code>FALSE</code> always evaluates to FALSE.</p> </li>
/// </ul>
/// <p>TRUE and FALSE are useful for testing a complex <code>AlarmRule</code> structure, and for testing your alarm actions.</p>
/// <p>Alarm names specified in <code>AlarmRule</code> can be surrounded with double-quotes ("), but do not have to be.</p>
/// <p>The following are some examples of <code>AlarmRule</code>:</p>
/// <ul>
/// <li> <p> <code>ALARM(CPUUtilizationTooHigh) AND ALARM(DiskReadOpsTooHigh)</code> specifies that the composite alarm goes into ALARM state only if both CPUUtilizationTooHigh and DiskReadOpsTooHigh alarms are in ALARM state.</p> </li>
/// <li> <p> <code>ALARM(CPUUtilizationTooHigh) AND NOT ALARM(DeploymentInProgress)</code> specifies that the alarm goes to ALARM state if CPUUtilizationTooHigh is in ALARM state and DeploymentInProgress is not in ALARM state. This example reduces alarm noise during a known deployment window.</p> </li>
/// <li> <p> <code>(ALARM(CPUUtilizationTooHigh) OR ALARM(DiskReadOpsTooHigh)) AND OK(NetworkOutTooHigh)</code> goes into ALARM state if CPUUtilizationTooHigh OR DiskReadOpsTooHigh is in ALARM state, and if NetworkOutTooHigh is in OK state. This provides another example of using a composite alarm to prevent noise. This rule ensures that you are not notified with an alarm action on high CPU or disk usage if a known network problem is also occurring.</p> </li>
/// </ul>
/// <p>The <code>AlarmRule</code> can specify as many as 100 "children" alarms. The <code>AlarmRule</code> expression can have as many as 500 elements. Elements are child alarms, TRUE or FALSE statements, and parentheses.</p>
pub fn set_alarm_rule(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_alarm_rule(input);
self
}
/// Appends an item to `InsufficientDataActions`.
///
/// To override the contents of this collection use [`set_insufficient_data_actions`](Self::set_insufficient_data_actions).
///
/// <p>The actions to execute when this alarm transitions to the <code>INSUFFICIENT_DATA</code> state from any other state. Each action is specified as an Amazon Resource Name (ARN).</p>
/// <p>Valid Values: <code>arn:aws:sns:<i>region</i>:<i>account-id</i>:<i>sns-topic-name</i> </code> </p>
pub fn insufficient_data_actions(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.insufficient_data_actions(input.into());
self
}
/// <p>The actions to execute when this alarm transitions to the <code>INSUFFICIENT_DATA</code> state from any other state. Each action is specified as an Amazon Resource Name (ARN).</p>
/// <p>Valid Values: <code>arn:aws:sns:<i>region</i>:<i>account-id</i>:<i>sns-topic-name</i> </code> </p>
pub fn set_insufficient_data_actions(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.inner = self.inner.set_insufficient_data_actions(input);
self
}
/// Appends an item to `OKActions`.
///
/// To override the contents of this collection use [`set_ok_actions`](Self::set_ok_actions).
///
/// <p>The actions to execute when this alarm transitions to an <code>OK</code> state from any other state. Each action is specified as an Amazon Resource Name (ARN).</p>
/// <p>Valid Values: <code>arn:aws:sns:<i>region</i>:<i>account-id</i>:<i>sns-topic-name</i> </code> </p>
pub fn ok_actions(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.ok_actions(input.into());
self
}
/// <p>The actions to execute when this alarm transitions to an <code>OK</code> state from any other state. Each action is specified as an Amazon Resource Name (ARN).</p>
/// <p>Valid Values: <code>arn:aws:sns:<i>region</i>:<i>account-id</i>:<i>sns-topic-name</i> </code> </p>
pub fn set_ok_actions(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.inner = self.inner.set_ok_actions(input);
self
}
/// Appends an item to `Tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>A list of key-value pairs to associate with the composite alarm. You can associate as many as 50 tags with an alarm.</p>
/// <p>Tags can help you organize and categorize your resources. You can also use them to scope user permissions, by granting a user permission to access or change only resources with certain tag values.</p>
pub fn tags(mut self, input: crate::model::Tag) -> Self {
self.inner = self.inner.tags(input);
self
}
/// <p>A list of key-value pairs to associate with the composite alarm. You can associate as many as 50 tags with an alarm.</p>
/// <p>Tags can help you organize and categorize your resources. You can also use them to scope user permissions, by granting a user permission to access or change only resources with certain tag values.</p>
pub fn set_tags(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Tag>>,
) -> Self {
self.inner = self.inner.set_tags(input);
self
}
}
/// Fluent builder constructing a request to `PutDashboard`.
///
/// <p>Creates a dashboard if it does not already exist, or updates an existing dashboard. If you update a dashboard, the entire contents are replaced with what you specify here.</p>
/// <p>All dashboards in your account are global, not region-specific.</p>
/// <p>A simple way to create a dashboard using <code>PutDashboard</code> is to copy an existing dashboard. To copy an existing dashboard using the console, you can load the dashboard and then use the View/edit source command in the Actions menu to display the JSON block for that dashboard. Another way to copy a dashboard is to use <code>GetDashboard</code>, and then use the data returned within <code>DashboardBody</code> as the template for the new dashboard when you call <code>PutDashboard</code>.</p>
/// <p>When you create a dashboard with <code>PutDashboard</code>, a good practice is to add a text widget at the top of the dashboard with a message that the dashboard was created by script and should not be changed in the console. This message could also point console users to the location of the <code>DashboardBody</code> script or the CloudFormation template used to create the dashboard.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct PutDashboard<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::put_dashboard_input::Builder,
}
impl<C, M, R> PutDashboard<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `PutDashboard`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::PutDashboardOutput,
aws_smithy_http::result::SdkError<crate::error::PutDashboardError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::PutDashboardInputOperationOutputAlias,
crate::output::PutDashboardOutput,
crate::error::PutDashboardError,
crate::input::PutDashboardInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The name of the dashboard. If a dashboard with this name already exists, this call modifies that dashboard, replacing its current contents. Otherwise, a new dashboard is created. The maximum length is 255, and valid characters are A-Z, a-z, 0-9, "-", and "_". This parameter is required.</p>
pub fn dashboard_name(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.dashboard_name(input.into());
self
}
/// <p>The name of the dashboard. If a dashboard with this name already exists, this call modifies that dashboard, replacing its current contents. Otherwise, a new dashboard is created. The maximum length is 255, and valid characters are A-Z, a-z, 0-9, "-", and "_". This parameter is required.</p>
pub fn set_dashboard_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_dashboard_name(input);
self
}
/// <p>The detailed information about the dashboard in JSON format, including the widgets to include and their location on the dashboard. This parameter is required.</p>
/// <p>For more information about the syntax, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/CloudWatch-Dashboard-Body-Structure.html">Dashboard Body Structure and Syntax</a>.</p>
pub fn dashboard_body(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.dashboard_body(input.into());
self
}
/// <p>The detailed information about the dashboard in JSON format, including the widgets to include and their location on the dashboard. This parameter is required.</p>
/// <p>For more information about the syntax, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/CloudWatch-Dashboard-Body-Structure.html">Dashboard Body Structure and Syntax</a>.</p>
pub fn set_dashboard_body(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_dashboard_body(input);
self
}
}
/// Fluent builder constructing a request to `PutInsightRule`.
///
/// <p>Creates a Contributor Insights rule. Rules evaluate log events in a CloudWatch Logs log group, enabling you to find contributor data for the log events in that log group. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ContributorInsights.html">Using Contributor Insights to Analyze High-Cardinality Data</a>.</p>
/// <p>If you create a rule, delete it, and then re-create it with the same name, historical data from the first time the rule was created might not be available.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct PutInsightRule<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::put_insight_rule_input::Builder,
}
impl<C, M, R> PutInsightRule<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `PutInsightRule`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::PutInsightRuleOutput,
aws_smithy_http::result::SdkError<crate::error::PutInsightRuleError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::PutInsightRuleInputOperationOutputAlias,
crate::output::PutInsightRuleOutput,
crate::error::PutInsightRuleError,
crate::input::PutInsightRuleInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>A unique name for the rule.</p>
pub fn rule_name(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.rule_name(input.into());
self
}
/// <p>A unique name for the rule.</p>
pub fn set_rule_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_rule_name(input);
self
}
/// <p>The state of the rule. Valid values are ENABLED and DISABLED.</p>
pub fn rule_state(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.rule_state(input.into());
self
}
/// <p>The state of the rule. Valid values are ENABLED and DISABLED.</p>
pub fn set_rule_state(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_rule_state(input);
self
}
/// <p>The definition of the rule, as a JSON object. For details on the valid syntax, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ContributorInsights-RuleSyntax.html">Contributor Insights Rule Syntax</a>.</p>
pub fn rule_definition(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.rule_definition(input.into());
self
}
/// <p>The definition of the rule, as a JSON object. For details on the valid syntax, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ContributorInsights-RuleSyntax.html">Contributor Insights Rule Syntax</a>.</p>
pub fn set_rule_definition(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_rule_definition(input);
self
}
/// Appends an item to `Tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>A list of key-value pairs to associate with the Contributor Insights rule. You can associate as many as 50 tags with a rule.</p>
/// <p>Tags can help you organize and categorize your resources. You can also use them to scope user permissions, by granting a user permission to access or change only the resources that have certain tag values.</p>
/// <p>To be able to associate tags with a rule, you must have the <code>cloudwatch:TagResource</code> permission in addition to the <code>cloudwatch:PutInsightRule</code> permission.</p>
/// <p>If you are using this operation to update an existing Contributor Insights rule, any tags you specify in this parameter are ignored. To change the tags of an existing rule, use <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_TagResource.html">TagResource</a>.</p>
pub fn tags(mut self, input: crate::model::Tag) -> Self {
self.inner = self.inner.tags(input);
self
}
/// <p>A list of key-value pairs to associate with the Contributor Insights rule. You can associate as many as 50 tags with a rule.</p>
/// <p>Tags can help you organize and categorize your resources. You can also use them to scope user permissions, by granting a user permission to access or change only the resources that have certain tag values.</p>
/// <p>To be able to associate tags with a rule, you must have the <code>cloudwatch:TagResource</code> permission in addition to the <code>cloudwatch:PutInsightRule</code> permission.</p>
/// <p>If you are using this operation to update an existing Contributor Insights rule, any tags you specify in this parameter are ignored. To change the tags of an existing rule, use <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_TagResource.html">TagResource</a>.</p>
pub fn set_tags(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Tag>>,
) -> Self {
self.inner = self.inner.set_tags(input);
self
}
}
/// Fluent builder constructing a request to `PutMetricAlarm`.
///
/// <p>Creates or updates an alarm and associates it with the specified metric, metric math expression, or anomaly detection model.</p>
/// <p>Alarms based on anomaly detection models cannot have Auto Scaling actions.</p>
/// <p>When this operation creates an alarm, the alarm state is immediately set to <code>INSUFFICIENT_DATA</code>. The alarm is then evaluated and its state is set appropriately. Any actions associated with the new state are then executed.</p>
/// <p>When you update an existing alarm, its state is left unchanged, but the update completely overwrites the previous configuration of the alarm.</p>
/// <p>If you are an IAM user, you must have Amazon EC2 permissions for some alarm operations:</p>
/// <ul>
/// <li> <p>The <code>iam:CreateServiceLinkedRole</code> for all alarms with EC2 actions</p> </li>
/// <li> <p>The <code>iam:CreateServiceLinkedRole</code> to create an alarm with Systems Manager OpsItem actions.</p> </li>
/// </ul>
/// <p>The first time you create an alarm in the Amazon Web Services Management Console, the CLI, or by using the PutMetricAlarm API, CloudWatch creates the necessary service-linked role for you. The service-linked roles are called <code>AWSServiceRoleForCloudWatchEvents</code> and <code>AWSServiceRoleForCloudWatchAlarms_ActionSSM</code>. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html#iam-term-service-linked-role">Amazon Web Services service-linked role</a>.</p>
/// <p> <b>Cross-account alarms</b> </p>
/// <p>You can set an alarm on metrics in the current account, or in another account. To create a cross-account alarm that watches a metric in a different account, you must have completed the following pre-requisites:</p>
/// <ul>
/// <li> <p>The account where the metrics are located (the <i>sharing account</i>) must already have a sharing role named <b>CloudWatch-CrossAccountSharingRole</b>. If it does not already have this role, you must create it using the instructions in <b>Set up a sharing account</b> in <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Cross-Account-Cross-Region.html#enable-cross-account-cross-Region"> Cross-account cross-Region CloudWatch console</a>. The policy for that role must grant access to the ID of the account where you are creating the alarm. </p> </li>
/// <li> <p>The account where you are creating the alarm (the <i>monitoring account</i>) must already have a service-linked role named <b>AWSServiceRoleForCloudWatchCrossAccount</b> to allow CloudWatch to assume the sharing role in the sharing account. If it does not, you must create it following the directions in <b>Set up a monitoring account</b> in <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Cross-Account-Cross-Region.html#enable-cross-account-cross-Region"> Cross-account cross-Region CloudWatch console</a>.</p> </li>
/// </ul>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct PutMetricAlarm<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::put_metric_alarm_input::Builder,
}
impl<C, M, R> PutMetricAlarm<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `PutMetricAlarm`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::PutMetricAlarmOutput,
aws_smithy_http::result::SdkError<crate::error::PutMetricAlarmError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::PutMetricAlarmInputOperationOutputAlias,
crate::output::PutMetricAlarmOutput,
crate::error::PutMetricAlarmError,
crate::input::PutMetricAlarmInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The name for the alarm. This name must be unique within the Region.</p>
pub fn alarm_name(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.alarm_name(input.into());
self
}
/// <p>The name for the alarm. This name must be unique within the Region.</p>
pub fn set_alarm_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_alarm_name(input);
self
}
/// <p>The description for the alarm.</p>
pub fn alarm_description(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.alarm_description(input.into());
self
}
/// <p>The description for the alarm.</p>
pub fn set_alarm_description(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_alarm_description(input);
self
}
/// <p>Indicates whether actions should be executed during any changes to the alarm state. The default is <code>TRUE</code>.</p>
pub fn actions_enabled(mut self, input: bool) -> Self {
self.inner = self.inner.actions_enabled(input);
self
}
/// <p>Indicates whether actions should be executed during any changes to the alarm state. The default is <code>TRUE</code>.</p>
pub fn set_actions_enabled(mut self, input: std::option::Option<bool>) -> Self {
self.inner = self.inner.set_actions_enabled(input);
self
}
/// Appends an item to `OKActions`.
///
/// To override the contents of this collection use [`set_ok_actions`](Self::set_ok_actions).
///
/// <p>The actions to execute when this alarm transitions to an <code>OK</code> state from any other state. Each action is specified as an Amazon Resource Name (ARN).</p>
/// <p>Valid Values: <code>arn:aws:automate:<i>region</i>:ec2:stop</code> | <code>arn:aws:automate:<i>region</i>:ec2:terminate</code> | <code>arn:aws:automate:<i>region</i>:ec2:recover</code> | <code>arn:aws:automate:<i>region</i>:ec2:reboot</code> | <code>arn:aws:sns:<i>region</i>:<i>account-id</i>:<i>sns-topic-name</i> </code> | <code>arn:aws:autoscaling:<i>region</i>:<i>account-id</i>:scalingPolicy:<i>policy-id</i>:autoScalingGroupName/<i>group-friendly-name</i>:policyName/<i>policy-friendly-name</i> </code> </p>
/// <p>Valid Values (for use with IAM roles): <code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Stop/1.0</code> | <code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Terminate/1.0</code> | <code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Reboot/1.0</code> | <code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Recover/1.0</code> </p>
pub fn ok_actions(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.ok_actions(input.into());
self
}
/// <p>The actions to execute when this alarm transitions to an <code>OK</code> state from any other state. Each action is specified as an Amazon Resource Name (ARN).</p>
/// <p>Valid Values: <code>arn:aws:automate:<i>region</i>:ec2:stop</code> | <code>arn:aws:automate:<i>region</i>:ec2:terminate</code> | <code>arn:aws:automate:<i>region</i>:ec2:recover</code> | <code>arn:aws:automate:<i>region</i>:ec2:reboot</code> | <code>arn:aws:sns:<i>region</i>:<i>account-id</i>:<i>sns-topic-name</i> </code> | <code>arn:aws:autoscaling:<i>region</i>:<i>account-id</i>:scalingPolicy:<i>policy-id</i>:autoScalingGroupName/<i>group-friendly-name</i>:policyName/<i>policy-friendly-name</i> </code> </p>
/// <p>Valid Values (for use with IAM roles): <code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Stop/1.0</code> | <code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Terminate/1.0</code> | <code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Reboot/1.0</code> | <code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Recover/1.0</code> </p>
pub fn set_ok_actions(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.inner = self.inner.set_ok_actions(input);
self
}
/// Appends an item to `AlarmActions`.
///
/// To override the contents of this collection use [`set_alarm_actions`](Self::set_alarm_actions).
///
/// <p>The actions to execute when this alarm transitions to the <code>ALARM</code> state from any other state. Each action is specified as an Amazon Resource Name (ARN).</p>
/// <p>Valid Values: <code>arn:aws:automate:<i>region</i>:ec2:stop</code> | <code>arn:aws:automate:<i>region</i>:ec2:terminate</code> | <code>arn:aws:automate:<i>region</i>:ec2:recover</code> | <code>arn:aws:automate:<i>region</i>:ec2:reboot</code> | <code>arn:aws:sns:<i>region</i>:<i>account-id</i>:<i>sns-topic-name</i> </code> | <code>arn:aws:autoscaling:<i>region</i>:<i>account-id</i>:scalingPolicy:<i>policy-id</i>:autoScalingGroupName/<i>group-friendly-name</i>:policyName/<i>policy-friendly-name</i> </code> | <code>arn:aws:ssm:<i>region</i>:<i>account-id</i>:opsitem:<i>severity</i> </code> | <code>arn:aws:ssm-incidents::<i>account-id</i>:response-plan:<i>response-plan-name</i> </code> </p>
/// <p>Valid Values (for use with IAM roles): <code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Stop/1.0</code> | <code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Terminate/1.0</code> | <code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Reboot/1.0</code> | <code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Recover/1.0</code> </p>
pub fn alarm_actions(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.alarm_actions(input.into());
self
}
/// <p>The actions to execute when this alarm transitions to the <code>ALARM</code> state from any other state. Each action is specified as an Amazon Resource Name (ARN).</p>
/// <p>Valid Values: <code>arn:aws:automate:<i>region</i>:ec2:stop</code> | <code>arn:aws:automate:<i>region</i>:ec2:terminate</code> | <code>arn:aws:automate:<i>region</i>:ec2:recover</code> | <code>arn:aws:automate:<i>region</i>:ec2:reboot</code> | <code>arn:aws:sns:<i>region</i>:<i>account-id</i>:<i>sns-topic-name</i> </code> | <code>arn:aws:autoscaling:<i>region</i>:<i>account-id</i>:scalingPolicy:<i>policy-id</i>:autoScalingGroupName/<i>group-friendly-name</i>:policyName/<i>policy-friendly-name</i> </code> | <code>arn:aws:ssm:<i>region</i>:<i>account-id</i>:opsitem:<i>severity</i> </code> | <code>arn:aws:ssm-incidents::<i>account-id</i>:response-plan:<i>response-plan-name</i> </code> </p>
/// <p>Valid Values (for use with IAM roles): <code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Stop/1.0</code> | <code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Terminate/1.0</code> | <code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Reboot/1.0</code> | <code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Recover/1.0</code> </p>
pub fn set_alarm_actions(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.inner = self.inner.set_alarm_actions(input);
self
}
/// Appends an item to `InsufficientDataActions`.
///
/// To override the contents of this collection use [`set_insufficient_data_actions`](Self::set_insufficient_data_actions).
///
/// <p>The actions to execute when this alarm transitions to the <code>INSUFFICIENT_DATA</code> state from any other state. Each action is specified as an Amazon Resource Name (ARN).</p>
/// <p>Valid Values: <code>arn:aws:automate:<i>region</i>:ec2:stop</code> | <code>arn:aws:automate:<i>region</i>:ec2:terminate</code> | <code>arn:aws:automate:<i>region</i>:ec2:recover</code> | <code>arn:aws:automate:<i>region</i>:ec2:reboot</code> | <code>arn:aws:sns:<i>region</i>:<i>account-id</i>:<i>sns-topic-name</i> </code> | <code>arn:aws:autoscaling:<i>region</i>:<i>account-id</i>:scalingPolicy:<i>policy-id</i>:autoScalingGroupName/<i>group-friendly-name</i>:policyName/<i>policy-friendly-name</i> </code> </p>
/// <p>Valid Values (for use with IAM roles): <code>>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Stop/1.0</code> | <code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Terminate/1.0</code> | <code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Reboot/1.0</code> </p>
pub fn insufficient_data_actions(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.insufficient_data_actions(input.into());
self
}
/// <p>The actions to execute when this alarm transitions to the <code>INSUFFICIENT_DATA</code> state from any other state. Each action is specified as an Amazon Resource Name (ARN).</p>
/// <p>Valid Values: <code>arn:aws:automate:<i>region</i>:ec2:stop</code> | <code>arn:aws:automate:<i>region</i>:ec2:terminate</code> | <code>arn:aws:automate:<i>region</i>:ec2:recover</code> | <code>arn:aws:automate:<i>region</i>:ec2:reboot</code> | <code>arn:aws:sns:<i>region</i>:<i>account-id</i>:<i>sns-topic-name</i> </code> | <code>arn:aws:autoscaling:<i>region</i>:<i>account-id</i>:scalingPolicy:<i>policy-id</i>:autoScalingGroupName/<i>group-friendly-name</i>:policyName/<i>policy-friendly-name</i> </code> </p>
/// <p>Valid Values (for use with IAM roles): <code>>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Stop/1.0</code> | <code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Terminate/1.0</code> | <code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Reboot/1.0</code> </p>
pub fn set_insufficient_data_actions(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.inner = self.inner.set_insufficient_data_actions(input);
self
}
/// <p>The name for the metric associated with the alarm. For each <code>PutMetricAlarm</code> operation, you must specify either <code>MetricName</code> or a <code>Metrics</code> array.</p>
/// <p>If you are creating an alarm based on a math expression, you cannot specify this parameter, or any of the <code>Dimensions</code>, <code>Period</code>, <code>Namespace</code>, <code>Statistic</code>, or <code>ExtendedStatistic</code> parameters. Instead, you specify all this information in the <code>Metrics</code> array.</p>
pub fn metric_name(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.metric_name(input.into());
self
}
/// <p>The name for the metric associated with the alarm. For each <code>PutMetricAlarm</code> operation, you must specify either <code>MetricName</code> or a <code>Metrics</code> array.</p>
/// <p>If you are creating an alarm based on a math expression, you cannot specify this parameter, or any of the <code>Dimensions</code>, <code>Period</code>, <code>Namespace</code>, <code>Statistic</code>, or <code>ExtendedStatistic</code> parameters. Instead, you specify all this information in the <code>Metrics</code> array.</p>
pub fn set_metric_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_metric_name(input);
self
}
/// <p>The namespace for the metric associated specified in <code>MetricName</code>.</p>
pub fn namespace(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.namespace(input.into());
self
}
/// <p>The namespace for the metric associated specified in <code>MetricName</code>.</p>
pub fn set_namespace(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_namespace(input);
self
}
/// <p>The statistic for the metric specified in <code>MetricName</code>, other than percentile. For percentile statistics, use <code>ExtendedStatistic</code>. When you call <code>PutMetricAlarm</code> and specify a <code>MetricName</code>, you must specify either <code>Statistic</code> or <code>ExtendedStatistic,</code> but not both.</p>
pub fn statistic(mut self, input: crate::model::Statistic) -> Self {
self.inner = self.inner.statistic(input);
self
}
/// <p>The statistic for the metric specified in <code>MetricName</code>, other than percentile. For percentile statistics, use <code>ExtendedStatistic</code>. When you call <code>PutMetricAlarm</code> and specify a <code>MetricName</code>, you must specify either <code>Statistic</code> or <code>ExtendedStatistic,</code> but not both.</p>
pub fn set_statistic(
mut self,
input: std::option::Option<crate::model::Statistic>,
) -> Self {
self.inner = self.inner.set_statistic(input);
self
}
/// <p>The percentile statistic for the metric specified in <code>MetricName</code>. Specify a value between p0.0 and p100. When you call <code>PutMetricAlarm</code> and specify a <code>MetricName</code>, you must specify either <code>Statistic</code> or <code>ExtendedStatistic,</code> but not both.</p>
pub fn extended_statistic(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.extended_statistic(input.into());
self
}
/// <p>The percentile statistic for the metric specified in <code>MetricName</code>. Specify a value between p0.0 and p100. When you call <code>PutMetricAlarm</code> and specify a <code>MetricName</code>, you must specify either <code>Statistic</code> or <code>ExtendedStatistic,</code> but not both.</p>
pub fn set_extended_statistic(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_extended_statistic(input);
self
}
/// Appends an item to `Dimensions`.
///
/// To override the contents of this collection use [`set_dimensions`](Self::set_dimensions).
///
/// <p>The dimensions for the metric specified in <code>MetricName</code>.</p>
pub fn dimensions(mut self, input: crate::model::Dimension) -> Self {
self.inner = self.inner.dimensions(input);
self
}
/// <p>The dimensions for the metric specified in <code>MetricName</code>.</p>
pub fn set_dimensions(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Dimension>>,
) -> Self {
self.inner = self.inner.set_dimensions(input);
self
}
/// <p>The length, in seconds, used each time the metric specified in <code>MetricName</code> is evaluated. Valid values are 10, 30, and any multiple of 60.</p>
/// <p> <code>Period</code> is required for alarms based on static thresholds. If you are creating an alarm based on a metric math expression, you specify the period for each metric within the objects in the <code>Metrics</code> array.</p>
/// <p>Be sure to specify 10 or 30 only for metrics that are stored by a <code>PutMetricData</code> call with a <code>StorageResolution</code> of 1. If you specify a period of 10 or 30 for a metric that does not have sub-minute resolution, the alarm still attempts to gather data at the period rate that you specify. In this case, it does not receive data for the attempts that do not correspond to a one-minute data resolution, and the alarm might often lapse into INSUFFICENT_DATA status. Specifying 10 or 30 also sets this alarm as a high-resolution alarm, which has a higher charge than other alarms. For more information about pricing, see <a href="https://aws.amazon.com/cloudwatch/pricing/">Amazon CloudWatch Pricing</a>.</p>
/// <p>An alarm's total current evaluation period can be no longer than one day, so <code>Period</code> multiplied by <code>EvaluationPeriods</code> cannot be more than 86,400 seconds.</p>
pub fn period(mut self, input: i32) -> Self {
self.inner = self.inner.period(input);
self
}
/// <p>The length, in seconds, used each time the metric specified in <code>MetricName</code> is evaluated. Valid values are 10, 30, and any multiple of 60.</p>
/// <p> <code>Period</code> is required for alarms based on static thresholds. If you are creating an alarm based on a metric math expression, you specify the period for each metric within the objects in the <code>Metrics</code> array.</p>
/// <p>Be sure to specify 10 or 30 only for metrics that are stored by a <code>PutMetricData</code> call with a <code>StorageResolution</code> of 1. If you specify a period of 10 or 30 for a metric that does not have sub-minute resolution, the alarm still attempts to gather data at the period rate that you specify. In this case, it does not receive data for the attempts that do not correspond to a one-minute data resolution, and the alarm might often lapse into INSUFFICENT_DATA status. Specifying 10 or 30 also sets this alarm as a high-resolution alarm, which has a higher charge than other alarms. For more information about pricing, see <a href="https://aws.amazon.com/cloudwatch/pricing/">Amazon CloudWatch Pricing</a>.</p>
/// <p>An alarm's total current evaluation period can be no longer than one day, so <code>Period</code> multiplied by <code>EvaluationPeriods</code> cannot be more than 86,400 seconds.</p>
pub fn set_period(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_period(input);
self
}
/// <p>The unit of measure for the statistic. For example, the units for the Amazon EC2 NetworkIn metric are Bytes because NetworkIn tracks the number of bytes that an instance receives on all network interfaces. You can also specify a unit when you create a custom metric. Units help provide conceptual meaning to your data. Metric data points that specify a unit of measure, such as Percent, are aggregated separately.</p>
/// <p>If you don't specify <code>Unit</code>, CloudWatch retrieves all unit types that have been published for the metric and attempts to evaluate the alarm. Usually, metrics are published with only one unit, so the alarm works as intended.</p>
/// <p>However, if the metric is published with multiple types of units and you don't specify a unit, the alarm's behavior is not defined and it behaves predictably.</p>
/// <p>We recommend omitting <code>Unit</code> so that you don't inadvertently specify an incorrect unit that is not published for this metric. Doing so causes the alarm to be stuck in the <code>INSUFFICIENT DATA</code> state.</p>
pub fn unit(mut self, input: crate::model::StandardUnit) -> Self {
self.inner = self.inner.unit(input);
self
}
/// <p>The unit of measure for the statistic. For example, the units for the Amazon EC2 NetworkIn metric are Bytes because NetworkIn tracks the number of bytes that an instance receives on all network interfaces. You can also specify a unit when you create a custom metric. Units help provide conceptual meaning to your data. Metric data points that specify a unit of measure, such as Percent, are aggregated separately.</p>
/// <p>If you don't specify <code>Unit</code>, CloudWatch retrieves all unit types that have been published for the metric and attempts to evaluate the alarm. Usually, metrics are published with only one unit, so the alarm works as intended.</p>
/// <p>However, if the metric is published with multiple types of units and you don't specify a unit, the alarm's behavior is not defined and it behaves predictably.</p>
/// <p>We recommend omitting <code>Unit</code> so that you don't inadvertently specify an incorrect unit that is not published for this metric. Doing so causes the alarm to be stuck in the <code>INSUFFICIENT DATA</code> state.</p>
pub fn set_unit(mut self, input: std::option::Option<crate::model::StandardUnit>) -> Self {
self.inner = self.inner.set_unit(input);
self
}
/// <p>The number of periods over which data is compared to the specified threshold. If you are setting an alarm that requires that a number of consecutive data points be breaching to trigger the alarm, this value specifies that number. If you are setting an "M out of N" alarm, this value is the N.</p>
/// <p>An alarm's total current evaluation period can be no longer than one day, so this number multiplied by <code>Period</code> cannot be more than 86,400 seconds.</p>
pub fn evaluation_periods(mut self, input: i32) -> Self {
self.inner = self.inner.evaluation_periods(input);
self
}
/// <p>The number of periods over which data is compared to the specified threshold. If you are setting an alarm that requires that a number of consecutive data points be breaching to trigger the alarm, this value specifies that number. If you are setting an "M out of N" alarm, this value is the N.</p>
/// <p>An alarm's total current evaluation period can be no longer than one day, so this number multiplied by <code>Period</code> cannot be more than 86,400 seconds.</p>
pub fn set_evaluation_periods(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_evaluation_periods(input);
self
}
/// <p>The number of data points that must be breaching to trigger the alarm. This is used only if you are setting an "M out of N" alarm. In that case, this value is the M. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarm-evaluation">Evaluating an Alarm</a> in the <i>Amazon CloudWatch User Guide</i>.</p>
pub fn datapoints_to_alarm(mut self, input: i32) -> Self {
self.inner = self.inner.datapoints_to_alarm(input);
self
}
/// <p>The number of data points that must be breaching to trigger the alarm. This is used only if you are setting an "M out of N" alarm. In that case, this value is the M. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarm-evaluation">Evaluating an Alarm</a> in the <i>Amazon CloudWatch User Guide</i>.</p>
pub fn set_datapoints_to_alarm(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_datapoints_to_alarm(input);
self
}
/// <p>The value against which the specified statistic is compared.</p>
/// <p>This parameter is required for alarms based on static thresholds, but should not be used for alarms based on anomaly detection models.</p>
pub fn threshold(mut self, input: f64) -> Self {
self.inner = self.inner.threshold(input);
self
}
/// <p>The value against which the specified statistic is compared.</p>
/// <p>This parameter is required for alarms based on static thresholds, but should not be used for alarms based on anomaly detection models.</p>
pub fn set_threshold(mut self, input: std::option::Option<f64>) -> Self {
self.inner = self.inner.set_threshold(input);
self
}
/// <p> The arithmetic operation to use when comparing the specified statistic and threshold. The specified statistic value is used as the first operand.</p>
/// <p>The values <code>LessThanLowerOrGreaterThanUpperThreshold</code>, <code>LessThanLowerThreshold</code>, and <code>GreaterThanUpperThreshold</code> are used only for alarms based on anomaly detection models.</p>
pub fn comparison_operator(mut self, input: crate::model::ComparisonOperator) -> Self {
self.inner = self.inner.comparison_operator(input);
self
}
/// <p> The arithmetic operation to use when comparing the specified statistic and threshold. The specified statistic value is used as the first operand.</p>
/// <p>The values <code>LessThanLowerOrGreaterThanUpperThreshold</code>, <code>LessThanLowerThreshold</code>, and <code>GreaterThanUpperThreshold</code> are used only for alarms based on anomaly detection models.</p>
pub fn set_comparison_operator(
mut self,
input: std::option::Option<crate::model::ComparisonOperator>,
) -> Self {
self.inner = self.inner.set_comparison_operator(input);
self
}
/// <p> Sets how this alarm is to handle missing data points. If <code>TreatMissingData</code> is omitted, the default behavior of <code>missing</code> is used. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarms-and-missing-data">Configuring How CloudWatch Alarms Treats Missing Data</a>.</p>
/// <p>Valid Values: <code>breaching | notBreaching | ignore | missing</code> </p>
pub fn treat_missing_data(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.treat_missing_data(input.into());
self
}
/// <p> Sets how this alarm is to handle missing data points. If <code>TreatMissingData</code> is omitted, the default behavior of <code>missing</code> is used. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarms-and-missing-data">Configuring How CloudWatch Alarms Treats Missing Data</a>.</p>
/// <p>Valid Values: <code>breaching | notBreaching | ignore | missing</code> </p>
pub fn set_treat_missing_data(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_treat_missing_data(input);
self
}
/// <p> Used only for alarms based on percentiles. If you specify <code>ignore</code>, the alarm state does not change during periods with too few data points to be statistically significant. If you specify <code>evaluate</code> or omit this parameter, the alarm is always evaluated and possibly changes state no matter how many data points are available. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#percentiles-with-low-samples">Percentile-Based CloudWatch Alarms and Low Data Samples</a>.</p>
/// <p>Valid Values: <code>evaluate | ignore</code> </p>
pub fn evaluate_low_sample_count_percentile(
mut self,
input: impl Into<std::string::String>,
) -> Self {
self.inner = self
.inner
.evaluate_low_sample_count_percentile(input.into());
self
}
/// <p> Used only for alarms based on percentiles. If you specify <code>ignore</code>, the alarm state does not change during periods with too few data points to be statistically significant. If you specify <code>evaluate</code> or omit this parameter, the alarm is always evaluated and possibly changes state no matter how many data points are available. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#percentiles-with-low-samples">Percentile-Based CloudWatch Alarms and Low Data Samples</a>.</p>
/// <p>Valid Values: <code>evaluate | ignore</code> </p>
pub fn set_evaluate_low_sample_count_percentile(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_evaluate_low_sample_count_percentile(input);
self
}
/// Appends an item to `Metrics`.
///
/// To override the contents of this collection use [`set_metrics`](Self::set_metrics).
///
/// <p>An array of <code>MetricDataQuery</code> structures that enable you to create an alarm based on the result of a metric math expression. For each <code>PutMetricAlarm</code> operation, you must specify either <code>MetricName</code> or a <code>Metrics</code> array.</p>
/// <p>Each item in the <code>Metrics</code> array either retrieves a metric or performs a math expression.</p>
/// <p>One item in the <code>Metrics</code> array is the expression that the alarm watches. You designate this expression by setting <code>ReturnData</code> to true for this object in the array. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDataQuery.html">MetricDataQuery</a>.</p>
/// <p>If you use the <code>Metrics</code> parameter, you cannot include the <code>MetricName</code>, <code>Dimensions</code>, <code>Period</code>, <code>Namespace</code>, <code>Statistic</code>, or <code>ExtendedStatistic</code> parameters of <code>PutMetricAlarm</code> in the same operation. Instead, you retrieve the metrics you are using in your math expression as part of the <code>Metrics</code> array.</p>
pub fn metrics(mut self, input: crate::model::MetricDataQuery) -> Self {
self.inner = self.inner.metrics(input);
self
}
/// <p>An array of <code>MetricDataQuery</code> structures that enable you to create an alarm based on the result of a metric math expression. For each <code>PutMetricAlarm</code> operation, you must specify either <code>MetricName</code> or a <code>Metrics</code> array.</p>
/// <p>Each item in the <code>Metrics</code> array either retrieves a metric or performs a math expression.</p>
/// <p>One item in the <code>Metrics</code> array is the expression that the alarm watches. You designate this expression by setting <code>ReturnData</code> to true for this object in the array. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDataQuery.html">MetricDataQuery</a>.</p>
/// <p>If you use the <code>Metrics</code> parameter, you cannot include the <code>MetricName</code>, <code>Dimensions</code>, <code>Period</code>, <code>Namespace</code>, <code>Statistic</code>, or <code>ExtendedStatistic</code> parameters of <code>PutMetricAlarm</code> in the same operation. Instead, you retrieve the metrics you are using in your math expression as part of the <code>Metrics</code> array.</p>
pub fn set_metrics(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::MetricDataQuery>>,
) -> Self {
self.inner = self.inner.set_metrics(input);
self
}
/// Appends an item to `Tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>A list of key-value pairs to associate with the alarm. You can associate as many as 50 tags with an alarm.</p>
/// <p>Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.</p>
/// <p>If you are using this operation to update an existing alarm, any tags you specify in this parameter are ignored. To change the tags of an existing alarm, use <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_TagResource.html">TagResource</a> or <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_UntagResource.html">UntagResource</a>.</p>
pub fn tags(mut self, input: crate::model::Tag) -> Self {
self.inner = self.inner.tags(input);
self
}
/// <p>A list of key-value pairs to associate with the alarm. You can associate as many as 50 tags with an alarm.</p>
/// <p>Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.</p>
/// <p>If you are using this operation to update an existing alarm, any tags you specify in this parameter are ignored. To change the tags of an existing alarm, use <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_TagResource.html">TagResource</a> or <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_UntagResource.html">UntagResource</a>.</p>
pub fn set_tags(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Tag>>,
) -> Self {
self.inner = self.inner.set_tags(input);
self
}
/// <p>If this is an alarm based on an anomaly detection model, make this value match the ID of the <code>ANOMALY_DETECTION_BAND</code> function.</p>
/// <p>For an example of how to use this parameter, see the <b>Anomaly Detection Model Alarm</b> example on this page.</p>
/// <p>If your alarm uses this parameter, it cannot have Auto Scaling actions.</p>
pub fn threshold_metric_id(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.threshold_metric_id(input.into());
self
}
/// <p>If this is an alarm based on an anomaly detection model, make this value match the ID of the <code>ANOMALY_DETECTION_BAND</code> function.</p>
/// <p>For an example of how to use this parameter, see the <b>Anomaly Detection Model Alarm</b> example on this page.</p>
/// <p>If your alarm uses this parameter, it cannot have Auto Scaling actions.</p>
pub fn set_threshold_metric_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_threshold_metric_id(input);
self
}
}
/// Fluent builder constructing a request to `PutMetricData`.
///
/// <p>Publishes metric data points to Amazon CloudWatch. CloudWatch associates the data points with the specified metric. If the specified metric does not exist, CloudWatch creates the metric. When CloudWatch creates a metric, it can take up to fifteen minutes for the metric to appear in calls to <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_ListMetrics.html">ListMetrics</a>.</p>
/// <p>You can publish either individual data points in the <code>Value</code> field, or arrays of values and the number of times each value occurred during the period by using the <code>Values</code> and <code>Counts</code> fields in the <code>MetricDatum</code> structure. Using the <code>Values</code> and <code>Counts</code> method enables you to publish up to 150 values per metric with one <code>PutMetricData</code> request, and supports retrieving percentile statistics on this data.</p>
/// <p>Each <code>PutMetricData</code> request is limited to 40 KB in size for HTTP POST requests. You can send a payload compressed by gzip. Each request is also limited to no more than 20 different metrics.</p>
/// <p>Although the <code>Value</code> parameter accepts numbers of type <code>Double</code>, CloudWatch rejects values that are either too small or too large. Values must be in the range of -2^360 to 2^360. In addition, special values (for example, NaN, +Infinity, -Infinity) are not supported.</p>
/// <p>You can use up to 10 dimensions per metric to further clarify what data the metric collects. Each dimension consists of a Name and Value pair. For more information about specifying dimensions, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/publishingMetrics.html">Publishing Metrics</a> in the <i>Amazon CloudWatch User Guide</i>.</p>
/// <p>You specify the time stamp to be associated with each data point. You can specify time stamps that are as much as two weeks before the current date, and as much as 2 hours after the current day and time.</p>
/// <p>Data points with time stamps from 24 hours ago or longer can take at least 48 hours to become available for <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_GetMetricData.html">GetMetricData</a> or <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_GetMetricStatistics.html">GetMetricStatistics</a> from the time they are submitted. Data points with time stamps between 3 and 24 hours ago can take as much as 2 hours to become available for for <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_GetMetricData.html">GetMetricData</a> or <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_GetMetricStatistics.html">GetMetricStatistics</a>.</p>
/// <p>CloudWatch needs raw data points to calculate percentile statistics. If you publish data using a statistic set instead, you can only retrieve percentile statistics for this data if one of the following conditions is true:</p>
/// <ul>
/// <li> <p>The <code>SampleCount</code> value of the statistic set is 1 and <code>Min</code>, <code>Max</code>, and <code>Sum</code> are all equal.</p> </li>
/// <li> <p>The <code>Min</code> and <code>Max</code> are equal, and <code>Sum</code> is equal to <code>Min</code> multiplied by <code>SampleCount</code>.</p> </li>
/// </ul>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct PutMetricData<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::put_metric_data_input::Builder,
}
impl<C, M, R> PutMetricData<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `PutMetricData`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::PutMetricDataOutput,
aws_smithy_http::result::SdkError<crate::error::PutMetricDataError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::PutMetricDataInputOperationOutputAlias,
crate::output::PutMetricDataOutput,
crate::error::PutMetricDataError,
crate::input::PutMetricDataInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The namespace for the metric data.</p>
/// <p>To avoid conflicts with Amazon Web Services service namespaces, you should not specify a namespace that begins with <code>AWS/</code> </p>
pub fn namespace(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.namespace(input.into());
self
}
/// <p>The namespace for the metric data.</p>
/// <p>To avoid conflicts with Amazon Web Services service namespaces, you should not specify a namespace that begins with <code>AWS/</code> </p>
pub fn set_namespace(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_namespace(input);
self
}
/// Appends an item to `MetricData`.
///
/// To override the contents of this collection use [`set_metric_data`](Self::set_metric_data).
///
/// <p>The data for the metric. The array can include no more than 20 metrics per call.</p>
pub fn metric_data(mut self, input: crate::model::MetricDatum) -> Self {
self.inner = self.inner.metric_data(input);
self
}
/// <p>The data for the metric. The array can include no more than 20 metrics per call.</p>
pub fn set_metric_data(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::MetricDatum>>,
) -> Self {
self.inner = self.inner.set_metric_data(input);
self
}
}
/// Fluent builder constructing a request to `PutMetricStream`.
///
/// <p>Creates or updates a metric stream. Metric streams can automatically stream CloudWatch metrics to Amazon Web Services destinations including Amazon S3 and to many third-party solutions.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Metric-Streams.html"> Using Metric Streams</a>.</p>
/// <p>To create a metric stream, you must be logged on to an account that has the <code>iam:PassRole</code> permission and either the <code>CloudWatchFullAccess</code> policy or the <code>cloudwatch:PutMetricStream</code> permission.</p>
/// <p>When you create or update a metric stream, you choose one of the following:</p>
/// <ul>
/// <li> <p>Stream metrics from all metric namespaces in the account.</p> </li>
/// <li> <p>Stream metrics from all metric namespaces in the account, except for the namespaces that you list in <code>ExcludeFilters</code>.</p> </li>
/// <li> <p>Stream metrics from only the metric namespaces that you list in <code>IncludeFilters</code>.</p> </li>
/// </ul>
/// <p>When you use <code>PutMetricStream</code> to create a new metric stream, the stream is created in the <code>running</code> state. If you use it to update an existing stream, the state of the stream is not changed.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct PutMetricStream<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::put_metric_stream_input::Builder,
}
impl<C, M, R> PutMetricStream<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `PutMetricStream`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::PutMetricStreamOutput,
aws_smithy_http::result::SdkError<crate::error::PutMetricStreamError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::PutMetricStreamInputOperationOutputAlias,
crate::output::PutMetricStreamOutput,
crate::error::PutMetricStreamError,
crate::input::PutMetricStreamInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>If you are creating a new metric stream, this is the name for the new stream. The name must be different than the names of other metric streams in this account and Region.</p>
/// <p>If you are updating a metric stream, specify the name of that stream here.</p>
/// <p>Valid characters are A-Z, a-z, 0-9, "-" and "_".</p>
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.name(input.into());
self
}
/// <p>If you are creating a new metric stream, this is the name for the new stream. The name must be different than the names of other metric streams in this account and Region.</p>
/// <p>If you are updating a metric stream, specify the name of that stream here.</p>
/// <p>Valid characters are A-Z, a-z, 0-9, "-" and "_".</p>
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_name(input);
self
}
/// Appends an item to `IncludeFilters`.
///
/// To override the contents of this collection use [`set_include_filters`](Self::set_include_filters).
///
/// <p>If you specify this parameter, the stream sends only the metrics from the metric namespaces that you specify here.</p>
/// <p>You cannot include <code>IncludeFilters</code> and <code>ExcludeFilters</code> in the same operation.</p>
pub fn include_filters(mut self, input: crate::model::MetricStreamFilter) -> Self {
self.inner = self.inner.include_filters(input);
self
}
/// <p>If you specify this parameter, the stream sends only the metrics from the metric namespaces that you specify here.</p>
/// <p>You cannot include <code>IncludeFilters</code> and <code>ExcludeFilters</code> in the same operation.</p>
pub fn set_include_filters(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::MetricStreamFilter>>,
) -> Self {
self.inner = self.inner.set_include_filters(input);
self
}
/// Appends an item to `ExcludeFilters`.
///
/// To override the contents of this collection use [`set_exclude_filters`](Self::set_exclude_filters).
///
/// <p>If you specify this parameter, the stream sends metrics from all metric namespaces except for the namespaces that you specify here.</p>
/// <p>You cannot include <code>ExcludeFilters</code> and <code>IncludeFilters</code> in the same operation.</p>
pub fn exclude_filters(mut self, input: crate::model::MetricStreamFilter) -> Self {
self.inner = self.inner.exclude_filters(input);
self
}
/// <p>If you specify this parameter, the stream sends metrics from all metric namespaces except for the namespaces that you specify here.</p>
/// <p>You cannot include <code>ExcludeFilters</code> and <code>IncludeFilters</code> in the same operation.</p>
pub fn set_exclude_filters(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::MetricStreamFilter>>,
) -> Self {
self.inner = self.inner.set_exclude_filters(input);
self
}
/// <p>The ARN of the Amazon Kinesis Firehose delivery stream to use for this metric stream. This Amazon Kinesis Firehose delivery stream must already exist and must be in the same account as the metric stream.</p>
pub fn firehose_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.firehose_arn(input.into());
self
}
/// <p>The ARN of the Amazon Kinesis Firehose delivery stream to use for this metric stream. This Amazon Kinesis Firehose delivery stream must already exist and must be in the same account as the metric stream.</p>
pub fn set_firehose_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_firehose_arn(input);
self
}
/// <p>The ARN of an IAM role that this metric stream will use to access Amazon Kinesis Firehose resources. This IAM role must already exist and must be in the same account as the metric stream. This IAM role must include the following permissions:</p>
/// <ul>
/// <li> <p>firehose:PutRecord</p> </li>
/// <li> <p>firehose:PutRecordBatch</p> </li>
/// </ul>
pub fn role_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.role_arn(input.into());
self
}
/// <p>The ARN of an IAM role that this metric stream will use to access Amazon Kinesis Firehose resources. This IAM role must already exist and must be in the same account as the metric stream. This IAM role must include the following permissions:</p>
/// <ul>
/// <li> <p>firehose:PutRecord</p> </li>
/// <li> <p>firehose:PutRecordBatch</p> </li>
/// </ul>
pub fn set_role_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_role_arn(input);
self
}
/// <p>The output format for the stream. Valid values are <code>json</code> and <code>opentelemetry0.7</code>. For more information about metric stream output formats, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-metric-streams-formats.html"> Metric streams output formats</a>.</p>
pub fn output_format(mut self, input: crate::model::MetricStreamOutputFormat) -> Self {
self.inner = self.inner.output_format(input);
self
}
/// <p>The output format for the stream. Valid values are <code>json</code> and <code>opentelemetry0.7</code>. For more information about metric stream output formats, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-metric-streams-formats.html"> Metric streams output formats</a>.</p>
pub fn set_output_format(
mut self,
input: std::option::Option<crate::model::MetricStreamOutputFormat>,
) -> Self {
self.inner = self.inner.set_output_format(input);
self
}
/// Appends an item to `Tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>A list of key-value pairs to associate with the metric stream. You can associate as many as 50 tags with a metric stream.</p>
/// <p>Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.</p>
/// <p>You can use this parameter only when you are creating a new metric stream. If you are using this operation to update an existing metric stream, any tags you specify in this parameter are ignored. To change the tags of an existing metric stream, use <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_TagResource.html">TagResource</a> or <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_UntagResource.html">UntagResource</a>.</p>
pub fn tags(mut self, input: crate::model::Tag) -> Self {
self.inner = self.inner.tags(input);
self
}
/// <p>A list of key-value pairs to associate with the metric stream. You can associate as many as 50 tags with a metric stream.</p>
/// <p>Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.</p>
/// <p>You can use this parameter only when you are creating a new metric stream. If you are using this operation to update an existing metric stream, any tags you specify in this parameter are ignored. To change the tags of an existing metric stream, use <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_TagResource.html">TagResource</a> or <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_UntagResource.html">UntagResource</a>.</p>
pub fn set_tags(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Tag>>,
) -> Self {
self.inner = self.inner.set_tags(input);
self
}
}
/// Fluent builder constructing a request to `SetAlarmState`.
///
/// <p>Temporarily sets the state of an alarm for testing purposes. When the updated state differs from the previous value, the action configured for the appropriate state is invoked. For example, if your alarm is configured to send an Amazon SNS message when an alarm is triggered, temporarily changing the alarm state to <code>ALARM</code> sends an SNS message.</p>
/// <p>Metric alarms returns to their actual state quickly, often within seconds. Because the metric alarm state change happens quickly, it is typically only visible in the alarm's <b>History</b> tab in the Amazon CloudWatch console or through <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeAlarmHistory.html">DescribeAlarmHistory</a>.</p>
/// <p>If you use <code>SetAlarmState</code> on a composite alarm, the composite alarm is not guaranteed to return to its actual state. It returns to its actual state only once any of its children alarms change state. It is also reevaluated if you update its configuration.</p>
/// <p>If an alarm triggers EC2 Auto Scaling policies or application Auto Scaling policies, you must include information in the <code>StateReasonData</code> parameter to enable the policy to take the correct action.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct SetAlarmState<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::set_alarm_state_input::Builder,
}
impl<C, M, R> SetAlarmState<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `SetAlarmState`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::SetAlarmStateOutput,
aws_smithy_http::result::SdkError<crate::error::SetAlarmStateError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::SetAlarmStateInputOperationOutputAlias,
crate::output::SetAlarmStateOutput,
crate::error::SetAlarmStateError,
crate::input::SetAlarmStateInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The name of the alarm.</p>
pub fn alarm_name(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.alarm_name(input.into());
self
}
/// <p>The name of the alarm.</p>
pub fn set_alarm_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_alarm_name(input);
self
}
/// <p>The value of the state.</p>
pub fn state_value(mut self, input: crate::model::StateValue) -> Self {
self.inner = self.inner.state_value(input);
self
}
/// <p>The value of the state.</p>
pub fn set_state_value(
mut self,
input: std::option::Option<crate::model::StateValue>,
) -> Self {
self.inner = self.inner.set_state_value(input);
self
}
/// <p>The reason that this alarm is set to this specific state, in text format.</p>
pub fn state_reason(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.state_reason(input.into());
self
}
/// <p>The reason that this alarm is set to this specific state, in text format.</p>
pub fn set_state_reason(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_state_reason(input);
self
}
/// <p>The reason that this alarm is set to this specific state, in JSON format.</p>
/// <p>For SNS or EC2 alarm actions, this is just informational. But for EC2 Auto Scaling or application Auto Scaling alarm actions, the Auto Scaling policy uses the information in this field to take the correct action.</p>
pub fn state_reason_data(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.state_reason_data(input.into());
self
}
/// <p>The reason that this alarm is set to this specific state, in JSON format.</p>
/// <p>For SNS or EC2 alarm actions, this is just informational. But for EC2 Auto Scaling or application Auto Scaling alarm actions, the Auto Scaling policy uses the information in this field to take the correct action.</p>
pub fn set_state_reason_data(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.inner = self.inner.set_state_reason_data(input);
self
}
}
/// Fluent builder constructing a request to `StartMetricStreams`.
///
/// <p>Starts the streaming of metrics for one or more of your metric streams.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct StartMetricStreams<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::start_metric_streams_input::Builder,
}
impl<C, M, R> StartMetricStreams<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `StartMetricStreams`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::StartMetricStreamsOutput,
aws_smithy_http::result::SdkError<crate::error::StartMetricStreamsError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::StartMetricStreamsInputOperationOutputAlias,
crate::output::StartMetricStreamsOutput,
crate::error::StartMetricStreamsError,
crate::input::StartMetricStreamsInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// Appends an item to `Names`.
///
/// To override the contents of this collection use [`set_names`](Self::set_names).
///
/// <p>The array of the names of metric streams to start streaming.</p>
/// <p>This is an "all or nothing" operation. If you do not have permission to access all of the metric streams that you list here, then none of the streams that you list in the operation will start streaming.</p>
pub fn names(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.names(input.into());
self
}
/// <p>The array of the names of metric streams to start streaming.</p>
/// <p>This is an "all or nothing" operation. If you do not have permission to access all of the metric streams that you list here, then none of the streams that you list in the operation will start streaming.</p>
pub fn set_names(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.inner = self.inner.set_names(input);
self
}
}
/// Fluent builder constructing a request to `StopMetricStreams`.
///
/// <p>Stops the streaming of metrics for one or more of your metric streams.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct StopMetricStreams<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::stop_metric_streams_input::Builder,
}
impl<C, M, R> StopMetricStreams<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `StopMetricStreams`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::StopMetricStreamsOutput,
aws_smithy_http::result::SdkError<crate::error::StopMetricStreamsError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::StopMetricStreamsInputOperationOutputAlias,
crate::output::StopMetricStreamsOutput,
crate::error::StopMetricStreamsError,
crate::input::StopMetricStreamsInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// Appends an item to `Names`.
///
/// To override the contents of this collection use [`set_names`](Self::set_names).
///
/// <p>The array of the names of metric streams to stop streaming.</p>
/// <p>This is an "all or nothing" operation. If you do not have permission to access all of the metric streams that you list here, then none of the streams that you list in the operation will stop streaming.</p>
pub fn names(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.names(input.into());
self
}
/// <p>The array of the names of metric streams to stop streaming.</p>
/// <p>This is an "all or nothing" operation. If you do not have permission to access all of the metric streams that you list here, then none of the streams that you list in the operation will stop streaming.</p>
pub fn set_names(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.inner = self.inner.set_names(input);
self
}
}
/// Fluent builder constructing a request to `TagResource`.
///
/// <p>Assigns one or more tags (key-value pairs) to the specified CloudWatch resource. Currently, the only CloudWatch resources that can be tagged are alarms and Contributor Insights rules.</p>
/// <p>Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.</p>
/// <p>Tags don't have any semantic meaning to Amazon Web Services and are interpreted strictly as strings of characters.</p>
/// <p>You can use the <code>TagResource</code> action with an alarm that already has tags. If you specify a new tag key for the alarm, this tag is appended to the list of tags associated with the alarm. If you specify a tag key that is already associated with the alarm, the new tag value that you specify replaces the previous value for that tag.</p>
/// <p>You can associate as many as 50 tags with a CloudWatch resource.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct TagResource<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::tag_resource_input::Builder,
}
impl<C, M, R> TagResource<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `TagResource`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::TagResourceOutput,
aws_smithy_http::result::SdkError<crate::error::TagResourceError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::TagResourceInputOperationOutputAlias,
crate::output::TagResourceOutput,
crate::error::TagResourceError,
crate::input::TagResourceInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The ARN of the CloudWatch resource that you're adding tags to.</p>
/// <p>The ARN format of an alarm is <code>arn:aws:cloudwatch:<i>Region</i>:<i>account-id</i>:alarm:<i>alarm-name</i> </code> </p>
/// <p>The ARN format of a Contributor Insights rule is <code>arn:aws:cloudwatch:<i>Region</i>:<i>account-id</i>:insight-rule:<i>insight-rule-name</i> </code> </p>
/// <p>For more information about ARN format, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/list_amazoncloudwatch.html#amazoncloudwatch-resources-for-iam-policies"> Resource Types Defined by Amazon CloudWatch</a> in the <i>Amazon Web Services General Reference</i>.</p>
pub fn resource_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.resource_arn(input.into());
self
}
/// <p>The ARN of the CloudWatch resource that you're adding tags to.</p>
/// <p>The ARN format of an alarm is <code>arn:aws:cloudwatch:<i>Region</i>:<i>account-id</i>:alarm:<i>alarm-name</i> </code> </p>
/// <p>The ARN format of a Contributor Insights rule is <code>arn:aws:cloudwatch:<i>Region</i>:<i>account-id</i>:insight-rule:<i>insight-rule-name</i> </code> </p>
/// <p>For more information about ARN format, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/list_amazoncloudwatch.html#amazoncloudwatch-resources-for-iam-policies"> Resource Types Defined by Amazon CloudWatch</a> in the <i>Amazon Web Services General Reference</i>.</p>
pub fn set_resource_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_resource_arn(input);
self
}
/// Appends an item to `Tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>The list of key-value pairs to associate with the alarm.</p>
pub fn tags(mut self, input: crate::model::Tag) -> Self {
self.inner = self.inner.tags(input);
self
}
/// <p>The list of key-value pairs to associate with the alarm.</p>
pub fn set_tags(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Tag>>,
) -> Self {
self.inner = self.inner.set_tags(input);
self
}
}
/// Fluent builder constructing a request to `UntagResource`.
///
/// <p>Removes one or more tags from the specified resource.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct UntagResource<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::untag_resource_input::Builder,
}
impl<C, M, R> UntagResource<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `UntagResource`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::UntagResourceOutput,
aws_smithy_http::result::SdkError<crate::error::UntagResourceError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::UntagResourceInputOperationOutputAlias,
crate::output::UntagResourceOutput,
crate::error::UntagResourceError,
crate::input::UntagResourceInputOperationRetryAlias,
>,
{
let op = self
.inner
.build()
.map_err(|err| aws_smithy_http::result::SdkError::ConstructionFailure(err.into()))?
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The ARN of the CloudWatch resource that you're removing tags from.</p>
/// <p>The ARN format of an alarm is <code>arn:aws:cloudwatch:<i>Region</i>:<i>account-id</i>:alarm:<i>alarm-name</i> </code> </p>
/// <p>The ARN format of a Contributor Insights rule is <code>arn:aws:cloudwatch:<i>Region</i>:<i>account-id</i>:insight-rule:<i>insight-rule-name</i> </code> </p>
/// <p>For more information about ARN format, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/list_amazoncloudwatch.html#amazoncloudwatch-resources-for-iam-policies"> Resource Types Defined by Amazon CloudWatch</a> in the <i>Amazon Web Services General Reference</i>.</p>
pub fn resource_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.resource_arn(input.into());
self
}
/// <p>The ARN of the CloudWatch resource that you're removing tags from.</p>
/// <p>The ARN format of an alarm is <code>arn:aws:cloudwatch:<i>Region</i>:<i>account-id</i>:alarm:<i>alarm-name</i> </code> </p>
/// <p>The ARN format of a Contributor Insights rule is <code>arn:aws:cloudwatch:<i>Region</i>:<i>account-id</i>:insight-rule:<i>insight-rule-name</i> </code> </p>
/// <p>For more information about ARN format, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/list_amazoncloudwatch.html#amazoncloudwatch-resources-for-iam-policies"> Resource Types Defined by Amazon CloudWatch</a> in the <i>Amazon Web Services General Reference</i>.</p>
pub fn set_resource_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_resource_arn(input);
self
}
/// Appends an item to `TagKeys`.
///
/// To override the contents of this collection use [`set_tag_keys`](Self::set_tag_keys).
///
/// <p>The list of tag keys to remove from the resource.</p>
pub fn tag_keys(mut self, input: impl Into<std::string::String>) -> Self {
self.inner = self.inner.tag_keys(input.into());
self
}
/// <p>The list of tag keys to remove from the resource.</p>
pub fn set_tag_keys(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.inner = self.inner.set_tag_keys(input);
self
}
}
}
impl<C> Client<C, crate::middleware::DefaultMiddleware, aws_smithy_client::retry::Standard> {
/// Creates a client with the given service config and connector override.
pub fn from_conf_conn(conf: crate::Config, conn: C) -> Self {
let retry_config = conf.retry_config.as_ref().cloned().unwrap_or_default();
let timeout_config = conf.timeout_config.as_ref().cloned().unwrap_or_default();
let sleep_impl = conf.sleep_impl.clone();
let mut builder = aws_smithy_client::Builder::new()
.connector(conn)
.middleware(crate::middleware::DefaultMiddleware::new());
builder.set_retry_config(retry_config.into());
builder.set_timeout_config(timeout_config);
if let Some(sleep_impl) = sleep_impl {
builder.set_sleep_impl(Some(sleep_impl));
}
let client = builder.build();
Self {
handle: std::sync::Arc::new(Handle { client, conf }),
}
}
}
impl
Client<
aws_smithy_client::erase::DynConnector,
crate::middleware::DefaultMiddleware,
aws_smithy_client::retry::Standard,
>
{
/// Creates a new client from a shared config.
#[cfg(any(feature = "rustls", feature = "native-tls"))]
pub fn new(config: &aws_types::config::Config) -> Self {
Self::from_conf(config.into())
}
/// Creates a new client from the service [`Config`](crate::Config).
#[cfg(any(feature = "rustls", feature = "native-tls"))]
pub fn from_conf(conf: crate::Config) -> Self {
let retry_config = conf.retry_config.as_ref().cloned().unwrap_or_default();
let timeout_config = conf.timeout_config.as_ref().cloned().unwrap_or_default();
let sleep_impl = conf.sleep_impl.clone();
let mut builder = aws_smithy_client::Builder::dyn_https()
.middleware(crate::middleware::DefaultMiddleware::new());
builder.set_retry_config(retry_config.into());
builder.set_timeout_config(timeout_config);
// the builder maintains a try-state. To avoid suppressing the warning when sleep is unset,
// only set it if we actually have a sleep impl.
if let Some(sleep_impl) = sleep_impl {
builder.set_sleep_impl(Some(sleep_impl));
}
let client = builder.build();
Self {
handle: std::sync::Arc::new(Handle { client, conf }),
}
}
}