Skip to content

Commit e053547

Browse files
yoshi-automationsofisl
authored andcommitted
feat(tpu): update the API
#### tpu:v2alpha1 The following keys were added: - resources.projects.resources.locations.resources.queuedResources.methods.reset.description - resources.projects.resources.locations.resources.queuedResources.methods.reset.flatPath - resources.projects.resources.locations.resources.queuedResources.methods.reset.httpMethod - resources.projects.resources.locations.resources.queuedResources.methods.reset.id - resources.projects.resources.locations.resources.queuedResources.methods.reset.parameterOrder - resources.projects.resources.locations.resources.queuedResources.methods.reset.parameters.name.description - resources.projects.resources.locations.resources.queuedResources.methods.reset.parameters.name.location - resources.projects.resources.locations.resources.queuedResources.methods.reset.parameters.name.pattern - resources.projects.resources.locations.resources.queuedResources.methods.reset.parameters.name.required - resources.projects.resources.locations.resources.queuedResources.methods.reset.parameters.name.type - resources.projects.resources.locations.resources.queuedResources.methods.reset.path - resources.projects.resources.locations.resources.queuedResources.methods.reset.request.$ref - resources.projects.resources.locations.resources.queuedResources.methods.reset.response.$ref - resources.projects.resources.locations.resources.queuedResources.methods.reset.scopes - schemas.ResetQueuedResourceRequest.description - schemas.ResetQueuedResourceRequest.id - schemas.ResetQueuedResourceRequest.type The following keys were changed: - resources.projects.resources.locations.resources.operations.methods.list.description
1 parent ab94b6d commit e053547

File tree

2 files changed

+192
-3
lines changed

2 files changed

+192
-3
lines changed

