Skip to content

Commit

Permalink
feat(notebooks): update the API
Browse files Browse the repository at this point in the history
#### notebooks:v1

The following keys were added:
- resources.projects.resources.locations.resources.runtimes.methods.refreshRuntimeTokenInternal.description
- resources.projects.resources.locations.resources.runtimes.methods.refreshRuntimeTokenInternal.flatPath
- resources.projects.resources.locations.resources.runtimes.methods.refreshRuntimeTokenInternal.httpMethod
- resources.projects.resources.locations.resources.runtimes.methods.refreshRuntimeTokenInternal.id
- resources.projects.resources.locations.resources.runtimes.methods.refreshRuntimeTokenInternal.parameterOrder
- resources.projects.resources.locations.resources.runtimes.methods.refreshRuntimeTokenInternal.parameters.name.description
- resources.projects.resources.locations.resources.runtimes.methods.refreshRuntimeTokenInternal.parameters.name.location
- resources.projects.resources.locations.resources.runtimes.methods.refreshRuntimeTokenInternal.parameters.name.pattern
- resources.projects.resources.locations.resources.runtimes.methods.refreshRuntimeTokenInternal.parameters.name.required
- resources.projects.resources.locations.resources.runtimes.methods.refreshRuntimeTokenInternal.parameters.name.type
- resources.projects.resources.locations.resources.runtimes.methods.refreshRuntimeTokenInternal.path
- resources.projects.resources.locations.resources.runtimes.methods.refreshRuntimeTokenInternal.request.$ref
- resources.projects.resources.locations.resources.runtimes.methods.refreshRuntimeTokenInternal.response.$ref
- resources.projects.resources.locations.resources.runtimes.methods.refreshRuntimeTokenInternal.scopes
- schemas.RefreshRuntimeTokenInternalRequest.description
- schemas.RefreshRuntimeTokenInternalRequest.id
- schemas.RefreshRuntimeTokenInternalRequest.properties.vmId.description
- schemas.RefreshRuntimeTokenInternalRequest.properties.vmId.type
- schemas.RefreshRuntimeTokenInternalRequest.type
- schemas.RefreshRuntimeTokenInternalResponse.description
- schemas.RefreshRuntimeTokenInternalResponse.id
- schemas.RefreshRuntimeTokenInternalResponse.properties.accessToken.description
- schemas.RefreshRuntimeTokenInternalResponse.properties.accessToken.type
- schemas.RefreshRuntimeTokenInternalResponse.properties.expireTime.description
- schemas.RefreshRuntimeTokenInternalResponse.properties.expireTime.format
- schemas.RefreshRuntimeTokenInternalResponse.properties.expireTime.readOnly
- schemas.RefreshRuntimeTokenInternalResponse.properties.expireTime.type
- schemas.RefreshRuntimeTokenInternalResponse.type

The following keys were changed:
- schemas.Empty.description
  • Loading branch information
yoshi-automation authored and sofisl committed Apr 1, 2022
1 parent eb6513c commit f53f95e
Show file tree
Hide file tree
Showing 2 changed files with 242 additions and 3 deletions.
60 changes: 58 additions & 2 deletions discovery/notebooks-v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -1389,6 +1389,34 @@
"https://www.googleapis.com/auth/cloud-platform"
]
},
"refreshRuntimeTokenInternal": {
"description": "Gets an access token for the consumer service account that the customer attached to the runtime. Only accessible from the tenant instance.",
"flatPath": "v1/projects/{projectsId}/locations/{locationsId}/runtimes/{runtimesId}:refreshRuntimeTokenInternal",
"httpMethod": "POST",
"id": "notebooks.projects.locations.runtimes.refreshRuntimeTokenInternal",
"parameterOrder": [
"name"
],
"parameters": {
"name": {
"description": "Required. Format: `projects/{project_id}/locations/{location}/runtimes/{runtime_id}`",
"location": "path",
"pattern": "^projects/[^/]+/locations/[^/]+/runtimes/[^/]+$",
"required": true,
"type": "string"
}
},
"path": "v1/{+name}:refreshRuntimeTokenInternal",
"request": {
"$ref": "RefreshRuntimeTokenInternalRequest"
},
"response": {
"$ref": "RefreshRuntimeTokenInternalResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
},
"reportEvent": {
"description": "Report and process a runtime event.",
"flatPath": "v1/projects/{projectsId}/locations/{locationsId}/runtimes/{runtimesId}:reportEvent",
Expand Down Expand Up @@ -1753,7 +1781,7 @@
}
}
},
"revision": "20220303",
"revision": "20220319",
"rootUrl": "https://notebooks.googleapis.com/",
"schemas": {
"AcceleratorConfig": {
Expand Down Expand Up @@ -1924,7 +1952,7 @@
"type": "object"
},
"Empty": {
"description": "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 `{}`.",
"description": "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); }",
"id": "Empty",
"properties": {},
"type": "object"
Expand Down Expand Up @@ -2956,6 +2984,34 @@
},
"type": "object"
},
"RefreshRuntimeTokenInternalRequest": {
"description": "Request for getting a new access token.",
"id": "RefreshRuntimeTokenInternalRequest",
"properties": {
"vmId": {
"description": "Required. The VM hardware token for authenticating the VM. https://cloud.google.com/compute/docs/instances/verifying-instance-identity",
"type": "string"
}
},
"type": "object"
},
"RefreshRuntimeTokenInternalResponse": {
"description": "Response with a new access token.",
"id": "RefreshRuntimeTokenInternalResponse",
"properties": {
"accessToken": {
"description": "The OAuth 2.0 access token.",
"type": "string"
},
"expireTime": {
"description": "Output only. Token expiration time.",
"format": "google-datetime",
"readOnly": true,
"type": "string"
}
},
"type": "object"
},
"RegisterInstanceRequest": {
"description": "Request for registering a notebook instance.",
"id": "RegisterInstanceRequest",
Expand Down
185 changes: 184 additions & 1 deletion src/apis/notebooks/v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ export namespace notebooks_v1 {
type?: string | null;
}
/**
* 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 `{\}`.
* 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); \}
*/
export interface Schema$Empty {}
/**
Expand Down Expand Up @@ -926,6 +926,28 @@ export namespace notebooks_v1 {
*/
version?: number | null;
}
/**
* Request for getting a new access token.
*/
export interface Schema$RefreshRuntimeTokenInternalRequest {
/**
* Required. The VM hardware token for authenticating the VM. https://cloud.google.com/compute/docs/instances/verifying-instance-identity
*/
vmId?: string | null;
}
/**
* Response with a new access token.
*/
export interface Schema$RefreshRuntimeTokenInternalResponse {
/**
* The OAuth 2.0 access token.
*/
accessToken?: string | null;
/**
* Output only. Token expiration time.
*/
expireTime?: string | null;
}
/**
* Request for registering a notebook instance.
*/
Expand Down Expand Up @@ -7955,6 +7977,155 @@ export namespace notebooks_v1 {
}
}

