(tpuClient)
| 17 | 'use strict'; |
| 18 | |
| 19 | async function main(tpuClient) { |
| 20 | // [START tpu_queued_resources_get] |
| 21 | // Import the TPUClient |
| 22 | // TODO(developer): Uncomment below line before running the sample. |
| 23 | // const {TpuClient} = require('@google-cloud/tpu').v2alpha1; |
| 24 | |
| 25 | // Instantiate a tpuClient |
| 26 | // TODO(developer): Uncomment below line before running the sample. |
| 27 | // tpuClient = new TpuClient(); |
| 28 | |
| 29 | /** |
| 30 | * TODO(developer): Update these variables before running the sample. |
| 31 | */ |
| 32 | // Project ID or project number of the Google Cloud project, where you want to retrive node. |
| 33 | const projectId = await tpuClient.getProjectId(); |
| 34 | |
| 35 | // The name of queued resource. |
| 36 | const queuedResourceName = 'queued-resource-1'; |
| 37 | |
| 38 | // The zone of your queued resource. |
| 39 | const zone = 'us-central1-a'; |
| 40 | |
| 41 | async function callGetQueuedResource() { |
| 42 | const request = { |
| 43 | name: `projects/${projectId}/locations/${zone}/queuedResources/${queuedResourceName}`, |
| 44 | }; |
| 45 | |
| 46 | const [response] = await tpuClient.getQueuedResource(request); |
| 47 | |
| 48 | console.log(`Queued resource ${queuedResourceName} retrived.`); |
| 49 | return response; |
| 50 | } |
| 51 | return await callGetQueuedResource(); |
| 52 | // [END tpu_queued_resources_get] |
| 53 | } |
| 54 | |
| 55 | module.exports = main; |
| 56 |
nothing calls this directly
no test coverage detected