How to use the @clevercloud/client/cjs/api/application.js.getAllEnvVarsForAddons 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 / env.js View on Github external
async function list (params) {
  const { alias, 'add-export': addExports } = params.options;
  const { org_id, app_id: appId } = await AppConfig.getAppData(alias).toPromise();

  const [envFromApp, envFromAddons, envFromDeps] = await Promise.all([
    application.getAllEnvVars({ id: org_id, appId }).then(sendToApi),
    application.getAllEnvVarsForAddons({ id: org_id, appId }).then(sendToApi),
    application.getAllEnvVarsForDependencies({ id: org_id, appId }).then(sendToApi),
  ]);

  Logger.println('# Manually set env variables');
  Logger.println(toNameEqualsValueString(envFromApp, { addExports }));

  envFromAddons.forEach((addon) => {
    Logger.println('# Addon ' + addon.addon_name);
    Logger.println(toNameEqualsValueString(addon.env, { addExports }));
  });

  envFromDeps.forEach((dep) => {
    Logger.println('# Dependency ' + dep.app_name);
    Logger.println(toNameEqualsValueString(dep.env, { addExports }));
  });
};