Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function status (params) {
const { alias } = params.options;
const { org_id, app_id: appId } = await AppConfig.getAppData(alias).toPromise();
const instances = await getAllInstances({ id: org_id, appId }).then(sendToApi);
const app = await getApplication({ id: org_id, appId }).then(sendToApi);
Logger.println(computeStatus(instances, app));
Logger.println(displayScalability(app));
}
async function setDedicatedBuildInstance (appId, orgaId, enableSeparateBuild) {
const app = await application.get({ id: orgaId, appId }).then(sendToApi);
const newConfig = { ...app, separateBuild: enableSeparateBuild };
return application.update({ id: orgaId, appId }, newConfig).then(sendToApi);
};
async function setScalability (appId, orgaId, scalabilityParameters) {
Logger.info('Scaling the app: ' + appId);
const app = await application.get({ id: orgaId, appId }).then(sendToApi);
const instance = _.cloneDeep(app.instance);
instance.minFlavor = instance.minFlavor.name;
instance.maxFlavor = instance.maxFlavor.name;
const newConfig = mergeScalabilityParameters(scalabilityParameters, instance);
return application.update({ id: orgaId, appId }, newConfig).then(sendToApi);
};