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
// This file is @generated by prost-build.
/// A guest attributes.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GuestAttributes {
/// The path to be queried. This can be the default namespace ('/') or a
/// nested namespace ('/\<namespace\>/') or a specified key
/// ('/\<namespace\>/\<key\>')
#[prost(string, tag = "1")]
pub query_path: ::prost::alloc::string::String,
/// The value of the requested queried path.
#[prost(message, optional, tag = "2")]
pub query_value: ::core::option::Option<GuestAttributesValue>,
}
/// Array of guest attribute namespace/key/value tuples.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GuestAttributesValue {
/// The list of guest attributes entries.
#[prost(message, repeated, tag = "1")]
pub items: ::prost::alloc::vec::Vec<GuestAttributesEntry>,
}
/// A guest attributes namespace/key/value entry.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GuestAttributesEntry {
/// Namespace for the guest attribute entry.
#[prost(string, tag = "1")]
pub namespace: ::prost::alloc::string::String,
/// Key for the guest attribute entry.
#[prost(string, tag = "2")]
pub key: ::prost::alloc::string::String,
/// Value for the guest attribute entry.
#[prost(string, tag = "3")]
pub value: ::prost::alloc::string::String,
}
/// A node-attached disk resource.
/// Next ID: 8;
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AttachedDisk {
/// Specifies the full path to an existing disk.
/// For example: "projects/my-project/zones/us-central1-c/disks/my-disk".
#[prost(string, tag = "3")]
pub source_disk: ::prost::alloc::string::String,
/// The mode in which to attach this disk.
/// If not specified, the default is READ_WRITE mode.
/// Only applicable to data_disks.
#[prost(enumeration = "attached_disk::DiskMode", tag = "4")]
pub mode: i32,
}
/// Nested message and enum types in `AttachedDisk`.
pub mod attached_disk {
/// The different mode of the attached disk.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum DiskMode {
/// The disk mode is not known/set.
Unspecified = 0,
/// Attaches the disk in read-write mode. Only one TPU node can attach a disk
/// in read-write mode at a time.
ReadWrite = 1,
/// Attaches the disk in read-only mode. Multiple TPU nodes can attach
/// a disk in read-only mode at a time.
ReadOnly = 2,
}
impl DiskMode {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
DiskMode::Unspecified => "DISK_MODE_UNSPECIFIED",
DiskMode::ReadWrite => "READ_WRITE",
DiskMode::ReadOnly => "READ_ONLY",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"DISK_MODE_UNSPECIFIED" => Some(Self::Unspecified),
"READ_WRITE" => Some(Self::ReadWrite),
"READ_ONLY" => Some(Self::ReadOnly),
_ => None,
}
}
}
}
/// Sets the scheduling options for this node.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct SchedulingConfig {
/// Defines whether the node is preemptible.
#[prost(bool, tag = "1")]
pub preemptible: bool,
/// Whether the node is created under a reservation.
#[prost(bool, tag = "2")]
pub reserved: bool,
}
/// A network endpoint over which a TPU worker can be reached.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NetworkEndpoint {
/// The internal IP address of this network endpoint.
#[prost(string, tag = "1")]
pub ip_address: ::prost::alloc::string::String,
/// The port of this network endpoint.
#[prost(int32, tag = "2")]
pub port: i32,
/// The access config for the TPU worker.
#[prost(message, optional, tag = "5")]
pub access_config: ::core::option::Option<AccessConfig>,
}
/// An access config attached to the TPU worker.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AccessConfig {
/// Output only. An external IP address associated with the TPU worker.
#[prost(string, tag = "1")]
pub external_ip: ::prost::alloc::string::String,
}
/// Network related configurations.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NetworkConfig {
/// The name of the network for the TPU node. It must be a preexisting Google
/// Compute Engine network. If none is provided, "default" will be used.
#[prost(string, tag = "1")]
pub network: ::prost::alloc::string::String,
/// The name of the subnetwork for the TPU node. It must be a preexisting
/// Google Compute Engine subnetwork. If none is provided, "default" will be
/// used.
#[prost(string, tag = "2")]
pub subnetwork: ::prost::alloc::string::String,
/// Indicates that external IP addresses would be associated with the TPU
/// workers. If set to false, the specified subnetwork or network should have
/// Private Google Access enabled.
#[prost(bool, tag = "3")]
pub enable_external_ips: bool,
/// Allows the TPU node to send and receive packets with non-matching
/// destination or source IPs. This is required if you plan to use the TPU
/// workers to forward routes.
#[prost(bool, tag = "4")]
pub can_ip_forward: bool,
}
/// A service account.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ServiceAccount {
/// Email address of the service account. If empty, default Compute service
/// account will be used.
#[prost(string, tag = "1")]
pub email: ::prost::alloc::string::String,
/// The list of scopes to be made available for this service account. If empty,
/// access to all Cloud APIs will be allowed.
#[prost(string, repeated, tag = "2")]
pub scope: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// A TPU instance.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Node {
/// Output only. Immutable. The name of the TPU.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// The user-supplied description of the TPU. Maximum of 512 characters.
#[prost(string, tag = "3")]
pub description: ::prost::alloc::string::String,
/// The type of hardware accelerators associated with this node.
#[prost(string, tag = "5")]
pub accelerator_type: ::prost::alloc::string::String,
/// Output only. The current state for the TPU Node.
#[prost(enumeration = "node::State", tag = "9")]
pub state: i32,
/// Output only. If this field is populated, it contains a description of why
/// the TPU Node is unhealthy.
#[prost(string, tag = "10")]
pub health_description: ::prost::alloc::string::String,
/// Required. The runtime version running in the Node.
#[prost(string, tag = "11")]
pub runtime_version: ::prost::alloc::string::String,
/// Network configurations for the TPU node.
#[prost(message, optional, tag = "36")]
pub network_config: ::core::option::Option<NetworkConfig>,
/// The CIDR block that the TPU node will use when selecting an IP address.
/// This CIDR block must be a /29 block; the Compute Engine networks API
/// forbids a smaller block, and using a larger block would be wasteful (a
/// node can only consume one IP address). Errors will occur if the CIDR block
/// has already been used for a currently existing TPU node, the CIDR block
/// conflicts with any subnetworks in the user's provided network, or the
/// provided network is peered with another network that is using that CIDR
/// block.
#[prost(string, tag = "13")]
pub cidr_block: ::prost::alloc::string::String,
/// The Google Cloud Platform Service Account to be used by the TPU node VMs.
/// If None is specified, the default compute service account will be used.
#[prost(message, optional, tag = "37")]
pub service_account: ::core::option::Option<ServiceAccount>,
/// Output only. The time when the node was created.
#[prost(message, optional, tag = "16")]
pub create_time: ::core::option::Option<::prost_types::Timestamp>,
/// The scheduling options for this node.
#[prost(message, optional, tag = "17")]
pub scheduling_config: ::core::option::Option<SchedulingConfig>,
/// Output only. The network endpoints where TPU workers can be accessed and
/// sent work. It is recommended that runtime clients of the node reach out
/// to the 0th entry in this map first.
#[prost(message, repeated, tag = "21")]
pub network_endpoints: ::prost::alloc::vec::Vec<NetworkEndpoint>,
/// The health status of the TPU node.
#[prost(enumeration = "node::Health", tag = "22")]
pub health: i32,
/// Resource labels to represent user-provided metadata.
#[prost(btree_map = "string, string", tag = "24")]
pub labels: ::prost::alloc::collections::BTreeMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// Custom metadata to apply to the TPU Node.
/// Can set startup-script and shutdown-script
#[prost(btree_map = "string, string", tag = "34")]
pub metadata: ::prost::alloc::collections::BTreeMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
/// Tags to apply to the TPU Node. Tags are used to identify valid sources or
/// targets for network firewalls.
#[prost(string, repeated, tag = "40")]
pub tags: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Output only. The unique identifier for the TPU Node.
#[prost(int64, tag = "33")]
pub id: i64,
/// The additional data disks for the Node.
#[prost(message, repeated, tag = "41")]
pub data_disks: ::prost::alloc::vec::Vec<AttachedDisk>,
/// Output only. The API version that created this Node.
#[prost(enumeration = "node::ApiVersion", tag = "38")]
pub api_version: i32,
/// Output only. The Symptoms that have occurred to the TPU Node.
#[prost(message, repeated, tag = "39")]
pub symptoms: ::prost::alloc::vec::Vec<Symptom>,
/// Output only. The qualified name of the QueuedResource that requested this
/// Node.
#[prost(string, tag = "43")]
pub queued_resource: ::prost::alloc::string::String,
/// The AccleratorConfig for the TPU Node.
#[prost(message, optional, tag = "44")]
pub accelerator_config: ::core::option::Option<AcceleratorConfig>,
/// Shielded Instance options.
#[prost(message, optional, tag = "45")]
pub shielded_instance_config: ::core::option::Option<ShieldedInstanceConfig>,
/// Output only. Whether the Node belongs to a Multislice group.
#[prost(bool, tag = "47")]
pub multislice_node: bool,
/// Optional. Boot disk configuration.
#[prost(message, optional, tag = "49")]
pub boot_disk_config: ::core::option::Option<BootDiskConfig>,
}
/// Nested message and enum types in `Node`.
pub mod node {
/// Represents the different states of a TPU node during its lifecycle.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum State {
/// TPU node state is not known/set.
Unspecified = 0,
/// TPU node is being created.
Creating = 1,
/// TPU node has been created.
Ready = 2,
/// TPU node is restarting.
Restarting = 3,
/// TPU node is undergoing reimaging.
Reimaging = 4,
/// TPU node is being deleted.
Deleting = 5,
/// TPU node is being repaired and may be unusable. Details can be
/// found in the 'help_description' field.
Repairing = 6,
/// TPU node is stopped.
Stopped = 8,
/// TPU node is currently stopping.
Stopping = 9,
/// TPU node is currently starting.
Starting = 10,
/// TPU node has been preempted. Only applies to Preemptible TPU Nodes.
Preempted = 11,
/// TPU node has been terminated due to maintenance or has reached the end of
/// its life cycle (for preemptible nodes).
Terminated = 12,
/// TPU node is currently hiding.
Hiding = 13,
/// TPU node has been hidden.
Hidden = 14,
/// TPU node is currently unhiding.
Unhiding = 15,
}
impl State {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
State::Unspecified => "STATE_UNSPECIFIED",
State::Creating => "CREATING",
State::Ready => "READY",
State::Restarting => "RESTARTING",
State::Reimaging => "REIMAGING",
State::Deleting => "DELETING",
State::Repairing => "REPAIRING",
State::Stopped => "STOPPED",
State::Stopping => "STOPPING",
State::Starting => "STARTING",
State::Preempted => "PREEMPTED",
State::Terminated => "TERMINATED",
State::Hiding => "HIDING",
State::Hidden => "HIDDEN",
State::Unhiding => "UNHIDING",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"STATE_UNSPECIFIED" => Some(Self::Unspecified),
"CREATING" => Some(Self::Creating),
"READY" => Some(Self::Ready),
"RESTARTING" => Some(Self::Restarting),
"REIMAGING" => Some(Self::Reimaging),
"DELETING" => Some(Self::Deleting),
"REPAIRING" => Some(Self::Repairing),
"STOPPED" => Some(Self::Stopped),
"STOPPING" => Some(Self::Stopping),
"STARTING" => Some(Self::Starting),
"PREEMPTED" => Some(Self::Preempted),
"TERMINATED" => Some(Self::Terminated),
"HIDING" => Some(Self::Hiding),
"HIDDEN" => Some(Self::Hidden),
"UNHIDING" => Some(Self::Unhiding),
_ => None,
}
}
}
/// Health defines the status of a TPU node as reported by
/// Health Monitor.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Health {
/// Health status is unknown: not initialized or failed to retrieve.
Unspecified = 0,
/// The resource is healthy.
Healthy = 1,
/// The resource is unresponsive.
Timeout = 3,
/// The in-guest ML stack is unhealthy.
UnhealthyTensorflow = 4,
/// The node is under maintenance/priority boost caused rescheduling and
/// will resume running once rescheduled.
UnhealthyMaintenance = 5,
}
impl Health {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Health::Unspecified => "HEALTH_UNSPECIFIED",
Health::Healthy => "HEALTHY",
Health::Timeout => "TIMEOUT",
Health::UnhealthyTensorflow => "UNHEALTHY_TENSORFLOW",
Health::UnhealthyMaintenance => "UNHEALTHY_MAINTENANCE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"HEALTH_UNSPECIFIED" => Some(Self::Unspecified),
"HEALTHY" => Some(Self::Healthy),
"TIMEOUT" => Some(Self::Timeout),
"UNHEALTHY_TENSORFLOW" => Some(Self::UnhealthyTensorflow),
"UNHEALTHY_MAINTENANCE" => Some(Self::UnhealthyMaintenance),
_ => None,
}
}
}
/// TPU API Version.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum ApiVersion {
/// API version is unknown.
Unspecified = 0,
/// TPU API V1Alpha1 version.
V1Alpha1 = 1,
/// TPU API V1 version.
V1 = 2,
/// TPU API V2Alpha1 version.
V2Alpha1 = 3,
}
impl ApiVersion {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
ApiVersion::Unspecified => "API_VERSION_UNSPECIFIED",
ApiVersion::V1Alpha1 => "V1_ALPHA1",
ApiVersion::V1 => "V1",
ApiVersion::V2Alpha1 => "V2_ALPHA1",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"API_VERSION_UNSPECIFIED" => Some(Self::Unspecified),
"V1_ALPHA1" => Some(Self::V1Alpha1),
"V1" => Some(Self::V1),
"V2_ALPHA1" => Some(Self::V2Alpha1),
_ => None,
}
}
}
}
/// A QueuedResource represents a request for resources that will be placed
/// in a queue and fulfilled when the necessary resources are available.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueuedResource {
/// Output only. Immutable. The name of the QueuedResource.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// The queueing policy of the QueuedRequest.
#[prost(message, optional, tag = "5")]
pub queueing_policy: ::core::option::Option<queued_resource::QueueingPolicy>,
/// Output only. State of the QueuedResource request.
#[prost(message, optional, tag = "6")]
pub state: ::core::option::Option<QueuedResourceState>,
/// Name of the reservation in which the resource should be provisioned.
/// Format: projects/{project}/locations/{zone}/reservations/{reservation}
#[prost(string, tag = "8")]
pub reservation_name: ::prost::alloc::string::String,
/// Resource specification.
#[prost(oneof = "queued_resource::Resource", tags = "2")]
pub resource: ::core::option::Option<queued_resource::Resource>,
/// Tier specifies the required tier.
#[prost(oneof = "queued_resource::Tier", tags = "3, 4, 9")]
pub tier: ::core::option::Option<queued_resource::Tier>,
}
/// Nested message and enum types in `QueuedResource`.
pub mod queued_resource {
/// Details of the TPU resource(s) being requested.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Tpu {
/// The TPU node(s) being requested.
#[prost(message, repeated, tag = "1")]
pub node_spec: ::prost::alloc::vec::Vec<tpu::NodeSpec>,
}
/// Nested message and enum types in `Tpu`.
pub mod tpu {
/// Details of the TPU node(s) being requested. Users can request either a
/// single node or multiple nodes.
/// NodeSpec provides the specification for node(s) to be created.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NodeSpec {
/// Required. The parent resource name.
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// The unqualified resource name. Should follow the `^\[A-Za-z0-9_.~+%-\]+$`
/// regex format. This is only specified when requesting a single node.
/// In case of multi-node requests, multi_node_params must be populated
/// instead. It's an error to specify both node_id and multi_node_params.
#[prost(string, tag = "2")]
pub node_id: ::prost::alloc::string::String,
/// Optional. Fields to specify in case of multi-node request.
#[prost(message, optional, tag = "6")]
pub multi_node_params: ::core::option::Option<node_spec::MultiNodeParams>,
/// Required. The node.
#[prost(message, optional, tag = "3")]
pub node: ::core::option::Option<super::super::Node>,
}
/// Nested message and enum types in `NodeSpec`.
pub mod node_spec {
/// Parameters to specify for multi-node QueuedResource requests. This
/// field must be populated in case of multi-node requests instead of
/// node_id. It's an error to specify both node_id and multi_node_params.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MultiNodeParams {
/// Required. Number of nodes with this spec. The system will attempt
/// to provison "node_count" nodes as part of the request.
/// This needs to be > 1.
#[prost(int32, tag = "1")]
pub node_count: i32,
/// Prefix of node_ids in case of multi-node request
/// Should follow the `^\[A-Za-z0-9_.~+%-\]+$` regex format.
/// If node_count = 3 and node_id_prefix = "np", node ids of nodes
/// created will be "np-0", "np-1", "np-2". If this field is not
/// provided we use queued_resource_id as the node_id_prefix.
#[prost(string, tag = "2")]
pub node_id_prefix: ::prost::alloc::string::String,
}
}
}
/// BestEffort tier definition.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct BestEffort {}
/// Spot tier definition.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Spot {}
/// Guaranteed tier definition.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Guaranteed {
/// Optional. Defines the minimum duration of the guarantee. If specified,
/// the requested resources will only be provisioned if they can be
/// allocated for at least the given duration.
#[prost(message, optional, tag = "1")]
pub min_duration: ::core::option::Option<::prost_types::Duration>,
/// Optional. Specifies the request should be scheduled on reserved capacity.
#[prost(bool, tag = "2")]
pub reserved: bool,
}
/// Defines the policy of the QueuedRequest.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct QueueingPolicy {
/// Time flexibility specification.
#[prost(
oneof = "queueing_policy::StartTimingConstraints",
tags = "1, 2, 3, 4, 5"
)]
pub start_timing_constraints: ::core::option::Option<
queueing_policy::StartTimingConstraints,
>,
}
/// Nested message and enum types in `QueueingPolicy`.
pub mod queueing_policy {
/// Time flexibility specification.
#[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
pub enum StartTimingConstraints {
/// A relative time after which resources should not be created.
/// If the request cannot be fulfilled by this time the request will be
/// failed.
#[prost(message, tag = "1")]
ValidUntilDuration(::prost_types::Duration),
/// An absolute time after which resources should not be created.
/// If the request cannot be fulfilled by this time the request will be
/// failed.
#[prost(message, tag = "2")]
ValidUntilTime(::prost_types::Timestamp),
/// A relative time after which resources may be created.
#[prost(message, tag = "3")]
ValidAfterDuration(::prost_types::Duration),
/// An absolute time at which resources may be created.
#[prost(message, tag = "4")]
ValidAfterTime(::prost_types::Timestamp),
/// An absolute time interval within which resources may be created.
#[prost(message, tag = "5")]
ValidInterval(super::super::super::super::super::r#type::Interval),
}
}
/// Resource specification.
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Resource {
/// Defines a TPU resource.
#[prost(message, tag = "2")]
Tpu(Tpu),
}
/// Tier specifies the required tier.
#[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
pub enum Tier {
/// The BestEffort tier.
#[prost(message, tag = "3")]
BestEffort(BestEffort),
/// The Guaranteed tier.
#[prost(message, tag = "4")]
Guaranteed(Guaranteed),
/// Optional. The Spot tier.
#[prost(message, tag = "9")]
Spot(Spot),
}
}
/// QueuedResourceState defines the details of the QueuedResource request.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueuedResourceState {
/// State of the QueuedResource request.
#[prost(enumeration = "queued_resource_state::State", tag = "1")]
pub state: i32,
/// Output only. The initiator of the QueuedResources's current state.
#[prost(enumeration = "queued_resource_state::StateInitiator", tag = "10")]
pub state_initiator: i32,
/// Further data for the state.
#[prost(oneof = "queued_resource_state::StateData", tags = "2, 3, 4, 5, 6, 7, 8, 9")]
pub state_data: ::core::option::Option<queued_resource_state::StateData>,
}
/// Nested message and enum types in `QueuedResourceState`.
pub mod queued_resource_state {
/// Further data for the creating state.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct CreatingData {}
/// Further data for the accepted state.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct AcceptedData {}
/// Further data for the provisioning state.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ProvisioningData {}
/// Further data for the failed state.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FailedData {
/// The error that caused the queued resource to enter the FAILED state.
#[prost(message, optional, tag = "1")]
pub error: ::core::option::Option<super::super::super::super::rpc::Status>,
}
/// Further data for the deleting state.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct DeletingData {}
/// Further data for the active state.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ActiveData {}
/// Further data for the suspending state.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct SuspendingData {}
/// Further data for the suspended state.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct SuspendedData {}
/// Output only state of the request
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum State {
/// State of the QueuedResource request is not known/set.
Unspecified = 0,
/// The QueuedResource request has been received. We're still working on
/// determining if we will be able to honor this request.
Creating = 1,
/// The QueuedResource request has passed initial validation/admission
/// control and has been persisted in the queue.
Accepted = 2,
/// The QueuedResource request has been selected. The
/// associated resources are currently being provisioned (or very soon
/// will begin provisioning).
Provisioning = 3,
/// The request could not be completed. This may be due to some
/// late-discovered problem with the request itself, or due to
/// unavailability of resources within the constraints of the request
/// (e.g., the 'valid until' start timing constraint expired).
Failed = 4,
/// The QueuedResource is being deleted.
Deleting = 5,
/// The resources specified in the QueuedResource request have been
/// provisioned and are ready for use by the end-user/consumer.
Active = 6,
/// The resources specified in the QueuedResource request are being
/// deleted. This may have been initiated by the user, or
/// the Cloud TPU service. Inspect the state data for more details.
Suspending = 7,
/// The resources specified in the QueuedResource request have been
/// deleted.
Suspended = 8,
/// The QueuedResource request has passed initial validation and has been
/// persisted in the queue. It will remain in this state until there are
/// sufficient free resources to begin provisioning your request. Wait times
/// will vary significantly depending on demand levels. When demand is high,
/// not all requests can be immediately provisioned. If you
/// need more reliable obtainability of TPUs consider purchasing a
/// reservation. To put a limit on how long you are willing to wait, use
/// [timing
/// constraints](<https://cloud.google.com/tpu/docs/queued-resources#request_a_queued_resource_before_a_specified_time>).
WaitingForResources = 9,
}
impl State {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
State::Unspecified => "STATE_UNSPECIFIED",
State::Creating => "CREATING",
State::Accepted => "ACCEPTED",
State::Provisioning => "PROVISIONING",
State::Failed => "FAILED",
State::Deleting => "DELETING",
State::Active => "ACTIVE",
State::Suspending => "SUSPENDING",
State::Suspended => "SUSPENDED",
State::WaitingForResources => "WAITING_FOR_RESOURCES",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"STATE_UNSPECIFIED" => Some(Self::Unspecified),
"CREATING" => Some(Self::Creating),
"ACCEPTED" => Some(Self::Accepted),
"PROVISIONING" => Some(Self::Provisioning),
"FAILED" => Some(Self::Failed),
"DELETING" => Some(Self::Deleting),
"ACTIVE" => Some(Self::Active),
"SUSPENDING" => Some(Self::Suspending),
"SUSPENDED" => Some(Self::Suspended),
"WAITING_FOR_RESOURCES" => Some(Self::WaitingForResources),
_ => None,
}
}
}
/// The initiator of the QueuedResource's SUSPENDING/SUSPENDED state.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum StateInitiator {
/// The state initiator is unspecified.
Unspecified = 0,
/// The current QueuedResource state was initiated by the user.
User = 1,
/// The current QueuedResource state was initiated by the service.
Service = 2,
}
impl StateInitiator {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
StateInitiator::Unspecified => "STATE_INITIATOR_UNSPECIFIED",
StateInitiator::User => "USER",
StateInitiator::Service => "SERVICE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"STATE_INITIATOR_UNSPECIFIED" => Some(Self::Unspecified),
"USER" => Some(Self::User),
"SERVICE" => Some(Self::Service),
_ => None,
}
}
}
/// Further data for the state.
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum StateData {
/// Further data for the creating state.
#[prost(message, tag = "2")]
CreatingData(CreatingData),
/// Further data for the accepted state.
#[prost(message, tag = "3")]
AcceptedData(AcceptedData),
/// Further data for the provisioning state.
#[prost(message, tag = "4")]
ProvisioningData(ProvisioningData),
/// Further data for the failed state.
#[prost(message, tag = "5")]
FailedData(FailedData),
/// Further data for the deleting state.
#[prost(message, tag = "6")]
DeletingData(DeletingData),
/// Further data for the active state.
#[prost(message, tag = "7")]
ActiveData(ActiveData),
/// Further data for the suspending state.
#[prost(message, tag = "8")]
SuspendingData(SuspendingData),
/// Further data for the suspended state.
#[prost(message, tag = "9")]
SuspendedData(SuspendedData),
}
}
/// Request for [ListNodes][google.cloud.tpu.v2alpha1.Tpu.ListNodes].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListNodesRequest {
/// Required. The parent resource name.
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// The maximum number of items to return.
#[prost(int32, tag = "2")]
pub page_size: i32,
/// The next_page_token value returned from a previous List request, if any.
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
}
/// Response for [ListNodes][google.cloud.tpu.v2alpha1.Tpu.ListNodes].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListNodesResponse {
/// The listed nodes.
#[prost(message, repeated, tag = "1")]
pub nodes: ::prost::alloc::vec::Vec<Node>,
/// The next page token or empty if none.
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
/// Locations that could not be reached.
#[prost(string, repeated, tag = "3")]
pub unreachable: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Request for [GetNode][google.cloud.tpu.v2alpha1.Tpu.GetNode].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetNodeRequest {
/// Required. The resource name.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// Request for [CreateNode][google.cloud.tpu.v2alpha1.Tpu.CreateNode].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateNodeRequest {
/// Required. The parent resource name.
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// The unqualified resource name.
#[prost(string, tag = "2")]
pub node_id: ::prost::alloc::string::String,
/// Required. The node.
#[prost(message, optional, tag = "3")]
pub node: ::core::option::Option<Node>,
/// Idempotent request UUID.
#[prost(string, tag = "6")]
pub request_id: ::prost::alloc::string::String,
}
/// Request for [DeleteNode][google.cloud.tpu.v2alpha1.Tpu.DeleteNode].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteNodeRequest {
/// Required. The resource name.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Idempotent request UUID.
#[prost(string, tag = "3")]
pub request_id: ::prost::alloc::string::String,
}
/// Request for [StopNode][google.cloud.tpu.v2alpha1.Tpu.StopNode].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StopNodeRequest {
/// Required. The resource name.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// Request for [StartNode][google.cloud.tpu.v2alpha1.Tpu.StartNode].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StartNodeRequest {
/// Required. The resource name.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// Request for [UpdateNode][google.cloud.tpu.v2alpha1.Tpu.UpdateNode].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateNodeRequest {
/// Required. Mask of fields from [Node][Tpu.Node] to update.
/// Supported fields: [description, tags, labels, metadata,
/// network_config.enable_external_ips].
#[prost(message, optional, tag = "1")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
/// Required. The node. Only fields specified in update_mask are updated.
#[prost(message, optional, tag = "2")]
pub node: ::core::option::Option<Node>,
}
/// Request for
/// [ListQueuedResources][google.cloud.tpu.v2alpha1.Tpu.ListQueuedResources].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListQueuedResourcesRequest {
/// Required. The parent resource name.
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// The maximum number of items to return.
#[prost(int32, tag = "2")]
pub page_size: i32,
/// The next_page_token value returned from a previous List request, if any.
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
}
/// Response for
/// [ListQueuedResources][google.cloud.tpu.v2alpha1.Tpu.ListQueuedResources].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListQueuedResourcesResponse {
/// The listed queued resources.
#[prost(message, repeated, tag = "1")]
pub queued_resources: ::prost::alloc::vec::Vec<QueuedResource>,
/// The next page token or empty if none.
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
/// Locations that could not be reached.
#[prost(string, repeated, tag = "3")]
pub unreachable: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Request for
/// [GetQueuedResource][google.cloud.tpu.v2alpha1.Tpu.GetQueuedResource]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetQueuedResourceRequest {
/// Required. The resource name.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// Request for
/// [CreateQueuedResource][google.cloud.tpu.v2alpha1.Tpu.CreateQueuedResource].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateQueuedResourceRequest {
/// Required. The parent resource name.
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// The unqualified resource name. Should follow the `^\[A-Za-z0-9_.~+%-\]+$`
/// regex format.
#[prost(string, tag = "2")]
pub queued_resource_id: ::prost::alloc::string::String,
/// Required. The queued resource.
#[prost(message, optional, tag = "3")]
pub queued_resource: ::core::option::Option<QueuedResource>,
/// Idempotent request UUID.
#[prost(string, tag = "4")]
pub request_id: ::prost::alloc::string::String,
}
/// Request for
/// [DeleteQueuedResource][google.cloud.tpu.v2alpha1.Tpu.DeleteQueuedResource].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteQueuedResourceRequest {
/// Required. The resource name.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Idempotent request UUID.
#[prost(string, tag = "2")]
pub request_id: ::prost::alloc::string::String,
/// If set to true, all running nodes belonging to this queued resource will
/// be deleted first and then the queued resource will be deleted.
/// Otherwise (i.e. force=false), the queued resource will only be deleted if
/// its nodes have already been deleted or the queued resource is in the
/// ACCEPTED, FAILED, or SUSPENDED state.
#[prost(bool, tag = "3")]
pub force: bool,
}
/// Request for
/// [ResetQueuedResource][google.cloud.tpu.v2alpha1.Tpu.ResetQueuedResource].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResetQueuedResourceRequest {
/// Required. The name of the queued resource.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// The per-product per-project service identity for Cloud TPU service.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ServiceIdentity {
/// The email address of the service identity.
#[prost(string, tag = "1")]
pub email: ::prost::alloc::string::String,
}
/// Request for
/// [GenerateServiceIdentity][google.cloud.tpu.v2alpha1.Tpu.GenerateServiceIdentity].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GenerateServiceIdentityRequest {
/// Required. The parent resource name.
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
}
/// Response for
/// [GenerateServiceIdentity][google.cloud.tpu.v2alpha1.Tpu.GenerateServiceIdentity].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GenerateServiceIdentityResponse {
/// ServiceIdentity that was created or retrieved.
#[prost(message, optional, tag = "1")]
pub identity: ::core::option::Option<ServiceIdentity>,
}
/// A accelerator type that a Node can be configured with.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AcceleratorType {
/// The resource name.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// The accelerator type.
#[prost(string, tag = "2")]
pub r#type: ::prost::alloc::string::String,
/// The accelerator config.
#[prost(message, repeated, tag = "3")]
pub accelerator_configs: ::prost::alloc::vec::Vec<AcceleratorConfig>,
}
/// Request for
/// [GetAcceleratorType][google.cloud.tpu.v2alpha1.Tpu.GetAcceleratorType].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetAcceleratorTypeRequest {
/// Required. The resource name.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// Request for
/// [ListAcceleratorTypes][google.cloud.tpu.v2alpha1.Tpu.ListAcceleratorTypes].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListAcceleratorTypesRequest {
/// Required. The parent resource name.
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// The maximum number of items to return.
#[prost(int32, tag = "2")]
pub page_size: i32,
/// The next_page_token value returned from a previous List request, if any.
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
/// List filter.
#[prost(string, tag = "5")]
pub filter: ::prost::alloc::string::String,
/// Sort results.
#[prost(string, tag = "6")]
pub order_by: ::prost::alloc::string::String,
}
/// Response for
/// [ListAcceleratorTypes][google.cloud.tpu.v2alpha1.Tpu.ListAcceleratorTypes].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListAcceleratorTypesResponse {
/// The listed nodes.
#[prost(message, repeated, tag = "1")]
pub accelerator_types: ::prost::alloc::vec::Vec<AcceleratorType>,
/// The next page token or empty if none.
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
/// Locations that could not be reached.
#[prost(string, repeated, tag = "3")]
pub unreachable: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// A runtime version that a Node can be configured with.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RuntimeVersion {
/// The resource name.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// The runtime version.
#[prost(string, tag = "2")]
pub version: ::prost::alloc::string::String,
}
/// Request for
/// [GetRuntimeVersion][google.cloud.tpu.v2alpha1.Tpu.GetRuntimeVersion].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetRuntimeVersionRequest {
/// Required. The resource name.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
/// Request for
/// [ListRuntimeVersions][google.cloud.tpu.v2alpha1.Tpu.ListRuntimeVersions].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListRuntimeVersionsRequest {
/// Required. The parent resource name.
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
/// The maximum number of items to return.
#[prost(int32, tag = "2")]
pub page_size: i32,
/// The next_page_token value returned from a previous List request, if any.
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
/// List filter.
#[prost(string, tag = "5")]
pub filter: ::prost::alloc::string::String,
/// Sort results.
#[prost(string, tag = "6")]
pub order_by: ::prost::alloc::string::String,
}
/// Response for
/// [ListRuntimeVersions][google.cloud.tpu.v2alpha1.Tpu.ListRuntimeVersions].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListRuntimeVersionsResponse {
/// The listed nodes.
#[prost(message, repeated, tag = "1")]
pub runtime_versions: ::prost::alloc::vec::Vec<RuntimeVersion>,
/// The next page token or empty if none.
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
/// Locations that could not be reached.
#[prost(string, repeated, tag = "3")]
pub unreachable: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Metadata describing an [Operation][google.longrunning.Operation]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OperationMetadata {
/// The time the operation was created.
#[prost(message, optional, tag = "1")]
pub create_time: ::core::option::Option<::prost_types::Timestamp>,
/// The time the operation finished running.
#[prost(message, optional, tag = "2")]
pub end_time: ::core::option::Option<::prost_types::Timestamp>,
/// Target of the operation - for example
/// projects/project-1/connectivityTests/test-1
#[prost(string, tag = "3")]
pub target: ::prost::alloc::string::String,
/// Name of the verb executed by the operation.
#[prost(string, tag = "4")]
pub verb: ::prost::alloc::string::String,
/// Human-readable status of the operation, if any.
#[prost(string, tag = "5")]
pub status_detail: ::prost::alloc::string::String,
/// Specifies if cancellation was requested for the operation.
#[prost(bool, tag = "6")]
pub cancel_requested: bool,
/// API version.
#[prost(string, tag = "7")]
pub api_version: ::prost::alloc::string::String,
}
/// A Symptom instance.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Symptom {
/// Timestamp when the Symptom is created.
#[prost(message, optional, tag = "1")]
pub create_time: ::core::option::Option<::prost_types::Timestamp>,
/// Type of the Symptom.
#[prost(enumeration = "symptom::SymptomType", tag = "2")]
pub symptom_type: i32,
/// Detailed information of the current Symptom.
#[prost(string, tag = "3")]
pub details: ::prost::alloc::string::String,
/// A string used to uniquely distinguish a worker within a TPU node.
#[prost(string, tag = "4")]
pub worker_id: ::prost::alloc::string::String,
}
/// Nested message and enum types in `Symptom`.
pub mod symptom {
/// SymptomType represents the different types of Symptoms that a TPU can be
/// at.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum SymptomType {
/// Unspecified symptom.
Unspecified = 0,
/// TPU VM memory is low.
LowMemory = 1,
/// TPU runtime is out of memory.
OutOfMemory = 2,
/// TPU runtime execution has timed out.
ExecuteTimedOut = 3,
/// TPU runtime fails to construct a mesh that recognizes each TPU device's
/// neighbors.
MeshBuildFail = 4,
/// TPU HBM is out of memory.
HbmOutOfMemory = 5,
/// Abusive behaviors have been identified on the current project.
ProjectAbuse = 6,
}
impl SymptomType {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
SymptomType::Unspecified => "SYMPTOM_TYPE_UNSPECIFIED",
SymptomType::LowMemory => "LOW_MEMORY",
SymptomType::OutOfMemory => "OUT_OF_MEMORY",
SymptomType::ExecuteTimedOut => "EXECUTE_TIMED_OUT",
SymptomType::MeshBuildFail => "MESH_BUILD_FAIL",
SymptomType::HbmOutOfMemory => "HBM_OUT_OF_MEMORY",
SymptomType::ProjectAbuse => "PROJECT_ABUSE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SYMPTOM_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"LOW_MEMORY" => Some(Self::LowMemory),
"OUT_OF_MEMORY" => Some(Self::OutOfMemory),
"EXECUTE_TIMED_OUT" => Some(Self::ExecuteTimedOut),
"MESH_BUILD_FAIL" => Some(Self::MeshBuildFail),
"HBM_OUT_OF_MEMORY" => Some(Self::HbmOutOfMemory),
"PROJECT_ABUSE" => Some(Self::ProjectAbuse),
_ => None,
}
}
}
}
/// Request for
/// [GetGuestAttributes][google.cloud.tpu.v2alpha1.Tpu.GetGuestAttributes].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetGuestAttributesRequest {
/// Required. The resource name.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// The guest attributes path to be queried.
#[prost(string, tag = "2")]
pub query_path: ::prost::alloc::string::String,
/// The 0-based worker ID. If it is empty, all workers' GuestAttributes will be
/// returned.
#[prost(string, repeated, tag = "3")]
pub worker_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Response for
/// [GetGuestAttributes][google.cloud.tpu.v2alpha1.Tpu.GetGuestAttributes].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetGuestAttributesResponse {
/// The guest attributes for the TPU workers.
#[prost(message, repeated, tag = "1")]
pub guest_attributes: ::prost::alloc::vec::Vec<GuestAttributes>,
}
/// Request for
/// [SimulateMaintenanceEvent][google.cloud.tpu.v2alpha1.Tpu.SimulateMaintenanceEvent].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SimulateMaintenanceEventRequest {
/// Required. The resource name.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// The 0-based worker ID. If it is empty, worker ID 0 will be selected for
/// maintenance event simulation. A maintenance event will only be fired on the
/// first specified worker ID. Future implementations may support firing on
/// multiple workers.
#[prost(string, repeated, tag = "2")]
pub worker_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// A TPU accelerator configuration.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AcceleratorConfig {
/// Required. Type of TPU.
#[prost(enumeration = "accelerator_config::Type", tag = "1")]
pub r#type: i32,
/// Required. Topology of TPU in chips.
#[prost(string, tag = "2")]
pub topology: ::prost::alloc::string::String,
}
/// Nested message and enum types in `AcceleratorConfig`.
pub mod accelerator_config {
/// TPU type.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Type {
/// Unspecified version.
Unspecified = 0,
/// TPU v2.
V2 = 2,
/// TPU v3.
V3 = 4,
/// TPU v4.
V4 = 7,
}
impl Type {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Type::Unspecified => "TYPE_UNSPECIFIED",
Type::V2 => "V2",
Type::V3 => "V3",
Type::V4 => "V4",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"V2" => Some(Self::V2),
"V3" => Some(Self::V3),
"V4" => Some(Self::V4),
_ => None,
}
}
}
}
/// A set of Shielded Instance options.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ShieldedInstanceConfig {
/// Defines whether the instance has Secure Boot enabled.
#[prost(bool, tag = "1")]
pub enable_secure_boot: bool,
}
/// Boot disk configurations.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BootDiskConfig {
/// Optional. Customer encryption key for boot disk.
#[prost(message, optional, tag = "1")]
pub customer_encryption_key: ::core::option::Option<CustomerEncryptionKey>,
/// Optional. Whether the boot disk will be created with confidential compute
/// mode.
#[prost(bool, tag = "2")]
pub enable_confidential_compute: bool,
}
/// Customer's encryption key.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CustomerEncryptionKey {
#[prost(oneof = "customer_encryption_key::Key", tags = "7")]
pub key: ::core::option::Option<customer_encryption_key::Key>,
}
/// Nested message and enum types in `CustomerEncryptionKey`.
pub mod customer_encryption_key {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Key {
/// The name of the encryption key that is stored in Google Cloud KMS.
/// For example:
/// <pre class="lang-html">"kmsKeyName": "projects/
/// <var class="apiparam">kms_project_id</var>/locations/
/// <var class="apiparam">region</var>/keyRings/<var class="apiparam">
/// key_region</var>/cryptoKeys/<var class="apiparam">key</var>
/// </pre>
/// The fully-qualifed key name may be returned for resource GET requests.
/// For example:
/// <pre class="lang-html">"kmsKeyName": "projects/
/// <var class="apiparam">kms_project_id</var>/locations/
/// <var class="apiparam">region</var>/keyRings/<var class="apiparam">
/// key_region</var>/cryptoKeys/<var class="apiparam">key</var>
/// /cryptoKeyVersions/1</pre>
#[prost(string, tag = "7")]
KmsKeyName(::prost::alloc::string::String),
}
}
/// Generated client implementations.
pub mod tpu_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
/// Manages TPU nodes and other resources
///
/// TPU API v2alpha1
#[derive(Debug, Clone)]
pub struct TpuClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> TpuClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> TpuClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
TpuClient::new(InterceptedService::new(inner, interceptor))
}
/// Compress requests with the given encoding.
///
/// This requires the server to support it otherwise it might respond with an
/// error.
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
/// Enable decompressing responses.
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
/// Limits the maximum size of a decoded message.
///
/// Default: `4MB`
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
/// Limits the maximum size of an encoded message.
///
/// Default: `usize::MAX`
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
/// Lists nodes.
pub async fn list_nodes(
&mut self,
request: impl tonic::IntoRequest<super::ListNodesRequest>,
) -> std::result::Result<
tonic::Response<super::ListNodesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.tpu.v2alpha1.Tpu/ListNodes",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("google.cloud.tpu.v2alpha1.Tpu", "ListNodes"));
self.inner.unary(req, path, codec).await
}
/// Gets the details of a node.
pub async fn get_node(
&mut self,
request: impl tonic::IntoRequest<super::GetNodeRequest>,
) -> std::result::Result<tonic::Response<super::Node>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.tpu.v2alpha1.Tpu/GetNode",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("google.cloud.tpu.v2alpha1.Tpu", "GetNode"));
self.inner.unary(req, path, codec).await
}
/// Creates a node.
pub async fn create_node(
&mut self,
request: impl tonic::IntoRequest<super::CreateNodeRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.tpu.v2alpha1.Tpu/CreateNode",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("google.cloud.tpu.v2alpha1.Tpu", "CreateNode"));
self.inner.unary(req, path, codec).await
}
/// Deletes a node.
pub async fn delete_node(
&mut self,
request: impl tonic::IntoRequest<super::DeleteNodeRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.tpu.v2alpha1.Tpu/DeleteNode",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("google.cloud.tpu.v2alpha1.Tpu", "DeleteNode"));
self.inner.unary(req, path, codec).await
}
/// Stops a node. This operation is only available with single TPU nodes.
pub async fn stop_node(
&mut self,
request: impl tonic::IntoRequest<super::StopNodeRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.tpu.v2alpha1.Tpu/StopNode",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("google.cloud.tpu.v2alpha1.Tpu", "StopNode"));
self.inner.unary(req, path, codec).await
}
/// Starts a node.
pub async fn start_node(
&mut self,
request: impl tonic::IntoRequest<super::StartNodeRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.tpu.v2alpha1.Tpu/StartNode",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("google.cloud.tpu.v2alpha1.Tpu", "StartNode"));
self.inner.unary(req, path, codec).await
}
/// Updates the configurations of a node.
pub async fn update_node(
&mut self,
request: impl tonic::IntoRequest<super::UpdateNodeRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.tpu.v2alpha1.Tpu/UpdateNode",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("google.cloud.tpu.v2alpha1.Tpu", "UpdateNode"));
self.inner.unary(req, path, codec).await
}
/// Lists queued resources.
pub async fn list_queued_resources(
&mut self,
request: impl tonic::IntoRequest<super::ListQueuedResourcesRequest>,
) -> std::result::Result<
tonic::Response<super::ListQueuedResourcesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.tpu.v2alpha1.Tpu/ListQueuedResources",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.tpu.v2alpha1.Tpu",
"ListQueuedResources",
),
);
self.inner.unary(req, path, codec).await
}
/// Gets details of a queued resource.
pub async fn get_queued_resource(
&mut self,
request: impl tonic::IntoRequest<super::GetQueuedResourceRequest>,
) -> std::result::Result<tonic::Response<super::QueuedResource>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.tpu.v2alpha1.Tpu/GetQueuedResource",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("google.cloud.tpu.v2alpha1.Tpu", "GetQueuedResource"),
);
self.inner.unary(req, path, codec).await
}
/// Creates a QueuedResource TPU instance.
pub async fn create_queued_resource(
&mut self,
request: impl tonic::IntoRequest<super::CreateQueuedResourceRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.tpu.v2alpha1.Tpu/CreateQueuedResource",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.tpu.v2alpha1.Tpu",
"CreateQueuedResource",
),
);
self.inner.unary(req, path, codec).await
}
/// Deletes a QueuedResource TPU instance.
pub async fn delete_queued_resource(
&mut self,
request: impl tonic::IntoRequest<super::DeleteQueuedResourceRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.tpu.v2alpha1.Tpu/DeleteQueuedResource",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.tpu.v2alpha1.Tpu",
"DeleteQueuedResource",
),
);
self.inner.unary(req, path, codec).await
}
/// Resets a QueuedResource TPU instance
pub async fn reset_queued_resource(
&mut self,
request: impl tonic::IntoRequest<super::ResetQueuedResourceRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.tpu.v2alpha1.Tpu/ResetQueuedResource",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.tpu.v2alpha1.Tpu",
"ResetQueuedResource",
),
);
self.inner.unary(req, path, codec).await
}
/// Generates the Cloud TPU service identity for the project.
pub async fn generate_service_identity(
&mut self,
request: impl tonic::IntoRequest<super::GenerateServiceIdentityRequest>,
) -> std::result::Result<
tonic::Response<super::GenerateServiceIdentityResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.tpu.v2alpha1.Tpu/GenerateServiceIdentity",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.tpu.v2alpha1.Tpu",
"GenerateServiceIdentity",
),
);
self.inner.unary(req, path, codec).await
}
/// Lists accelerator types supported by this API.
pub async fn list_accelerator_types(
&mut self,
request: impl tonic::IntoRequest<super::ListAcceleratorTypesRequest>,
) -> std::result::Result<
tonic::Response<super::ListAcceleratorTypesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.tpu.v2alpha1.Tpu/ListAcceleratorTypes",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.tpu.v2alpha1.Tpu",
"ListAcceleratorTypes",
),
);
self.inner.unary(req, path, codec).await
}
/// Gets AcceleratorType.
pub async fn get_accelerator_type(
&mut self,
request: impl tonic::IntoRequest<super::GetAcceleratorTypeRequest>,
) -> std::result::Result<
tonic::Response<super::AcceleratorType>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.tpu.v2alpha1.Tpu/GetAcceleratorType",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.tpu.v2alpha1.Tpu",
"GetAcceleratorType",
),
);
self.inner.unary(req, path, codec).await
}
/// Lists runtime versions supported by this API.
pub async fn list_runtime_versions(
&mut self,
request: impl tonic::IntoRequest<super::ListRuntimeVersionsRequest>,
) -> std::result::Result<
tonic::Response<super::ListRuntimeVersionsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.tpu.v2alpha1.Tpu/ListRuntimeVersions",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.tpu.v2alpha1.Tpu",
"ListRuntimeVersions",
),
);
self.inner.unary(req, path, codec).await
}
/// Gets a runtime version.
pub async fn get_runtime_version(
&mut self,
request: impl tonic::IntoRequest<super::GetRuntimeVersionRequest>,
) -> std::result::Result<tonic::Response<super::RuntimeVersion>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.tpu.v2alpha1.Tpu/GetRuntimeVersion",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("google.cloud.tpu.v2alpha1.Tpu", "GetRuntimeVersion"),
);
self.inner.unary(req, path, codec).await
}
/// Retrieves the guest attributes for the node.
pub async fn get_guest_attributes(
&mut self,
request: impl tonic::IntoRequest<super::GetGuestAttributesRequest>,
) -> std::result::Result<
tonic::Response<super::GetGuestAttributesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.tpu.v2alpha1.Tpu/GetGuestAttributes",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.tpu.v2alpha1.Tpu",
"GetGuestAttributes",
),
);
self.inner.unary(req, path, codec).await
}
/// Simulates a maintenance event.
pub async fn simulate_maintenance_event(
&mut self,
request: impl tonic::IntoRequest<super::SimulateMaintenanceEventRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.tpu.v2alpha1.Tpu/SimulateMaintenanceEvent",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"google.cloud.tpu.v2alpha1.Tpu",
"SimulateMaintenanceEvent",
),
);
self.inner.unary(req, path, codec).await
}
}
}