use of io.elastest.etm.model.SupportService in project elastest-torm by elastest.
the class ExternalService method startEus.
public SupportService startEus() {
List<SupportService> tssList = esmService.getRegisteredServices();
SupportService eus = null;
for (SupportService tss : tssList) {
if ("eus".equals(tss.getName().toLowerCase())) {
eus = tss;
break;
}
}
return eus;
}
use of io.elastest.etm.model.SupportService in project elastest-torm by elastest.
the class ExternalService method createExternalTJobExecution.
public ExternalTJobExecution createExternalTJobExecution(ExternalTJobExecution exec) {
exec = this.externalTJobExecutionRepository.save(exec);
if (exec.getMonitoringIndex().isEmpty() || "".equals(exec.getMonitoringIndex())) {
exec.generateMonitoringIndex();
exec = this.externalTJobExecutionRepository.save(exec);
}
SupportService eus = this.startEus();
if (eus != null) {
String instanceId = utilTools.generateUniqueId();
esmService.provisionExternalTJobExecServiceInstanceAsync(eus.getId(), exec, instanceId);
exec.getEnvVars().put("EUS_ID", eus.getId());
exec.getEnvVars().put("EUS_INSTANCE_ID", instanceId);
}
elasticsearchService.createMonitoringIndex(exec.getMonitoringIndicesList());
return exec;
}
use of io.elastest.etm.model.SupportService in project elastest-torm by elastest.
the class ExternalService method createExternalTJobExecutionByExternalTJobId.
public ExternalTJobExecution createExternalTJobExecutionByExternalTJobId(Long exTJobId) {
ExternalTJob exTJob = this.externalTJobRepository.findById(exTJobId);
ExternalTJobExecution exec = new ExternalTJobExecution();
exec.setExTJob(exTJob);
exec.setStartDate(new Date());
this.externalTJobExecutionRepository.save(exec);
exec.generateMonitoringIndex();
exec = this.externalTJobExecutionRepository.save(exec);
SupportService eus = this.startEus();
if (eus != null) {
String instanceId = utilTools.generateUniqueId();
esmService.provisionExternalTJobExecServiceInstanceAsync(eus.getId(), exec, instanceId);
exec.getEnvVars().put("EUS_ID", eus.getId());
exec.getEnvVars().put("EUS_INSTANCE_ID", instanceId);
exec = this.externalTJobExecutionRepository.save(exec);
}
elasticsearchService.createMonitoringIndex(exec.getMonitoringIndicesList());
return exec;
}
use of io.elastest.etm.model.SupportService in project elastest-torm by elastest.
the class EsmService method getRegisteredServicesName.
public List<String> getRegisteredServicesName() {
logger.info("Get registered services names.");
List<String> registeredServices = new ArrayList<>();
List<SupportService> services = getRegisteredServices();
for (SupportService service : services) {
registeredServices.add(service.getName());
logger.info("Service name: {} ", service.getName());
}
return registeredServices;
}
use of io.elastest.etm.model.SupportService in project elastest-torm by elastest.
the class EsmService method getRegisteredServices.
public List<SupportService> getRegisteredServices() {
logger.info("Get registered services.");
List<SupportService> services = new ArrayList<>();
JsonNode objs = esmServiceClient.getRegisteredServices();
for (JsonNode esmService : objs) {
JsonNode configJson = esmService.get("manifest") != null ? esmService.get("manifest").get("config") : null;
String config = configJson != null ? configJson.toString() : "";
services.add(new SupportService(esmService.get("id").toString().replaceAll("\"", ""), esmService.get("name").toString().replaceAll("\"", ""), // "")
"", config));
}
return services;
}
Aggregations