// Imports the Google Cloud Tasks library.
const cloudTasks = require('@google-cloud/tasks');
// Instantiates a client.
const client = new cloudTasks.CloudTasksClient();
async function listQueues() {
// Get the fully qualified path to the region
const parent = client.locationPath(project, location);
// list all fo the queues
const [queues] = await client.listQueues({parent});
if (queues.length > 0) {
console.log('Queues:');
queues.forEach(queue => {
console.log(` ${queue.name}`);
});
} else {
console.log('No queues found!');
}
}
listQueues();