MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/nodejs-docs-samples / main

Function main

container-analysis/snippets/deleteNote.js:21–43  ·  view source on GitHub ↗
(
  projectId = 'your-project-id', // Your GCP Project Id
  noteId = 'my-note-id' // Id of the note
)

Source from the content-addressed store, hash-verified

19// description: Deletes a specified Note
20// usage: node deleteNote.js "project-id" "note-id"
21async function main(
22 projectId = 'your-project-id', // Your GCP Project Id
23 noteId = 'my-note-id' // Id of the note
24) {
25 // [START containeranalysis_delete_note]
26 /**
27 * TODO(developer): Uncomment these variables before running the sample
28 */
29 // const projectId = 'your-project-id', // Your GCP Project Id
30 // const noteId = 'my-note-id' // Id of the note
31
32 // Import the library and create a client
33 const {ContainerAnalysisClient} = require('@google-cloud/containeranalysis');
34 const client = new ContainerAnalysisClient();
35
36 // Get the full path to the note
37 const formattedName = client.notePath(projectId, noteId);
38
39 // Delete the note
40 await client.getGrafeasClient().deleteNote({name: formattedName});
41 console.log(`Note ${formattedName} deleted.`);
42 // [END containeranalysis_delete_note]
43}
44
45main(...process.argv.slice(2));

Callers 1

deleteNote.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected