@googleapis/tpu 6.0.1 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +41 -0
- package/build/v1.d.ts +916 -0
- package/build/v1.js.map +1 -1
- package/build/v1alpha1.d.ts +920 -0
- package/build/v1alpha1.js.map +1 -1
- package/build/v2.d.ts +1349 -0
- package/build/v2.js.map +1 -1
- package/build/v2alpha1.d.ts +1596 -1
- package/build/v2alpha1.js.map +1 -1
- package/package.json +1 -1
- package/v1.ts +916 -0
- package/v1alpha1.ts +920 -0
- package/v2.ts +1349 -0
- package/v2alpha1.ts +1596 -1
package/v2.ts
CHANGED
|
@@ -971,6 +971,58 @@ export namespace tpu_v2 {
|
|
|
971
971
|
|
|
972
972
|
/**
|
|
973
973
|
* Generates the Cloud TPU service identity for the project.
|
|
974
|
+
* @example
|
|
975
|
+
* ```js
|
|
976
|
+
* // Before running the sample:
|
|
977
|
+
* // - Enable the API at:
|
|
978
|
+
* // https://console.developers.google.com/apis/api/tpu.googleapis.com
|
|
979
|
+
* // - Login into gcloud by running:
|
|
980
|
+
* // ```sh
|
|
981
|
+
* // $ gcloud auth application-default login
|
|
982
|
+
* // ```
|
|
983
|
+
* // - Install the npm module by running:
|
|
984
|
+
* // ```sh
|
|
985
|
+
* // $ npm install googleapis
|
|
986
|
+
* // ```
|
|
987
|
+
*
|
|
988
|
+
* const {google} = require('googleapis');
|
|
989
|
+
* const tpu = google.tpu('v2');
|
|
990
|
+
*
|
|
991
|
+
* async function main() {
|
|
992
|
+
* const auth = new google.auth.GoogleAuth({
|
|
993
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
994
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
995
|
+
* });
|
|
996
|
+
*
|
|
997
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
998
|
+
* const authClient = await auth.getClient();
|
|
999
|
+
* google.options({auth: authClient});
|
|
1000
|
+
*
|
|
1001
|
+
* // Do the magic
|
|
1002
|
+
* const res = await tpu.projects.locations.generateServiceIdentity({
|
|
1003
|
+
* // Required. The parent resource name.
|
|
1004
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
1005
|
+
*
|
|
1006
|
+
* // Request body metadata
|
|
1007
|
+
* requestBody: {
|
|
1008
|
+
* // request body parameters
|
|
1009
|
+
* // {}
|
|
1010
|
+
* },
|
|
1011
|
+
* });
|
|
1012
|
+
* console.log(res.data);
|
|
1013
|
+
*
|
|
1014
|
+
* // Example response
|
|
1015
|
+
* // {
|
|
1016
|
+
* // "identity": {}
|
|
1017
|
+
* // }
|
|
1018
|
+
* }
|
|
1019
|
+
*
|
|
1020
|
+
* main().catch(e => {
|
|
1021
|
+
* console.error(e);
|
|
1022
|
+
* throw e;
|
|
1023
|
+
* });
|
|
1024
|
+
*
|
|
1025
|
+
* ```
|
|
974
1026
|
*
|
|
975
1027
|
* @param params - Parameters for request
|
|
976
1028
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1069,6 +1121,56 @@ export namespace tpu_v2 {
|
|
|
1069
1121
|
|
|
1070
1122
|
/**
|
|
1071
1123
|
* Gets information about a location.
|
|
1124
|
+
* @example
|
|
1125
|
+
* ```js
|
|
1126
|
+
* // Before running the sample:
|
|
1127
|
+
* // - Enable the API at:
|
|
1128
|
+
* // https://console.developers.google.com/apis/api/tpu.googleapis.com
|
|
1129
|
+
* // - Login into gcloud by running:
|
|
1130
|
+
* // ```sh
|
|
1131
|
+
* // $ gcloud auth application-default login
|
|
1132
|
+
* // ```
|
|
1133
|
+
* // - Install the npm module by running:
|
|
1134
|
+
* // ```sh
|
|
1135
|
+
* // $ npm install googleapis
|
|
1136
|
+
* // ```
|
|
1137
|
+
*
|
|
1138
|
+
* const {google} = require('googleapis');
|
|
1139
|
+
* const tpu = google.tpu('v2');
|
|
1140
|
+
*
|
|
1141
|
+
* async function main() {
|
|
1142
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1143
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1144
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
1145
|
+
* });
|
|
1146
|
+
*
|
|
1147
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1148
|
+
* const authClient = await auth.getClient();
|
|
1149
|
+
* google.options({auth: authClient});
|
|
1150
|
+
*
|
|
1151
|
+
* // Do the magic
|
|
1152
|
+
* const res = await tpu.projects.locations.get({
|
|
1153
|
+
* // Resource name for the location.
|
|
1154
|
+
* name: 'projects/my-project/locations/my-location',
|
|
1155
|
+
* });
|
|
1156
|
+
* console.log(res.data);
|
|
1157
|
+
*
|
|
1158
|
+
* // Example response
|
|
1159
|
+
* // {
|
|
1160
|
+
* // "displayName": "my_displayName",
|
|
1161
|
+
* // "labels": {},
|
|
1162
|
+
* // "locationId": "my_locationId",
|
|
1163
|
+
* // "metadata": {},
|
|
1164
|
+
* // "name": "my_name"
|
|
1165
|
+
* // }
|
|
1166
|
+
* }
|
|
1167
|
+
*
|
|
1168
|
+
* main().catch(e => {
|
|
1169
|
+
* console.error(e);
|
|
1170
|
+
* throw e;
|
|
1171
|
+
* });
|
|
1172
|
+
*
|
|
1173
|
+
* ```
|
|
1072
1174
|
*
|
|
1073
1175
|
* @param params - Parameters for request
|
|
1074
1176
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1157,6 +1259,61 @@ export namespace tpu_v2 {
|
|
|
1157
1259
|
|
|
1158
1260
|
/**
|
|
1159
1261
|
* Lists information about the supported locations for this service.
|
|
1262
|
+
* @example
|
|
1263
|
+
* ```js
|
|
1264
|
+
* // Before running the sample:
|
|
1265
|
+
* // - Enable the API at:
|
|
1266
|
+
* // https://console.developers.google.com/apis/api/tpu.googleapis.com
|
|
1267
|
+
* // - Login into gcloud by running:
|
|
1268
|
+
* // ```sh
|
|
1269
|
+
* // $ gcloud auth application-default login
|
|
1270
|
+
* // ```
|
|
1271
|
+
* // - Install the npm module by running:
|
|
1272
|
+
* // ```sh
|
|
1273
|
+
* // $ npm install googleapis
|
|
1274
|
+
* // ```
|
|
1275
|
+
*
|
|
1276
|
+
* const {google} = require('googleapis');
|
|
1277
|
+
* const tpu = google.tpu('v2');
|
|
1278
|
+
*
|
|
1279
|
+
* async function main() {
|
|
1280
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1281
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1282
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
1283
|
+
* });
|
|
1284
|
+
*
|
|
1285
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1286
|
+
* const authClient = await auth.getClient();
|
|
1287
|
+
* google.options({auth: authClient});
|
|
1288
|
+
*
|
|
1289
|
+
* // Do the magic
|
|
1290
|
+
* const res = await tpu.projects.locations.list({
|
|
1291
|
+
* // Optional. A list of extra location types that should be used as conditions for controlling the visibility of the locations.
|
|
1292
|
+
* extraLocationTypes: 'placeholder-value',
|
|
1293
|
+
* // A filter to narrow down results to a preferred subset. The filtering language accepts strings like `"displayName=tokyo"`, and is documented in more detail in [AIP-160](https://google.aip.dev/160).
|
|
1294
|
+
* filter: 'placeholder-value',
|
|
1295
|
+
* // The resource that owns the locations collection, if applicable.
|
|
1296
|
+
* name: 'projects/my-project',
|
|
1297
|
+
* // The maximum number of results to return. If not set, the service selects a default.
|
|
1298
|
+
* pageSize: 'placeholder-value',
|
|
1299
|
+
* // A page token received from the `next_page_token` field in the response. Send that page token to receive the subsequent page.
|
|
1300
|
+
* pageToken: 'placeholder-value',
|
|
1301
|
+
* });
|
|
1302
|
+
* console.log(res.data);
|
|
1303
|
+
*
|
|
1304
|
+
* // Example response
|
|
1305
|
+
* // {
|
|
1306
|
+
* // "locations": [],
|
|
1307
|
+
* // "nextPageToken": "my_nextPageToken"
|
|
1308
|
+
* // }
|
|
1309
|
+
* }
|
|
1310
|
+
*
|
|
1311
|
+
* main().catch(e => {
|
|
1312
|
+
* console.error(e);
|
|
1313
|
+
* throw e;
|
|
1314
|
+
* });
|
|
1315
|
+
*
|
|
1316
|
+
* ```
|
|
1160
1317
|
*
|
|
1161
1318
|
* @param params - Parameters for request
|
|
1162
1319
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1300,6 +1457,54 @@ export namespace tpu_v2 {
|
|
|
1300
1457
|
|
|
1301
1458
|
/**
|
|
1302
1459
|
* Gets AcceleratorType.
|
|
1460
|
+
* @example
|
|
1461
|
+
* ```js
|
|
1462
|
+
* // Before running the sample:
|
|
1463
|
+
* // - Enable the API at:
|
|
1464
|
+
* // https://console.developers.google.com/apis/api/tpu.googleapis.com
|
|
1465
|
+
* // - Login into gcloud by running:
|
|
1466
|
+
* // ```sh
|
|
1467
|
+
* // $ gcloud auth application-default login
|
|
1468
|
+
* // ```
|
|
1469
|
+
* // - Install the npm module by running:
|
|
1470
|
+
* // ```sh
|
|
1471
|
+
* // $ npm install googleapis
|
|
1472
|
+
* // ```
|
|
1473
|
+
*
|
|
1474
|
+
* const {google} = require('googleapis');
|
|
1475
|
+
* const tpu = google.tpu('v2');
|
|
1476
|
+
*
|
|
1477
|
+
* async function main() {
|
|
1478
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1479
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1480
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
1481
|
+
* });
|
|
1482
|
+
*
|
|
1483
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1484
|
+
* const authClient = await auth.getClient();
|
|
1485
|
+
* google.options({auth: authClient});
|
|
1486
|
+
*
|
|
1487
|
+
* // Do the magic
|
|
1488
|
+
* const res = await tpu.projects.locations.acceleratorTypes.get({
|
|
1489
|
+
* // Required. The resource name.
|
|
1490
|
+
* name: 'projects/my-project/locations/my-location/acceleratorTypes/my-acceleratorType',
|
|
1491
|
+
* });
|
|
1492
|
+
* console.log(res.data);
|
|
1493
|
+
*
|
|
1494
|
+
* // Example response
|
|
1495
|
+
* // {
|
|
1496
|
+
* // "acceleratorConfigs": [],
|
|
1497
|
+
* // "name": "my_name",
|
|
1498
|
+
* // "type": "my_type"
|
|
1499
|
+
* // }
|
|
1500
|
+
* }
|
|
1501
|
+
*
|
|
1502
|
+
* main().catch(e => {
|
|
1503
|
+
* console.error(e);
|
|
1504
|
+
* throw e;
|
|
1505
|
+
* });
|
|
1506
|
+
*
|
|
1507
|
+
* ```
|
|
1303
1508
|
*
|
|
1304
1509
|
* @param params - Parameters for request
|
|
1305
1510
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1388,6 +1593,62 @@ export namespace tpu_v2 {
|
|
|
1388
1593
|
|
|
1389
1594
|
/**
|
|
1390
1595
|
* Lists accelerator types supported by this API.
|
|
1596
|
+
* @example
|
|
1597
|
+
* ```js
|
|
1598
|
+
* // Before running the sample:
|
|
1599
|
+
* // - Enable the API at:
|
|
1600
|
+
* // https://console.developers.google.com/apis/api/tpu.googleapis.com
|
|
1601
|
+
* // - Login into gcloud by running:
|
|
1602
|
+
* // ```sh
|
|
1603
|
+
* // $ gcloud auth application-default login
|
|
1604
|
+
* // ```
|
|
1605
|
+
* // - Install the npm module by running:
|
|
1606
|
+
* // ```sh
|
|
1607
|
+
* // $ npm install googleapis
|
|
1608
|
+
* // ```
|
|
1609
|
+
*
|
|
1610
|
+
* const {google} = require('googleapis');
|
|
1611
|
+
* const tpu = google.tpu('v2');
|
|
1612
|
+
*
|
|
1613
|
+
* async function main() {
|
|
1614
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1615
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1616
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
1617
|
+
* });
|
|
1618
|
+
*
|
|
1619
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1620
|
+
* const authClient = await auth.getClient();
|
|
1621
|
+
* google.options({auth: authClient});
|
|
1622
|
+
*
|
|
1623
|
+
* // Do the magic
|
|
1624
|
+
* const res = await tpu.projects.locations.acceleratorTypes.list({
|
|
1625
|
+
* // List filter.
|
|
1626
|
+
* filter: 'placeholder-value',
|
|
1627
|
+
* // Sort results.
|
|
1628
|
+
* orderBy: 'placeholder-value',
|
|
1629
|
+
* // The maximum number of items to return.
|
|
1630
|
+
* pageSize: 'placeholder-value',
|
|
1631
|
+
* // The next_page_token value returned from a previous List request, if any.
|
|
1632
|
+
* pageToken: 'placeholder-value',
|
|
1633
|
+
* // Required. The parent resource name.
|
|
1634
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
1635
|
+
* });
|
|
1636
|
+
* console.log(res.data);
|
|
1637
|
+
*
|
|
1638
|
+
* // Example response
|
|
1639
|
+
* // {
|
|
1640
|
+
* // "acceleratorTypes": [],
|
|
1641
|
+
* // "nextPageToken": "my_nextPageToken",
|
|
1642
|
+
* // "unreachable": []
|
|
1643
|
+
* // }
|
|
1644
|
+
* }
|
|
1645
|
+
*
|
|
1646
|
+
* main().catch(e => {
|
|
1647
|
+
* console.error(e);
|
|
1648
|
+
* throw e;
|
|
1649
|
+
* });
|
|
1650
|
+
*
|
|
1651
|
+
* ```
|
|
1391
1652
|
*
|
|
1392
1653
|
* @param params - Parameters for request
|
|
1393
1654
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1523,6 +1784,91 @@ export namespace tpu_v2 {
|
|
|
1523
1784
|
|
|
1524
1785
|
/**
|
|
1525
1786
|
* Creates a node.
|
|
1787
|
+
* @example
|
|
1788
|
+
* ```js
|
|
1789
|
+
* // Before running the sample:
|
|
1790
|
+
* // - Enable the API at:
|
|
1791
|
+
* // https://console.developers.google.com/apis/api/tpu.googleapis.com
|
|
1792
|
+
* // - Login into gcloud by running:
|
|
1793
|
+
* // ```sh
|
|
1794
|
+
* // $ gcloud auth application-default login
|
|
1795
|
+
* // ```
|
|
1796
|
+
* // - Install the npm module by running:
|
|
1797
|
+
* // ```sh
|
|
1798
|
+
* // $ npm install googleapis
|
|
1799
|
+
* // ```
|
|
1800
|
+
*
|
|
1801
|
+
* const {google} = require('googleapis');
|
|
1802
|
+
* const tpu = google.tpu('v2');
|
|
1803
|
+
*
|
|
1804
|
+
* async function main() {
|
|
1805
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1806
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1807
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
1808
|
+
* });
|
|
1809
|
+
*
|
|
1810
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1811
|
+
* const authClient = await auth.getClient();
|
|
1812
|
+
* google.options({auth: authClient});
|
|
1813
|
+
*
|
|
1814
|
+
* // Do the magic
|
|
1815
|
+
* const res = await tpu.projects.locations.nodes.create({
|
|
1816
|
+
* // The unqualified resource name.
|
|
1817
|
+
* nodeId: 'placeholder-value',
|
|
1818
|
+
* // Required. The parent resource name.
|
|
1819
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
1820
|
+
*
|
|
1821
|
+
* // Request body metadata
|
|
1822
|
+
* requestBody: {
|
|
1823
|
+
* // request body parameters
|
|
1824
|
+
* // {
|
|
1825
|
+
* // "acceleratorConfig": {},
|
|
1826
|
+
* // "acceleratorType": "my_acceleratorType",
|
|
1827
|
+
* // "apiVersion": "my_apiVersion",
|
|
1828
|
+
* // "cidrBlock": "my_cidrBlock",
|
|
1829
|
+
* // "createTime": "my_createTime",
|
|
1830
|
+
* // "dataDisks": [],
|
|
1831
|
+
* // "description": "my_description",
|
|
1832
|
+
* // "health": "my_health",
|
|
1833
|
+
* // "healthDescription": "my_healthDescription",
|
|
1834
|
+
* // "id": "my_id",
|
|
1835
|
+
* // "labels": {},
|
|
1836
|
+
* // "metadata": {},
|
|
1837
|
+
* // "multisliceNode": false,
|
|
1838
|
+
* // "name": "my_name",
|
|
1839
|
+
* // "networkConfig": {},
|
|
1840
|
+
* // "networkConfigs": [],
|
|
1841
|
+
* // "networkEndpoints": [],
|
|
1842
|
+
* // "queuedResource": "my_queuedResource",
|
|
1843
|
+
* // "runtimeVersion": "my_runtimeVersion",
|
|
1844
|
+
* // "schedulingConfig": {},
|
|
1845
|
+
* // "serviceAccount": {},
|
|
1846
|
+
* // "shieldedInstanceConfig": {},
|
|
1847
|
+
* // "state": "my_state",
|
|
1848
|
+
* // "symptoms": [],
|
|
1849
|
+
* // "tags": [],
|
|
1850
|
+
* // "upcomingMaintenance": {}
|
|
1851
|
+
* // }
|
|
1852
|
+
* },
|
|
1853
|
+
* });
|
|
1854
|
+
* console.log(res.data);
|
|
1855
|
+
*
|
|
1856
|
+
* // Example response
|
|
1857
|
+
* // {
|
|
1858
|
+
* // "done": false,
|
|
1859
|
+
* // "error": {},
|
|
1860
|
+
* // "metadata": {},
|
|
1861
|
+
* // "name": "my_name",
|
|
1862
|
+
* // "response": {}
|
|
1863
|
+
* // }
|
|
1864
|
+
* }
|
|
1865
|
+
*
|
|
1866
|
+
* main().catch(e => {
|
|
1867
|
+
* console.error(e);
|
|
1868
|
+
* throw e;
|
|
1869
|
+
* });
|
|
1870
|
+
*
|
|
1871
|
+
* ```
|
|
1526
1872
|
*
|
|
1527
1873
|
* @param params - Parameters for request
|
|
1528
1874
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1614,6 +1960,56 @@ export namespace tpu_v2 {
|
|
|
1614
1960
|
|
|
1615
1961
|
/**
|
|
1616
1962
|
* Deletes a node.
|
|
1963
|
+
* @example
|
|
1964
|
+
* ```js
|
|
1965
|
+
* // Before running the sample:
|
|
1966
|
+
* // - Enable the API at:
|
|
1967
|
+
* // https://console.developers.google.com/apis/api/tpu.googleapis.com
|
|
1968
|
+
* // - Login into gcloud by running:
|
|
1969
|
+
* // ```sh
|
|
1970
|
+
* // $ gcloud auth application-default login
|
|
1971
|
+
* // ```
|
|
1972
|
+
* // - Install the npm module by running:
|
|
1973
|
+
* // ```sh
|
|
1974
|
+
* // $ npm install googleapis
|
|
1975
|
+
* // ```
|
|
1976
|
+
*
|
|
1977
|
+
* const {google} = require('googleapis');
|
|
1978
|
+
* const tpu = google.tpu('v2');
|
|
1979
|
+
*
|
|
1980
|
+
* async function main() {
|
|
1981
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1982
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1983
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
1984
|
+
* });
|
|
1985
|
+
*
|
|
1986
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1987
|
+
* const authClient = await auth.getClient();
|
|
1988
|
+
* google.options({auth: authClient});
|
|
1989
|
+
*
|
|
1990
|
+
* // Do the magic
|
|
1991
|
+
* const res = await tpu.projects.locations.nodes.delete({
|
|
1992
|
+
* // Required. The resource name.
|
|
1993
|
+
* name: 'projects/my-project/locations/my-location/nodes/my-node',
|
|
1994
|
+
* });
|
|
1995
|
+
* console.log(res.data);
|
|
1996
|
+
*
|
|
1997
|
+
* // Example response
|
|
1998
|
+
* // {
|
|
1999
|
+
* // "done": false,
|
|
2000
|
+
* // "error": {},
|
|
2001
|
+
* // "metadata": {},
|
|
2002
|
+
* // "name": "my_name",
|
|
2003
|
+
* // "response": {}
|
|
2004
|
+
* // }
|
|
2005
|
+
* }
|
|
2006
|
+
*
|
|
2007
|
+
* main().catch(e => {
|
|
2008
|
+
* console.error(e);
|
|
2009
|
+
* throw e;
|
|
2010
|
+
* });
|
|
2011
|
+
*
|
|
2012
|
+
* ```
|
|
1617
2013
|
*
|
|
1618
2014
|
* @param params - Parameters for request
|
|
1619
2015
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1702,6 +2098,77 @@ export namespace tpu_v2 {
|
|
|
1702
2098
|
|
|
1703
2099
|
/**
|
|
1704
2100
|
* Gets the details of a node.
|
|
2101
|
+
* @example
|
|
2102
|
+
* ```js
|
|
2103
|
+
* // Before running the sample:
|
|
2104
|
+
* // - Enable the API at:
|
|
2105
|
+
* // https://console.developers.google.com/apis/api/tpu.googleapis.com
|
|
2106
|
+
* // - Login into gcloud by running:
|
|
2107
|
+
* // ```sh
|
|
2108
|
+
* // $ gcloud auth application-default login
|
|
2109
|
+
* // ```
|
|
2110
|
+
* // - Install the npm module by running:
|
|
2111
|
+
* // ```sh
|
|
2112
|
+
* // $ npm install googleapis
|
|
2113
|
+
* // ```
|
|
2114
|
+
*
|
|
2115
|
+
* const {google} = require('googleapis');
|
|
2116
|
+
* const tpu = google.tpu('v2');
|
|
2117
|
+
*
|
|
2118
|
+
* async function main() {
|
|
2119
|
+
* const auth = new google.auth.GoogleAuth({
|
|
2120
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
2121
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
2122
|
+
* });
|
|
2123
|
+
*
|
|
2124
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2125
|
+
* const authClient = await auth.getClient();
|
|
2126
|
+
* google.options({auth: authClient});
|
|
2127
|
+
*
|
|
2128
|
+
* // Do the magic
|
|
2129
|
+
* const res = await tpu.projects.locations.nodes.get({
|
|
2130
|
+
* // Required. The resource name.
|
|
2131
|
+
* name: 'projects/my-project/locations/my-location/nodes/my-node',
|
|
2132
|
+
* });
|
|
2133
|
+
* console.log(res.data);
|
|
2134
|
+
*
|
|
2135
|
+
* // Example response
|
|
2136
|
+
* // {
|
|
2137
|
+
* // "acceleratorConfig": {},
|
|
2138
|
+
* // "acceleratorType": "my_acceleratorType",
|
|
2139
|
+
* // "apiVersion": "my_apiVersion",
|
|
2140
|
+
* // "cidrBlock": "my_cidrBlock",
|
|
2141
|
+
* // "createTime": "my_createTime",
|
|
2142
|
+
* // "dataDisks": [],
|
|
2143
|
+
* // "description": "my_description",
|
|
2144
|
+
* // "health": "my_health",
|
|
2145
|
+
* // "healthDescription": "my_healthDescription",
|
|
2146
|
+
* // "id": "my_id",
|
|
2147
|
+
* // "labels": {},
|
|
2148
|
+
* // "metadata": {},
|
|
2149
|
+
* // "multisliceNode": false,
|
|
2150
|
+
* // "name": "my_name",
|
|
2151
|
+
* // "networkConfig": {},
|
|
2152
|
+
* // "networkConfigs": [],
|
|
2153
|
+
* // "networkEndpoints": [],
|
|
2154
|
+
* // "queuedResource": "my_queuedResource",
|
|
2155
|
+
* // "runtimeVersion": "my_runtimeVersion",
|
|
2156
|
+
* // "schedulingConfig": {},
|
|
2157
|
+
* // "serviceAccount": {},
|
|
2158
|
+
* // "shieldedInstanceConfig": {},
|
|
2159
|
+
* // "state": "my_state",
|
|
2160
|
+
* // "symptoms": [],
|
|
2161
|
+
* // "tags": [],
|
|
2162
|
+
* // "upcomingMaintenance": {}
|
|
2163
|
+
* // }
|
|
2164
|
+
* }
|
|
2165
|
+
*
|
|
2166
|
+
* main().catch(e => {
|
|
2167
|
+
* console.error(e);
|
|
2168
|
+
* throw e;
|
|
2169
|
+
* });
|
|
2170
|
+
*
|
|
2171
|
+
* ```
|
|
1705
2172
|
*
|
|
1706
2173
|
* @param params - Parameters for request
|
|
1707
2174
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1790,6 +2257,61 @@ export namespace tpu_v2 {
|
|
|
1790
2257
|
|
|
1791
2258
|
/**
|
|
1792
2259
|
* Retrieves the guest attributes for the node.
|
|
2260
|
+
* @example
|
|
2261
|
+
* ```js
|
|
2262
|
+
* // Before running the sample:
|
|
2263
|
+
* // - Enable the API at:
|
|
2264
|
+
* // https://console.developers.google.com/apis/api/tpu.googleapis.com
|
|
2265
|
+
* // - Login into gcloud by running:
|
|
2266
|
+
* // ```sh
|
|
2267
|
+
* // $ gcloud auth application-default login
|
|
2268
|
+
* // ```
|
|
2269
|
+
* // - Install the npm module by running:
|
|
2270
|
+
* // ```sh
|
|
2271
|
+
* // $ npm install googleapis
|
|
2272
|
+
* // ```
|
|
2273
|
+
*
|
|
2274
|
+
* const {google} = require('googleapis');
|
|
2275
|
+
* const tpu = google.tpu('v2');
|
|
2276
|
+
*
|
|
2277
|
+
* async function main() {
|
|
2278
|
+
* const auth = new google.auth.GoogleAuth({
|
|
2279
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
2280
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
2281
|
+
* });
|
|
2282
|
+
*
|
|
2283
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2284
|
+
* const authClient = await auth.getClient();
|
|
2285
|
+
* google.options({auth: authClient});
|
|
2286
|
+
*
|
|
2287
|
+
* // Do the magic
|
|
2288
|
+
* const res = await tpu.projects.locations.nodes.getGuestAttributes({
|
|
2289
|
+
* // Required. The resource name.
|
|
2290
|
+
* name: 'projects/my-project/locations/my-location/nodes/my-node',
|
|
2291
|
+
*
|
|
2292
|
+
* // Request body metadata
|
|
2293
|
+
* requestBody: {
|
|
2294
|
+
* // request body parameters
|
|
2295
|
+
* // {
|
|
2296
|
+
* // "queryPath": "my_queryPath",
|
|
2297
|
+
* // "workerIds": []
|
|
2298
|
+
* // }
|
|
2299
|
+
* },
|
|
2300
|
+
* });
|
|
2301
|
+
* console.log(res.data);
|
|
2302
|
+
*
|
|
2303
|
+
* // Example response
|
|
2304
|
+
* // {
|
|
2305
|
+
* // "guestAttributes": []
|
|
2306
|
+
* // }
|
|
2307
|
+
* }
|
|
2308
|
+
*
|
|
2309
|
+
* main().catch(e => {
|
|
2310
|
+
* console.error(e);
|
|
2311
|
+
* throw e;
|
|
2312
|
+
* });
|
|
2313
|
+
*
|
|
2314
|
+
* ```
|
|
1793
2315
|
*
|
|
1794
2316
|
* @param params - Parameters for request
|
|
1795
2317
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1886,6 +2408,58 @@ export namespace tpu_v2 {
|
|
|
1886
2408
|
|
|
1887
2409
|
/**
|
|
1888
2410
|
* Lists nodes.
|
|
2411
|
+
* @example
|
|
2412
|
+
* ```js
|
|
2413
|
+
* // Before running the sample:
|
|
2414
|
+
* // - Enable the API at:
|
|
2415
|
+
* // https://console.developers.google.com/apis/api/tpu.googleapis.com
|
|
2416
|
+
* // - Login into gcloud by running:
|
|
2417
|
+
* // ```sh
|
|
2418
|
+
* // $ gcloud auth application-default login
|
|
2419
|
+
* // ```
|
|
2420
|
+
* // - Install the npm module by running:
|
|
2421
|
+
* // ```sh
|
|
2422
|
+
* // $ npm install googleapis
|
|
2423
|
+
* // ```
|
|
2424
|
+
*
|
|
2425
|
+
* const {google} = require('googleapis');
|
|
2426
|
+
* const tpu = google.tpu('v2');
|
|
2427
|
+
*
|
|
2428
|
+
* async function main() {
|
|
2429
|
+
* const auth = new google.auth.GoogleAuth({
|
|
2430
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
2431
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
2432
|
+
* });
|
|
2433
|
+
*
|
|
2434
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2435
|
+
* const authClient = await auth.getClient();
|
|
2436
|
+
* google.options({auth: authClient});
|
|
2437
|
+
*
|
|
2438
|
+
* // Do the magic
|
|
2439
|
+
* const res = await tpu.projects.locations.nodes.list({
|
|
2440
|
+
* // The maximum number of items to return.
|
|
2441
|
+
* pageSize: 'placeholder-value',
|
|
2442
|
+
* // The next_page_token value returned from a previous List request, if any.
|
|
2443
|
+
* pageToken: 'placeholder-value',
|
|
2444
|
+
* // Required. The parent resource name.
|
|
2445
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
2446
|
+
* });
|
|
2447
|
+
* console.log(res.data);
|
|
2448
|
+
*
|
|
2449
|
+
* // Example response
|
|
2450
|
+
* // {
|
|
2451
|
+
* // "nextPageToken": "my_nextPageToken",
|
|
2452
|
+
* // "nodes": [],
|
|
2453
|
+
* // "unreachable": []
|
|
2454
|
+
* // }
|
|
2455
|
+
* }
|
|
2456
|
+
*
|
|
2457
|
+
* main().catch(e => {
|
|
2458
|
+
* console.error(e);
|
|
2459
|
+
* throw e;
|
|
2460
|
+
* });
|
|
2461
|
+
*
|
|
2462
|
+
* ```
|
|
1889
2463
|
*
|
|
1890
2464
|
* @param params - Parameters for request
|
|
1891
2465
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1977,6 +2551,91 @@ export namespace tpu_v2 {
|
|
|
1977
2551
|
|
|
1978
2552
|
/**
|
|
1979
2553
|
* Updates the configurations of a node.
|
|
2554
|
+
* @example
|
|
2555
|
+
* ```js
|
|
2556
|
+
* // Before running the sample:
|
|
2557
|
+
* // - Enable the API at:
|
|
2558
|
+
* // https://console.developers.google.com/apis/api/tpu.googleapis.com
|
|
2559
|
+
* // - Login into gcloud by running:
|
|
2560
|
+
* // ```sh
|
|
2561
|
+
* // $ gcloud auth application-default login
|
|
2562
|
+
* // ```
|
|
2563
|
+
* // - Install the npm module by running:
|
|
2564
|
+
* // ```sh
|
|
2565
|
+
* // $ npm install googleapis
|
|
2566
|
+
* // ```
|
|
2567
|
+
*
|
|
2568
|
+
* const {google} = require('googleapis');
|
|
2569
|
+
* const tpu = google.tpu('v2');
|
|
2570
|
+
*
|
|
2571
|
+
* async function main() {
|
|
2572
|
+
* const auth = new google.auth.GoogleAuth({
|
|
2573
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
2574
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
2575
|
+
* });
|
|
2576
|
+
*
|
|
2577
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2578
|
+
* const authClient = await auth.getClient();
|
|
2579
|
+
* google.options({auth: authClient});
|
|
2580
|
+
*
|
|
2581
|
+
* // Do the magic
|
|
2582
|
+
* const res = await tpu.projects.locations.nodes.patch({
|
|
2583
|
+
* // Output only. Immutable. The name of the TPU.
|
|
2584
|
+
* name: 'projects/my-project/locations/my-location/nodes/my-node',
|
|
2585
|
+
* // Required. Mask of fields from Node to update. Supported fields: [description, tags, labels, metadata, network_config.enable_external_ips].
|
|
2586
|
+
* updateMask: 'placeholder-value',
|
|
2587
|
+
*
|
|
2588
|
+
* // Request body metadata
|
|
2589
|
+
* requestBody: {
|
|
2590
|
+
* // request body parameters
|
|
2591
|
+
* // {
|
|
2592
|
+
* // "acceleratorConfig": {},
|
|
2593
|
+
* // "acceleratorType": "my_acceleratorType",
|
|
2594
|
+
* // "apiVersion": "my_apiVersion",
|
|
2595
|
+
* // "cidrBlock": "my_cidrBlock",
|
|
2596
|
+
* // "createTime": "my_createTime",
|
|
2597
|
+
* // "dataDisks": [],
|
|
2598
|
+
* // "description": "my_description",
|
|
2599
|
+
* // "health": "my_health",
|
|
2600
|
+
* // "healthDescription": "my_healthDescription",
|
|
2601
|
+
* // "id": "my_id",
|
|
2602
|
+
* // "labels": {},
|
|
2603
|
+
* // "metadata": {},
|
|
2604
|
+
* // "multisliceNode": false,
|
|
2605
|
+
* // "name": "my_name",
|
|
2606
|
+
* // "networkConfig": {},
|
|
2607
|
+
* // "networkConfigs": [],
|
|
2608
|
+
* // "networkEndpoints": [],
|
|
2609
|
+
* // "queuedResource": "my_queuedResource",
|
|
2610
|
+
* // "runtimeVersion": "my_runtimeVersion",
|
|
2611
|
+
* // "schedulingConfig": {},
|
|
2612
|
+
* // "serviceAccount": {},
|
|
2613
|
+
* // "shieldedInstanceConfig": {},
|
|
2614
|
+
* // "state": "my_state",
|
|
2615
|
+
* // "symptoms": [],
|
|
2616
|
+
* // "tags": [],
|
|
2617
|
+
* // "upcomingMaintenance": {}
|
|
2618
|
+
* // }
|
|
2619
|
+
* },
|
|
2620
|
+
* });
|
|
2621
|
+
* console.log(res.data);
|
|
2622
|
+
*
|
|
2623
|
+
* // Example response
|
|
2624
|
+
* // {
|
|
2625
|
+
* // "done": false,
|
|
2626
|
+
* // "error": {},
|
|
2627
|
+
* // "metadata": {},
|
|
2628
|
+
* // "name": "my_name",
|
|
2629
|
+
* // "response": {}
|
|
2630
|
+
* // }
|
|
2631
|
+
* }
|
|
2632
|
+
*
|
|
2633
|
+
* main().catch(e => {
|
|
2634
|
+
* console.error(e);
|
|
2635
|
+
* throw e;
|
|
2636
|
+
* });
|
|
2637
|
+
*
|
|
2638
|
+
* ```
|
|
1980
2639
|
*
|
|
1981
2640
|
* @param params - Parameters for request
|
|
1982
2641
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2065,6 +2724,62 @@ export namespace tpu_v2 {
|
|
|
2065
2724
|
|
|
2066
2725
|
/**
|
|
2067
2726
|
* Starts a node.
|
|
2727
|
+
* @example
|
|
2728
|
+
* ```js
|
|
2729
|
+
* // Before running the sample:
|
|
2730
|
+
* // - Enable the API at:
|
|
2731
|
+
* // https://console.developers.google.com/apis/api/tpu.googleapis.com
|
|
2732
|
+
* // - Login into gcloud by running:
|
|
2733
|
+
* // ```sh
|
|
2734
|
+
* // $ gcloud auth application-default login
|
|
2735
|
+
* // ```
|
|
2736
|
+
* // - Install the npm module by running:
|
|
2737
|
+
* // ```sh
|
|
2738
|
+
* // $ npm install googleapis
|
|
2739
|
+
* // ```
|
|
2740
|
+
*
|
|
2741
|
+
* const {google} = require('googleapis');
|
|
2742
|
+
* const tpu = google.tpu('v2');
|
|
2743
|
+
*
|
|
2744
|
+
* async function main() {
|
|
2745
|
+
* const auth = new google.auth.GoogleAuth({
|
|
2746
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
2747
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
2748
|
+
* });
|
|
2749
|
+
*
|
|
2750
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2751
|
+
* const authClient = await auth.getClient();
|
|
2752
|
+
* google.options({auth: authClient});
|
|
2753
|
+
*
|
|
2754
|
+
* // Do the magic
|
|
2755
|
+
* const res = await tpu.projects.locations.nodes.start({
|
|
2756
|
+
* // Required. The resource name.
|
|
2757
|
+
* name: 'projects/my-project/locations/my-location/nodes/my-node',
|
|
2758
|
+
*
|
|
2759
|
+
* // Request body metadata
|
|
2760
|
+
* requestBody: {
|
|
2761
|
+
* // request body parameters
|
|
2762
|
+
* // {}
|
|
2763
|
+
* },
|
|
2764
|
+
* });
|
|
2765
|
+
* console.log(res.data);
|
|
2766
|
+
*
|
|
2767
|
+
* // Example response
|
|
2768
|
+
* // {
|
|
2769
|
+
* // "done": false,
|
|
2770
|
+
* // "error": {},
|
|
2771
|
+
* // "metadata": {},
|
|
2772
|
+
* // "name": "my_name",
|
|
2773
|
+
* // "response": {}
|
|
2774
|
+
* // }
|
|
2775
|
+
* }
|
|
2776
|
+
*
|
|
2777
|
+
* main().catch(e => {
|
|
2778
|
+
* console.error(e);
|
|
2779
|
+
* throw e;
|
|
2780
|
+
* });
|
|
2781
|
+
*
|
|
2782
|
+
* ```
|
|
2068
2783
|
*
|
|
2069
2784
|
* @param params - Parameters for request
|
|
2070
2785
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2153,6 +2868,62 @@ export namespace tpu_v2 {
|
|
|
2153
2868
|
|
|
2154
2869
|
/**
|
|
2155
2870
|
* Stops a node. This operation is only available with single TPU nodes.
|
|
2871
|
+
* @example
|
|
2872
|
+
* ```js
|
|
2873
|
+
* // Before running the sample:
|
|
2874
|
+
* // - Enable the API at:
|
|
2875
|
+
* // https://console.developers.google.com/apis/api/tpu.googleapis.com
|
|
2876
|
+
* // - Login into gcloud by running:
|
|
2877
|
+
* // ```sh
|
|
2878
|
+
* // $ gcloud auth application-default login
|
|
2879
|
+
* // ```
|
|
2880
|
+
* // - Install the npm module by running:
|
|
2881
|
+
* // ```sh
|
|
2882
|
+
* // $ npm install googleapis
|
|
2883
|
+
* // ```
|
|
2884
|
+
*
|
|
2885
|
+
* const {google} = require('googleapis');
|
|
2886
|
+
* const tpu = google.tpu('v2');
|
|
2887
|
+
*
|
|
2888
|
+
* async function main() {
|
|
2889
|
+
* const auth = new google.auth.GoogleAuth({
|
|
2890
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
2891
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
2892
|
+
* });
|
|
2893
|
+
*
|
|
2894
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2895
|
+
* const authClient = await auth.getClient();
|
|
2896
|
+
* google.options({auth: authClient});
|
|
2897
|
+
*
|
|
2898
|
+
* // Do the magic
|
|
2899
|
+
* const res = await tpu.projects.locations.nodes.stop({
|
|
2900
|
+
* // Required. The resource name.
|
|
2901
|
+
* name: 'projects/my-project/locations/my-location/nodes/my-node',
|
|
2902
|
+
*
|
|
2903
|
+
* // Request body metadata
|
|
2904
|
+
* requestBody: {
|
|
2905
|
+
* // request body parameters
|
|
2906
|
+
* // {}
|
|
2907
|
+
* },
|
|
2908
|
+
* });
|
|
2909
|
+
* console.log(res.data);
|
|
2910
|
+
*
|
|
2911
|
+
* // Example response
|
|
2912
|
+
* // {
|
|
2913
|
+
* // "done": false,
|
|
2914
|
+
* // "error": {},
|
|
2915
|
+
* // "metadata": {},
|
|
2916
|
+
* // "name": "my_name",
|
|
2917
|
+
* // "response": {}
|
|
2918
|
+
* // }
|
|
2919
|
+
* }
|
|
2920
|
+
*
|
|
2921
|
+
* main().catch(e => {
|
|
2922
|
+
* console.error(e);
|
|
2923
|
+
* throw e;
|
|
2924
|
+
* });
|
|
2925
|
+
*
|
|
2926
|
+
* ```
|
|
2156
2927
|
*
|
|
2157
2928
|
* @param params - Parameters for request
|
|
2158
2929
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2346,6 +3117,50 @@ export namespace tpu_v2 {
|
|
|
2346
3117
|
|
|
2347
3118
|
/**
|
|
2348
3119
|
* Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of `1`, corresponding to `Code.CANCELLED`.
|
|
3120
|
+
* @example
|
|
3121
|
+
* ```js
|
|
3122
|
+
* // Before running the sample:
|
|
3123
|
+
* // - Enable the API at:
|
|
3124
|
+
* // https://console.developers.google.com/apis/api/tpu.googleapis.com
|
|
3125
|
+
* // - Login into gcloud by running:
|
|
3126
|
+
* // ```sh
|
|
3127
|
+
* // $ gcloud auth application-default login
|
|
3128
|
+
* // ```
|
|
3129
|
+
* // - Install the npm module by running:
|
|
3130
|
+
* // ```sh
|
|
3131
|
+
* // $ npm install googleapis
|
|
3132
|
+
* // ```
|
|
3133
|
+
*
|
|
3134
|
+
* const {google} = require('googleapis');
|
|
3135
|
+
* const tpu = google.tpu('v2');
|
|
3136
|
+
*
|
|
3137
|
+
* async function main() {
|
|
3138
|
+
* const auth = new google.auth.GoogleAuth({
|
|
3139
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
3140
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
3141
|
+
* });
|
|
3142
|
+
*
|
|
3143
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
3144
|
+
* const authClient = await auth.getClient();
|
|
3145
|
+
* google.options({auth: authClient});
|
|
3146
|
+
*
|
|
3147
|
+
* // Do the magic
|
|
3148
|
+
* const res = await tpu.projects.locations.operations.cancel({
|
|
3149
|
+
* // The name of the operation resource to be cancelled.
|
|
3150
|
+
* name: 'projects/my-project/locations/my-location/operations/my-operation',
|
|
3151
|
+
* });
|
|
3152
|
+
* console.log(res.data);
|
|
3153
|
+
*
|
|
3154
|
+
* // Example response
|
|
3155
|
+
* // {}
|
|
3156
|
+
* }
|
|
3157
|
+
*
|
|
3158
|
+
* main().catch(e => {
|
|
3159
|
+
* console.error(e);
|
|
3160
|
+
* throw e;
|
|
3161
|
+
* });
|
|
3162
|
+
*
|
|
3163
|
+
* ```
|
|
2349
3164
|
*
|
|
2350
3165
|
* @param params - Parameters for request
|
|
2351
3166
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2434,6 +3249,50 @@ export namespace tpu_v2 {
|
|
|
2434
3249
|
|
|
2435
3250
|
/**
|
|
2436
3251
|
* Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
|
|
3252
|
+
* @example
|
|
3253
|
+
* ```js
|
|
3254
|
+
* // Before running the sample:
|
|
3255
|
+
* // - Enable the API at:
|
|
3256
|
+
* // https://console.developers.google.com/apis/api/tpu.googleapis.com
|
|
3257
|
+
* // - Login into gcloud by running:
|
|
3258
|
+
* // ```sh
|
|
3259
|
+
* // $ gcloud auth application-default login
|
|
3260
|
+
* // ```
|
|
3261
|
+
* // - Install the npm module by running:
|
|
3262
|
+
* // ```sh
|
|
3263
|
+
* // $ npm install googleapis
|
|
3264
|
+
* // ```
|
|
3265
|
+
*
|
|
3266
|
+
* const {google} = require('googleapis');
|
|
3267
|
+
* const tpu = google.tpu('v2');
|
|
3268
|
+
*
|
|
3269
|
+
* async function main() {
|
|
3270
|
+
* const auth = new google.auth.GoogleAuth({
|
|
3271
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
3272
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
3273
|
+
* });
|
|
3274
|
+
*
|
|
3275
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
3276
|
+
* const authClient = await auth.getClient();
|
|
3277
|
+
* google.options({auth: authClient});
|
|
3278
|
+
*
|
|
3279
|
+
* // Do the magic
|
|
3280
|
+
* const res = await tpu.projects.locations.operations.delete({
|
|
3281
|
+
* // The name of the operation resource to be deleted.
|
|
3282
|
+
* name: 'projects/my-project/locations/my-location/operations/my-operation',
|
|
3283
|
+
* });
|
|
3284
|
+
* console.log(res.data);
|
|
3285
|
+
*
|
|
3286
|
+
* // Example response
|
|
3287
|
+
* // {}
|
|
3288
|
+
* }
|
|
3289
|
+
*
|
|
3290
|
+
* main().catch(e => {
|
|
3291
|
+
* console.error(e);
|
|
3292
|
+
* throw e;
|
|
3293
|
+
* });
|
|
3294
|
+
*
|
|
3295
|
+
* ```
|
|
2437
3296
|
*
|
|
2438
3297
|
* @param params - Parameters for request
|
|
2439
3298
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2522,6 +3381,56 @@ export namespace tpu_v2 {
|
|
|
2522
3381
|
|
|
2523
3382
|
/**
|
|
2524
3383
|
* Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
|
|
3384
|
+
* @example
|
|
3385
|
+
* ```js
|
|
3386
|
+
* // Before running the sample:
|
|
3387
|
+
* // - Enable the API at:
|
|
3388
|
+
* // https://console.developers.google.com/apis/api/tpu.googleapis.com
|
|
3389
|
+
* // - Login into gcloud by running:
|
|
3390
|
+
* // ```sh
|
|
3391
|
+
* // $ gcloud auth application-default login
|
|
3392
|
+
* // ```
|
|
3393
|
+
* // - Install the npm module by running:
|
|
3394
|
+
* // ```sh
|
|
3395
|
+
* // $ npm install googleapis
|
|
3396
|
+
* // ```
|
|
3397
|
+
*
|
|
3398
|
+
* const {google} = require('googleapis');
|
|
3399
|
+
* const tpu = google.tpu('v2');
|
|
3400
|
+
*
|
|
3401
|
+
* async function main() {
|
|
3402
|
+
* const auth = new google.auth.GoogleAuth({
|
|
3403
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
3404
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
3405
|
+
* });
|
|
3406
|
+
*
|
|
3407
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
3408
|
+
* const authClient = await auth.getClient();
|
|
3409
|
+
* google.options({auth: authClient});
|
|
3410
|
+
*
|
|
3411
|
+
* // Do the magic
|
|
3412
|
+
* const res = await tpu.projects.locations.operations.get({
|
|
3413
|
+
* // The name of the operation resource.
|
|
3414
|
+
* name: 'projects/my-project/locations/my-location/operations/my-operation',
|
|
3415
|
+
* });
|
|
3416
|
+
* console.log(res.data);
|
|
3417
|
+
*
|
|
3418
|
+
* // Example response
|
|
3419
|
+
* // {
|
|
3420
|
+
* // "done": false,
|
|
3421
|
+
* // "error": {},
|
|
3422
|
+
* // "metadata": {},
|
|
3423
|
+
* // "name": "my_name",
|
|
3424
|
+
* // "response": {}
|
|
3425
|
+
* // }
|
|
3426
|
+
* }
|
|
3427
|
+
*
|
|
3428
|
+
* main().catch(e => {
|
|
3429
|
+
* console.error(e);
|
|
3430
|
+
* throw e;
|
|
3431
|
+
* });
|
|
3432
|
+
*
|
|
3433
|
+
* ```
|
|
2525
3434
|
*
|
|
2526
3435
|
* @param params - Parameters for request
|
|
2527
3436
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2610,6 +3519,59 @@ export namespace tpu_v2 {
|
|
|
2610
3519
|
|
|
2611
3520
|
/**
|
|
2612
3521
|
* Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.
|
|
3522
|
+
* @example
|
|
3523
|
+
* ```js
|
|
3524
|
+
* // Before running the sample:
|
|
3525
|
+
* // - Enable the API at:
|
|
3526
|
+
* // https://console.developers.google.com/apis/api/tpu.googleapis.com
|
|
3527
|
+
* // - Login into gcloud by running:
|
|
3528
|
+
* // ```sh
|
|
3529
|
+
* // $ gcloud auth application-default login
|
|
3530
|
+
* // ```
|
|
3531
|
+
* // - Install the npm module by running:
|
|
3532
|
+
* // ```sh
|
|
3533
|
+
* // $ npm install googleapis
|
|
3534
|
+
* // ```
|
|
3535
|
+
*
|
|
3536
|
+
* const {google} = require('googleapis');
|
|
3537
|
+
* const tpu = google.tpu('v2');
|
|
3538
|
+
*
|
|
3539
|
+
* async function main() {
|
|
3540
|
+
* const auth = new google.auth.GoogleAuth({
|
|
3541
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
3542
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
3543
|
+
* });
|
|
3544
|
+
*
|
|
3545
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
3546
|
+
* const authClient = await auth.getClient();
|
|
3547
|
+
* google.options({auth: authClient});
|
|
3548
|
+
*
|
|
3549
|
+
* // Do the magic
|
|
3550
|
+
* const res = await tpu.projects.locations.operations.list({
|
|
3551
|
+
* // The standard list filter.
|
|
3552
|
+
* filter: 'placeholder-value',
|
|
3553
|
+
* // The name of the operation's parent resource.
|
|
3554
|
+
* name: 'projects/my-project/locations/my-location',
|
|
3555
|
+
* // The standard list page size.
|
|
3556
|
+
* pageSize: 'placeholder-value',
|
|
3557
|
+
* // The standard list page token.
|
|
3558
|
+
* pageToken: 'placeholder-value',
|
|
3559
|
+
* });
|
|
3560
|
+
* console.log(res.data);
|
|
3561
|
+
*
|
|
3562
|
+
* // Example response
|
|
3563
|
+
* // {
|
|
3564
|
+
* // "nextPageToken": "my_nextPageToken",
|
|
3565
|
+
* // "operations": []
|
|
3566
|
+
* // }
|
|
3567
|
+
* }
|
|
3568
|
+
*
|
|
3569
|
+
* main().catch(e => {
|
|
3570
|
+
* console.error(e);
|
|
3571
|
+
* throw e;
|
|
3572
|
+
* });
|
|
3573
|
+
*
|
|
3574
|
+
* ```
|
|
2613
3575
|
*
|
|
2614
3576
|
* @param params - Parameters for request
|
|
2615
3577
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2751,6 +3713,75 @@ export namespace tpu_v2 {
|
|
|
2751
3713
|
|
|
2752
3714
|
/**
|
|
2753
3715
|
* Creates a QueuedResource TPU instance.
|
|
3716
|
+
* @example
|
|
3717
|
+
* ```js
|
|
3718
|
+
* // Before running the sample:
|
|
3719
|
+
* // - Enable the API at:
|
|
3720
|
+
* // https://console.developers.google.com/apis/api/tpu.googleapis.com
|
|
3721
|
+
* // - Login into gcloud by running:
|
|
3722
|
+
* // ```sh
|
|
3723
|
+
* // $ gcloud auth application-default login
|
|
3724
|
+
* // ```
|
|
3725
|
+
* // - Install the npm module by running:
|
|
3726
|
+
* // ```sh
|
|
3727
|
+
* // $ npm install googleapis
|
|
3728
|
+
* // ```
|
|
3729
|
+
*
|
|
3730
|
+
* const {google} = require('googleapis');
|
|
3731
|
+
* const tpu = google.tpu('v2');
|
|
3732
|
+
*
|
|
3733
|
+
* async function main() {
|
|
3734
|
+
* const auth = new google.auth.GoogleAuth({
|
|
3735
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
3736
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
3737
|
+
* });
|
|
3738
|
+
*
|
|
3739
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
3740
|
+
* const authClient = await auth.getClient();
|
|
3741
|
+
* google.options({auth: authClient});
|
|
3742
|
+
*
|
|
3743
|
+
* // Do the magic
|
|
3744
|
+
* const res = await tpu.projects.locations.queuedResources.create({
|
|
3745
|
+
* // Required. The parent resource name.
|
|
3746
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
3747
|
+
* // Optional. The unqualified resource name. Should follow the `^[A-Za-z0-9_.~+%-]+$` regex format.
|
|
3748
|
+
* queuedResourceId: 'placeholder-value',
|
|
3749
|
+
* // Optional. Idempotent request UUID.
|
|
3750
|
+
* requestId: 'placeholder-value',
|
|
3751
|
+
*
|
|
3752
|
+
* // Request body metadata
|
|
3753
|
+
* requestBody: {
|
|
3754
|
+
* // request body parameters
|
|
3755
|
+
* // {
|
|
3756
|
+
* // "createTime": "my_createTime",
|
|
3757
|
+
* // "guaranteed": {},
|
|
3758
|
+
* // "name": "my_name",
|
|
3759
|
+
* // "queueingPolicy": {},
|
|
3760
|
+
* // "reservationName": "my_reservationName",
|
|
3761
|
+
* // "spot": {},
|
|
3762
|
+
* // "state": {},
|
|
3763
|
+
* // "tpu": {}
|
|
3764
|
+
* // }
|
|
3765
|
+
* },
|
|
3766
|
+
* });
|
|
3767
|
+
* console.log(res.data);
|
|
3768
|
+
*
|
|
3769
|
+
* // Example response
|
|
3770
|
+
* // {
|
|
3771
|
+
* // "done": false,
|
|
3772
|
+
* // "error": {},
|
|
3773
|
+
* // "metadata": {},
|
|
3774
|
+
* // "name": "my_name",
|
|
3775
|
+
* // "response": {}
|
|
3776
|
+
* // }
|
|
3777
|
+
* }
|
|
3778
|
+
*
|
|
3779
|
+
* main().catch(e => {
|
|
3780
|
+
* console.error(e);
|
|
3781
|
+
* throw e;
|
|
3782
|
+
* });
|
|
3783
|
+
*
|
|
3784
|
+
* ```
|
|
2754
3785
|
*
|
|
2755
3786
|
* @param params - Parameters for request
|
|
2756
3787
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2843,6 +3874,60 @@ export namespace tpu_v2 {
|
|
|
2843
3874
|
|
|
2844
3875
|
/**
|
|
2845
3876
|
* Deletes a QueuedResource TPU instance.
|
|
3877
|
+
* @example
|
|
3878
|
+
* ```js
|
|
3879
|
+
* // Before running the sample:
|
|
3880
|
+
* // - Enable the API at:
|
|
3881
|
+
* // https://console.developers.google.com/apis/api/tpu.googleapis.com
|
|
3882
|
+
* // - Login into gcloud by running:
|
|
3883
|
+
* // ```sh
|
|
3884
|
+
* // $ gcloud auth application-default login
|
|
3885
|
+
* // ```
|
|
3886
|
+
* // - Install the npm module by running:
|
|
3887
|
+
* // ```sh
|
|
3888
|
+
* // $ npm install googleapis
|
|
3889
|
+
* // ```
|
|
3890
|
+
*
|
|
3891
|
+
* const {google} = require('googleapis');
|
|
3892
|
+
* const tpu = google.tpu('v2');
|
|
3893
|
+
*
|
|
3894
|
+
* async function main() {
|
|
3895
|
+
* const auth = new google.auth.GoogleAuth({
|
|
3896
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
3897
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
3898
|
+
* });
|
|
3899
|
+
*
|
|
3900
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
3901
|
+
* const authClient = await auth.getClient();
|
|
3902
|
+
* google.options({auth: authClient});
|
|
3903
|
+
*
|
|
3904
|
+
* // Do the magic
|
|
3905
|
+
* const res = await tpu.projects.locations.queuedResources.delete({
|
|
3906
|
+
* // Optional. 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.
|
|
3907
|
+
* force: 'placeholder-value',
|
|
3908
|
+
* // Required. The resource name.
|
|
3909
|
+
* name: 'projects/my-project/locations/my-location/queuedResources/my-queuedResource',
|
|
3910
|
+
* // Optional. Idempotent request UUID.
|
|
3911
|
+
* requestId: 'placeholder-value',
|
|
3912
|
+
* });
|
|
3913
|
+
* console.log(res.data);
|
|
3914
|
+
*
|
|
3915
|
+
* // Example response
|
|
3916
|
+
* // {
|
|
3917
|
+
* // "done": false,
|
|
3918
|
+
* // "error": {},
|
|
3919
|
+
* // "metadata": {},
|
|
3920
|
+
* // "name": "my_name",
|
|
3921
|
+
* // "response": {}
|
|
3922
|
+
* // }
|
|
3923
|
+
* }
|
|
3924
|
+
*
|
|
3925
|
+
* main().catch(e => {
|
|
3926
|
+
* console.error(e);
|
|
3927
|
+
* throw e;
|
|
3928
|
+
* });
|
|
3929
|
+
*
|
|
3930
|
+
* ```
|
|
2846
3931
|
*
|
|
2847
3932
|
* @param params - Parameters for request
|
|
2848
3933
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2932,6 +4017,59 @@ export namespace tpu_v2 {
|
|
|
2932
4017
|
|
|
2933
4018
|
/**
|
|
2934
4019
|
* Gets details of a queued resource.
|
|
4020
|
+
* @example
|
|
4021
|
+
* ```js
|
|
4022
|
+
* // Before running the sample:
|
|
4023
|
+
* // - Enable the API at:
|
|
4024
|
+
* // https://console.developers.google.com/apis/api/tpu.googleapis.com
|
|
4025
|
+
* // - Login into gcloud by running:
|
|
4026
|
+
* // ```sh
|
|
4027
|
+
* // $ gcloud auth application-default login
|
|
4028
|
+
* // ```
|
|
4029
|
+
* // - Install the npm module by running:
|
|
4030
|
+
* // ```sh
|
|
4031
|
+
* // $ npm install googleapis
|
|
4032
|
+
* // ```
|
|
4033
|
+
*
|
|
4034
|
+
* const {google} = require('googleapis');
|
|
4035
|
+
* const tpu = google.tpu('v2');
|
|
4036
|
+
*
|
|
4037
|
+
* async function main() {
|
|
4038
|
+
* const auth = new google.auth.GoogleAuth({
|
|
4039
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
4040
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
4041
|
+
* });
|
|
4042
|
+
*
|
|
4043
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
4044
|
+
* const authClient = await auth.getClient();
|
|
4045
|
+
* google.options({auth: authClient});
|
|
4046
|
+
*
|
|
4047
|
+
* // Do the magic
|
|
4048
|
+
* const res = await tpu.projects.locations.queuedResources.get({
|
|
4049
|
+
* // Required. The resource name.
|
|
4050
|
+
* name: 'projects/my-project/locations/my-location/queuedResources/my-queuedResource',
|
|
4051
|
+
* });
|
|
4052
|
+
* console.log(res.data);
|
|
4053
|
+
*
|
|
4054
|
+
* // Example response
|
|
4055
|
+
* // {
|
|
4056
|
+
* // "createTime": "my_createTime",
|
|
4057
|
+
* // "guaranteed": {},
|
|
4058
|
+
* // "name": "my_name",
|
|
4059
|
+
* // "queueingPolicy": {},
|
|
4060
|
+
* // "reservationName": "my_reservationName",
|
|
4061
|
+
* // "spot": {},
|
|
4062
|
+
* // "state": {},
|
|
4063
|
+
* // "tpu": {}
|
|
4064
|
+
* // }
|
|
4065
|
+
* }
|
|
4066
|
+
*
|
|
4067
|
+
* main().catch(e => {
|
|
4068
|
+
* console.error(e);
|
|
4069
|
+
* throw e;
|
|
4070
|
+
* });
|
|
4071
|
+
*
|
|
4072
|
+
* ```
|
|
2935
4073
|
*
|
|
2936
4074
|
* @param params - Parameters for request
|
|
2937
4075
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -3020,6 +4158,58 @@ export namespace tpu_v2 {
|
|
|
3020
4158
|
|
|
3021
4159
|
/**
|
|
3022
4160
|
* Lists queued resources.
|
|
4161
|
+
* @example
|
|
4162
|
+
* ```js
|
|
4163
|
+
* // Before running the sample:
|
|
4164
|
+
* // - Enable the API at:
|
|
4165
|
+
* // https://console.developers.google.com/apis/api/tpu.googleapis.com
|
|
4166
|
+
* // - Login into gcloud by running:
|
|
4167
|
+
* // ```sh
|
|
4168
|
+
* // $ gcloud auth application-default login
|
|
4169
|
+
* // ```
|
|
4170
|
+
* // - Install the npm module by running:
|
|
4171
|
+
* // ```sh
|
|
4172
|
+
* // $ npm install googleapis
|
|
4173
|
+
* // ```
|
|
4174
|
+
*
|
|
4175
|
+
* const {google} = require('googleapis');
|
|
4176
|
+
* const tpu = google.tpu('v2');
|
|
4177
|
+
*
|
|
4178
|
+
* async function main() {
|
|
4179
|
+
* const auth = new google.auth.GoogleAuth({
|
|
4180
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
4181
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
4182
|
+
* });
|
|
4183
|
+
*
|
|
4184
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
4185
|
+
* const authClient = await auth.getClient();
|
|
4186
|
+
* google.options({auth: authClient});
|
|
4187
|
+
*
|
|
4188
|
+
* // Do the magic
|
|
4189
|
+
* const res = await tpu.projects.locations.queuedResources.list({
|
|
4190
|
+
* // Optional. The maximum number of items to return.
|
|
4191
|
+
* pageSize: 'placeholder-value',
|
|
4192
|
+
* // Optional. The next_page_token value returned from a previous List request, if any.
|
|
4193
|
+
* pageToken: 'placeholder-value',
|
|
4194
|
+
* // Required. The parent resource name.
|
|
4195
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
4196
|
+
* });
|
|
4197
|
+
* console.log(res.data);
|
|
4198
|
+
*
|
|
4199
|
+
* // Example response
|
|
4200
|
+
* // {
|
|
4201
|
+
* // "nextPageToken": "my_nextPageToken",
|
|
4202
|
+
* // "queuedResources": [],
|
|
4203
|
+
* // "unreachable": []
|
|
4204
|
+
* // }
|
|
4205
|
+
* }
|
|
4206
|
+
*
|
|
4207
|
+
* main().catch(e => {
|
|
4208
|
+
* console.error(e);
|
|
4209
|
+
* throw e;
|
|
4210
|
+
* });
|
|
4211
|
+
*
|
|
4212
|
+
* ```
|
|
3023
4213
|
*
|
|
3024
4214
|
* @param params - Parameters for request
|
|
3025
4215
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -3115,6 +4305,62 @@ export namespace tpu_v2 {
|
|
|
3115
4305
|
|
|
3116
4306
|
/**
|
|
3117
4307
|
* Resets a QueuedResource TPU instance
|
|
4308
|
+
* @example
|
|
4309
|
+
* ```js
|
|
4310
|
+
* // Before running the sample:
|
|
4311
|
+
* // - Enable the API at:
|
|
4312
|
+
* // https://console.developers.google.com/apis/api/tpu.googleapis.com
|
|
4313
|
+
* // - Login into gcloud by running:
|
|
4314
|
+
* // ```sh
|
|
4315
|
+
* // $ gcloud auth application-default login
|
|
4316
|
+
* // ```
|
|
4317
|
+
* // - Install the npm module by running:
|
|
4318
|
+
* // ```sh
|
|
4319
|
+
* // $ npm install googleapis
|
|
4320
|
+
* // ```
|
|
4321
|
+
*
|
|
4322
|
+
* const {google} = require('googleapis');
|
|
4323
|
+
* const tpu = google.tpu('v2');
|
|
4324
|
+
*
|
|
4325
|
+
* async function main() {
|
|
4326
|
+
* const auth = new google.auth.GoogleAuth({
|
|
4327
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
4328
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
4329
|
+
* });
|
|
4330
|
+
*
|
|
4331
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
4332
|
+
* const authClient = await auth.getClient();
|
|
4333
|
+
* google.options({auth: authClient});
|
|
4334
|
+
*
|
|
4335
|
+
* // Do the magic
|
|
4336
|
+
* const res = await tpu.projects.locations.queuedResources.reset({
|
|
4337
|
+
* // Required. The name of the queued resource.
|
|
4338
|
+
* name: 'projects/my-project/locations/my-location/queuedResources/my-queuedResource',
|
|
4339
|
+
*
|
|
4340
|
+
* // Request body metadata
|
|
4341
|
+
* requestBody: {
|
|
4342
|
+
* // request body parameters
|
|
4343
|
+
* // {}
|
|
4344
|
+
* },
|
|
4345
|
+
* });
|
|
4346
|
+
* console.log(res.data);
|
|
4347
|
+
*
|
|
4348
|
+
* // Example response
|
|
4349
|
+
* // {
|
|
4350
|
+
* // "done": false,
|
|
4351
|
+
* // "error": {},
|
|
4352
|
+
* // "metadata": {},
|
|
4353
|
+
* // "name": "my_name",
|
|
4354
|
+
* // "response": {}
|
|
4355
|
+
* // }
|
|
4356
|
+
* }
|
|
4357
|
+
*
|
|
4358
|
+
* main().catch(e => {
|
|
4359
|
+
* console.error(e);
|
|
4360
|
+
* throw e;
|
|
4361
|
+
* });
|
|
4362
|
+
*
|
|
4363
|
+
* ```
|
|
3118
4364
|
*
|
|
3119
4365
|
* @param params - Parameters for request
|
|
3120
4366
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -3280,6 +4526,53 @@ export namespace tpu_v2 {
|
|
|
3280
4526
|
|
|
3281
4527
|
/**
|
|
3282
4528
|
* Gets a runtime version.
|
|
4529
|
+
* @example
|
|
4530
|
+
* ```js
|
|
4531
|
+
* // Before running the sample:
|
|
4532
|
+
* // - Enable the API at:
|
|
4533
|
+
* // https://console.developers.google.com/apis/api/tpu.googleapis.com
|
|
4534
|
+
* // - Login into gcloud by running:
|
|
4535
|
+
* // ```sh
|
|
4536
|
+
* // $ gcloud auth application-default login
|
|
4537
|
+
* // ```
|
|
4538
|
+
* // - Install the npm module by running:
|
|
4539
|
+
* // ```sh
|
|
4540
|
+
* // $ npm install googleapis
|
|
4541
|
+
* // ```
|
|
4542
|
+
*
|
|
4543
|
+
* const {google} = require('googleapis');
|
|
4544
|
+
* const tpu = google.tpu('v2');
|
|
4545
|
+
*
|
|
4546
|
+
* async function main() {
|
|
4547
|
+
* const auth = new google.auth.GoogleAuth({
|
|
4548
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
4549
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
4550
|
+
* });
|
|
4551
|
+
*
|
|
4552
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
4553
|
+
* const authClient = await auth.getClient();
|
|
4554
|
+
* google.options({auth: authClient});
|
|
4555
|
+
*
|
|
4556
|
+
* // Do the magic
|
|
4557
|
+
* const res = await tpu.projects.locations.runtimeVersions.get({
|
|
4558
|
+
* // Required. The resource name.
|
|
4559
|
+
* name: 'projects/my-project/locations/my-location/runtimeVersions/my-runtimeVersion',
|
|
4560
|
+
* });
|
|
4561
|
+
* console.log(res.data);
|
|
4562
|
+
*
|
|
4563
|
+
* // Example response
|
|
4564
|
+
* // {
|
|
4565
|
+
* // "name": "my_name",
|
|
4566
|
+
* // "version": "my_version"
|
|
4567
|
+
* // }
|
|
4568
|
+
* }
|
|
4569
|
+
*
|
|
4570
|
+
* main().catch(e => {
|
|
4571
|
+
* console.error(e);
|
|
4572
|
+
* throw e;
|
|
4573
|
+
* });
|
|
4574
|
+
*
|
|
4575
|
+
* ```
|
|
3283
4576
|
*
|
|
3284
4577
|
* @param params - Parameters for request
|
|
3285
4578
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -3368,6 +4661,62 @@ export namespace tpu_v2 {
|
|
|
3368
4661
|
|
|
3369
4662
|
/**
|
|
3370
4663
|
* Lists runtime versions supported by this API.
|
|
4664
|
+
* @example
|
|
4665
|
+
* ```js
|
|
4666
|
+
* // Before running the sample:
|
|
4667
|
+
* // - Enable the API at:
|
|
4668
|
+
* // https://console.developers.google.com/apis/api/tpu.googleapis.com
|
|
4669
|
+
* // - Login into gcloud by running:
|
|
4670
|
+
* // ```sh
|
|
4671
|
+
* // $ gcloud auth application-default login
|
|
4672
|
+
* // ```
|
|
4673
|
+
* // - Install the npm module by running:
|
|
4674
|
+
* // ```sh
|
|
4675
|
+
* // $ npm install googleapis
|
|
4676
|
+
* // ```
|
|
4677
|
+
*
|
|
4678
|
+
* const {google} = require('googleapis');
|
|
4679
|
+
* const tpu = google.tpu('v2');
|
|
4680
|
+
*
|
|
4681
|
+
* async function main() {
|
|
4682
|
+
* const auth = new google.auth.GoogleAuth({
|
|
4683
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
4684
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
4685
|
+
* });
|
|
4686
|
+
*
|
|
4687
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
4688
|
+
* const authClient = await auth.getClient();
|
|
4689
|
+
* google.options({auth: authClient});
|
|
4690
|
+
*
|
|
4691
|
+
* // Do the magic
|
|
4692
|
+
* const res = await tpu.projects.locations.runtimeVersions.list({
|
|
4693
|
+
* // List filter.
|
|
4694
|
+
* filter: 'placeholder-value',
|
|
4695
|
+
* // Sort results.
|
|
4696
|
+
* orderBy: 'placeholder-value',
|
|
4697
|
+
* // The maximum number of items to return.
|
|
4698
|
+
* pageSize: 'placeholder-value',
|
|
4699
|
+
* // The next_page_token value returned from a previous List request, if any.
|
|
4700
|
+
* pageToken: 'placeholder-value',
|
|
4701
|
+
* // Required. The parent resource name.
|
|
4702
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
4703
|
+
* });
|
|
4704
|
+
* console.log(res.data);
|
|
4705
|
+
*
|
|
4706
|
+
* // Example response
|
|
4707
|
+
* // {
|
|
4708
|
+
* // "nextPageToken": "my_nextPageToken",
|
|
4709
|
+
* // "runtimeVersions": [],
|
|
4710
|
+
* // "unreachable": []
|
|
4711
|
+
* // }
|
|
4712
|
+
* }
|
|
4713
|
+
*
|
|
4714
|
+
* main().catch(e => {
|
|
4715
|
+
* console.error(e);
|
|
4716
|
+
* throw e;
|
|
4717
|
+
* });
|
|
4718
|
+
*
|
|
4719
|
+
* ```
|
|
3371
4720
|
*
|
|
3372
4721
|
* @param params - Parameters for request
|
|
3373
4722
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|