| 26 | const client = new cloudTasks.CloudTasksClient(); |
| 27 | |
| 28 | async function listQueues() { |
| 29 | // Get the fully qualified path to the region |
| 30 | const parent = client.locationPath(project, location); |
| 31 | |
| 32 | // list all fo the queues |
| 33 | const [queues] = await client.listQueues({parent}); |
| 34 | |
| 35 | if (queues.length > 0) { |
| 36 | console.log('Queues:'); |
| 37 | queues.forEach(queue => { |
| 38 | console.log(` ${queue.name}`); |
| 39 | }); |
| 40 | } else { |
| 41 | console.log('No queues found!'); |
| 42 | } |
| 43 | } |
| 44 | listQueues(); |
| 45 | // [END cloud_tasks_list_queues] |
| 46 | } |