How to use the @clevercloud/client/cjs/api/log.js.getDrains function in @clevercloud/client

To help you get started, we’ve selected a few @clevercloud/client examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github CleverCloud / clever-tools / src / commands / drain.js View on Github external
async function list (params) {
  const { alias } = params.options;

  const { app_id: appId } = await AppConfig.getAppData(alias).toPromise();
  const drains = await getDrains({ appId }).then(sendToApi);

  drains.forEach((drain) => {
    const { id, state, target: { url, drainType } } = drain;
    Logger.println(`${id} -> ${state} for ${url} as ${drainType}`);
  });
}