samples/deleteQueue.js
async function deleteQueue(
  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
) {
  // Imports the Google Cloud Tasks library.
  const cloudTasks = require('@google-cloud/tasks');

  // Instantiates a client.
  const client = new cloudTasks.CloudTasksClient();

  // Get the fully qualified path to the queue
  const name = client.queuePath(project, location, queue);

  // Send delete queue request.
  await client.deleteQueue({name});
  console.log(`Deleted queue '${queue}'.`);
}
async function deleteQueue(
  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
) {
  // Imports the Google Cloud Tasks library.
  const cloudTasks = require('@google-cloud/tasks');

  // Instantiates a client.
  const client = new cloudTasks.CloudTasksClient();

  // Get the fully qualified path to the queue
  const name = client.queuePath(project, location, queue);

  // Send delete queue request.
  await client.deleteQueue({name});
  console.log(`Deleted queue '${queue}'.`);
}
async function deleteQueue ( 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 ) { // Imports the Google Cloud Tasks library. const cloudTasks = require ( '@google-cloud/tasks' ) ; // Instantiates a client. const client = new cloudTasks . CloudTasksClient ( ) ; // Get the fully qualified path to the queue const name = client . queuePath ( project , location , queue ) ; // Send delete queue request. await client . deleteQueue ( { name } ) ; console . log ( ` ${ queue } ` ) ; }
Delete a given Queue
Delete a given Queue