import { CloudTasksClient } from "@google-cloud/tasks";
import { credentials } from "@grpc/grpc-js";
async function main() {
const client = new CloudTasksClient({
servicePath: "127.0.0.1",
port: 8123,
sslCreds: credentials.createInsecure(),
});
try {
const [queues] = await client.listQueues({
parent: "projects/****/locations/****",
});
console.log(queues);
} catch (error) {
console.error(error);
} finally {
await client.close();
}
}
await main();
import { CloudTasksClient } from "@google-cloud/tasks";
import { credentials } from "@grpc/grpc-js";
async function main() {
const client = new CloudTasksClient({
servicePath: "127.0.0.1",
port: 8123,
sslCreds: credentials.createInsecure(),
});
try {
const [queues] = await client.listQueues({
parent: "projects/****/locations/****",
});
console.log(queues);
} catch (error) {
console.error(error);
} finally {
await client.close();
}
}
await main();