()
| 37 | const zone = 'europe-west4-a'; |
| 38 | |
| 39 | async function callStopTpuVM() { |
| 40 | const request = { |
| 41 | name: `projects/${projectId}/locations/${zone}/nodes/${nodeName}`, |
| 42 | }; |
| 43 | |
| 44 | const [operation] = await tpuClient.stopNode(request); |
| 45 | // Wait for the operation to complete. |
| 46 | const [response] = await operation.promise(); |
| 47 | |
| 48 | console.log(`Node: ${nodeName} stopped.`); |
| 49 | return response; |
| 50 | } |
| 51 | |
| 52 | return await callStopTpuVM(); |
| 53 | // [END tpu_vm_stop] |