// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/file.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 file = google.file('v1beta1');
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 file.projects.locations.instances.snapshots.delete({
// Required. The snapshot resource name, in the format `projects/{project_id\}/locations/{location\}/instances/{instance_id\}/snapshots/{snapshot_id\}`
name: 'projects/my-project/locations/my-location/instances/my-instance/snapshots/my-snapshot',
});
console.log(res.data);
// Example response
// {
// "done": false,
// "error": {},
// "metadata": {},
// "name": "my_name",
// "response": {}
// }
}
main().catch(e => {
console.error(e);
throw e;
});
// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/file.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 file = google.file('v1beta1');
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 file.projects.locations.instances.snapshots.patch({
// Output only. The resource name of the snapshot, in the format `projects/{project_id\}/locations/{location_id\}/instances/{instance_id\}/snapshots/{snapshot_id\}`.
name: 'projects/my-project/locations/my-location/instances/my-instance/snapshots/my-snapshot',
// Required. Mask of fields to update. At least one path must be supplied in this field.
updateMask: 'placeholder-value',
// Request body metadata
requestBody: {
// request body parameters
// {
// "createTime": "my_createTime",
// "description": "my_description",
// "filesystemUsedBytes": "my_filesystemUsedBytes",
// "labels": {},
// "name": "my_name",
// "state": "my_state"
// }
},
});
console.log(res.data);
// Example response
// {
// "done": false,
// "error": {},
// "metadata": {},
// "name": "my_name",
// "response": {}
// }
}
main().catch(e => {
console.error(e);
throw e;
});
// 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.instances.rollback({
// Required. Format: `projects/{project_id\}/locations/{location\}/instances/{instance_id\}`
name: 'projects/my-project/locations/my-location/instances/my-instance',
// Request body metadata
requestBody: {
// request body parameters
// {
// "targetSnapshot": "my_targetSnapshot"
// }
},
});
console.log(res.data);
// Example response
// {
// "done": false,
// "error": {},
// "metadata": {},
// "name": "my_name",
// "response": {}
// }
}
main().catch(e => {
console.error(e);
throw e;
});
// 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.instances.delete({
// Required. Format: `projects/{project_id\}/locations/{location\}/instances/{instance_id\}`
name: 'projects/my-project/locations/my-location/instances/my-instance',
});
console.log(res.data);
// Example response
// {
// "done": false,
// "error": {},
// "metadata": {},
// "name": "my_name",
// "response": {}
// }
}
main().catch(e => {
console.error(e);
throw e;
});
// 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.instances.updateShieldedInstanceConfig({
// Required. Format: `projects/{project_id\}/locations/{location\}/instances/{instance_id\}`
name: 'projects/my-project/locations/my-location/instances/my-instance',
// Request body metadata
requestBody: {
// request body parameters
// {
// "shieldedInstanceConfig": {}
// }
},
});
console.log(res.data);
// Example response
// {
// "done": false,
// "error": {},
// "metadata": {},
// "name": "my_name",
// "response": {}
// }
}
main().catch(e => {
console.error(e);
throw e;
});