use of org.folio.okapi.util.TenantInstallOptions in project okapi by folio-org.
the class InternalModule method createTenantOptions.
private TenantInstallOptions createTenantOptions(RoutingContext ctx) {
TenantInstallOptions options = new TenantInstallOptions();
options.setSimulate(getParamBoolean(ctx.request(), "simulate", false));
options.setPreRelease(getParamBoolean(ctx.request(), "preRelease", true));
options.setDeploy(getParamBoolean(ctx.request(), "deploy", false));
return options;
}
use of org.folio.okapi.util.TenantInstallOptions in project okapi by folio-org.
the class InternalModule method installModulesForTenant.
private void installModulesForTenant(ProxyContext pc, String id, String body, Handler<ExtendedAsyncResult<String>> fut) {
try {
TenantInstallOptions options = createTenantOptions(pc.getCtx());
final TenantModuleDescriptor[] tml = Json.decodeValue(body, TenantModuleDescriptor[].class);
List<TenantModuleDescriptor> tm = new LinkedList<>();
Collections.addAll(tm, tml);
tenantManager.installUpgradeModules(id, pc, options, tm, res -> {
if (res.failed()) {
fut.handle(new Failure<>(res.getType(), res.cause()));
} else {
logger.info("installUpgradeModules returns:\n" + Json.encodePrettily(res.result()));
fut.handle(new Success<>(Json.encodePrettily(res.result())));
}
});
} catch (DecodeException ex) {
fut.handle(new Failure<>(USER, ex));
}
}
use of org.folio.okapi.util.TenantInstallOptions in project okapi by folio-org.
the class InternalModule method upgradeModulesForTenant.
private void upgradeModulesForTenant(ProxyContext pc, String id, Handler<ExtendedAsyncResult<String>> fut) {
try {
TenantInstallOptions options = createTenantOptions(pc.getCtx());
tenantManager.installUpgradeModules(id, pc, options, null, res -> {
if (res.failed()) {
fut.handle(new Failure<>(res.getType(), res.cause()));
} else {
logger.info("installUpgradeModules returns:\n" + Json.encodePrettily(res.result()));
fut.handle(new Success<>(Json.encodePrettily(res.result())));
}
});
} catch (DecodeException ex) {
fut.handle(new Failure<>(USER, ex));
}
}
Aggregations