MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/nodejs-docs-samples / _listRunningInstances

Function _listRunningInstances

functions/billing/index.js:150–158  ·  view source on GitHub ↗
(projectId, zone)

Source from the content-addressed store, hash-verified

148 * @return {Promise} Array of names of running instances
149 */
150const _listRunningInstances = async (projectId, zone) => {
151 const [instances] = await instancesClient.list({
152 project: projectId,
153 zone: zone,
154 });
155 return instances
156 .filter(item => item.status === 'RUNNING')
157 .map(item => item.name);
158};
159
160/**
161 * @param {Array} instanceNames Names of instance to stop

Callers 1

index.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected