Skip to content

Commit 80ae519

Browse files
yoshi-automationsofisl
authored andcommitted
feat(notebooks): update the API
#### notebooks:v1 The following keys were changed: - schemas.AcceleratorConfig.properties.type.enum - schemas.AcceleratorConfig.properties.type.enumDescriptions - schemas.SetInstanceAcceleratorRequest.properties.type.enum - schemas.SetInstanceAcceleratorRequest.properties.type.enumDescriptions #### notebooks:v2 The following keys were added: - resources.projects.resources.locations.resources.instances.methods.restore.description - resources.projects.resources.locations.resources.instances.methods.restore.flatPath - resources.projects.resources.locations.resources.instances.methods.restore.httpMethod - resources.projects.resources.locations.resources.instances.methods.restore.id - resources.projects.resources.locations.resources.instances.methods.restore.parameterOrder - resources.projects.resources.locations.resources.instances.methods.restore.parameters.name.description - resources.projects.resources.locations.resources.instances.methods.restore.parameters.name.location - resources.projects.resources.locations.resources.instances.methods.restore.parameters.name.pattern - resources.projects.resources.locations.resources.instances.methods.restore.parameters.name.required - resources.projects.resources.locations.resources.instances.methods.restore.parameters.name.type - resources.projects.resources.locations.resources.instances.methods.restore.path - resources.projects.resources.locations.resources.instances.methods.restore.request.$ref - resources.projects.resources.locations.resources.instances.methods.restore.response.$ref - resources.projects.resources.locations.resources.instances.methods.restore.scopes - schemas.RestoreInstanceRequest.description - schemas.RestoreInstanceRequest.id - schemas.RestoreInstanceRequest.properties.snapshot.$ref - schemas.RestoreInstanceRequest.properties.snapshot.description - schemas.RestoreInstanceRequest.type - schemas.Snapshot.description - schemas.Snapshot.id - schemas.Snapshot.properties.projectId.description - schemas.Snapshot.properties.projectId.type - schemas.Snapshot.properties.snapshotId.description - schemas.Snapshot.properties.snapshotId.type - schemas.Snapshot.type
1 parent 08c6b8f commit 80ae519

File tree

3 files changed

+186
-2
lines changed

3 files changed

+186
-2
lines changed

discovery/notebooks-v1.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2008,7 +2008,7 @@
20082008
}
20092009
}
20102010
},
2011-
"revision": "20240314",
2011+
"revision": "20240820",
20122012
"rootUrl": "https://notebooks.googleapis.com/",
20132013
"schemas": {
20142014
"AcceleratorConfig": {
@@ -2035,6 +2035,8 @@
20352035
"NVIDIA_TESLA_T4_VWS",
20362036
"NVIDIA_TESLA_P100_VWS",
20372037
"NVIDIA_TESLA_P4_VWS",
2038+
"NVIDIA_H100_80GB",
2039+
"NVIDIA_H100_MEGA_80GB",
20382040
"TPU_V2",
20392041
"TPU_V3"
20402042
],
@@ -2051,6 +2053,8 @@
20512053
"Accelerator type is NVIDIA Tesla T4 Virtual Workstations.",
20522054
"Accelerator type is NVIDIA Tesla P100 Virtual Workstations.",
20532055
"Accelerator type is NVIDIA Tesla P4 Virtual Workstations.",
2056+
"Accelerator type is NVIDIA H100 80GB.",
2057+
"Accelerator type is NVIDIA H100 Mega 80GB.",
20542058
"(Coming soon) Accelerator type is TPU V2.",
20552059
"(Coming soon) Accelerator type is TPU V3."
20562060
],
@@ -4058,6 +4062,8 @@
40584062
"NVIDIA_TESLA_T4_VWS",
40594063
"NVIDIA_TESLA_P100_VWS",
40604064
"NVIDIA_TESLA_P4_VWS",
4065+
"NVIDIA_H100_80GB",
4066+
"NVIDIA_H100_MEGA_80GB",
40614067
"TPU_V2",
40624068
"TPU_V3"
40634069
],
@@ -4074,6 +4080,8 @@
40744080
"Accelerator type is NVIDIA Tesla T4 Virtual Workstations.",
40754081
"Accelerator type is NVIDIA Tesla P100 Virtual Workstations.",
40764082
"Accelerator type is NVIDIA Tesla P4 Virtual Workstations.",
4083+
"Accelerator type is NVIDIA H100 80GB.",
4084+
"Accelerator type is NVIDIA H100 Mega 80GB.",
40774085
"(Coming soon) Accelerator type is TPU V2.",
40784086
"(Coming soon) Accelerator type is TPU V3."
40794087
],

