* 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 )
| 18 | * Delete a given Queue |
| 19 | */ |
| 20 | function 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 | |
| 44 | process.on('unhandledRejection', err => { |
| 45 | console.error(err.message); |
no test coverage detected