(tpuClient)
| 17 | 'use strict'; |
| 18 | |
| 19 | async function main(tpuClient) { |
| 20 | // [START tpu_vm_list] |
| 21 | // Import the TPUClient |
| 22 | // TODO(developer): Uncomment below line before running the sample. |
| 23 | // const {TpuClient} = require('@google-cloud/tpu').v2; |
| 24 | |
| 25 | // Instantiate a tpuClient |
| 26 | // TODO(developer): Uncomment below line before running the sample. |
| 27 | // tpuClient = new TpuClient(); |
| 28 | |
| 29 | // TODO(developer): Update these variables before running the sample. |
| 30 | // Project ID or project number of the Google Cloud project you want to retrive a list of TPU nodes. |
| 31 | const projectId = await tpuClient.getProjectId(); |
| 32 | |
| 33 | // The zone from which the TPUs are retrived. |
| 34 | const zone = 'europe-west4-a'; |
| 35 | |
| 36 | async function callTpuVMList() { |
| 37 | const request = { |
| 38 | parent: `projects/${projectId}/locations/${zone}`, |
| 39 | }; |
| 40 | |
| 41 | const [response] = await tpuClient.listNodes(request); |
| 42 | |
| 43 | return response; |
| 44 | } |
| 45 | |
| 46 | return await callTpuVMList(); |
| 47 | // [END tpu_vm_list] |
| 48 | } |
| 49 | |
| 50 | module.exports = main; |
| 51 |
nothing calls this directly
no test coverage detected