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
|
package job
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"context"
"encoding/json"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/autorest/date"
"github.com/Azure/go-autorest/autorest/to"
"github.com/Azure/go-autorest/tracing"
"github.com/gofrs/uuid"
"net/http"
)
// The package's fully qualified name.
const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/datalake/analytics/2017-09-01-preview/job"
// BaseJobParameters data Lake Analytics Job Parameters base class for build and submit.
type BaseJobParameters struct {
// Type - The job type of the current job (Hive, USql, or Scope (for internal use only)). Possible values include: 'USQL', 'Hive', 'Scope'
Type TypeEnum `json:"type,omitempty"`
// Properties - The job specific properties.
Properties BasicCreateJobProperties `json:"properties,omitempty"`
}
// UnmarshalJSON is the custom unmarshaler for BaseJobParameters struct.
func (bjp *BaseJobParameters) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "type":
if v != nil {
var typeVar TypeEnum
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
bjp.Type = typeVar
}
case "properties":
if v != nil {
properties, err := unmarshalBasicCreateJobProperties(*v)
if err != nil {
return err
}
bjp.Properties = properties
}
}
}
return nil
}
// BuildJobParameters the parameters used to build a new Data Lake Analytics job.
type BuildJobParameters struct {
// Name - The friendly name of the job to build.
Name *string `json:"name,omitempty"`
// Type - The job type of the current job (Hive, USql, or Scope (for internal use only)). Possible values include: 'USQL', 'Hive', 'Scope'
Type TypeEnum `json:"type,omitempty"`
// Properties - The job specific properties.
Properties BasicCreateJobProperties `json:"properties,omitempty"`
}
// UnmarshalJSON is the custom unmarshaler for BuildJobParameters struct.
func (bjp *BuildJobParameters) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
bjp.Name = &name
}
case "type":
if v != nil {
var typeVar TypeEnum
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
bjp.Type = typeVar
}
case "properties":
if v != nil {
properties, err := unmarshalBasicCreateJobProperties(*v)
if err != nil {
return err
}
bjp.Properties = properties
}
}
}
return nil
}
// CancelFuture an abstraction for monitoring and retrieving the results of a long-running operation.
type CancelFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(Client) (autorest.Response, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *CancelFuture) UnmarshalJSON(body []byte) error {
var azFuture azure.Future
if err := json.Unmarshal(body, &azFuture); err != nil {
return err
}
future.FutureAPI = &azFuture
future.Result = future.result
return nil
}
// result is the default implementation for CancelFuture.Result.
func (future *CancelFuture) result(client Client) (ar autorest.Response, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "job.CancelFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
ar.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("job.CancelFuture")
return
}
ar.Response = future.Response()
return
}
// CreateJobParameters the parameters used to submit a new Data Lake Analytics job.
type CreateJobParameters struct {
// Name - The friendly name of the job to submit.
Name *string `json:"name,omitempty"`
// DegreeOfParallelism - The degree of parallelism to use for this job. At most one of degreeOfParallelism and degreeOfParallelismPercent should be specified. If none, a default value of 1 will be used for degreeOfParallelism.
DegreeOfParallelism *int32 `json:"degreeOfParallelism,omitempty"`
// DegreeOfParallelismPercent - the degree of parallelism in percentage used for this job. At most one of degreeOfParallelism and degreeOfParallelismPercent should be specified. If none, a default value of 1 will be used for degreeOfParallelism.
DegreeOfParallelismPercent *float64 `json:"degreeOfParallelismPercent,omitempty"`
// Priority - The priority value to use for the current job. Lower numbers have a higher priority. By default, a job has a priority of 1000. This must be greater than 0.
Priority *int32 `json:"priority,omitempty"`
// LogFilePatterns - The list of log file name patterns to find in the logFolder. '*' is the only matching character allowed. Example format: jobExecution*.log or *mylog*.txt
LogFilePatterns *[]string `json:"logFilePatterns,omitempty"`
// Related - The recurring job relationship information properties.
Related *RelationshipProperties `json:"related,omitempty"`
// Type - The job type of the current job (Hive, USql, or Scope (for internal use only)). Possible values include: 'USQL', 'Hive', 'Scope'
Type TypeEnum `json:"type,omitempty"`
// Properties - The job specific properties.
Properties BasicCreateJobProperties `json:"properties,omitempty"`
}
// UnmarshalJSON is the custom unmarshaler for CreateJobParameters struct.
func (cjp *CreateJobParameters) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
cjp.Name = &name
}
case "degreeOfParallelism":
if v != nil {
var degreeOfParallelism int32
err = json.Unmarshal(*v, °reeOfParallelism)
if err != nil {
return err
}
cjp.DegreeOfParallelism = °reeOfParallelism
}
case "degreeOfParallelismPercent":
if v != nil {
var degreeOfParallelismPercent float64
err = json.Unmarshal(*v, °reeOfParallelismPercent)
if err != nil {
return err
}
cjp.DegreeOfParallelismPercent = °reeOfParallelismPercent
}
case "priority":
if v != nil {
var priority int32
err = json.Unmarshal(*v, &priority)
if err != nil {
return err
}
cjp.Priority = &priority
}
case "logFilePatterns":
if v != nil {
var logFilePatterns []string
err = json.Unmarshal(*v, &logFilePatterns)
if err != nil {
return err
}
cjp.LogFilePatterns = &logFilePatterns
}
case "related":
if v != nil {
var related RelationshipProperties
err = json.Unmarshal(*v, &related)
if err != nil {
return err
}
cjp.Related = &related
}
case "type":
if v != nil {
var typeVar TypeEnum
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
cjp.Type = typeVar
}
case "properties":
if v != nil {
properties, err := unmarshalBasicCreateJobProperties(*v)
if err != nil {
return err
}
cjp.Properties = properties
}
}
}
return nil
}
// BasicCreateJobProperties the common Data Lake Analytics job properties for job submission.
type BasicCreateJobProperties interface {
AsCreateUSQLJobProperties() (*CreateUSQLJobProperties, bool)
AsCreateScopeJobProperties() (*CreateScopeJobProperties, bool)
AsCreateJobProperties() (*CreateJobProperties, bool)
}
// CreateJobProperties the common Data Lake Analytics job properties for job submission.
type CreateJobProperties struct {
// RuntimeVersion - The runtime version of the Data Lake Analytics engine to use for the specific type of job being run.
RuntimeVersion *string `json:"runtimeVersion,omitempty"`
// Script - The script to run. Please note that the maximum script size is 3 MB.
Script *string `json:"script,omitempty"`
// Type - Possible values include: 'TypeBasicCreateJobPropertiesTypeCreateJobProperties', 'TypeBasicCreateJobPropertiesTypeUSQL', 'TypeBasicCreateJobPropertiesTypeScope'
Type TypeBasicCreateJobProperties `json:"type,omitempty"`
}
func unmarshalBasicCreateJobProperties(body []byte) (BasicCreateJobProperties, error) {
var m map[string]interface{}
err := json.Unmarshal(body, &m)
if err != nil {
return nil, err
}
switch m["type"] {
case string(TypeBasicCreateJobPropertiesTypeUSQL):
var cusjp CreateUSQLJobProperties
err := json.Unmarshal(body, &cusjp)
return cusjp, err
case string(TypeBasicCreateJobPropertiesTypeScope):
var csjp CreateScopeJobProperties
err := json.Unmarshal(body, &csjp)
return csjp, err
default:
var cjp CreateJobProperties
err := json.Unmarshal(body, &cjp)
return cjp, err
}
}
func unmarshalBasicCreateJobPropertiesArray(body []byte) ([]BasicCreateJobProperties, error) {
var rawMessages []*json.RawMessage
err := json.Unmarshal(body, &rawMessages)
if err != nil {
return nil, err
}
cjpArray := make([]BasicCreateJobProperties, len(rawMessages))
for index, rawMessage := range rawMessages {
cjp, err := unmarshalBasicCreateJobProperties(*rawMessage)
if err != nil {
return nil, err
}
cjpArray[index] = cjp
}
return cjpArray, nil
}
// MarshalJSON is the custom marshaler for CreateJobProperties.
func (cjp CreateJobProperties) MarshalJSON() ([]byte, error) {
cjp.Type = TypeBasicCreateJobPropertiesTypeCreateJobProperties
objectMap := make(map[string]interface{})
if cjp.RuntimeVersion != nil {
objectMap["runtimeVersion"] = cjp.RuntimeVersion
}
if cjp.Script != nil {
objectMap["script"] = cjp.Script
}
if cjp.Type != "" {
objectMap["type"] = cjp.Type
}
return json.Marshal(objectMap)
}
// AsCreateUSQLJobProperties is the BasicCreateJobProperties implementation for CreateJobProperties.
func (cjp CreateJobProperties) AsCreateUSQLJobProperties() (*CreateUSQLJobProperties, bool) {
return nil, false
}
// AsCreateScopeJobProperties is the BasicCreateJobProperties implementation for CreateJobProperties.
func (cjp CreateJobProperties) AsCreateScopeJobProperties() (*CreateScopeJobProperties, bool) {
return nil, false
}
// AsCreateJobProperties is the BasicCreateJobProperties implementation for CreateJobProperties.
func (cjp CreateJobProperties) AsCreateJobProperties() (*CreateJobProperties, bool) {
return &cjp, true
}
// AsBasicCreateJobProperties is the BasicCreateJobProperties implementation for CreateJobProperties.
func (cjp CreateJobProperties) AsBasicCreateJobProperties() (BasicCreateJobProperties, bool) {
return &cjp, true
}
// CreateScopeJobParameters the parameters used to submit a new Data Lake Analytics Scope job. (Only for
// use internally with Scope job type.)
type CreateScopeJobParameters struct {
// Tags - The key-value pairs used to add additional metadata to the job information.
Tags map[string]*string `json:"tags"`
// Name - The friendly name of the job to submit.
Name *string `json:"name,omitempty"`
// DegreeOfParallelism - The degree of parallelism to use for this job. At most one of degreeOfParallelism and degreeOfParallelismPercent should be specified. If none, a default value of 1 will be used for degreeOfParallelism.
DegreeOfParallelism *int32 `json:"degreeOfParallelism,omitempty"`
// DegreeOfParallelismPercent - the degree of parallelism in percentage used for this job. At most one of degreeOfParallelism and degreeOfParallelismPercent should be specified. If none, a default value of 1 will be used for degreeOfParallelism.
DegreeOfParallelismPercent *float64 `json:"degreeOfParallelismPercent,omitempty"`
// Priority - The priority value to use for the current job. Lower numbers have a higher priority. By default, a job has a priority of 1000. This must be greater than 0.
Priority *int32 `json:"priority,omitempty"`
// LogFilePatterns - The list of log file name patterns to find in the logFolder. '*' is the only matching character allowed. Example format: jobExecution*.log or *mylog*.txt
LogFilePatterns *[]string `json:"logFilePatterns,omitempty"`
// Related - The recurring job relationship information properties.
Related *RelationshipProperties `json:"related,omitempty"`
// Type - The job type of the current job (Hive, USql, or Scope (for internal use only)). Possible values include: 'USQL', 'Hive', 'Scope'
Type TypeEnum `json:"type,omitempty"`
// Properties - The job specific properties.
Properties BasicCreateJobProperties `json:"properties,omitempty"`
}
// MarshalJSON is the custom marshaler for CreateScopeJobParameters.
func (csjp CreateScopeJobParameters) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if csjp.Tags != nil {
objectMap["tags"] = csjp.Tags
}
if csjp.Name != nil {
objectMap["name"] = csjp.Name
}
if csjp.DegreeOfParallelism != nil {
objectMap["degreeOfParallelism"] = csjp.DegreeOfParallelism
}
if csjp.DegreeOfParallelismPercent != nil {
objectMap["degreeOfParallelismPercent"] = csjp.DegreeOfParallelismPercent
}
if csjp.Priority != nil {
objectMap["priority"] = csjp.Priority
}
if csjp.LogFilePatterns != nil {
objectMap["logFilePatterns"] = csjp.LogFilePatterns
}
if csjp.Related != nil {
objectMap["related"] = csjp.Related
}
if csjp.Type != "" {
objectMap["type"] = csjp.Type
}
objectMap["properties"] = csjp.Properties
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for CreateScopeJobParameters struct.
func (csjp *CreateScopeJobParameters) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "tags":
if v != nil {
var tags map[string]*string
err = json.Unmarshal(*v, &tags)
if err != nil {
return err
}
csjp.Tags = tags
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
csjp.Name = &name
}
case "degreeOfParallelism":
if v != nil {
var degreeOfParallelism int32
err = json.Unmarshal(*v, °reeOfParallelism)
if err != nil {
return err
}
csjp.DegreeOfParallelism = °reeOfParallelism
}
case "degreeOfParallelismPercent":
if v != nil {
var degreeOfParallelismPercent float64
err = json.Unmarshal(*v, °reeOfParallelismPercent)
if err != nil {
return err
}
csjp.DegreeOfParallelismPercent = °reeOfParallelismPercent
}
case "priority":
if v != nil {
var priority int32
err = json.Unmarshal(*v, &priority)
if err != nil {
return err
}
csjp.Priority = &priority
}
case "logFilePatterns":
if v != nil {
var logFilePatterns []string
err = json.Unmarshal(*v, &logFilePatterns)
if err != nil {
return err
}
csjp.LogFilePatterns = &logFilePatterns
}
case "related":
if v != nil {
var related RelationshipProperties
err = json.Unmarshal(*v, &related)
if err != nil {
return err
}
csjp.Related = &related
}
case "type":
if v != nil {
var typeVar TypeEnum
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
csjp.Type = typeVar
}
case "properties":
if v != nil {
properties, err := unmarshalBasicCreateJobProperties(*v)
if err != nil {
return err
}
csjp.Properties = properties
}
}
}
return nil
}
// CreateScopeJobProperties scope job properties used when submitting Scope jobs. (Only for use internally
// with Scope job type.)
type CreateScopeJobProperties struct {
// Resources - The list of resources that are required by the job.
Resources *[]ScopeJobResource `json:"resources,omitempty"`
// Notifier - The list of email addresses, separated by semi-colons, to notify when the job reaches a terminal state.
Notifier *string `json:"notifier,omitempty"`
// RuntimeVersion - The runtime version of the Data Lake Analytics engine to use for the specific type of job being run.
RuntimeVersion *string `json:"runtimeVersion,omitempty"`
// Script - The script to run. Please note that the maximum script size is 3 MB.
Script *string `json:"script,omitempty"`
// Type - Possible values include: 'TypeBasicCreateJobPropertiesTypeCreateJobProperties', 'TypeBasicCreateJobPropertiesTypeUSQL', 'TypeBasicCreateJobPropertiesTypeScope'
Type TypeBasicCreateJobProperties `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for CreateScopeJobProperties.
func (csjp CreateScopeJobProperties) MarshalJSON() ([]byte, error) {
csjp.Type = TypeBasicCreateJobPropertiesTypeScope
objectMap := make(map[string]interface{})
if csjp.Resources != nil {
objectMap["resources"] = csjp.Resources
}
if csjp.Notifier != nil {
objectMap["notifier"] = csjp.Notifier
}
if csjp.RuntimeVersion != nil {
objectMap["runtimeVersion"] = csjp.RuntimeVersion
}
if csjp.Script != nil {
objectMap["script"] = csjp.Script
}
if csjp.Type != "" {
objectMap["type"] = csjp.Type
}
return json.Marshal(objectMap)
}
// AsCreateUSQLJobProperties is the BasicCreateJobProperties implementation for CreateScopeJobProperties.
func (csjp CreateScopeJobProperties) AsCreateUSQLJobProperties() (*CreateUSQLJobProperties, bool) {
return nil, false
}
// AsCreateScopeJobProperties is the BasicCreateJobProperties implementation for CreateScopeJobProperties.
func (csjp CreateScopeJobProperties) AsCreateScopeJobProperties() (*CreateScopeJobProperties, bool) {
return &csjp, true
}
// AsCreateJobProperties is the BasicCreateJobProperties implementation for CreateScopeJobProperties.
func (csjp CreateScopeJobProperties) AsCreateJobProperties() (*CreateJobProperties, bool) {
return nil, false
}
// AsBasicCreateJobProperties is the BasicCreateJobProperties implementation for CreateScopeJobProperties.
func (csjp CreateScopeJobProperties) AsBasicCreateJobProperties() (BasicCreateJobProperties, bool) {
return &csjp, true
}
// CreateUSQLJobProperties u-SQL job properties used when submitting U-SQL jobs.
type CreateUSQLJobProperties struct {
// CompileMode - The specific compilation mode for the job used during execution. If this is not specified during submission, the server will determine the optimal compilation mode. Possible values include: 'Semantic', 'Full', 'SingleBox'
CompileMode CompileMode `json:"compileMode,omitempty"`
// RuntimeVersion - The runtime version of the Data Lake Analytics engine to use for the specific type of job being run.
RuntimeVersion *string `json:"runtimeVersion,omitempty"`
// Script - The script to run. Please note that the maximum script size is 3 MB.
Script *string `json:"script,omitempty"`
// Type - Possible values include: 'TypeBasicCreateJobPropertiesTypeCreateJobProperties', 'TypeBasicCreateJobPropertiesTypeUSQL', 'TypeBasicCreateJobPropertiesTypeScope'
Type TypeBasicCreateJobProperties `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for CreateUSQLJobProperties.
func (cusjp CreateUSQLJobProperties) MarshalJSON() ([]byte, error) {
cusjp.Type = TypeBasicCreateJobPropertiesTypeUSQL
objectMap := make(map[string]interface{})
if cusjp.CompileMode != "" {
objectMap["compileMode"] = cusjp.CompileMode
}
if cusjp.RuntimeVersion != nil {
objectMap["runtimeVersion"] = cusjp.RuntimeVersion
}
if cusjp.Script != nil {
objectMap["script"] = cusjp.Script
}
if cusjp.Type != "" {
objectMap["type"] = cusjp.Type
}
return json.Marshal(objectMap)
}
// AsCreateUSQLJobProperties is the BasicCreateJobProperties implementation for CreateUSQLJobProperties.
func (cusjp CreateUSQLJobProperties) AsCreateUSQLJobProperties() (*CreateUSQLJobProperties, bool) {
return &cusjp, true
}
// AsCreateScopeJobProperties is the BasicCreateJobProperties implementation for CreateUSQLJobProperties.
func (cusjp CreateUSQLJobProperties) AsCreateScopeJobProperties() (*CreateScopeJobProperties, bool) {
return nil, false
}
// AsCreateJobProperties is the BasicCreateJobProperties implementation for CreateUSQLJobProperties.
func (cusjp CreateUSQLJobProperties) AsCreateJobProperties() (*CreateJobProperties, bool) {
return nil, false
}
// AsBasicCreateJobProperties is the BasicCreateJobProperties implementation for CreateUSQLJobProperties.
func (cusjp CreateUSQLJobProperties) AsBasicCreateJobProperties() (BasicCreateJobProperties, bool) {
return &cusjp, true
}
// DataPath a Data Lake Analytics job data path item.
type DataPath struct {
autorest.Response `json:"-"`
// JobID - READ-ONLY; The ID of the job this data is for.
JobID *uuid.UUID `json:"jobId,omitempty"`
// Command - READ-ONLY; The command that this job data relates to.
Command *string `json:"command,omitempty"`
// Paths - READ-ONLY; The list of paths to all of the job data.
Paths *[]string `json:"paths,omitempty"`
}
// MarshalJSON is the custom marshaler for DataPath.
func (dp DataPath) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// Diagnostics error diagnostic information for failed jobs.
type Diagnostics struct {
// Message - READ-ONLY; The error message.
Message *string `json:"message,omitempty"`
// Severity - READ-ONLY; The severity of the error. Possible values include: 'Warning', 'Error', 'Info', 'SevereWarning', 'Deprecated', 'UserWarning'
Severity SeverityTypes `json:"severity,omitempty"`
// LineNumber - READ-ONLY; The line number the error occurred on.
LineNumber *int32 `json:"lineNumber,omitempty"`
// ColumnNumber - READ-ONLY; The column where the error occurred.
ColumnNumber *int32 `json:"columnNumber,omitempty"`
// Start - READ-ONLY; The starting index of the error.
Start *int32 `json:"start,omitempty"`
// End - READ-ONLY; The ending index of the error.
End *int32 `json:"end,omitempty"`
}
// MarshalJSON is the custom marshaler for Diagnostics.
func (d Diagnostics) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// ErrorDetails the Data Lake Analytics job error details.
type ErrorDetails struct {
// ErrorID - READ-ONLY; The specific identifier for the type of error encountered in the job.
ErrorID *string `json:"errorId,omitempty"`
// Severity - READ-ONLY; The severity level of the failure. Possible values include: 'Warning', 'Error', 'Info', 'SevereWarning', 'Deprecated', 'UserWarning'
Severity SeverityTypes `json:"severity,omitempty"`
// Source - READ-ONLY; The ultimate source of the failure (usually either SYSTEM or USER).
Source *string `json:"source,omitempty"`
// Message - READ-ONLY; The user friendly error message for the failure.
Message *string `json:"message,omitempty"`
// Description - READ-ONLY; The error message description.
Description *string `json:"description,omitempty"`
// Details - READ-ONLY; The details of the error message.
Details *string `json:"details,omitempty"`
// LineNumber - READ-ONLY; The specific line number in the job where the error occurred.
LineNumber *int32 `json:"lineNumber,omitempty"`
// StartOffset - READ-ONLY; The start offset in the job where the error was found
StartOffset *int32 `json:"startOffset,omitempty"`
// EndOffset - READ-ONLY; The end offset in the job where the error was found.
EndOffset *int32 `json:"endOffset,omitempty"`
// Resolution - READ-ONLY; The recommended resolution for the failure, if any.
Resolution *string `json:"resolution,omitempty"`
// FilePath - READ-ONLY; The path to any supplemental error files, if any.
FilePath *string `json:"filePath,omitempty"`
// HelpLink - READ-ONLY; The link to MSDN or Azure help for this type of error, if any.
HelpLink *string `json:"helpLink,omitempty"`
// InternalDiagnostics - READ-ONLY; The internal diagnostic stack trace if the user requesting the job error details has sufficient permissions it will be retrieved, otherwise it will be empty.
InternalDiagnostics *string `json:"internalDiagnostics,omitempty"`
// InnerError - READ-ONLY; The inner error of this specific job error message, if any.
InnerError *InnerError `json:"innerError,omitempty"`
}
// MarshalJSON is the custom marshaler for ErrorDetails.
func (ed ErrorDetails) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// HiveJobProperties hive job properties used when retrieving Hive jobs.
type HiveJobProperties struct {
// LogsLocation - READ-ONLY; The Hive logs location.
LogsLocation *string `json:"logsLocation,omitempty"`
// OutputLocation - READ-ONLY; The location of Hive job output files (both execution output and results).
OutputLocation *string `json:"outputLocation,omitempty"`
// StatementCount - READ-ONLY; The number of statements that will be run based on the script.
StatementCount *int32 `json:"statementCount,omitempty"`
// ExecutedStatementCount - READ-ONLY; The number of statements that have been run based on the script.
ExecutedStatementCount *int32 `json:"executedStatementCount,omitempty"`
// RuntimeVersion - The runtime version of the Data Lake Analytics engine to use for the specific type of job being run.
RuntimeVersion *string `json:"runtimeVersion,omitempty"`
// Script - The script to run. Please note that the maximum script size is 3 MB.
Script *string `json:"script,omitempty"`
// Type - Possible values include: 'TypeJobProperties', 'TypeUSQL', 'TypeHive', 'TypeScope'
Type Type `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for HiveJobProperties.
func (hjp HiveJobProperties) MarshalJSON() ([]byte, error) {
hjp.Type = TypeHive
objectMap := make(map[string]interface{})
if hjp.RuntimeVersion != nil {
objectMap["runtimeVersion"] = hjp.RuntimeVersion
}
if hjp.Script != nil {
objectMap["script"] = hjp.Script
}
if hjp.Type != "" {
objectMap["type"] = hjp.Type
}
return json.Marshal(objectMap)
}
// AsUSQLJobProperties is the BasicProperties implementation for HiveJobProperties.
func (hjp HiveJobProperties) AsUSQLJobProperties() (*USQLJobProperties, bool) {
return nil, false
}
// AsHiveJobProperties is the BasicProperties implementation for HiveJobProperties.
func (hjp HiveJobProperties) AsHiveJobProperties() (*HiveJobProperties, bool) {
return &hjp, true
}
// AsScopeJobProperties is the BasicProperties implementation for HiveJobProperties.
func (hjp HiveJobProperties) AsScopeJobProperties() (*ScopeJobProperties, bool) {
return nil, false
}
// AsProperties is the BasicProperties implementation for HiveJobProperties.
func (hjp HiveJobProperties) AsProperties() (*Properties, bool) {
return nil, false
}
// AsBasicProperties is the BasicProperties implementation for HiveJobProperties.
func (hjp HiveJobProperties) AsBasicProperties() (BasicProperties, bool) {
return &hjp, true
}
// InfoListResult list of JobInfo items.
type InfoListResult struct {
autorest.Response `json:"-"`
// Value - READ-ONLY; The list of JobInfo items.
Value *[]InformationBasic `json:"value,omitempty"`
// NextLink - READ-ONLY; The link (url) to the next page of results.
NextLink *string `json:"nextLink,omitempty"`
}
// MarshalJSON is the custom marshaler for InfoListResult.
func (ilr InfoListResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// InfoListResultIterator provides access to a complete listing of InformationBasic values.
type InfoListResultIterator struct {
i int
page InfoListResultPage
}
// NextWithContext advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *InfoListResultIterator) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/InfoListResultIterator.NextWithContext")
defer func() {
sc := -1
if iter.Response().Response.Response != nil {
sc = iter.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
iter.i++
if iter.i < len(iter.page.Values()) {
return nil
}
err = iter.page.NextWithContext(ctx)
if err != nil {
iter.i--
return err
}
iter.i = 0
return nil
}
// Next advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *InfoListResultIterator) Next() error {
return iter.NextWithContext(context.Background())
}
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter InfoListResultIterator) NotDone() bool {
return iter.page.NotDone() && iter.i < len(iter.page.Values())
}
// Response returns the raw server response from the last page request.
func (iter InfoListResultIterator) Response() InfoListResult {
return iter.page.Response()
}
// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter InfoListResultIterator) Value() InformationBasic {
if !iter.page.NotDone() {
return InformationBasic{}
}
return iter.page.Values()[iter.i]
}
// Creates a new instance of the InfoListResultIterator type.
func NewInfoListResultIterator(page InfoListResultPage) InfoListResultIterator {
return InfoListResultIterator{page: page}
}
// IsEmpty returns true if the ListResult contains no values.
func (ilr InfoListResult) IsEmpty() bool {
return ilr.Value == nil || len(*ilr.Value) == 0
}
// hasNextLink returns true if the NextLink is not empty.
func (ilr InfoListResult) hasNextLink() bool {
return ilr.NextLink != nil && len(*ilr.NextLink) != 0
}
// infoListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (ilr InfoListResult) infoListResultPreparer(ctx context.Context) (*http.Request, error) {
if !ilr.hasNextLink() {
return nil, nil
}
return autorest.Prepare((&http.Request{}).WithContext(ctx),
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(ilr.NextLink)))
}
// InfoListResultPage contains a page of InformationBasic values.
type InfoListResultPage struct {
fn func(context.Context, InfoListResult) (InfoListResult, error)
ilr InfoListResult
}
// NextWithContext advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
func (page *InfoListResultPage) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/InfoListResultPage.NextWithContext")
defer func() {
sc := -1
if page.Response().Response.Response != nil {
sc = page.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
for {
next, err := page.fn(ctx, page.ilr)
if err != nil {
return err
}
page.ilr = next
if !next.hasNextLink() || !next.IsEmpty() {
break
}
}
return nil
}
// Next advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *InfoListResultPage) Next() error {
return page.NextWithContext(context.Background())
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page InfoListResultPage) NotDone() bool {
return !page.ilr.IsEmpty()
}
// Response returns the raw server response from the last page request.
func (page InfoListResultPage) Response() InfoListResult {
return page.ilr
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page InfoListResultPage) Values() []InformationBasic {
if page.ilr.IsEmpty() {
return nil
}
return *page.ilr.Value
}
// Creates a new instance of the InfoListResultPage type.
func NewInfoListResultPage(cur InfoListResult, getNextPage func(context.Context, InfoListResult) (InfoListResult, error)) InfoListResultPage {
return InfoListResultPage{
fn: getNextPage,
ilr: cur,
}
}
// Information the extended Data Lake Analytics job information properties returned when retrieving a
// specific job.
type Information struct {
autorest.Response `json:"-"`
// ErrorMessage - READ-ONLY; The error message details for the job, if the job failed.
ErrorMessage *[]ErrorDetails `json:"errorMessage,omitempty"`
// StateAuditRecords - READ-ONLY; The job state audit records, indicating when various operations have been performed on this job.
StateAuditRecords *[]StateAuditRecord `json:"stateAuditRecords,omitempty"`
// Properties - The job specific properties.
Properties BasicProperties `json:"properties,omitempty"`
// JobID - READ-ONLY; The job's unique identifier (a GUID).
JobID *uuid.UUID `json:"jobId,omitempty"`
// Name - The friendly name of the job.
Name *string `json:"name,omitempty"`
// Type - The job type of the current job (Hive, USql, or Scope (for internal use only)). Possible values include: 'USQL', 'Hive', 'Scope'
Type TypeEnum `json:"type,omitempty"`
// Submitter - READ-ONLY; The user or account that submitted the job.
Submitter *string `json:"submitter,omitempty"`
// DegreeOfParallelism - The degree of parallelism used for this job.
DegreeOfParallelism *int32 `json:"degreeOfParallelism,omitempty"`
// DegreeOfParallelismPercent - READ-ONLY; the degree of parallelism in percentage used for this job.
DegreeOfParallelismPercent *float64 `json:"degreeOfParallelismPercent,omitempty"`
// Priority - The priority value for the current job. Lower numbers have a higher priority. By default, a job has a priority of 1000. This must be greater than 0.
Priority *int32 `json:"priority,omitempty"`
// SubmitTime - READ-ONLY; The time the job was submitted to the service.
SubmitTime *date.Time `json:"submitTime,omitempty"`
// StartTime - READ-ONLY; The start time of the job.
StartTime *date.Time `json:"startTime,omitempty"`
// EndTime - READ-ONLY; The completion time of the job.
EndTime *date.Time `json:"endTime,omitempty"`
// State - READ-ONLY; The job state. When the job is in the Ended state, refer to Result and ErrorMessage for details. Possible values include: 'StateAccepted', 'StateCompiling', 'StateEnded', 'StateNew', 'StateQueued', 'StateRunning', 'StateScheduling', 'StateStarting', 'StatePaused', 'StateWaitingForCapacity', 'StateYielded', 'StateFinalizing'
State State `json:"state,omitempty"`
// Result - READ-ONLY; The result of job execution or the current result of the running job. Possible values include: 'None', 'Succeeded', 'Cancelled', 'Failed'
Result Result `json:"result,omitempty"`
// LogFolder - READ-ONLY; The log folder path to use in the following format: adl://<accountName>.azuredatalakestore.net/system/jobservice/jobs/Usql/2016/03/13/17/18/5fe51957-93bc-4de0-8ddc-c5a4753b068b/logs/.
LogFolder *string `json:"logFolder,omitempty"`
// LogFilePatterns - The list of log file name patterns to find in the logFolder. '*' is the only matching character allowed. Example format: jobExecution*.log or *mylog*.txt
LogFilePatterns *[]string `json:"logFilePatterns,omitempty"`
// Related - The recurring job relationship information properties.
Related *RelationshipProperties `json:"related,omitempty"`
// Tags - The key-value pairs used to add additional metadata to the job information. (Only for use internally with Scope job type.)
Tags map[string]*string `json:"tags"`
// HierarchyQueueNode - READ-ONLY; the name of hierarchy queue node this job is assigned to, Null if job has not been assigned yet or the account doesn't have hierarchy queue.
HierarchyQueueNode *string `json:"hierarchyQueueNode,omitempty"`
}
// MarshalJSON is the custom marshaler for Information.
func (i Information) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
objectMap["properties"] = i.Properties
if i.Name != nil {
objectMap["name"] = i.Name
}
if i.Type != "" {
objectMap["type"] = i.Type
}
if i.DegreeOfParallelism != nil {
objectMap["degreeOfParallelism"] = i.DegreeOfParallelism
}
if i.Priority != nil {
objectMap["priority"] = i.Priority
}
if i.LogFilePatterns != nil {
objectMap["logFilePatterns"] = i.LogFilePatterns
}
if i.Related != nil {
objectMap["related"] = i.Related
}
if i.Tags != nil {
objectMap["tags"] = i.Tags
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for Information struct.
func (i *Information) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "errorMessage":
if v != nil {
var errorMessage []ErrorDetails
err = json.Unmarshal(*v, &errorMessage)
if err != nil {
return err
}
i.ErrorMessage = &errorMessage
}
case "stateAuditRecords":
if v != nil {
var stateAuditRecords []StateAuditRecord
err = json.Unmarshal(*v, &stateAuditRecords)
if err != nil {
return err
}
i.StateAuditRecords = &stateAuditRecords
}
case "properties":
if v != nil {
properties, err := unmarshalBasicProperties(*v)
if err != nil {
return err
}
i.Properties = properties
}
case "jobId":
if v != nil {
var jobID uuid.UUID
err = json.Unmarshal(*v, &jobID)
if err != nil {
return err
}
i.JobID = &jobID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
i.Name = &name
}
case "type":
if v != nil {
var typeVar TypeEnum
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
i.Type = typeVar
}
case "submitter":
if v != nil {
var submitter string
err = json.Unmarshal(*v, &submitter)
if err != nil {
return err
}
i.Submitter = &submitter
}
case "degreeOfParallelism":
if v != nil {
var degreeOfParallelism int32
err = json.Unmarshal(*v, °reeOfParallelism)
if err != nil {
return err
}
i.DegreeOfParallelism = °reeOfParallelism
}
case "degreeOfParallelismPercent":
if v != nil {
var degreeOfParallelismPercent float64
err = json.Unmarshal(*v, °reeOfParallelismPercent)
if err != nil {
return err
}
i.DegreeOfParallelismPercent = °reeOfParallelismPercent
}
case "priority":
if v != nil {
var priority int32
err = json.Unmarshal(*v, &priority)
if err != nil {
return err
}
i.Priority = &priority
}
case "submitTime":
if v != nil {
var submitTime date.Time
err = json.Unmarshal(*v, &submitTime)
if err != nil {
return err
}
i.SubmitTime = &submitTime
}
case "startTime":
if v != nil {
var startTime date.Time
err = json.Unmarshal(*v, &startTime)
if err != nil {
return err
}
i.StartTime = &startTime
}
case "endTime":
if v != nil {
var endTime date.Time
err = json.Unmarshal(*v, &endTime)
if err != nil {
return err
}
i.EndTime = &endTime
}
case "state":
if v != nil {
var state State
err = json.Unmarshal(*v, &state)
if err != nil {
return err
}
i.State = state
}
case "result":
if v != nil {
var resultVar Result
err = json.Unmarshal(*v, &resultVar)
if err != nil {
return err
}
i.Result = resultVar
}
case "logFolder":
if v != nil {
var logFolder string
err = json.Unmarshal(*v, &logFolder)
if err != nil {
return err
}
i.LogFolder = &logFolder
}
case "logFilePatterns":
if v != nil {
var logFilePatterns []string
err = json.Unmarshal(*v, &logFilePatterns)
if err != nil {
return err
}
i.LogFilePatterns = &logFilePatterns
}
case "related":
if v != nil {
var related RelationshipProperties
err = json.Unmarshal(*v, &related)
if err != nil {
return err
}
i.Related = &related
}
case "tags":
if v != nil {
var tags map[string]*string
err = json.Unmarshal(*v, &tags)
if err != nil {
return err
}
i.Tags = tags
}
case "hierarchyQueueNode":
if v != nil {
var hierarchyQueueNode string
err = json.Unmarshal(*v, &hierarchyQueueNode)
if err != nil {
return err
}
i.HierarchyQueueNode = &hierarchyQueueNode
}
}
}
return nil
}
// InformationBasic the common Data Lake Analytics job information properties.
type InformationBasic struct {
// JobID - READ-ONLY; The job's unique identifier (a GUID).
JobID *uuid.UUID `json:"jobId,omitempty"`
// Name - The friendly name of the job.
Name *string `json:"name,omitempty"`
// Type - The job type of the current job (Hive, USql, or Scope (for internal use only)). Possible values include: 'USQL', 'Hive', 'Scope'
Type TypeEnum `json:"type,omitempty"`
// Submitter - READ-ONLY; The user or account that submitted the job.
Submitter *string `json:"submitter,omitempty"`
// DegreeOfParallelism - The degree of parallelism used for this job.
DegreeOfParallelism *int32 `json:"degreeOfParallelism,omitempty"`
// DegreeOfParallelismPercent - READ-ONLY; the degree of parallelism in percentage used for this job.
DegreeOfParallelismPercent *float64 `json:"degreeOfParallelismPercent,omitempty"`
// Priority - The priority value for the current job. Lower numbers have a higher priority. By default, a job has a priority of 1000. This must be greater than 0.
Priority *int32 `json:"priority,omitempty"`
// SubmitTime - READ-ONLY; The time the job was submitted to the service.
SubmitTime *date.Time `json:"submitTime,omitempty"`
// StartTime - READ-ONLY; The start time of the job.
StartTime *date.Time `json:"startTime,omitempty"`
// EndTime - READ-ONLY; The completion time of the job.
EndTime *date.Time `json:"endTime,omitempty"`
// State - READ-ONLY; The job state. When the job is in the Ended state, refer to Result and ErrorMessage for details. Possible values include: 'StateAccepted', 'StateCompiling', 'StateEnded', 'StateNew', 'StateQueued', 'StateRunning', 'StateScheduling', 'StateStarting', 'StatePaused', 'StateWaitingForCapacity', 'StateYielded', 'StateFinalizing'
State State `json:"state,omitempty"`
// Result - READ-ONLY; The result of job execution or the current result of the running job. Possible values include: 'None', 'Succeeded', 'Cancelled', 'Failed'
Result Result `json:"result,omitempty"`
// LogFolder - READ-ONLY; The log folder path to use in the following format: adl://<accountName>.azuredatalakestore.net/system/jobservice/jobs/Usql/2016/03/13/17/18/5fe51957-93bc-4de0-8ddc-c5a4753b068b/logs/.
LogFolder *string `json:"logFolder,omitempty"`
// LogFilePatterns - The list of log file name patterns to find in the logFolder. '*' is the only matching character allowed. Example format: jobExecution*.log or *mylog*.txt
LogFilePatterns *[]string `json:"logFilePatterns,omitempty"`
// Related - The recurring job relationship information properties.
Related *RelationshipProperties `json:"related,omitempty"`
// Tags - The key-value pairs used to add additional metadata to the job information. (Only for use internally with Scope job type.)
Tags map[string]*string `json:"tags"`
// HierarchyQueueNode - READ-ONLY; the name of hierarchy queue node this job is assigned to, Null if job has not been assigned yet or the account doesn't have hierarchy queue.
HierarchyQueueNode *string `json:"hierarchyQueueNode,omitempty"`
}
// MarshalJSON is the custom marshaler for InformationBasic.
func (ib InformationBasic) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if ib.Name != nil {
objectMap["name"] = ib.Name
}
if ib.Type != "" {
objectMap["type"] = ib.Type
}
if ib.DegreeOfParallelism != nil {
objectMap["degreeOfParallelism"] = ib.DegreeOfParallelism
}
if ib.Priority != nil {
objectMap["priority"] = ib.Priority
}
if ib.LogFilePatterns != nil {
objectMap["logFilePatterns"] = ib.LogFilePatterns
}
if ib.Related != nil {
objectMap["related"] = ib.Related
}
if ib.Tags != nil {
objectMap["tags"] = ib.Tags
}
return json.Marshal(objectMap)
}
// InnerError the Data Lake Analytics job error details.
type InnerError struct {
// ErrorID - READ-ONLY; The specific identifier for the type of error encountered in the job.
ErrorID *string `json:"errorId,omitempty"`
// Severity - READ-ONLY; The severity level of the failure. Possible values include: 'Warning', 'Error', 'Info', 'SevereWarning', 'Deprecated', 'UserWarning'
Severity SeverityTypes `json:"severity,omitempty"`
// Source - READ-ONLY; The ultimate source of the failure (usually either SYSTEM or USER).
Source *string `json:"source,omitempty"`
// Message - READ-ONLY; The user friendly error message for the failure.
Message *string `json:"message,omitempty"`
// Description - READ-ONLY; The error message description.
Description *string `json:"description,omitempty"`
// Details - READ-ONLY; The details of the error message.
Details *string `json:"details,omitempty"`
// DiagnosticCode - READ-ONLY; The diagnostic error code.
DiagnosticCode *int32 `json:"diagnosticCode,omitempty"`
// Component - READ-ONLY; The component that failed.
Component *string `json:"component,omitempty"`
// Resolution - READ-ONLY; The recommended resolution for the failure, if any.
Resolution *string `json:"resolution,omitempty"`
// HelpLink - READ-ONLY; The link to MSDN or Azure help for this type of error, if any.
HelpLink *string `json:"helpLink,omitempty"`
// InternalDiagnostics - READ-ONLY; The internal diagnostic stack trace if the user requesting the job error details has sufficient permissions it will be retrieved, otherwise it will be empty.
InternalDiagnostics *string `json:"internalDiagnostics,omitempty"`
// InnerError - READ-ONLY; The inner error of this specific job error message, if any.
InnerError *InnerError `json:"innerError,omitempty"`
}
// MarshalJSON is the custom marshaler for InnerError.
func (ie InnerError) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// PipelineInformation job Pipeline Information, showing the relationship of jobs and recurrences of those
// jobs in a pipeline.
type PipelineInformation struct {
autorest.Response `json:"-"`
// PipelineID - READ-ONLY; The job relationship pipeline identifier (a GUID).
PipelineID *uuid.UUID `json:"pipelineId,omitempty"`
// PipelineName - READ-ONLY; The friendly name of the job relationship pipeline, which does not need to be unique.
PipelineName *string `json:"pipelineName,omitempty"`
// PipelineURI - READ-ONLY; The pipeline uri, unique, links to the originating service for this pipeline.
PipelineURI *string `json:"pipelineUri,omitempty"`
// NumJobsFailed - READ-ONLY; The number of jobs in this pipeline that have failed.
NumJobsFailed *int32 `json:"numJobsFailed,omitempty"`
// NumJobsCanceled - READ-ONLY; The number of jobs in this pipeline that have been canceled.
NumJobsCanceled *int32 `json:"numJobsCanceled,omitempty"`
// NumJobsSucceeded - READ-ONLY; The number of jobs in this pipeline that have succeeded.
NumJobsSucceeded *int32 `json:"numJobsSucceeded,omitempty"`
// AuHoursFailed - READ-ONLY; The number of job execution hours that resulted in failed jobs.
AuHoursFailed *float64 `json:"auHoursFailed,omitempty"`
// AuHoursCanceled - READ-ONLY; The number of job execution hours that resulted in canceled jobs.
AuHoursCanceled *float64 `json:"auHoursCanceled,omitempty"`
// AuHoursSucceeded - READ-ONLY; The number of job execution hours that resulted in successful jobs.
AuHoursSucceeded *float64 `json:"auHoursSucceeded,omitempty"`
// LastSubmitTime - READ-ONLY; The last time a job in this pipeline was submitted.
LastSubmitTime *date.Time `json:"lastSubmitTime,omitempty"`
// Runs - READ-ONLY; The list of recurrence identifiers representing each run of this pipeline.
Runs *[]PipelineRunInformation `json:"runs,omitempty"`
// Recurrences - READ-ONLY; The list of recurrence identifiers representing each run of this pipeline.
Recurrences *[]uuid.UUID `json:"recurrences,omitempty"`
}
// MarshalJSON is the custom marshaler for PipelineInformation.
func (pi PipelineInformation) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// PipelineInformationListResult list of job pipeline information items.
type PipelineInformationListResult struct {
autorest.Response `json:"-"`
// Value - READ-ONLY; The list of job pipeline information items.
Value *[]PipelineInformation `json:"value,omitempty"`
// NextLink - READ-ONLY; The link (url) to the next page of results.
NextLink *string `json:"nextLink,omitempty"`
}
// MarshalJSON is the custom marshaler for PipelineInformationListResult.
func (pilr PipelineInformationListResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// PipelineInformationListResultIterator provides access to a complete listing of PipelineInformation
// values.
type PipelineInformationListResultIterator struct {
i int
page PipelineInformationListResultPage
}
// NextWithContext advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *PipelineInformationListResultIterator) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/PipelineInformationListResultIterator.NextWithContext")
defer func() {
sc := -1
if iter.Response().Response.Response != nil {
sc = iter.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
iter.i++
if iter.i < len(iter.page.Values()) {
return nil
}
err = iter.page.NextWithContext(ctx)
if err != nil {
iter.i--
return err
}
iter.i = 0
return nil
}
// Next advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *PipelineInformationListResultIterator) Next() error {
return iter.NextWithContext(context.Background())
}
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter PipelineInformationListResultIterator) NotDone() bool {
return iter.page.NotDone() && iter.i < len(iter.page.Values())
}
// Response returns the raw server response from the last page request.
func (iter PipelineInformationListResultIterator) Response() PipelineInformationListResult {
return iter.page.Response()
}
// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter PipelineInformationListResultIterator) Value() PipelineInformation {
if !iter.page.NotDone() {
return PipelineInformation{}
}
return iter.page.Values()[iter.i]
}
// Creates a new instance of the PipelineInformationListResultIterator type.
func NewPipelineInformationListResultIterator(page PipelineInformationListResultPage) PipelineInformationListResultIterator {
return PipelineInformationListResultIterator{page: page}
}
// IsEmpty returns true if the ListResult contains no values.
func (pilr PipelineInformationListResult) IsEmpty() bool {
return pilr.Value == nil || len(*pilr.Value) == 0
}
// hasNextLink returns true if the NextLink is not empty.
func (pilr PipelineInformationListResult) hasNextLink() bool {
return pilr.NextLink != nil && len(*pilr.NextLink) != 0
}
// pipelineInformationListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (pilr PipelineInformationListResult) pipelineInformationListResultPreparer(ctx context.Context) (*http.Request, error) {
if !pilr.hasNextLink() {
return nil, nil
}
return autorest.Prepare((&http.Request{}).WithContext(ctx),
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(pilr.NextLink)))
}
// PipelineInformationListResultPage contains a page of PipelineInformation values.
type PipelineInformationListResultPage struct {
fn func(context.Context, PipelineInformationListResult) (PipelineInformationListResult, error)
pilr PipelineInformationListResult
}
// NextWithContext advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
func (page *PipelineInformationListResultPage) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/PipelineInformationListResultPage.NextWithContext")
defer func() {
sc := -1
if page.Response().Response.Response != nil {
sc = page.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
for {
next, err := page.fn(ctx, page.pilr)
if err != nil {
return err
}
page.pilr = next
if !next.hasNextLink() || !next.IsEmpty() {
break
}
}
return nil
}
// Next advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *PipelineInformationListResultPage) Next() error {
return page.NextWithContext(context.Background())
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page PipelineInformationListResultPage) NotDone() bool {
return !page.pilr.IsEmpty()
}
// Response returns the raw server response from the last page request.
func (page PipelineInformationListResultPage) Response() PipelineInformationListResult {
return page.pilr
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page PipelineInformationListResultPage) Values() []PipelineInformation {
if page.pilr.IsEmpty() {
return nil
}
return *page.pilr.Value
}
// Creates a new instance of the PipelineInformationListResultPage type.
func NewPipelineInformationListResultPage(cur PipelineInformationListResult, getNextPage func(context.Context, PipelineInformationListResult) (PipelineInformationListResult, error)) PipelineInformationListResultPage {
return PipelineInformationListResultPage{
fn: getNextPage,
pilr: cur,
}
}
// PipelineRunInformation run info for a specific job pipeline.
type PipelineRunInformation struct {
// RunID - READ-ONLY; The run identifier of an instance of pipeline executions (a GUID).
RunID *uuid.UUID `json:"runId,omitempty"`
// LastSubmitTime - READ-ONLY; The time this instance was last submitted.
LastSubmitTime *date.Time `json:"lastSubmitTime,omitempty"`
}
// MarshalJSON is the custom marshaler for PipelineRunInformation.
func (pri PipelineRunInformation) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// BasicProperties the common Data Lake Analytics job properties.
type BasicProperties interface {
AsUSQLJobProperties() (*USQLJobProperties, bool)
AsHiveJobProperties() (*HiveJobProperties, bool)
AsScopeJobProperties() (*ScopeJobProperties, bool)
AsProperties() (*Properties, bool)
}
// Properties the common Data Lake Analytics job properties.
type Properties struct {
// RuntimeVersion - The runtime version of the Data Lake Analytics engine to use for the specific type of job being run.
RuntimeVersion *string `json:"runtimeVersion,omitempty"`
// Script - The script to run. Please note that the maximum script size is 3 MB.
Script *string `json:"script,omitempty"`
// Type - Possible values include: 'TypeJobProperties', 'TypeUSQL', 'TypeHive', 'TypeScope'
Type Type `json:"type,omitempty"`
}
func unmarshalBasicProperties(body []byte) (BasicProperties, error) {
var m map[string]interface{}
err := json.Unmarshal(body, &m)
if err != nil {
return nil, err
}
switch m["type"] {
case string(TypeUSQL):
var usjp USQLJobProperties
err := json.Unmarshal(body, &usjp)
return usjp, err
case string(TypeHive):
var hjp HiveJobProperties
err := json.Unmarshal(body, &hjp)
return hjp, err
case string(TypeScope):
var sjp ScopeJobProperties
err := json.Unmarshal(body, &sjp)
return sjp, err
default:
var p Properties
err := json.Unmarshal(body, &p)
return p, err
}
}
func unmarshalBasicPropertiesArray(body []byte) ([]BasicProperties, error) {
var rawMessages []*json.RawMessage
err := json.Unmarshal(body, &rawMessages)
if err != nil {
return nil, err
}
pArray := make([]BasicProperties, len(rawMessages))
for index, rawMessage := range rawMessages {
p, err := unmarshalBasicProperties(*rawMessage)
if err != nil {
return nil, err
}
pArray[index] = p
}
return pArray, nil
}
// MarshalJSON is the custom marshaler for Properties.
func (p Properties) MarshalJSON() ([]byte, error) {
p.Type = TypeJobProperties
objectMap := make(map[string]interface{})
if p.RuntimeVersion != nil {
objectMap["runtimeVersion"] = p.RuntimeVersion
}
if p.Script != nil {
objectMap["script"] = p.Script
}
if p.Type != "" {
objectMap["type"] = p.Type
}
return json.Marshal(objectMap)
}
// AsUSQLJobProperties is the BasicProperties implementation for Properties.
func (p Properties) AsUSQLJobProperties() (*USQLJobProperties, bool) {
return nil, false
}
// AsHiveJobProperties is the BasicProperties implementation for Properties.
func (p Properties) AsHiveJobProperties() (*HiveJobProperties, bool) {
return nil, false
}
// AsScopeJobProperties is the BasicProperties implementation for Properties.
func (p Properties) AsScopeJobProperties() (*ScopeJobProperties, bool) {
return nil, false
}
// AsProperties is the BasicProperties implementation for Properties.
func (p Properties) AsProperties() (*Properties, bool) {
return &p, true
}
// AsBasicProperties is the BasicProperties implementation for Properties.
func (p Properties) AsBasicProperties() (BasicProperties, bool) {
return &p, true
}
// RecurrenceInformation recurrence job information for a specific recurrence.
type RecurrenceInformation struct {
autorest.Response `json:"-"`
// RecurrenceID - READ-ONLY; The recurrence identifier (a GUID), unique per activity/script, regardless of iterations. This is something to link different occurrences of the same job together.
RecurrenceID *uuid.UUID `json:"recurrenceId,omitempty"`
// RecurrenceName - READ-ONLY; The recurrence name, user friendly name for the correlation between jobs.
RecurrenceName *string `json:"recurrenceName,omitempty"`
// NumJobsFailed - READ-ONLY; The number of jobs in this recurrence that have failed.
NumJobsFailed *int32 `json:"numJobsFailed,omitempty"`
// NumJobsCanceled - READ-ONLY; The number of jobs in this recurrence that have been canceled.
NumJobsCanceled *int32 `json:"numJobsCanceled,omitempty"`
// NumJobsSucceeded - READ-ONLY; The number of jobs in this recurrence that have succeeded.
NumJobsSucceeded *int32 `json:"numJobsSucceeded,omitempty"`
// AuHoursFailed - READ-ONLY; The number of job execution hours that resulted in failed jobs.
AuHoursFailed *float64 `json:"auHoursFailed,omitempty"`
// AuHoursCanceled - READ-ONLY; The number of job execution hours that resulted in canceled jobs.
AuHoursCanceled *float64 `json:"auHoursCanceled,omitempty"`
// AuHoursSucceeded - READ-ONLY; The number of job execution hours that resulted in successful jobs.
AuHoursSucceeded *float64 `json:"auHoursSucceeded,omitempty"`
// LastSubmitTime - READ-ONLY; The last time a job in this recurrence was submitted.
LastSubmitTime *date.Time `json:"lastSubmitTime,omitempty"`
}
// MarshalJSON is the custom marshaler for RecurrenceInformation.
func (ri RecurrenceInformation) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// RecurrenceInformationListResult list of job recurrence information items.
type RecurrenceInformationListResult struct {
autorest.Response `json:"-"`
// Value - READ-ONLY; The list of job recurrence information items.
Value *[]RecurrenceInformation `json:"value,omitempty"`
// NextLink - READ-ONLY; The link (url) to the next page of results.
NextLink *string `json:"nextLink,omitempty"`
}
// MarshalJSON is the custom marshaler for RecurrenceInformationListResult.
func (rilr RecurrenceInformationListResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// RecurrenceInformationListResultIterator provides access to a complete listing of RecurrenceInformation
// values.
type RecurrenceInformationListResultIterator struct {
i int
page RecurrenceInformationListResultPage
}
// NextWithContext advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *RecurrenceInformationListResultIterator) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/RecurrenceInformationListResultIterator.NextWithContext")
defer func() {
sc := -1
if iter.Response().Response.Response != nil {
sc = iter.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
iter.i++
if iter.i < len(iter.page.Values()) {
return nil
}
err = iter.page.NextWithContext(ctx)
if err != nil {
iter.i--
return err
}
iter.i = 0
return nil
}
// Next advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *RecurrenceInformationListResultIterator) Next() error {
return iter.NextWithContext(context.Background())
}
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter RecurrenceInformationListResultIterator) NotDone() bool {
return iter.page.NotDone() && iter.i < len(iter.page.Values())
}
// Response returns the raw server response from the last page request.
func (iter RecurrenceInformationListResultIterator) Response() RecurrenceInformationListResult {
return iter.page.Response()
}
// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter RecurrenceInformationListResultIterator) Value() RecurrenceInformation {
if !iter.page.NotDone() {
return RecurrenceInformation{}
}
return iter.page.Values()[iter.i]
}
// Creates a new instance of the RecurrenceInformationListResultIterator type.
func NewRecurrenceInformationListResultIterator(page RecurrenceInformationListResultPage) RecurrenceInformationListResultIterator {
return RecurrenceInformationListResultIterator{page: page}
}
// IsEmpty returns true if the ListResult contains no values.
func (rilr RecurrenceInformationListResult) IsEmpty() bool {
return rilr.Value == nil || len(*rilr.Value) == 0
}
// hasNextLink returns true if the NextLink is not empty.
func (rilr RecurrenceInformationListResult) hasNextLink() bool {
return rilr.NextLink != nil && len(*rilr.NextLink) != 0
}
// recurrenceInformationListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (rilr RecurrenceInformationListResult) recurrenceInformationListResultPreparer(ctx context.Context) (*http.Request, error) {
if !rilr.hasNextLink() {
return nil, nil
}
return autorest.Prepare((&http.Request{}).WithContext(ctx),
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(rilr.NextLink)))
}
// RecurrenceInformationListResultPage contains a page of RecurrenceInformation values.
type RecurrenceInformationListResultPage struct {
fn func(context.Context, RecurrenceInformationListResult) (RecurrenceInformationListResult, error)
rilr RecurrenceInformationListResult
}
// NextWithContext advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
func (page *RecurrenceInformationListResultPage) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/RecurrenceInformationListResultPage.NextWithContext")
defer func() {
sc := -1
if page.Response().Response.Response != nil {
sc = page.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
for {
next, err := page.fn(ctx, page.rilr)
if err != nil {
return err
}
page.rilr = next
if !next.hasNextLink() || !next.IsEmpty() {
break
}
}
return nil
}
// Next advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *RecurrenceInformationListResultPage) Next() error {
return page.NextWithContext(context.Background())
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page RecurrenceInformationListResultPage) NotDone() bool {
return !page.rilr.IsEmpty()
}
// Response returns the raw server response from the last page request.
func (page RecurrenceInformationListResultPage) Response() RecurrenceInformationListResult {
return page.rilr
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page RecurrenceInformationListResultPage) Values() []RecurrenceInformation {
if page.rilr.IsEmpty() {
return nil
}
return *page.rilr.Value
}
// Creates a new instance of the RecurrenceInformationListResultPage type.
func NewRecurrenceInformationListResultPage(cur RecurrenceInformationListResult, getNextPage func(context.Context, RecurrenceInformationListResult) (RecurrenceInformationListResult, error)) RecurrenceInformationListResultPage {
return RecurrenceInformationListResultPage{
fn: getNextPage,
rilr: cur,
}
}
// RelationshipProperties job relationship information properties including pipeline information,
// correlation information, etc.
type RelationshipProperties struct {
// PipelineID - The job relationship pipeline identifier (a GUID).
PipelineID *uuid.UUID `json:"pipelineId,omitempty"`
// PipelineName - The friendly name of the job relationship pipeline, which does not need to be unique.
PipelineName *string `json:"pipelineName,omitempty"`
// PipelineURI - The pipeline uri, unique, links to the originating service for this pipeline.
PipelineURI *string `json:"pipelineUri,omitempty"`
// RunID - The run identifier (a GUID), unique identifier of the iteration of this pipeline.
RunID *uuid.UUID `json:"runId,omitempty"`
// RecurrenceID - The recurrence identifier (a GUID), unique per activity/script, regardless of iterations. This is something to link different occurrences of the same job together.
RecurrenceID *uuid.UUID `json:"recurrenceId,omitempty"`
// RecurrenceName - The recurrence name, user friendly name for the correlation between jobs.
RecurrenceName *string `json:"recurrenceName,omitempty"`
}
// Resource the Data Lake Analytics job resources.
type Resource struct {
// Name - The name of the resource.
Name *string `json:"name,omitempty"`
// ResourcePath - The path to the resource.
ResourcePath *string `json:"resourcePath,omitempty"`
// Type - The job resource type. Possible values include: 'VertexResource', 'JobManagerResource', 'StatisticsResource', 'VertexResourceInUserFolder', 'JobManagerResourceInUserFolder', 'StatisticsResourceInUserFolder'
Type ResourceType `json:"type,omitempty"`
}
// ResourceUsageStatistics the statistics information for resource usage.
type ResourceUsageStatistics struct {
// Average - READ-ONLY; The average value.
Average *float64 `json:"average,omitempty"`
// Minimum - READ-ONLY; The minimum value.
Minimum *int64 `json:"minimum,omitempty"`
// Maximum - READ-ONLY; The maximum value.
Maximum *int64 `json:"maximum,omitempty"`
}
// MarshalJSON is the custom marshaler for ResourceUsageStatistics.
func (rus ResourceUsageStatistics) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// ScopeJobProperties scope job properties used when submitting and retrieving Scope jobs. (Only for use
// internally with Scope job type.)
type ScopeJobProperties struct {
// Resources - READ-ONLY; The list of resources that are required by the job.
Resources *[]ScopeJobResource `json:"resources,omitempty"`
// UserAlgebraPath - READ-ONLY; The algebra file path after the job has completed.
UserAlgebraPath *string `json:"userAlgebraPath,omitempty"`
// Notifier - The list of email addresses, separated by semi-colons, to notify when the job reaches a terminal state.
Notifier *string `json:"notifier,omitempty"`
// TotalCompilationTime - READ-ONLY; The total time this job spent compiling. This value should not be set by the user and will be ignored if it is.
TotalCompilationTime *string `json:"totalCompilationTime,omitempty"`
// TotalQueuedTime - READ-ONLY; The total time this job spent queued. This value should not be set by the user and will be ignored if it is.
TotalQueuedTime *string `json:"totalQueuedTime,omitempty"`
// TotalRunningTime - READ-ONLY; The total time this job spent executing. This value should not be set by the user and will be ignored if it is.
TotalRunningTime *string `json:"totalRunningTime,omitempty"`
// TotalPausedTime - READ-ONLY; The total time this job spent paused. This value should not be set by the user and will be ignored if it is.
TotalPausedTime *string `json:"totalPausedTime,omitempty"`
// RootProcessNodeID - READ-ONLY; The ID used to identify the job manager coordinating job execution. This value should not be set by the user and will be ignored if it is.
RootProcessNodeID *string `json:"rootProcessNodeId,omitempty"`
// YarnApplicationID - READ-ONLY; The ID used to identify the yarn application executing the job. This value should not be set by the user and will be ignored if it is.
YarnApplicationID *string `json:"yarnApplicationId,omitempty"`
// RuntimeVersion - The runtime version of the Data Lake Analytics engine to use for the specific type of job being run.
RuntimeVersion *string `json:"runtimeVersion,omitempty"`
// Script - The script to run. Please note that the maximum script size is 3 MB.
Script *string `json:"script,omitempty"`
// Type - Possible values include: 'TypeJobProperties', 'TypeUSQL', 'TypeHive', 'TypeScope'
Type Type `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for ScopeJobProperties.
func (sjp ScopeJobProperties) MarshalJSON() ([]byte, error) {
sjp.Type = TypeScope
objectMap := make(map[string]interface{})
if sjp.Notifier != nil {
objectMap["notifier"] = sjp.Notifier
}
if sjp.RuntimeVersion != nil {
objectMap["runtimeVersion"] = sjp.RuntimeVersion
}
if sjp.Script != nil {
objectMap["script"] = sjp.Script
}
if sjp.Type != "" {
objectMap["type"] = sjp.Type
}
return json.Marshal(objectMap)
}
// AsUSQLJobProperties is the BasicProperties implementation for ScopeJobProperties.
func (sjp ScopeJobProperties) AsUSQLJobProperties() (*USQLJobProperties, bool) {
return nil, false
}
// AsHiveJobProperties is the BasicProperties implementation for ScopeJobProperties.
func (sjp ScopeJobProperties) AsHiveJobProperties() (*HiveJobProperties, bool) {
return nil, false
}
// AsScopeJobProperties is the BasicProperties implementation for ScopeJobProperties.
func (sjp ScopeJobProperties) AsScopeJobProperties() (*ScopeJobProperties, bool) {
return &sjp, true
}
// AsProperties is the BasicProperties implementation for ScopeJobProperties.
func (sjp ScopeJobProperties) AsProperties() (*Properties, bool) {
return nil, false
}
// AsBasicProperties is the BasicProperties implementation for ScopeJobProperties.
func (sjp ScopeJobProperties) AsBasicProperties() (BasicProperties, bool) {
return &sjp, true
}
// ScopeJobResource the Scope job resources. (Only for use internally with Scope job type.)
type ScopeJobResource struct {
// Name - The name of the resource.
Name *string `json:"name,omitempty"`
// Path - The path to the resource.
Path *string `json:"path,omitempty"`
}
// StateAuditRecord the Data Lake Analytics job state audit records for tracking the lifecycle of a job.
type StateAuditRecord struct {
// NewState - READ-ONLY; The new state the job is in.
NewState *string `json:"newState,omitempty"`
// TimeStamp - READ-ONLY; The time stamp that the state change took place.
TimeStamp *date.Time `json:"timeStamp,omitempty"`
// RequestedByUser - READ-ONLY; The user who requests the change.
RequestedByUser *string `json:"requestedByUser,omitempty"`
// Details - READ-ONLY; The details of the audit log.
Details *string `json:"details,omitempty"`
}
// MarshalJSON is the custom marshaler for StateAuditRecord.
func (sar StateAuditRecord) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// Statistics the Data Lake Analytics job execution statistics.
type Statistics struct {
autorest.Response `json:"-"`
// LastUpdateTimeUtc - READ-ONLY; The last update time for the statistics.
LastUpdateTimeUtc *date.Time `json:"lastUpdateTimeUtc,omitempty"`
// FinalizingTimeUtc - READ-ONLY; The job finalizing start time.
FinalizingTimeUtc *date.Time `json:"finalizingTimeUtc,omitempty"`
// Stages - READ-ONLY; The list of stages for the job.
Stages *[]StatisticsVertexStage `json:"stages,omitempty"`
}
// MarshalJSON is the custom marshaler for Statistics.
func (s Statistics) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// StatisticsVertex the detailed information for a vertex.
type StatisticsVertex struct {
// Name - READ-ONLY; The name of the vertex.
Name *string `json:"name,omitempty"`
// VertexID - READ-ONLY; The id of the vertex.
VertexID *uuid.UUID `json:"vertexId,omitempty"`
// ExecutionTime - READ-ONLY; The amount of execution time of the vertex.
ExecutionTime *string `json:"executionTime,omitempty"`
// DataRead - READ-ONLY; The amount of data read of the vertex, in bytes.
DataRead *int64 `json:"dataRead,omitempty"`
// PeakMemUsage - READ-ONLY; The amount of peak memory usage of the vertex, in bytes.
PeakMemUsage *int64 `json:"peakMemUsage,omitempty"`
}
// MarshalJSON is the custom marshaler for StatisticsVertex.
func (sv StatisticsVertex) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// StatisticsVertexStage the Data Lake Analytics job statistics vertex stage information.
type StatisticsVertexStage struct {
// DataRead - READ-ONLY; The amount of data read, in bytes.
DataRead *int64 `json:"dataRead,omitempty"`
// DataReadCrossPod - READ-ONLY; The amount of data read across multiple pods, in bytes.
DataReadCrossPod *int64 `json:"dataReadCrossPod,omitempty"`
// DataReadIntraPod - READ-ONLY; The amount of data read in one pod, in bytes.
DataReadIntraPod *int64 `json:"dataReadIntraPod,omitempty"`
// DataToRead - READ-ONLY; The amount of data remaining to be read, in bytes.
DataToRead *int64 `json:"dataToRead,omitempty"`
// DataWritten - READ-ONLY; The amount of data written, in bytes.
DataWritten *int64 `json:"dataWritten,omitempty"`
// DuplicateDiscardCount - READ-ONLY; The number of duplicates that were discarded.
DuplicateDiscardCount *int32 `json:"duplicateDiscardCount,omitempty"`
// FailedCount - READ-ONLY; The number of failures that occurred in this stage.
FailedCount *int32 `json:"failedCount,omitempty"`
// MaxVertexDataRead - READ-ONLY; The maximum amount of data read in a single vertex, in bytes.
MaxVertexDataRead *int64 `json:"maxVertexDataRead,omitempty"`
// MinVertexDataRead - READ-ONLY; The minimum amount of data read in a single vertex, in bytes.
MinVertexDataRead *int64 `json:"minVertexDataRead,omitempty"`
// ReadFailureCount - READ-ONLY; The number of read failures in this stage.
ReadFailureCount *int32 `json:"readFailureCount,omitempty"`
// RevocationCount - READ-ONLY; The number of vertices that were revoked during this stage.
RevocationCount *int32 `json:"revocationCount,omitempty"`
// RunningCount - READ-ONLY; The number of currently running vertices in this stage.
RunningCount *int32 `json:"runningCount,omitempty"`
// ScheduledCount - READ-ONLY; The number of currently scheduled vertices in this stage.
ScheduledCount *int32 `json:"scheduledCount,omitempty"`
// StageName - READ-ONLY; The name of this stage in job execution.
StageName *string `json:"stageName,omitempty"`
// SucceededCount - READ-ONLY; The number of vertices that succeeded in this stage.
SucceededCount *int32 `json:"succeededCount,omitempty"`
// TempDataWritten - READ-ONLY; The amount of temporary data written, in bytes.
TempDataWritten *int64 `json:"tempDataWritten,omitempty"`
// TotalCount - READ-ONLY; The total vertex count for this stage.
TotalCount *int32 `json:"totalCount,omitempty"`
// TotalFailedTime - READ-ONLY; The amount of time that failed vertices took up in this stage.
TotalFailedTime *string `json:"totalFailedTime,omitempty"`
// TotalProgress - READ-ONLY; The current progress of this stage, as a percentage.
TotalProgress *int32 `json:"totalProgress,omitempty"`
// TotalSucceededTime - READ-ONLY; The amount of time all successful vertices took in this stage.
TotalSucceededTime *string `json:"totalSucceededTime,omitempty"`
// TotalPeakMemUsage - READ-ONLY; The sum of the peak memory usage of all the vertices in the stage, in bytes.
TotalPeakMemUsage *int64 `json:"totalPeakMemUsage,omitempty"`
// TotalExecutionTime - READ-ONLY; The sum of the total execution time of all the vertices in the stage.
TotalExecutionTime *string `json:"totalExecutionTime,omitempty"`
// MaxDataReadVertex - the vertex with the maximum amount of data read.
MaxDataReadVertex *StatisticsVertex `json:"maxDataReadVertex,omitempty"`
// MaxExecutionTimeVertex - the vertex with the maximum execution time.
MaxExecutionTimeVertex *StatisticsVertex `json:"maxExecutionTimeVertex,omitempty"`
// MaxPeakMemUsageVertex - the vertex with the maximum peak memory usage.
MaxPeakMemUsageVertex *StatisticsVertex `json:"maxPeakMemUsageVertex,omitempty"`
// EstimatedVertexCPUCoreCount - READ-ONLY; The estimated vertex CPU core count.
EstimatedVertexCPUCoreCount *int32 `json:"estimatedVertexCpuCoreCount,omitempty"`
// EstimatedVertexPeakCPUCoreCount - READ-ONLY; The estimated vertex peak CPU core count.
EstimatedVertexPeakCPUCoreCount *int32 `json:"estimatedVertexPeakCpuCoreCount,omitempty"`
// EstimatedVertexMemSize - READ-ONLY; The estimated vertex memory size, in bytes.
EstimatedVertexMemSize *int64 `json:"estimatedVertexMemSize,omitempty"`
// AllocatedContainerCPUCoreCount - The statistics information for the allocated container CPU core count.
AllocatedContainerCPUCoreCount *ResourceUsageStatistics `json:"allocatedContainerCpuCoreCount,omitempty"`
// AllocatedContainerMemSize - The statistics information for the allocated container memory size.
AllocatedContainerMemSize *ResourceUsageStatistics `json:"allocatedContainerMemSize,omitempty"`
// UsedVertexCPUCoreCount - The statistics information for the used vertex CPU core count.
UsedVertexCPUCoreCount *ResourceUsageStatistics `json:"usedVertexCpuCoreCount,omitempty"`
// UsedVertexPeakMemSize - The statistics information for the used vertex peak memory size.
UsedVertexPeakMemSize *ResourceUsageStatistics `json:"usedVertexPeakMemSize,omitempty"`
}
// MarshalJSON is the custom marshaler for StatisticsVertexStage.
func (svs StatisticsVertexStage) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if svs.MaxDataReadVertex != nil {
objectMap["maxDataReadVertex"] = svs.MaxDataReadVertex
}
if svs.MaxExecutionTimeVertex != nil {
objectMap["maxExecutionTimeVertex"] = svs.MaxExecutionTimeVertex
}
if svs.MaxPeakMemUsageVertex != nil {
objectMap["maxPeakMemUsageVertex"] = svs.MaxPeakMemUsageVertex
}
if svs.AllocatedContainerCPUCoreCount != nil {
objectMap["allocatedContainerCpuCoreCount"] = svs.AllocatedContainerCPUCoreCount
}
if svs.AllocatedContainerMemSize != nil {
objectMap["allocatedContainerMemSize"] = svs.AllocatedContainerMemSize
}
if svs.UsedVertexCPUCoreCount != nil {
objectMap["usedVertexCpuCoreCount"] = svs.UsedVertexCPUCoreCount
}
if svs.UsedVertexPeakMemSize != nil {
objectMap["usedVertexPeakMemSize"] = svs.UsedVertexPeakMemSize
}
return json.Marshal(objectMap)
}
// UpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
type UpdateFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(Client) (Information, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *UpdateFuture) UnmarshalJSON(body []byte) error {
var azFuture azure.Future
if err := json.Unmarshal(body, &azFuture); err != nil {
return err
}
future.FutureAPI = &azFuture
future.Result = future.result
return nil
}
// result is the default implementation for UpdateFuture.Result.
func (future *UpdateFuture) result(client Client) (i Information, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "job.UpdateFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
i.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("job.UpdateFuture")
return
}
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
if i.Response.Response, err = future.GetResult(sender); err == nil && i.Response.Response.StatusCode != http.StatusNoContent {
i, err = client.UpdateResponder(i.Response.Response)
if err != nil {
err = autorest.NewErrorWithError(err, "job.UpdateFuture", "Result", i.Response.Response, "Failure responding to request")
}
}
return
}
// UpdateJobParameters the parameters that can be used to update existing Data Lake Analytics job
// information properties. (Only for use internally with Scope job type.)
type UpdateJobParameters struct {
// DegreeOfParallelism - The degree of parallelism used for this job.
DegreeOfParallelism *int32 `json:"degreeOfParallelism,omitempty"`
// DegreeOfParallelismPercent - the degree of parallelism in percentage used for this job.
DegreeOfParallelismPercent *float64 `json:"degreeOfParallelismPercent,omitempty"`
// Priority - The priority value for the current job. Lower numbers have a higher priority. By default, a job has a priority of 1000. This must be greater than 0.
Priority *int32 `json:"priority,omitempty"`
// Tags - The key-value pairs used to add additional metadata to the job information.
Tags map[string]*string `json:"tags"`
}
// MarshalJSON is the custom marshaler for UpdateJobParameters.
func (ujp UpdateJobParameters) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if ujp.DegreeOfParallelism != nil {
objectMap["degreeOfParallelism"] = ujp.DegreeOfParallelism
}
if ujp.DegreeOfParallelismPercent != nil {
objectMap["degreeOfParallelismPercent"] = ujp.DegreeOfParallelismPercent
}
if ujp.Priority != nil {
objectMap["priority"] = ujp.Priority
}
if ujp.Tags != nil {
objectMap["tags"] = ujp.Tags
}
return json.Marshal(objectMap)
}
// USQLJobProperties u-SQL job properties used when retrieving U-SQL jobs.
type USQLJobProperties struct {
// Resources - READ-ONLY; The list of resources that are required by the job.
Resources *[]Resource `json:"resources,omitempty"`
// Statistics - The job specific statistics.
Statistics *Statistics `json:"statistics,omitempty"`
// DebugData - The job specific debug data locations.
DebugData *DataPath `json:"debugData,omitempty"`
// Diagnostics - READ-ONLY; The diagnostics for the job.
Diagnostics *[]Diagnostics `json:"diagnostics,omitempty"`
// AlgebraFilePath - READ-ONLY; The algebra file path after the job has completed.
AlgebraFilePath *string `json:"algebraFilePath,omitempty"`
// TotalCompilationTime - READ-ONLY; The total time this job spent compiling. This value should not be set by the user and will be ignored if it is.
TotalCompilationTime *string `json:"totalCompilationTime,omitempty"`
// TotalQueuedTime - READ-ONLY; The total time this job spent queued. This value should not be set by the user and will be ignored if it is.
TotalQueuedTime *string `json:"totalQueuedTime,omitempty"`
// TotalRunningTime - READ-ONLY; The total time this job spent executing. This value should not be set by the user and will be ignored if it is.
TotalRunningTime *string `json:"totalRunningTime,omitempty"`
// TotalPausedTime - READ-ONLY; The total time this job spent paused. This value should not be set by the user and will be ignored if it is.
TotalPausedTime *string `json:"totalPausedTime,omitempty"`
// RootProcessNodeID - READ-ONLY; The ID used to identify the job manager coordinating job execution. This value should not be set by the user and will be ignored if it is.
RootProcessNodeID *string `json:"rootProcessNodeId,omitempty"`
// YarnApplicationID - READ-ONLY; The ID used to identify the yarn application executing the job. This value should not be set by the user and will be ignored if it is.
YarnApplicationID *string `json:"yarnApplicationId,omitempty"`
// YarnApplicationTimeStamp - READ-ONLY; The timestamp (in ticks) for the yarn application executing the job. This value should not be set by the user and will be ignored if it is.
YarnApplicationTimeStamp *int64 `json:"yarnApplicationTimeStamp,omitempty"`
// CompileMode - READ-ONLY; The specific compilation mode for the job used during execution. If this is not specified during submission, the server will determine the optimal compilation mode. Possible values include: 'Semantic', 'Full', 'SingleBox'
CompileMode CompileMode `json:"compileMode,omitempty"`
// RuntimeVersion - The runtime version of the Data Lake Analytics engine to use for the specific type of job being run.
RuntimeVersion *string `json:"runtimeVersion,omitempty"`
// Script - The script to run. Please note that the maximum script size is 3 MB.
Script *string `json:"script,omitempty"`
// Type - Possible values include: 'TypeJobProperties', 'TypeUSQL', 'TypeHive', 'TypeScope'
Type Type `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for USQLJobProperties.
func (usjp USQLJobProperties) MarshalJSON() ([]byte, error) {
usjp.Type = TypeUSQL
objectMap := make(map[string]interface{})
if usjp.Statistics != nil {
objectMap["statistics"] = usjp.Statistics
}
if usjp.DebugData != nil {
objectMap["debugData"] = usjp.DebugData
}
if usjp.RuntimeVersion != nil {
objectMap["runtimeVersion"] = usjp.RuntimeVersion
}
if usjp.Script != nil {
objectMap["script"] = usjp.Script
}
if usjp.Type != "" {
objectMap["type"] = usjp.Type
}
return json.Marshal(objectMap)
}
// AsUSQLJobProperties is the BasicProperties implementation for USQLJobProperties.
func (usjp USQLJobProperties) AsUSQLJobProperties() (*USQLJobProperties, bool) {
return &usjp, true
}
// AsHiveJobProperties is the BasicProperties implementation for USQLJobProperties.
func (usjp USQLJobProperties) AsHiveJobProperties() (*HiveJobProperties, bool) {
return nil, false
}
// AsScopeJobProperties is the BasicProperties implementation for USQLJobProperties.
func (usjp USQLJobProperties) AsScopeJobProperties() (*ScopeJobProperties, bool) {
return nil, false
}
// AsProperties is the BasicProperties implementation for USQLJobProperties.
func (usjp USQLJobProperties) AsProperties() (*Properties, bool) {
return nil, false
}
// AsBasicProperties is the BasicProperties implementation for USQLJobProperties.
func (usjp USQLJobProperties) AsBasicProperties() (BasicProperties, bool) {
return &usjp, true
}
// YieldFuture an abstraction for monitoring and retrieving the results of a long-running operation.
type YieldFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(Client) (autorest.Response, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *YieldFuture) UnmarshalJSON(body []byte) error {
var azFuture azure.Future
if err := json.Unmarshal(body, &azFuture); err != nil {
return err
}
future.FutureAPI = &azFuture
future.Result = future.result
return nil
}
// result is the default implementation for YieldFuture.Result.
func (future *YieldFuture) result(client Client) (ar autorest.Response, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "job.YieldFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
ar.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("job.YieldFuture")
return
}
ar.Response = future.Response()
return
}
|