discovery/notebooks-v2.json

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,34 @@
550550
"https://www.googleapis.com/auth/cloud-platform"
551551
]
552552
},
553+
"restore": {
554+
"description": "RestoreInstance restores an Instance from a BackupSource.",
555+
"flatPath": "v2/projects/{projectsId}/locations/{locationsId}/instances/{instancesId}:restore",
556+
"httpMethod": "POST",
557+
"id": "notebooks.projects.locations.instances.restore",
558+
"parameterOrder": [
559+
"name"
560+
],
561+
"parameters": {
562+
"name": {
563+
"description": "Required. Format: `projects/{project_id}/locations/{location}/instances/{instance_id}`",
564+
"location": "path",
565+
"pattern": "^projects/[^/]+/locations/[^/]+/instances/[^/]+$",
566+
"required": true,
567+
"type": "string"
568+
}
569+
},
570+
"path": "v2/{+name}:restore",
571+
"request": {
572+
"$ref": "RestoreInstanceRequest"
573+
},
574+
"response": {
575+
"$ref": "Operation"
576+
},
577+
"scopes": [
578+
"https://www.googleapis.com/auth/cloud-platform"
579+
]
580+
},
553581
"rollback": {
554582
"description": "Rollbacks a notebook instance to the previous version.",
555583
"flatPath": "v2/projects/{projectsId}/locations/{locationsId}/instances/{instancesId}:rollback",
@@ -876,7 +904,7 @@
876904
}
877905
}
878906
},
879-
"revision": "20240731",
907+
"revision": "20240820",
880908
"rootUrl": "https://notebooks.googleapis.com/",
881909
"schemas": {
882910
"AcceleratorConfig": {
@@ -1768,6 +1796,17 @@
17681796
},
17691797
"type": "object"
17701798
},
1799+
"RestoreInstanceRequest": {
1800+
"description": "Request for restoring the notebook instance from a BackupSource.",
1801+
"id": "RestoreInstanceRequest",
1802+
"properties": {
1803+
"snapshot": {
1804+
"$ref": "Snapshot",
1805+
"description": "Snapshot to be used for restore."
1806+
}
1807+
},
1808+
"type": "object"
1809+
},
17711810
"RollbackInstanceRequest": {
17721811
"description": "Request for rollbacking a notebook instance",
17731812
"id": "RollbackInstanceRequest",
@@ -1833,6 +1872,21 @@
18331872
},
18341873
"type": "object"
18351874
},
1875+
"Snapshot": {
1876+
"description": "Snapshot represents the snapshot of the data disk used to restore the Workbench Instance from. Refers to: compute/v1/projects/{project_id}/global/snapshots/{snapshot_id}",
1877+
"id": "Snapshot",
1878+
"properties": {
1879+
"projectId": {
1880+
"description": "Required. The project ID of the snapshot.",
1881+
"type": "string"
1882+
},
1883+
"snapshotId": {
1884+
"description": "Required. The ID of the snapshot.",
1885+
"type": "string"
1886+
}
1887+
},
1888+
"type": "object"
1889+
},
18361890
"StartInstanceRequest": {
18371891
"description": "Request for starting a notebook instance",
18381892
"id": "StartInstanceRequest",

src/apis/notebooks/v2.ts

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,15 @@ export namespace notebooks_v2 {
711711
*/
712712
dataDisk?: Schema$DataDisk;
713713
}
714+
/**
715+
* Request for restoring the notebook instance from a BackupSource.
716+
*/
717+
export interface Schema$RestoreInstanceRequest {
718+
/**
719+
* Snapshot to be used for restore.
720+
*/
721+
snapshot?: Schema$Snapshot;
722+
}
714723
/**
715724
* Request for rollbacking a notebook instance
716725
*/
@@ -763,6 +772,19 @@ export namespace notebooks_v2 {
763772
*/
764773
enableVtpm?: boolean | null;
765774
}
775+
/**
776+
* Snapshot represents the snapshot of the data disk used to restore the Workbench Instance from. Refers to: compute/v1/projects/{project_id\}/global/snapshots/{snapshot_id\}
777+
*/
778+
export interface Schema$Snapshot {
779+
/**
780+
* Required. The project ID of the snapshot.
781+
*/
782+
projectId?: string | null;
783+
/**
784+
* Required. The ID of the snapshot.
785+
*/
786+
snapshotId?: string | null;
787+
}
766788
/**
767789
* Request for starting a notebook instance
768790
*/
@@ -2184,6 +2206,94 @@ export namespace notebooks_v2 {
21842206
}
21852207
}
21862208