/**
* Gets an access token for the consumer service account that the customer attached to the runtime. Only accessible from the tenant instance.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/notebooks.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const notebooks = google.notebooks('v1');
*
* async function main() {
* const auth = new google.auth.GoogleAuth({
* // Scopes can be specified either as an array or as a single, space-delimited string.
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
* });
*
* // Acquire an auth client, and bind it to all future calls
* const authClient = await auth.getClient();
* google.options({auth: authClient});
*
* // Do the magic
* const res =
* await notebooks.projects.locations.runtimes.refreshRuntimeTokenInternal({
* // Required. Format: `projects/{project_id\}/locations/{location\}/runtimes/{runtime_id\}`
* name: 'projects/my-project/locations/my-location/runtimes/my-runtime',
*
* // Request body metadata
* requestBody: {
* // request body parameters
* // {
* // "vmId": "my_vmId"
* // }
* },
* });
* console.log(res.data);
*
* // Example response
* // {
* // "accessToken": "my_accessToken",
* // "expireTime": "my_expireTime"
* // }
* }
*
* main().catch(e => {
* console.error(e);
* throw e;
* });
*
* ```
*
* @param params - Parameters for request
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
* @param callback - Optional callback that handles the response.
* @returns A promise if used with async/await, or void if used with a callback.
*/
refreshRuntimeTokenInternal(
params: Params$Resource$Projects$Locations$Runtimes$Refreshruntimetokeninternal,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
refreshRuntimeTokenInternal(
params?: Params$Resource$Projects$Locations$Runtimes$Refreshruntimetokeninternal,
options?: MethodOptions
): GaxiosPromise<Schema$RefreshRuntimeTokenInternalResponse>;
refreshRuntimeTokenInternal(
params: Params$Resource$Projects$Locations$Runtimes$Refreshruntimetokeninternal,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
refreshRuntimeTokenInternal(
params: Params$Resource$Projects$Locations$Runtimes$Refreshruntimetokeninternal,
options:
| MethodOptions
| BodyResponseCallback<Schema$RefreshRuntimeTokenInternalResponse>,
callback: BodyResponseCallback<Schema$RefreshRuntimeTokenInternalResponse>
): void;
refreshRuntimeTokenInternal(
params: Params$Resource$Projects$Locations$Runtimes$Refreshruntimetokeninternal,
callback: BodyResponseCallback<Schema$RefreshRuntimeTokenInternalResponse>
): void;
refreshRuntimeTokenInternal(
callback: BodyResponseCallback<Schema$RefreshRuntimeTokenInternalResponse>
): void;
refreshRuntimeTokenInternal(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Runtimes$Refreshruntimetokeninternal
| BodyResponseCallback<Schema$RefreshRuntimeTokenInternalResponse>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$RefreshRuntimeTokenInternalResponse>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$RefreshRuntimeTokenInternalResponse>
| BodyResponseCallback<Readable>
):
| void
| GaxiosPromise<Schema$RefreshRuntimeTokenInternalResponse>
| GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Projects$Locations$Runtimes$Refreshruntimetokeninternal;
let options = (optionsOrCallback || {}) as MethodOptions;

if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params =
{} as Params$Resource$Projects$Locations$Runtimes$Refreshruntimetokeninternal;
options = {};
}

if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}

const rootUrl = options.rootUrl || 'https://notebooks.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (rootUrl + '/v1/{+name}:refreshRuntimeTokenInternal').replace(
/([^:]\/)\/+/g,
'$1'
),
method: 'POST',
},
options
),
params,
requiredParams: ['name'],
pathParams: ['name'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$RefreshRuntimeTokenInternalResponse>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$RefreshRuntimeTokenInternalResponse>(
parameters
);
}
}

/**
* Report and process a runtime event.
* @example
Expand Down Expand Up @@ -9000,6 +9171,18 @@ export namespace notebooks_v1 {
*/
parent?: string;
}
export interface Params$Resource$Projects$Locations$Runtimes$Refreshruntimetokeninternal
extends StandardParameters {
/**
* Required. Format: `projects/{project_id\}/locations/{location\}/runtimes/{runtime_id\}`
*/
name?: string;

/**
* Request body metadata
*/
requestBody?: Schema$RefreshRuntimeTokenInternalRequest;
}
export interface Params$Resource$Projects$Locations$Runtimes$Reportevent
extends StandardParameters {
/**
Expand Down

0 comments on commit f53f95e

Please sign in to comment.