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
|
// Copyright 2021 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Code generated file. DO NOT EDIT.
// Package monitoring provides access to the Cloud Monitoring API.
//
// For product documentation, see: https://cloud.google.com/monitoring/api/
//
// Creating a client
//
// Usage example:
//
// import "google.golang.org/api/monitoring/v1"
// ...
// ctx := context.Background()
// monitoringService, err := monitoring.NewService(ctx)
//
// In this example, Google Application Default Credentials are used for authentication.
//
// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
//
// Other authentication options
//
// By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
//
// monitoringService, err := monitoring.NewService(ctx, option.WithScopes(monitoring.MonitoringWriteScope))
//
// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
//
// monitoringService, err := monitoring.NewService(ctx, option.WithAPIKey("AIza..."))
//
// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
//
// config := &oauth2.Config{...}
// // ...
// token, err := config.Exchange(ctx, ...)
// monitoringService, err := monitoring.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
//
// See https://godoc.org/google.golang.org/api/option/ for details on options.
package monitoring // import "google.golang.org/api/monitoring/v1"
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"net/url"
"strconv"
"strings"
googleapi "google.golang.org/api/googleapi"
gensupport "google.golang.org/api/internal/gensupport"
option "google.golang.org/api/option"
internaloption "google.golang.org/api/option/internaloption"
htransport "google.golang.org/api/transport/http"
)
// Always reference these packages, just in case the auto-generated code
// below doesn't.
var _ = bytes.NewBuffer
var _ = strconv.Itoa
var _ = fmt.Sprintf
var _ = json.NewDecoder
var _ = io.Copy
var _ = url.Parse
var _ = gensupport.MarshalJSON
var _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = context.Canceled
var _ = internaloption.WithDefaultEndpoint
const apiId = "monitoring:v1"
const apiName = "monitoring"
const apiVersion = "v1"
const basePath = "https://monitoring.googleapis.com/"
const mtlsBasePath = "https://monitoring.mtls.googleapis.com/"
// OAuth2 scopes used by this API.
const (
// See, edit, configure, and delete your Google Cloud data and see the
// email address for your Google Account.
CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
// View and write monitoring data for all of your Google and third-party
// Cloud and API projects
MonitoringScope = "https://www.googleapis.com/auth/monitoring"
// View monitoring data for all of your Google Cloud and third-party
// projects
MonitoringReadScope = "https://www.googleapis.com/auth/monitoring.read"
// Publish metric data to your Google Cloud projects
MonitoringWriteScope = "https://www.googleapis.com/auth/monitoring.write"
)
// NewService creates a new Service.
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
scopesOption := option.WithScopes(
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/monitoring",
"https://www.googleapis.com/auth/monitoring.read",
"https://www.googleapis.com/auth/monitoring.write",
)
// NOTE: prepend, so we don't override user-specified scopes.
opts = append([]option.ClientOption{scopesOption}, opts...)
opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
client, endpoint, err := htransport.NewClient(ctx, opts...)
if err != nil {
return nil, err
}
s, err := New(client)
if err != nil {
return nil, err
}
if endpoint != "" {
s.BasePath = endpoint
}
return s, nil
}
// New creates a new Service. It uses the provided http.Client for requests.
//
// Deprecated: please use NewService instead.
// To provide a custom HTTP client, use option.WithHTTPClient.
// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
}
s := &Service{client: client, BasePath: basePath}
s.Locations = NewLocationsService(s)
s.Operations = NewOperationsService(s)
s.Projects = NewProjectsService(s)
return s, nil
}
type Service struct {
client *http.Client
BasePath string // API endpoint base URL
UserAgent string // optional additional User-Agent fragment
Locations *LocationsService
Operations *OperationsService
Projects *ProjectsService
}
func (s *Service) userAgent() string {
if s.UserAgent == "" {
return googleapi.UserAgent
}
return googleapi.UserAgent + " " + s.UserAgent
}
func NewLocationsService(s *Service) *LocationsService {
rs := &LocationsService{s: s}
rs.Global = NewLocationsGlobalService(s)
return rs
}
type LocationsService struct {
s *Service
Global *LocationsGlobalService
}
func NewLocationsGlobalService(s *Service) *LocationsGlobalService {
rs := &LocationsGlobalService{s: s}
rs.MetricsScopes = NewLocationsGlobalMetricsScopesService(s)
return rs
}
type LocationsGlobalService struct {
s *Service
MetricsScopes *LocationsGlobalMetricsScopesService
}
func NewLocationsGlobalMetricsScopesService(s *Service) *LocationsGlobalMetricsScopesService {
rs := &LocationsGlobalMetricsScopesService{s: s}
rs.Projects = NewLocationsGlobalMetricsScopesProjectsService(s)
return rs
}
type LocationsGlobalMetricsScopesService struct {
s *Service
Projects *LocationsGlobalMetricsScopesProjectsService
}
func NewLocationsGlobalMetricsScopesProjectsService(s *Service) *LocationsGlobalMetricsScopesProjectsService {
rs := &LocationsGlobalMetricsScopesProjectsService{s: s}
return rs
}
type LocationsGlobalMetricsScopesProjectsService struct {
s *Service
}
func NewOperationsService(s *Service) *OperationsService {
rs := &OperationsService{s: s}
return rs
}
type OperationsService struct {
s *Service
}
func NewProjectsService(s *Service) *ProjectsService {
rs := &ProjectsService{s: s}
rs.Dashboards = NewProjectsDashboardsService(s)
rs.Location = NewProjectsLocationService(s)
return rs
}
type ProjectsService struct {
s *Service
Dashboards *ProjectsDashboardsService
Location *ProjectsLocationService
}
func NewProjectsDashboardsService(s *Service) *ProjectsDashboardsService {
rs := &ProjectsDashboardsService{s: s}
return rs
}
type ProjectsDashboardsService struct {
s *Service
}
func NewProjectsLocationService(s *Service) *ProjectsLocationService {
rs := &ProjectsLocationService{s: s}
rs.Prometheus = NewProjectsLocationPrometheusService(s)
return rs
}
type ProjectsLocationService struct {
s *Service
Prometheus *ProjectsLocationPrometheusService
}
func NewProjectsLocationPrometheusService(s *Service) *ProjectsLocationPrometheusService {
rs := &ProjectsLocationPrometheusService{s: s}
rs.Api = NewProjectsLocationPrometheusApiService(s)
return rs
}
type ProjectsLocationPrometheusService struct {
s *Service
Api *ProjectsLocationPrometheusApiService
}
func NewProjectsLocationPrometheusApiService(s *Service) *ProjectsLocationPrometheusApiService {
rs := &ProjectsLocationPrometheusApiService{s: s}
rs.V1 = NewProjectsLocationPrometheusApiV1Service(s)
return rs
}
type ProjectsLocationPrometheusApiService struct {
s *Service
V1 *ProjectsLocationPrometheusApiV1Service
}
func NewProjectsLocationPrometheusApiV1Service(s *Service) *ProjectsLocationPrometheusApiV1Service {
rs := &ProjectsLocationPrometheusApiV1Service{s: s}
rs.Label = NewProjectsLocationPrometheusApiV1LabelService(s)
rs.Metadata = NewProjectsLocationPrometheusApiV1MetadataService(s)
return rs
}
type ProjectsLocationPrometheusApiV1Service struct {
s *Service
Label *ProjectsLocationPrometheusApiV1LabelService
Metadata *ProjectsLocationPrometheusApiV1MetadataService
}
func NewProjectsLocationPrometheusApiV1LabelService(s *Service) *ProjectsLocationPrometheusApiV1LabelService {
rs := &ProjectsLocationPrometheusApiV1LabelService{s: s}
return rs
}
type ProjectsLocationPrometheusApiV1LabelService struct {
s *Service
}
func NewProjectsLocationPrometheusApiV1MetadataService(s *Service) *ProjectsLocationPrometheusApiV1MetadataService {
rs := &ProjectsLocationPrometheusApiV1MetadataService{s: s}
return rs
}
type ProjectsLocationPrometheusApiV1MetadataService struct {
s *Service
}
// Aggregation: Describes how to combine multiple time series to provide
// a different view of the data. Aggregation of time series is done in
// two steps. First, each time series in the set is aligned to the same
// time interval boundaries, then the set of time series is optionally
// reduced in number.Alignment consists of applying the
// per_series_aligner operation to each time series after its data has
// been divided into regular alignment_period time intervals. This
// process takes all of the data points in an alignment period, applies
// a mathematical transformation such as averaging, minimum, maximum,
// delta, etc., and converts them into a single data point per
// period.Reduction is when the aligned and transformed time series can
// optionally be combined, reducing the number of time series through
// similar mathematical transformations. Reduction involves applying a
// cross_series_reducer to all the time series, optionally sorting the
// time series into subsets with group_by_fields, and applying the
// reducer to each subset.The raw time series data can contain a huge
// amount of information from multiple sources. Alignment and reduction
// transforms this mass of data into a more manageable and
// representative collection of data, for example "the 95% latency
// across the average of all tasks in a cluster". This representative
// data can be more easily graphed and comprehended, and the individual
// time series data is still available for later drilldown. For more
// details, see Filtering and aggregation
// (https://cloud.google.com/monitoring/api/v3/aggregation).
type Aggregation struct {
// AlignmentPeriod: The alignment_period specifies a time interval, in
// seconds, that is used to divide the data in all the time series into
// consistent blocks of time. This will be done before the per-series
// aligner can be applied to the data.The value must be at least 60
// seconds. If a per-series aligner other than ALIGN_NONE is specified,
// this field is required or an error is returned. If no per-series
// aligner is specified, or the aligner ALIGN_NONE is specified, then
// this field is ignored.The maximum value of the alignment_period is 2
// years, or 104 weeks.
AlignmentPeriod string `json:"alignmentPeriod,omitempty"`
// CrossSeriesReducer: The reduction operation to be used to combine
// time series into a single time series, where the value of each data
// point in the resulting series is a function of all the already
// aligned values in the input time series.Not all reducer operations
// can be applied to all time series. The valid choices depend on the
// metric_kind and the value_type of the original time series. Reduction
// can yield a time series with a different metric_kind or value_type
// than the input time series.Time series data must first be aligned
// (see per_series_aligner) in order to perform cross-time series
// reduction. If cross_series_reducer is specified, then
// per_series_aligner must be specified, and must not be ALIGN_NONE. An
// alignment_period must also be specified; otherwise, an error is
// returned.
//
// Possible values:
// "REDUCE_NONE" - No cross-time series reduction. The output of the
// Aligner is returned.
// "REDUCE_MEAN" - Reduce by computing the mean value across time
// series for each alignment period. This reducer is valid for DELTA and
// GAUGE metrics with numeric or distribution values. The value_type of
// the output is DOUBLE.
// "REDUCE_MIN" - Reduce by computing the minimum value across time
// series for each alignment period. This reducer is valid for DELTA and
// GAUGE metrics with numeric values. The value_type of the output is
// the same as the value_type of the input.
// "REDUCE_MAX" - Reduce by computing the maximum value across time
// series for each alignment period. This reducer is valid for DELTA and
// GAUGE metrics with numeric values. The value_type of the output is
// the same as the value_type of the input.
// "REDUCE_SUM" - Reduce by computing the sum across time series for
// each alignment period. This reducer is valid for DELTA and GAUGE
// metrics with numeric and distribution values. The value_type of the
// output is the same as the value_type of the input.
// "REDUCE_STDDEV" - Reduce by computing the standard deviation across
// time series for each alignment period. This reducer is valid for
// DELTA and GAUGE metrics with numeric or distribution values. The
// value_type of the output is DOUBLE.
// "REDUCE_COUNT" - Reduce by computing the number of data points
// across time series for each alignment period. This reducer is valid
// for DELTA and GAUGE metrics of numeric, Boolean, distribution, and
// string value_type. The value_type of the output is INT64.
// "REDUCE_COUNT_TRUE" - Reduce by computing the number of True-valued
// data points across time series for each alignment period. This
// reducer is valid for DELTA and GAUGE metrics of Boolean value_type.
// The value_type of the output is INT64.
// "REDUCE_COUNT_FALSE" - Reduce by computing the number of
// False-valued data points across time series for each alignment
// period. This reducer is valid for DELTA and GAUGE metrics of Boolean
// value_type. The value_type of the output is INT64.
// "REDUCE_FRACTION_TRUE" - Reduce by computing the ratio of the
// number of True-valued data points to the total number of data points
// for each alignment period. This reducer is valid for DELTA and GAUGE
// metrics of Boolean value_type. The output value is in the range 0.0,
// 1.0 and has value_type DOUBLE.
// "REDUCE_PERCENTILE_99" - Reduce by computing the 99th percentile
// (https://en.wikipedia.org/wiki/Percentile) of data points across time
// series for each alignment period. This reducer is valid for GAUGE and
// DELTA metrics of numeric and distribution type. The value of the
// output is DOUBLE.
// "REDUCE_PERCENTILE_95" - Reduce by computing the 95th percentile
// (https://en.wikipedia.org/wiki/Percentile) of data points across time
// series for each alignment period. This reducer is valid for GAUGE and
// DELTA metrics of numeric and distribution type. The value of the
// output is DOUBLE.
// "REDUCE_PERCENTILE_50" - Reduce by computing the 50th percentile
// (https://en.wikipedia.org/wiki/Percentile) of data points across time
// series for each alignment period. This reducer is valid for GAUGE and
// DELTA metrics of numeric and distribution type. The value of the
// output is DOUBLE.
// "REDUCE_PERCENTILE_05" - Reduce by computing the 5th percentile
// (https://en.wikipedia.org/wiki/Percentile) of data points across time
// series for each alignment period. This reducer is valid for GAUGE and
// DELTA metrics of numeric and distribution type. The value of the
// output is DOUBLE.
CrossSeriesReducer string `json:"crossSeriesReducer,omitempty"`
// GroupByFields: The set of fields to preserve when
// cross_series_reducer is specified. The group_by_fields determine how
// the time series are partitioned into subsets prior to applying the
// aggregation operation. Each subset contains time series that have the
// same value for each of the grouping fields. Each individual time
// series is a member of exactly one subset. The cross_series_reducer is
// applied to each subset of time series. It is not possible to reduce
// across different resource types, so this field implicitly contains
// resource.type. Fields not specified in group_by_fields are aggregated
// away. If group_by_fields is not specified and all the time series
// have the same resource type, then the time series are aggregated into
// a single output time series. If cross_series_reducer is not defined,
// this field is ignored.
GroupByFields []string `json:"groupByFields,omitempty"`
// PerSeriesAligner: An Aligner describes how to bring the data points
// in a single time series into temporal alignment. Except for
// ALIGN_NONE, all alignments cause all the data points in an
// alignment_period to be mathematically grouped together, resulting in
// a single data point for each alignment_period with end timestamp at
// the end of the period.Not all alignment operations may be applied to
// all time series. The valid choices depend on the metric_kind and
// value_type of the original time series. Alignment can change the
// metric_kind or the value_type of the time series.Time series data
// must be aligned in order to perform cross-time series reduction. If
// cross_series_reducer is specified, then per_series_aligner must be
// specified and not equal to ALIGN_NONE and alignment_period must be
// specified; otherwise, an error is returned.
//
// Possible values:
// "ALIGN_NONE" - No alignment. Raw data is returned. Not valid if
// cross-series reduction is requested. The value_type of the result is
// the same as the value_type of the input.
// "ALIGN_DELTA" - Align and convert to DELTA. The output is delta =
// y1 - y0.This alignment is valid for CUMULATIVE and DELTA metrics. If
// the selected alignment period results in periods with no data, then
// the aligned value for such a period is created by interpolation. The
// value_type of the aligned result is the same as the value_type of the
// input.
// "ALIGN_RATE" - Align and convert to a rate. The result is computed
// as rate = (y1 - y0)/(t1 - t0), or "delta over time". Think of this
// aligner as providing the slope of the line that passes through the
// value at the start and at the end of the alignment_period.This
// aligner is valid for CUMULATIVE and DELTA metrics with numeric
// values. If the selected alignment period results in periods with no
// data, then the aligned value for such a period is created by
// interpolation. The output is a GAUGE metric with value_type
// DOUBLE.If, by "rate", you mean "percentage change", see the
// ALIGN_PERCENT_CHANGE aligner instead.
// "ALIGN_INTERPOLATE" - Align by interpolating between adjacent
// points around the alignment period boundary. This aligner is valid
// for GAUGE metrics with numeric values. The value_type of the aligned
// result is the same as the value_type of the input.
// "ALIGN_NEXT_OLDER" - Align by moving the most recent data point
// before the end of the alignment period to the boundary at the end of
// the alignment period. This aligner is valid for GAUGE metrics. The
// value_type of the aligned result is the same as the value_type of the
// input.
// "ALIGN_MIN" - Align the time series by returning the minimum value
// in each alignment period. This aligner is valid for GAUGE and DELTA
// metrics with numeric values. The value_type of the aligned result is
// the same as the value_type of the input.
// "ALIGN_MAX" - Align the time series by returning the maximum value
// in each alignment period. This aligner is valid for GAUGE and DELTA
// metrics with numeric values. The value_type of the aligned result is
// the same as the value_type of the input.
// "ALIGN_MEAN" - Align the time series by returning the mean value in
// each alignment period. This aligner is valid for GAUGE and DELTA
// metrics with numeric values. The value_type of the aligned result is
// DOUBLE.
// "ALIGN_COUNT" - Align the time series by returning the number of
// values in each alignment period. This aligner is valid for GAUGE and
// DELTA metrics with numeric or Boolean values. The value_type of the
// aligned result is INT64.
// "ALIGN_SUM" - Align the time series by returning the sum of the
// values in each alignment period. This aligner is valid for GAUGE and
// DELTA metrics with numeric and distribution values. The value_type of
// the aligned result is the same as the value_type of the input.
// "ALIGN_STDDEV" - Align the time series by returning the standard
// deviation of the values in each alignment period. This aligner is
// valid for GAUGE and DELTA metrics with numeric values. The value_type
// of the output is DOUBLE.
// "ALIGN_COUNT_TRUE" - Align the time series by returning the number
// of True values in each alignment period. This aligner is valid for
// GAUGE metrics with Boolean values. The value_type of the output is
// INT64.
// "ALIGN_COUNT_FALSE" - Align the time series by returning the number
// of False values in each alignment period. This aligner is valid for
// GAUGE metrics with Boolean values. The value_type of the output is
// INT64.
// "ALIGN_FRACTION_TRUE" - Align the time series by returning the
// ratio of the number of True values to the total number of values in
// each alignment period. This aligner is valid for GAUGE metrics with
// Boolean values. The output value is in the range 0.0, 1.0 and has
// value_type DOUBLE.
// "ALIGN_PERCENTILE_99" - Align the time series by using percentile
// aggregation (https://en.wikipedia.org/wiki/Percentile). The resulting
// data point in each alignment period is the 99th percentile of all
// data points in the period. This aligner is valid for GAUGE and DELTA
// metrics with distribution values. The output is a GAUGE metric with
// value_type DOUBLE.
// "ALIGN_PERCENTILE_95" - Align the time series by using percentile
// aggregation (https://en.wikipedia.org/wiki/Percentile). The resulting
// data point in each alignment period is the 95th percentile of all
// data points in the period. This aligner is valid for GAUGE and DELTA
// metrics with distribution values. The output is a GAUGE metric with
// value_type DOUBLE.
// "ALIGN_PERCENTILE_50" - Align the time series by using percentile
// aggregation (https://en.wikipedia.org/wiki/Percentile). The resulting
// data point in each alignment period is the 50th percentile of all
// data points in the period. This aligner is valid for GAUGE and DELTA
// metrics with distribution values. The output is a GAUGE metric with
// value_type DOUBLE.
// "ALIGN_PERCENTILE_05" - Align the time series by using percentile
// aggregation (https://en.wikipedia.org/wiki/Percentile). The resulting
// data point in each alignment period is the 5th percentile of all data
// points in the period. This aligner is valid for GAUGE and DELTA
// metrics with distribution values. The output is a GAUGE metric with
// value_type DOUBLE.
// "ALIGN_PERCENT_CHANGE" - Align and convert to a percentage change.
// This aligner is valid for GAUGE and DELTA metrics with numeric
// values. This alignment returns ((current - previous)/previous) * 100,
// where the value of previous is determined based on the
// alignment_period.If the values of current and previous are both 0,
// then the returned value is 0. If only previous is 0, the returned
// value is infinity.A 10-minute moving mean is computed at each point
// of the alignment period prior to the above calculation to smooth the
// metric and prevent false positives from very short-lived spikes. The
// moving mean is only applicable for data whose values are >= 0. Any
// values < 0 are treated as a missing datapoint, and are ignored. While
// DELTA metrics are accepted by this alignment, special care should be
// taken that the values for the metric will always be positive. The
// output is a GAUGE metric with value_type DOUBLE.
PerSeriesAligner string `json:"perSeriesAligner,omitempty"`
// ForceSendFields is a list of field names (e.g. "AlignmentPeriod") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "AlignmentPeriod") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *Aggregation) MarshalJSON() ([]byte, error) {
type NoMethod Aggregation
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// AlertChart: A chart that displays alert policy data.
type AlertChart struct {
// Name: Required. The resource name of the alert policy. The format is:
// projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID]
Name string `json:"name,omitempty"`
// ForceSendFields is a list of field names (e.g. "Name") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Name") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *AlertChart) MarshalJSON() ([]byte, error) {
type NoMethod AlertChart
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Axis: A chart axis.
type Axis struct {
// Label: The label of the axis.
Label string `json:"label,omitempty"`
// Scale: The axis scale. By default, a linear scale is used.
//
// Possible values:
// "SCALE_UNSPECIFIED" - Scale is unspecified. The view will default
// to LINEAR.
// "LINEAR" - Linear scale.
// "LOG10" - Logarithmic scale (base 10).
Scale string `json:"scale,omitempty"`
// ForceSendFields is a list of field names (e.g. "Label") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Label") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Axis) MarshalJSON() ([]byte, error) {
type NoMethod Axis
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ChartOptions: Options to control visual rendering of a chart.
type ChartOptions struct {
// Mode: The chart mode.
//
// Possible values:
// "MODE_UNSPECIFIED" - Mode is unspecified. The view will default to
// COLOR.
// "COLOR" - The chart distinguishes data series using different
// color. Line colors may get reused when there are many lines in the
// chart.
// "X_RAY" - The chart uses the Stackdriver x-ray mode, in which each
// data set is plotted using the same semi-transparent color.
// "STATS" - The chart displays statistics such as average, median,
// 95th percentile, and more.
Mode string `json:"mode,omitempty"`
// ForceSendFields is a list of field names (e.g. "Mode") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Mode") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ChartOptions) MarshalJSON() ([]byte, error) {
type NoMethod ChartOptions
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Column: Defines the layout properties and content for a column.
type Column struct {
// Weight: The relative weight of this column. The column weight is used
// to adjust the width of columns on the screen (relative to peers).
// Greater the weight, greater the width of the column on the screen. If
// omitted, a value of 1 is used while rendering.
Weight int64 `json:"weight,omitempty,string"`
// Widgets: The display widgets arranged vertically in this column.
Widgets []*Widget `json:"widgets,omitempty"`
// ForceSendFields is a list of field names (e.g. "Weight") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Weight") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Column) MarshalJSON() ([]byte, error) {
type NoMethod Column
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ColumnLayout: A simplified layout that divides the available space
// into vertical columns and arranges a set of widgets vertically in
// each column.
type ColumnLayout struct {
// Columns: The columns of content to display.
Columns []*Column `json:"columns,omitempty"`
// ForceSendFields is a list of field names (e.g. "Columns") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Columns") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ColumnLayout) MarshalJSON() ([]byte, error) {
type NoMethod ColumnLayout
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Dashboard: A Google Stackdriver dashboard. Dashboards define the
// content and layout of pages in the Stackdriver web application.
type Dashboard struct {
// ColumnLayout: The content is divided into equally spaced columns and
// the widgets are arranged vertically.
ColumnLayout *ColumnLayout `json:"columnLayout,omitempty"`
// DisplayName: Required. The mutable, human-readable name.
DisplayName string `json:"displayName,omitempty"`
// Etag: etag is used for optimistic concurrency control as a way to
// help prevent simultaneous updates of a policy from overwriting each
// other. An etag is returned in the response to GetDashboard, and users
// are expected to put that etag in the request to UpdateDashboard to
// ensure that their change will be applied to the same version of the
// Dashboard configuration. The field should not be passed during
// dashboard creation.
Etag string `json:"etag,omitempty"`
// GridLayout: Content is arranged with a basic layout that re-flows a
// simple list of informational elements like widgets or tiles.
GridLayout *GridLayout `json:"gridLayout,omitempty"`
// Labels: Labels applied to the dashboard
Labels map[string]string `json:"labels,omitempty"`
// MosaicLayout: The content is arranged as a grid of tiles, with each
// content widget occupying one or more grid blocks.
MosaicLayout *MosaicLayout `json:"mosaicLayout,omitempty"`
// Name: Immutable. The resource name of the dashboard.
Name string `json:"name,omitempty"`
// RowLayout: The content is divided into equally spaced rows and the
// widgets are arranged horizontally.
RowLayout *RowLayout `json:"rowLayout,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "ColumnLayout") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ColumnLayout") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Dashboard) MarshalJSON() ([]byte, error) {
type NoMethod Dashboard
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// DataSet: Groups a time series query definition with charting options.
type DataSet struct {
// LegendTemplate: A template string for naming TimeSeries in the
// resulting data set. This should be a string with interpolations of
// the form ${label_name}, which will resolve to the label's value.
LegendTemplate string `json:"legendTemplate,omitempty"`
// MinAlignmentPeriod: Optional. The lower bound on data point frequency
// for this data set, implemented by specifying the minimum alignment
// period to use in a time series query For example, if the data is
// published once every 10 minutes, the min_alignment_period should be
// at least 10 minutes. It would not make sense to fetch and align data
// at one minute intervals.
MinAlignmentPeriod string `json:"minAlignmentPeriod,omitempty"`
// PlotType: How this data should be plotted on the chart.
//
// Possible values:
// "PLOT_TYPE_UNSPECIFIED" - Plot type is unspecified. The view will
// default to LINE.
// "LINE" - The data is plotted as a set of lines (one line per
// series).
// "STACKED_AREA" - The data is plotted as a set of filled areas (one
// area per series), with the areas stacked vertically (the base of each
// area is the top of its predecessor, and the base of the first area is
// the X axis). Since the areas do not overlap, each is filled with a
// different opaque color.
// "STACKED_BAR" - The data is plotted as a set of rectangular boxes
// (one box per series), with the boxes stacked vertically (the base of
// each box is the top of its predecessor, and the base of the first box
// is the X axis). Since the boxes do not overlap, each is filled with a
// different opaque color.
// "HEATMAP" - The data is plotted as a heatmap. The series being
// plotted must have a DISTRIBUTION value type. The value of each bucket
// in the distribution is displayed as a color. This type is not
// currently available in the Stackdriver Monitoring application.
PlotType string `json:"plotType,omitempty"`
// TargetAxis: Optional. The target axis to use for plotting the metric.
//
// Possible values:
// "TARGET_AXIS_UNSPECIFIED" - The target axis was not specified.
// Defaults to Y1.
// "Y1" - The y_axis (the right axis of chart).
// "Y2" - The y2_axis (the left axis of chart).
TargetAxis string `json:"targetAxis,omitempty"`
// TimeSeriesQuery: Required. Fields for querying time series data from
// the Stackdriver metrics API.
TimeSeriesQuery *TimeSeriesQuery `json:"timeSeriesQuery,omitempty"`
// ForceSendFields is a list of field names (e.g. "LegendTemplate") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "LegendTemplate") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *DataSet) MarshalJSON() ([]byte, error) {
type NoMethod DataSet
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// DroppedLabels: A set of (label, value) pairs that were removed from a
// Distribution time series during aggregation and then added as an
// attachment to a Distribution.Exemplar.The full label set for the
// exemplars is constructed by using the dropped pairs in combination
// with the label values that remain on the aggregated Distribution time
// series. The constructed full label set can be used to identify the
// specific entity, such as the instance or job, which might be
// contributing to a long-tail. However, with dropped labels, the
// storage requirements are reduced because only the aggregated
// distribution values for a large group of time series are stored.Note
// that there are no guarantees on ordering of the labels from
// exemplar-to-exemplar and from distribution-to-distribution in the
// same stream, and there may be duplicates. It is up to clients to
// resolve any ambiguities.
type DroppedLabels struct {
// Label: Map from label to its value, for all labels dropped in any
// aggregation.
Label map[string]string `json:"label,omitempty"`
// ForceSendFields is a list of field names (e.g. "Label") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Label") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *DroppedLabels) MarshalJSON() ([]byte, error) {
type NoMethod DroppedLabels
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Empty: A generic empty message that you can re-use to avoid defining
// duplicated empty messages in your APIs. A typical example is to use
// it as the request or the response type of an API method. For
// instance: service Foo { rpc Bar(google.protobuf.Empty) returns
// (google.protobuf.Empty); } The JSON representation for Empty is empty
// JSON object {}.
type Empty struct {
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
}
// Field: A single field of a message type.
type Field struct {
// Cardinality: The field cardinality.
//
// Possible values:
// "CARDINALITY_UNKNOWN" - For fields with unknown cardinality.
// "CARDINALITY_OPTIONAL" - For optional fields.
// "CARDINALITY_REQUIRED" - For required fields. Proto2 syntax only.
// "CARDINALITY_REPEATED" - For repeated fields.
Cardinality string `json:"cardinality,omitempty"`
// DefaultValue: The string value of the default value of this field.
// Proto2 syntax only.
DefaultValue string `json:"defaultValue,omitempty"`
// JsonName: The field JSON name.
JsonName string `json:"jsonName,omitempty"`
// Kind: The field type.
//
// Possible values:
// "TYPE_UNKNOWN" - Field type unknown.
// "TYPE_DOUBLE" - Field type double.
// "TYPE_FLOAT" - Field type float.
// "TYPE_INT64" - Field type int64.
// "TYPE_UINT64" - Field type uint64.
// "TYPE_INT32" - Field type int32.
// "TYPE_FIXED64" - Field type fixed64.
// "TYPE_FIXED32" - Field type fixed32.
// "TYPE_BOOL" - Field type bool.
// "TYPE_STRING" - Field type string.
// "TYPE_GROUP" - Field type group. Proto2 syntax only, and
// deprecated.
// "TYPE_MESSAGE" - Field type message.
// "TYPE_BYTES" - Field type bytes.
// "TYPE_UINT32" - Field type uint32.
// "TYPE_ENUM" - Field type enum.
// "TYPE_SFIXED32" - Field type sfixed32.
// "TYPE_SFIXED64" - Field type sfixed64.
// "TYPE_SINT32" - Field type sint32.
// "TYPE_SINT64" - Field type sint64.
Kind string `json:"kind,omitempty"`
// Name: The field name.
Name string `json:"name,omitempty"`
// Number: The field number.
Number int64 `json:"number,omitempty"`
// OneofIndex: The index of the field type in Type.oneofs, for message
// or enumeration types. The first type has index 1; zero means the type
// is not in the list.
OneofIndex int64 `json:"oneofIndex,omitempty"`
// Options: The protocol buffer options.
Options []*Option `json:"options,omitempty"`
// Packed: Whether to use alternative packed wire representation.
Packed bool `json:"packed,omitempty"`
// TypeUrl: The field type URL, without the scheme, for message or
// enumeration types. Example:
// "type.googleapis.com/google.protobuf.Timestamp".
TypeUrl string `json:"typeUrl,omitempty"`
// ForceSendFields is a list of field names (e.g. "Cardinality") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Cardinality") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Field) MarshalJSON() ([]byte, error) {
type NoMethod Field
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GaugeView: A gauge chart shows where the current value sits within a
// pre-defined range. The upper and lower bounds should define the
// possible range of values for the scorecard's query (inclusive).
type GaugeView struct {
// LowerBound: The lower bound for this gauge chart. The value of the
// chart should always be greater than or equal to this.
LowerBound float64 `json:"lowerBound,omitempty"`
// UpperBound: The upper bound for this gauge chart. The value of the
// chart should always be less than or equal to this.
UpperBound float64 `json:"upperBound,omitempty"`
// ForceSendFields is a list of field names (e.g. "LowerBound") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "LowerBound") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *GaugeView) MarshalJSON() ([]byte, error) {
type NoMethod GaugeView
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
func (s *GaugeView) UnmarshalJSON(data []byte) error {
type NoMethod GaugeView
var s1 struct {
LowerBound gensupport.JSONFloat64 `json:"lowerBound"`
UpperBound gensupport.JSONFloat64 `json:"upperBound"`
*NoMethod
}
s1.NoMethod = (*NoMethod)(s)
if err := json.Unmarshal(data, &s1); err != nil {
return err
}
s.LowerBound = float64(s1.LowerBound)
s.UpperBound = float64(s1.UpperBound)
return nil
}
// GridLayout: A basic layout divides the available space into vertical
// columns of equal width and arranges a list of widgets using a
// row-first strategy.
type GridLayout struct {
// Columns: The number of columns into which the view's width is
// divided. If omitted or set to zero, a system default will be used
// while rendering.
Columns int64 `json:"columns,omitempty,string"`
// Widgets: The informational elements that are arranged into the
// columns row-first.
Widgets []*Widget `json:"widgets,omitempty"`
// ForceSendFields is a list of field names (e.g. "Columns") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Columns") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *GridLayout) MarshalJSON() ([]byte, error) {
type NoMethod GridLayout
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// HttpBody: Message that represents an arbitrary HTTP body. It should
// only be used for payload formats that can't be represented as JSON,
// such as raw binary or an HTML page.This message can be used both in
// streaming and non-streaming API methods in the request as well as the
// response.It can be used as a top-level request field, which is
// convenient if one wants to extract parameters from either the URL or
// HTTP template into the request fields and also want access to the raw
// HTTP body.Example: message GetResourceRequest { // A unique request
// id. string request_id = 1; // The raw HTTP body is bound to this
// field. google.api.HttpBody http_body = 2; } service ResourceService {
// rpc GetResource(GetResourceRequest) returns (google.api.HttpBody);
// rpc UpdateResource(google.api.HttpBody) returns
// (google.protobuf.Empty); } Example with streaming methods: service
// CaldavService { rpc GetCalendar(stream google.api.HttpBody) returns
// (stream google.api.HttpBody); rpc UpdateCalendar(stream
// google.api.HttpBody) returns (stream google.api.HttpBody); } Use of
// this type only changes how the request and response bodies are
// handled, all other features will continue to work unchanged.
type HttpBody struct {
// ContentType: The HTTP Content-Type header value specifying the
// content type of the body.
ContentType string `json:"contentType,omitempty"`
// Data: The HTTP request/response body as raw binary.
Data string `json:"data,omitempty"`
// Extensions: Application specific response metadata. Must be set in
// the first response for streaming APIs.
Extensions []googleapi.RawMessage `json:"extensions,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "ContentType") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ContentType") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *HttpBody) MarshalJSON() ([]byte, error) {
type NoMethod HttpBody
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ListDashboardsResponse: The ListDashboards request.
type ListDashboardsResponse struct {
// Dashboards: The list of requested dashboards.
Dashboards []*Dashboard `json:"dashboards,omitempty"`
// NextPageToken: If there are more results than have been returned,
// then this field is set to a non-empty value. To see the additional
// results, use that value as page_token in the next call to this
// method.
NextPageToken string `json:"nextPageToken,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Dashboards") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Dashboards") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ListDashboardsResponse) MarshalJSON() ([]byte, error) {
type NoMethod ListDashboardsResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ListMetricsScopesByMonitoredProjectResponse: Response for the
// ListMetricsScopesByMonitoredProject method.
type ListMetricsScopesByMonitoredProjectResponse struct {
// MetricsScopes: A set of all metrics scopes that the specified
// monitored project has been added to.
MetricsScopes []*MetricsScope `json:"metricsScopes,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "MetricsScopes") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "MetricsScopes") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ListMetricsScopesByMonitoredProjectResponse) MarshalJSON() ([]byte, error) {
type NoMethod ListMetricsScopesByMonitoredProjectResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// LogsPanel: A widget that displays a stream of log.
type LogsPanel struct {
// Filter: A filter that chooses which log entries to return. See
// Advanced Logs Queries
// (https://cloud.google.com/logging/docs/view/advanced-queries). Only
// log entries that match the filter are returned. An empty filter
// matches all log entries.
Filter string `json:"filter,omitempty"`
// ResourceNames: The names of logging resources to collect logs for.
// Does not implicitly include the current host project. Currently only
// projects are supported. There must be at least one resource_name.
ResourceNames []string `json:"resourceNames,omitempty"`
// ForceSendFields is a list of field names (e.g. "Filter") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Filter") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *LogsPanel) MarshalJSON() ([]byte, error) {
type NoMethod LogsPanel
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// MetricsScope: Represents a Metrics Scope
// (https://cloud.google.com/monitoring/settings#concept-scope) in Cloud
// Monitoring, which specifies one or more Google projects and zero or
// more AWS accounts to monitor together.
type MetricsScope struct {
// CreateTime: Output only. The time when this Metrics Scope was
// created.
CreateTime string `json:"createTime,omitempty"`
// MonitoredProjects: Output only. The list of projects monitored by
// this Metrics Scope.
MonitoredProjects []*MonitoredProject `json:"monitoredProjects,omitempty"`
// Name: Immutable. The resource name of the Monitoring Metrics Scope.
// On input, the resource name can be specified with the scoping project
// ID or number. On output, the resource name is specified with the
// scoping project number. Example:
// locations/global/metricsScopes/{SCOPING_PROJECT_ID_OR_NUMBER}
Name string `json:"name,omitempty"`
// UpdateTime: Output only. The time when this Metrics Scope record was
// last updated.
UpdateTime string `json:"updateTime,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "CreateTime") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "CreateTime") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *MetricsScope) MarshalJSON() ([]byte, error) {
type NoMethod MetricsScope
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// MonitoredProject: A project being monitored
// (https://cloud.google.com/monitoring/settings/multiple-projects#create-multi)
// by a Metrics Scope.
type MonitoredProject struct {
// CreateTime: Output only. The time when this MonitoredProject was
// created.
CreateTime string `json:"createTime,omitempty"`
// Name: Immutable. The resource name of the MonitoredProject. On input,
// the resource name includes the scoping project ID and monitored
// project ID. On output, it contains the equivalent project numbers.
// Example:
// locations/global/metricsScopes/{SCOPING_PROJECT_ID_OR_NUMBER}/projects
// /{MONITORED_PROJECT_ID_OR_NUMBER}
Name string `json:"name,omitempty"`
// ForceSendFields is a list of field names (e.g. "CreateTime") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "CreateTime") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *MonitoredProject) MarshalJSON() ([]byte, error) {
type NoMethod MonitoredProject
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// MosaicLayout: A mosaic layout divides the available space into a grid
// of blocks, and overlays the grid with tiles. Unlike GridLayout, tiles
// may span multiple grid blocks and can be placed at arbitrary
// locations in the grid.
type MosaicLayout struct {
// Columns: The number of columns in the mosaic grid. The number of
// columns must be between 1 and 12, inclusive.
Columns int64 `json:"columns,omitempty"`
// Tiles: The tiles to display.
Tiles []*Tile `json:"tiles,omitempty"`
// ForceSendFields is a list of field names (e.g. "Columns") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Columns") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *MosaicLayout) MarshalJSON() ([]byte, error) {
type NoMethod MosaicLayout
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Operation: This resource represents a long-running operation that is
// the result of a network API call.
type Operation struct {
// Done: If the value is false, it means the operation is still in
// progress. If true, the operation is completed, and either error or
// response is available.
Done bool `json:"done,omitempty"`
// Error: The error result of the operation in case of failure or
// cancellation.
Error *Status `json:"error,omitempty"`
// Metadata: Service-specific metadata associated with the operation. It
// typically contains progress information and common metadata such as
// create time. Some services might not provide such metadata. Any
// method that returns a long-running operation should document the
// metadata type, if any.
Metadata googleapi.RawMessage `json:"metadata,omitempty"`
// Name: The server-assigned name, which is only unique within the same
// service that originally returns it. If you use the default HTTP
// mapping, the name should be a resource name ending with
// operations/{unique_id}.
Name string `json:"name,omitempty"`
// Response: The normal response of the operation in case of success. If
// the original method returns no data on success, such as Delete, the
// response is google.protobuf.Empty. If the original method is standard
// Get/Create/Update, the response should be the resource. For other
// methods, the response should have the type XxxResponse, where Xxx is
// the original method name. For example, if the original method name is
// TakeSnapshot(), the inferred response type is TakeSnapshotResponse.
Response googleapi.RawMessage `json:"response,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Done") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Done") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Operation) MarshalJSON() ([]byte, error) {
type NoMethod Operation
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// OperationMetadata: Contains metadata for longrunning operation for
// the edit Metrics Scope endpoints.
type OperationMetadata struct {
// CreateTime: The time when the batch request was received.
CreateTime string `json:"createTime,omitempty"`
// State: Current state of the batch operation.
//
// Possible values:
// "STATE_UNSPECIFIED" - Invalid.
// "CREATED" - Request has been received.
// "RUNNING" - Request is actively being processed.
// "DONE" - The batch processing is done.
// "CANCELLED" - The batch processing was cancelled.
State string `json:"state,omitempty"`
// UpdateTime: The time when the operation result was last updated.
UpdateTime string `json:"updateTime,omitempty"`
// ForceSendFields is a list of field names (e.g. "CreateTime") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "CreateTime") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *OperationMetadata) MarshalJSON() ([]byte, error) {
type NoMethod OperationMetadata
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Option: A protocol buffer option, which can be attached to a message,
// field, enumeration, etc.
type Option struct {
// Name: The option's name. For protobuf built-in options (options
// defined in descriptor.proto), this is the short name. For example,
// "map_entry". For custom options, it should be the fully-qualified
// name. For example, "google.api.http".
Name string `json:"name,omitempty"`
// Value: The option's value packed in an Any message. If the value is a
// primitive, the corresponding wrapper type defined in
// google/protobuf/wrappers.proto should be used. If the value is an
// enum, it should be stored as an int32 value using the
// google.protobuf.Int32Value type.
Value googleapi.RawMessage `json:"value,omitempty"`
// ForceSendFields is a list of field names (e.g. "Name") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Name") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Option) MarshalJSON() ([]byte, error) {
type NoMethod Option
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// PickTimeSeriesFilter: Describes a ranking-based time series filter.
// Each input time series is ranked with an aligner. The filter will
// allow up to num_time_series time series to pass through it, selecting
// them based on the relative ranking.For example, if ranking_method is
// METHOD_MEAN,direction is BOTTOM, and num_time_series is 3, then the 3
// times series with the lowest mean values will pass through the
// filter.
type PickTimeSeriesFilter struct {
// Direction: How to use the ranking to select time series that pass
// through the filter.
//
// Possible values:
// "DIRECTION_UNSPECIFIED" - Not allowed. You must specify a different
// Direction if you specify a PickTimeSeriesFilter.
// "TOP" - Pass the highest num_time_series ranking inputs.
// "BOTTOM" - Pass the lowest num_time_series ranking inputs.
Direction string `json:"direction,omitempty"`
// NumTimeSeries: How many time series to allow to pass through the
// filter.
NumTimeSeries int64 `json:"numTimeSeries,omitempty"`
// RankingMethod: ranking_method is applied to each time series
// independently to produce the value which will be used to compare the
// time series to other time series.
//
// Possible values:
// "METHOD_UNSPECIFIED" - Not allowed. You must specify a different
// Method if you specify a PickTimeSeriesFilter.
// "METHOD_MEAN" - Select the mean of all values.
// "METHOD_MAX" - Select the maximum value.
// "METHOD_MIN" - Select the minimum value.
// "METHOD_SUM" - Compute the sum of all values.
// "METHOD_LATEST" - Select the most recent value.
RankingMethod string `json:"rankingMethod,omitempty"`
// ForceSendFields is a list of field names (e.g. "Direction") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Direction") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *PickTimeSeriesFilter) MarshalJSON() ([]byte, error) {
type NoMethod PickTimeSeriesFilter
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// QueryInstantRequest: QueryInstantRequest holds all parameters of the
// Prometheus upstream instant query API plus GCM specific parameters.
type QueryInstantRequest struct {
// Query: A PromQL query string. Query lanauge documentation:
// https://prometheus.io/docs/prometheus/latest/querying/basics/.
Query string `json:"query,omitempty"`
// Time: The single point in time to evaluate the query for. Either
// floating point UNIX seconds or RFC3339 formatted timestamp.
Time string `json:"time,omitempty"`
// Timeout: An upper bound timeout for the query. Either a Prometheus
// duration string
// (https://prometheus.io/docs/prometheus/latest/querying/basics/#time-durations)
// or floating point seconds. This non-standard encoding must be used
// for compatibility with the open source API. Clients may still
// implement timeouts at the connection level while ignoring this field.
Timeout string `json:"timeout,omitempty"`
// ForceSendFields is a list of field names (e.g. "Query") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Query") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *QueryInstantRequest) MarshalJSON() ([]byte, error) {
type NoMethod QueryInstantRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// QueryRangeRequest: QueryRangeRequest holds all parameters of the
// Prometheus upstream range query API plus GCM specific parameters.
type QueryRangeRequest struct {
// End: The end time to evaluate the query for. Either floating point
// UNIX seconds or RFC3339 formatted timestamp.
End string `json:"end,omitempty"`
// Query: A PromQL query string. Query lanauge documentation:
// https://prometheus.io/docs/prometheus/latest/querying/basics/.
Query string `json:"query,omitempty"`
// Start: The start time to evaluate the query for. Either floating
// point UNIX seconds or RFC3339 formatted timestamp.
Start string `json:"start,omitempty"`
// Step: The resolution of query result. Either a Prometheus duration
// string
// (https://prometheus.io/docs/prometheus/latest/querying/basics/#time-durations)
// or floating point seconds. This non-standard encoding must be used
// for compatibility with the open source API. Clients may still
// implement timeouts at the connection level while ignoring this field.
Step string `json:"step,omitempty"`
// Timeout: An upper bound timeout for the query. Either a Prometheus
// duration string
// (https://prometheus.io/docs/prometheus/latest/querying/basics/#time-durations)
// or floating point seconds. This non-standard encoding must be used
// for compatibility with the open source API. Clients may still
// implement timeouts at the connection level while ignoring this field.
Timeout string `json:"timeout,omitempty"`
// ForceSendFields is a list of field names (e.g. "End") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "End") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *QueryRangeRequest) MarshalJSON() ([]byte, error) {
type NoMethod QueryRangeRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// QuerySeriesRequest: QuerySeries holds all parameters of the
// Prometheus upstream API for querying series.
type QuerySeriesRequest struct {
// End: The end time to evaluate the query for. Either floating point
// UNIX seconds or RFC3339 formatted timestamp.
End string `json:"end,omitempty"`
// Start: The start time to evaluate the query for. Either floating
// point UNIX seconds or RFC3339 formatted timestamp.
Start string `json:"start,omitempty"`
// ForceSendFields is a list of field names (e.g. "End") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "End") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *QuerySeriesRequest) MarshalJSON() ([]byte, error) {
type NoMethod QuerySeriesRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// RatioPart: Describes a query to build the numerator or denominator of
// a TimeSeriesFilterRatio.
type RatioPart struct {
// Aggregation: By default, the raw time series data is returned. Use
// this field to combine multiple time series for different views of the
// data.
Aggregation *Aggregation `json:"aggregation,omitempty"`
// Filter: Required. The monitoring filter
// (https://cloud.google.com/monitoring/api/v3/filters) that identifies
// the metric types, resources, and projects to query.
Filter string `json:"filter,omitempty"`
// ForceSendFields is a list of field names (e.g. "Aggregation") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Aggregation") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *RatioPart) MarshalJSON() ([]byte, error) {
type NoMethod RatioPart
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Row: Defines the layout properties and content for a row.
type Row struct {
// Weight: The relative weight of this row. The row weight is used to
// adjust the height of rows on the screen (relative to peers). Greater
// the weight, greater the height of the row on the screen. If omitted,
// a value of 1 is used while rendering.
Weight int64 `json:"weight,omitempty,string"`
// Widgets: The display widgets arranged horizontally in this row.
Widgets []*Widget `json:"widgets,omitempty"`
// ForceSendFields is a list of field names (e.g. "Weight") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Weight") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Row) MarshalJSON() ([]byte, error) {
type NoMethod Row
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// RowLayout: A simplified layout that divides the available space into
// rows and arranges a set of widgets horizontally in each row.
type RowLayout struct {
// Rows: The rows of content to display.
Rows []*Row `json:"rows,omitempty"`
// ForceSendFields is a list of field names (e.g. "Rows") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Rows") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *RowLayout) MarshalJSON() ([]byte, error) {
type NoMethod RowLayout
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Scorecard: A widget showing the latest value of a metric, and how
// this value relates to one or more thresholds.
type Scorecard struct {
// GaugeView: Will cause the scorecard to show a gauge chart.
GaugeView *GaugeView `json:"gaugeView,omitempty"`
// SparkChartView: Will cause the scorecard to show a spark chart.
SparkChartView *SparkChartView `json:"sparkChartView,omitempty"`
// Thresholds: The thresholds used to determine the state of the
// scorecard given the time series' current value. For an actual value
// x, the scorecard is in a danger state if x is less than or equal to a
// danger threshold that triggers below, or greater than or equal to a
// danger threshold that triggers above. Similarly, if x is above/below
// a warning threshold that triggers above/below, then the scorecard is
// in a warning state - unless x also puts it in a danger state. (Danger
// trumps warning.)As an example, consider a scorecard with the
// following four thresholds: { value: 90, category: 'DANGER', trigger:
// 'ABOVE', }, { value: 70, category: 'WARNING', trigger: 'ABOVE', }, {
// value: 10, category: 'DANGER', trigger: 'BELOW', }, { value: 20,
// category: 'WARNING', trigger: 'BELOW', }Then: values less than or
// equal to 10 would put the scorecard in a DANGER state, values greater
// than 10 but less than or equal to 20 a WARNING state, values strictly
// between 20 and 70 an OK state, values greater than or equal to 70 but
// less than 90 a WARNING state, and values greater than or equal to 90
// a DANGER state.
Thresholds []*Threshold `json:"thresholds,omitempty"`
// TimeSeriesQuery: Required. Fields for querying time series data from
// the Stackdriver metrics API.
TimeSeriesQuery *TimeSeriesQuery `json:"timeSeriesQuery,omitempty"`
// ForceSendFields is a list of field names (e.g. "GaugeView") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "GaugeView") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Scorecard) MarshalJSON() ([]byte, error) {
type NoMethod Scorecard
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SourceContext: SourceContext represents information about the source
// of a protobuf element, like the file in which it is defined.
type SourceContext struct {
// FileName: The path-qualified name of the .proto file that contained
// the associated protobuf element. For example:
// "google/protobuf/source_context.proto".
FileName string `json:"fileName,omitempty"`
// ForceSendFields is a list of field names (e.g. "FileName") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "FileName") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SourceContext) MarshalJSON() ([]byte, error) {
type NoMethod SourceContext
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SpanContext: The context of a span. This is attached to an Exemplar
// in Distribution values during aggregation.It contains the name of a
// span with format:
// projects/[PROJECT_ID_OR_NUMBER]/traces/[TRACE_ID]/spans/[SPAN_ID]
type SpanContext struct {
// SpanName: The resource name of the span. The format is:
// projects/[PROJECT_ID_OR_NUMBER]/traces/[TRACE_ID]/spans/[SPAN_ID]
// [TRACE_ID] is a unique identifier for a trace within a project; it is
// a 32-character hexadecimal encoding of a 16-byte array.[SPAN_ID] is a
// unique identifier for a span within a trace; it is a 16-character
// hexadecimal encoding of an 8-byte array.
SpanName string `json:"spanName,omitempty"`
// ForceSendFields is a list of field names (e.g. "SpanName") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "SpanName") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *SpanContext) MarshalJSON() ([]byte, error) {
type NoMethod SpanContext
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// SparkChartView: A sparkChart is a small chart suitable for inclusion
// in a table-cell or inline in text. This message contains the
// configuration for a sparkChart to show up on a Scorecard, showing
// recent trends of the scorecard's timeseries.
type SparkChartView struct {
// MinAlignmentPeriod: The lower bound on data point frequency in the
// chart implemented by specifying the minimum alignment period to use
// in a time series query. For example, if the data is published once
// every 10 minutes it would not make sense to fetch and align data at
// one minute intervals. This field is optional and exists only as a
// hint.
MinAlignmentPeriod string `json:"minAlignmentPeriod,omitempty"`
// SparkChartType: Required. The type of sparkchart to show in this
// chartView.
//
// Possible values:
// "SPARK_CHART_TYPE_UNSPECIFIED" - Not allowed in well-formed
// requests.
// "SPARK_LINE" - The sparkline will be rendered as a small line
// chart.
// "SPARK_BAR" - The sparkbar will be rendered as a small bar chart.
SparkChartType string `json:"sparkChartType,omitempty"`
// ForceSendFields is a list of field names (e.g. "MinAlignmentPeriod")
// to unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "MinAlignmentPeriod") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *SparkChartView) MarshalJSON() ([]byte, error) {
type NoMethod SparkChartView
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// StatisticalTimeSeriesFilter: A filter that ranks streams based on
// their statistical relation to other streams in a request. Note: This
// field is deprecated and completely ignored by the API.
type StatisticalTimeSeriesFilter struct {
// NumTimeSeries: How many time series to output.
NumTimeSeries int64 `json:"numTimeSeries,omitempty"`
// RankingMethod: rankingMethod is applied to a set of time series, and
// then the produced value for each individual time series is used to
// compare a given time series to others. These are methods that cannot
// be applied stream-by-stream, but rather require the full context of a
// request to evaluate time series.
//
// Possible values:
// "METHOD_UNSPECIFIED" - Not allowed in well-formed requests.
// "METHOD_CLUSTER_OUTLIER" - Compute the outlier score of each
// stream.
RankingMethod string `json:"rankingMethod,omitempty"`
// ForceSendFields is a list of field names (e.g. "NumTimeSeries") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "NumTimeSeries") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *StatisticalTimeSeriesFilter) MarshalJSON() ([]byte, error) {
type NoMethod StatisticalTimeSeriesFilter
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Status: The Status type defines a logical error model that is
// suitable for different programming environments, including REST APIs
// and RPC APIs. It is used by gRPC (https://github.com/grpc). Each
// Status message contains three pieces of data: error code, error
// message, and error details.You can find out more about this error
// model and how to work with it in the API Design Guide
// (https://cloud.google.com/apis/design/errors).
type Status struct {
// Code: The status code, which should be an enum value of
// google.rpc.Code.
Code int64 `json:"code,omitempty"`
// Details: A list of messages that carry the error details. There is a
// common set of message types for APIs to use.
Details []googleapi.RawMessage `json:"details,omitempty"`
// Message: A developer-facing error message, which should be in
// English. Any user-facing error message should be localized and sent
// in the google.rpc.Status.details field, or localized by the client.
Message string `json:"message,omitempty"`
// ForceSendFields is a list of field names (e.g. "Code") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Code") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Status) MarshalJSON() ([]byte, error) {
type NoMethod Status
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// TableDataSet: Groups a time series query definition with table
// options.
type TableDataSet struct {
// MinAlignmentPeriod: Optional. The lower bound on data point frequency
// for this data set, implemented by specifying the minimum alignment
// period to use in a time series query For example, if the data is
// published once every 10 minutes, the min_alignment_period should be
// at least 10 minutes. It would not make sense to fetch and align data
// at one minute intervals.
MinAlignmentPeriod string `json:"minAlignmentPeriod,omitempty"`
// TableDisplayOptions: Optional. Table display options for configuring
// how the table is rendered.
TableDisplayOptions *TableDisplayOptions `json:"tableDisplayOptions,omitempty"`
// TableTemplate: Optional. A template string for naming TimeSeries in
// the resulting data set. This should be a string with interpolations
// of the form ${label_name}, which will resolve to the label's value
// i.e. "${resource.labels.project_id}."
TableTemplate string `json:"tableTemplate,omitempty"`
// TimeSeriesQuery: Required. Fields for querying time series data from
// the Stackdriver metrics API.
TimeSeriesQuery *TimeSeriesQuery `json:"timeSeriesQuery,omitempty"`
// ForceSendFields is a list of field names (e.g. "MinAlignmentPeriod")
// to unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "MinAlignmentPeriod") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *TableDataSet) MarshalJSON() ([]byte, error) {
type NoMethod TableDataSet
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// TableDisplayOptions: Table display options that can be reused.
type TableDisplayOptions struct {
// ShownColumns: Optional. Columns to display in the table. Leave empty
// to display all available columns. Note: This field is for future
// features and is not currently used.
ShownColumns []string `json:"shownColumns,omitempty"`
// ForceSendFields is a list of field names (e.g. "ShownColumns") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ShownColumns") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *TableDisplayOptions) MarshalJSON() ([]byte, error) {
type NoMethod TableDisplayOptions
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Text: A widget that displays textual content.
type Text struct {
// Content: The text content to be displayed.
Content string `json:"content,omitempty"`
// Format: How the text content is formatted.
//
// Possible values:
// "FORMAT_UNSPECIFIED" - Format is unspecified. Defaults to MARKDOWN.
// "MARKDOWN" - The text contains Markdown formatting.
// "RAW" - The text contains no special formatting.
Format string `json:"format,omitempty"`
// ForceSendFields is a list of field names (e.g. "Content") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Content") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Text) MarshalJSON() ([]byte, error) {
type NoMethod Text
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Threshold: Defines a threshold for categorizing time series values.
type Threshold struct {
// Color: The state color for this threshold. Color is not allowed in a
// XyChart.
//
// Possible values:
// "COLOR_UNSPECIFIED" - Color is unspecified. Not allowed in
// well-formed requests.
// "YELLOW" - Crossing the threshold is "concerning" behavior.
// "RED" - Crossing the threshold is "emergency" behavior.
Color string `json:"color,omitempty"`
// Direction: The direction for the current threshold. Direction is not
// allowed in a XyChart.
//
// Possible values:
// "DIRECTION_UNSPECIFIED" - Not allowed in well-formed requests.
// "ABOVE" - The threshold will be considered crossed if the actual
// value is above the threshold value.
// "BELOW" - The threshold will be considered crossed if the actual
// value is below the threshold value.
Direction string `json:"direction,omitempty"`
// Label: A label for the threshold.
Label string `json:"label,omitempty"`
// TargetAxis: The target axis to use for plotting the threshold. Target
// axis is not allowed in a Scorecard.
//
// Possible values:
// "TARGET_AXIS_UNSPECIFIED" - The target axis was not specified.
// Defaults to Y1.
// "Y1" - The y_axis (the right axis of chart).
// "Y2" - The y2_axis (the left axis of chart).
TargetAxis string `json:"targetAxis,omitempty"`
// Value: The value of the threshold. The value should be defined in the
// native scale of the metric.
Value float64 `json:"value,omitempty"`
// ForceSendFields is a list of field names (e.g. "Color") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Color") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Threshold) MarshalJSON() ([]byte, error) {
type NoMethod Threshold
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
func (s *Threshold) UnmarshalJSON(data []byte) error {
type NoMethod Threshold
var s1 struct {
Value gensupport.JSONFloat64 `json:"value"`
*NoMethod
}
s1.NoMethod = (*NoMethod)(s)
if err := json.Unmarshal(data, &s1); err != nil {
return err
}
s.Value = float64(s1.Value)
return nil
}
// Tile: A single tile in the mosaic. The placement and size of the tile
// are configurable.
type Tile struct {
// Height: The height of the tile, measured in grid blocks. Tiles must
// have a minimum height of 1.
Height int64 `json:"height,omitempty"`
// Widget: The informational widget contained in the tile. For example
// an XyChart.
Widget *Widget `json:"widget,omitempty"`
// Width: The width of the tile, measured in grid blocks. Tiles must
// have a minimum width of 1.
Width int64 `json:"width,omitempty"`
// XPos: The zero-indexed position of the tile in grid blocks relative
// to the left edge of the grid. Tiles must be contained within the
// specified number of columns. x_pos cannot be negative.
XPos int64 `json:"xPos,omitempty"`
// YPos: The zero-indexed position of the tile in grid blocks relative
// to the top edge of the grid. y_pos cannot be negative.
YPos int64 `json:"yPos,omitempty"`
// ForceSendFields is a list of field names (e.g. "Height") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Height") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Tile) MarshalJSON() ([]byte, error) {
type NoMethod Tile
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// TimeSeriesFilter: A filter that defines a subset of time series data
// that is displayed in a widget. Time series data is fetched using the
// ListTimeSeries
// (https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
// method.
type TimeSeriesFilter struct {
// Aggregation: By default, the raw time series data is returned. Use
// this field to combine multiple time series for different views of the
// data.
Aggregation *Aggregation `json:"aggregation,omitempty"`
// Filter: Required. The monitoring filter
// (https://cloud.google.com/monitoring/api/v3/filters) that identifies
// the metric types, resources, and projects to query.
Filter string `json:"filter,omitempty"`
// PickTimeSeriesFilter: Ranking based time series filter.
PickTimeSeriesFilter *PickTimeSeriesFilter `json:"pickTimeSeriesFilter,omitempty"`
// SecondaryAggregation: Apply a second aggregation after aggregation is
// applied.
SecondaryAggregation *Aggregation `json:"secondaryAggregation,omitempty"`
// StatisticalTimeSeriesFilter: Statistics based time series filter.
// Note: This field is deprecated and completely ignored by the API.
StatisticalTimeSeriesFilter *StatisticalTimeSeriesFilter `json:"statisticalTimeSeriesFilter,omitempty"`
// ForceSendFields is a list of field names (e.g. "Aggregation") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Aggregation") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *TimeSeriesFilter) MarshalJSON() ([]byte, error) {
type NoMethod TimeSeriesFilter
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// TimeSeriesFilterRatio: A pair of time series filters that define a
// ratio computation. The output time series is the pair-wise division
// of each aligned element from the numerator and denominator time
// series.
type TimeSeriesFilterRatio struct {
// Denominator: The denominator of the ratio.
Denominator *RatioPart `json:"denominator,omitempty"`
// Numerator: The numerator of the ratio.
Numerator *RatioPart `json:"numerator,omitempty"`
// PickTimeSeriesFilter: Ranking based time series filter.
PickTimeSeriesFilter *PickTimeSeriesFilter `json:"pickTimeSeriesFilter,omitempty"`
// SecondaryAggregation: Apply a second aggregation after the ratio is
// computed.
SecondaryAggregation *Aggregation `json:"secondaryAggregation,omitempty"`
// StatisticalTimeSeriesFilter: Statistics based time series filter.
// Note: This field is deprecated and completely ignored by the API.
StatisticalTimeSeriesFilter *StatisticalTimeSeriesFilter `json:"statisticalTimeSeriesFilter,omitempty"`
// ForceSendFields is a list of field names (e.g. "Denominator") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Denominator") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *TimeSeriesFilterRatio) MarshalJSON() ([]byte, error) {
type NoMethod TimeSeriesFilterRatio
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// TimeSeriesQuery: TimeSeriesQuery collects the set of supported
// methods for querying time series data from the Stackdriver metrics
// API.
type TimeSeriesQuery struct {
// TimeSeriesFilter: Filter parameters to fetch time series.
TimeSeriesFilter *TimeSeriesFilter `json:"timeSeriesFilter,omitempty"`
// TimeSeriesFilterRatio: Parameters to fetch a ratio between two time
// series filters.
TimeSeriesFilterRatio *TimeSeriesFilterRatio `json:"timeSeriesFilterRatio,omitempty"`
// TimeSeriesQueryLanguage: A query used to fetch time series.
TimeSeriesQueryLanguage string `json:"timeSeriesQueryLanguage,omitempty"`
// UnitOverride: The unit of data contained in fetched time series. If
// non-empty, this unit will override any unit that accompanies fetched
// data. The format is the same as the unit
// (https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors)
// field in MetricDescriptor.
UnitOverride string `json:"unitOverride,omitempty"`
// ForceSendFields is a list of field names (e.g. "TimeSeriesFilter") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "TimeSeriesFilter") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *TimeSeriesQuery) MarshalJSON() ([]byte, error) {
type NoMethod TimeSeriesQuery
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// TimeSeriesTable: A table that displays time series data.
type TimeSeriesTable struct {
// DataSets: Required. The data displayed in this table.
DataSets []*TableDataSet `json:"dataSets,omitempty"`
// ForceSendFields is a list of field names (e.g. "DataSets") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "DataSets") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *TimeSeriesTable) MarshalJSON() ([]byte, error) {
type NoMethod TimeSeriesTable
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Type: A protocol buffer message type.
type Type struct {
// Fields: The list of fields.
Fields []*Field `json:"fields,omitempty"`
// Name: The fully qualified message name.
Name string `json:"name,omitempty"`
// Oneofs: The list of types appearing in oneof definitions in this
// type.
Oneofs []string `json:"oneofs,omitempty"`
// Options: The protocol buffer options.
Options []*Option `json:"options,omitempty"`
// SourceContext: The source context.
SourceContext *SourceContext `json:"sourceContext,omitempty"`
// Syntax: The source syntax.
//
// Possible values:
// "SYNTAX_PROTO2" - Syntax proto2.
// "SYNTAX_PROTO3" - Syntax proto3.
Syntax string `json:"syntax,omitempty"`
// ForceSendFields is a list of field names (e.g. "Fields") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Fields") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Type) MarshalJSON() ([]byte, error) {
type NoMethod Type
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Widget: Widget contains a single dashboard component and
// configuration of how to present the component in the dashboard.
type Widget struct {
// AlertChart: A chart of alert policy data.
AlertChart *AlertChart `json:"alertChart,omitempty"`
// Blank: A blank space.
Blank *Empty `json:"blank,omitempty"`
// LogsPanel: A widget that shows a stream of logs.
LogsPanel *LogsPanel `json:"logsPanel,omitempty"`
// Scorecard: A scorecard summarizing time series data.
Scorecard *Scorecard `json:"scorecard,omitempty"`
// Text: A raw string or markdown displaying textual content.
Text *Text `json:"text,omitempty"`
// TimeSeriesTable: A widget that displays time series data in a tabular
// format.
TimeSeriesTable *TimeSeriesTable `json:"timeSeriesTable,omitempty"`
// Title: Optional. The title of the widget.
Title string `json:"title,omitempty"`
// XyChart: A chart of time series data.
XyChart *XyChart `json:"xyChart,omitempty"`
// ForceSendFields is a list of field names (e.g. "AlertChart") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "AlertChart") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Widget) MarshalJSON() ([]byte, error) {
type NoMethod Widget
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// XyChart: A chart that displays data on a 2D (X and Y axes) plane.
type XyChart struct {
// ChartOptions: Display options for the chart.
ChartOptions *ChartOptions `json:"chartOptions,omitempty"`
// DataSets: Required. The data displayed in this chart.
DataSets []*DataSet `json:"dataSets,omitempty"`
// Thresholds: Threshold lines drawn horizontally across the chart.
Thresholds []*Threshold `json:"thresholds,omitempty"`
// TimeshiftDuration: The duration used to display a comparison chart. A
// comparison chart simultaneously shows values from two similar-length
// time periods (e.g., week-over-week metrics). The duration must be
// positive, and it can only be applied to charts with data sets of LINE
// plot type.
TimeshiftDuration string `json:"timeshiftDuration,omitempty"`
// XAxis: The properties applied to the X axis.
XAxis *Axis `json:"xAxis,omitempty"`
// Y2Axis: The properties applied to the Y2 axis.
Y2Axis *Axis `json:"y2Axis,omitempty"`
// YAxis: The properties applied to the Y axis.
YAxis *Axis `json:"yAxis,omitempty"`
// ForceSendFields is a list of field names (e.g. "ChartOptions") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ChartOptions") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *XyChart) MarshalJSON() ([]byte, error) {
type NoMethod XyChart
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// method id "monitoring.locations.global.metricsScopes.get":
type LocationsGlobalMetricsScopesGetCall struct {
s *Service
name string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// Get: Returns a specific Metrics Scope, including the list of projects
// monitored by the specified Metrics Scope.
//
// - name: The resource name of the Metrics Scope. Example:
// locations/global/metricsScopes/{SCOPING_PROJECT_ID_OR_NUMBER}.
func (r *LocationsGlobalMetricsScopesService) Get(name string) *LocationsGlobalMetricsScopesGetCall {
c := &LocationsGlobalMetricsScopesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *LocationsGlobalMetricsScopesGetCall) Fields(s ...googleapi.Field) *LocationsGlobalMetricsScopesGetCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *LocationsGlobalMetricsScopesGetCall) IfNoneMatch(entityTag string) *LocationsGlobalMetricsScopesGetCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *LocationsGlobalMetricsScopesGetCall) Context(ctx context.Context) *LocationsGlobalMetricsScopesGetCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *LocationsGlobalMetricsScopesGetCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *LocationsGlobalMetricsScopesGetCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("GET", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "monitoring.locations.global.metricsScopes.get" call.
// Exactly one of *MetricsScope or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *MetricsScope.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *LocationsGlobalMetricsScopesGetCall) Do(opts ...googleapi.CallOption) (*MetricsScope, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &MetricsScope{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Returns a specific Metrics Scope, including the list of projects monitored by the specified Metrics Scope.",
// "flatPath": "v1/locations/global/metricsScopes/{metricsScopesId}",
// "httpMethod": "GET",
// "id": "monitoring.locations.global.metricsScopes.get",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "Required. The resource name of the Metrics Scope. Example: locations/global/metricsScopes/{SCOPING_PROJECT_ID_OR_NUMBER}",
// "location": "path",
// "pattern": "^locations/global/metricsScopes/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1/{+name}",
// "response": {
// "$ref": "MetricsScope"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/monitoring",
// "https://www.googleapis.com/auth/monitoring.read"
// ]
// }
}
// method id "monitoring.locations.global.metricsScopes.listMetricsScopesByMonitoredProject":
type LocationsGlobalMetricsScopesListMetricsScopesByMonitoredProjectCall struct {
s *Service
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// ListMetricsScopesByMonitoredProject: Returns a list of every Metrics
// Scope that a specific MonitoredProject has been added to. The metrics
// scope representing the specified monitored project will always be the
// first entry in the response.
func (r *LocationsGlobalMetricsScopesService) ListMetricsScopesByMonitoredProject() *LocationsGlobalMetricsScopesListMetricsScopesByMonitoredProjectCall {
c := &LocationsGlobalMetricsScopesListMetricsScopesByMonitoredProjectCall{s: r.s, urlParams_: make(gensupport.URLParams)}
return c
}
// MonitoredResourceContainer sets the optional parameter
// "monitoredResourceContainer": Required. The resource name of the
// Monitored Project being requested. Example:
// projects/{MONITORED_PROJECT_ID_OR_NUMBER}
func (c *LocationsGlobalMetricsScopesListMetricsScopesByMonitoredProjectCall) MonitoredResourceContainer(monitoredResourceContainer string) *LocationsGlobalMetricsScopesListMetricsScopesByMonitoredProjectCall {
c.urlParams_.Set("monitoredResourceContainer", monitoredResourceContainer)
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *LocationsGlobalMetricsScopesListMetricsScopesByMonitoredProjectCall) Fields(s ...googleapi.Field) *LocationsGlobalMetricsScopesListMetricsScopesByMonitoredProjectCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *LocationsGlobalMetricsScopesListMetricsScopesByMonitoredProjectCall) IfNoneMatch(entityTag string) *LocationsGlobalMetricsScopesListMetricsScopesByMonitoredProjectCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *LocationsGlobalMetricsScopesListMetricsScopesByMonitoredProjectCall) Context(ctx context.Context) *LocationsGlobalMetricsScopesListMetricsScopesByMonitoredProjectCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *LocationsGlobalMetricsScopesListMetricsScopesByMonitoredProjectCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *LocationsGlobalMetricsScopesListMetricsScopesByMonitoredProjectCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/locations/global/metricsScopes:listMetricsScopesByMonitoredProject")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("GET", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "monitoring.locations.global.metricsScopes.listMetricsScopesByMonitoredProject" call.
// Exactly one of *ListMetricsScopesByMonitoredProjectResponse or error
// will be non-nil. Any non-2xx status code is an error. Response
// headers are in either
// *ListMetricsScopesByMonitoredProjectResponse.ServerResponse.Header or
// (if a response was returned at all) in
// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
// whether the returned error was because http.StatusNotModified was
// returned.
func (c *LocationsGlobalMetricsScopesListMetricsScopesByMonitoredProjectCall) Do(opts ...googleapi.CallOption) (*ListMetricsScopesByMonitoredProjectResponse, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &ListMetricsScopesByMonitoredProjectResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Returns a list of every Metrics Scope that a specific MonitoredProject has been added to. The metrics scope representing the specified monitored project will always be the first entry in the response.",
// "flatPath": "v1/locations/global/metricsScopes:listMetricsScopesByMonitoredProject",
// "httpMethod": "GET",
// "id": "monitoring.locations.global.metricsScopes.listMetricsScopesByMonitoredProject",
// "parameterOrder": [],
// "parameters": {
// "monitoredResourceContainer": {
// "description": "Required. The resource name of the Monitored Project being requested. Example: projects/{MONITORED_PROJECT_ID_OR_NUMBER}",
// "location": "query",
// "type": "string"
// }
// },
// "path": "v1/locations/global/metricsScopes:listMetricsScopesByMonitoredProject",
// "response": {
// "$ref": "ListMetricsScopesByMonitoredProjectResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/monitoring",
// "https://www.googleapis.com/auth/monitoring.read"
// ]
// }
}
// method id "monitoring.locations.global.metricsScopes.projects.create":
type LocationsGlobalMetricsScopesProjectsCreateCall struct {
s *Service
parent string
monitoredproject *MonitoredProject
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Create: Adds a MonitoredProject with the given project ID to the
// specified Metrics Scope.
//
// - parent: The resource name of the existing Metrics Scope that will
// monitor this project. Example:
// locations/global/metricsScopes/{SCOPING_PROJECT_ID_OR_NUMBER}.
func (r *LocationsGlobalMetricsScopesProjectsService) Create(parent string, monitoredproject *MonitoredProject) *LocationsGlobalMetricsScopesProjectsCreateCall {
c := &LocationsGlobalMetricsScopesProjectsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.parent = parent
c.monitoredproject = monitoredproject
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *LocationsGlobalMetricsScopesProjectsCreateCall) Fields(s ...googleapi.Field) *LocationsGlobalMetricsScopesProjectsCreateCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *LocationsGlobalMetricsScopesProjectsCreateCall) Context(ctx context.Context) *LocationsGlobalMetricsScopesProjectsCreateCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *LocationsGlobalMetricsScopesProjectsCreateCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *LocationsGlobalMetricsScopesProjectsCreateCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.monitoredproject)
if err != nil {
return nil, err
}
reqHeaders.Set("Content-Type", "application/json")
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/projects")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("POST", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"parent": c.parent,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "monitoring.locations.global.metricsScopes.projects.create" call.
// Exactly one of *Operation or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *Operation.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *LocationsGlobalMetricsScopesProjectsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &Operation{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Adds a MonitoredProject with the given project ID to the specified Metrics Scope.",
// "flatPath": "v1/locations/global/metricsScopes/{metricsScopesId}/projects",
// "httpMethod": "POST",
// "id": "monitoring.locations.global.metricsScopes.projects.create",
// "parameterOrder": [
// "parent"
// ],
// "parameters": {
// "parent": {
// "description": "Required. The resource name of the existing Metrics Scope that will monitor this project. Example: locations/global/metricsScopes/{SCOPING_PROJECT_ID_OR_NUMBER}",
// "location": "path",
// "pattern": "^locations/global/metricsScopes/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1/{+parent}/projects",
// "request": {
// "$ref": "MonitoredProject"
// },
// "response": {
// "$ref": "Operation"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/monitoring",
// "https://www.googleapis.com/auth/monitoring.write"
// ]
// }
}
// method id "monitoring.locations.global.metricsScopes.projects.delete":
type LocationsGlobalMetricsScopesProjectsDeleteCall struct {
s *Service
name string
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Delete: Deletes a MonitoredProject from the specified Metrics Scope.
//
// - name: The resource name of the MonitoredProject. Example:
// locations/global/metricsScopes/{SCOPING_PROJECT_ID_OR_NUMBER}/projec
// ts/{MONITORED_PROJECT_ID_OR_NUMBER}Authorization requires the
// following Google IAM (https://cloud.google.com/iam) permissions on
// both the Metrics Scope and on the MonitoredProject:
// monitoring.metricsScopes.link.
func (r *LocationsGlobalMetricsScopesProjectsService) Delete(name string) *LocationsGlobalMetricsScopesProjectsDeleteCall {
c := &LocationsGlobalMetricsScopesProjectsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *LocationsGlobalMetricsScopesProjectsDeleteCall) Fields(s ...googleapi.Field) *LocationsGlobalMetricsScopesProjectsDeleteCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *LocationsGlobalMetricsScopesProjectsDeleteCall) Context(ctx context.Context) *LocationsGlobalMetricsScopesProjectsDeleteCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *LocationsGlobalMetricsScopesProjectsDeleteCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *LocationsGlobalMetricsScopesProjectsDeleteCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("DELETE", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "monitoring.locations.global.metricsScopes.projects.delete" call.
// Exactly one of *Operation or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *Operation.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *LocationsGlobalMetricsScopesProjectsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &Operation{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Deletes a MonitoredProject from the specified Metrics Scope.",
// "flatPath": "v1/locations/global/metricsScopes/{metricsScopesId}/projects/{projectsId}",
// "httpMethod": "DELETE",
// "id": "monitoring.locations.global.metricsScopes.projects.delete",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "Required. The resource name of the MonitoredProject. Example: locations/global/metricsScopes/{SCOPING_PROJECT_ID_OR_NUMBER}/projects/{MONITORED_PROJECT_ID_OR_NUMBER}Authorization requires the following Google IAM (https://cloud.google.com/iam) permissions on both the Metrics Scope and on the MonitoredProject: monitoring.metricsScopes.link",
// "location": "path",
// "pattern": "^locations/global/metricsScopes/[^/]+/projects/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1/{+name}",
// "response": {
// "$ref": "Operation"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/monitoring",
// "https://www.googleapis.com/auth/monitoring.write"
// ]
// }
}
// method id "monitoring.operations.get":
type OperationsGetCall struct {
s *Service
name string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// Get: Gets the latest state of a long-running operation. Clients can
// use this method to poll the operation result at intervals as
// recommended by the API service.
//
// - name: The name of the operation resource.
func (r *OperationsService) Get(name string) *OperationsGetCall {
c := &OperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *OperationsGetCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("GET", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "monitoring.operations.get" call.
// Exactly one of *Operation or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *Operation.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &Operation{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.",
// "flatPath": "v1/operations/{operationsId}",
// "httpMethod": "GET",
// "id": "monitoring.operations.get",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "The name of the operation resource.",
// "location": "path",
// "pattern": "^operations/.*$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1/{+name}",
// "response": {
// "$ref": "Operation"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/monitoring",
// "https://www.googleapis.com/auth/monitoring.read"
// ]
// }
}
// method id "monitoring.projects.dashboards.create":
type ProjectsDashboardsCreateCall struct {
s *Service
parent string
dashboard *Dashboard
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Create: Creates a new custom dashboard. For examples on how you can
// use this API to create dashboards, see Managing dashboards by API
// (https://cloud.google.com/monitoring/dashboards/api-dashboard). This
// method requires the monitoring.dashboards.create permission on the
// specified project. For more information about permissions, see Cloud
// Identity and Access Management (https://cloud.google.com/iam).
//
// - parent: The project on which to execute the request. The format is:
// projects/[PROJECT_ID_OR_NUMBER] The [PROJECT_ID_OR_NUMBER] must
// match the dashboard resource name.
func (r *ProjectsDashboardsService) Create(parent string, dashboard *Dashboard) *ProjectsDashboardsCreateCall {
c := &ProjectsDashboardsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.parent = parent
c.dashboard = dashboard
return c
}
// ValidateOnly sets the optional parameter "validateOnly": If set,
// validate the request and preview the review, but do not actually save
// it.
func (c *ProjectsDashboardsCreateCall) ValidateOnly(validateOnly bool) *ProjectsDashboardsCreateCall {
c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ProjectsDashboardsCreateCall) Fields(s ...googleapi.Field) *ProjectsDashboardsCreateCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *ProjectsDashboardsCreateCall) Context(ctx context.Context) *ProjectsDashboardsCreateCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ProjectsDashboardsCreateCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsDashboardsCreateCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.dashboard)
if err != nil {
return nil, err
}
reqHeaders.Set("Content-Type", "application/json")
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dashboards")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("POST", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"parent": c.parent,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "monitoring.projects.dashboards.create" call.
// Exactly one of *Dashboard or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *Dashboard.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *ProjectsDashboardsCreateCall) Do(opts ...googleapi.CallOption) (*Dashboard, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &Dashboard{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Creates a new custom dashboard. For examples on how you can use this API to create dashboards, see Managing dashboards by API (https://cloud.google.com/monitoring/dashboards/api-dashboard). This method requires the monitoring.dashboards.create permission on the specified project. For more information about permissions, see Cloud Identity and Access Management (https://cloud.google.com/iam).",
// "flatPath": "v1/projects/{projectsId}/dashboards",
// "httpMethod": "POST",
// "id": "monitoring.projects.dashboards.create",
// "parameterOrder": [
// "parent"
// ],
// "parameters": {
// "parent": {
// "description": "Required. The project on which to execute the request. The format is: projects/[PROJECT_ID_OR_NUMBER] The [PROJECT_ID_OR_NUMBER] must match the dashboard resource name.",
// "location": "path",
// "pattern": "^projects/[^/]+$",
// "required": true,
// "type": "string"
// },
// "validateOnly": {
// "description": "If set, validate the request and preview the review, but do not actually save it.",
// "location": "query",
// "type": "boolean"
// }
// },
// "path": "v1/{+parent}/dashboards",
// "request": {
// "$ref": "Dashboard"
// },
// "response": {
// "$ref": "Dashboard"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/monitoring",
// "https://www.googleapis.com/auth/monitoring.write"
// ]
// }
}
// method id "monitoring.projects.dashboards.delete":
type ProjectsDashboardsDeleteCall struct {
s *Service
name string
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Delete: Deletes an existing custom dashboard.This method requires the
// monitoring.dashboards.delete permission on the specified dashboard.
// For more information, see Cloud Identity and Access Management
// (https://cloud.google.com/iam).
//
// - name: The resource name of the Dashboard. The format is:
// projects/[PROJECT_ID_OR_NUMBER]/dashboards/[DASHBOARD_ID].
func (r *ProjectsDashboardsService) Delete(name string) *ProjectsDashboardsDeleteCall {
c := &ProjectsDashboardsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ProjectsDashboardsDeleteCall) Fields(s ...googleapi.Field) *ProjectsDashboardsDeleteCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *ProjectsDashboardsDeleteCall) Context(ctx context.Context) *ProjectsDashboardsDeleteCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ProjectsDashboardsDeleteCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsDashboardsDeleteCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("DELETE", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "monitoring.projects.dashboards.delete" call.
// Exactly one of *Empty or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *Empty.ServerResponse.Header or (if a response was returned at all)
// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
// check whether the returned error was because http.StatusNotModified
// was returned.
func (c *ProjectsDashboardsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &Empty{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Deletes an existing custom dashboard.This method requires the monitoring.dashboards.delete permission on the specified dashboard. For more information, see Cloud Identity and Access Management (https://cloud.google.com/iam).",
// "flatPath": "v1/projects/{projectsId}/dashboards/{dashboardsId}",
// "httpMethod": "DELETE",
// "id": "monitoring.projects.dashboards.delete",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "Required. The resource name of the Dashboard. The format is: projects/[PROJECT_ID_OR_NUMBER]/dashboards/[DASHBOARD_ID] ",
// "location": "path",
// "pattern": "^projects/[^/]+/dashboards/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1/{+name}",
// "response": {
// "$ref": "Empty"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/monitoring",
// "https://www.googleapis.com/auth/monitoring.write"
// ]
// }
}
// method id "monitoring.projects.dashboards.get":
type ProjectsDashboardsGetCall struct {
s *Service
name string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// Get: Fetches a specific dashboard.This method requires the
// monitoring.dashboards.get permission on the specified dashboard. For
// more information, see Cloud Identity and Access Management
// (https://cloud.google.com/iam).
//
// - name: The resource name of the Dashboard. The format is one of:
// dashboards/[DASHBOARD_ID] (for system dashboards)
// projects/[PROJECT_ID_OR_NUMBER]/dashboards/[DASHBOARD_ID] (for
// custom dashboards).
func (r *ProjectsDashboardsService) Get(name string) *ProjectsDashboardsGetCall {
c := &ProjectsDashboardsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ProjectsDashboardsGetCall) Fields(s ...googleapi.Field) *ProjectsDashboardsGetCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *ProjectsDashboardsGetCall) IfNoneMatch(entityTag string) *ProjectsDashboardsGetCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *ProjectsDashboardsGetCall) Context(ctx context.Context) *ProjectsDashboardsGetCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ProjectsDashboardsGetCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsDashboardsGetCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("GET", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "monitoring.projects.dashboards.get" call.
// Exactly one of *Dashboard or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *Dashboard.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *ProjectsDashboardsGetCall) Do(opts ...googleapi.CallOption) (*Dashboard, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &Dashboard{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Fetches a specific dashboard.This method requires the monitoring.dashboards.get permission on the specified dashboard. For more information, see Cloud Identity and Access Management (https://cloud.google.com/iam).",
// "flatPath": "v1/projects/{projectsId}/dashboards/{dashboardsId}",
// "httpMethod": "GET",
// "id": "monitoring.projects.dashboards.get",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "Required. The resource name of the Dashboard. The format is one of: dashboards/[DASHBOARD_ID] (for system dashboards) projects/[PROJECT_ID_OR_NUMBER]/dashboards/[DASHBOARD_ID] (for custom dashboards).",
// "location": "path",
// "pattern": "^projects/[^/]+/dashboards/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1/{+name}",
// "response": {
// "$ref": "Dashboard"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/monitoring",
// "https://www.googleapis.com/auth/monitoring.read"
// ]
// }
}
// method id "monitoring.projects.dashboards.list":
type ProjectsDashboardsListCall struct {
s *Service
parent string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// List: Lists the existing dashboards.This method requires the
// monitoring.dashboards.list permission on the specified project. For
// more information, see Cloud Identity and Access Management
// (https://cloud.google.com/iam).
//
// - parent: The scope of the dashboards to list. The format is:
// projects/[PROJECT_ID_OR_NUMBER].
func (r *ProjectsDashboardsService) List(parent string) *ProjectsDashboardsListCall {
c := &ProjectsDashboardsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.parent = parent
return c
}
// PageSize sets the optional parameter "pageSize": A positive number
// that is the maximum number of results to return. If unspecified, a
// default of 1000 is used.
func (c *ProjectsDashboardsListCall) PageSize(pageSize int64) *ProjectsDashboardsListCall {
c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
return c
}
// PageToken sets the optional parameter "pageToken": If this field is
// not empty then it must contain the nextPageToken value returned by a
// previous call to this method. Using this field causes the method to
// return additional results from the previous method call.
func (c *ProjectsDashboardsListCall) PageToken(pageToken string) *ProjectsDashboardsListCall {
c.urlParams_.Set("pageToken", pageToken)
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ProjectsDashboardsListCall) Fields(s ...googleapi.Field) *ProjectsDashboardsListCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *ProjectsDashboardsListCall) IfNoneMatch(entityTag string) *ProjectsDashboardsListCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *ProjectsDashboardsListCall) Context(ctx context.Context) *ProjectsDashboardsListCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ProjectsDashboardsListCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsDashboardsListCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dashboards")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("GET", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"parent": c.parent,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "monitoring.projects.dashboards.list" call.
// Exactly one of *ListDashboardsResponse or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *ListDashboardsResponse.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *ProjectsDashboardsListCall) Do(opts ...googleapi.CallOption) (*ListDashboardsResponse, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &ListDashboardsResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Lists the existing dashboards.This method requires the monitoring.dashboards.list permission on the specified project. For more information, see Cloud Identity and Access Management (https://cloud.google.com/iam).",
// "flatPath": "v1/projects/{projectsId}/dashboards",
// "httpMethod": "GET",
// "id": "monitoring.projects.dashboards.list",
// "parameterOrder": [
// "parent"
// ],
// "parameters": {
// "pageSize": {
// "description": "A positive number that is the maximum number of results to return. If unspecified, a default of 1000 is used.",
// "format": "int32",
// "location": "query",
// "type": "integer"
// },
// "pageToken": {
// "description": "If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call.",
// "location": "query",
// "type": "string"
// },
// "parent": {
// "description": "Required. The scope of the dashboards to list. The format is: projects/[PROJECT_ID_OR_NUMBER] ",
// "location": "path",
// "pattern": "^projects/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1/{+parent}/dashboards",
// "response": {
// "$ref": "ListDashboardsResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/monitoring",
// "https://www.googleapis.com/auth/monitoring.read"
// ]
// }
}
// Pages invokes f for each page of results.
// A non-nil error returned from f will halt the iteration.
// The provided context supersedes any context provided to the Context method.
func (c *ProjectsDashboardsListCall) Pages(ctx context.Context, f func(*ListDashboardsResponse) error) error {
c.ctx_ = ctx
defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
for {
x, err := c.Do()
if err != nil {
return err
}
if err := f(x); err != nil {
return err
}
if x.NextPageToken == "" {
return nil
}
c.PageToken(x.NextPageToken)
}
}
// method id "monitoring.projects.dashboards.patch":
type ProjectsDashboardsPatchCall struct {
s *Service
name string
dashboard *Dashboard
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Patch: Replaces an existing custom dashboard with a new
// definition.This method requires the monitoring.dashboards.update
// permission on the specified dashboard. For more information, see
// Cloud Identity and Access Management (https://cloud.google.com/iam).
//
// - name: Immutable. The resource name of the dashboard.
func (r *ProjectsDashboardsService) Patch(name string, dashboard *Dashboard) *ProjectsDashboardsPatchCall {
c := &ProjectsDashboardsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
c.dashboard = dashboard
return c
}
// ValidateOnly sets the optional parameter "validateOnly": If set,
// validate the request and preview the review, but do not actually save
// it.
func (c *ProjectsDashboardsPatchCall) ValidateOnly(validateOnly bool) *ProjectsDashboardsPatchCall {
c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ProjectsDashboardsPatchCall) Fields(s ...googleapi.Field) *ProjectsDashboardsPatchCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *ProjectsDashboardsPatchCall) Context(ctx context.Context) *ProjectsDashboardsPatchCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ProjectsDashboardsPatchCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsDashboardsPatchCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.dashboard)
if err != nil {
return nil, err
}
reqHeaders.Set("Content-Type", "application/json")
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("PATCH", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "monitoring.projects.dashboards.patch" call.
// Exactly one of *Dashboard or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *Dashboard.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *ProjectsDashboardsPatchCall) Do(opts ...googleapi.CallOption) (*Dashboard, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &Dashboard{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Replaces an existing custom dashboard with a new definition.This method requires the monitoring.dashboards.update permission on the specified dashboard. For more information, see Cloud Identity and Access Management (https://cloud.google.com/iam).",
// "flatPath": "v1/projects/{projectsId}/dashboards/{dashboardsId}",
// "httpMethod": "PATCH",
// "id": "monitoring.projects.dashboards.patch",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "Immutable. The resource name of the dashboard.",
// "location": "path",
// "pattern": "^projects/[^/]+/dashboards/[^/]+$",
// "required": true,
// "type": "string"
// },
// "validateOnly": {
// "description": "If set, validate the request and preview the review, but do not actually save it.",
// "location": "query",
// "type": "boolean"
// }
// },
// "path": "v1/{+name}",
// "request": {
// "$ref": "Dashboard"
// },
// "response": {
// "$ref": "Dashboard"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/monitoring",
// "https://www.googleapis.com/auth/monitoring.write"
// ]
// }
}
// method id "monitoring.projects.location.prometheus.api.v1.query":
type ProjectsLocationPrometheusApiV1QueryCall struct {
s *Service
name string
location string
queryinstantrequest *QueryInstantRequest
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Query: Evaluate a PromQL query at a single point in time.
//
// - location: Location of the resource information. Has to be "global"
// now.
// - name: The project on which to execute the request. Data associcated
// with the project's workspace stored under the The format is:
// projects/PROJECT_ID_OR_NUMBER. Open source API but used as a
// request path prefix to distinguish different virtual Prometheus
// instances of Google Prometheus Engine.
func (r *ProjectsLocationPrometheusApiV1Service) Query(name string, location string, queryinstantrequest *QueryInstantRequest) *ProjectsLocationPrometheusApiV1QueryCall {
c := &ProjectsLocationPrometheusApiV1QueryCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
c.location = location
c.queryinstantrequest = queryinstantrequest
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ProjectsLocationPrometheusApiV1QueryCall) Fields(s ...googleapi.Field) *ProjectsLocationPrometheusApiV1QueryCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *ProjectsLocationPrometheusApiV1QueryCall) Context(ctx context.Context) *ProjectsLocationPrometheusApiV1QueryCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ProjectsLocationPrometheusApiV1QueryCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsLocationPrometheusApiV1QueryCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.queryinstantrequest)
if err != nil {
return nil, err
}
reqHeaders.Set("Content-Type", "application/json")
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/location/{location}/prometheus/api/v1/query")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("POST", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
"location": c.location,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "monitoring.projects.location.prometheus.api.v1.query" call.
// Exactly one of *HttpBody or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *HttpBody.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *ProjectsLocationPrometheusApiV1QueryCall) Do(opts ...googleapi.CallOption) (*HttpBody, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &HttpBody{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Evaluate a PromQL query at a single point in time.",
// "flatPath": "v1/projects/{projectsId}/location/{location}/prometheus/api/v1/query",
// "httpMethod": "POST",
// "id": "monitoring.projects.location.prometheus.api.v1.query",
// "parameterOrder": [
// "name",
// "location"
// ],
// "parameters": {
// "location": {
// "description": "Location of the resource information. Has to be \"global\" now.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "name": {
// "description": "The project on which to execute the request. Data associcated with the project's workspace stored under the The format is: projects/PROJECT_ID_OR_NUMBER. Open source API but used as a request path prefix to distinguish different virtual Prometheus instances of Google Prometheus Engine.",
// "location": "path",
// "pattern": "^projects/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1/{+name}/location/{location}/prometheus/api/v1/query",
// "request": {
// "$ref": "QueryInstantRequest"
// },
// "response": {
// "$ref": "HttpBody"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/monitoring",
// "https://www.googleapis.com/auth/monitoring.read"
// ]
// }
}
// method id "monitoring.projects.location.prometheus.api.v1.query_range":
type ProjectsLocationPrometheusApiV1QueryRangeCall struct {
s *Service
name string
location string
queryrangerequest *QueryRangeRequest
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// QueryRange: Evaluate a PromQL query with start, end time range.
//
// - location: Location of the resource information. Has to be "global"
// now.
// - name: The project on which to execute the request. Data associcated
// with the project's workspace stored under the The format is:
// projects/PROJECT_ID_OR_NUMBER. Open source API but used as a
// request path prefix to distinguish different virtual Prometheus
// instances of Google Prometheus Engine.
func (r *ProjectsLocationPrometheusApiV1Service) QueryRange(name string, location string, queryrangerequest *QueryRangeRequest) *ProjectsLocationPrometheusApiV1QueryRangeCall {
c := &ProjectsLocationPrometheusApiV1QueryRangeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
c.location = location
c.queryrangerequest = queryrangerequest
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ProjectsLocationPrometheusApiV1QueryRangeCall) Fields(s ...googleapi.Field) *ProjectsLocationPrometheusApiV1QueryRangeCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *ProjectsLocationPrometheusApiV1QueryRangeCall) Context(ctx context.Context) *ProjectsLocationPrometheusApiV1QueryRangeCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ProjectsLocationPrometheusApiV1QueryRangeCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsLocationPrometheusApiV1QueryRangeCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.queryrangerequest)
if err != nil {
return nil, err
}
reqHeaders.Set("Content-Type", "application/json")
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/location/{location}/prometheus/api/v1/query_range")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("POST", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
"location": c.location,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "monitoring.projects.location.prometheus.api.v1.query_range" call.
// Exactly one of *HttpBody or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *HttpBody.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *ProjectsLocationPrometheusApiV1QueryRangeCall) Do(opts ...googleapi.CallOption) (*HttpBody, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &HttpBody{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Evaluate a PromQL query with start, end time range.",
// "flatPath": "v1/projects/{projectsId}/location/{location}/prometheus/api/v1/query_range",
// "httpMethod": "POST",
// "id": "monitoring.projects.location.prometheus.api.v1.query_range",
// "parameterOrder": [
// "name",
// "location"
// ],
// "parameters": {
// "location": {
// "description": "Location of the resource information. Has to be \"global\" now.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "name": {
// "description": "The project on which to execute the request. Data associcated with the project's workspace stored under the The format is: projects/PROJECT_ID_OR_NUMBER. Open source API but used as a request path prefix to distinguish different virtual Prometheus instances of Google Prometheus Engine.",
// "location": "path",
// "pattern": "^projects/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1/{+name}/location/{location}/prometheus/api/v1/query_range",
// "request": {
// "$ref": "QueryRangeRequest"
// },
// "response": {
// "$ref": "HttpBody"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/monitoring",
// "https://www.googleapis.com/auth/monitoring.read"
// ]
// }
}
// method id "monitoring.projects.location.prometheus.api.v1.series":
type ProjectsLocationPrometheusApiV1SeriesCall struct {
s *Service
name string
location string
queryseriesrequest *QuerySeriesRequest
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Series: Lists metadata for metrics.
//
// - location: Location of the resource information. Has to be "global"
// for now.
// - name: The workspace on which to execute the request. It is not part
// of the open source API but used as a request path prefix to
// distinguish different virtual Prometheus instances of Google
// Prometheus Engine. The format is: projects/PROJECT_ID_OR_NUMBER.
func (r *ProjectsLocationPrometheusApiV1Service) Series(name string, location string, queryseriesrequest *QuerySeriesRequest) *ProjectsLocationPrometheusApiV1SeriesCall {
c := &ProjectsLocationPrometheusApiV1SeriesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
c.location = location
c.queryseriesrequest = queryseriesrequest
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ProjectsLocationPrometheusApiV1SeriesCall) Fields(s ...googleapi.Field) *ProjectsLocationPrometheusApiV1SeriesCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *ProjectsLocationPrometheusApiV1SeriesCall) Context(ctx context.Context) *ProjectsLocationPrometheusApiV1SeriesCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ProjectsLocationPrometheusApiV1SeriesCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsLocationPrometheusApiV1SeriesCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.queryseriesrequest)
if err != nil {
return nil, err
}
reqHeaders.Set("Content-Type", "application/json")
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/location/{location}/prometheus/api/v1/series")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("POST", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
"location": c.location,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "monitoring.projects.location.prometheus.api.v1.series" call.
// Exactly one of *HttpBody or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *HttpBody.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *ProjectsLocationPrometheusApiV1SeriesCall) Do(opts ...googleapi.CallOption) (*HttpBody, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &HttpBody{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Lists metadata for metrics.",
// "flatPath": "v1/projects/{projectsId}/location/{location}/prometheus/api/v1/series",
// "httpMethod": "POST",
// "id": "monitoring.projects.location.prometheus.api.v1.series",
// "parameterOrder": [
// "name",
// "location"
// ],
// "parameters": {
// "location": {
// "description": "Location of the resource information. Has to be \"global\" for now.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "name": {
// "description": "Required. The workspace on which to execute the request. It is not part of the open source API but used as a request path prefix to distinguish different virtual Prometheus instances of Google Prometheus Engine. The format is: projects/PROJECT_ID_OR_NUMBER.",
// "location": "path",
// "pattern": "^projects/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1/{+name}/location/{location}/prometheus/api/v1/series",
// "request": {
// "$ref": "QuerySeriesRequest"
// },
// "response": {
// "$ref": "HttpBody"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/monitoring",
// "https://www.googleapis.com/auth/monitoring.read"
// ]
// }
}
// method id "monitoring.projects.location.prometheus.api.v1.label.values":
type ProjectsLocationPrometheusApiV1LabelValuesCall struct {
s *Service
name string
location string
label string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// Values: Lists possible values for a given label name.
//
// - label: The label name for which values are queried.
// - location: Location of the resource information. Has to be "global"
// now.
// - name: The workspace on which to execute the request. It is not part
// of the open source API but used as a request path prefix to
// distinguish different virtual Prometheus instances of Google
// Prometheus Engine. The format is: projects/PROJECT_ID_OR_NUMBER.
func (r *ProjectsLocationPrometheusApiV1LabelService) Values(name string, location string, label string) *ProjectsLocationPrometheusApiV1LabelValuesCall {
c := &ProjectsLocationPrometheusApiV1LabelValuesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
c.location = location
c.label = label
return c
}
// End sets the optional parameter "end": The end time to evaluate the
// query for. Either floating point UNIX seconds or RFC3339 formatted
// timestamp.
func (c *ProjectsLocationPrometheusApiV1LabelValuesCall) End(end string) *ProjectsLocationPrometheusApiV1LabelValuesCall {
c.urlParams_.Set("end", end)
return c
}
// Match sets the optional parameter "match": A list of matchers encoded
// in the Prometheus label matcher format to constrain the values to
// series that satisfy them.
func (c *ProjectsLocationPrometheusApiV1LabelValuesCall) Match(match string) *ProjectsLocationPrometheusApiV1LabelValuesCall {
c.urlParams_.Set("match", match)
return c
}
// Start sets the optional parameter "start": The start time to evaluate
// the query for. Either floating point UNIX seconds or RFC3339
// formatted timestamp.
func (c *ProjectsLocationPrometheusApiV1LabelValuesCall) Start(start string) *ProjectsLocationPrometheusApiV1LabelValuesCall {
c.urlParams_.Set("start", start)
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ProjectsLocationPrometheusApiV1LabelValuesCall) Fields(s ...googleapi.Field) *ProjectsLocationPrometheusApiV1LabelValuesCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *ProjectsLocationPrometheusApiV1LabelValuesCall) IfNoneMatch(entityTag string) *ProjectsLocationPrometheusApiV1LabelValuesCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *ProjectsLocationPrometheusApiV1LabelValuesCall) Context(ctx context.Context) *ProjectsLocationPrometheusApiV1LabelValuesCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ProjectsLocationPrometheusApiV1LabelValuesCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsLocationPrometheusApiV1LabelValuesCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/location/{location}/prometheus/api/v1/label/{label}/values")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("GET", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
"location": c.location,
"label": c.label,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "monitoring.projects.location.prometheus.api.v1.label.values" call.
// Exactly one of *HttpBody or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *HttpBody.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *ProjectsLocationPrometheusApiV1LabelValuesCall) Do(opts ...googleapi.CallOption) (*HttpBody, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &HttpBody{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Lists possible values for a given label name.",
// "flatPath": "v1/projects/{projectsId}/location/{location}/prometheus/api/v1/label/{label}/values",
// "httpMethod": "GET",
// "id": "monitoring.projects.location.prometheus.api.v1.label.values",
// "parameterOrder": [
// "name",
// "location",
// "label"
// ],
// "parameters": {
// "end": {
// "description": "The end time to evaluate the query for. Either floating point UNIX seconds or RFC3339 formatted timestamp.",
// "location": "query",
// "type": "string"
// },
// "label": {
// "description": "The label name for which values are queried.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "location": {
// "description": "Location of the resource information. Has to be \"global\" now.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "match": {
// "description": "A list of matchers encoded in the Prometheus label matcher format to constrain the values to series that satisfy them.",
// "location": "query",
// "type": "string"
// },
// "name": {
// "description": "The workspace on which to execute the request. It is not part of the open source API but used as a request path prefix to distinguish different virtual Prometheus instances of Google Prometheus Engine. The format is: projects/PROJECT_ID_OR_NUMBER.",
// "location": "path",
// "pattern": "^projects/[^/]+$",
// "required": true,
// "type": "string"
// },
// "start": {
// "description": "The start time to evaluate the query for. Either floating point UNIX seconds or RFC3339 formatted timestamp.",
// "location": "query",
// "type": "string"
// }
// },
// "path": "v1/{+name}/location/{location}/prometheus/api/v1/label/{label}/values",
// "response": {
// "$ref": "HttpBody"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/monitoring",
// "https://www.googleapis.com/auth/monitoring.read"
// ]
// }
}
// method id "monitoring.projects.location.prometheus.api.v1.metadata.list":
type ProjectsLocationPrometheusApiV1MetadataListCall struct {
s *Service
name string
location string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// List: Lists metadata for metrics.
//
// - location: Location of the resource information. Has to be "global"
// for now.
// - name: The workspace on which to execute the request. It is not part
// of the open source API but used as a request path prefix to
// distinguish different virtual Prometheus instances of Google
// Prometheus Engine. The format is: projects/PROJECT_ID_OR_NUMBER.
func (r *ProjectsLocationPrometheusApiV1MetadataService) List(name string, location string) *ProjectsLocationPrometheusApiV1MetadataListCall {
c := &ProjectsLocationPrometheusApiV1MetadataListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
c.location = location
return c
}
// Limit sets the optional parameter "limit": Maximum number of metrics
// to return.
func (c *ProjectsLocationPrometheusApiV1MetadataListCall) Limit(limit int64) *ProjectsLocationPrometheusApiV1MetadataListCall {
c.urlParams_.Set("limit", fmt.Sprint(limit))
return c
}
// Metric sets the optional parameter "metric": The metric name for
// which to query metadata. If unset, all metric metadata is returned.
func (c *ProjectsLocationPrometheusApiV1MetadataListCall) Metric(metric string) *ProjectsLocationPrometheusApiV1MetadataListCall {
c.urlParams_.Set("metric", metric)
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ProjectsLocationPrometheusApiV1MetadataListCall) Fields(s ...googleapi.Field) *ProjectsLocationPrometheusApiV1MetadataListCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *ProjectsLocationPrometheusApiV1MetadataListCall) IfNoneMatch(entityTag string) *ProjectsLocationPrometheusApiV1MetadataListCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *ProjectsLocationPrometheusApiV1MetadataListCall) Context(ctx context.Context) *ProjectsLocationPrometheusApiV1MetadataListCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ProjectsLocationPrometheusApiV1MetadataListCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsLocationPrometheusApiV1MetadataListCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/location/{location}/prometheus/api/v1/metadata")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("GET", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
"location": c.location,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "monitoring.projects.location.prometheus.api.v1.metadata.list" call.
// Exactly one of *HttpBody or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *HttpBody.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *ProjectsLocationPrometheusApiV1MetadataListCall) Do(opts ...googleapi.CallOption) (*HttpBody, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &HttpBody{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Lists metadata for metrics.",
// "flatPath": "v1/projects/{projectsId}/location/{location}/prometheus/api/v1/metadata",
// "httpMethod": "GET",
// "id": "monitoring.projects.location.prometheus.api.v1.metadata.list",
// "parameterOrder": [
// "name",
// "location"
// ],
// "parameters": {
// "limit": {
// "description": "Maximum number of metrics to return.",
// "format": "int64",
// "location": "query",
// "type": "string"
// },
// "location": {
// "description": "Location of the resource information. Has to be \"global\" for now.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "metric": {
// "description": "The metric name for which to query metadata. If unset, all metric metadata is returned.",
// "location": "query",
// "type": "string"
// },
// "name": {
// "description": "Required. The workspace on which to execute the request. It is not part of the open source API but used as a request path prefix to distinguish different virtual Prometheus instances of Google Prometheus Engine. The format is: projects/PROJECT_ID_OR_NUMBER.",
// "location": "path",
// "pattern": "^projects/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1/{+name}/location/{location}/prometheus/api/v1/metadata",
// "response": {
// "$ref": "HttpBody"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/monitoring",
// "https://www.googleapis.com/auth/monitoring.read"
// ]
// }
}
|