use of com.epam.pipeline.entity.dts.DtsRegistry in project cloud-pipeline by epam.
the class DtsListingManager method getDtsBaseUrl.
private String getDtsBaseUrl(String path, Long dtsId) {
DtsRegistry registry = dtsRegistryManager.load(dtsId);
Assert.isTrue(registry.getPrefixes().stream().anyMatch(prefix -> path.startsWith(trimTrailingDelimiter(prefix))), String.format("Required path %s does not satisfy DTS registry with id %d", path, dtsId));
return registry.getUrl();
}
use of com.epam.pipeline.entity.dts.DtsRegistry in project cloud-pipeline by epam.
the class DtsConfigurationProviderImpl method validateEntry.
@Override
public void validateEntry(DtsRunConfigurationEntry entry) {
DtsRegistry dts = dtsRegistryManager.load(entry.getDtsId());
Assert.isTrue(dts.isSchedulable(), messageHelper.getMessage(MessageConstants.ERROR_DTS_NOT_SCHEDULABLE, dts.getName()));
if (entry.getPipelineId() != null) {
pipelineManager.load(entry.getPipelineId());
}
}
use of com.epam.pipeline.entity.dts.DtsRegistry in project cloud-pipeline by epam.
the class DtsConfigurationProviderImpl method stop.
@Override
public boolean stop(Long runId, DtsExecutionPreferences executionPreferences) {
DtsRegistry dts = dtsRegistryManager.load(executionPreferences.getDtsId());
Assert.isTrue(dts.isSchedulable(), messageHelper.getMessage(MessageConstants.ERROR_DTS_NOT_SCHEDULABLE, dts.getName()));
try {
dtsSubmissionManager.stopSubmission(dts.getId(), runId);
} catch (DtsRequestException e) {
log.error("Failed to stop submission on DTS: {}", e);
return false;
}
return true;
}
Aggregations