(projectId, zone)
| 193 | * @return {Promise} Array of names of running instances |
| 194 | */ |
| 195 | const _listStoppedInstances = async (projectId, zone) => { |
| 196 | const [instances] = await instancesClient.list({ |
| 197 | project: projectId, |
| 198 | zone: zone, |
| 199 | }); |
| 200 | const stoppedInstances = instances.filter(item => item.status !== 'RUNNING'); |
| 201 | return stoppedInstances.map(item => item.name); |
| 202 | }; |
| 203 | |
| 204 | /** |
| 205 | * @param {Array} instanceNames Names of instance to stop |