Function
_stopInstances
(projectId, zone, instanceNames)
Source from the content-addressed store, hash-verified
| 162 | * @return {Promise} Response from stopping instances |
| 163 | */ |
| 164 | const _stopInstances = async (projectId, zone, instanceNames) => { |
| 165 | await Promise.all( |
| 166 | instanceNames.map(instanceName => { |
| 167 | return instancesClient |
| 168 | .stop({ |
| 169 | project: projectId, |
| 170 | zone: zone, |
| 171 | instance: instanceName, |
| 172 | }) |
| 173 | .then(() => { |
| 174 | console.log(`Instance stopped successfully: ${instanceName}`); |
| 175 | }); |
| 176 | }) |
| 177 | ); |
| 178 | }; |
| 179 | // [END functions_billing_limit] |
| 180 | |
| 181 | // Helper function to restart instances (used in tests) |
Tested by
no test coverage detected