@googleapis/tpu 6.0.1 → 7.1.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 +30 -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 +1595 -0
- 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 +1595 -0
package/v1.ts
CHANGED
|
@@ -507,6 +507,56 @@ export namespace tpu_v1 {
|
|
|
507
507
|
|
|
508
508
|
/**
|
|
509
509
|
* Gets information about a location.
|
|
510
|
+
* @example
|
|
511
|
+
* ```js
|
|
512
|
+
* // Before running the sample:
|
|
513
|
+
* // - Enable the API at:
|
|
514
|
+
* // https://console.developers.google.com/apis/api/tpu.googleapis.com
|
|
515
|
+
* // - Login into gcloud by running:
|
|
516
|
+
* // ```sh
|
|
517
|
+
* // $ gcloud auth application-default login
|
|
518
|
+
* // ```
|
|
519
|
+
* // - Install the npm module by running:
|
|
520
|
+
* // ```sh
|
|
521
|
+
* // $ npm install googleapis
|
|
522
|
+
* // ```
|
|
523
|
+
*
|
|
524
|
+
* const {google} = require('googleapis');
|
|
525
|
+
* const tpu = google.tpu('v1');
|
|
526
|
+
*
|
|
527
|
+
* async function main() {
|
|
528
|
+
* const auth = new google.auth.GoogleAuth({
|
|
529
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
530
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
531
|
+
* });
|
|
532
|
+
*
|
|
533
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
534
|
+
* const authClient = await auth.getClient();
|
|
535
|
+
* google.options({auth: authClient});
|
|
536
|
+
*
|
|
537
|
+
* // Do the magic
|
|
538
|
+
* const res = await tpu.projects.locations.get({
|
|
539
|
+
* // Resource name for the location.
|
|
540
|
+
* name: 'projects/my-project/locations/my-location',
|
|
541
|
+
* });
|
|
542
|
+
* console.log(res.data);
|
|
543
|
+
*
|
|
544
|
+
* // Example response
|
|
545
|
+
* // {
|
|
546
|
+
* // "displayName": "my_displayName",
|
|
547
|
+
* // "labels": {},
|
|
548
|
+
* // "locationId": "my_locationId",
|
|
549
|
+
* // "metadata": {},
|
|
550
|
+
* // "name": "my_name"
|
|
551
|
+
* // }
|
|
552
|
+
* }
|
|
553
|
+
*
|
|
554
|
+
* main().catch(e => {
|
|
555
|
+
* console.error(e);
|
|
556
|
+
* throw e;
|
|
557
|
+
* });
|
|
558
|
+
*
|
|
559
|
+
* ```
|
|
510
560
|
*
|
|
511
561
|
* @param params - Parameters for request
|
|
512
562
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -595,6 +645,61 @@ export namespace tpu_v1 {
|
|
|
595
645
|
|
|
596
646
|
/**
|
|
597
647
|
* Lists information about the supported locations for this service.
|
|
648
|
+
* @example
|
|
649
|
+
* ```js
|
|
650
|
+
* // Before running the sample:
|
|
651
|
+
* // - Enable the API at:
|
|
652
|
+
* // https://console.developers.google.com/apis/api/tpu.googleapis.com
|
|
653
|
+
* // - Login into gcloud by running:
|
|
654
|
+
* // ```sh
|
|
655
|
+
* // $ gcloud auth application-default login
|
|
656
|
+
* // ```
|
|
657
|
+
* // - Install the npm module by running:
|
|
658
|
+
* // ```sh
|
|
659
|
+
* // $ npm install googleapis
|
|
660
|
+
* // ```
|
|
661
|
+
*
|
|
662
|
+
* const {google} = require('googleapis');
|
|
663
|
+
* const tpu = google.tpu('v1');
|
|
664
|
+
*
|
|
665
|
+
* async function main() {
|
|
666
|
+
* const auth = new google.auth.GoogleAuth({
|
|
667
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
668
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
669
|
+
* });
|
|
670
|
+
*
|
|
671
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
672
|
+
* const authClient = await auth.getClient();
|
|
673
|
+
* google.options({auth: authClient});
|
|
674
|
+
*
|
|
675
|
+
* // Do the magic
|
|
676
|
+
* const res = await tpu.projects.locations.list({
|
|
677
|
+
* // Optional. A list of extra location types that should be used as conditions for controlling the visibility of the locations.
|
|
678
|
+
* extraLocationTypes: 'placeholder-value',
|
|
679
|
+
* // 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).
|
|
680
|
+
* filter: 'placeholder-value',
|
|
681
|
+
* // The resource that owns the locations collection, if applicable.
|
|
682
|
+
* name: 'projects/my-project',
|
|
683
|
+
* // The maximum number of results to return. If not set, the service selects a default.
|
|
684
|
+
* pageSize: 'placeholder-value',
|
|
685
|
+
* // A page token received from the `next_page_token` field in the response. Send that page token to receive the subsequent page.
|
|
686
|
+
* pageToken: 'placeholder-value',
|
|
687
|
+
* });
|
|
688
|
+
* console.log(res.data);
|
|
689
|
+
*
|
|
690
|
+
* // Example response
|
|
691
|
+
* // {
|
|
692
|
+
* // "locations": [],
|
|
693
|
+
* // "nextPageToken": "my_nextPageToken"
|
|
694
|
+
* // }
|
|
695
|
+
* }
|
|
696
|
+
*
|
|
697
|
+
* main().catch(e => {
|
|
698
|
+
* console.error(e);
|
|
699
|
+
* throw e;
|
|
700
|
+
* });
|
|
701
|
+
*
|
|
702
|
+
* ```
|
|
598
703
|
*
|
|
599
704
|
* @param params - Parameters for request
|
|
600
705
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -726,6 +831,53 @@ export namespace tpu_v1 {
|
|
|
726
831
|
|
|
727
832
|
/**
|
|
728
833
|
* Gets AcceleratorType.
|
|
834
|
+
* @example
|
|
835
|
+
* ```js
|
|
836
|
+
* // Before running the sample:
|
|
837
|
+
* // - Enable the API at:
|
|
838
|
+
* // https://console.developers.google.com/apis/api/tpu.googleapis.com
|
|
839
|
+
* // - Login into gcloud by running:
|
|
840
|
+
* // ```sh
|
|
841
|
+
* // $ gcloud auth application-default login
|
|
842
|
+
* // ```
|
|
843
|
+
* // - Install the npm module by running:
|
|
844
|
+
* // ```sh
|
|
845
|
+
* // $ npm install googleapis
|
|
846
|
+
* // ```
|
|
847
|
+
*
|
|
848
|
+
* const {google} = require('googleapis');
|
|
849
|
+
* const tpu = google.tpu('v1');
|
|
850
|
+
*
|
|
851
|
+
* async function main() {
|
|
852
|
+
* const auth = new google.auth.GoogleAuth({
|
|
853
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
854
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
855
|
+
* });
|
|
856
|
+
*
|
|
857
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
858
|
+
* const authClient = await auth.getClient();
|
|
859
|
+
* google.options({auth: authClient});
|
|
860
|
+
*
|
|
861
|
+
* // Do the magic
|
|
862
|
+
* const res = await tpu.projects.locations.acceleratorTypes.get({
|
|
863
|
+
* // Required. The resource name.
|
|
864
|
+
* name: 'projects/my-project/locations/my-location/acceleratorTypes/my-acceleratorType',
|
|
865
|
+
* });
|
|
866
|
+
* console.log(res.data);
|
|
867
|
+
*
|
|
868
|
+
* // Example response
|
|
869
|
+
* // {
|
|
870
|
+
* // "name": "my_name",
|
|
871
|
+
* // "type": "my_type"
|
|
872
|
+
* // }
|
|
873
|
+
* }
|
|
874
|
+
*
|
|
875
|
+
* main().catch(e => {
|
|
876
|
+
* console.error(e);
|
|
877
|
+
* throw e;
|
|
878
|
+
* });
|
|
879
|
+
*
|
|
880
|
+
* ```
|
|
729
881
|
*
|
|
730
882
|
* @param params - Parameters for request
|
|
731
883
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -814,6 +966,62 @@ export namespace tpu_v1 {
|
|
|
814
966
|
|
|
815
967
|
/**
|
|
816
968
|
* Lists accelerator types supported by this API.
|
|
969
|
+
* @example
|
|
970
|
+
* ```js
|
|
971
|
+
* // Before running the sample:
|
|
972
|
+
* // - Enable the API at:
|
|
973
|
+
* // https://console.developers.google.com/apis/api/tpu.googleapis.com
|
|
974
|
+
* // - Login into gcloud by running:
|
|
975
|
+
* // ```sh
|
|
976
|
+
* // $ gcloud auth application-default login
|
|
977
|
+
* // ```
|
|
978
|
+
* // - Install the npm module by running:
|
|
979
|
+
* // ```sh
|
|
980
|
+
* // $ npm install googleapis
|
|
981
|
+
* // ```
|
|
982
|
+
*
|
|
983
|
+
* const {google} = require('googleapis');
|
|
984
|
+
* const tpu = google.tpu('v1');
|
|
985
|
+
*
|
|
986
|
+
* async function main() {
|
|
987
|
+
* const auth = new google.auth.GoogleAuth({
|
|
988
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
989
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
990
|
+
* });
|
|
991
|
+
*
|
|
992
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
993
|
+
* const authClient = await auth.getClient();
|
|
994
|
+
* google.options({auth: authClient});
|
|
995
|
+
*
|
|
996
|
+
* // Do the magic
|
|
997
|
+
* const res = await tpu.projects.locations.acceleratorTypes.list({
|
|
998
|
+
* // List filter.
|
|
999
|
+
* filter: 'placeholder-value',
|
|
1000
|
+
* // Sort results.
|
|
1001
|
+
* orderBy: 'placeholder-value',
|
|
1002
|
+
* // The maximum number of items to return.
|
|
1003
|
+
* pageSize: 'placeholder-value',
|
|
1004
|
+
* // The next_page_token value returned from a previous List request, if any.
|
|
1005
|
+
* pageToken: 'placeholder-value',
|
|
1006
|
+
* // Required. The parent resource name.
|
|
1007
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
1008
|
+
* });
|
|
1009
|
+
* console.log(res.data);
|
|
1010
|
+
*
|
|
1011
|
+
* // Example response
|
|
1012
|
+
* // {
|
|
1013
|
+
* // "acceleratorTypes": [],
|
|
1014
|
+
* // "nextPageToken": "my_nextPageToken",
|
|
1015
|
+
* // "unreachable": []
|
|
1016
|
+
* // }
|
|
1017
|
+
* }
|
|
1018
|
+
*
|
|
1019
|
+
* main().catch(e => {
|
|
1020
|
+
* console.error(e);
|
|
1021
|
+
* throw e;
|
|
1022
|
+
* });
|
|
1023
|
+
*
|
|
1024
|
+
* ```
|
|
817
1025
|
*
|
|
818
1026
|
* @param params - Parameters for request
|
|
819
1027
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -949,6 +1157,84 @@ export namespace tpu_v1 {
|
|
|
949
1157
|
|
|
950
1158
|
/**
|
|
951
1159
|
* Creates a node.
|
|
1160
|
+
* @example
|
|
1161
|
+
* ```js
|
|
1162
|
+
* // Before running the sample:
|
|
1163
|
+
* // - Enable the API at:
|
|
1164
|
+
* // https://console.developers.google.com/apis/api/tpu.googleapis.com
|
|
1165
|
+
* // - Login into gcloud by running:
|
|
1166
|
+
* // ```sh
|
|
1167
|
+
* // $ gcloud auth application-default login
|
|
1168
|
+
* // ```
|
|
1169
|
+
* // - Install the npm module by running:
|
|
1170
|
+
* // ```sh
|
|
1171
|
+
* // $ npm install googleapis
|
|
1172
|
+
* // ```
|
|
1173
|
+
*
|
|
1174
|
+
* const {google} = require('googleapis');
|
|
1175
|
+
* const tpu = google.tpu('v1');
|
|
1176
|
+
*
|
|
1177
|
+
* async function main() {
|
|
1178
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1179
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1180
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
1181
|
+
* });
|
|
1182
|
+
*
|
|
1183
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1184
|
+
* const authClient = await auth.getClient();
|
|
1185
|
+
* google.options({auth: authClient});
|
|
1186
|
+
*
|
|
1187
|
+
* // Do the magic
|
|
1188
|
+
* const res = await tpu.projects.locations.nodes.create({
|
|
1189
|
+
* // The unqualified resource name.
|
|
1190
|
+
* nodeId: 'placeholder-value',
|
|
1191
|
+
* // Required. The parent resource name.
|
|
1192
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
1193
|
+
*
|
|
1194
|
+
* // Request body metadata
|
|
1195
|
+
* requestBody: {
|
|
1196
|
+
* // request body parameters
|
|
1197
|
+
* // {
|
|
1198
|
+
* // "acceleratorType": "my_acceleratorType",
|
|
1199
|
+
* // "apiVersion": "my_apiVersion",
|
|
1200
|
+
* // "cidrBlock": "my_cidrBlock",
|
|
1201
|
+
* // "createTime": "my_createTime",
|
|
1202
|
+
* // "description": "my_description",
|
|
1203
|
+
* // "health": "my_health",
|
|
1204
|
+
* // "healthDescription": "my_healthDescription",
|
|
1205
|
+
* // "ipAddress": "my_ipAddress",
|
|
1206
|
+
* // "labels": {},
|
|
1207
|
+
* // "name": "my_name",
|
|
1208
|
+
* // "network": "my_network",
|
|
1209
|
+
* // "networkEndpoints": [],
|
|
1210
|
+
* // "port": "my_port",
|
|
1211
|
+
* // "schedulingConfig": {},
|
|
1212
|
+
* // "serviceAccount": "my_serviceAccount",
|
|
1213
|
+
* // "state": "my_state",
|
|
1214
|
+
* // "symptoms": [],
|
|
1215
|
+
* // "tensorflowVersion": "my_tensorflowVersion",
|
|
1216
|
+
* // "useServiceNetworking": false
|
|
1217
|
+
* // }
|
|
1218
|
+
* },
|
|
1219
|
+
* });
|
|
1220
|
+
* console.log(res.data);
|
|
1221
|
+
*
|
|
1222
|
+
* // Example response
|
|
1223
|
+
* // {
|
|
1224
|
+
* // "done": false,
|
|
1225
|
+
* // "error": {},
|
|
1226
|
+
* // "metadata": {},
|
|
1227
|
+
* // "name": "my_name",
|
|
1228
|
+
* // "response": {}
|
|
1229
|
+
* // }
|
|
1230
|
+
* }
|
|
1231
|
+
*
|
|
1232
|
+
* main().catch(e => {
|
|
1233
|
+
* console.error(e);
|
|
1234
|
+
* throw e;
|
|
1235
|
+
* });
|
|
1236
|
+
*
|
|
1237
|
+
* ```
|
|
952
1238
|
*
|
|
953
1239
|
* @param params - Parameters for request
|
|
954
1240
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1040,6 +1326,56 @@ export namespace tpu_v1 {
|
|
|
1040
1326
|
|
|
1041
1327
|
/**
|
|
1042
1328
|
* Deletes a node.
|
|
1329
|
+
* @example
|
|
1330
|
+
* ```js
|
|
1331
|
+
* // Before running the sample:
|
|
1332
|
+
* // - Enable the API at:
|
|
1333
|
+
* // https://console.developers.google.com/apis/api/tpu.googleapis.com
|
|
1334
|
+
* // - Login into gcloud by running:
|
|
1335
|
+
* // ```sh
|
|
1336
|
+
* // $ gcloud auth application-default login
|
|
1337
|
+
* // ```
|
|
1338
|
+
* // - Install the npm module by running:
|
|
1339
|
+
* // ```sh
|
|
1340
|
+
* // $ npm install googleapis
|
|
1341
|
+
* // ```
|
|
1342
|
+
*
|
|
1343
|
+
* const {google} = require('googleapis');
|
|
1344
|
+
* const tpu = google.tpu('v1');
|
|
1345
|
+
*
|
|
1346
|
+
* async function main() {
|
|
1347
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1348
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1349
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
1350
|
+
* });
|
|
1351
|
+
*
|
|
1352
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1353
|
+
* const authClient = await auth.getClient();
|
|
1354
|
+
* google.options({auth: authClient});
|
|
1355
|
+
*
|
|
1356
|
+
* // Do the magic
|
|
1357
|
+
* const res = await tpu.projects.locations.nodes.delete({
|
|
1358
|
+
* // Required. The resource name.
|
|
1359
|
+
* name: 'projects/my-project/locations/my-location/nodes/my-node',
|
|
1360
|
+
* });
|
|
1361
|
+
* console.log(res.data);
|
|
1362
|
+
*
|
|
1363
|
+
* // Example response
|
|
1364
|
+
* // {
|
|
1365
|
+
* // "done": false,
|
|
1366
|
+
* // "error": {},
|
|
1367
|
+
* // "metadata": {},
|
|
1368
|
+
* // "name": "my_name",
|
|
1369
|
+
* // "response": {}
|
|
1370
|
+
* // }
|
|
1371
|
+
* }
|
|
1372
|
+
*
|
|
1373
|
+
* main().catch(e => {
|
|
1374
|
+
* console.error(e);
|
|
1375
|
+
* throw e;
|
|
1376
|
+
* });
|
|
1377
|
+
*
|
|
1378
|
+
* ```
|
|
1043
1379
|
*
|
|
1044
1380
|
* @param params - Parameters for request
|
|
1045
1381
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1128,6 +1464,70 @@ export namespace tpu_v1 {
|
|
|
1128
1464
|
|
|
1129
1465
|
/**
|
|
1130
1466
|
* Gets the details of a node.
|
|
1467
|
+
* @example
|
|
1468
|
+
* ```js
|
|
1469
|
+
* // Before running the sample:
|
|
1470
|
+
* // - Enable the API at:
|
|
1471
|
+
* // https://console.developers.google.com/apis/api/tpu.googleapis.com
|
|
1472
|
+
* // - Login into gcloud by running:
|
|
1473
|
+
* // ```sh
|
|
1474
|
+
* // $ gcloud auth application-default login
|
|
1475
|
+
* // ```
|
|
1476
|
+
* // - Install the npm module by running:
|
|
1477
|
+
* // ```sh
|
|
1478
|
+
* // $ npm install googleapis
|
|
1479
|
+
* // ```
|
|
1480
|
+
*
|
|
1481
|
+
* const {google} = require('googleapis');
|
|
1482
|
+
* const tpu = google.tpu('v1');
|
|
1483
|
+
*
|
|
1484
|
+
* async function main() {
|
|
1485
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1486
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1487
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
1488
|
+
* });
|
|
1489
|
+
*
|
|
1490
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1491
|
+
* const authClient = await auth.getClient();
|
|
1492
|
+
* google.options({auth: authClient});
|
|
1493
|
+
*
|
|
1494
|
+
* // Do the magic
|
|
1495
|
+
* const res = await tpu.projects.locations.nodes.get({
|
|
1496
|
+
* // Required. The resource name.
|
|
1497
|
+
* name: 'projects/my-project/locations/my-location/nodes/my-node',
|
|
1498
|
+
* });
|
|
1499
|
+
* console.log(res.data);
|
|
1500
|
+
*
|
|
1501
|
+
* // Example response
|
|
1502
|
+
* // {
|
|
1503
|
+
* // "acceleratorType": "my_acceleratorType",
|
|
1504
|
+
* // "apiVersion": "my_apiVersion",
|
|
1505
|
+
* // "cidrBlock": "my_cidrBlock",
|
|
1506
|
+
* // "createTime": "my_createTime",
|
|
1507
|
+
* // "description": "my_description",
|
|
1508
|
+
* // "health": "my_health",
|
|
1509
|
+
* // "healthDescription": "my_healthDescription",
|
|
1510
|
+
* // "ipAddress": "my_ipAddress",
|
|
1511
|
+
* // "labels": {},
|
|
1512
|
+
* // "name": "my_name",
|
|
1513
|
+
* // "network": "my_network",
|
|
1514
|
+
* // "networkEndpoints": [],
|
|
1515
|
+
* // "port": "my_port",
|
|
1516
|
+
* // "schedulingConfig": {},
|
|
1517
|
+
* // "serviceAccount": "my_serviceAccount",
|
|
1518
|
+
* // "state": "my_state",
|
|
1519
|
+
* // "symptoms": [],
|
|
1520
|
+
* // "tensorflowVersion": "my_tensorflowVersion",
|
|
1521
|
+
* // "useServiceNetworking": false
|
|
1522
|
+
* // }
|
|
1523
|
+
* }
|
|
1524
|
+
*
|
|
1525
|
+
* main().catch(e => {
|
|
1526
|
+
* console.error(e);
|
|
1527
|
+
* throw e;
|
|
1528
|
+
* });
|
|
1529
|
+
*
|
|
1530
|
+
* ```
|
|
1131
1531
|
*
|
|
1132
1532
|
* @param params - Parameters for request
|
|
1133
1533
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1216,6 +1616,58 @@ export namespace tpu_v1 {
|
|
|
1216
1616
|
|
|
1217
1617
|
/**
|
|
1218
1618
|
* Lists nodes.
|
|
1619
|
+
* @example
|
|
1620
|
+
* ```js
|
|
1621
|
+
* // Before running the sample:
|
|
1622
|
+
* // - Enable the API at:
|
|
1623
|
+
* // https://console.developers.google.com/apis/api/tpu.googleapis.com
|
|
1624
|
+
* // - Login into gcloud by running:
|
|
1625
|
+
* // ```sh
|
|
1626
|
+
* // $ gcloud auth application-default login
|
|
1627
|
+
* // ```
|
|
1628
|
+
* // - Install the npm module by running:
|
|
1629
|
+
* // ```sh
|
|
1630
|
+
* // $ npm install googleapis
|
|
1631
|
+
* // ```
|
|
1632
|
+
*
|
|
1633
|
+
* const {google} = require('googleapis');
|
|
1634
|
+
* const tpu = google.tpu('v1');
|
|
1635
|
+
*
|
|
1636
|
+
* async function main() {
|
|
1637
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1638
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1639
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
1640
|
+
* });
|
|
1641
|
+
*
|
|
1642
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1643
|
+
* const authClient = await auth.getClient();
|
|
1644
|
+
* google.options({auth: authClient});
|
|
1645
|
+
*
|
|
1646
|
+
* // Do the magic
|
|
1647
|
+
* const res = await tpu.projects.locations.nodes.list({
|
|
1648
|
+
* // The maximum number of items to return.
|
|
1649
|
+
* pageSize: 'placeholder-value',
|
|
1650
|
+
* // The next_page_token value returned from a previous List request, if any.
|
|
1651
|
+
* pageToken: 'placeholder-value',
|
|
1652
|
+
* // Required. The parent resource name.
|
|
1653
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
1654
|
+
* });
|
|
1655
|
+
* console.log(res.data);
|
|
1656
|
+
*
|
|
1657
|
+
* // Example response
|
|
1658
|
+
* // {
|
|
1659
|
+
* // "nextPageToken": "my_nextPageToken",
|
|
1660
|
+
* // "nodes": [],
|
|
1661
|
+
* // "unreachable": []
|
|
1662
|
+
* // }
|
|
1663
|
+
* }
|
|
1664
|
+
*
|
|
1665
|
+
* main().catch(e => {
|
|
1666
|
+
* console.error(e);
|
|
1667
|
+
* throw e;
|
|
1668
|
+
* });
|
|
1669
|
+
*
|
|
1670
|
+
* ```
|
|
1219
1671
|
*
|
|
1220
1672
|
* @param params - Parameters for request
|
|
1221
1673
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1307,6 +1759,64 @@ export namespace tpu_v1 {
|
|
|
1307
1759
|
|
|
1308
1760
|
/**
|
|
1309
1761
|
* Reimages a node's OS.
|
|
1762
|
+
* @example
|
|
1763
|
+
* ```js
|
|
1764
|
+
* // Before running the sample:
|
|
1765
|
+
* // - Enable the API at:
|
|
1766
|
+
* // https://console.developers.google.com/apis/api/tpu.googleapis.com
|
|
1767
|
+
* // - Login into gcloud by running:
|
|
1768
|
+
* // ```sh
|
|
1769
|
+
* // $ gcloud auth application-default login
|
|
1770
|
+
* // ```
|
|
1771
|
+
* // - Install the npm module by running:
|
|
1772
|
+
* // ```sh
|
|
1773
|
+
* // $ npm install googleapis
|
|
1774
|
+
* // ```
|
|
1775
|
+
*
|
|
1776
|
+
* const {google} = require('googleapis');
|
|
1777
|
+
* const tpu = google.tpu('v1');
|
|
1778
|
+
*
|
|
1779
|
+
* async function main() {
|
|
1780
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1781
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1782
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
1783
|
+
* });
|
|
1784
|
+
*
|
|
1785
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1786
|
+
* const authClient = await auth.getClient();
|
|
1787
|
+
* google.options({auth: authClient});
|
|
1788
|
+
*
|
|
1789
|
+
* // Do the magic
|
|
1790
|
+
* const res = await tpu.projects.locations.nodes.reimage({
|
|
1791
|
+
* // The resource name.
|
|
1792
|
+
* name: 'projects/my-project/locations/my-location/nodes/my-node',
|
|
1793
|
+
*
|
|
1794
|
+
* // Request body metadata
|
|
1795
|
+
* requestBody: {
|
|
1796
|
+
* // request body parameters
|
|
1797
|
+
* // {
|
|
1798
|
+
* // "tensorflowVersion": "my_tensorflowVersion"
|
|
1799
|
+
* // }
|
|
1800
|
+
* },
|
|
1801
|
+
* });
|
|
1802
|
+
* console.log(res.data);
|
|
1803
|
+
*
|
|
1804
|
+
* // Example response
|
|
1805
|
+
* // {
|
|
1806
|
+
* // "done": false,
|
|
1807
|
+
* // "error": {},
|
|
1808
|
+
* // "metadata": {},
|
|
1809
|
+
* // "name": "my_name",
|
|
1810
|
+
* // "response": {}
|
|
1811
|
+
* // }
|
|
1812
|
+
* }
|
|
1813
|
+
*
|
|
1814
|
+
* main().catch(e => {
|
|
1815
|
+
* console.error(e);
|
|
1816
|
+
* throw e;
|
|
1817
|
+
* });
|
|
1818
|
+
*
|
|
1819
|
+
* ```
|
|
1310
1820
|
*
|
|
1311
1821
|
* @param params - Parameters for request
|
|
1312
1822
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1398,6 +1908,62 @@ export namespace tpu_v1 {
|
|
|
1398
1908
|
|
|
1399
1909
|
/**
|
|
1400
1910
|
* Starts a node.
|
|
1911
|
+
* @example
|
|
1912
|
+
* ```js
|
|
1913
|
+
* // Before running the sample:
|
|
1914
|
+
* // - Enable the API at:
|
|
1915
|
+
* // https://console.developers.google.com/apis/api/tpu.googleapis.com
|
|
1916
|
+
* // - Login into gcloud by running:
|
|
1917
|
+
* // ```sh
|
|
1918
|
+
* // $ gcloud auth application-default login
|
|
1919
|
+
* // ```
|
|
1920
|
+
* // - Install the npm module by running:
|
|
1921
|
+
* // ```sh
|
|
1922
|
+
* // $ npm install googleapis
|
|
1923
|
+
* // ```
|
|
1924
|
+
*
|
|
1925
|
+
* const {google} = require('googleapis');
|
|
1926
|
+
* const tpu = google.tpu('v1');
|
|
1927
|
+
*
|
|
1928
|
+
* async function main() {
|
|
1929
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1930
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1931
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
1932
|
+
* });
|
|
1933
|
+
*
|
|
1934
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1935
|
+
* const authClient = await auth.getClient();
|
|
1936
|
+
* google.options({auth: authClient});
|
|
1937
|
+
*
|
|
1938
|
+
* // Do the magic
|
|
1939
|
+
* const res = await tpu.projects.locations.nodes.start({
|
|
1940
|
+
* // The resource name.
|
|
1941
|
+
* name: 'projects/my-project/locations/my-location/nodes/my-node',
|
|
1942
|
+
*
|
|
1943
|
+
* // Request body metadata
|
|
1944
|
+
* requestBody: {
|
|
1945
|
+
* // request body parameters
|
|
1946
|
+
* // {}
|
|
1947
|
+
* },
|
|
1948
|
+
* });
|
|
1949
|
+
* console.log(res.data);
|
|
1950
|
+
*
|
|
1951
|
+
* // Example response
|
|
1952
|
+
* // {
|
|
1953
|
+
* // "done": false,
|
|
1954
|
+
* // "error": {},
|
|
1955
|
+
* // "metadata": {},
|
|
1956
|
+
* // "name": "my_name",
|
|
1957
|
+
* // "response": {}
|
|
1958
|
+
* // }
|
|
1959
|
+
* }
|
|
1960
|
+
*
|
|
1961
|
+
* main().catch(e => {
|
|
1962
|
+
* console.error(e);
|
|
1963
|
+
* throw e;
|
|
1964
|
+
* });
|
|
1965
|
+
*
|
|
1966
|
+
* ```
|
|
1401
1967
|
*
|
|
1402
1968
|
* @param params - Parameters for request
|
|
1403
1969
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1486,6 +2052,62 @@ export namespace tpu_v1 {
|
|
|
1486
2052
|
|
|
1487
2053
|
/**
|
|
1488
2054
|
* Stops a node, this operation is only available with single TPU nodes.
|
|
2055
|
+
* @example
|
|
2056
|
+
* ```js
|
|
2057
|
+
* // Before running the sample:
|
|
2058
|
+
* // - Enable the API at:
|
|
2059
|
+
* // https://console.developers.google.com/apis/api/tpu.googleapis.com
|
|
2060
|
+
* // - Login into gcloud by running:
|
|
2061
|
+
* // ```sh
|
|
2062
|
+
* // $ gcloud auth application-default login
|
|
2063
|
+
* // ```
|
|
2064
|
+
* // - Install the npm module by running:
|
|
2065
|
+
* // ```sh
|
|
2066
|
+
* // $ npm install googleapis
|
|
2067
|
+
* // ```
|
|
2068
|
+
*
|
|
2069
|
+
* const {google} = require('googleapis');
|
|
2070
|
+
* const tpu = google.tpu('v1');
|
|
2071
|
+
*
|
|
2072
|
+
* async function main() {
|
|
2073
|
+
* const auth = new google.auth.GoogleAuth({
|
|
2074
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
2075
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
2076
|
+
* });
|
|
2077
|
+
*
|
|
2078
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2079
|
+
* const authClient = await auth.getClient();
|
|
2080
|
+
* google.options({auth: authClient});
|
|
2081
|
+
*
|
|
2082
|
+
* // Do the magic
|
|
2083
|
+
* const res = await tpu.projects.locations.nodes.stop({
|
|
2084
|
+
* // The resource name.
|
|
2085
|
+
* name: 'projects/my-project/locations/my-location/nodes/my-node',
|
|
2086
|
+
*
|
|
2087
|
+
* // Request body metadata
|
|
2088
|
+
* requestBody: {
|
|
2089
|
+
* // request body parameters
|
|
2090
|
+
* // {}
|
|
2091
|
+
* },
|
|
2092
|
+
* });
|
|
2093
|
+
* console.log(res.data);
|
|
2094
|
+
*
|
|
2095
|
+
* // Example response
|
|
2096
|
+
* // {
|
|
2097
|
+
* // "done": false,
|
|
2098
|
+
* // "error": {},
|
|
2099
|
+
* // "metadata": {},
|
|
2100
|
+
* // "name": "my_name",
|
|
2101
|
+
* // "response": {}
|
|
2102
|
+
* // }
|
|
2103
|
+
* }
|
|
2104
|
+
*
|
|
2105
|
+
* main().catch(e => {
|
|
2106
|
+
* console.error(e);
|
|
2107
|
+
* throw e;
|
|
2108
|
+
* });
|
|
2109
|
+
*
|
|
2110
|
+
* ```
|
|
1489
2111
|
*
|
|
1490
2112
|
* @param params - Parameters for request
|
|
1491
2113
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1663,6 +2285,50 @@ export namespace tpu_v1 {
|
|
|
1663
2285
|
|
|
1664
2286
|
/**
|
|
1665
2287
|
* 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`.
|
|
2288
|
+
* @example
|
|
2289
|
+
* ```js
|
|
2290
|
+
* // Before running the sample:
|
|
2291
|
+
* // - Enable the API at:
|
|
2292
|
+
* // https://console.developers.google.com/apis/api/tpu.googleapis.com
|
|
2293
|
+
* // - Login into gcloud by running:
|
|
2294
|
+
* // ```sh
|
|
2295
|
+
* // $ gcloud auth application-default login
|
|
2296
|
+
* // ```
|
|
2297
|
+
* // - Install the npm module by running:
|
|
2298
|
+
* // ```sh
|
|
2299
|
+
* // $ npm install googleapis
|
|
2300
|
+
* // ```
|
|
2301
|
+
*
|
|
2302
|
+
* const {google} = require('googleapis');
|
|
2303
|
+
* const tpu = google.tpu('v1');
|
|
2304
|
+
*
|
|
2305
|
+
* async function main() {
|
|
2306
|
+
* const auth = new google.auth.GoogleAuth({
|
|
2307
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
2308
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
2309
|
+
* });
|
|
2310
|
+
*
|
|
2311
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2312
|
+
* const authClient = await auth.getClient();
|
|
2313
|
+
* google.options({auth: authClient});
|
|
2314
|
+
*
|
|
2315
|
+
* // Do the magic
|
|
2316
|
+
* const res = await tpu.projects.locations.operations.cancel({
|
|
2317
|
+
* // The name of the operation resource to be cancelled.
|
|
2318
|
+
* name: 'projects/my-project/locations/my-location/operations/my-operation',
|
|
2319
|
+
* });
|
|
2320
|
+
* console.log(res.data);
|
|
2321
|
+
*
|
|
2322
|
+
* // Example response
|
|
2323
|
+
* // {}
|
|
2324
|
+
* }
|
|
2325
|
+
*
|
|
2326
|
+
* main().catch(e => {
|
|
2327
|
+
* console.error(e);
|
|
2328
|
+
* throw e;
|
|
2329
|
+
* });
|
|
2330
|
+
*
|
|
2331
|
+
* ```
|
|
1666
2332
|
*
|
|
1667
2333
|
* @param params - Parameters for request
|
|
1668
2334
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1751,6 +2417,50 @@ export namespace tpu_v1 {
|
|
|
1751
2417
|
|
|
1752
2418
|
/**
|
|
1753
2419
|
* 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`.
|
|
2420
|
+
* @example
|
|
2421
|
+
* ```js
|
|
2422
|
+
* // Before running the sample:
|
|
2423
|
+
* // - Enable the API at:
|
|
2424
|
+
* // https://console.developers.google.com/apis/api/tpu.googleapis.com
|
|
2425
|
+
* // - Login into gcloud by running:
|
|
2426
|
+
* // ```sh
|
|
2427
|
+
* // $ gcloud auth application-default login
|
|
2428
|
+
* // ```
|
|
2429
|
+
* // - Install the npm module by running:
|
|
2430
|
+
* // ```sh
|
|
2431
|
+
* // $ npm install googleapis
|
|
2432
|
+
* // ```
|
|
2433
|
+
*
|
|
2434
|
+
* const {google} = require('googleapis');
|
|
2435
|
+
* const tpu = google.tpu('v1');
|
|
2436
|
+
*
|
|
2437
|
+
* async function main() {
|
|
2438
|
+
* const auth = new google.auth.GoogleAuth({
|
|
2439
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
2440
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
2441
|
+
* });
|
|
2442
|
+
*
|
|
2443
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2444
|
+
* const authClient = await auth.getClient();
|
|
2445
|
+
* google.options({auth: authClient});
|
|
2446
|
+
*
|
|
2447
|
+
* // Do the magic
|
|
2448
|
+
* const res = await tpu.projects.locations.operations.delete({
|
|
2449
|
+
* // The name of the operation resource to be deleted.
|
|
2450
|
+
* name: 'projects/my-project/locations/my-location/operations/my-operation',
|
|
2451
|
+
* });
|
|
2452
|
+
* console.log(res.data);
|
|
2453
|
+
*
|
|
2454
|
+
* // Example response
|
|
2455
|
+
* // {}
|
|
2456
|
+
* }
|
|
2457
|
+
*
|
|
2458
|
+
* main().catch(e => {
|
|
2459
|
+
* console.error(e);
|
|
2460
|
+
* throw e;
|
|
2461
|
+
* });
|
|
2462
|
+
*
|
|
2463
|
+
* ```
|
|
1754
2464
|
*
|
|
1755
2465
|
* @param params - Parameters for request
|
|
1756
2466
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1839,6 +2549,56 @@ export namespace tpu_v1 {
|
|
|
1839
2549
|
|
|
1840
2550
|
/**
|
|
1841
2551
|
* 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.
|
|
2552
|
+
* @example
|
|
2553
|
+
* ```js
|
|
2554
|
+
* // Before running the sample:
|
|
2555
|
+
* // - Enable the API at:
|
|
2556
|
+
* // https://console.developers.google.com/apis/api/tpu.googleapis.com
|
|
2557
|
+
* // - Login into gcloud by running:
|
|
2558
|
+
* // ```sh
|
|
2559
|
+
* // $ gcloud auth application-default login
|
|
2560
|
+
* // ```
|
|
2561
|
+
* // - Install the npm module by running:
|
|
2562
|
+
* // ```sh
|
|
2563
|
+
* // $ npm install googleapis
|
|
2564
|
+
* // ```
|
|
2565
|
+
*
|
|
2566
|
+
* const {google} = require('googleapis');
|
|
2567
|
+
* const tpu = google.tpu('v1');
|
|
2568
|
+
*
|
|
2569
|
+
* async function main() {
|
|
2570
|
+
* const auth = new google.auth.GoogleAuth({
|
|
2571
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
2572
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
2573
|
+
* });
|
|
2574
|
+
*
|
|
2575
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2576
|
+
* const authClient = await auth.getClient();
|
|
2577
|
+
* google.options({auth: authClient});
|
|
2578
|
+
*
|
|
2579
|
+
* // Do the magic
|
|
2580
|
+
* const res = await tpu.projects.locations.operations.get({
|
|
2581
|
+
* // The name of the operation resource.
|
|
2582
|
+
* name: 'projects/my-project/locations/my-location/operations/my-operation',
|
|
2583
|
+
* });
|
|
2584
|
+
* console.log(res.data);
|
|
2585
|
+
*
|
|
2586
|
+
* // Example response
|
|
2587
|
+
* // {
|
|
2588
|
+
* // "done": false,
|
|
2589
|
+
* // "error": {},
|
|
2590
|
+
* // "metadata": {},
|
|
2591
|
+
* // "name": "my_name",
|
|
2592
|
+
* // "response": {}
|
|
2593
|
+
* // }
|
|
2594
|
+
* }
|
|
2595
|
+
*
|
|
2596
|
+
* main().catch(e => {
|
|
2597
|
+
* console.error(e);
|
|
2598
|
+
* throw e;
|
|
2599
|
+
* });
|
|
2600
|
+
*
|
|
2601
|
+
* ```
|
|
1842
2602
|
*
|
|
1843
2603
|
* @param params - Parameters for request
|
|
1844
2604
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1927,6 +2687,59 @@ export namespace tpu_v1 {
|
|
|
1927
2687
|
|
|
1928
2688
|
/**
|
|
1929
2689
|
* Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.
|
|
2690
|
+
* @example
|
|
2691
|
+
* ```js
|
|
2692
|
+
* // Before running the sample:
|
|
2693
|
+
* // - Enable the API at:
|
|
2694
|
+
* // https://console.developers.google.com/apis/api/tpu.googleapis.com
|
|
2695
|
+
* // - Login into gcloud by running:
|
|
2696
|
+
* // ```sh
|
|
2697
|
+
* // $ gcloud auth application-default login
|
|
2698
|
+
* // ```
|
|
2699
|
+
* // - Install the npm module by running:
|
|
2700
|
+
* // ```sh
|
|
2701
|
+
* // $ npm install googleapis
|
|
2702
|
+
* // ```
|
|
2703
|
+
*
|
|
2704
|
+
* const {google} = require('googleapis');
|
|
2705
|
+
* const tpu = google.tpu('v1');
|
|
2706
|
+
*
|
|
2707
|
+
* async function main() {
|
|
2708
|
+
* const auth = new google.auth.GoogleAuth({
|
|
2709
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
2710
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
2711
|
+
* });
|
|
2712
|
+
*
|
|
2713
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2714
|
+
* const authClient = await auth.getClient();
|
|
2715
|
+
* google.options({auth: authClient});
|
|
2716
|
+
*
|
|
2717
|
+
* // Do the magic
|
|
2718
|
+
* const res = await tpu.projects.locations.operations.list({
|
|
2719
|
+
* // The standard list filter.
|
|
2720
|
+
* filter: 'placeholder-value',
|
|
2721
|
+
* // The name of the operation's parent resource.
|
|
2722
|
+
* name: 'projects/my-project/locations/my-location',
|
|
2723
|
+
* // The standard list page size.
|
|
2724
|
+
* pageSize: 'placeholder-value',
|
|
2725
|
+
* // The standard list page token.
|
|
2726
|
+
* pageToken: 'placeholder-value',
|
|
2727
|
+
* });
|
|
2728
|
+
* console.log(res.data);
|
|
2729
|
+
*
|
|
2730
|
+
* // Example response
|
|
2731
|
+
* // {
|
|
2732
|
+
* // "nextPageToken": "my_nextPageToken",
|
|
2733
|
+
* // "operations": []
|
|
2734
|
+
* // }
|
|
2735
|
+
* }
|
|
2736
|
+
*
|
|
2737
|
+
* main().catch(e => {
|
|
2738
|
+
* console.error(e);
|
|
2739
|
+
* throw e;
|
|
2740
|
+
* });
|
|
2741
|
+
*
|
|
2742
|
+
* ```
|
|
1930
2743
|
*
|
|
1931
2744
|
* @param params - Parameters for request
|
|
1932
2745
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2068,6 +2881,53 @@ export namespace tpu_v1 {
|
|
|
2068
2881
|
|
|
2069
2882
|
/**
|
|
2070
2883
|
* Gets TensorFlow Version.
|
|
2884
|
+
* @example
|
|
2885
|
+
* ```js
|
|
2886
|
+
* // Before running the sample:
|
|
2887
|
+
* // - Enable the API at:
|
|
2888
|
+
* // https://console.developers.google.com/apis/api/tpu.googleapis.com
|
|
2889
|
+
* // - Login into gcloud by running:
|
|
2890
|
+
* // ```sh
|
|
2891
|
+
* // $ gcloud auth application-default login
|
|
2892
|
+
* // ```
|
|
2893
|
+
* // - Install the npm module by running:
|
|
2894
|
+
* // ```sh
|
|
2895
|
+
* // $ npm install googleapis
|
|
2896
|
+
* // ```
|
|
2897
|
+
*
|
|
2898
|
+
* const {google} = require('googleapis');
|
|
2899
|
+
* const tpu = google.tpu('v1');
|
|
2900
|
+
*
|
|
2901
|
+
* async function main() {
|
|
2902
|
+
* const auth = new google.auth.GoogleAuth({
|
|
2903
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
2904
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
2905
|
+
* });
|
|
2906
|
+
*
|
|
2907
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2908
|
+
* const authClient = await auth.getClient();
|
|
2909
|
+
* google.options({auth: authClient});
|
|
2910
|
+
*
|
|
2911
|
+
* // Do the magic
|
|
2912
|
+
* const res = await tpu.projects.locations.tensorflowVersions.get({
|
|
2913
|
+
* // Required. The resource name.
|
|
2914
|
+
* name: 'projects/my-project/locations/my-location/tensorflowVersions/my-tensorflowVersion',
|
|
2915
|
+
* });
|
|
2916
|
+
* console.log(res.data);
|
|
2917
|
+
*
|
|
2918
|
+
* // Example response
|
|
2919
|
+
* // {
|
|
2920
|
+
* // "name": "my_name",
|
|
2921
|
+
* // "version": "my_version"
|
|
2922
|
+
* // }
|
|
2923
|
+
* }
|
|
2924
|
+
*
|
|
2925
|
+
* main().catch(e => {
|
|
2926
|
+
* console.error(e);
|
|
2927
|
+
* throw e;
|
|
2928
|
+
* });
|
|
2929
|
+
*
|
|
2930
|
+
* ```
|
|
2071
2931
|
*
|
|
2072
2932
|
* @param params - Parameters for request
|
|
2073
2933
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2157,6 +3017,62 @@ export namespace tpu_v1 {
|
|
|
2157
3017
|
|
|
2158
3018
|
/**
|
|
2159
3019
|
* List TensorFlow versions supported by this API.
|
|
3020
|
+
* @example
|
|
3021
|
+
* ```js
|
|
3022
|
+
* // Before running the sample:
|
|
3023
|
+
* // - Enable the API at:
|
|
3024
|
+
* // https://console.developers.google.com/apis/api/tpu.googleapis.com
|
|
3025
|
+
* // - Login into gcloud by running:
|
|
3026
|
+
* // ```sh
|
|
3027
|
+
* // $ gcloud auth application-default login
|
|
3028
|
+
* // ```
|
|
3029
|
+
* // - Install the npm module by running:
|
|
3030
|
+
* // ```sh
|
|
3031
|
+
* // $ npm install googleapis
|
|
3032
|
+
* // ```
|
|
3033
|
+
*
|
|
3034
|
+
* const {google} = require('googleapis');
|
|
3035
|
+
* const tpu = google.tpu('v1');
|
|
3036
|
+
*
|
|
3037
|
+
* async function main() {
|
|
3038
|
+
* const auth = new google.auth.GoogleAuth({
|
|
3039
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
3040
|
+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
|
|
3041
|
+
* });
|
|
3042
|
+
*
|
|
3043
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
3044
|
+
* const authClient = await auth.getClient();
|
|
3045
|
+
* google.options({auth: authClient});
|
|
3046
|
+
*
|
|
3047
|
+
* // Do the magic
|
|
3048
|
+
* const res = await tpu.projects.locations.tensorflowVersions.list({
|
|
3049
|
+
* // List filter.
|
|
3050
|
+
* filter: 'placeholder-value',
|
|
3051
|
+
* // Sort results.
|
|
3052
|
+
* orderBy: 'placeholder-value',
|
|
3053
|
+
* // The maximum number of items to return.
|
|
3054
|
+
* pageSize: 'placeholder-value',
|
|
3055
|
+
* // The next_page_token value returned from a previous List request, if any.
|
|
3056
|
+
* pageToken: 'placeholder-value',
|
|
3057
|
+
* // Required. The parent resource name.
|
|
3058
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
3059
|
+
* });
|
|
3060
|
+
* console.log(res.data);
|
|
3061
|
+
*
|
|
3062
|
+
* // Example response
|
|
3063
|
+
* // {
|
|
3064
|
+
* // "nextPageToken": "my_nextPageToken",
|
|
3065
|
+
* // "tensorflowVersions": [],
|
|
3066
|
+
* // "unreachable": []
|
|
3067
|
+
* // }
|
|
3068
|
+
* }
|
|
3069
|
+
*
|
|
3070
|
+
* main().catch(e => {
|
|
3071
|
+
* console.error(e);
|
|
3072
|
+
* throw e;
|
|
3073
|
+
* });
|
|
3074
|
+
*
|
|
3075
|
+
* ```
|
|
2160
3076
|
*
|
|
2161
3077
|
* @param params - Parameters for request
|
|
2162
3078
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|