discovery/tpu-v2alpha1.json

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@
637637
]
638638
},
639639
"list": {
640-
"description": "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/*/operations`. To override the binding, API services can add a binding such as `\"/v1/{name=users/*}/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.",
640+
"description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.",
641641
"flatPath": "v2alpha1/projects/{projectsId}/locations/{locationsId}/operations",
642642
"httpMethod": "GET",
643643
"id": "tpu.projects.locations.operations.list",
@@ -809,6 +809,34 @@
809809
"scopes": [
810810
"https://www.googleapis.com/auth/cloud-platform"
811811
]
812+
},
813+
"reset": {
814+
"description": "Resets a QueuedResource TPU instance",
815+
"flatPath": "v2alpha1/projects/{projectsId}/locations/{locationsId}/queuedResources/{queuedResourcesId}:reset",
816+
"httpMethod": "POST",
817+
"id": "tpu.projects.locations.queuedResources.reset",
818+
"parameterOrder": [
819+
"name"
820+
],
821+
"parameters": {
822+
"name": {
823+
"description": "Required. The name of the queued resource.",
824+
"location": "path",
825+
"pattern": "^projects/[^/]+/locations/[^/]+/queuedResources/[^/]+$",
826+
"required": true,
827+
"type": "string"
828+
}
829+
},
830+
"path": "v2alpha1/{+name}:reset",
831+
"request": {
832+
"$ref": "ResetQueuedResourceRequest"
833+
},
834+
"response": {
835+
"$ref": "Operation"
836+
},
837+
"scopes": [
838+
"https://www.googleapis.com/auth/cloud-platform"
839+
]
812840
}
813841
}
814842
},
@@ -892,7 +920,7 @@
892920
}
893921
}
894922
},
895-
"revision": "20230223",
923+
"revision": "20230316",
896924
"rootUrl": "https://tpu.googleapis.com/",
897925
"schemas": {
898926
"AcceleratorConfig": {
@@ -1785,6 +1813,12 @@
17851813
},
17861814
"type": "object"
17871815
},
1816+
"ResetQueuedResourceRequest": {
1817+
"description": "Request for ResetQueuedResource.",
1818+
"id": "ResetQueuedResourceRequest",
1819+
"properties": {},
1820+
"type": "object"
1821+
},
17881822
"RuntimeVersion": {
17891823
"description": "A runtime version that a Node can be configured with.",
17901824
"id": "RuntimeVersion",

src/apis/tpu/v2alpha1.ts

Lines changed: 156 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,10 @@ export namespace tpu_v2alpha1 {
737737
*/
738738
validUntilTime?: string | null;
739739
}
740+
/**
741+
* Request for ResetQueuedResource.
742+
*/
743+
export interface Schema$ResetQueuedResourceRequest {}
740744
/**
741745
* A runtime version that a Node can be configured with.
742746
*/
@@ -3496,7 +3500,7 @@ export namespace tpu_v2alpha1 {
34963500
}
34973501

34983502
/**
3499-
* 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.
3503+
* Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.
35003504
* @example
35013505
* ```js
35023506
* // Before running the sample:
@@ -4240,6 +4244,145 @@ export namespace tpu_v2alpha1 {
42404244
return createAPIRequest<Schema$ListQueuedResourcesResponse>(parameters);
42414245
}
42424246
}
4247+
4248+
/**
4249+
* Resets a QueuedResource TPU instance
4250+
* @example
4251+
* ```js
4252+
* // Before running the sample:
4253+
* // - Enable the API at:
4254+
* // https://console.developers.google.com/apis/api/tpu.googleapis.com
4255+
* // - Login into gcloud by running:
4256+
* // `$ gcloud auth application-default login`
4257+
* // - Install the npm module by running:
4258+
* // `$ npm install googleapis`
4259+
*
4260+
* const {google} = require('googleapis');
4261+
* const tpu = google.tpu('v2alpha1');
4262+
*
4263+
* async function main() {
4264+
* const auth = new google.auth.GoogleAuth({
4265+
* // Scopes can be specified either as an array or as a single, space-delimited string.
4266+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
4267+
* });
4268+
*
4269+
* // Acquire an auth client, and bind it to all future calls
4270+
* const authClient = await auth.getClient();
4271+
* google.options({auth: authClient});
4272+
*
4273+
* // Do the magic
4274+
* const res = await tpu.projects.locations.queuedResources.reset({
4275+
* // Required. The name of the queued resource.
4276+
* name: 'projects/my-project/locations/my-location/queuedResources/my-queuedResource',
4277+
*
4278+
* // Request body metadata
4279+
* requestBody: {
4280+
* // request body parameters
4281+
* // {}
4282+
* },
4283+
* });
4284+
* console.log(res.data);
4285+
*
4286+
* // Example response
4287+
* // {
4288+
* // "done": false,
4289+
* // "error": {},
4290+
* // "metadata": {},
4291+
* // "name": "my_name",
4292+
* // "response": {}
4293+
* // }
4294+
* }
4295+
*
4296+
* main().catch(e => {
4297+
* console.error(e);
4298+
* throw e;
4299+
* });
4300+
*
4301+
* ```
4302+
*
4303+
* @param params - Parameters for request
4304+
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
4305+
* @param callback - Optional callback that handles the response.
4306+
* @returns A promise if used with async/await, or void if used with a callback.
4307+
*/
4308+
reset(
4309+
params: Params$Resource$Projects$Locations$Queuedresources$Reset,
4310+
options: StreamMethodOptions
4311+
): GaxiosPromise<Readable>;
4312+
reset(
4313+
params?: Params$Resource$Projects$Locations$Queuedresources$Reset,
4314+
options?: MethodOptions
4315+
): GaxiosPromise<Schema$Operation>;
4316+
reset(
4317+
params: Params$Resource$Projects$Locations$Queuedresources$Reset,
4318+
options: StreamMethodOptions | BodyResponseCallback<Readable>,
4319+
callback: BodyResponseCallback<Readable>
4320+
): void;
4321+
reset(
4322+
params: Params$Resource$Projects$Locations$Queuedresources$Reset,
4323+
options: MethodOptions | BodyResponseCallback<Schema$Operation>,
4324+
callback: BodyResponseCallback<Schema$Operation>
4325+
): void;
4326+
reset(
4327+
params: Params$Resource$Projects$Locations$Queuedresources$Reset,
4328+
callback: BodyResponseCallback<Schema$Operation>
4329+
): void;
4330+
reset(callback: BodyResponseCallback<Schema$Operation>): void;
4331+
reset(
4332+
paramsOrCallback?:
4333+
| Params$Resource$Projects$Locations$Queuedresources$Reset
4334+
| BodyResponseCallback<Schema$Operation>
4335+
| BodyResponseCallback<Readable>,
4336+
optionsOrCallback?:
4337+
| MethodOptions
4338+
| StreamMethodOptions
4339+
| BodyResponseCallback<Schema$Operation>
4340+
| BodyResponseCallback<Readable>,
4341+
callback?:
4342+
| BodyResponseCallback<Schema$Operation>
4343+
| BodyResponseCallback<Readable>
4344+
): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
4345+
let params = (paramsOrCallback ||
4346+
{}) as Params$Resource$Projects$Locations$Queuedresources$Reset;
4347+
let options = (optionsOrCallback || {}) as MethodOptions;
4348+
4349+
if (typeof paramsOrCallback === 'function') {
4350+
callback = paramsOrCallback;
4351+
params = {} as Params$Resource$Projects$Locations$Queuedresources$Reset;
4352+
options = {};
4353+
}
4354+
4355+
if (typeof optionsOrCallback === 'function') {
4356+
callback = optionsOrCallback;
4357+
options = {};
4358+
}
4359+
4360+
const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/';
4361+
const parameters = {
4362+
options: Object.assign(
4363+
{
4364+
url: (rootUrl + '/v2alpha1/{+name}:reset').replace(
4365+
/([^:]\/)\/+/g,
4366+
'$1'
4367+
),
4368+
method: 'POST',
4369+
},
4370+
options
4371+
),
4372+
params,
4373+
requiredParams: ['name'],
4374+
pathParams: ['name'],
4375+
context: this.context,
4376+
};
4377+
if (callback) {
4378+
createAPIRequest<Schema$Operation>(
4379+
parameters,
4380+
callback as BodyResponseCallback<unknown>
4381+
);
4382+
} else {
4383+
return createAPIRequest<Schema$Operation>(parameters);
4384+
}
4385+
}
42434386
}
42444387

42454388
export interface Params$Resource$Projects$Locations$Queuedresources$Create
@@ -4295,6 +4438,18 @@ export namespace tpu_v2alpha1 {
42954438
*/
42964439
parent?: string;
42974440
}
4441+
export interface Params$Resource$Projects$Locations$Queuedresources$Reset
4442+
extends StandardParameters {
4443+
/**
4444+
* Required. The name of the queued resource.
4445+
*/
4446+
name?: string;
4447+
4448+
/**
4449+
* Request body metadata
4450+
*/
4451+
requestBody?: Schema$ResetQueuedResourceRequest;
4452+
}
42984453

42994454
export class Resource$Projects$Locations$Runtimeversions {
43004455
context: APIRequestContext;

0 commit comments

Comments
 (0)