@googleapis/tpu 1.0.2 → 2.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/v2.ts ADDED
@@ -0,0 +1,3566 @@
1
+ // Copyright 2020 Google LLC
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+
14
+ /* eslint-disable @typescript-eslint/no-explicit-any */
15
+ /* eslint-disable @typescript-eslint/no-unused-vars */
16
+ /* eslint-disable @typescript-eslint/no-empty-interface */
17
+ /* eslint-disable @typescript-eslint/no-namespace */
18
+ /* eslint-disable no-irregular-whitespace */
19
+
20
+ import {
21
+ OAuth2Client,
22
+ JWT,
23
+ Compute,
24
+ UserRefreshClient,
25
+ BaseExternalAccountClient,
26
+ GaxiosPromise,
27
+ GoogleConfigurable,
28
+ createAPIRequest,
29
+ MethodOptions,
30
+ StreamMethodOptions,
31
+ GlobalOptions,
32
+ GoogleAuth,
33
+ BodyResponseCallback,
34
+ APIRequestContext,
35
+ } from 'googleapis-common';
36
+ import {Readable} from 'stream';
37
+
38
+ export namespace tpu_v2 {
39
+ export interface Options extends GlobalOptions {
40
+ version: 'v2';
41
+ }
42
+
43
+ interface StandardParameters {
44
+ /**
45
+ * Auth client or API Key for the request
46
+ */
47
+ auth?:
48
+ | string
49
+ | OAuth2Client
50
+ | JWT
51
+ | Compute
52
+ | UserRefreshClient
53
+ | BaseExternalAccountClient
54
+ | GoogleAuth;
55
+
56
+ /**
57
+ * V1 error format.
58
+ */
59
+ '$.xgafv'?: string;
60
+ /**
61
+ * OAuth access token.
62
+ */
63
+ access_token?: string;
64
+ /**
65
+ * Data format for response.
66
+ */
67
+ alt?: string;
68
+ /**
69
+ * JSONP
70
+ */
71
+ callback?: string;
72
+ /**
73
+ * Selector specifying which fields to include in a partial response.
74
+ */
75
+ fields?: string;
76
+ /**
77
+ * API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
78
+ */
79
+ key?: string;
80
+ /**
81
+ * OAuth 2.0 token for the current user.
82
+ */
83
+ oauth_token?: string;
84
+ /**
85
+ * Returns response with indentations and line breaks.
86
+ */
87
+ prettyPrint?: boolean;
88
+ /**
89
+ * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
90
+ */
91
+ quotaUser?: string;
92
+ /**
93
+ * Legacy upload protocol for media (e.g. "media", "multipart").
94
+ */
95
+ uploadType?: string;
96
+ /**
97
+ * Upload protocol for media (e.g. "raw", "multipart").
98
+ */
99
+ upload_protocol?: string;
100
+ }
101
+
102
+ /**
103
+ * Cloud TPU API
104
+ *
105
+ * TPU API provides customers with access to Google TPU technology.
106
+ *
107
+ * @example
108
+ * ```js
109
+ * const {google} = require('googleapis');
110
+ * const tpu = google.tpu('v2');
111
+ * ```
112
+ */
113
+ export class Tpu {
114
+ context: APIRequestContext;
115
+ projects: Resource$Projects;
116
+
117
+ constructor(options: GlobalOptions, google?: GoogleConfigurable) {
118
+ this.context = {
119
+ _options: options || {},
120
+ google,
121
+ };
122
+
123
+ this.projects = new Resource$Projects(this.context);
124
+ }
125
+ }
126
+
127
+ /**
128
+ * A accelerator type that a Node can be configured with.
129
+ */
130
+ export interface Schema$AcceleratorType {
131
+ /**
132
+ * The resource name.
133
+ */
134
+ name?: string | null;
135
+ /**
136
+ * the accelerator type.
137
+ */
138
+ type?: string | null;
139
+ }
140
+ /**
141
+ * An access config attached to the TPU worker.
142
+ */
143
+ export interface Schema$AccessConfig {
144
+ /**
145
+ * Output only. An external IP address associated with the TPU worker.
146
+ */
147
+ externalIp?: string | null;
148
+ }
149
+ /**
150
+ * A node-attached disk resource. Next ID: 8;
151
+ */
152
+ export interface Schema$AttachedDisk {
153
+ /**
154
+ * The mode in which to attach this disk. If not specified, the default is READ_WRITE mode. Only applicable to data_disks.
155
+ */
156
+ mode?: string | null;
157
+ /**
158
+ * Specifies the full path to an existing disk. For example: "projects/my-project/zones/us-central1-c/disks/my-disk".
159
+ */
160
+ sourceDisk?: string | null;
161
+ }
162
+ /**
163
+ * A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); \}
164
+ */
165
+ export interface Schema$Empty {}
166
+ /**
167
+ * Request for GenerateServiceIdentity.
168
+ */
169
+ export interface Schema$GenerateServiceIdentityRequest {}
170
+ /**
171
+ * Response for GenerateServiceIdentity.
172
+ */
173
+ export interface Schema$GenerateServiceIdentityResponse {
174
+ /**
175
+ * ServiceIdentity that was created or retrieved.
176
+ */
177
+ identity?: Schema$ServiceIdentity;
178
+ }
179
+ /**
180
+ * Request for GetGuestAttributes.
181
+ */
182
+ export interface Schema$GetGuestAttributesRequest {
183
+ /**
184
+ * The guest attributes path to be queried.
185
+ */
186
+ queryPath?: string | null;
187
+ /**
188
+ * The 0-based worker ID. If it is empty, all workers' GuestAttributes will be returned.
189
+ */
190
+ workerIds?: string[] | null;
191
+ }
192
+ /**
193
+ * Response for GetGuestAttributes.
194
+ */
195
+ export interface Schema$GetGuestAttributesResponse {
196
+ /**
197
+ * The guest attributes for the TPU workers.
198
+ */
199
+ guestAttributes?: Schema$GuestAttributes[];
200
+ }
201
+ /**
202
+ * A guest attributes.
203
+ */
204
+ export interface Schema$GuestAttributes {
205
+ /**
206
+ * The path to be queried. This can be the default namespace ('/') or a nested namespace ('/\/') or a specified key ('/\/\')
207
+ */
208
+ queryPath?: string | null;
209
+ /**
210
+ * The value of the requested queried path.
211
+ */
212
+ queryValue?: Schema$GuestAttributesValue;
213
+ }
214
+ /**
215
+ * A guest attributes namespace/key/value entry.
216
+ */
217
+ export interface Schema$GuestAttributesEntry {
218
+ /**
219
+ * Key for the guest attribute entry.
220
+ */
221
+ key?: string | null;
222
+ /**
223
+ * Namespace for the guest attribute entry.
224
+ */
225
+ namespace?: string | null;
226
+ /**
227
+ * Value for the guest attribute entry.
228
+ */
229
+ value?: string | null;
230
+ }
231
+ /**
232
+ * Array of guest attribute namespace/key/value tuples.
233
+ */
234
+ export interface Schema$GuestAttributesValue {
235
+ /**
236
+ * The list of guest attributes entries.
237
+ */
238
+ items?: Schema$GuestAttributesEntry[];
239
+ }
240
+ /**
241
+ * Response for ListAcceleratorTypes.
242
+ */
243
+ export interface Schema$ListAcceleratorTypesResponse {
244
+ /**
245
+ * The listed nodes.
246
+ */
247
+ acceleratorTypes?: Schema$AcceleratorType[];
248
+ /**
249
+ * The next page token or empty if none.
250
+ */
251
+ nextPageToken?: string | null;
252
+ /**
253
+ * Locations that could not be reached.
254
+ */
255
+ unreachable?: string[] | null;
256
+ }
257
+ /**
258
+ * The response message for Locations.ListLocations.
259
+ */
260
+ export interface Schema$ListLocationsResponse {
261
+ /**
262
+ * A list of locations that matches the specified filter in the request.
263
+ */
264
+ locations?: Schema$Location[];
265
+ /**
266
+ * The standard List next-page token.
267
+ */
268
+ nextPageToken?: string | null;
269
+ }
270
+ /**
271
+ * Response for ListNodes.
272
+ */
273
+ export interface Schema$ListNodesResponse {
274
+ /**
275
+ * The next page token or empty if none.
276
+ */
277
+ nextPageToken?: string | null;
278
+ /**
279
+ * The listed nodes.
280
+ */
281
+ nodes?: Schema$Node[];
282
+ /**
283
+ * Locations that could not be reached.
284
+ */
285
+ unreachable?: string[] | null;
286
+ }
287
+ /**
288
+ * The response message for Operations.ListOperations.
289
+ */
290
+ export interface Schema$ListOperationsResponse {
291
+ /**
292
+ * The standard List next-page token.
293
+ */
294
+ nextPageToken?: string | null;
295
+ /**
296
+ * A list of operations that matches the specified filter in the request.
297
+ */
298
+ operations?: Schema$Operation[];
299
+ }
300
+ /**
301
+ * Response for ListRuntimeVersions.
302
+ */
303
+ export interface Schema$ListRuntimeVersionsResponse {
304
+ /**
305
+ * The next page token or empty if none.
306
+ */
307
+ nextPageToken?: string | null;
308
+ /**
309
+ * The listed nodes.
310
+ */
311
+ runtimeVersions?: Schema$RuntimeVersion[];
312
+ /**
313
+ * Locations that could not be reached.
314
+ */
315
+ unreachable?: string[] | null;
316
+ }
317
+ /**
318
+ * A resource that represents Google Cloud Platform location.
319
+ */
320
+ export interface Schema$Location {
321
+ /**
322
+ * The friendly name for this location, typically a nearby city name. For example, "Tokyo".
323
+ */
324
+ displayName?: string | null;
325
+ /**
326
+ * Cross-service attributes for the location. For example {"cloud.googleapis.com/region": "us-east1"\}
327
+ */
328
+ labels?: {[key: string]: string} | null;
329
+ /**
330
+ * The canonical id for this location. For example: `"us-east1"`.
331
+ */
332
+ locationId?: string | null;
333
+ /**
334
+ * Service-specific metadata. For example the available capacity at the given location.
335
+ */
336
+ metadata?: {[key: string]: any} | null;
337
+ /**
338
+ * Resource name for the location, which may vary between implementations. For example: `"projects/example-project/locations/us-east1"`
339
+ */
340
+ name?: string | null;
341
+ }
342
+ /**
343
+ * Network related configurations.
344
+ */
345
+ export interface Schema$NetworkConfig {
346
+ /**
347
+ * Allows the TPU node to send and receive packets with non-matching destination or source IPs. This is required if you plan to use the TPU workers to forward routes.
348
+ */
349
+ canIpForward?: boolean | null;
350
+ /**
351
+ * Indicates that external IP addresses would be associated with the TPU workers. If set to false, the specified subnetwork or network should have Private Google Access enabled.
352
+ */
353
+ enableExternalIps?: boolean | null;
354
+ /**
355
+ * The name of the network for the TPU node. It must be a preexisting Google Compute Engine network. If none is provided, "default" will be used.
356
+ */
357
+ network?: string | null;
358
+ /**
359
+ * The name of the subnetwork for the TPU node. It must be a preexisting Google Compute Engine subnetwork. If none is provided, "default" will be used.
360
+ */
361
+ subnetwork?: string | null;
362
+ }
363
+ /**
364
+ * A network endpoint over which a TPU worker can be reached.
365
+ */
366
+ export interface Schema$NetworkEndpoint {
367
+ /**
368
+ * The access config for the TPU worker.
369
+ */
370
+ accessConfig?: Schema$AccessConfig;
371
+ /**
372
+ * The internal IP address of this network endpoint.
373
+ */
374
+ ipAddress?: string | null;
375
+ /**
376
+ * The port of this network endpoint.
377
+ */
378
+ port?: number | null;
379
+ }
380
+ /**
381
+ * A TPU instance.
382
+ */
383
+ export interface Schema$Node {
384
+ /**
385
+ * Required. The type of hardware accelerators associated with this node.
386
+ */
387
+ acceleratorType?: string | null;
388
+ /**
389
+ * Output only. The API version that created this Node.
390
+ */
391
+ apiVersion?: string | null;
392
+ /**
393
+ * The CIDR block that the TPU node will use when selecting an IP address. This CIDR block must be a /29 block; the Compute Engine networks API forbids a smaller block, and using a larger block would be wasteful (a node can only consume one IP address). Errors will occur if the CIDR block has already been used for a currently existing TPU node, the CIDR block conflicts with any subnetworks in the user's provided network, or the provided network is peered with another network that is using that CIDR block.
394
+ */
395
+ cidrBlock?: string | null;
396
+ /**
397
+ * Output only. The time when the node was created.
398
+ */
399
+ createTime?: string | null;
400
+ /**
401
+ * The additional data disks for the Node.
402
+ */
403
+ dataDisks?: Schema$AttachedDisk[];
404
+ /**
405
+ * The user-supplied description of the TPU. Maximum of 512 characters.
406
+ */
407
+ description?: string | null;
408
+ /**
409
+ * The health status of the TPU node.
410
+ */
411
+ health?: string | null;
412
+ /**
413
+ * Output only. If this field is populated, it contains a description of why the TPU Node is unhealthy.
414
+ */
415
+ healthDescription?: string | null;
416
+ /**
417
+ * Output only. The unique identifier for the TPU Node.
418
+ */
419
+ id?: string | null;
420
+ /**
421
+ * Resource labels to represent user-provided metadata.
422
+ */
423
+ labels?: {[key: string]: string} | null;
424
+ /**
425
+ * Custom metadata to apply to the TPU Node. Can set startup-script and shutdown-script
426
+ */
427
+ metadata?: {[key: string]: string} | null;
428
+ /**
429
+ * Output only. Immutable. The name of the TPU.
430
+ */
431
+ name?: string | null;
432
+ /**
433
+ * Network configurations for the TPU node.
434
+ */
435
+ networkConfig?: Schema$NetworkConfig;
436
+ /**
437
+ * Output only. The network endpoints where TPU workers can be accessed and sent work. It is recommended that runtime clients of the node reach out to the 0th entry in this map first.
438
+ */
439
+ networkEndpoints?: Schema$NetworkEndpoint[];
440
+ /**
441
+ * Required. The runtime version running in the Node.
442
+ */
443
+ runtimeVersion?: string | null;
444
+ /**
445
+ * The scheduling options for this node.
446
+ */
447
+ schedulingConfig?: Schema$SchedulingConfig;
448
+ /**
449
+ * The Google Cloud Platform Service Account to be used by the TPU node VMs. If None is specified, the default compute service account will be used.
450
+ */
451
+ serviceAccount?: Schema$ServiceAccount;
452
+ /**
453
+ * Shielded Instance options.
454
+ */
455
+ shieldedInstanceConfig?: Schema$ShieldedInstanceConfig;
456
+ /**
457
+ * Output only. The current state for the TPU Node.
458
+ */
459
+ state?: string | null;
460
+ /**
461
+ * Output only. The Symptoms that have occurred to the TPU Node.
462
+ */
463
+ symptoms?: Schema$Symptom[];
464
+ /**
465
+ * Tags to apply to the TPU Node. Tags are used to identify valid sources or targets for network firewalls.
466
+ */
467
+ tags?: string[] | null;
468
+ }
469
+ /**
470
+ * This resource represents a long-running operation that is the result of a network API call.
471
+ */
472
+ export interface Schema$Operation {
473
+ /**
474
+ * If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.
475
+ */
476
+ done?: boolean | null;
477
+ /**
478
+ * The error result of the operation in case of failure or cancellation.
479
+ */
480
+ error?: Schema$Status;
481
+ /**
482
+ * Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
483
+ */
484
+ metadata?: {[key: string]: any} | null;
485
+ /**
486
+ * The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id\}`.
487
+ */
488
+ name?: string | null;
489
+ /**
490
+ * The normal response of the operation in case of success. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
491
+ */
492
+ response?: {[key: string]: any} | null;
493
+ }
494
+ /**
495
+ * Metadata describing an Operation
496
+ */
497
+ export interface Schema$OperationMetadata {
498
+ /**
499
+ * API version.
500
+ */
501
+ apiVersion?: string | null;
502
+ /**
503
+ * Specifies if cancellation was requested for the operation.
504
+ */
505
+ cancelRequested?: boolean | null;
506
+ /**
507
+ * The time the operation was created.
508
+ */
509
+ createTime?: string | null;
510
+ /**
511
+ * The time the operation finished running.
512
+ */
513
+ endTime?: string | null;
514
+ /**
515
+ * Human-readable status of the operation, if any.
516
+ */
517
+ statusDetail?: string | null;
518
+ /**
519
+ * Target of the operation - for example projects/project-1/connectivityTests/test-1
520
+ */
521
+ target?: string | null;
522
+ /**
523
+ * Name of the verb executed by the operation.
524
+ */
525
+ verb?: string | null;
526
+ }
527
+ /**
528
+ * A runtime version that a Node can be configured with.
529
+ */
530
+ export interface Schema$RuntimeVersion {
531
+ /**
532
+ * The resource name.
533
+ */
534
+ name?: string | null;
535
+ /**
536
+ * The runtime version.
537
+ */
538
+ version?: string | null;
539
+ }
540
+ /**
541
+ * Sets the scheduling options for this node.
542
+ */
543
+ export interface Schema$SchedulingConfig {
544
+ /**
545
+ * Defines whether the node is preemptible.
546
+ */
547
+ preemptible?: boolean | null;
548
+ /**
549
+ * Whether the node is created under a reservation.
550
+ */
551
+ reserved?: boolean | null;
552
+ }
553
+ /**
554
+ * A service account.
555
+ */
556
+ export interface Schema$ServiceAccount {
557
+ /**
558
+ * Email address of the service account. If empty, default Compute service account will be used.
559
+ */
560
+ email?: string | null;
561
+ /**
562
+ * The list of scopes to be made available for this service account. If empty, access to all Cloud APIs will be allowed.
563
+ */
564
+ scope?: string[] | null;
565
+ }
566
+ /**
567
+ * The per-product per-project service identity for Cloud TPU service.
568
+ */
569
+ export interface Schema$ServiceIdentity {
570
+ /**
571
+ * The email address of the service identity.
572
+ */
573
+ email?: string | null;
574
+ }
575
+ /**
576
+ * A set of Shielded Instance options.
577
+ */
578
+ export interface Schema$ShieldedInstanceConfig {
579
+ /**
580
+ * Defines whether the instance has Secure Boot enabled.
581
+ */
582
+ enableSecureBoot?: boolean | null;
583
+ }
584
+ /**
585
+ * Request for StartNode.
586
+ */
587
+ export interface Schema$StartNodeRequest {}
588
+ /**
589
+ * The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).
590
+ */
591
+ export interface Schema$Status {
592
+ /**
593
+ * The status code, which should be an enum value of google.rpc.Code.
594
+ */
595
+ code?: number | null;
596
+ /**
597
+ * A list of messages that carry the error details. There is a common set of message types for APIs to use.
598
+ */
599
+ details?: Array<{[key: string]: any}> | null;
600
+ /**
601
+ * A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
602
+ */
603
+ message?: string | null;
604
+ }
605
+ /**
606
+ * Request for StopNode.
607
+ */
608
+ export interface Schema$StopNodeRequest {}
609
+ /**
610
+ * A Symptom instance.
611
+ */
612
+ export interface Schema$Symptom {
613
+ /**
614
+ * Timestamp when the Symptom is created.
615
+ */
616
+ createTime?: string | null;
617
+ /**
618
+ * Detailed information of the current Symptom.
619
+ */
620
+ details?: string | null;
621
+ /**
622
+ * Type of the Symptom.
623
+ */
624
+ symptomType?: string | null;
625
+ /**
626
+ * A string used to uniquely distinguish a worker within a TPU node.
627
+ */
628
+ workerId?: string | null;
629
+ }
630
+
631
+ export class Resource$Projects {
632
+ context: APIRequestContext;
633
+ locations: Resource$Projects$Locations;
634
+ constructor(context: APIRequestContext) {
635
+ this.context = context;
636
+ this.locations = new Resource$Projects$Locations(this.context);
637
+ }
638
+ }
639
+
640
+ export class Resource$Projects$Locations {
641
+ context: APIRequestContext;
642
+ acceleratorTypes: Resource$Projects$Locations$Acceleratortypes;
643
+ nodes: Resource$Projects$Locations$Nodes;
644
+ operations: Resource$Projects$Locations$Operations;
645
+ runtimeVersions: Resource$Projects$Locations$Runtimeversions;
646
+ constructor(context: APIRequestContext) {
647
+ this.context = context;
648
+ this.acceleratorTypes = new Resource$Projects$Locations$Acceleratortypes(
649
+ this.context
650
+ );
651
+ this.nodes = new Resource$Projects$Locations$Nodes(this.context);
652
+ this.operations = new Resource$Projects$Locations$Operations(
653
+ this.context
654
+ );
655
+ this.runtimeVersions = new Resource$Projects$Locations$Runtimeversions(
656
+ this.context
657
+ );
658
+ }
659
+
660
+ /**
661
+ * Generates the Cloud TPU service identity for the project.
662
+ * @example
663
+ * ```js
664
+ * // Before running the sample:
665
+ * // - Enable the API at:
666
+ * // https://console.developers.google.com/apis/api/tpu.googleapis.com
667
+ * // - Login into gcloud by running:
668
+ * // `$ gcloud auth application-default login`
669
+ * // - Install the npm module by running:
670
+ * // `$ npm install googleapis`
671
+ *
672
+ * const {google} = require('googleapis');
673
+ * const tpu = google.tpu('v2');
674
+ *
675
+ * async function main() {
676
+ * const auth = new google.auth.GoogleAuth({
677
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
678
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
679
+ * });
680
+ *
681
+ * // Acquire an auth client, and bind it to all future calls
682
+ * const authClient = await auth.getClient();
683
+ * google.options({auth: authClient});
684
+ *
685
+ * // Do the magic
686
+ * const res = await tpu.projects.locations.generateServiceIdentity({
687
+ * // Required. The parent resource name.
688
+ * parent: 'projects/my-project/locations/my-location',
689
+ *
690
+ * // Request body metadata
691
+ * requestBody: {
692
+ * // request body parameters
693
+ * // {}
694
+ * },
695
+ * });
696
+ * console.log(res.data);
697
+ *
698
+ * // Example response
699
+ * // {
700
+ * // "identity": {}
701
+ * // }
702
+ * }
703
+ *
704
+ * main().catch(e => {
705
+ * console.error(e);
706
+ * throw e;
707
+ * });
708
+ *
709
+ * ```
710
+ *
711
+ * @param params - Parameters for request
712
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
713
+ * @param callback - Optional callback that handles the response.
714
+ * @returns A promise if used with async/await, or void if used with a callback.
715
+ */
716
+ generateServiceIdentity(
717
+ params: Params$Resource$Projects$Locations$Generateserviceidentity,
718
+ options: StreamMethodOptions
719
+ ): GaxiosPromise<Readable>;
720
+ generateServiceIdentity(
721
+ params?: Params$Resource$Projects$Locations$Generateserviceidentity,
722
+ options?: MethodOptions
723
+ ): GaxiosPromise<Schema$GenerateServiceIdentityResponse>;
724
+ generateServiceIdentity(
725
+ params: Params$Resource$Projects$Locations$Generateserviceidentity,
726
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
727
+ callback: BodyResponseCallback<Readable>
728
+ ): void;
729
+ generateServiceIdentity(
730
+ params: Params$Resource$Projects$Locations$Generateserviceidentity,
731
+ options:
732
+ | MethodOptions
733
+ | BodyResponseCallback<Schema$GenerateServiceIdentityResponse>,
734
+ callback: BodyResponseCallback<Schema$GenerateServiceIdentityResponse>
735
+ ): void;
736
+ generateServiceIdentity(
737
+ params: Params$Resource$Projects$Locations$Generateserviceidentity,
738
+ callback: BodyResponseCallback<Schema$GenerateServiceIdentityResponse>
739
+ ): void;
740
+ generateServiceIdentity(
741
+ callback: BodyResponseCallback<Schema$GenerateServiceIdentityResponse>
742
+ ): void;
743
+ generateServiceIdentity(
744
+ paramsOrCallback?:
745
+ | Params$Resource$Projects$Locations$Generateserviceidentity
746
+ | BodyResponseCallback<Schema$GenerateServiceIdentityResponse>
747
+ | BodyResponseCallback<Readable>,
748
+ optionsOrCallback?:
749
+ | MethodOptions
750
+ | StreamMethodOptions
751
+ | BodyResponseCallback<Schema$GenerateServiceIdentityResponse>
752
+ | BodyResponseCallback<Readable>,
753
+ callback?:
754
+ | BodyResponseCallback<Schema$GenerateServiceIdentityResponse>
755
+ | BodyResponseCallback<Readable>
756
+ ):
757
+ | void
758
+ | GaxiosPromise<Schema$GenerateServiceIdentityResponse>
759
+ | GaxiosPromise<Readable> {
760
+ let params = (paramsOrCallback ||
761
+ {}) as Params$Resource$Projects$Locations$Generateserviceidentity;
762
+ let options = (optionsOrCallback || {}) as MethodOptions;
763
+
764
+ if (typeof paramsOrCallback === 'function') {
765
+ callback = paramsOrCallback;
766
+ params =
767
+ {} as Params$Resource$Projects$Locations$Generateserviceidentity;
768
+ options = {};
769
+ }
770
+
771
+ if (typeof optionsOrCallback === 'function') {
772
+ callback = optionsOrCallback;
773
+ options = {};
774
+ }
775
+
776
+ const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/';
777
+ const parameters = {
778
+ options: Object.assign(
779
+ {
780
+ url: (rootUrl + '/v2/{+parent}:generateServiceIdentity').replace(
781
+ /([^:]\/)\/+/g,
782
+ '$1'
783
+ ),
784
+ method: 'POST',
785
+ },
786
+ options
787
+ ),
788
+ params,
789
+ requiredParams: ['parent'],
790
+ pathParams: ['parent'],
791
+ context: this.context,
792
+ };
793
+ if (callback) {
794
+ createAPIRequest<Schema$GenerateServiceIdentityResponse>(
795
+ parameters,
796
+ callback as BodyResponseCallback<unknown>
797
+ );
798
+ } else {
799
+ return createAPIRequest<Schema$GenerateServiceIdentityResponse>(
800
+ parameters
801
+ );
802
+ }
803
+ }
804
+
805
+ /**
806
+ * Gets information about a location.
807
+ * @example
808
+ * ```js
809
+ * // Before running the sample:
810
+ * // - Enable the API at:
811
+ * // https://console.developers.google.com/apis/api/tpu.googleapis.com
812
+ * // - Login into gcloud by running:
813
+ * // `$ gcloud auth application-default login`
814
+ * // - Install the npm module by running:
815
+ * // `$ npm install googleapis`
816
+ *
817
+ * const {google} = require('googleapis');
818
+ * const tpu = google.tpu('v2');
819
+ *
820
+ * async function main() {
821
+ * const auth = new google.auth.GoogleAuth({
822
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
823
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
824
+ * });
825
+ *
826
+ * // Acquire an auth client, and bind it to all future calls
827
+ * const authClient = await auth.getClient();
828
+ * google.options({auth: authClient});
829
+ *
830
+ * // Do the magic
831
+ * const res = await tpu.projects.locations.get({
832
+ * // Resource name for the location.
833
+ * name: 'projects/my-project/locations/my-location',
834
+ * });
835
+ * console.log(res.data);
836
+ *
837
+ * // Example response
838
+ * // {
839
+ * // "displayName": "my_displayName",
840
+ * // "labels": {},
841
+ * // "locationId": "my_locationId",
842
+ * // "metadata": {},
843
+ * // "name": "my_name"
844
+ * // }
845
+ * }
846
+ *
847
+ * main().catch(e => {
848
+ * console.error(e);
849
+ * throw e;
850
+ * });
851
+ *
852
+ * ```
853
+ *
854
+ * @param params - Parameters for request
855
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
856
+ * @param callback - Optional callback that handles the response.
857
+ * @returns A promise if used with async/await, or void if used with a callback.
858
+ */
859
+ get(
860
+ params: Params$Resource$Projects$Locations$Get,
861
+ options: StreamMethodOptions
862
+ ): GaxiosPromise<Readable>;
863
+ get(
864
+ params?: Params$Resource$Projects$Locations$Get,
865
+ options?: MethodOptions
866
+ ): GaxiosPromise<Schema$Location>;
867
+ get(
868
+ params: Params$Resource$Projects$Locations$Get,
869
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
870
+ callback: BodyResponseCallback<Readable>
871
+ ): void;
872
+ get(
873
+ params: Params$Resource$Projects$Locations$Get,
874
+ options: MethodOptions | BodyResponseCallback<Schema$Location>,
875
+ callback: BodyResponseCallback<Schema$Location>
876
+ ): void;
877
+ get(
878
+ params: Params$Resource$Projects$Locations$Get,
879
+ callback: BodyResponseCallback<Schema$Location>
880
+ ): void;
881
+ get(callback: BodyResponseCallback<Schema$Location>): void;
882
+ get(
883
+ paramsOrCallback?:
884
+ | Params$Resource$Projects$Locations$Get
885
+ | BodyResponseCallback<Schema$Location>
886
+ | BodyResponseCallback<Readable>,
887
+ optionsOrCallback?:
888
+ | MethodOptions
889
+ | StreamMethodOptions
890
+ | BodyResponseCallback<Schema$Location>
891
+ | BodyResponseCallback<Readable>,
892
+ callback?:
893
+ | BodyResponseCallback<Schema$Location>
894
+ | BodyResponseCallback<Readable>
895
+ ): void | GaxiosPromise<Schema$Location> | GaxiosPromise<Readable> {
896
+ let params = (paramsOrCallback ||
897
+ {}) as Params$Resource$Projects$Locations$Get;
898
+ let options = (optionsOrCallback || {}) as MethodOptions;
899
+
900
+ if (typeof paramsOrCallback === 'function') {
901
+ callback = paramsOrCallback;
902
+ params = {} as Params$Resource$Projects$Locations$Get;
903
+ options = {};
904
+ }
905
+
906
+ if (typeof optionsOrCallback === 'function') {
907
+ callback = optionsOrCallback;
908
+ options = {};
909
+ }
910
+
911
+ const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/';
912
+ const parameters = {
913
+ options: Object.assign(
914
+ {
915
+ url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'),
916
+ method: 'GET',
917
+ },
918
+ options
919
+ ),
920
+ params,
921
+ requiredParams: ['name'],
922
+ pathParams: ['name'],
923
+ context: this.context,
924
+ };
925
+ if (callback) {
926
+ createAPIRequest<Schema$Location>(
927
+ parameters,
928
+ callback as BodyResponseCallback<unknown>
929
+ );
930
+ } else {
931
+ return createAPIRequest<Schema$Location>(parameters);
932
+ }
933
+ }
934
+
935
+ /**
936
+ * Lists information about the supported locations for this service.
937
+ * @example
938
+ * ```js
939
+ * // Before running the sample:
940
+ * // - Enable the API at:
941
+ * // https://console.developers.google.com/apis/api/tpu.googleapis.com
942
+ * // - Login into gcloud by running:
943
+ * // `$ gcloud auth application-default login`
944
+ * // - Install the npm module by running:
945
+ * // `$ npm install googleapis`
946
+ *
947
+ * const {google} = require('googleapis');
948
+ * const tpu = google.tpu('v2');
949
+ *
950
+ * async function main() {
951
+ * const auth = new google.auth.GoogleAuth({
952
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
953
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
954
+ * });
955
+ *
956
+ * // Acquire an auth client, and bind it to all future calls
957
+ * const authClient = await auth.getClient();
958
+ * google.options({auth: authClient});
959
+ *
960
+ * // Do the magic
961
+ * const res = await tpu.projects.locations.list({
962
+ * // 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).
963
+ * filter: 'placeholder-value',
964
+ * // The resource that owns the locations collection, if applicable.
965
+ * name: 'projects/my-project',
966
+ * // The maximum number of results to return. If not set, the service selects a default.
967
+ * pageSize: 'placeholder-value',
968
+ * // A page token received from the `next_page_token` field in the response. Send that page token to receive the subsequent page.
969
+ * pageToken: 'placeholder-value',
970
+ * });
971
+ * console.log(res.data);
972
+ *
973
+ * // Example response
974
+ * // {
975
+ * // "locations": [],
976
+ * // "nextPageToken": "my_nextPageToken"
977
+ * // }
978
+ * }
979
+ *
980
+ * main().catch(e => {
981
+ * console.error(e);
982
+ * throw e;
983
+ * });
984
+ *
985
+ * ```
986
+ *
987
+ * @param params - Parameters for request
988
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
989
+ * @param callback - Optional callback that handles the response.
990
+ * @returns A promise if used with async/await, or void if used with a callback.
991
+ */
992
+ list(
993
+ params: Params$Resource$Projects$Locations$List,
994
+ options: StreamMethodOptions
995
+ ): GaxiosPromise<Readable>;
996
+ list(
997
+ params?: Params$Resource$Projects$Locations$List,
998
+ options?: MethodOptions
999
+ ): GaxiosPromise<Schema$ListLocationsResponse>;
1000
+ list(
1001
+ params: Params$Resource$Projects$Locations$List,
1002
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
1003
+ callback: BodyResponseCallback<Readable>
1004
+ ): void;
1005
+ list(
1006
+ params: Params$Resource$Projects$Locations$List,
1007
+ options:
1008
+ | MethodOptions
1009
+ | BodyResponseCallback<Schema$ListLocationsResponse>,
1010
+ callback: BodyResponseCallback<Schema$ListLocationsResponse>
1011
+ ): void;
1012
+ list(
1013
+ params: Params$Resource$Projects$Locations$List,
1014
+ callback: BodyResponseCallback<Schema$ListLocationsResponse>
1015
+ ): void;
1016
+ list(callback: BodyResponseCallback<Schema$ListLocationsResponse>): void;
1017
+ list(
1018
+ paramsOrCallback?:
1019
+ | Params$Resource$Projects$Locations$List
1020
+ | BodyResponseCallback<Schema$ListLocationsResponse>
1021
+ | BodyResponseCallback<Readable>,
1022
+ optionsOrCallback?:
1023
+ | MethodOptions
1024
+ | StreamMethodOptions
1025
+ | BodyResponseCallback<Schema$ListLocationsResponse>
1026
+ | BodyResponseCallback<Readable>,
1027
+ callback?:
1028
+ | BodyResponseCallback<Schema$ListLocationsResponse>
1029
+ | BodyResponseCallback<Readable>
1030
+ ):
1031
+ | void
1032
+ | GaxiosPromise<Schema$ListLocationsResponse>
1033
+ | GaxiosPromise<Readable> {
1034
+ let params = (paramsOrCallback ||
1035
+ {}) as Params$Resource$Projects$Locations$List;
1036
+ let options = (optionsOrCallback || {}) as MethodOptions;
1037
+
1038
+ if (typeof paramsOrCallback === 'function') {
1039
+ callback = paramsOrCallback;
1040
+ params = {} as Params$Resource$Projects$Locations$List;
1041
+ options = {};
1042
+ }
1043
+
1044
+ if (typeof optionsOrCallback === 'function') {
1045
+ callback = optionsOrCallback;
1046
+ options = {};
1047
+ }
1048
+
1049
+ const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/';
1050
+ const parameters = {
1051
+ options: Object.assign(
1052
+ {
1053
+ url: (rootUrl + '/v2/{+name}/locations').replace(
1054
+ /([^:]\/)\/+/g,
1055
+ '$1'
1056
+ ),
1057
+ method: 'GET',
1058
+ },
1059
+ options
1060
+ ),
1061
+ params,
1062
+ requiredParams: ['name'],
1063
+ pathParams: ['name'],
1064
+ context: this.context,
1065
+ };
1066
+ if (callback) {
1067
+ createAPIRequest<Schema$ListLocationsResponse>(
1068
+ parameters,
1069
+ callback as BodyResponseCallback<unknown>
1070
+ );
1071
+ } else {
1072
+ return createAPIRequest<Schema$ListLocationsResponse>(parameters);
1073
+ }
1074
+ }
1075
+ }
1076
+
1077
+ export interface Params$Resource$Projects$Locations$Generateserviceidentity
1078
+ extends StandardParameters {
1079
+ /**
1080
+ * Required. The parent resource name.
1081
+ */
1082
+ parent?: string;
1083
+
1084
+ /**
1085
+ * Request body metadata
1086
+ */
1087
+ requestBody?: Schema$GenerateServiceIdentityRequest;
1088
+ }
1089
+ export interface Params$Resource$Projects$Locations$Get
1090
+ extends StandardParameters {
1091
+ /**
1092
+ * Resource name for the location.
1093
+ */
1094
+ name?: string;
1095
+ }
1096
+ export interface Params$Resource$Projects$Locations$List
1097
+ extends StandardParameters {
1098
+ /**
1099
+ * 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).
1100
+ */
1101
+ filter?: string;
1102
+ /**
1103
+ * The resource that owns the locations collection, if applicable.
1104
+ */
1105
+ name?: string;
1106
+ /**
1107
+ * The maximum number of results to return. If not set, the service selects a default.
1108
+ */
1109
+ pageSize?: number;
1110
+ /**
1111
+ * A page token received from the `next_page_token` field in the response. Send that page token to receive the subsequent page.
1112
+ */
1113
+ pageToken?: string;
1114
+ }
1115
+
1116
+ export class Resource$Projects$Locations$Acceleratortypes {
1117
+ context: APIRequestContext;
1118
+ constructor(context: APIRequestContext) {
1119
+ this.context = context;
1120
+ }
1121
+
1122
+ /**
1123
+ * Gets AcceleratorType.
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
+ * // `$ gcloud auth application-default login`
1131
+ * // - Install the npm module by running:
1132
+ * // `$ npm install googleapis`
1133
+ *
1134
+ * const {google} = require('googleapis');
1135
+ * const tpu = google.tpu('v2');
1136
+ *
1137
+ * async function main() {
1138
+ * const auth = new google.auth.GoogleAuth({
1139
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1140
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
1141
+ * });
1142
+ *
1143
+ * // Acquire an auth client, and bind it to all future calls
1144
+ * const authClient = await auth.getClient();
1145
+ * google.options({auth: authClient});
1146
+ *
1147
+ * // Do the magic
1148
+ * const res = await tpu.projects.locations.acceleratorTypes.get({
1149
+ * // Required. The resource name.
1150
+ * name: 'projects/my-project/locations/my-location/acceleratorTypes/my-acceleratorType',
1151
+ * });
1152
+ * console.log(res.data);
1153
+ *
1154
+ * // Example response
1155
+ * // {
1156
+ * // "name": "my_name",
1157
+ * // "type": "my_type"
1158
+ * // }
1159
+ * }
1160
+ *
1161
+ * main().catch(e => {
1162
+ * console.error(e);
1163
+ * throw e;
1164
+ * });
1165
+ *
1166
+ * ```
1167
+ *
1168
+ * @param params - Parameters for request
1169
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
1170
+ * @param callback - Optional callback that handles the response.
1171
+ * @returns A promise if used with async/await, or void if used with a callback.
1172
+ */
1173
+ get(
1174
+ params: Params$Resource$Projects$Locations$Acceleratortypes$Get,
1175
+ options: StreamMethodOptions
1176
+ ): GaxiosPromise<Readable>;
1177
+ get(
1178
+ params?: Params$Resource$Projects$Locations$Acceleratortypes$Get,
1179
+ options?: MethodOptions
1180
+ ): GaxiosPromise<Schema$AcceleratorType>;
1181
+ get(
1182
+ params: Params$Resource$Projects$Locations$Acceleratortypes$Get,
1183
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
1184
+ callback: BodyResponseCallback<Readable>
1185
+ ): void;
1186
+ get(
1187
+ params: Params$Resource$Projects$Locations$Acceleratortypes$Get,
1188
+ options: MethodOptions | BodyResponseCallback<Schema$AcceleratorType>,
1189
+ callback: BodyResponseCallback<Schema$AcceleratorType>
1190
+ ): void;
1191
+ get(
1192
+ params: Params$Resource$Projects$Locations$Acceleratortypes$Get,
1193
+ callback: BodyResponseCallback<Schema$AcceleratorType>
1194
+ ): void;
1195
+ get(callback: BodyResponseCallback<Schema$AcceleratorType>): void;
1196
+ get(
1197
+ paramsOrCallback?:
1198
+ | Params$Resource$Projects$Locations$Acceleratortypes$Get
1199
+ | BodyResponseCallback<Schema$AcceleratorType>
1200
+ | BodyResponseCallback<Readable>,
1201
+ optionsOrCallback?:
1202
+ | MethodOptions
1203
+ | StreamMethodOptions
1204
+ | BodyResponseCallback<Schema$AcceleratorType>
1205
+ | BodyResponseCallback<Readable>,
1206
+ callback?:
1207
+ | BodyResponseCallback<Schema$AcceleratorType>
1208
+ | BodyResponseCallback<Readable>
1209
+ ): void | GaxiosPromise<Schema$AcceleratorType> | GaxiosPromise<Readable> {
1210
+ let params = (paramsOrCallback ||
1211
+ {}) as Params$Resource$Projects$Locations$Acceleratortypes$Get;
1212
+ let options = (optionsOrCallback || {}) as MethodOptions;
1213
+
1214
+ if (typeof paramsOrCallback === 'function') {
1215
+ callback = paramsOrCallback;
1216
+ params = {} as Params$Resource$Projects$Locations$Acceleratortypes$Get;
1217
+ options = {};
1218
+ }
1219
+
1220
+ if (typeof optionsOrCallback === 'function') {
1221
+ callback = optionsOrCallback;
1222
+ options = {};
1223
+ }
1224
+
1225
+ const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/';
1226
+ const parameters = {
1227
+ options: Object.assign(
1228
+ {
1229
+ url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'),
1230
+ method: 'GET',
1231
+ },
1232
+ options
1233
+ ),
1234
+ params,
1235
+ requiredParams: ['name'],
1236
+ pathParams: ['name'],
1237
+ context: this.context,
1238
+ };
1239
+ if (callback) {
1240
+ createAPIRequest<Schema$AcceleratorType>(
1241
+ parameters,
1242
+ callback as BodyResponseCallback<unknown>
1243
+ );
1244
+ } else {
1245
+ return createAPIRequest<Schema$AcceleratorType>(parameters);
1246
+ }
1247
+ }
1248
+
1249
+ /**
1250
+ * Lists accelerator types supported by this API.
1251
+ * @example
1252
+ * ```js
1253
+ * // Before running the sample:
1254
+ * // - Enable the API at:
1255
+ * // https://console.developers.google.com/apis/api/tpu.googleapis.com
1256
+ * // - Login into gcloud by running:
1257
+ * // `$ gcloud auth application-default login`
1258
+ * // - Install the npm module by running:
1259
+ * // `$ npm install googleapis`
1260
+ *
1261
+ * const {google} = require('googleapis');
1262
+ * const tpu = google.tpu('v2');
1263
+ *
1264
+ * async function main() {
1265
+ * const auth = new google.auth.GoogleAuth({
1266
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1267
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
1268
+ * });
1269
+ *
1270
+ * // Acquire an auth client, and bind it to all future calls
1271
+ * const authClient = await auth.getClient();
1272
+ * google.options({auth: authClient});
1273
+ *
1274
+ * // Do the magic
1275
+ * const res = await tpu.projects.locations.acceleratorTypes.list({
1276
+ * // List filter.
1277
+ * filter: 'placeholder-value',
1278
+ * // Sort results.
1279
+ * orderBy: 'placeholder-value',
1280
+ * // The maximum number of items to return.
1281
+ * pageSize: 'placeholder-value',
1282
+ * // The next_page_token value returned from a previous List request, if any.
1283
+ * pageToken: 'placeholder-value',
1284
+ * // Required. The parent resource name.
1285
+ * parent: 'projects/my-project/locations/my-location',
1286
+ * });
1287
+ * console.log(res.data);
1288
+ *
1289
+ * // Example response
1290
+ * // {
1291
+ * // "acceleratorTypes": [],
1292
+ * // "nextPageToken": "my_nextPageToken",
1293
+ * // "unreachable": []
1294
+ * // }
1295
+ * }
1296
+ *
1297
+ * main().catch(e => {
1298
+ * console.error(e);
1299
+ * throw e;
1300
+ * });
1301
+ *
1302
+ * ```
1303
+ *
1304
+ * @param params - Parameters for request
1305
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
1306
+ * @param callback - Optional callback that handles the response.
1307
+ * @returns A promise if used with async/await, or void if used with a callback.
1308
+ */
1309
+ list(
1310
+ params: Params$Resource$Projects$Locations$Acceleratortypes$List,
1311
+ options: StreamMethodOptions
1312
+ ): GaxiosPromise<Readable>;
1313
+ list(
1314
+ params?: Params$Resource$Projects$Locations$Acceleratortypes$List,
1315
+ options?: MethodOptions
1316
+ ): GaxiosPromise<Schema$ListAcceleratorTypesResponse>;
1317
+ list(
1318
+ params: Params$Resource$Projects$Locations$Acceleratortypes$List,
1319
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
1320
+ callback: BodyResponseCallback<Readable>
1321
+ ): void;
1322
+ list(
1323
+ params: Params$Resource$Projects$Locations$Acceleratortypes$List,
1324
+ options:
1325
+ | MethodOptions
1326
+ | BodyResponseCallback<Schema$ListAcceleratorTypesResponse>,
1327
+ callback: BodyResponseCallback<Schema$ListAcceleratorTypesResponse>
1328
+ ): void;
1329
+ list(
1330
+ params: Params$Resource$Projects$Locations$Acceleratortypes$List,
1331
+ callback: BodyResponseCallback<Schema$ListAcceleratorTypesResponse>
1332
+ ): void;
1333
+ list(
1334
+ callback: BodyResponseCallback<Schema$ListAcceleratorTypesResponse>
1335
+ ): void;
1336
+ list(
1337
+ paramsOrCallback?:
1338
+ | Params$Resource$Projects$Locations$Acceleratortypes$List
1339
+ | BodyResponseCallback<Schema$ListAcceleratorTypesResponse>
1340
+ | BodyResponseCallback<Readable>,
1341
+ optionsOrCallback?:
1342
+ | MethodOptions
1343
+ | StreamMethodOptions
1344
+ | BodyResponseCallback<Schema$ListAcceleratorTypesResponse>
1345
+ | BodyResponseCallback<Readable>,
1346
+ callback?:
1347
+ | BodyResponseCallback<Schema$ListAcceleratorTypesResponse>
1348
+ | BodyResponseCallback<Readable>
1349
+ ):
1350
+ | void
1351
+ | GaxiosPromise<Schema$ListAcceleratorTypesResponse>
1352
+ | GaxiosPromise<Readable> {
1353
+ let params = (paramsOrCallback ||
1354
+ {}) as Params$Resource$Projects$Locations$Acceleratortypes$List;
1355
+ let options = (optionsOrCallback || {}) as MethodOptions;
1356
+
1357
+ if (typeof paramsOrCallback === 'function') {
1358
+ callback = paramsOrCallback;
1359
+ params = {} as Params$Resource$Projects$Locations$Acceleratortypes$List;
1360
+ options = {};
1361
+ }
1362
+
1363
+ if (typeof optionsOrCallback === 'function') {
1364
+ callback = optionsOrCallback;
1365
+ options = {};
1366
+ }
1367
+
1368
+ const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/';
1369
+ const parameters = {
1370
+ options: Object.assign(
1371
+ {
1372
+ url: (rootUrl + '/v2/{+parent}/acceleratorTypes').replace(
1373
+ /([^:]\/)\/+/g,
1374
+ '$1'
1375
+ ),
1376
+ method: 'GET',
1377
+ },
1378
+ options
1379
+ ),
1380
+ params,
1381
+ requiredParams: ['parent'],
1382
+ pathParams: ['parent'],
1383
+ context: this.context,
1384
+ };
1385
+ if (callback) {
1386
+ createAPIRequest<Schema$ListAcceleratorTypesResponse>(
1387
+ parameters,
1388
+ callback as BodyResponseCallback<unknown>
1389
+ );
1390
+ } else {
1391
+ return createAPIRequest<Schema$ListAcceleratorTypesResponse>(
1392
+ parameters
1393
+ );
1394
+ }
1395
+ }
1396
+ }
1397
+
1398
+ export interface Params$Resource$Projects$Locations$Acceleratortypes$Get
1399
+ extends StandardParameters {
1400
+ /**
1401
+ * Required. The resource name.
1402
+ */
1403
+ name?: string;
1404
+ }
1405
+ export interface Params$Resource$Projects$Locations$Acceleratortypes$List
1406
+ extends StandardParameters {
1407
+ /**
1408
+ * List filter.
1409
+ */
1410
+ filter?: string;
1411
+ /**
1412
+ * Sort results.
1413
+ */
1414
+ orderBy?: string;
1415
+ /**
1416
+ * The maximum number of items to return.
1417
+ */
1418
+ pageSize?: number;
1419
+ /**
1420
+ * The next_page_token value returned from a previous List request, if any.
1421
+ */
1422
+ pageToken?: string;
1423
+ /**
1424
+ * Required. The parent resource name.
1425
+ */
1426
+ parent?: string;
1427
+ }
1428
+
1429
+ export class Resource$Projects$Locations$Nodes {
1430
+ context: APIRequestContext;
1431
+ constructor(context: APIRequestContext) {
1432
+ this.context = context;
1433
+ }
1434
+
1435
+ /**
1436
+ * Creates a node.
1437
+ * @example
1438
+ * ```js
1439
+ * // Before running the sample:
1440
+ * // - Enable the API at:
1441
+ * // https://console.developers.google.com/apis/api/tpu.googleapis.com
1442
+ * // - Login into gcloud by running:
1443
+ * // `$ gcloud auth application-default login`
1444
+ * // - Install the npm module by running:
1445
+ * // `$ npm install googleapis`
1446
+ *
1447
+ * const {google} = require('googleapis');
1448
+ * const tpu = google.tpu('v2');
1449
+ *
1450
+ * async function main() {
1451
+ * const auth = new google.auth.GoogleAuth({
1452
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1453
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
1454
+ * });
1455
+ *
1456
+ * // Acquire an auth client, and bind it to all future calls
1457
+ * const authClient = await auth.getClient();
1458
+ * google.options({auth: authClient});
1459
+ *
1460
+ * // Do the magic
1461
+ * const res = await tpu.projects.locations.nodes.create({
1462
+ * // The unqualified resource name.
1463
+ * nodeId: 'placeholder-value',
1464
+ * // Required. The parent resource name.
1465
+ * parent: 'projects/my-project/locations/my-location',
1466
+ *
1467
+ * // Request body metadata
1468
+ * requestBody: {
1469
+ * // request body parameters
1470
+ * // {
1471
+ * // "acceleratorType": "my_acceleratorType",
1472
+ * // "apiVersion": "my_apiVersion",
1473
+ * // "cidrBlock": "my_cidrBlock",
1474
+ * // "createTime": "my_createTime",
1475
+ * // "dataDisks": [],
1476
+ * // "description": "my_description",
1477
+ * // "health": "my_health",
1478
+ * // "healthDescription": "my_healthDescription",
1479
+ * // "id": "my_id",
1480
+ * // "labels": {},
1481
+ * // "metadata": {},
1482
+ * // "name": "my_name",
1483
+ * // "networkConfig": {},
1484
+ * // "networkEndpoints": [],
1485
+ * // "runtimeVersion": "my_runtimeVersion",
1486
+ * // "schedulingConfig": {},
1487
+ * // "serviceAccount": {},
1488
+ * // "shieldedInstanceConfig": {},
1489
+ * // "state": "my_state",
1490
+ * // "symptoms": [],
1491
+ * // "tags": []
1492
+ * // }
1493
+ * },
1494
+ * });
1495
+ * console.log(res.data);
1496
+ *
1497
+ * // Example response
1498
+ * // {
1499
+ * // "done": false,
1500
+ * // "error": {},
1501
+ * // "metadata": {},
1502
+ * // "name": "my_name",
1503
+ * // "response": {}
1504
+ * // }
1505
+ * }
1506
+ *
1507
+ * main().catch(e => {
1508
+ * console.error(e);
1509
+ * throw e;
1510
+ * });
1511
+ *
1512
+ * ```
1513
+ *
1514
+ * @param params - Parameters for request
1515
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
1516
+ * @param callback - Optional callback that handles the response.
1517
+ * @returns A promise if used with async/await, or void if used with a callback.
1518
+ */
1519
+ create(
1520
+ params: Params$Resource$Projects$Locations$Nodes$Create,
1521
+ options: StreamMethodOptions
1522
+ ): GaxiosPromise<Readable>;
1523
+ create(
1524
+ params?: Params$Resource$Projects$Locations$Nodes$Create,
1525
+ options?: MethodOptions
1526
+ ): GaxiosPromise<Schema$Operation>;
1527
+ create(
1528
+ params: Params$Resource$Projects$Locations$Nodes$Create,
1529
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
1530
+ callback: BodyResponseCallback<Readable>
1531
+ ): void;
1532
+ create(
1533
+ params: Params$Resource$Projects$Locations$Nodes$Create,
1534
+ options: MethodOptions | BodyResponseCallback<Schema$Operation>,
1535
+ callback: BodyResponseCallback<Schema$Operation>
1536
+ ): void;
1537
+ create(
1538
+ params: Params$Resource$Projects$Locations$Nodes$Create,
1539
+ callback: BodyResponseCallback<Schema$Operation>
1540
+ ): void;
1541
+ create(callback: BodyResponseCallback<Schema$Operation>): void;
1542
+ create(
1543
+ paramsOrCallback?:
1544
+ | Params$Resource$Projects$Locations$Nodes$Create
1545
+ | BodyResponseCallback<Schema$Operation>
1546
+ | BodyResponseCallback<Readable>,
1547
+ optionsOrCallback?:
1548
+ | MethodOptions
1549
+ | StreamMethodOptions
1550
+ | BodyResponseCallback<Schema$Operation>
1551
+ | BodyResponseCallback<Readable>,
1552
+ callback?:
1553
+ | BodyResponseCallback<Schema$Operation>
1554
+ | BodyResponseCallback<Readable>
1555
+ ): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
1556
+ let params = (paramsOrCallback ||
1557
+ {}) as Params$Resource$Projects$Locations$Nodes$Create;
1558
+ let options = (optionsOrCallback || {}) as MethodOptions;
1559
+
1560
+ if (typeof paramsOrCallback === 'function') {
1561
+ callback = paramsOrCallback;
1562
+ params = {} as Params$Resource$Projects$Locations$Nodes$Create;
1563
+ options = {};
1564
+ }
1565
+
1566
+ if (typeof optionsOrCallback === 'function') {
1567
+ callback = optionsOrCallback;
1568
+ options = {};
1569
+ }
1570
+
1571
+ const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/';
1572
+ const parameters = {
1573
+ options: Object.assign(
1574
+ {
1575
+ url: (rootUrl + '/v2/{+parent}/nodes').replace(
1576
+ /([^:]\/)\/+/g,
1577
+ '$1'
1578
+ ),
1579
+ method: 'POST',
1580
+ },
1581
+ options
1582
+ ),
1583
+ params,
1584
+ requiredParams: ['parent'],
1585
+ pathParams: ['parent'],
1586
+ context: this.context,
1587
+ };
1588
+ if (callback) {
1589
+ createAPIRequest<Schema$Operation>(
1590
+ parameters,
1591
+ callback as BodyResponseCallback<unknown>
1592
+ );
1593
+ } else {
1594
+ return createAPIRequest<Schema$Operation>(parameters);
1595
+ }
1596
+ }
1597
+
1598
+ /**
1599
+ * Deletes a node.
1600
+ * @example
1601
+ * ```js
1602
+ * // Before running the sample:
1603
+ * // - Enable the API at:
1604
+ * // https://console.developers.google.com/apis/api/tpu.googleapis.com
1605
+ * // - Login into gcloud by running:
1606
+ * // `$ gcloud auth application-default login`
1607
+ * // - Install the npm module by running:
1608
+ * // `$ npm install googleapis`
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.nodes.delete({
1625
+ * // Required. The resource name.
1626
+ * name: 'projects/my-project/locations/my-location/nodes/my-node',
1627
+ * });
1628
+ * console.log(res.data);
1629
+ *
1630
+ * // Example response
1631
+ * // {
1632
+ * // "done": false,
1633
+ * // "error": {},
1634
+ * // "metadata": {},
1635
+ * // "name": "my_name",
1636
+ * // "response": {}
1637
+ * // }
1638
+ * }
1639
+ *
1640
+ * main().catch(e => {
1641
+ * console.error(e);
1642
+ * throw e;
1643
+ * });
1644
+ *
1645
+ * ```
1646
+ *
1647
+ * @param params - Parameters for request
1648
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
1649
+ * @param callback - Optional callback that handles the response.
1650
+ * @returns A promise if used with async/await, or void if used with a callback.
1651
+ */
1652
+ delete(
1653
+ params: Params$Resource$Projects$Locations$Nodes$Delete,
1654
+ options: StreamMethodOptions
1655
+ ): GaxiosPromise<Readable>;
1656
+ delete(
1657
+ params?: Params$Resource$Projects$Locations$Nodes$Delete,
1658
+ options?: MethodOptions
1659
+ ): GaxiosPromise<Schema$Operation>;
1660
+ delete(
1661
+ params: Params$Resource$Projects$Locations$Nodes$Delete,
1662
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
1663
+ callback: BodyResponseCallback<Readable>
1664
+ ): void;
1665
+ delete(
1666
+ params: Params$Resource$Projects$Locations$Nodes$Delete,
1667
+ options: MethodOptions | BodyResponseCallback<Schema$Operation>,
1668
+ callback: BodyResponseCallback<Schema$Operation>
1669
+ ): void;
1670
+ delete(
1671
+ params: Params$Resource$Projects$Locations$Nodes$Delete,
1672
+ callback: BodyResponseCallback<Schema$Operation>
1673
+ ): void;
1674
+ delete(callback: BodyResponseCallback<Schema$Operation>): void;
1675
+ delete(
1676
+ paramsOrCallback?:
1677
+ | Params$Resource$Projects$Locations$Nodes$Delete
1678
+ | BodyResponseCallback<Schema$Operation>
1679
+ | BodyResponseCallback<Readable>,
1680
+ optionsOrCallback?:
1681
+ | MethodOptions
1682
+ | StreamMethodOptions
1683
+ | BodyResponseCallback<Schema$Operation>
1684
+ | BodyResponseCallback<Readable>,
1685
+ callback?:
1686
+ | BodyResponseCallback<Schema$Operation>
1687
+ | BodyResponseCallback<Readable>
1688
+ ): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
1689
+ let params = (paramsOrCallback ||
1690
+ {}) as Params$Resource$Projects$Locations$Nodes$Delete;
1691
+ let options = (optionsOrCallback || {}) as MethodOptions;
1692
+
1693
+ if (typeof paramsOrCallback === 'function') {
1694
+ callback = paramsOrCallback;
1695
+ params = {} as Params$Resource$Projects$Locations$Nodes$Delete;
1696
+ options = {};
1697
+ }
1698
+
1699
+ if (typeof optionsOrCallback === 'function') {
1700
+ callback = optionsOrCallback;
1701
+ options = {};
1702
+ }
1703
+
1704
+ const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/';
1705
+ const parameters = {
1706
+ options: Object.assign(
1707
+ {
1708
+ url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'),
1709
+ method: 'DELETE',
1710
+ },
1711
+ options
1712
+ ),
1713
+ params,
1714
+ requiredParams: ['name'],
1715
+ pathParams: ['name'],
1716
+ context: this.context,
1717
+ };
1718
+ if (callback) {
1719
+ createAPIRequest<Schema$Operation>(
1720
+ parameters,
1721
+ callback as BodyResponseCallback<unknown>
1722
+ );
1723
+ } else {
1724
+ return createAPIRequest<Schema$Operation>(parameters);
1725
+ }
1726
+ }
1727
+
1728
+ /**
1729
+ * Gets the details of a node.
1730
+ * @example
1731
+ * ```js
1732
+ * // Before running the sample:
1733
+ * // - Enable the API at:
1734
+ * // https://console.developers.google.com/apis/api/tpu.googleapis.com
1735
+ * // - Login into gcloud by running:
1736
+ * // `$ gcloud auth application-default login`
1737
+ * // - Install the npm module by running:
1738
+ * // `$ npm install googleapis`
1739
+ *
1740
+ * const {google} = require('googleapis');
1741
+ * const tpu = google.tpu('v2');
1742
+ *
1743
+ * async function main() {
1744
+ * const auth = new google.auth.GoogleAuth({
1745
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1746
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
1747
+ * });
1748
+ *
1749
+ * // Acquire an auth client, and bind it to all future calls
1750
+ * const authClient = await auth.getClient();
1751
+ * google.options({auth: authClient});
1752
+ *
1753
+ * // Do the magic
1754
+ * const res = await tpu.projects.locations.nodes.get({
1755
+ * // Required. The resource name.
1756
+ * name: 'projects/my-project/locations/my-location/nodes/my-node',
1757
+ * });
1758
+ * console.log(res.data);
1759
+ *
1760
+ * // Example response
1761
+ * // {
1762
+ * // "acceleratorType": "my_acceleratorType",
1763
+ * // "apiVersion": "my_apiVersion",
1764
+ * // "cidrBlock": "my_cidrBlock",
1765
+ * // "createTime": "my_createTime",
1766
+ * // "dataDisks": [],
1767
+ * // "description": "my_description",
1768
+ * // "health": "my_health",
1769
+ * // "healthDescription": "my_healthDescription",
1770
+ * // "id": "my_id",
1771
+ * // "labels": {},
1772
+ * // "metadata": {},
1773
+ * // "name": "my_name",
1774
+ * // "networkConfig": {},
1775
+ * // "networkEndpoints": [],
1776
+ * // "runtimeVersion": "my_runtimeVersion",
1777
+ * // "schedulingConfig": {},
1778
+ * // "serviceAccount": {},
1779
+ * // "shieldedInstanceConfig": {},
1780
+ * // "state": "my_state",
1781
+ * // "symptoms": [],
1782
+ * // "tags": []
1783
+ * // }
1784
+ * }
1785
+ *
1786
+ * main().catch(e => {
1787
+ * console.error(e);
1788
+ * throw e;
1789
+ * });
1790
+ *
1791
+ * ```
1792
+ *
1793
+ * @param params - Parameters for request
1794
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
1795
+ * @param callback - Optional callback that handles the response.
1796
+ * @returns A promise if used with async/await, or void if used with a callback.
1797
+ */
1798
+ get(
1799
+ params: Params$Resource$Projects$Locations$Nodes$Get,
1800
+ options: StreamMethodOptions
1801
+ ): GaxiosPromise<Readable>;
1802
+ get(
1803
+ params?: Params$Resource$Projects$Locations$Nodes$Get,
1804
+ options?: MethodOptions
1805
+ ): GaxiosPromise<Schema$Node>;
1806
+ get(
1807
+ params: Params$Resource$Projects$Locations$Nodes$Get,
1808
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
1809
+ callback: BodyResponseCallback<Readable>
1810
+ ): void;
1811
+ get(
1812
+ params: Params$Resource$Projects$Locations$Nodes$Get,
1813
+ options: MethodOptions | BodyResponseCallback<Schema$Node>,
1814
+ callback: BodyResponseCallback<Schema$Node>
1815
+ ): void;
1816
+ get(
1817
+ params: Params$Resource$Projects$Locations$Nodes$Get,
1818
+ callback: BodyResponseCallback<Schema$Node>
1819
+ ): void;
1820
+ get(callback: BodyResponseCallback<Schema$Node>): void;
1821
+ get(
1822
+ paramsOrCallback?:
1823
+ | Params$Resource$Projects$Locations$Nodes$Get
1824
+ | BodyResponseCallback<Schema$Node>
1825
+ | BodyResponseCallback<Readable>,
1826
+ optionsOrCallback?:
1827
+ | MethodOptions
1828
+ | StreamMethodOptions
1829
+ | BodyResponseCallback<Schema$Node>
1830
+ | BodyResponseCallback<Readable>,
1831
+ callback?:
1832
+ | BodyResponseCallback<Schema$Node>
1833
+ | BodyResponseCallback<Readable>
1834
+ ): void | GaxiosPromise<Schema$Node> | GaxiosPromise<Readable> {
1835
+ let params = (paramsOrCallback ||
1836
+ {}) as Params$Resource$Projects$Locations$Nodes$Get;
1837
+ let options = (optionsOrCallback || {}) as MethodOptions;
1838
+
1839
+ if (typeof paramsOrCallback === 'function') {
1840
+ callback = paramsOrCallback;
1841
+ params = {} as Params$Resource$Projects$Locations$Nodes$Get;
1842
+ options = {};
1843
+ }
1844
+
1845
+ if (typeof optionsOrCallback === 'function') {
1846
+ callback = optionsOrCallback;
1847
+ options = {};
1848
+ }
1849
+
1850
+ const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/';
1851
+ const parameters = {
1852
+ options: Object.assign(
1853
+ {
1854
+ url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'),
1855
+ method: 'GET',
1856
+ },
1857
+ options
1858
+ ),
1859
+ params,
1860
+ requiredParams: ['name'],
1861
+ pathParams: ['name'],
1862
+ context: this.context,
1863
+ };
1864
+ if (callback) {
1865
+ createAPIRequest<Schema$Node>(
1866
+ parameters,
1867
+ callback as BodyResponseCallback<unknown>
1868
+ );
1869
+ } else {
1870
+ return createAPIRequest<Schema$Node>(parameters);
1871
+ }
1872
+ }
1873
+
1874
+ /**
1875
+ * Retrieves the guest attributes for the node.
1876
+ * @example
1877
+ * ```js
1878
+ * // Before running the sample:
1879
+ * // - Enable the API at:
1880
+ * // https://console.developers.google.com/apis/api/tpu.googleapis.com
1881
+ * // - Login into gcloud by running:
1882
+ * // `$ gcloud auth application-default login`
1883
+ * // - Install the npm module by running:
1884
+ * // `$ npm install googleapis`
1885
+ *
1886
+ * const {google} = require('googleapis');
1887
+ * const tpu = google.tpu('v2');
1888
+ *
1889
+ * async function main() {
1890
+ * const auth = new google.auth.GoogleAuth({
1891
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1892
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
1893
+ * });
1894
+ *
1895
+ * // Acquire an auth client, and bind it to all future calls
1896
+ * const authClient = await auth.getClient();
1897
+ * google.options({auth: authClient});
1898
+ *
1899
+ * // Do the magic
1900
+ * const res = await tpu.projects.locations.nodes.getGuestAttributes({
1901
+ * // Required. The resource name.
1902
+ * name: 'projects/my-project/locations/my-location/nodes/my-node',
1903
+ *
1904
+ * // Request body metadata
1905
+ * requestBody: {
1906
+ * // request body parameters
1907
+ * // {
1908
+ * // "queryPath": "my_queryPath",
1909
+ * // "workerIds": []
1910
+ * // }
1911
+ * },
1912
+ * });
1913
+ * console.log(res.data);
1914
+ *
1915
+ * // Example response
1916
+ * // {
1917
+ * // "guestAttributes": []
1918
+ * // }
1919
+ * }
1920
+ *
1921
+ * main().catch(e => {
1922
+ * console.error(e);
1923
+ * throw e;
1924
+ * });
1925
+ *
1926
+ * ```
1927
+ *
1928
+ * @param params - Parameters for request
1929
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
1930
+ * @param callback - Optional callback that handles the response.
1931
+ * @returns A promise if used with async/await, or void if used with a callback.
1932
+ */
1933
+ getGuestAttributes(
1934
+ params: Params$Resource$Projects$Locations$Nodes$Getguestattributes,
1935
+ options: StreamMethodOptions
1936
+ ): GaxiosPromise<Readable>;
1937
+ getGuestAttributes(
1938
+ params?: Params$Resource$Projects$Locations$Nodes$Getguestattributes,
1939
+ options?: MethodOptions
1940
+ ): GaxiosPromise<Schema$GetGuestAttributesResponse>;
1941
+ getGuestAttributes(
1942
+ params: Params$Resource$Projects$Locations$Nodes$Getguestattributes,
1943
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
1944
+ callback: BodyResponseCallback<Readable>
1945
+ ): void;
1946
+ getGuestAttributes(
1947
+ params: Params$Resource$Projects$Locations$Nodes$Getguestattributes,
1948
+ options:
1949
+ | MethodOptions
1950
+ | BodyResponseCallback<Schema$GetGuestAttributesResponse>,
1951
+ callback: BodyResponseCallback<Schema$GetGuestAttributesResponse>
1952
+ ): void;
1953
+ getGuestAttributes(
1954
+ params: Params$Resource$Projects$Locations$Nodes$Getguestattributes,
1955
+ callback: BodyResponseCallback<Schema$GetGuestAttributesResponse>
1956
+ ): void;
1957
+ getGuestAttributes(
1958
+ callback: BodyResponseCallback<Schema$GetGuestAttributesResponse>
1959
+ ): void;
1960
+ getGuestAttributes(
1961
+ paramsOrCallback?:
1962
+ | Params$Resource$Projects$Locations$Nodes$Getguestattributes
1963
+ | BodyResponseCallback<Schema$GetGuestAttributesResponse>
1964
+ | BodyResponseCallback<Readable>,
1965
+ optionsOrCallback?:
1966
+ | MethodOptions
1967
+ | StreamMethodOptions
1968
+ | BodyResponseCallback<Schema$GetGuestAttributesResponse>
1969
+ | BodyResponseCallback<Readable>,
1970
+ callback?:
1971
+ | BodyResponseCallback<Schema$GetGuestAttributesResponse>
1972
+ | BodyResponseCallback<Readable>
1973
+ ):
1974
+ | void
1975
+ | GaxiosPromise<Schema$GetGuestAttributesResponse>
1976
+ | GaxiosPromise<Readable> {
1977
+ let params = (paramsOrCallback ||
1978
+ {}) as Params$Resource$Projects$Locations$Nodes$Getguestattributes;
1979
+ let options = (optionsOrCallback || {}) as MethodOptions;
1980
+
1981
+ if (typeof paramsOrCallback === 'function') {
1982
+ callback = paramsOrCallback;
1983
+ params =
1984
+ {} as Params$Resource$Projects$Locations$Nodes$Getguestattributes;
1985
+ options = {};
1986
+ }
1987
+
1988
+ if (typeof optionsOrCallback === 'function') {
1989
+ callback = optionsOrCallback;
1990
+ options = {};
1991
+ }
1992
+
1993
+ const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/';
1994
+ const parameters = {
1995
+ options: Object.assign(
1996
+ {
1997
+ url: (rootUrl + '/v2/{+name}:getGuestAttributes').replace(
1998
+ /([^:]\/)\/+/g,
1999
+ '$1'
2000
+ ),
2001
+ method: 'POST',
2002
+ },
2003
+ options
2004
+ ),
2005
+ params,
2006
+ requiredParams: ['name'],
2007
+ pathParams: ['name'],
2008
+ context: this.context,
2009
+ };
2010
+ if (callback) {
2011
+ createAPIRequest<Schema$GetGuestAttributesResponse>(
2012
+ parameters,
2013
+ callback as BodyResponseCallback<unknown>
2014
+ );
2015
+ } else {
2016
+ return createAPIRequest<Schema$GetGuestAttributesResponse>(parameters);
2017
+ }
2018
+ }
2019
+
2020
+ /**
2021
+ * Lists nodes.
2022
+ * @example
2023
+ * ```js
2024
+ * // Before running the sample:
2025
+ * // - Enable the API at:
2026
+ * // https://console.developers.google.com/apis/api/tpu.googleapis.com
2027
+ * // - Login into gcloud by running:
2028
+ * // `$ gcloud auth application-default login`
2029
+ * // - Install the npm module by running:
2030
+ * // `$ npm install googleapis`
2031
+ *
2032
+ * const {google} = require('googleapis');
2033
+ * const tpu = google.tpu('v2');
2034
+ *
2035
+ * async function main() {
2036
+ * const auth = new google.auth.GoogleAuth({
2037
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2038
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
2039
+ * });
2040
+ *
2041
+ * // Acquire an auth client, and bind it to all future calls
2042
+ * const authClient = await auth.getClient();
2043
+ * google.options({auth: authClient});
2044
+ *
2045
+ * // Do the magic
2046
+ * const res = await tpu.projects.locations.nodes.list({
2047
+ * // The maximum number of items to return.
2048
+ * pageSize: 'placeholder-value',
2049
+ * // The next_page_token value returned from a previous List request, if any.
2050
+ * pageToken: 'placeholder-value',
2051
+ * // Required. The parent resource name.
2052
+ * parent: 'projects/my-project/locations/my-location',
2053
+ * });
2054
+ * console.log(res.data);
2055
+ *
2056
+ * // Example response
2057
+ * // {
2058
+ * // "nextPageToken": "my_nextPageToken",
2059
+ * // "nodes": [],
2060
+ * // "unreachable": []
2061
+ * // }
2062
+ * }
2063
+ *
2064
+ * main().catch(e => {
2065
+ * console.error(e);
2066
+ * throw e;
2067
+ * });
2068
+ *
2069
+ * ```
2070
+ *
2071
+ * @param params - Parameters for request
2072
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
2073
+ * @param callback - Optional callback that handles the response.
2074
+ * @returns A promise if used with async/await, or void if used with a callback.
2075
+ */
2076
+ list(
2077
+ params: Params$Resource$Projects$Locations$Nodes$List,
2078
+ options: StreamMethodOptions
2079
+ ): GaxiosPromise<Readable>;
2080
+ list(
2081
+ params?: Params$Resource$Projects$Locations$Nodes$List,
2082
+ options?: MethodOptions
2083
+ ): GaxiosPromise<Schema$ListNodesResponse>;
2084
+ list(
2085
+ params: Params$Resource$Projects$Locations$Nodes$List,
2086
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
2087
+ callback: BodyResponseCallback<Readable>
2088
+ ): void;
2089
+ list(
2090
+ params: Params$Resource$Projects$Locations$Nodes$List,
2091
+ options: MethodOptions | BodyResponseCallback<Schema$ListNodesResponse>,
2092
+ callback: BodyResponseCallback<Schema$ListNodesResponse>
2093
+ ): void;
2094
+ list(
2095
+ params: Params$Resource$Projects$Locations$Nodes$List,
2096
+ callback: BodyResponseCallback<Schema$ListNodesResponse>
2097
+ ): void;
2098
+ list(callback: BodyResponseCallback<Schema$ListNodesResponse>): void;
2099
+ list(
2100
+ paramsOrCallback?:
2101
+ | Params$Resource$Projects$Locations$Nodes$List
2102
+ | BodyResponseCallback<Schema$ListNodesResponse>
2103
+ | BodyResponseCallback<Readable>,
2104
+ optionsOrCallback?:
2105
+ | MethodOptions
2106
+ | StreamMethodOptions
2107
+ | BodyResponseCallback<Schema$ListNodesResponse>
2108
+ | BodyResponseCallback<Readable>,
2109
+ callback?:
2110
+ | BodyResponseCallback<Schema$ListNodesResponse>
2111
+ | BodyResponseCallback<Readable>
2112
+ ):
2113
+ | void
2114
+ | GaxiosPromise<Schema$ListNodesResponse>
2115
+ | GaxiosPromise<Readable> {
2116
+ let params = (paramsOrCallback ||
2117
+ {}) as Params$Resource$Projects$Locations$Nodes$List;
2118
+ let options = (optionsOrCallback || {}) as MethodOptions;
2119
+
2120
+ if (typeof paramsOrCallback === 'function') {
2121
+ callback = paramsOrCallback;
2122
+ params = {} as Params$Resource$Projects$Locations$Nodes$List;
2123
+ options = {};
2124
+ }
2125
+
2126
+ if (typeof optionsOrCallback === 'function') {
2127
+ callback = optionsOrCallback;
2128
+ options = {};
2129
+ }
2130
+
2131
+ const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/';
2132
+ const parameters = {
2133
+ options: Object.assign(
2134
+ {
2135
+ url: (rootUrl + '/v2/{+parent}/nodes').replace(
2136
+ /([^:]\/)\/+/g,
2137
+ '$1'
2138
+ ),
2139
+ method: 'GET',
2140
+ },
2141
+ options
2142
+ ),
2143
+ params,
2144
+ requiredParams: ['parent'],
2145
+ pathParams: ['parent'],
2146
+ context: this.context,
2147
+ };
2148
+ if (callback) {
2149
+ createAPIRequest<Schema$ListNodesResponse>(
2150
+ parameters,
2151
+ callback as BodyResponseCallback<unknown>
2152
+ );
2153
+ } else {
2154
+ return createAPIRequest<Schema$ListNodesResponse>(parameters);
2155
+ }
2156
+ }
2157
+
2158
+ /**
2159
+ * Updates the configurations of a node.
2160
+ * @example
2161
+ * ```js
2162
+ * // Before running the sample:
2163
+ * // - Enable the API at:
2164
+ * // https://console.developers.google.com/apis/api/tpu.googleapis.com
2165
+ * // - Login into gcloud by running:
2166
+ * // `$ gcloud auth application-default login`
2167
+ * // - Install the npm module by running:
2168
+ * // `$ npm install googleapis`
2169
+ *
2170
+ * const {google} = require('googleapis');
2171
+ * const tpu = google.tpu('v2');
2172
+ *
2173
+ * async function main() {
2174
+ * const auth = new google.auth.GoogleAuth({
2175
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2176
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
2177
+ * });
2178
+ *
2179
+ * // Acquire an auth client, and bind it to all future calls
2180
+ * const authClient = await auth.getClient();
2181
+ * google.options({auth: authClient});
2182
+ *
2183
+ * // Do the magic
2184
+ * const res = await tpu.projects.locations.nodes.patch({
2185
+ * // Output only. Immutable. The name of the TPU.
2186
+ * name: 'projects/my-project/locations/my-location/nodes/my-node',
2187
+ * // Required. Mask of fields from Node to update. Supported fields: [description, tags, labels, metadata, network_config.enable_external_ips].
2188
+ * updateMask: 'placeholder-value',
2189
+ *
2190
+ * // Request body metadata
2191
+ * requestBody: {
2192
+ * // request body parameters
2193
+ * // {
2194
+ * // "acceleratorType": "my_acceleratorType",
2195
+ * // "apiVersion": "my_apiVersion",
2196
+ * // "cidrBlock": "my_cidrBlock",
2197
+ * // "createTime": "my_createTime",
2198
+ * // "dataDisks": [],
2199
+ * // "description": "my_description",
2200
+ * // "health": "my_health",
2201
+ * // "healthDescription": "my_healthDescription",
2202
+ * // "id": "my_id",
2203
+ * // "labels": {},
2204
+ * // "metadata": {},
2205
+ * // "name": "my_name",
2206
+ * // "networkConfig": {},
2207
+ * // "networkEndpoints": [],
2208
+ * // "runtimeVersion": "my_runtimeVersion",
2209
+ * // "schedulingConfig": {},
2210
+ * // "serviceAccount": {},
2211
+ * // "shieldedInstanceConfig": {},
2212
+ * // "state": "my_state",
2213
+ * // "symptoms": [],
2214
+ * // "tags": []
2215
+ * // }
2216
+ * },
2217
+ * });
2218
+ * console.log(res.data);
2219
+ *
2220
+ * // Example response
2221
+ * // {
2222
+ * // "done": false,
2223
+ * // "error": {},
2224
+ * // "metadata": {},
2225
+ * // "name": "my_name",
2226
+ * // "response": {}
2227
+ * // }
2228
+ * }
2229
+ *
2230
+ * main().catch(e => {
2231
+ * console.error(e);
2232
+ * throw e;
2233
+ * });
2234
+ *
2235
+ * ```
2236
+ *
2237
+ * @param params - Parameters for request
2238
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
2239
+ * @param callback - Optional callback that handles the response.
2240
+ * @returns A promise if used with async/await, or void if used with a callback.
2241
+ */
2242
+ patch(
2243
+ params: Params$Resource$Projects$Locations$Nodes$Patch,
2244
+ options: StreamMethodOptions
2245
+ ): GaxiosPromise<Readable>;
2246
+ patch(
2247
+ params?: Params$Resource$Projects$Locations$Nodes$Patch,
2248
+ options?: MethodOptions
2249
+ ): GaxiosPromise<Schema$Operation>;
2250
+ patch(
2251
+ params: Params$Resource$Projects$Locations$Nodes$Patch,
2252
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
2253
+ callback: BodyResponseCallback<Readable>
2254
+ ): void;
2255
+ patch(
2256
+ params: Params$Resource$Projects$Locations$Nodes$Patch,
2257
+ options: MethodOptions | BodyResponseCallback<Schema$Operation>,
2258
+ callback: BodyResponseCallback<Schema$Operation>
2259
+ ): void;
2260
+ patch(
2261
+ params: Params$Resource$Projects$Locations$Nodes$Patch,
2262
+ callback: BodyResponseCallback<Schema$Operation>
2263
+ ): void;
2264
+ patch(callback: BodyResponseCallback<Schema$Operation>): void;
2265
+ patch(
2266
+ paramsOrCallback?:
2267
+ | Params$Resource$Projects$Locations$Nodes$Patch
2268
+ | BodyResponseCallback<Schema$Operation>
2269
+ | BodyResponseCallback<Readable>,
2270
+ optionsOrCallback?:
2271
+ | MethodOptions
2272
+ | StreamMethodOptions
2273
+ | BodyResponseCallback<Schema$Operation>
2274
+ | BodyResponseCallback<Readable>,
2275
+ callback?:
2276
+ | BodyResponseCallback<Schema$Operation>
2277
+ | BodyResponseCallback<Readable>
2278
+ ): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
2279
+ let params = (paramsOrCallback ||
2280
+ {}) as Params$Resource$Projects$Locations$Nodes$Patch;
2281
+ let options = (optionsOrCallback || {}) as MethodOptions;
2282
+
2283
+ if (typeof paramsOrCallback === 'function') {
2284
+ callback = paramsOrCallback;
2285
+ params = {} as Params$Resource$Projects$Locations$Nodes$Patch;
2286
+ options = {};
2287
+ }
2288
+
2289
+ if (typeof optionsOrCallback === 'function') {
2290
+ callback = optionsOrCallback;
2291
+ options = {};
2292
+ }
2293
+
2294
+ const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/';
2295
+ const parameters = {
2296
+ options: Object.assign(
2297
+ {
2298
+ url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'),
2299
+ method: 'PATCH',
2300
+ },
2301
+ options
2302
+ ),
2303
+ params,
2304
+ requiredParams: ['name'],
2305
+ pathParams: ['name'],
2306
+ context: this.context,
2307
+ };
2308
+ if (callback) {
2309
+ createAPIRequest<Schema$Operation>(
2310
+ parameters,
2311
+ callback as BodyResponseCallback<unknown>
2312
+ );
2313
+ } else {
2314
+ return createAPIRequest<Schema$Operation>(parameters);
2315
+ }
2316
+ }
2317
+
2318
+ /**
2319
+ * Starts a node.
2320
+ * @example
2321
+ * ```js
2322
+ * // Before running the sample:
2323
+ * // - Enable the API at:
2324
+ * // https://console.developers.google.com/apis/api/tpu.googleapis.com
2325
+ * // - Login into gcloud by running:
2326
+ * // `$ gcloud auth application-default login`
2327
+ * // - Install the npm module by running:
2328
+ * // `$ npm install googleapis`
2329
+ *
2330
+ * const {google} = require('googleapis');
2331
+ * const tpu = google.tpu('v2');
2332
+ *
2333
+ * async function main() {
2334
+ * const auth = new google.auth.GoogleAuth({
2335
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2336
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
2337
+ * });
2338
+ *
2339
+ * // Acquire an auth client, and bind it to all future calls
2340
+ * const authClient = await auth.getClient();
2341
+ * google.options({auth: authClient});
2342
+ *
2343
+ * // Do the magic
2344
+ * const res = await tpu.projects.locations.nodes.start({
2345
+ * // The resource name.
2346
+ * name: 'projects/my-project/locations/my-location/nodes/my-node',
2347
+ *
2348
+ * // Request body metadata
2349
+ * requestBody: {
2350
+ * // request body parameters
2351
+ * // {}
2352
+ * },
2353
+ * });
2354
+ * console.log(res.data);
2355
+ *
2356
+ * // Example response
2357
+ * // {
2358
+ * // "done": false,
2359
+ * // "error": {},
2360
+ * // "metadata": {},
2361
+ * // "name": "my_name",
2362
+ * // "response": {}
2363
+ * // }
2364
+ * }
2365
+ *
2366
+ * main().catch(e => {
2367
+ * console.error(e);
2368
+ * throw e;
2369
+ * });
2370
+ *
2371
+ * ```
2372
+ *
2373
+ * @param params - Parameters for request
2374
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
2375
+ * @param callback - Optional callback that handles the response.
2376
+ * @returns A promise if used with async/await, or void if used with a callback.
2377
+ */
2378
+ start(
2379
+ params: Params$Resource$Projects$Locations$Nodes$Start,
2380
+ options: StreamMethodOptions
2381
+ ): GaxiosPromise<Readable>;
2382
+ start(
2383
+ params?: Params$Resource$Projects$Locations$Nodes$Start,
2384
+ options?: MethodOptions
2385
+ ): GaxiosPromise<Schema$Operation>;
2386
+ start(
2387
+ params: Params$Resource$Projects$Locations$Nodes$Start,
2388
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
2389
+ callback: BodyResponseCallback<Readable>
2390
+ ): void;
2391
+ start(
2392
+ params: Params$Resource$Projects$Locations$Nodes$Start,
2393
+ options: MethodOptions | BodyResponseCallback<Schema$Operation>,
2394
+ callback: BodyResponseCallback<Schema$Operation>
2395
+ ): void;
2396
+ start(
2397
+ params: Params$Resource$Projects$Locations$Nodes$Start,
2398
+ callback: BodyResponseCallback<Schema$Operation>
2399
+ ): void;
2400
+ start(callback: BodyResponseCallback<Schema$Operation>): void;
2401
+ start(
2402
+ paramsOrCallback?:
2403
+ | Params$Resource$Projects$Locations$Nodes$Start
2404
+ | BodyResponseCallback<Schema$Operation>
2405
+ | BodyResponseCallback<Readable>,
2406
+ optionsOrCallback?:
2407
+ | MethodOptions
2408
+ | StreamMethodOptions
2409
+ | BodyResponseCallback<Schema$Operation>
2410
+ | BodyResponseCallback<Readable>,
2411
+ callback?:
2412
+ | BodyResponseCallback<Schema$Operation>
2413
+ | BodyResponseCallback<Readable>
2414
+ ): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
2415
+ let params = (paramsOrCallback ||
2416
+ {}) as Params$Resource$Projects$Locations$Nodes$Start;
2417
+ let options = (optionsOrCallback || {}) as MethodOptions;
2418
+
2419
+ if (typeof paramsOrCallback === 'function') {
2420
+ callback = paramsOrCallback;
2421
+ params = {} as Params$Resource$Projects$Locations$Nodes$Start;
2422
+ options = {};
2423
+ }
2424
+
2425
+ if (typeof optionsOrCallback === 'function') {
2426
+ callback = optionsOrCallback;
2427
+ options = {};
2428
+ }
2429
+
2430
+ const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/';
2431
+ const parameters = {
2432
+ options: Object.assign(
2433
+ {
2434
+ url: (rootUrl + '/v2/{+name}:start').replace(/([^:]\/)\/+/g, '$1'),
2435
+ method: 'POST',
2436
+ },
2437
+ options
2438
+ ),
2439
+ params,
2440
+ requiredParams: ['name'],
2441
+ pathParams: ['name'],
2442
+ context: this.context,
2443
+ };
2444
+ if (callback) {
2445
+ createAPIRequest<Schema$Operation>(
2446
+ parameters,
2447
+ callback as BodyResponseCallback<unknown>
2448
+ );
2449
+ } else {
2450
+ return createAPIRequest<Schema$Operation>(parameters);
2451
+ }
2452
+ }
2453
+
2454
+ /**
2455
+ * Stops a node. This operation is only available with single TPU nodes.
2456
+ * @example
2457
+ * ```js
2458
+ * // Before running the sample:
2459
+ * // - Enable the API at:
2460
+ * // https://console.developers.google.com/apis/api/tpu.googleapis.com
2461
+ * // - Login into gcloud by running:
2462
+ * // `$ gcloud auth application-default login`
2463
+ * // - Install the npm module by running:
2464
+ * // `$ npm install googleapis`
2465
+ *
2466
+ * const {google} = require('googleapis');
2467
+ * const tpu = google.tpu('v2');
2468
+ *
2469
+ * async function main() {
2470
+ * const auth = new google.auth.GoogleAuth({
2471
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2472
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
2473
+ * });
2474
+ *
2475
+ * // Acquire an auth client, and bind it to all future calls
2476
+ * const authClient = await auth.getClient();
2477
+ * google.options({auth: authClient});
2478
+ *
2479
+ * // Do the magic
2480
+ * const res = await tpu.projects.locations.nodes.stop({
2481
+ * // The resource name.
2482
+ * name: 'projects/my-project/locations/my-location/nodes/my-node',
2483
+ *
2484
+ * // Request body metadata
2485
+ * requestBody: {
2486
+ * // request body parameters
2487
+ * // {}
2488
+ * },
2489
+ * });
2490
+ * console.log(res.data);
2491
+ *
2492
+ * // Example response
2493
+ * // {
2494
+ * // "done": false,
2495
+ * // "error": {},
2496
+ * // "metadata": {},
2497
+ * // "name": "my_name",
2498
+ * // "response": {}
2499
+ * // }
2500
+ * }
2501
+ *
2502
+ * main().catch(e => {
2503
+ * console.error(e);
2504
+ * throw e;
2505
+ * });
2506
+ *
2507
+ * ```
2508
+ *
2509
+ * @param params - Parameters for request
2510
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
2511
+ * @param callback - Optional callback that handles the response.
2512
+ * @returns A promise if used with async/await, or void if used with a callback.
2513
+ */
2514
+ stop(
2515
+ params: Params$Resource$Projects$Locations$Nodes$Stop,
2516
+ options: StreamMethodOptions
2517
+ ): GaxiosPromise<Readable>;
2518
+ stop(
2519
+ params?: Params$Resource$Projects$Locations$Nodes$Stop,
2520
+ options?: MethodOptions
2521
+ ): GaxiosPromise<Schema$Operation>;
2522
+ stop(
2523
+ params: Params$Resource$Projects$Locations$Nodes$Stop,
2524
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
2525
+ callback: BodyResponseCallback<Readable>
2526
+ ): void;
2527
+ stop(
2528
+ params: Params$Resource$Projects$Locations$Nodes$Stop,
2529
+ options: MethodOptions | BodyResponseCallback<Schema$Operation>,
2530
+ callback: BodyResponseCallback<Schema$Operation>
2531
+ ): void;
2532
+ stop(
2533
+ params: Params$Resource$Projects$Locations$Nodes$Stop,
2534
+ callback: BodyResponseCallback<Schema$Operation>
2535
+ ): void;
2536
+ stop(callback: BodyResponseCallback<Schema$Operation>): void;
2537
+ stop(
2538
+ paramsOrCallback?:
2539
+ | Params$Resource$Projects$Locations$Nodes$Stop
2540
+ | BodyResponseCallback<Schema$Operation>
2541
+ | BodyResponseCallback<Readable>,
2542
+ optionsOrCallback?:
2543
+ | MethodOptions
2544
+ | StreamMethodOptions
2545
+ | BodyResponseCallback<Schema$Operation>
2546
+ | BodyResponseCallback<Readable>,
2547
+ callback?:
2548
+ | BodyResponseCallback<Schema$Operation>
2549
+ | BodyResponseCallback<Readable>
2550
+ ): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
2551
+ let params = (paramsOrCallback ||
2552
+ {}) as Params$Resource$Projects$Locations$Nodes$Stop;
2553
+ let options = (optionsOrCallback || {}) as MethodOptions;
2554
+
2555
+ if (typeof paramsOrCallback === 'function') {
2556
+ callback = paramsOrCallback;
2557
+ params = {} as Params$Resource$Projects$Locations$Nodes$Stop;
2558
+ options = {};
2559
+ }
2560
+
2561
+ if (typeof optionsOrCallback === 'function') {
2562
+ callback = optionsOrCallback;
2563
+ options = {};
2564
+ }
2565
+
2566
+ const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/';
2567
+ const parameters = {
2568
+ options: Object.assign(
2569
+ {
2570
+ url: (rootUrl + '/v2/{+name}:stop').replace(/([^:]\/)\/+/g, '$1'),
2571
+ method: 'POST',
2572
+ },
2573
+ options
2574
+ ),
2575
+ params,
2576
+ requiredParams: ['name'],
2577
+ pathParams: ['name'],
2578
+ context: this.context,
2579
+ };
2580
+ if (callback) {
2581
+ createAPIRequest<Schema$Operation>(
2582
+ parameters,
2583
+ callback as BodyResponseCallback<unknown>
2584
+ );
2585
+ } else {
2586
+ return createAPIRequest<Schema$Operation>(parameters);
2587
+ }
2588
+ }
2589
+ }
2590
+
2591
+ export interface Params$Resource$Projects$Locations$Nodes$Create
2592
+ extends StandardParameters {
2593
+ /**
2594
+ * The unqualified resource name.
2595
+ */
2596
+ nodeId?: string;
2597
+ /**
2598
+ * Required. The parent resource name.
2599
+ */
2600
+ parent?: string;
2601
+
2602
+ /**
2603
+ * Request body metadata
2604
+ */
2605
+ requestBody?: Schema$Node;
2606
+ }
2607
+ export interface Params$Resource$Projects$Locations$Nodes$Delete
2608
+ extends StandardParameters {
2609
+ /**
2610
+ * Required. The resource name.
2611
+ */
2612
+ name?: string;
2613
+ }
2614
+ export interface Params$Resource$Projects$Locations$Nodes$Get
2615
+ extends StandardParameters {
2616
+ /**
2617
+ * Required. The resource name.
2618
+ */
2619
+ name?: string;
2620
+ }
2621
+ export interface Params$Resource$Projects$Locations$Nodes$Getguestattributes
2622
+ extends StandardParameters {
2623
+ /**
2624
+ * Required. The resource name.
2625
+ */
2626
+ name?: string;
2627
+
2628
+ /**
2629
+ * Request body metadata
2630
+ */
2631
+ requestBody?: Schema$GetGuestAttributesRequest;
2632
+ }
2633
+ export interface Params$Resource$Projects$Locations$Nodes$List
2634
+ extends StandardParameters {
2635
+ /**
2636
+ * The maximum number of items to return.
2637
+ */
2638
+ pageSize?: number;
2639
+ /**
2640
+ * The next_page_token value returned from a previous List request, if any.
2641
+ */
2642
+ pageToken?: string;
2643
+ /**
2644
+ * Required. The parent resource name.
2645
+ */
2646
+ parent?: string;
2647
+ }
2648
+ export interface Params$Resource$Projects$Locations$Nodes$Patch
2649
+ extends StandardParameters {
2650
+ /**
2651
+ * Output only. Immutable. The name of the TPU.
2652
+ */
2653
+ name?: string;
2654
+ /**
2655
+ * Required. Mask of fields from Node to update. Supported fields: [description, tags, labels, metadata, network_config.enable_external_ips].
2656
+ */
2657
+ updateMask?: string;
2658
+
2659
+ /**
2660
+ * Request body metadata
2661
+ */
2662
+ requestBody?: Schema$Node;
2663
+ }
2664
+ export interface Params$Resource$Projects$Locations$Nodes$Start
2665
+ extends StandardParameters {
2666
+ /**
2667
+ * The resource name.
2668
+ */
2669
+ name?: string;
2670
+
2671
+ /**
2672
+ * Request body metadata
2673
+ */
2674
+ requestBody?: Schema$StartNodeRequest;
2675
+ }
2676
+ export interface Params$Resource$Projects$Locations$Nodes$Stop
2677
+ extends StandardParameters {
2678
+ /**
2679
+ * The resource name.
2680
+ */
2681
+ name?: string;
2682
+
2683
+ /**
2684
+ * Request body metadata
2685
+ */
2686
+ requestBody?: Schema$StopNodeRequest;
2687
+ }
2688
+
2689
+ export class Resource$Projects$Locations$Operations {
2690
+ context: APIRequestContext;
2691
+ constructor(context: APIRequestContext) {
2692
+ this.context = context;
2693
+ }
2694
+
2695
+ /**
2696
+ * 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`.
2697
+ * @example
2698
+ * ```js
2699
+ * // Before running the sample:
2700
+ * // - Enable the API at:
2701
+ * // https://console.developers.google.com/apis/api/tpu.googleapis.com
2702
+ * // - Login into gcloud by running:
2703
+ * // `$ gcloud auth application-default login`
2704
+ * // - Install the npm module by running:
2705
+ * // `$ npm install googleapis`
2706
+ *
2707
+ * const {google} = require('googleapis');
2708
+ * const tpu = google.tpu('v2');
2709
+ *
2710
+ * async function main() {
2711
+ * const auth = new google.auth.GoogleAuth({
2712
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2713
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
2714
+ * });
2715
+ *
2716
+ * // Acquire an auth client, and bind it to all future calls
2717
+ * const authClient = await auth.getClient();
2718
+ * google.options({auth: authClient});
2719
+ *
2720
+ * // Do the magic
2721
+ * const res = await tpu.projects.locations.operations.cancel({
2722
+ * // The name of the operation resource to be cancelled.
2723
+ * name: 'projects/my-project/locations/my-location/operations/my-operation',
2724
+ * });
2725
+ * console.log(res.data);
2726
+ *
2727
+ * // Example response
2728
+ * // {}
2729
+ * }
2730
+ *
2731
+ * main().catch(e => {
2732
+ * console.error(e);
2733
+ * throw e;
2734
+ * });
2735
+ *
2736
+ * ```
2737
+ *
2738
+ * @param params - Parameters for request
2739
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
2740
+ * @param callback - Optional callback that handles the response.
2741
+ * @returns A promise if used with async/await, or void if used with a callback.
2742
+ */
2743
+ cancel(
2744
+ params: Params$Resource$Projects$Locations$Operations$Cancel,
2745
+ options: StreamMethodOptions
2746
+ ): GaxiosPromise<Readable>;
2747
+ cancel(
2748
+ params?: Params$Resource$Projects$Locations$Operations$Cancel,
2749
+ options?: MethodOptions
2750
+ ): GaxiosPromise<Schema$Empty>;
2751
+ cancel(
2752
+ params: Params$Resource$Projects$Locations$Operations$Cancel,
2753
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
2754
+ callback: BodyResponseCallback<Readable>
2755
+ ): void;
2756
+ cancel(
2757
+ params: Params$Resource$Projects$Locations$Operations$Cancel,
2758
+ options: MethodOptions | BodyResponseCallback<Schema$Empty>,
2759
+ callback: BodyResponseCallback<Schema$Empty>
2760
+ ): void;
2761
+ cancel(
2762
+ params: Params$Resource$Projects$Locations$Operations$Cancel,
2763
+ callback: BodyResponseCallback<Schema$Empty>
2764
+ ): void;
2765
+ cancel(callback: BodyResponseCallback<Schema$Empty>): void;
2766
+ cancel(
2767
+ paramsOrCallback?:
2768
+ | Params$Resource$Projects$Locations$Operations$Cancel
2769
+ | BodyResponseCallback<Schema$Empty>
2770
+ | BodyResponseCallback<Readable>,
2771
+ optionsOrCallback?:
2772
+ | MethodOptions
2773
+ | StreamMethodOptions
2774
+ | BodyResponseCallback<Schema$Empty>
2775
+ | BodyResponseCallback<Readable>,
2776
+ callback?:
2777
+ | BodyResponseCallback<Schema$Empty>
2778
+ | BodyResponseCallback<Readable>
2779
+ ): void | GaxiosPromise<Schema$Empty> | GaxiosPromise<Readable> {
2780
+ let params = (paramsOrCallback ||
2781
+ {}) as Params$Resource$Projects$Locations$Operations$Cancel;
2782
+ let options = (optionsOrCallback || {}) as MethodOptions;
2783
+
2784
+ if (typeof paramsOrCallback === 'function') {
2785
+ callback = paramsOrCallback;
2786
+ params = {} as Params$Resource$Projects$Locations$Operations$Cancel;
2787
+ options = {};
2788
+ }
2789
+
2790
+ if (typeof optionsOrCallback === 'function') {
2791
+ callback = optionsOrCallback;
2792
+ options = {};
2793
+ }
2794
+
2795
+ const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/';
2796
+ const parameters = {
2797
+ options: Object.assign(
2798
+ {
2799
+ url: (rootUrl + '/v2/{+name}:cancel').replace(/([^:]\/)\/+/g, '$1'),
2800
+ method: 'POST',
2801
+ },
2802
+ options
2803
+ ),
2804
+ params,
2805
+ requiredParams: ['name'],
2806
+ pathParams: ['name'],
2807
+ context: this.context,
2808
+ };
2809
+ if (callback) {
2810
+ createAPIRequest<Schema$Empty>(
2811
+ parameters,
2812
+ callback as BodyResponseCallback<unknown>
2813
+ );
2814
+ } else {
2815
+ return createAPIRequest<Schema$Empty>(parameters);
2816
+ }
2817
+ }
2818
+
2819
+ /**
2820
+ * 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`.
2821
+ * @example
2822
+ * ```js
2823
+ * // Before running the sample:
2824
+ * // - Enable the API at:
2825
+ * // https://console.developers.google.com/apis/api/tpu.googleapis.com
2826
+ * // - Login into gcloud by running:
2827
+ * // `$ gcloud auth application-default login`
2828
+ * // - Install the npm module by running:
2829
+ * // `$ npm install googleapis`
2830
+ *
2831
+ * const {google} = require('googleapis');
2832
+ * const tpu = google.tpu('v2');
2833
+ *
2834
+ * async function main() {
2835
+ * const auth = new google.auth.GoogleAuth({
2836
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2837
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
2838
+ * });
2839
+ *
2840
+ * // Acquire an auth client, and bind it to all future calls
2841
+ * const authClient = await auth.getClient();
2842
+ * google.options({auth: authClient});
2843
+ *
2844
+ * // Do the magic
2845
+ * const res = await tpu.projects.locations.operations.delete({
2846
+ * // The name of the operation resource to be deleted.
2847
+ * name: 'projects/my-project/locations/my-location/operations/my-operation',
2848
+ * });
2849
+ * console.log(res.data);
2850
+ *
2851
+ * // Example response
2852
+ * // {}
2853
+ * }
2854
+ *
2855
+ * main().catch(e => {
2856
+ * console.error(e);
2857
+ * throw e;
2858
+ * });
2859
+ *
2860
+ * ```
2861
+ *
2862
+ * @param params - Parameters for request
2863
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
2864
+ * @param callback - Optional callback that handles the response.
2865
+ * @returns A promise if used with async/await, or void if used with a callback.
2866
+ */
2867
+ delete(
2868
+ params: Params$Resource$Projects$Locations$Operations$Delete,
2869
+ options: StreamMethodOptions
2870
+ ): GaxiosPromise<Readable>;
2871
+ delete(
2872
+ params?: Params$Resource$Projects$Locations$Operations$Delete,
2873
+ options?: MethodOptions
2874
+ ): GaxiosPromise<Schema$Empty>;
2875
+ delete(
2876
+ params: Params$Resource$Projects$Locations$Operations$Delete,
2877
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
2878
+ callback: BodyResponseCallback<Readable>
2879
+ ): void;
2880
+ delete(
2881
+ params: Params$Resource$Projects$Locations$Operations$Delete,
2882
+ options: MethodOptions | BodyResponseCallback<Schema$Empty>,
2883
+ callback: BodyResponseCallback<Schema$Empty>
2884
+ ): void;
2885
+ delete(
2886
+ params: Params$Resource$Projects$Locations$Operations$Delete,
2887
+ callback: BodyResponseCallback<Schema$Empty>
2888
+ ): void;
2889
+ delete(callback: BodyResponseCallback<Schema$Empty>): void;
2890
+ delete(
2891
+ paramsOrCallback?:
2892
+ | Params$Resource$Projects$Locations$Operations$Delete
2893
+ | BodyResponseCallback<Schema$Empty>
2894
+ | BodyResponseCallback<Readable>,
2895
+ optionsOrCallback?:
2896
+ | MethodOptions
2897
+ | StreamMethodOptions
2898
+ | BodyResponseCallback<Schema$Empty>
2899
+ | BodyResponseCallback<Readable>,
2900
+ callback?:
2901
+ | BodyResponseCallback<Schema$Empty>
2902
+ | BodyResponseCallback<Readable>
2903
+ ): void | GaxiosPromise<Schema$Empty> | GaxiosPromise<Readable> {
2904
+ let params = (paramsOrCallback ||
2905
+ {}) as Params$Resource$Projects$Locations$Operations$Delete;
2906
+ let options = (optionsOrCallback || {}) as MethodOptions;
2907
+
2908
+ if (typeof paramsOrCallback === 'function') {
2909
+ callback = paramsOrCallback;
2910
+ params = {} as Params$Resource$Projects$Locations$Operations$Delete;
2911
+ options = {};
2912
+ }
2913
+
2914
+ if (typeof optionsOrCallback === 'function') {
2915
+ callback = optionsOrCallback;
2916
+ options = {};
2917
+ }
2918
+
2919
+ const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/';
2920
+ const parameters = {
2921
+ options: Object.assign(
2922
+ {
2923
+ url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'),
2924
+ method: 'DELETE',
2925
+ },
2926
+ options
2927
+ ),
2928
+ params,
2929
+ requiredParams: ['name'],
2930
+ pathParams: ['name'],
2931
+ context: this.context,
2932
+ };
2933
+ if (callback) {
2934
+ createAPIRequest<Schema$Empty>(
2935
+ parameters,
2936
+ callback as BodyResponseCallback<unknown>
2937
+ );
2938
+ } else {
2939
+ return createAPIRequest<Schema$Empty>(parameters);
2940
+ }
2941
+ }
2942
+
2943
+ /**
2944
+ * 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.
2945
+ * @example
2946
+ * ```js
2947
+ * // Before running the sample:
2948
+ * // - Enable the API at:
2949
+ * // https://console.developers.google.com/apis/api/tpu.googleapis.com
2950
+ * // - Login into gcloud by running:
2951
+ * // `$ gcloud auth application-default login`
2952
+ * // - Install the npm module by running:
2953
+ * // `$ npm install googleapis`
2954
+ *
2955
+ * const {google} = require('googleapis');
2956
+ * const tpu = google.tpu('v2');
2957
+ *
2958
+ * async function main() {
2959
+ * const auth = new google.auth.GoogleAuth({
2960
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2961
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
2962
+ * });
2963
+ *
2964
+ * // Acquire an auth client, and bind it to all future calls
2965
+ * const authClient = await auth.getClient();
2966
+ * google.options({auth: authClient});
2967
+ *
2968
+ * // Do the magic
2969
+ * const res = await tpu.projects.locations.operations.get({
2970
+ * // The name of the operation resource.
2971
+ * name: 'projects/my-project/locations/my-location/operations/my-operation',
2972
+ * });
2973
+ * console.log(res.data);
2974
+ *
2975
+ * // Example response
2976
+ * // {
2977
+ * // "done": false,
2978
+ * // "error": {},
2979
+ * // "metadata": {},
2980
+ * // "name": "my_name",
2981
+ * // "response": {}
2982
+ * // }
2983
+ * }
2984
+ *
2985
+ * main().catch(e => {
2986
+ * console.error(e);
2987
+ * throw e;
2988
+ * });
2989
+ *
2990
+ * ```
2991
+ *
2992
+ * @param params - Parameters for request
2993
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
2994
+ * @param callback - Optional callback that handles the response.
2995
+ * @returns A promise if used with async/await, or void if used with a callback.
2996
+ */
2997
+ get(
2998
+ params: Params$Resource$Projects$Locations$Operations$Get,
2999
+ options: StreamMethodOptions
3000
+ ): GaxiosPromise<Readable>;
3001
+ get(
3002
+ params?: Params$Resource$Projects$Locations$Operations$Get,
3003
+ options?: MethodOptions
3004
+ ): GaxiosPromise<Schema$Operation>;
3005
+ get(
3006
+ params: Params$Resource$Projects$Locations$Operations$Get,
3007
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
3008
+ callback: BodyResponseCallback<Readable>
3009
+ ): void;
3010
+ get(
3011
+ params: Params$Resource$Projects$Locations$Operations$Get,
3012
+ options: MethodOptions | BodyResponseCallback<Schema$Operation>,
3013
+ callback: BodyResponseCallback<Schema$Operation>
3014
+ ): void;
3015
+ get(
3016
+ params: Params$Resource$Projects$Locations$Operations$Get,
3017
+ callback: BodyResponseCallback<Schema$Operation>
3018
+ ): void;
3019
+ get(callback: BodyResponseCallback<Schema$Operation>): void;
3020
+ get(
3021
+ paramsOrCallback?:
3022
+ | Params$Resource$Projects$Locations$Operations$Get
3023
+ | BodyResponseCallback<Schema$Operation>
3024
+ | BodyResponseCallback<Readable>,
3025
+ optionsOrCallback?:
3026
+ | MethodOptions
3027
+ | StreamMethodOptions
3028
+ | BodyResponseCallback<Schema$Operation>
3029
+ | BodyResponseCallback<Readable>,
3030
+ callback?:
3031
+ | BodyResponseCallback<Schema$Operation>
3032
+ | BodyResponseCallback<Readable>
3033
+ ): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
3034
+ let params = (paramsOrCallback ||
3035
+ {}) as Params$Resource$Projects$Locations$Operations$Get;
3036
+ let options = (optionsOrCallback || {}) as MethodOptions;
3037
+
3038
+ if (typeof paramsOrCallback === 'function') {
3039
+ callback = paramsOrCallback;
3040
+ params = {} as Params$Resource$Projects$Locations$Operations$Get;
3041
+ options = {};
3042
+ }
3043
+
3044
+ if (typeof optionsOrCallback === 'function') {
3045
+ callback = optionsOrCallback;
3046
+ options = {};
3047
+ }
3048
+
3049
+ const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/';
3050
+ const parameters = {
3051
+ options: Object.assign(
3052
+ {
3053
+ url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'),
3054
+ method: 'GET',
3055
+ },
3056
+ options
3057
+ ),
3058
+ params,
3059
+ requiredParams: ['name'],
3060
+ pathParams: ['name'],
3061
+ context: this.context,
3062
+ };
3063
+ if (callback) {
3064
+ createAPIRequest<Schema$Operation>(
3065
+ parameters,
3066
+ callback as BodyResponseCallback<unknown>
3067
+ );
3068
+ } else {
3069
+ return createAPIRequest<Schema$Operation>(parameters);
3070
+ }
3071
+ }
3072
+
3073
+ /**
3074
+ * Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x\}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.
3075
+ * @example
3076
+ * ```js
3077
+ * // Before running the sample:
3078
+ * // - Enable the API at:
3079
+ * // https://console.developers.google.com/apis/api/tpu.googleapis.com
3080
+ * // - Login into gcloud by running:
3081
+ * // `$ gcloud auth application-default login`
3082
+ * // - Install the npm module by running:
3083
+ * // `$ npm install googleapis`
3084
+ *
3085
+ * const {google} = require('googleapis');
3086
+ * const tpu = google.tpu('v2');
3087
+ *
3088
+ * async function main() {
3089
+ * const auth = new google.auth.GoogleAuth({
3090
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
3091
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
3092
+ * });
3093
+ *
3094
+ * // Acquire an auth client, and bind it to all future calls
3095
+ * const authClient = await auth.getClient();
3096
+ * google.options({auth: authClient});
3097
+ *
3098
+ * // Do the magic
3099
+ * const res = await tpu.projects.locations.operations.list({
3100
+ * // The standard list filter.
3101
+ * filter: 'placeholder-value',
3102
+ * // The name of the operation's parent resource.
3103
+ * name: 'projects/my-project/locations/my-location',
3104
+ * // The standard list page size.
3105
+ * pageSize: 'placeholder-value',
3106
+ * // The standard list page token.
3107
+ * pageToken: 'placeholder-value',
3108
+ * });
3109
+ * console.log(res.data);
3110
+ *
3111
+ * // Example response
3112
+ * // {
3113
+ * // "nextPageToken": "my_nextPageToken",
3114
+ * // "operations": []
3115
+ * // }
3116
+ * }
3117
+ *
3118
+ * main().catch(e => {
3119
+ * console.error(e);
3120
+ * throw e;
3121
+ * });
3122
+ *
3123
+ * ```
3124
+ *
3125
+ * @param params - Parameters for request
3126
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
3127
+ * @param callback - Optional callback that handles the response.
3128
+ * @returns A promise if used with async/await, or void if used with a callback.
3129
+ */
3130
+ list(
3131
+ params: Params$Resource$Projects$Locations$Operations$List,
3132
+ options: StreamMethodOptions
3133
+ ): GaxiosPromise<Readable>;
3134
+ list(
3135
+ params?: Params$Resource$Projects$Locations$Operations$List,
3136
+ options?: MethodOptions
3137
+ ): GaxiosPromise<Schema$ListOperationsResponse>;
3138
+ list(
3139
+ params: Params$Resource$Projects$Locations$Operations$List,
3140
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
3141
+ callback: BodyResponseCallback<Readable>
3142
+ ): void;
3143
+ list(
3144
+ params: Params$Resource$Projects$Locations$Operations$List,
3145
+ options:
3146
+ | MethodOptions
3147
+ | BodyResponseCallback<Schema$ListOperationsResponse>,
3148
+ callback: BodyResponseCallback<Schema$ListOperationsResponse>
3149
+ ): void;
3150
+ list(
3151
+ params: Params$Resource$Projects$Locations$Operations$List,
3152
+ callback: BodyResponseCallback<Schema$ListOperationsResponse>
3153
+ ): void;
3154
+ list(callback: BodyResponseCallback<Schema$ListOperationsResponse>): void;
3155
+ list(
3156
+ paramsOrCallback?:
3157
+ | Params$Resource$Projects$Locations$Operations$List
3158
+ | BodyResponseCallback<Schema$ListOperationsResponse>
3159
+ | BodyResponseCallback<Readable>,
3160
+ optionsOrCallback?:
3161
+ | MethodOptions
3162
+ | StreamMethodOptions
3163
+ | BodyResponseCallback<Schema$ListOperationsResponse>
3164
+ | BodyResponseCallback<Readable>,
3165
+ callback?:
3166
+ | BodyResponseCallback<Schema$ListOperationsResponse>
3167
+ | BodyResponseCallback<Readable>
3168
+ ):
3169
+ | void
3170
+ | GaxiosPromise<Schema$ListOperationsResponse>
3171
+ | GaxiosPromise<Readable> {
3172
+ let params = (paramsOrCallback ||
3173
+ {}) as Params$Resource$Projects$Locations$Operations$List;
3174
+ let options = (optionsOrCallback || {}) as MethodOptions;
3175
+
3176
+ if (typeof paramsOrCallback === 'function') {
3177
+ callback = paramsOrCallback;
3178
+ params = {} as Params$Resource$Projects$Locations$Operations$List;
3179
+ options = {};
3180
+ }
3181
+
3182
+ if (typeof optionsOrCallback === 'function') {
3183
+ callback = optionsOrCallback;
3184
+ options = {};
3185
+ }
3186
+
3187
+ const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/';
3188
+ const parameters = {
3189
+ options: Object.assign(
3190
+ {
3191
+ url: (rootUrl + '/v2/{+name}/operations').replace(
3192
+ /([^:]\/)\/+/g,
3193
+ '$1'
3194
+ ),
3195
+ method: 'GET',
3196
+ },
3197
+ options
3198
+ ),
3199
+ params,
3200
+ requiredParams: ['name'],
3201
+ pathParams: ['name'],
3202
+ context: this.context,
3203
+ };
3204
+ if (callback) {
3205
+ createAPIRequest<Schema$ListOperationsResponse>(
3206
+ parameters,
3207
+ callback as BodyResponseCallback<unknown>
3208
+ );
3209
+ } else {
3210
+ return createAPIRequest<Schema$ListOperationsResponse>(parameters);
3211
+ }
3212
+ }
3213
+ }
3214
+
3215
+ export interface Params$Resource$Projects$Locations$Operations$Cancel
3216
+ extends StandardParameters {
3217
+ /**
3218
+ * The name of the operation resource to be cancelled.
3219
+ */
3220
+ name?: string;
3221
+ }
3222
+ export interface Params$Resource$Projects$Locations$Operations$Delete
3223
+ extends StandardParameters {
3224
+ /**
3225
+ * The name of the operation resource to be deleted.
3226
+ */
3227
+ name?: string;
3228
+ }
3229
+ export interface Params$Resource$Projects$Locations$Operations$Get
3230
+ extends StandardParameters {
3231
+ /**
3232
+ * The name of the operation resource.
3233
+ */
3234
+ name?: string;
3235
+ }
3236
+ export interface Params$Resource$Projects$Locations$Operations$List
3237
+ extends StandardParameters {
3238
+ /**
3239
+ * The standard list filter.
3240
+ */
3241
+ filter?: string;
3242
+ /**
3243
+ * The name of the operation's parent resource.
3244
+ */
3245
+ name?: string;
3246
+ /**
3247
+ * The standard list page size.
3248
+ */
3249
+ pageSize?: number;
3250
+ /**
3251
+ * The standard list page token.
3252
+ */
3253
+ pageToken?: string;
3254
+ }
3255
+
3256
+ export class Resource$Projects$Locations$Runtimeversions {
3257
+ context: APIRequestContext;
3258
+ constructor(context: APIRequestContext) {
3259
+ this.context = context;
3260
+ }
3261
+
3262
+ /**
3263
+ * Gets a runtime version.
3264
+ * @example
3265
+ * ```js
3266
+ * // Before running the sample:
3267
+ * // - Enable the API at:
3268
+ * // https://console.developers.google.com/apis/api/tpu.googleapis.com
3269
+ * // - Login into gcloud by running:
3270
+ * // `$ gcloud auth application-default login`
3271
+ * // - Install the npm module by running:
3272
+ * // `$ npm install googleapis`
3273
+ *
3274
+ * const {google} = require('googleapis');
3275
+ * const tpu = google.tpu('v2');
3276
+ *
3277
+ * async function main() {
3278
+ * const auth = new google.auth.GoogleAuth({
3279
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
3280
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
3281
+ * });
3282
+ *
3283
+ * // Acquire an auth client, and bind it to all future calls
3284
+ * const authClient = await auth.getClient();
3285
+ * google.options({auth: authClient});
3286
+ *
3287
+ * // Do the magic
3288
+ * const res = await tpu.projects.locations.runtimeVersions.get({
3289
+ * // Required. The resource name.
3290
+ * name: 'projects/my-project/locations/my-location/runtimeVersions/my-runtimeVersion',
3291
+ * });
3292
+ * console.log(res.data);
3293
+ *
3294
+ * // Example response
3295
+ * // {
3296
+ * // "name": "my_name",
3297
+ * // "version": "my_version"
3298
+ * // }
3299
+ * }
3300
+ *
3301
+ * main().catch(e => {
3302
+ * console.error(e);
3303
+ * throw e;
3304
+ * });
3305
+ *
3306
+ * ```
3307
+ *
3308
+ * @param params - Parameters for request
3309
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
3310
+ * @param callback - Optional callback that handles the response.
3311
+ * @returns A promise if used with async/await, or void if used with a callback.
3312
+ */
3313
+ get(
3314
+ params: Params$Resource$Projects$Locations$Runtimeversions$Get,
3315
+ options: StreamMethodOptions
3316
+ ): GaxiosPromise<Readable>;
3317
+ get(
3318
+ params?: Params$Resource$Projects$Locations$Runtimeversions$Get,
3319
+ options?: MethodOptions
3320
+ ): GaxiosPromise<Schema$RuntimeVersion>;
3321
+ get(
3322
+ params: Params$Resource$Projects$Locations$Runtimeversions$Get,
3323
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
3324
+ callback: BodyResponseCallback<Readable>
3325
+ ): void;
3326
+ get(
3327
+ params: Params$Resource$Projects$Locations$Runtimeversions$Get,
3328
+ options: MethodOptions | BodyResponseCallback<Schema$RuntimeVersion>,
3329
+ callback: BodyResponseCallback<Schema$RuntimeVersion>
3330
+ ): void;
3331
+ get(
3332
+ params: Params$Resource$Projects$Locations$Runtimeversions$Get,
3333
+ callback: BodyResponseCallback<Schema$RuntimeVersion>
3334
+ ): void;
3335
+ get(callback: BodyResponseCallback<Schema$RuntimeVersion>): void;
3336
+ get(
3337
+ paramsOrCallback?:
3338
+ | Params$Resource$Projects$Locations$Runtimeversions$Get
3339
+ | BodyResponseCallback<Schema$RuntimeVersion>
3340
+ | BodyResponseCallback<Readable>,
3341
+ optionsOrCallback?:
3342
+ | MethodOptions
3343
+ | StreamMethodOptions
3344
+ | BodyResponseCallback<Schema$RuntimeVersion>
3345
+ | BodyResponseCallback<Readable>,
3346
+ callback?:
3347
+ | BodyResponseCallback<Schema$RuntimeVersion>
3348
+ | BodyResponseCallback<Readable>
3349
+ ): void | GaxiosPromise<Schema$RuntimeVersion> | GaxiosPromise<Readable> {
3350
+ let params = (paramsOrCallback ||
3351
+ {}) as Params$Resource$Projects$Locations$Runtimeversions$Get;
3352
+ let options = (optionsOrCallback || {}) as MethodOptions;
3353
+
3354
+ if (typeof paramsOrCallback === 'function') {
3355
+ callback = paramsOrCallback;
3356
+ params = {} as Params$Resource$Projects$Locations$Runtimeversions$Get;
3357
+ options = {};
3358
+ }
3359
+
3360
+ if (typeof optionsOrCallback === 'function') {
3361
+ callback = optionsOrCallback;
3362
+ options = {};
3363
+ }
3364
+
3365
+ const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/';
3366
+ const parameters = {
3367
+ options: Object.assign(
3368
+ {
3369
+ url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'),
3370
+ method: 'GET',
3371
+ },
3372
+ options
3373
+ ),
3374
+ params,
3375
+ requiredParams: ['name'],
3376
+ pathParams: ['name'],
3377
+ context: this.context,
3378
+ };
3379
+ if (callback) {
3380
+ createAPIRequest<Schema$RuntimeVersion>(
3381
+ parameters,
3382
+ callback as BodyResponseCallback<unknown>
3383
+ );
3384
+ } else {
3385
+ return createAPIRequest<Schema$RuntimeVersion>(parameters);
3386
+ }
3387
+ }
3388
+
3389
+ /**
3390
+ * Lists runtime versions supported by this API.
3391
+ * @example
3392
+ * ```js
3393
+ * // Before running the sample:
3394
+ * // - Enable the API at:
3395
+ * // https://console.developers.google.com/apis/api/tpu.googleapis.com
3396
+ * // - Login into gcloud by running:
3397
+ * // `$ gcloud auth application-default login`
3398
+ * // - Install the npm module by running:
3399
+ * // `$ npm install googleapis`
3400
+ *
3401
+ * const {google} = require('googleapis');
3402
+ * const tpu = google.tpu('v2');
3403
+ *
3404
+ * async function main() {
3405
+ * const auth = new google.auth.GoogleAuth({
3406
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
3407
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
3408
+ * });
3409
+ *
3410
+ * // Acquire an auth client, and bind it to all future calls
3411
+ * const authClient = await auth.getClient();
3412
+ * google.options({auth: authClient});
3413
+ *
3414
+ * // Do the magic
3415
+ * const res = await tpu.projects.locations.runtimeVersions.list({
3416
+ * // List filter.
3417
+ * filter: 'placeholder-value',
3418
+ * // Sort results.
3419
+ * orderBy: 'placeholder-value',
3420
+ * // The maximum number of items to return.
3421
+ * pageSize: 'placeholder-value',
3422
+ * // The next_page_token value returned from a previous List request, if any.
3423
+ * pageToken: 'placeholder-value',
3424
+ * // Required. The parent resource name.
3425
+ * parent: 'projects/my-project/locations/my-location',
3426
+ * });
3427
+ * console.log(res.data);
3428
+ *
3429
+ * // Example response
3430
+ * // {
3431
+ * // "nextPageToken": "my_nextPageToken",
3432
+ * // "runtimeVersions": [],
3433
+ * // "unreachable": []
3434
+ * // }
3435
+ * }
3436
+ *
3437
+ * main().catch(e => {
3438
+ * console.error(e);
3439
+ * throw e;
3440
+ * });
3441
+ *
3442
+ * ```
3443
+ *
3444
+ * @param params - Parameters for request
3445
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
3446
+ * @param callback - Optional callback that handles the response.
3447
+ * @returns A promise if used with async/await, or void if used with a callback.
3448
+ */
3449
+ list(
3450
+ params: Params$Resource$Projects$Locations$Runtimeversions$List,
3451
+ options: StreamMethodOptions
3452
+ ): GaxiosPromise<Readable>;
3453
+ list(
3454
+ params?: Params$Resource$Projects$Locations$Runtimeversions$List,
3455
+ options?: MethodOptions
3456
+ ): GaxiosPromise<Schema$ListRuntimeVersionsResponse>;
3457
+ list(
3458
+ params: Params$Resource$Projects$Locations$Runtimeversions$List,
3459
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
3460
+ callback: BodyResponseCallback<Readable>
3461
+ ): void;
3462
+ list(
3463
+ params: Params$Resource$Projects$Locations$Runtimeversions$List,
3464
+ options:
3465
+ | MethodOptions
3466
+ | BodyResponseCallback<Schema$ListRuntimeVersionsResponse>,
3467
+ callback: BodyResponseCallback<Schema$ListRuntimeVersionsResponse>
3468
+ ): void;
3469
+ list(
3470
+ params: Params$Resource$Projects$Locations$Runtimeversions$List,
3471
+ callback: BodyResponseCallback<Schema$ListRuntimeVersionsResponse>
3472
+ ): void;
3473
+ list(
3474
+ callback: BodyResponseCallback<Schema$ListRuntimeVersionsResponse>
3475
+ ): void;
3476
+ list(
3477
+ paramsOrCallback?:
3478
+ | Params$Resource$Projects$Locations$Runtimeversions$List
3479
+ | BodyResponseCallback<Schema$ListRuntimeVersionsResponse>
3480
+ | BodyResponseCallback<Readable>,
3481
+ optionsOrCallback?:
3482
+ | MethodOptions
3483
+ | StreamMethodOptions
3484
+ | BodyResponseCallback<Schema$ListRuntimeVersionsResponse>
3485
+ | BodyResponseCallback<Readable>,
3486
+ callback?:
3487
+ | BodyResponseCallback<Schema$ListRuntimeVersionsResponse>
3488
+ | BodyResponseCallback<Readable>
3489
+ ):
3490
+ | void
3491
+ | GaxiosPromise<Schema$ListRuntimeVersionsResponse>
3492
+ | GaxiosPromise<Readable> {
3493
+ let params = (paramsOrCallback ||
3494
+ {}) as Params$Resource$Projects$Locations$Runtimeversions$List;
3495
+ let options = (optionsOrCallback || {}) as MethodOptions;
3496
+
3497
+ if (typeof paramsOrCallback === 'function') {
3498
+ callback = paramsOrCallback;
3499
+ params = {} as Params$Resource$Projects$Locations$Runtimeversions$List;
3500
+ options = {};
3501
+ }
3502
+
3503
+ if (typeof optionsOrCallback === 'function') {
3504
+ callback = optionsOrCallback;
3505
+ options = {};
3506
+ }
3507
+
3508
+ const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/';
3509
+ const parameters = {
3510
+ options: Object.assign(
3511
+ {
3512
+ url: (rootUrl + '/v2/{+parent}/runtimeVersions').replace(
3513
+ /([^:]\/)\/+/g,
3514
+ '$1'
3515
+ ),
3516
+ method: 'GET',
3517
+ },
3518
+ options
3519
+ ),
3520
+ params,
3521
+ requiredParams: ['parent'],
3522
+ pathParams: ['parent'],
3523
+ context: this.context,
3524
+ };
3525
+ if (callback) {
3526
+ createAPIRequest<Schema$ListRuntimeVersionsResponse>(
3527
+ parameters,
3528
+ callback as BodyResponseCallback<unknown>
3529
+ );
3530
+ } else {
3531
+ return createAPIRequest<Schema$ListRuntimeVersionsResponse>(parameters);
3532
+ }
3533
+ }
3534
+ }
3535
+
3536
+ export interface Params$Resource$Projects$Locations$Runtimeversions$Get
3537
+ extends StandardParameters {
3538
+ /**
3539
+ * Required. The resource name.
3540
+ */
3541
+ name?: string;
3542
+ }
3543
+ export interface Params$Resource$Projects$Locations$Runtimeversions$List
3544
+ extends StandardParameters {
3545
+ /**
3546
+ * List filter.
3547
+ */
3548
+ filter?: string;
3549
+ /**
3550
+ * Sort results.
3551
+ */
3552
+ orderBy?: string;
3553
+ /**
3554
+ * The maximum number of items to return.
3555
+ */
3556
+ pageSize?: number;
3557
+ /**
3558
+ * The next_page_token value returned from a previous List request, if any.
3559
+ */
3560
+ pageToken?: string;
3561
+ /**
3562
+ * Required. The parent resource name.
3563
+ */
3564
+ parent?: string;
3565
+ }
3566
+ }