2209+
/**
2210+
* RestoreInstance restores an Instance from a BackupSource.
2211+
*
2212+
* @param params - Parameters for request
2213+
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
2214+
* @param callback - Optional callback that handles the response.
2215+
* @returns A promise if used with async/await, or void if used with a callback.
2216+
*/
2217+
restore(
2218+
params: Params$Resource$Projects$Locations$Instances$Restore,
2219+
options: StreamMethodOptions
2220+
): GaxiosPromise<Readable>;
2221+
restore(
2222+
params?: Params$Resource$Projects$Locations$Instances$Restore,
2223+
options?: MethodOptions
2224+
): GaxiosPromise<Schema$Operation>;
2225+
restore(
2226+
params: Params$Resource$Projects$Locations$Instances$Restore,
2227+
options: StreamMethodOptions | BodyResponseCallback<Readable>,
2228+
callback: BodyResponseCallback<Readable>
2229+
): void;
2230+
restore(
2231+
params: Params$Resource$Projects$Locations$Instances$Restore,
2232+
options: MethodOptions | BodyResponseCallback<Schema$Operation>,
2233+
callback: BodyResponseCallback<Schema$Operation>
2234+
): void;
2235+
restore(
2236+
params: Params$Resource$Projects$Locations$Instances$Restore,
2237+
callback: BodyResponseCallback<Schema$Operation>
2238+
): void;
2239+
restore(callback: BodyResponseCallback<Schema$Operation>): void;
2240+
restore(
2241+
paramsOrCallback?:
2242+
| Params$Resource$Projects$Locations$Instances$Restore
2243+
| BodyResponseCallback<Schema$Operation>
2244+
| BodyResponseCallback<Readable>,
2245+
optionsOrCallback?:
2246+
| MethodOptions
2247+
| StreamMethodOptions
2248+
| BodyResponseCallback<Schema$Operation>
2249+
| BodyResponseCallback<Readable>,
2250+
callback?:
2251+
| BodyResponseCallback<Schema$Operation>
2252+
| BodyResponseCallback<Readable>
2253+
): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
2254+
let params = (paramsOrCallback ||
2255+
{}) as Params$Resource$Projects$Locations$Instances$Restore;
2256+
let options = (optionsOrCallback || {}) as MethodOptions;
2257+
2258+
if (typeof paramsOrCallback === 'function') {
2259+
callback = paramsOrCallback;
2260+
params = {} as Params$Resource$Projects$Locations$Instances$Restore;
2261+
options = {};
2262+
}
2263+
2264+
if (typeof optionsOrCallback === 'function') {
2265+
callback = optionsOrCallback;
2266+
options = {};
2267+
}
2268+
2269+
const rootUrl = options.rootUrl || 'https://notebooks.googleapis.com/';
2270+
const parameters = {
2271+
options: Object.assign(
2272+
{
2273+
url: (rootUrl + '/v2/{+name}:restore').replace(
2274+
/([^:]\/)\/+/g,
2275+
'$1'
2276+
),
2277+
method: 'POST',
2278+
apiVersion: '',
2279+
},
2280+
options
2281+
),
2282+
params,
2283+
requiredParams: ['name'],
2284+
pathParams: ['name'],
2285+
context: this.context,
2286+
};
2287+
if (callback) {
2288+
createAPIRequest<Schema$Operation>(
2289+
parameters,
2290+
callback as BodyResponseCallback<unknown>
2291+
);
2292+
} else {
2293+
return createAPIRequest<Schema$Operation>(parameters);
2294+
}
2295+
}
2296+
21872297
/**
21882298
* Rollbacks a notebook instance to the previous version.
21892299
*
@@ -2959,6 +3069,18 @@ export namespace notebooks_v2 {
29593069
*/
29603070
requestBody?: Schema$ResizeDiskRequest;
29613071
}
3072+
export interface Params$Resource$Projects$Locations$Instances$Restore
3073+
extends StandardParameters {
3074+
/**
3075+
* Required. Format: `projects/{project_id\}/locations/{location\}/instances/{instance_id\}`
3076+
*/
3077+
name?: string;
3078+
3079+
/**
3080+
* Request body metadata
3081+
*/
3082+
requestBody?: Schema$RestoreInstanceRequest;
3083+
}
29623084
export interface Params$Resource$Projects$Locations$Instances$Rollback
29633085
extends StandardParameters {
29643086
/**

0 commit comments

Comments
 (0)