@googleapis/tpu 0.2.0 → 0.6.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,3559 @@
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
+ * Represents the metadata of the long-running operation.
493
+ */
494
+ export interface Schema$OperationMetadata {
495
+ /**
496
+ * Output only. API version used to start the operation.
497
+ */
498
+ apiVersion?: string | null;
499
+ /**
500
+ * Output only. Identifies whether the user has requested cancellation of the operation. Operations that have been cancelled successfully have Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`.
501
+ */
502
+ cancelRequested?: boolean | null;
503
+ /**
504
+ * Output only. The time the operation was created.
505
+ */
506
+ createTime?: string | null;
507
+ /**
508
+ * Output only. The time the operation finished running.
509
+ */
510
+ endTime?: string | null;
511
+ /**
512
+ * Output only. Human-readable status of the operation, if any.
513
+ */
514
+ statusDetail?: string | null;
515
+ /**
516
+ * Output only. Server-defined resource path for the target of the operation.
517
+ */
518
+ target?: string | null;
519
+ /**
520
+ * Output only. 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
+ *
1454
+ * // Request body metadata
1455
+ * requestBody: {
1456
+ * // request body parameters
1457
+ * // {
1458
+ * // "acceleratorType": "my_acceleratorType",
1459
+ * // "apiVersion": "my_apiVersion",
1460
+ * // "cidrBlock": "my_cidrBlock",
1461
+ * // "createTime": "my_createTime",
1462
+ * // "dataDisks": [],
1463
+ * // "description": "my_description",
1464
+ * // "health": "my_health",
1465
+ * // "healthDescription": "my_healthDescription",
1466
+ * // "id": "my_id",
1467
+ * // "labels": {},
1468
+ * // "metadata": {},
1469
+ * // "name": "my_name",
1470
+ * // "networkConfig": {},
1471
+ * // "networkEndpoints": [],
1472
+ * // "runtimeVersion": "my_runtimeVersion",
1473
+ * // "schedulingConfig": {},
1474
+ * // "serviceAccount": {},
1475
+ * // "state": "my_state",
1476
+ * // "symptoms": [],
1477
+ * // "tags": []
1478
+ * // }
1479
+ * },
1480
+ * });
1481
+ * console.log(res.data);
1482
+ *
1483
+ * // Example response
1484
+ * // {
1485
+ * // "done": false,
1486
+ * // "error": {},
1487
+ * // "metadata": {},
1488
+ * // "name": "my_name",
1489
+ * // "response": {}
1490
+ * // }
1491
+ * }
1492
+ *
1493
+ * main().catch(e => {
1494
+ * console.error(e);
1495
+ * throw e;
1496
+ * });
1497
+ *
1498
+ * ```
1499
+ *
1500
+ * @param params - Parameters for request
1501
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
1502
+ * @param callback - Optional callback that handles the response.
1503
+ * @returns A promise if used with async/await, or void if used with a callback.
1504
+ */
1505
+ create(
1506
+ params: Params$Resource$Projects$Locations$Nodes$Create,
1507
+ options: StreamMethodOptions
1508
+ ): GaxiosPromise<Readable>;
1509
+ create(
1510
+ params?: Params$Resource$Projects$Locations$Nodes$Create,
1511
+ options?: MethodOptions
1512
+ ): GaxiosPromise<Schema$Operation>;
1513
+ create(
1514
+ params: Params$Resource$Projects$Locations$Nodes$Create,
1515
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
1516
+ callback: BodyResponseCallback<Readable>
1517
+ ): void;
1518
+ create(
1519
+ params: Params$Resource$Projects$Locations$Nodes$Create,
1520
+ options: MethodOptions | BodyResponseCallback<Schema$Operation>,
1521
+ callback: BodyResponseCallback<Schema$Operation>
1522
+ ): void;
1523
+ create(
1524
+ params: Params$Resource$Projects$Locations$Nodes$Create,
1525
+ callback: BodyResponseCallback<Schema$Operation>
1526
+ ): void;
1527
+ create(callback: BodyResponseCallback<Schema$Operation>): void;
1528
+ create(
1529
+ paramsOrCallback?:
1530
+ | Params$Resource$Projects$Locations$Nodes$Create
1531
+ | BodyResponseCallback<Schema$Operation>
1532
+ | BodyResponseCallback<Readable>,
1533
+ optionsOrCallback?:
1534
+ | MethodOptions
1535
+ | StreamMethodOptions
1536
+ | BodyResponseCallback<Schema$Operation>
1537
+ | BodyResponseCallback<Readable>,
1538
+ callback?:
1539
+ | BodyResponseCallback<Schema$Operation>
1540
+ | BodyResponseCallback<Readable>
1541
+ ): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
1542
+ let params = (paramsOrCallback ||
1543
+ {}) as Params$Resource$Projects$Locations$Nodes$Create;
1544
+ let options = (optionsOrCallback || {}) as MethodOptions;
1545
+
1546
+ if (typeof paramsOrCallback === 'function') {
1547
+ callback = paramsOrCallback;
1548
+ params = {} as Params$Resource$Projects$Locations$Nodes$Create;
1549
+ options = {};
1550
+ }
1551
+
1552
+ if (typeof optionsOrCallback === 'function') {
1553
+ callback = optionsOrCallback;
1554
+ options = {};
1555
+ }
1556
+
1557
+ const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/';
1558
+ const parameters = {
1559
+ options: Object.assign(
1560
+ {
1561
+ url: (rootUrl + '/v2alpha1/{+parent}/nodes').replace(
1562
+ /([^:]\/)\/+/g,
1563
+ '$1'
1564
+ ),
1565
+ method: 'POST',
1566
+ },
1567
+ options
1568
+ ),
1569
+ params,
1570
+ requiredParams: ['parent'],
1571
+ pathParams: ['parent'],
1572
+ context: this.context,
1573
+ };
1574
+ if (callback) {
1575
+ createAPIRequest<Schema$Operation>(
1576
+ parameters,
1577
+ callback as BodyResponseCallback<unknown>
1578
+ );
1579
+ } else {
1580
+ return createAPIRequest<Schema$Operation>(parameters);
1581
+ }
1582
+ }
1583
+
1584
+ /**
1585
+ * Deletes a node.
1586
+ * @example
1587
+ * ```js
1588
+ * // Before running the sample:
1589
+ * // - Enable the API at:
1590
+ * // https://console.developers.google.com/apis/api/tpu.googleapis.com
1591
+ * // - Login into gcloud by running:
1592
+ * // `$ gcloud auth application-default login`
1593
+ * // - Install the npm module by running:
1594
+ * // `$ npm install googleapis`
1595
+ *
1596
+ * const {google} = require('googleapis');
1597
+ * const tpu = google.tpu('v2alpha1');
1598
+ *
1599
+ * async function main() {
1600
+ * const auth = new google.auth.GoogleAuth({
1601
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1602
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
1603
+ * });
1604
+ *
1605
+ * // Acquire an auth client, and bind it to all future calls
1606
+ * const authClient = await auth.getClient();
1607
+ * google.options({auth: authClient});
1608
+ *
1609
+ * // Do the magic
1610
+ * const res = await tpu.projects.locations.nodes.delete({
1611
+ * // Required. The resource name.
1612
+ * name: 'projects/my-project/locations/my-location/nodes/my-node',
1613
+ * });
1614
+ * console.log(res.data);
1615
+ *
1616
+ * // Example response
1617
+ * // {
1618
+ * // "done": false,
1619
+ * // "error": {},
1620
+ * // "metadata": {},
1621
+ * // "name": "my_name",
1622
+ * // "response": {}
1623
+ * // }
1624
+ * }
1625
+ *
1626
+ * main().catch(e => {
1627
+ * console.error(e);
1628
+ * throw e;
1629
+ * });
1630
+ *
1631
+ * ```
1632
+ *
1633
+ * @param params - Parameters for request
1634
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
1635
+ * @param callback - Optional callback that handles the response.
1636
+ * @returns A promise if used with async/await, or void if used with a callback.
1637
+ */
1638
+ delete(
1639
+ params: Params$Resource$Projects$Locations$Nodes$Delete,
1640
+ options: StreamMethodOptions
1641
+ ): GaxiosPromise<Readable>;
1642
+ delete(
1643
+ params?: Params$Resource$Projects$Locations$Nodes$Delete,
1644
+ options?: MethodOptions
1645
+ ): GaxiosPromise<Schema$Operation>;
1646
+ delete(
1647
+ params: Params$Resource$Projects$Locations$Nodes$Delete,
1648
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
1649
+ callback: BodyResponseCallback<Readable>
1650
+ ): void;
1651
+ delete(
1652
+ params: Params$Resource$Projects$Locations$Nodes$Delete,
1653
+ options: MethodOptions | BodyResponseCallback<Schema$Operation>,
1654
+ callback: BodyResponseCallback<Schema$Operation>
1655
+ ): void;
1656
+ delete(
1657
+ params: Params$Resource$Projects$Locations$Nodes$Delete,
1658
+ callback: BodyResponseCallback<Schema$Operation>
1659
+ ): void;
1660
+ delete(callback: BodyResponseCallback<Schema$Operation>): void;
1661
+ delete(
1662
+ paramsOrCallback?:
1663
+ | Params$Resource$Projects$Locations$Nodes$Delete
1664
+ | BodyResponseCallback<Schema$Operation>
1665
+ | BodyResponseCallback<Readable>,
1666
+ optionsOrCallback?:
1667
+ | MethodOptions
1668
+ | StreamMethodOptions
1669
+ | BodyResponseCallback<Schema$Operation>
1670
+ | BodyResponseCallback<Readable>,
1671
+ callback?:
1672
+ | BodyResponseCallback<Schema$Operation>
1673
+ | BodyResponseCallback<Readable>
1674
+ ): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
1675
+ let params = (paramsOrCallback ||
1676
+ {}) as Params$Resource$Projects$Locations$Nodes$Delete;
1677
+ let options = (optionsOrCallback || {}) as MethodOptions;
1678
+
1679
+ if (typeof paramsOrCallback === 'function') {
1680
+ callback = paramsOrCallback;
1681
+ params = {} as Params$Resource$Projects$Locations$Nodes$Delete;
1682
+ options = {};
1683
+ }
1684
+
1685
+ if (typeof optionsOrCallback === 'function') {
1686
+ callback = optionsOrCallback;
1687
+ options = {};
1688
+ }
1689
+
1690
+ const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/';
1691
+ const parameters = {
1692
+ options: Object.assign(
1693
+ {
1694
+ url: (rootUrl + '/v2alpha1/{+name}').replace(/([^:]\/)\/+/g, '$1'),
1695
+ method: 'DELETE',
1696
+ },
1697
+ options
1698
+ ),
1699
+ params,
1700
+ requiredParams: ['name'],
1701
+ pathParams: ['name'],
1702
+ context: this.context,
1703
+ };
1704
+ if (callback) {
1705
+ createAPIRequest<Schema$Operation>(
1706
+ parameters,
1707
+ callback as BodyResponseCallback<unknown>
1708
+ );
1709
+ } else {
1710
+ return createAPIRequest<Schema$Operation>(parameters);
1711
+ }
1712
+ }
1713
+
1714
+ /**
1715
+ * Gets the details of a node.
1716
+ * @example
1717
+ * ```js
1718
+ * // Before running the sample:
1719
+ * // - Enable the API at:
1720
+ * // https://console.developers.google.com/apis/api/tpu.googleapis.com
1721
+ * // - Login into gcloud by running:
1722
+ * // `$ gcloud auth application-default login`
1723
+ * // - Install the npm module by running:
1724
+ * // `$ npm install googleapis`
1725
+ *
1726
+ * const {google} = require('googleapis');
1727
+ * const tpu = google.tpu('v2alpha1');
1728
+ *
1729
+ * async function main() {
1730
+ * const auth = new google.auth.GoogleAuth({
1731
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1732
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
1733
+ * });
1734
+ *
1735
+ * // Acquire an auth client, and bind it to all future calls
1736
+ * const authClient = await auth.getClient();
1737
+ * google.options({auth: authClient});
1738
+ *
1739
+ * // Do the magic
1740
+ * const res = await tpu.projects.locations.nodes.get({
1741
+ * // Required. The resource name.
1742
+ * name: 'projects/my-project/locations/my-location/nodes/my-node',
1743
+ * });
1744
+ * console.log(res.data);
1745
+ *
1746
+ * // Example response
1747
+ * // {
1748
+ * // "acceleratorType": "my_acceleratorType",
1749
+ * // "apiVersion": "my_apiVersion",
1750
+ * // "cidrBlock": "my_cidrBlock",
1751
+ * // "createTime": "my_createTime",
1752
+ * // "dataDisks": [],
1753
+ * // "description": "my_description",
1754
+ * // "health": "my_health",
1755
+ * // "healthDescription": "my_healthDescription",
1756
+ * // "id": "my_id",
1757
+ * // "labels": {},
1758
+ * // "metadata": {},
1759
+ * // "name": "my_name",
1760
+ * // "networkConfig": {},
1761
+ * // "networkEndpoints": [],
1762
+ * // "runtimeVersion": "my_runtimeVersion",
1763
+ * // "schedulingConfig": {},
1764
+ * // "serviceAccount": {},
1765
+ * // "state": "my_state",
1766
+ * // "symptoms": [],
1767
+ * // "tags": []
1768
+ * // }
1769
+ * }
1770
+ *
1771
+ * main().catch(e => {
1772
+ * console.error(e);
1773
+ * throw e;
1774
+ * });
1775
+ *
1776
+ * ```
1777
+ *
1778
+ * @param params - Parameters for request
1779
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
1780
+ * @param callback - Optional callback that handles the response.
1781
+ * @returns A promise if used with async/await, or void if used with a callback.
1782
+ */
1783
+ get(
1784
+ params: Params$Resource$Projects$Locations$Nodes$Get,
1785
+ options: StreamMethodOptions
1786
+ ): GaxiosPromise<Readable>;
1787
+ get(
1788
+ params?: Params$Resource$Projects$Locations$Nodes$Get,
1789
+ options?: MethodOptions
1790
+ ): GaxiosPromise<Schema$Node>;
1791
+ get(
1792
+ params: Params$Resource$Projects$Locations$Nodes$Get,
1793
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
1794
+ callback: BodyResponseCallback<Readable>
1795
+ ): void;
1796
+ get(
1797
+ params: Params$Resource$Projects$Locations$Nodes$Get,
1798
+ options: MethodOptions | BodyResponseCallback<Schema$Node>,
1799
+ callback: BodyResponseCallback<Schema$Node>
1800
+ ): void;
1801
+ get(
1802
+ params: Params$Resource$Projects$Locations$Nodes$Get,
1803
+ callback: BodyResponseCallback<Schema$Node>
1804
+ ): void;
1805
+ get(callback: BodyResponseCallback<Schema$Node>): void;
1806
+ get(
1807
+ paramsOrCallback?:
1808
+ | Params$Resource$Projects$Locations$Nodes$Get
1809
+ | BodyResponseCallback<Schema$Node>
1810
+ | BodyResponseCallback<Readable>,
1811
+ optionsOrCallback?:
1812
+ | MethodOptions
1813
+ | StreamMethodOptions
1814
+ | BodyResponseCallback<Schema$Node>
1815
+ | BodyResponseCallback<Readable>,
1816
+ callback?:
1817
+ | BodyResponseCallback<Schema$Node>
1818
+ | BodyResponseCallback<Readable>
1819
+ ): void | GaxiosPromise<Schema$Node> | GaxiosPromise<Readable> {
1820
+ let params = (paramsOrCallback ||
1821
+ {}) as Params$Resource$Projects$Locations$Nodes$Get;
1822
+ let options = (optionsOrCallback || {}) as MethodOptions;
1823
+
1824
+ if (typeof paramsOrCallback === 'function') {
1825
+ callback = paramsOrCallback;
1826
+ params = {} as Params$Resource$Projects$Locations$Nodes$Get;
1827
+ options = {};
1828
+ }
1829
+
1830
+ if (typeof optionsOrCallback === 'function') {
1831
+ callback = optionsOrCallback;
1832
+ options = {};
1833
+ }
1834
+
1835
+ const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/';
1836
+ const parameters = {
1837
+ options: Object.assign(
1838
+ {
1839
+ url: (rootUrl + '/v2alpha1/{+name}').replace(/([^:]\/)\/+/g, '$1'),
1840
+ method: 'GET',
1841
+ },
1842
+ options
1843
+ ),
1844
+ params,
1845
+ requiredParams: ['name'],
1846
+ pathParams: ['name'],
1847
+ context: this.context,
1848
+ };
1849
+ if (callback) {
1850
+ createAPIRequest<Schema$Node>(
1851
+ parameters,
1852
+ callback as BodyResponseCallback<unknown>
1853
+ );
1854
+ } else {
1855
+ return createAPIRequest<Schema$Node>(parameters);
1856
+ }
1857
+ }
1858
+
1859
+ /**
1860
+ * Retrieves the guest attributes for the node.
1861
+ * @example
1862
+ * ```js
1863
+ * // Before running the sample:
1864
+ * // - Enable the API at:
1865
+ * // https://console.developers.google.com/apis/api/tpu.googleapis.com
1866
+ * // - Login into gcloud by running:
1867
+ * // `$ gcloud auth application-default login`
1868
+ * // - Install the npm module by running:
1869
+ * // `$ npm install googleapis`
1870
+ *
1871
+ * const {google} = require('googleapis');
1872
+ * const tpu = google.tpu('v2alpha1');
1873
+ *
1874
+ * async function main() {
1875
+ * const auth = new google.auth.GoogleAuth({
1876
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1877
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
1878
+ * });
1879
+ *
1880
+ * // Acquire an auth client, and bind it to all future calls
1881
+ * const authClient = await auth.getClient();
1882
+ * google.options({auth: authClient});
1883
+ *
1884
+ * // Do the magic
1885
+ * const res = await tpu.projects.locations.nodes.getGuestAttributes({
1886
+ * // Required. The resource name.
1887
+ * name: 'projects/my-project/locations/my-location/nodes/my-node',
1888
+ *
1889
+ * // Request body metadata
1890
+ * requestBody: {
1891
+ * // request body parameters
1892
+ * // {
1893
+ * // "queryPath": "my_queryPath",
1894
+ * // "workerIds": []
1895
+ * // }
1896
+ * },
1897
+ * });
1898
+ * console.log(res.data);
1899
+ *
1900
+ * // Example response
1901
+ * // {
1902
+ * // "guestAttributes": []
1903
+ * // }
1904
+ * }
1905
+ *
1906
+ * main().catch(e => {
1907
+ * console.error(e);
1908
+ * throw e;
1909
+ * });
1910
+ *
1911
+ * ```
1912
+ *
1913
+ * @param params - Parameters for request
1914
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
1915
+ * @param callback - Optional callback that handles the response.
1916
+ * @returns A promise if used with async/await, or void if used with a callback.
1917
+ */
1918
+ getGuestAttributes(
1919
+ params: Params$Resource$Projects$Locations$Nodes$Getguestattributes,
1920
+ options: StreamMethodOptions
1921
+ ): GaxiosPromise<Readable>;
1922
+ getGuestAttributes(
1923
+ params?: Params$Resource$Projects$Locations$Nodes$Getguestattributes,
1924
+ options?: MethodOptions
1925
+ ): GaxiosPromise<Schema$GetGuestAttributesResponse>;
1926
+ getGuestAttributes(
1927
+ params: Params$Resource$Projects$Locations$Nodes$Getguestattributes,
1928
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
1929
+ callback: BodyResponseCallback<Readable>
1930
+ ): void;
1931
+ getGuestAttributes(
1932
+ params: Params$Resource$Projects$Locations$Nodes$Getguestattributes,
1933
+ options:
1934
+ | MethodOptions
1935
+ | BodyResponseCallback<Schema$GetGuestAttributesResponse>,
1936
+ callback: BodyResponseCallback<Schema$GetGuestAttributesResponse>
1937
+ ): void;
1938
+ getGuestAttributes(
1939
+ params: Params$Resource$Projects$Locations$Nodes$Getguestattributes,
1940
+ callback: BodyResponseCallback<Schema$GetGuestAttributesResponse>
1941
+ ): void;
1942
+ getGuestAttributes(
1943
+ callback: BodyResponseCallback<Schema$GetGuestAttributesResponse>
1944
+ ): void;
1945
+ getGuestAttributes(
1946
+ paramsOrCallback?:
1947
+ | Params$Resource$Projects$Locations$Nodes$Getguestattributes
1948
+ | BodyResponseCallback<Schema$GetGuestAttributesResponse>
1949
+ | BodyResponseCallback<Readable>,
1950
+ optionsOrCallback?:
1951
+ | MethodOptions
1952
+ | StreamMethodOptions
1953
+ | BodyResponseCallback<Schema$GetGuestAttributesResponse>
1954
+ | BodyResponseCallback<Readable>,
1955
+ callback?:
1956
+ | BodyResponseCallback<Schema$GetGuestAttributesResponse>
1957
+ | BodyResponseCallback<Readable>
1958
+ ):
1959
+ | void
1960
+ | GaxiosPromise<Schema$GetGuestAttributesResponse>
1961
+ | GaxiosPromise<Readable> {
1962
+ let params = (paramsOrCallback ||
1963
+ {}) as Params$Resource$Projects$Locations$Nodes$Getguestattributes;
1964
+ let options = (optionsOrCallback || {}) as MethodOptions;
1965
+
1966
+ if (typeof paramsOrCallback === 'function') {
1967
+ callback = paramsOrCallback;
1968
+ params =
1969
+ {} as Params$Resource$Projects$Locations$Nodes$Getguestattributes;
1970
+ options = {};
1971
+ }
1972
+
1973
+ if (typeof optionsOrCallback === 'function') {
1974
+ callback = optionsOrCallback;
1975
+ options = {};
1976
+ }
1977
+
1978
+ const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/';
1979
+ const parameters = {
1980
+ options: Object.assign(
1981
+ {
1982
+ url: (rootUrl + '/v2alpha1/{+name}:getGuestAttributes').replace(
1983
+ /([^:]\/)\/+/g,
1984
+ '$1'
1985
+ ),
1986
+ method: 'POST',
1987
+ },
1988
+ options
1989
+ ),
1990
+ params,
1991
+ requiredParams: ['name'],
1992
+ pathParams: ['name'],
1993
+ context: this.context,
1994
+ };
1995
+ if (callback) {
1996
+ createAPIRequest<Schema$GetGuestAttributesResponse>(
1997
+ parameters,
1998
+ callback as BodyResponseCallback<unknown>
1999
+ );
2000
+ } else {
2001
+ return createAPIRequest<Schema$GetGuestAttributesResponse>(parameters);
2002
+ }
2003
+ }
2004
+
2005
+ /**
2006
+ * Lists nodes.
2007
+ * @example
2008
+ * ```js
2009
+ * // Before running the sample:
2010
+ * // - Enable the API at:
2011
+ * // https://console.developers.google.com/apis/api/tpu.googleapis.com
2012
+ * // - Login into gcloud by running:
2013
+ * // `$ gcloud auth application-default login`
2014
+ * // - Install the npm module by running:
2015
+ * // `$ npm install googleapis`
2016
+ *
2017
+ * const {google} = require('googleapis');
2018
+ * const tpu = google.tpu('v2alpha1');
2019
+ *
2020
+ * async function main() {
2021
+ * const auth = new google.auth.GoogleAuth({
2022
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2023
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
2024
+ * });
2025
+ *
2026
+ * // Acquire an auth client, and bind it to all future calls
2027
+ * const authClient = await auth.getClient();
2028
+ * google.options({auth: authClient});
2029
+ *
2030
+ * // Do the magic
2031
+ * const res = await tpu.projects.locations.nodes.list({
2032
+ * // The maximum number of items to return.
2033
+ * pageSize: 'placeholder-value',
2034
+ * // The next_page_token value returned from a previous List request, if any.
2035
+ * pageToken: 'placeholder-value',
2036
+ * // Required. The parent resource name.
2037
+ * parent: 'projects/my-project/locations/my-location',
2038
+ * });
2039
+ * console.log(res.data);
2040
+ *
2041
+ * // Example response
2042
+ * // {
2043
+ * // "nextPageToken": "my_nextPageToken",
2044
+ * // "nodes": [],
2045
+ * // "unreachable": []
2046
+ * // }
2047
+ * }
2048
+ *
2049
+ * main().catch(e => {
2050
+ * console.error(e);
2051
+ * throw e;
2052
+ * });
2053
+ *
2054
+ * ```
2055
+ *
2056
+ * @param params - Parameters for request
2057
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
2058
+ * @param callback - Optional callback that handles the response.
2059
+ * @returns A promise if used with async/await, or void if used with a callback.
2060
+ */
2061
+ list(
2062
+ params: Params$Resource$Projects$Locations$Nodes$List,
2063
+ options: StreamMethodOptions
2064
+ ): GaxiosPromise<Readable>;
2065
+ list(
2066
+ params?: Params$Resource$Projects$Locations$Nodes$List,
2067
+ options?: MethodOptions
2068
+ ): GaxiosPromise<Schema$ListNodesResponse>;
2069
+ list(
2070
+ params: Params$Resource$Projects$Locations$Nodes$List,
2071
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
2072
+ callback: BodyResponseCallback<Readable>
2073
+ ): void;
2074
+ list(
2075
+ params: Params$Resource$Projects$Locations$Nodes$List,
2076
+ options: MethodOptions | BodyResponseCallback<Schema$ListNodesResponse>,
2077
+ callback: BodyResponseCallback<Schema$ListNodesResponse>
2078
+ ): void;
2079
+ list(
2080
+ params: Params$Resource$Projects$Locations$Nodes$List,
2081
+ callback: BodyResponseCallback<Schema$ListNodesResponse>
2082
+ ): void;
2083
+ list(callback: BodyResponseCallback<Schema$ListNodesResponse>): void;
2084
+ list(
2085
+ paramsOrCallback?:
2086
+ | Params$Resource$Projects$Locations$Nodes$List
2087
+ | BodyResponseCallback<Schema$ListNodesResponse>
2088
+ | BodyResponseCallback<Readable>,
2089
+ optionsOrCallback?:
2090
+ | MethodOptions
2091
+ | StreamMethodOptions
2092
+ | BodyResponseCallback<Schema$ListNodesResponse>
2093
+ | BodyResponseCallback<Readable>,
2094
+ callback?:
2095
+ | BodyResponseCallback<Schema$ListNodesResponse>
2096
+ | BodyResponseCallback<Readable>
2097
+ ):
2098
+ | void
2099
+ | GaxiosPromise<Schema$ListNodesResponse>
2100
+ | GaxiosPromise<Readable> {
2101
+ let params = (paramsOrCallback ||
2102
+ {}) as Params$Resource$Projects$Locations$Nodes$List;
2103
+ let options = (optionsOrCallback || {}) as MethodOptions;
2104
+
2105
+ if (typeof paramsOrCallback === 'function') {
2106
+ callback = paramsOrCallback;
2107
+ params = {} as Params$Resource$Projects$Locations$Nodes$List;
2108
+ options = {};
2109
+ }
2110
+
2111
+ if (typeof optionsOrCallback === 'function') {
2112
+ callback = optionsOrCallback;
2113
+ options = {};
2114
+ }
2115
+
2116
+ const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/';
2117
+ const parameters = {
2118
+ options: Object.assign(
2119
+ {
2120
+ url: (rootUrl + '/v2alpha1/{+parent}/nodes').replace(
2121
+ /([^:]\/)\/+/g,
2122
+ '$1'
2123
+ ),
2124
+ method: 'GET',
2125
+ },
2126
+ options
2127
+ ),
2128
+ params,
2129
+ requiredParams: ['parent'],
2130
+ pathParams: ['parent'],
2131
+ context: this.context,
2132
+ };
2133
+ if (callback) {
2134
+ createAPIRequest<Schema$ListNodesResponse>(
2135
+ parameters,
2136
+ callback as BodyResponseCallback<unknown>
2137
+ );
2138
+ } else {
2139
+ return createAPIRequest<Schema$ListNodesResponse>(parameters);
2140
+ }
2141
+ }
2142
+
2143
+ /**
2144
+ * Updates the configurations of a node.
2145
+ * @example
2146
+ * ```js
2147
+ * // Before running the sample:
2148
+ * // - Enable the API at:
2149
+ * // https://console.developers.google.com/apis/api/tpu.googleapis.com
2150
+ * // - Login into gcloud by running:
2151
+ * // `$ gcloud auth application-default login`
2152
+ * // - Install the npm module by running:
2153
+ * // `$ npm install googleapis`
2154
+ *
2155
+ * const {google} = require('googleapis');
2156
+ * const tpu = google.tpu('v2alpha1');
2157
+ *
2158
+ * async function main() {
2159
+ * const auth = new google.auth.GoogleAuth({
2160
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2161
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
2162
+ * });
2163
+ *
2164
+ * // Acquire an auth client, and bind it to all future calls
2165
+ * const authClient = await auth.getClient();
2166
+ * google.options({auth: authClient});
2167
+ *
2168
+ * // Do the magic
2169
+ * const res = await tpu.projects.locations.nodes.patch({
2170
+ * // Output only. Immutable. The name of the TPU.
2171
+ * name: 'projects/my-project/locations/my-location/nodes/my-node',
2172
+ * // Required. Mask of fields from Node to update. Supported fields: [description, tags, labels, metadata, network_config.enable_external_ips].
2173
+ * updateMask: 'placeholder-value',
2174
+ *
2175
+ * // Request body metadata
2176
+ * requestBody: {
2177
+ * // request body parameters
2178
+ * // {
2179
+ * // "acceleratorType": "my_acceleratorType",
2180
+ * // "apiVersion": "my_apiVersion",
2181
+ * // "cidrBlock": "my_cidrBlock",
2182
+ * // "createTime": "my_createTime",
2183
+ * // "dataDisks": [],
2184
+ * // "description": "my_description",
2185
+ * // "health": "my_health",
2186
+ * // "healthDescription": "my_healthDescription",
2187
+ * // "id": "my_id",
2188
+ * // "labels": {},
2189
+ * // "metadata": {},
2190
+ * // "name": "my_name",
2191
+ * // "networkConfig": {},
2192
+ * // "networkEndpoints": [],
2193
+ * // "runtimeVersion": "my_runtimeVersion",
2194
+ * // "schedulingConfig": {},
2195
+ * // "serviceAccount": {},
2196
+ * // "state": "my_state",
2197
+ * // "symptoms": [],
2198
+ * // "tags": []
2199
+ * // }
2200
+ * },
2201
+ * });
2202
+ * console.log(res.data);
2203
+ *
2204
+ * // Example response
2205
+ * // {
2206
+ * // "done": false,
2207
+ * // "error": {},
2208
+ * // "metadata": {},
2209
+ * // "name": "my_name",
2210
+ * // "response": {}
2211
+ * // }
2212
+ * }
2213
+ *
2214
+ * main().catch(e => {
2215
+ * console.error(e);
2216
+ * throw e;
2217
+ * });
2218
+ *
2219
+ * ```
2220
+ *
2221
+ * @param params - Parameters for request
2222
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
2223
+ * @param callback - Optional callback that handles the response.
2224
+ * @returns A promise if used with async/await, or void if used with a callback.
2225
+ */
2226
+ patch(
2227
+ params: Params$Resource$Projects$Locations$Nodes$Patch,
2228
+ options: StreamMethodOptions
2229
+ ): GaxiosPromise<Readable>;
2230
+ patch(
2231
+ params?: Params$Resource$Projects$Locations$Nodes$Patch,
2232
+ options?: MethodOptions
2233
+ ): GaxiosPromise<Schema$Operation>;
2234
+ patch(
2235
+ params: Params$Resource$Projects$Locations$Nodes$Patch,
2236
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
2237
+ callback: BodyResponseCallback<Readable>
2238
+ ): void;
2239
+ patch(
2240
+ params: Params$Resource$Projects$Locations$Nodes$Patch,
2241
+ options: MethodOptions | BodyResponseCallback<Schema$Operation>,
2242
+ callback: BodyResponseCallback<Schema$Operation>
2243
+ ): void;
2244
+ patch(
2245
+ params: Params$Resource$Projects$Locations$Nodes$Patch,
2246
+ callback: BodyResponseCallback<Schema$Operation>
2247
+ ): void;
2248
+ patch(callback: BodyResponseCallback<Schema$Operation>): void;
2249
+ patch(
2250
+ paramsOrCallback?:
2251
+ | Params$Resource$Projects$Locations$Nodes$Patch
2252
+ | BodyResponseCallback<Schema$Operation>
2253
+ | BodyResponseCallback<Readable>,
2254
+ optionsOrCallback?:
2255
+ | MethodOptions
2256
+ | StreamMethodOptions
2257
+ | BodyResponseCallback<Schema$Operation>
2258
+ | BodyResponseCallback<Readable>,
2259
+ callback?:
2260
+ | BodyResponseCallback<Schema$Operation>
2261
+ | BodyResponseCallback<Readable>
2262
+ ): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
2263
+ let params = (paramsOrCallback ||
2264
+ {}) as Params$Resource$Projects$Locations$Nodes$Patch;
2265
+ let options = (optionsOrCallback || {}) as MethodOptions;
2266
+
2267
+ if (typeof paramsOrCallback === 'function') {
2268
+ callback = paramsOrCallback;
2269
+ params = {} as Params$Resource$Projects$Locations$Nodes$Patch;
2270
+ options = {};
2271
+ }
2272
+
2273
+ if (typeof optionsOrCallback === 'function') {
2274
+ callback = optionsOrCallback;
2275
+ options = {};
2276
+ }
2277
+
2278
+ const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/';
2279
+ const parameters = {
2280
+ options: Object.assign(
2281
+ {
2282
+ url: (rootUrl + '/v2alpha1/{+name}').replace(/([^:]\/)\/+/g, '$1'),
2283
+ method: 'PATCH',
2284
+ },
2285
+ options
2286
+ ),
2287
+ params,
2288
+ requiredParams: ['name'],
2289
+ pathParams: ['name'],
2290
+ context: this.context,
2291
+ };
2292
+ if (callback) {
2293
+ createAPIRequest<Schema$Operation>(
2294
+ parameters,
2295
+ callback as BodyResponseCallback<unknown>
2296
+ );
2297
+ } else {
2298
+ return createAPIRequest<Schema$Operation>(parameters);
2299
+ }
2300
+ }
2301
+
2302
+ /**
2303
+ * Starts a node.
2304
+ * @example
2305
+ * ```js
2306
+ * // Before running the sample:
2307
+ * // - Enable the API at:
2308
+ * // https://console.developers.google.com/apis/api/tpu.googleapis.com
2309
+ * // - Login into gcloud by running:
2310
+ * // `$ gcloud auth application-default login`
2311
+ * // - Install the npm module by running:
2312
+ * // `$ npm install googleapis`
2313
+ *
2314
+ * const {google} = require('googleapis');
2315
+ * const tpu = google.tpu('v2alpha1');
2316
+ *
2317
+ * async function main() {
2318
+ * const auth = new google.auth.GoogleAuth({
2319
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2320
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
2321
+ * });
2322
+ *
2323
+ * // Acquire an auth client, and bind it to all future calls
2324
+ * const authClient = await auth.getClient();
2325
+ * google.options({auth: authClient});
2326
+ *
2327
+ * // Do the magic
2328
+ * const res = await tpu.projects.locations.nodes.start({
2329
+ * // The resource name.
2330
+ * name: 'projects/my-project/locations/my-location/nodes/my-node',
2331
+ *
2332
+ * // Request body metadata
2333
+ * requestBody: {
2334
+ * // request body parameters
2335
+ * // {}
2336
+ * },
2337
+ * });
2338
+ * console.log(res.data);
2339
+ *
2340
+ * // Example response
2341
+ * // {
2342
+ * // "done": false,
2343
+ * // "error": {},
2344
+ * // "metadata": {},
2345
+ * // "name": "my_name",
2346
+ * // "response": {}
2347
+ * // }
2348
+ * }
2349
+ *
2350
+ * main().catch(e => {
2351
+ * console.error(e);
2352
+ * throw e;
2353
+ * });
2354
+ *
2355
+ * ```
2356
+ *
2357
+ * @param params - Parameters for request
2358
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
2359
+ * @param callback - Optional callback that handles the response.
2360
+ * @returns A promise if used with async/await, or void if used with a callback.
2361
+ */
2362
+ start(
2363
+ params: Params$Resource$Projects$Locations$Nodes$Start,
2364
+ options: StreamMethodOptions
2365
+ ): GaxiosPromise<Readable>;
2366
+ start(
2367
+ params?: Params$Resource$Projects$Locations$Nodes$Start,
2368
+ options?: MethodOptions
2369
+ ): GaxiosPromise<Schema$Operation>;
2370
+ start(
2371
+ params: Params$Resource$Projects$Locations$Nodes$Start,
2372
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
2373
+ callback: BodyResponseCallback<Readable>
2374
+ ): void;
2375
+ start(
2376
+ params: Params$Resource$Projects$Locations$Nodes$Start,
2377
+ options: MethodOptions | BodyResponseCallback<Schema$Operation>,
2378
+ callback: BodyResponseCallback<Schema$Operation>
2379
+ ): void;
2380
+ start(
2381
+ params: Params$Resource$Projects$Locations$Nodes$Start,
2382
+ callback: BodyResponseCallback<Schema$Operation>
2383
+ ): void;
2384
+ start(callback: BodyResponseCallback<Schema$Operation>): void;
2385
+ start(
2386
+ paramsOrCallback?:
2387
+ | Params$Resource$Projects$Locations$Nodes$Start
2388
+ | BodyResponseCallback<Schema$Operation>
2389
+ | BodyResponseCallback<Readable>,
2390
+ optionsOrCallback?:
2391
+ | MethodOptions
2392
+ | StreamMethodOptions
2393
+ | BodyResponseCallback<Schema$Operation>
2394
+ | BodyResponseCallback<Readable>,
2395
+ callback?:
2396
+ | BodyResponseCallback<Schema$Operation>
2397
+ | BodyResponseCallback<Readable>
2398
+ ): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
2399
+ let params = (paramsOrCallback ||
2400
+ {}) as Params$Resource$Projects$Locations$Nodes$Start;
2401
+ let options = (optionsOrCallback || {}) as MethodOptions;
2402
+
2403
+ if (typeof paramsOrCallback === 'function') {
2404
+ callback = paramsOrCallback;
2405
+ params = {} as Params$Resource$Projects$Locations$Nodes$Start;
2406
+ options = {};
2407
+ }
2408
+
2409
+ if (typeof optionsOrCallback === 'function') {
2410
+ callback = optionsOrCallback;
2411
+ options = {};
2412
+ }
2413
+
2414
+ const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/';
2415
+ const parameters = {
2416
+ options: Object.assign(
2417
+ {
2418
+ url: (rootUrl + '/v2alpha1/{+name}:start').replace(
2419
+ /([^:]\/)\/+/g,
2420
+ '$1'
2421
+ ),
2422
+ method: 'POST',
2423
+ },
2424
+ options
2425
+ ),
2426
+ params,
2427
+ requiredParams: ['name'],
2428
+ pathParams: ['name'],
2429
+ context: this.context,
2430
+ };
2431
+ if (callback) {
2432
+ createAPIRequest<Schema$Operation>(
2433
+ parameters,
2434
+ callback as BodyResponseCallback<unknown>
2435
+ );
2436
+ } else {
2437
+ return createAPIRequest<Schema$Operation>(parameters);
2438
+ }
2439
+ }
2440
+
2441
+ /**
2442
+ * Stops a node. This operation is only available with single TPU nodes.
2443
+ * @example
2444
+ * ```js
2445
+ * // Before running the sample:
2446
+ * // - Enable the API at:
2447
+ * // https://console.developers.google.com/apis/api/tpu.googleapis.com
2448
+ * // - Login into gcloud by running:
2449
+ * // `$ gcloud auth application-default login`
2450
+ * // - Install the npm module by running:
2451
+ * // `$ npm install googleapis`
2452
+ *
2453
+ * const {google} = require('googleapis');
2454
+ * const tpu = google.tpu('v2alpha1');
2455
+ *
2456
+ * async function main() {
2457
+ * const auth = new google.auth.GoogleAuth({
2458
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2459
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
2460
+ * });
2461
+ *
2462
+ * // Acquire an auth client, and bind it to all future calls
2463
+ * const authClient = await auth.getClient();
2464
+ * google.options({auth: authClient});
2465
+ *
2466
+ * // Do the magic
2467
+ * const res = await tpu.projects.locations.nodes.stop({
2468
+ * // The resource name.
2469
+ * name: 'projects/my-project/locations/my-location/nodes/my-node',
2470
+ *
2471
+ * // Request body metadata
2472
+ * requestBody: {
2473
+ * // request body parameters
2474
+ * // {}
2475
+ * },
2476
+ * });
2477
+ * console.log(res.data);
2478
+ *
2479
+ * // Example response
2480
+ * // {
2481
+ * // "done": false,
2482
+ * // "error": {},
2483
+ * // "metadata": {},
2484
+ * // "name": "my_name",
2485
+ * // "response": {}
2486
+ * // }
2487
+ * }
2488
+ *
2489
+ * main().catch(e => {
2490
+ * console.error(e);
2491
+ * throw e;
2492
+ * });
2493
+ *
2494
+ * ```
2495
+ *
2496
+ * @param params - Parameters for request
2497
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
2498
+ * @param callback - Optional callback that handles the response.
2499
+ * @returns A promise if used with async/await, or void if used with a callback.
2500
+ */
2501
+ stop(
2502
+ params: Params$Resource$Projects$Locations$Nodes$Stop,
2503
+ options: StreamMethodOptions
2504
+ ): GaxiosPromise<Readable>;
2505
+ stop(
2506
+ params?: Params$Resource$Projects$Locations$Nodes$Stop,
2507
+ options?: MethodOptions
2508
+ ): GaxiosPromise<Schema$Operation>;
2509
+ stop(
2510
+ params: Params$Resource$Projects$Locations$Nodes$Stop,
2511
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
2512
+ callback: BodyResponseCallback<Readable>
2513
+ ): void;
2514
+ stop(
2515
+ params: Params$Resource$Projects$Locations$Nodes$Stop,
2516
+ options: MethodOptions | BodyResponseCallback<Schema$Operation>,
2517
+ callback: BodyResponseCallback<Schema$Operation>
2518
+ ): void;
2519
+ stop(
2520
+ params: Params$Resource$Projects$Locations$Nodes$Stop,
2521
+ callback: BodyResponseCallback<Schema$Operation>
2522
+ ): void;
2523
+ stop(callback: BodyResponseCallback<Schema$Operation>): void;
2524
+ stop(
2525
+ paramsOrCallback?:
2526
+ | Params$Resource$Projects$Locations$Nodes$Stop
2527
+ | BodyResponseCallback<Schema$Operation>
2528
+ | BodyResponseCallback<Readable>,
2529
+ optionsOrCallback?:
2530
+ | MethodOptions
2531
+ | StreamMethodOptions
2532
+ | BodyResponseCallback<Schema$Operation>
2533
+ | BodyResponseCallback<Readable>,
2534
+ callback?:
2535
+ | BodyResponseCallback<Schema$Operation>
2536
+ | BodyResponseCallback<Readable>
2537
+ ): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
2538
+ let params = (paramsOrCallback ||
2539
+ {}) as Params$Resource$Projects$Locations$Nodes$Stop;
2540
+ let options = (optionsOrCallback || {}) as MethodOptions;
2541
+
2542
+ if (typeof paramsOrCallback === 'function') {
2543
+ callback = paramsOrCallback;
2544
+ params = {} as Params$Resource$Projects$Locations$Nodes$Stop;
2545
+ options = {};
2546
+ }
2547
+
2548
+ if (typeof optionsOrCallback === 'function') {
2549
+ callback = optionsOrCallback;
2550
+ options = {};
2551
+ }
2552
+
2553
+ const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/';
2554
+ const parameters = {
2555
+ options: Object.assign(
2556
+ {
2557
+ url: (rootUrl + '/v2alpha1/{+name}:stop').replace(
2558
+ /([^:]\/)\/+/g,
2559
+ '$1'
2560
+ ),
2561
+ method: 'POST',
2562
+ },
2563
+ options
2564
+ ),
2565
+ params,
2566
+ requiredParams: ['name'],
2567
+ pathParams: ['name'],
2568
+ context: this.context,
2569
+ };
2570
+ if (callback) {
2571
+ createAPIRequest<Schema$Operation>(
2572
+ parameters,
2573
+ callback as BodyResponseCallback<unknown>
2574
+ );
2575
+ } else {
2576
+ return createAPIRequest<Schema$Operation>(parameters);
2577
+ }
2578
+ }
2579
+ }
2580
+
2581
+ export interface Params$Resource$Projects$Locations$Nodes$Create
2582
+ extends StandardParameters {
2583
+ /**
2584
+ * The unqualified resource name.
2585
+ */
2586
+ nodeId?: string;
2587
+ /**
2588
+ * Required. The parent resource name.
2589
+ */
2590
+ parent?: string;
2591
+
2592
+ /**
2593
+ * Request body metadata
2594
+ */
2595
+ requestBody?: Schema$Node;
2596
+ }
2597
+ export interface Params$Resource$Projects$Locations$Nodes$Delete
2598
+ extends StandardParameters {
2599
+ /**
2600
+ * Required. The resource name.
2601
+ */
2602
+ name?: string;
2603
+ }
2604
+ export interface Params$Resource$Projects$Locations$Nodes$Get
2605
+ extends StandardParameters {
2606
+ /**
2607
+ * Required. The resource name.
2608
+ */
2609
+ name?: string;
2610
+ }
2611
+ export interface Params$Resource$Projects$Locations$Nodes$Getguestattributes
2612
+ extends StandardParameters {
2613
+ /**
2614
+ * Required. The resource name.
2615
+ */
2616
+ name?: string;
2617
+
2618
+ /**
2619
+ * Request body metadata
2620
+ */
2621
+ requestBody?: Schema$GetGuestAttributesRequest;
2622
+ }
2623
+ export interface Params$Resource$Projects$Locations$Nodes$List
2624
+ extends StandardParameters {
2625
+ /**
2626
+ * The maximum number of items to return.
2627
+ */
2628
+ pageSize?: number;
2629
+ /**
2630
+ * The next_page_token value returned from a previous List request, if any.
2631
+ */
2632
+ pageToken?: string;
2633
+ /**
2634
+ * Required. The parent resource name.
2635
+ */
2636
+ parent?: string;
2637
+ }
2638
+ export interface Params$Resource$Projects$Locations$Nodes$Patch
2639
+ extends StandardParameters {
2640
+ /**
2641
+ * Output only. Immutable. The name of the TPU.
2642
+ */
2643
+ name?: string;
2644
+ /**
2645
+ * Required. Mask of fields from Node to update. Supported fields: [description, tags, labels, metadata, network_config.enable_external_ips].
2646
+ */
2647
+ updateMask?: string;
2648
+
2649
+ /**
2650
+ * Request body metadata
2651
+ */
2652
+ requestBody?: Schema$Node;
2653
+ }
2654
+ export interface Params$Resource$Projects$Locations$Nodes$Start
2655
+ extends StandardParameters {
2656
+ /**
2657
+ * The resource name.
2658
+ */
2659
+ name?: string;
2660
+
2661
+ /**
2662
+ * Request body metadata
2663
+ */
2664
+ requestBody?: Schema$StartNodeRequest;
2665
+ }
2666
+ export interface Params$Resource$Projects$Locations$Nodes$Stop
2667
+ extends StandardParameters {
2668
+ /**
2669
+ * The resource name.
2670
+ */
2671
+ name?: string;
2672
+
2673
+ /**
2674
+ * Request body metadata
2675
+ */
2676
+ requestBody?: Schema$StopNodeRequest;
2677
+ }
2678
+
2679
+ export class Resource$Projects$Locations$Operations {
2680
+ context: APIRequestContext;
2681
+ constructor(context: APIRequestContext) {
2682
+ this.context = context;
2683
+ }
2684
+
2685
+ /**
2686
+ * 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`.
2687
+ * @example
2688
+ * ```js
2689
+ * // Before running the sample:
2690
+ * // - Enable the API at:
2691
+ * // https://console.developers.google.com/apis/api/tpu.googleapis.com
2692
+ * // - Login into gcloud by running:
2693
+ * // `$ gcloud auth application-default login`
2694
+ * // - Install the npm module by running:
2695
+ * // `$ npm install googleapis`
2696
+ *
2697
+ * const {google} = require('googleapis');
2698
+ * const tpu = google.tpu('v2alpha1');
2699
+ *
2700
+ * async function main() {
2701
+ * const auth = new google.auth.GoogleAuth({
2702
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2703
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
2704
+ * });
2705
+ *
2706
+ * // Acquire an auth client, and bind it to all future calls
2707
+ * const authClient = await auth.getClient();
2708
+ * google.options({auth: authClient});
2709
+ *
2710
+ * // Do the magic
2711
+ * const res = await tpu.projects.locations.operations.cancel({
2712
+ * // The name of the operation resource to be cancelled.
2713
+ * name: 'projects/my-project/locations/my-location/operations/my-operation',
2714
+ * });
2715
+ * console.log(res.data);
2716
+ *
2717
+ * // Example response
2718
+ * // {}
2719
+ * }
2720
+ *
2721
+ * main().catch(e => {
2722
+ * console.error(e);
2723
+ * throw e;
2724
+ * });
2725
+ *
2726
+ * ```
2727
+ *
2728
+ * @param params - Parameters for request
2729
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
2730
+ * @param callback - Optional callback that handles the response.
2731
+ * @returns A promise if used with async/await, or void if used with a callback.
2732
+ */
2733
+ cancel(
2734
+ params: Params$Resource$Projects$Locations$Operations$Cancel,
2735
+ options: StreamMethodOptions
2736
+ ): GaxiosPromise<Readable>;
2737
+ cancel(
2738
+ params?: Params$Resource$Projects$Locations$Operations$Cancel,
2739
+ options?: MethodOptions
2740
+ ): GaxiosPromise<Schema$Empty>;
2741
+ cancel(
2742
+ params: Params$Resource$Projects$Locations$Operations$Cancel,
2743
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
2744
+ callback: BodyResponseCallback<Readable>
2745
+ ): void;
2746
+ cancel(
2747
+ params: Params$Resource$Projects$Locations$Operations$Cancel,
2748
+ options: MethodOptions | BodyResponseCallback<Schema$Empty>,
2749
+ callback: BodyResponseCallback<Schema$Empty>
2750
+ ): void;
2751
+ cancel(
2752
+ params: Params$Resource$Projects$Locations$Operations$Cancel,
2753
+ callback: BodyResponseCallback<Schema$Empty>
2754
+ ): void;
2755
+ cancel(callback: BodyResponseCallback<Schema$Empty>): void;
2756
+ cancel(
2757
+ paramsOrCallback?:
2758
+ | Params$Resource$Projects$Locations$Operations$Cancel
2759
+ | BodyResponseCallback<Schema$Empty>
2760
+ | BodyResponseCallback<Readable>,
2761
+ optionsOrCallback?:
2762
+ | MethodOptions
2763
+ | StreamMethodOptions
2764
+ | BodyResponseCallback<Schema$Empty>
2765
+ | BodyResponseCallback<Readable>,
2766
+ callback?:
2767
+ | BodyResponseCallback<Schema$Empty>
2768
+ | BodyResponseCallback<Readable>
2769
+ ): void | GaxiosPromise<Schema$Empty> | GaxiosPromise<Readable> {
2770
+ let params = (paramsOrCallback ||
2771
+ {}) as Params$Resource$Projects$Locations$Operations$Cancel;
2772
+ let options = (optionsOrCallback || {}) as MethodOptions;
2773
+
2774
+ if (typeof paramsOrCallback === 'function') {
2775
+ callback = paramsOrCallback;
2776
+ params = {} as Params$Resource$Projects$Locations$Operations$Cancel;
2777
+ options = {};
2778
+ }
2779
+
2780
+ if (typeof optionsOrCallback === 'function') {
2781
+ callback = optionsOrCallback;
2782
+ options = {};
2783
+ }
2784
+
2785
+ const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/';
2786
+ const parameters = {
2787
+ options: Object.assign(
2788
+ {
2789
+ url: (rootUrl + '/v2alpha1/{+name}:cancel').replace(
2790
+ /([^:]\/)\/+/g,
2791
+ '$1'
2792
+ ),
2793
+ method: 'POST',
2794
+ },
2795
+ options
2796
+ ),
2797
+ params,
2798
+ requiredParams: ['name'],
2799
+ pathParams: ['name'],
2800
+ context: this.context,
2801
+ };
2802
+ if (callback) {
2803
+ createAPIRequest<Schema$Empty>(
2804
+ parameters,
2805
+ callback as BodyResponseCallback<unknown>
2806
+ );
2807
+ } else {
2808
+ return createAPIRequest<Schema$Empty>(parameters);
2809
+ }
2810
+ }
2811
+
2812
+ /**
2813
+ * 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`.
2814
+ * @example
2815
+ * ```js
2816
+ * // Before running the sample:
2817
+ * // - Enable the API at:
2818
+ * // https://console.developers.google.com/apis/api/tpu.googleapis.com
2819
+ * // - Login into gcloud by running:
2820
+ * // `$ gcloud auth application-default login`
2821
+ * // - Install the npm module by running:
2822
+ * // `$ npm install googleapis`
2823
+ *
2824
+ * const {google} = require('googleapis');
2825
+ * const tpu = google.tpu('v2alpha1');
2826
+ *
2827
+ * async function main() {
2828
+ * const auth = new google.auth.GoogleAuth({
2829
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2830
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
2831
+ * });
2832
+ *
2833
+ * // Acquire an auth client, and bind it to all future calls
2834
+ * const authClient = await auth.getClient();
2835
+ * google.options({auth: authClient});
2836
+ *
2837
+ * // Do the magic
2838
+ * const res = await tpu.projects.locations.operations.delete({
2839
+ * // The name of the operation resource to be deleted.
2840
+ * name: 'projects/my-project/locations/my-location/operations/my-operation',
2841
+ * });
2842
+ * console.log(res.data);
2843
+ *
2844
+ * // Example response
2845
+ * // {}
2846
+ * }
2847
+ *
2848
+ * main().catch(e => {
2849
+ * console.error(e);
2850
+ * throw e;
2851
+ * });
2852
+ *
2853
+ * ```
2854
+ *
2855
+ * @param params - Parameters for request
2856
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
2857
+ * @param callback - Optional callback that handles the response.
2858
+ * @returns A promise if used with async/await, or void if used with a callback.
2859
+ */
2860
+ delete(
2861
+ params: Params$Resource$Projects$Locations$Operations$Delete,
2862
+ options: StreamMethodOptions
2863
+ ): GaxiosPromise<Readable>;
2864
+ delete(
2865
+ params?: Params$Resource$Projects$Locations$Operations$Delete,
2866
+ options?: MethodOptions
2867
+ ): GaxiosPromise<Schema$Empty>;
2868
+ delete(
2869
+ params: Params$Resource$Projects$Locations$Operations$Delete,
2870
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
2871
+ callback: BodyResponseCallback<Readable>
2872
+ ): void;
2873
+ delete(
2874
+ params: Params$Resource$Projects$Locations$Operations$Delete,
2875
+ options: MethodOptions | BodyResponseCallback<Schema$Empty>,
2876
+ callback: BodyResponseCallback<Schema$Empty>
2877
+ ): void;
2878
+ delete(
2879
+ params: Params$Resource$Projects$Locations$Operations$Delete,
2880
+ callback: BodyResponseCallback<Schema$Empty>
2881
+ ): void;
2882
+ delete(callback: BodyResponseCallback<Schema$Empty>): void;
2883
+ delete(
2884
+ paramsOrCallback?:
2885
+ | Params$Resource$Projects$Locations$Operations$Delete
2886
+ | BodyResponseCallback<Schema$Empty>
2887
+ | BodyResponseCallback<Readable>,
2888
+ optionsOrCallback?:
2889
+ | MethodOptions
2890
+ | StreamMethodOptions
2891
+ | BodyResponseCallback<Schema$Empty>
2892
+ | BodyResponseCallback<Readable>,
2893
+ callback?:
2894
+ | BodyResponseCallback<Schema$Empty>
2895
+ | BodyResponseCallback<Readable>
2896
+ ): void | GaxiosPromise<Schema$Empty> | GaxiosPromise<Readable> {
2897
+ let params = (paramsOrCallback ||
2898
+ {}) as Params$Resource$Projects$Locations$Operations$Delete;
2899
+ let options = (optionsOrCallback || {}) as MethodOptions;
2900
+
2901
+ if (typeof paramsOrCallback === 'function') {
2902
+ callback = paramsOrCallback;
2903
+ params = {} as Params$Resource$Projects$Locations$Operations$Delete;
2904
+ options = {};
2905
+ }
2906
+
2907
+ if (typeof optionsOrCallback === 'function') {
2908
+ callback = optionsOrCallback;
2909
+ options = {};
2910
+ }
2911
+
2912
+ const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/';
2913
+ const parameters = {
2914
+ options: Object.assign(
2915
+ {
2916
+ url: (rootUrl + '/v2alpha1/{+name}').replace(/([^:]\/)\/+/g, '$1'),
2917
+ method: 'DELETE',
2918
+ },
2919
+ options
2920
+ ),
2921
+ params,
2922
+ requiredParams: ['name'],
2923
+ pathParams: ['name'],
2924
+ context: this.context,
2925
+ };
2926
+ if (callback) {
2927
+ createAPIRequest<Schema$Empty>(
2928
+ parameters,
2929
+ callback as BodyResponseCallback<unknown>
2930
+ );
2931
+ } else {
2932
+ return createAPIRequest<Schema$Empty>(parameters);
2933
+ }
2934
+ }
2935
+
2936
+ /**
2937
+ * 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.
2938
+ * @example
2939
+ * ```js
2940
+ * // Before running the sample:
2941
+ * // - Enable the API at:
2942
+ * // https://console.developers.google.com/apis/api/tpu.googleapis.com
2943
+ * // - Login into gcloud by running:
2944
+ * // `$ gcloud auth application-default login`
2945
+ * // - Install the npm module by running:
2946
+ * // `$ npm install googleapis`
2947
+ *
2948
+ * const {google} = require('googleapis');
2949
+ * const tpu = google.tpu('v2alpha1');
2950
+ *
2951
+ * async function main() {
2952
+ * const auth = new google.auth.GoogleAuth({
2953
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2954
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
2955
+ * });
2956
+ *
2957
+ * // Acquire an auth client, and bind it to all future calls
2958
+ * const authClient = await auth.getClient();
2959
+ * google.options({auth: authClient});
2960
+ *
2961
+ * // Do the magic
2962
+ * const res = await tpu.projects.locations.operations.get({
2963
+ * // The name of the operation resource.
2964
+ * name: 'projects/my-project/locations/my-location/operations/my-operation',
2965
+ * });
2966
+ * console.log(res.data);
2967
+ *
2968
+ * // Example response
2969
+ * // {
2970
+ * // "done": false,
2971
+ * // "error": {},
2972
+ * // "metadata": {},
2973
+ * // "name": "my_name",
2974
+ * // "response": {}
2975
+ * // }
2976
+ * }
2977
+ *
2978
+ * main().catch(e => {
2979
+ * console.error(e);
2980
+ * throw e;
2981
+ * });
2982
+ *
2983
+ * ```
2984
+ *
2985
+ * @param params - Parameters for request
2986
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
2987
+ * @param callback - Optional callback that handles the response.
2988
+ * @returns A promise if used with async/await, or void if used with a callback.
2989
+ */
2990
+ get(
2991
+ params: Params$Resource$Projects$Locations$Operations$Get,
2992
+ options: StreamMethodOptions
2993
+ ): GaxiosPromise<Readable>;
2994
+ get(
2995
+ params?: Params$Resource$Projects$Locations$Operations$Get,
2996
+ options?: MethodOptions
2997
+ ): GaxiosPromise<Schema$Operation>;
2998
+ get(
2999
+ params: Params$Resource$Projects$Locations$Operations$Get,
3000
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
3001
+ callback: BodyResponseCallback<Readable>
3002
+ ): void;
3003
+ get(
3004
+ params: Params$Resource$Projects$Locations$Operations$Get,
3005
+ options: MethodOptions | BodyResponseCallback<Schema$Operation>,
3006
+ callback: BodyResponseCallback<Schema$Operation>
3007
+ ): void;
3008
+ get(
3009
+ params: Params$Resource$Projects$Locations$Operations$Get,
3010
+ callback: BodyResponseCallback<Schema$Operation>
3011
+ ): void;
3012
+ get(callback: BodyResponseCallback<Schema$Operation>): void;
3013
+ get(
3014
+ paramsOrCallback?:
3015
+ | Params$Resource$Projects$Locations$Operations$Get
3016
+ | BodyResponseCallback<Schema$Operation>
3017
+ | BodyResponseCallback<Readable>,
3018
+ optionsOrCallback?:
3019
+ | MethodOptions
3020
+ | StreamMethodOptions
3021
+ | BodyResponseCallback<Schema$Operation>
3022
+ | BodyResponseCallback<Readable>,
3023
+ callback?:
3024
+ | BodyResponseCallback<Schema$Operation>
3025
+ | BodyResponseCallback<Readable>
3026
+ ): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
3027
+ let params = (paramsOrCallback ||
3028
+ {}) as Params$Resource$Projects$Locations$Operations$Get;
3029
+ let options = (optionsOrCallback || {}) as MethodOptions;
3030
+
3031
+ if (typeof paramsOrCallback === 'function') {
3032
+ callback = paramsOrCallback;
3033
+ params = {} as Params$Resource$Projects$Locations$Operations$Get;
3034
+ options = {};
3035
+ }
3036
+
3037
+ if (typeof optionsOrCallback === 'function') {
3038
+ callback = optionsOrCallback;
3039
+ options = {};
3040
+ }
3041
+
3042
+ const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/';
3043
+ const parameters = {
3044
+ options: Object.assign(
3045
+ {
3046
+ url: (rootUrl + '/v2alpha1/{+name}').replace(/([^:]\/)\/+/g, '$1'),
3047
+ method: 'GET',
3048
+ },
3049
+ options
3050
+ ),
3051
+ params,
3052
+ requiredParams: ['name'],
3053
+ pathParams: ['name'],
3054
+ context: this.context,
3055
+ };
3056
+ if (callback) {
3057
+ createAPIRequest<Schema$Operation>(
3058
+ parameters,
3059
+ callback as BodyResponseCallback<unknown>
3060
+ );
3061
+ } else {
3062
+ return createAPIRequest<Schema$Operation>(parameters);
3063
+ }
3064
+ }
3065
+
3066
+ /**
3067
+ * 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.
3068
+ * @example
3069
+ * ```js
3070
+ * // Before running the sample:
3071
+ * // - Enable the API at:
3072
+ * // https://console.developers.google.com/apis/api/tpu.googleapis.com
3073
+ * // - Login into gcloud by running:
3074
+ * // `$ gcloud auth application-default login`
3075
+ * // - Install the npm module by running:
3076
+ * // `$ npm install googleapis`
3077
+ *
3078
+ * const {google} = require('googleapis');
3079
+ * const tpu = google.tpu('v2alpha1');
3080
+ *
3081
+ * async function main() {
3082
+ * const auth = new google.auth.GoogleAuth({
3083
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
3084
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
3085
+ * });
3086
+ *
3087
+ * // Acquire an auth client, and bind it to all future calls
3088
+ * const authClient = await auth.getClient();
3089
+ * google.options({auth: authClient});
3090
+ *
3091
+ * // Do the magic
3092
+ * const res = await tpu.projects.locations.operations.list({
3093
+ * // The standard list filter.
3094
+ * filter: 'placeholder-value',
3095
+ * // The name of the operation's parent resource.
3096
+ * name: 'projects/my-project/locations/my-location',
3097
+ * // The standard list page size.
3098
+ * pageSize: 'placeholder-value',
3099
+ * // The standard list page token.
3100
+ * pageToken: 'placeholder-value',
3101
+ * });
3102
+ * console.log(res.data);
3103
+ *
3104
+ * // Example response
3105
+ * // {
3106
+ * // "nextPageToken": "my_nextPageToken",
3107
+ * // "operations": []
3108
+ * // }
3109
+ * }
3110
+ *
3111
+ * main().catch(e => {
3112
+ * console.error(e);
3113
+ * throw e;
3114
+ * });
3115
+ *
3116
+ * ```
3117
+ *
3118
+ * @param params - Parameters for request
3119
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
3120
+ * @param callback - Optional callback that handles the response.
3121
+ * @returns A promise if used with async/await, or void if used with a callback.
3122
+ */
3123
+ list(
3124
+ params: Params$Resource$Projects$Locations$Operations$List,
3125
+ options: StreamMethodOptions
3126
+ ): GaxiosPromise<Readable>;
3127
+ list(
3128
+ params?: Params$Resource$Projects$Locations$Operations$List,
3129
+ options?: MethodOptions
3130
+ ): GaxiosPromise<Schema$ListOperationsResponse>;
3131
+ list(
3132
+ params: Params$Resource$Projects$Locations$Operations$List,
3133
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
3134
+ callback: BodyResponseCallback<Readable>
3135
+ ): void;
3136
+ list(
3137
+ params: Params$Resource$Projects$Locations$Operations$List,
3138
+ options:
3139
+ | MethodOptions
3140
+ | BodyResponseCallback<Schema$ListOperationsResponse>,
3141
+ callback: BodyResponseCallback<Schema$ListOperationsResponse>
3142
+ ): void;
3143
+ list(
3144
+ params: Params$Resource$Projects$Locations$Operations$List,
3145
+ callback: BodyResponseCallback<Schema$ListOperationsResponse>
3146
+ ): void;
3147
+ list(callback: BodyResponseCallback<Schema$ListOperationsResponse>): void;
3148
+ list(
3149
+ paramsOrCallback?:
3150
+ | Params$Resource$Projects$Locations$Operations$List
3151
+ | BodyResponseCallback<Schema$ListOperationsResponse>
3152
+ | BodyResponseCallback<Readable>,
3153
+ optionsOrCallback?:
3154
+ | MethodOptions
3155
+ | StreamMethodOptions
3156
+ | BodyResponseCallback<Schema$ListOperationsResponse>
3157
+ | BodyResponseCallback<Readable>,
3158
+ callback?:
3159
+ | BodyResponseCallback<Schema$ListOperationsResponse>
3160
+ | BodyResponseCallback<Readable>
3161
+ ):
3162
+ | void
3163
+ | GaxiosPromise<Schema$ListOperationsResponse>
3164
+ | GaxiosPromise<Readable> {
3165
+ let params = (paramsOrCallback ||
3166
+ {}) as Params$Resource$Projects$Locations$Operations$List;
3167
+ let options = (optionsOrCallback || {}) as MethodOptions;
3168
+
3169
+ if (typeof paramsOrCallback === 'function') {
3170
+ callback = paramsOrCallback;
3171
+ params = {} as Params$Resource$Projects$Locations$Operations$List;
3172
+ options = {};
3173
+ }
3174
+
3175
+ if (typeof optionsOrCallback === 'function') {
3176
+ callback = optionsOrCallback;
3177
+ options = {};
3178
+ }
3179
+
3180
+ const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/';
3181
+ const parameters = {
3182
+ options: Object.assign(
3183
+ {
3184
+ url: (rootUrl + '/v2alpha1/{+name}/operations').replace(
3185
+ /([^:]\/)\/+/g,
3186
+ '$1'
3187
+ ),
3188
+ method: 'GET',
3189
+ },
3190
+ options
3191
+ ),
3192
+ params,
3193
+ requiredParams: ['name'],
3194
+ pathParams: ['name'],
3195
+ context: this.context,
3196
+ };
3197
+ if (callback) {
3198
+ createAPIRequest<Schema$ListOperationsResponse>(
3199
+ parameters,
3200
+ callback as BodyResponseCallback<unknown>
3201
+ );
3202
+ } else {
3203
+ return createAPIRequest<Schema$ListOperationsResponse>(parameters);
3204
+ }
3205
+ }
3206
+ }
3207
+
3208
+ export interface Params$Resource$Projects$Locations$Operations$Cancel
3209
+ extends StandardParameters {
3210
+ /**
3211
+ * The name of the operation resource to be cancelled.
3212
+ */
3213
+ name?: string;
3214
+ }
3215
+ export interface Params$Resource$Projects$Locations$Operations$Delete
3216
+ extends StandardParameters {
3217
+ /**
3218
+ * The name of the operation resource to be deleted.
3219
+ */
3220
+ name?: string;
3221
+ }
3222
+ export interface Params$Resource$Projects$Locations$Operations$Get
3223
+ extends StandardParameters {
3224
+ /**
3225
+ * The name of the operation resource.
3226
+ */
3227
+ name?: string;
3228
+ }
3229
+ export interface Params$Resource$Projects$Locations$Operations$List
3230
+ extends StandardParameters {
3231
+ /**
3232
+ * The standard list filter.
3233
+ */
3234
+ filter?: string;
3235
+ /**
3236
+ * The name of the operation's parent resource.
3237
+ */
3238
+ name?: string;
3239
+ /**
3240
+ * The standard list page size.
3241
+ */
3242
+ pageSize?: number;
3243
+ /**
3244
+ * The standard list page token.
3245
+ */
3246
+ pageToken?: string;
3247
+ }
3248
+
3249
+ export class Resource$Projects$Locations$Runtimeversions {
3250
+ context: APIRequestContext;
3251
+ constructor(context: APIRequestContext) {
3252
+ this.context = context;
3253
+ }
3254
+
3255
+ /**
3256
+ * Gets a runtime version.
3257
+ * @example
3258
+ * ```js
3259
+ * // Before running the sample:
3260
+ * // - Enable the API at:
3261
+ * // https://console.developers.google.com/apis/api/tpu.googleapis.com
3262
+ * // - Login into gcloud by running:
3263
+ * // `$ gcloud auth application-default login`
3264
+ * // - Install the npm module by running:
3265
+ * // `$ npm install googleapis`
3266
+ *
3267
+ * const {google} = require('googleapis');
3268
+ * const tpu = google.tpu('v2alpha1');
3269
+ *
3270
+ * async function main() {
3271
+ * const auth = new google.auth.GoogleAuth({
3272
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
3273
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
3274
+ * });
3275
+ *
3276
+ * // Acquire an auth client, and bind it to all future calls
3277
+ * const authClient = await auth.getClient();
3278
+ * google.options({auth: authClient});
3279
+ *
3280
+ * // Do the magic
3281
+ * const res = await tpu.projects.locations.runtimeVersions.get({
3282
+ * // Required. The resource name.
3283
+ * name: 'projects/my-project/locations/my-location/runtimeVersions/my-runtimeVersion',
3284
+ * });
3285
+ * console.log(res.data);
3286
+ *
3287
+ * // Example response
3288
+ * // {
3289
+ * // "name": "my_name",
3290
+ * // "version": "my_version"
3291
+ * // }
3292
+ * }
3293
+ *
3294
+ * main().catch(e => {
3295
+ * console.error(e);
3296
+ * throw e;
3297
+ * });
3298
+ *
3299
+ * ```
3300
+ *
3301
+ * @param params - Parameters for request
3302
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
3303
+ * @param callback - Optional callback that handles the response.
3304
+ * @returns A promise if used with async/await, or void if used with a callback.
3305
+ */
3306
+ get(
3307
+ params: Params$Resource$Projects$Locations$Runtimeversions$Get,
3308
+ options: StreamMethodOptions
3309
+ ): GaxiosPromise<Readable>;
3310
+ get(
3311
+ params?: Params$Resource$Projects$Locations$Runtimeversions$Get,
3312
+ options?: MethodOptions
3313
+ ): GaxiosPromise<Schema$RuntimeVersion>;
3314
+ get(
3315
+ params: Params$Resource$Projects$Locations$Runtimeversions$Get,
3316
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
3317
+ callback: BodyResponseCallback<Readable>
3318
+ ): void;
3319
+ get(
3320
+ params: Params$Resource$Projects$Locations$Runtimeversions$Get,
3321
+ options: MethodOptions | BodyResponseCallback<Schema$RuntimeVersion>,
3322
+ callback: BodyResponseCallback<Schema$RuntimeVersion>
3323
+ ): void;
3324
+ get(
3325
+ params: Params$Resource$Projects$Locations$Runtimeversions$Get,
3326
+ callback: BodyResponseCallback<Schema$RuntimeVersion>
3327
+ ): void;
3328
+ get(callback: BodyResponseCallback<Schema$RuntimeVersion>): void;
3329
+ get(
3330
+ paramsOrCallback?:
3331
+ | Params$Resource$Projects$Locations$Runtimeversions$Get
3332
+ | BodyResponseCallback<Schema$RuntimeVersion>
3333
+ | BodyResponseCallback<Readable>,
3334
+ optionsOrCallback?:
3335
+ | MethodOptions
3336
+ | StreamMethodOptions
3337
+ | BodyResponseCallback<Schema$RuntimeVersion>
3338
+ | BodyResponseCallback<Readable>,
3339
+ callback?:
3340
+ | BodyResponseCallback<Schema$RuntimeVersion>
3341
+ | BodyResponseCallback<Readable>
3342
+ ): void | GaxiosPromise<Schema$RuntimeVersion> | GaxiosPromise<Readable> {
3343
+ let params = (paramsOrCallback ||
3344
+ {}) as Params$Resource$Projects$Locations$Runtimeversions$Get;
3345
+ let options = (optionsOrCallback || {}) as MethodOptions;
3346
+
3347
+ if (typeof paramsOrCallback === 'function') {
3348
+ callback = paramsOrCallback;
3349
+ params = {} as Params$Resource$Projects$Locations$Runtimeversions$Get;
3350
+ options = {};
3351
+ }
3352
+
3353
+ if (typeof optionsOrCallback === 'function') {
3354
+ callback = optionsOrCallback;
3355
+ options = {};
3356
+ }
3357
+
3358
+ const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/';
3359
+ const parameters = {
3360
+ options: Object.assign(
3361
+ {
3362
+ url: (rootUrl + '/v2alpha1/{+name}').replace(/([^:]\/)\/+/g, '$1'),
3363
+ method: 'GET',
3364
+ },
3365
+ options
3366
+ ),
3367
+ params,
3368
+ requiredParams: ['name'],
3369
+ pathParams: ['name'],
3370
+ context: this.context,
3371
+ };
3372
+ if (callback) {
3373
+ createAPIRequest<Schema$RuntimeVersion>(
3374
+ parameters,
3375
+ callback as BodyResponseCallback<unknown>
3376
+ );
3377
+ } else {
3378
+ return createAPIRequest<Schema$RuntimeVersion>(parameters);
3379
+ }
3380
+ }
3381
+
3382
+ /**
3383
+ * Lists runtime versions supported by this API.
3384
+ * @example
3385
+ * ```js
3386
+ * // Before running the sample:
3387
+ * // - Enable the API at:
3388
+ * // https://console.developers.google.com/apis/api/tpu.googleapis.com
3389
+ * // - Login into gcloud by running:
3390
+ * // `$ gcloud auth application-default login`
3391
+ * // - Install the npm module by running:
3392
+ * // `$ npm install googleapis`
3393
+ *
3394
+ * const {google} = require('googleapis');
3395
+ * const tpu = google.tpu('v2alpha1');
3396
+ *
3397
+ * async function main() {
3398
+ * const auth = new google.auth.GoogleAuth({
3399
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
3400
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
3401
+ * });
3402
+ *
3403
+ * // Acquire an auth client, and bind it to all future calls
3404
+ * const authClient = await auth.getClient();
3405
+ * google.options({auth: authClient});
3406
+ *
3407
+ * // Do the magic
3408
+ * const res = await tpu.projects.locations.runtimeVersions.list({
3409
+ * // List filter.
3410
+ * filter: 'placeholder-value',
3411
+ * // Sort results.
3412
+ * orderBy: 'placeholder-value',
3413
+ * // The maximum number of items to return.
3414
+ * pageSize: 'placeholder-value',
3415
+ * // The next_page_token value returned from a previous List request, if any.
3416
+ * pageToken: 'placeholder-value',
3417
+ * // Required. The parent resource name.
3418
+ * parent: 'projects/my-project/locations/my-location',
3419
+ * });
3420
+ * console.log(res.data);
3421
+ *
3422
+ * // Example response
3423
+ * // {
3424
+ * // "nextPageToken": "my_nextPageToken",
3425
+ * // "runtimeVersions": [],
3426
+ * // "unreachable": []
3427
+ * // }
3428
+ * }
3429
+ *
3430
+ * main().catch(e => {
3431
+ * console.error(e);
3432
+ * throw e;
3433
+ * });
3434
+ *
3435
+ * ```
3436
+ *
3437
+ * @param params - Parameters for request
3438
+ * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
3439
+ * @param callback - Optional callback that handles the response.
3440
+ * @returns A promise if used with async/await, or void if used with a callback.
3441
+ */
3442
+ list(
3443
+ params: Params$Resource$Projects$Locations$Runtimeversions$List,
3444
+ options: StreamMethodOptions
3445
+ ): GaxiosPromise<Readable>;
3446
+ list(
3447
+ params?: Params$Resource$Projects$Locations$Runtimeversions$List,
3448
+ options?: MethodOptions
3449
+ ): GaxiosPromise<Schema$ListRuntimeVersionsResponse>;
3450
+ list(
3451
+ params: Params$Resource$Projects$Locations$Runtimeversions$List,
3452
+ options: StreamMethodOptions | BodyResponseCallback<Readable>,
3453
+ callback: BodyResponseCallback<Readable>
3454
+ ): void;
3455
+ list(
3456
+ params: Params$Resource$Projects$Locations$Runtimeversions$List,
3457
+ options:
3458
+ | MethodOptions
3459
+ | BodyResponseCallback<Schema$ListRuntimeVersionsResponse>,
3460
+ callback: BodyResponseCallback<Schema$ListRuntimeVersionsResponse>
3461
+ ): void;
3462
+ list(
3463
+ params: Params$Resource$Projects$Locations$Runtimeversions$List,
3464
+ callback: BodyResponseCallback<Schema$ListRuntimeVersionsResponse>
3465
+ ): void;
3466
+ list(
3467
+ callback: BodyResponseCallback<Schema$ListRuntimeVersionsResponse>
3468
+ ): void;
3469
+ list(
3470
+ paramsOrCallback?:
3471
+ | Params$Resource$Projects$Locations$Runtimeversions$List
3472
+ | BodyResponseCallback<Schema$ListRuntimeVersionsResponse>
3473
+ | BodyResponseCallback<Readable>,
3474
+ optionsOrCallback?:
3475
+ | MethodOptions
3476
+ | StreamMethodOptions
3477
+ | BodyResponseCallback<Schema$ListRuntimeVersionsResponse>
3478
+ | BodyResponseCallback<Readable>,
3479
+ callback?:
3480
+ | BodyResponseCallback<Schema$ListRuntimeVersionsResponse>
3481
+ | BodyResponseCallback<Readable>
3482
+ ):
3483
+ | void
3484
+ | GaxiosPromise<Schema$ListRuntimeVersionsResponse>
3485
+ | GaxiosPromise<Readable> {
3486
+ let params = (paramsOrCallback ||
3487
+ {}) as Params$Resource$Projects$Locations$Runtimeversions$List;
3488
+ let options = (optionsOrCallback || {}) as MethodOptions;
3489
+
3490
+ if (typeof paramsOrCallback === 'function') {
3491
+ callback = paramsOrCallback;
3492
+ params = {} as Params$Resource$Projects$Locations$Runtimeversions$List;
3493
+ options = {};
3494
+ }
3495
+
3496
+ if (typeof optionsOrCallback === 'function') {
3497
+ callback = optionsOrCallback;
3498
+ options = {};
3499
+ }
3500
+
3501
+ const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/';
3502
+ const parameters = {
3503
+ options: Object.assign(
3504
+ {
3505
+ url: (rootUrl + '/v2alpha1/{+parent}/runtimeVersions').replace(
3506
+ /([^:]\/)\/+/g,
3507
+ '$1'
3508
+ ),
3509
+ method: 'GET',
3510
+ },
3511
+ options
3512
+ ),
3513
+ params,
3514
+ requiredParams: ['parent'],
3515
+ pathParams: ['parent'],
3516
+ context: this.context,
3517
+ };
3518
+ if (callback) {
3519
+ createAPIRequest<Schema$ListRuntimeVersionsResponse>(
3520
+ parameters,
3521
+ callback as BodyResponseCallback<unknown>
3522
+ );
3523
+ } else {
3524
+ return createAPIRequest<Schema$ListRuntimeVersionsResponse>(parameters);
3525
+ }
3526
+ }
3527
+ }
3528
+
3529
+ export interface Params$Resource$Projects$Locations$Runtimeversions$Get
3530
+ extends StandardParameters {
3531
+ /**
3532
+ * Required. The resource name.
3533
+ */
3534
+ name?: string;
3535
+ }
3536
+ export interface Params$Resource$Projects$Locations$Runtimeversions$List
3537
+ extends StandardParameters {
3538
+ /**
3539
+ * List filter.
3540
+ */
3541
+ filter?: string;
3542
+ /**
3543
+ * Sort results.
3544
+ */
3545
+ orderBy?: string;
3546
+ /**
3547
+ * The maximum number of items to return.
3548
+ */
3549
+ pageSize?: number;
3550
+ /**
3551
+ * The next_page_token value returned from a previous List request, if any.
3552
+ */
3553
+ pageToken?: string;
3554
+ /**
3555
+ * Required. The parent resource name.
3556
+ */
3557
+ parent?: string;
3558
+ }
3559
+ }