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