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

Function main

cloud-tasks/snippets/deleteQueue.js:20–42  ·  view source on GitHub ↗

* Delete a given Queue

(
  project = 'my-project-id', // Your GCP Project id
  queue = 'my-appengine-queue', // Name of the Queue to delete
  location = 'us-central1' // The GCP region in which to delete the queue
)

Source from the content-addressed store, hash-verified

18 * Delete a given Queue
19 */
20function main(
21 project = 'my-project-id', // Your GCP Project id
22 queue = 'my-appengine-queue', // Name of the Queue to delete
23 location = 'us-central1' // The GCP region in which to delete the queue
24) {
25 // [START cloud_tasks_delete_queue]
26 // Imports the Google Cloud Tasks library.
27 const cloudTasks = require('@google-cloud/tasks');
28
29 // Instantiates a client.
30 const client = new cloudTasks.CloudTasksClient();
31
32 async function deleteQueue() {
33 // Get the fully qualified path to the queue
34 const name = client.queuePath(project, location, queue);
35
36 // Send delete queue request.
37 await client.deleteQueue({name});
38 console.log(`Deleted queue '${queue}'.`);
39 }
40 deleteQueue();
41 // [END cloud_tasks_delete_queue]
42}
43
44process.on('unhandledRejection', err => {
45 console.error(err.message);

Callers 1

deleteQueue.jsFile · 0.70

Calls 1

deleteQueueFunction · 0.85

Tested by

no test coverage detected