(projectId, zone, instanceNames)
| 206 | * @return {Promise} Response from stopping instances |
| 207 | */ |
| 208 | const _startInstances = async (projectId, zone, instanceNames) => { |
| 209 | if (!instanceNames.length) { |
| 210 | return 'No stopped instances were found.'; |
| 211 | } |
| 212 | await Promise.all( |
| 213 | instanceNames.map(instanceName => { |
| 214 | return instancesClient.start({ |
| 215 | project: projectId, |
| 216 | zone: zone, |
| 217 | instance: instanceName, |
| 218 | }); |
| 219 | }) |
| 220 | ); |
| 221 | }; |
| 222 | |
| 223 | // Helper function used in tests |
| 224 | exports.listRunningInstances = async () => { |