use of com.sequenceiq.cloudbreak.api.endpoint.v4.common.StackType in project cloudbreak by hortonworks.
the class StackOperations method get.
public StackV4Response get(NameOrCrn nameOrCrn, Long workspaceId, Set<String> entries, StackType stackType) {
LOGGER.info("Validate stack in workspace {}.", workspaceId);
StackV4Response stackResponse = stackCommonService.findStackByNameOrCrnAndWorkspaceId(nameOrCrn, workspaceId, entries, stackType);
LOGGER.info("Adding environment name and credential to the response.");
environmentServiceDecorator.prepareEnvironmentAndCredentialName(stackResponse);
LOGGER.info("Adding SDX CRN and name to the response.");
sdxServiceDecorator.prepareSdxAttributes(stackResponse);
LOGGER.info("Query Stack successfully decorated.");
return stackResponse;
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.common.StackType in project cloudbreak by hortonworks.
the class StackOperations method listByEnvironmentCrn.
public StackViewV4Responses listByEnvironmentCrn(Long workspaceId, String environmentCrn, List<StackType> stackTypes) {
Set<StackViewV4Response> stackViewResponses;
LOGGER.info("List for Stack in workspace {} and environmentCrn {}.", workspaceId, environmentCrn);
stackViewResponses = stackApiViewService.retrieveStackViewsByWorkspaceIdAndEnvironmentCrn(workspaceId, environmentCrn, stackTypes).stream().map(s -> stackApiViewToStackViewV4ResponseConverter.convert(s)).collect(Collectors.toSet());
LOGGER.info("Adding environment name and credential to the responses.");
NameOrCrn nameOrCrn = StringUtils.isEmpty(environmentCrn) ? NameOrCrn.empty() : NameOrCrn.ofCrn(environmentCrn);
environmentServiceDecorator.prepareEnvironmentsAndCredentialName(stackViewResponses, nameOrCrn);
LOGGER.info("Adding SDX CRN and name to the responses.");
sdxServiceDecorator.prepareMultipleSdxAttributes(stackViewResponses);
return new StackViewV4Responses(stackViewResponses);
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.common.StackType in project cloudbreak by hortonworks.
the class StackOperations method getForInternalCrn.
public StackViewV4Response getForInternalCrn(NameOrCrn nameOrCrn, StackType stackType) {
LOGGER.info("Validate stack against internal user.");
StackApiView stackApiView = stackApiViewService.retrieveStackByCrnAndType(nameOrCrn.getCrn(), stackType);
LOGGER.info("Query Stack (view) successfully finished with crn {}", nameOrCrn.getCrn());
StackViewV4Response stackViewV4Response = stackApiViewToStackViewV4ResponseConverter.convert(stackApiView);
LOGGER.info("Adding environment name to the response.");
environmentServiceDecorator.prepareEnvironment(stackViewV4Response);
return stackViewV4Response;
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.common.StackType in project cloudbreak by hortonworks.
the class StackOperations method listByStackIds.
public StackViewV4Responses listByStackIds(Long workspaceId, List<Long> stackIds, String environmentCrn, List<StackType> stackTypes) {
Set<StackViewV4Response> stackViewResponses;
stackViewResponses = stackApiViewService.retrieveStackViewsByStackIdsAndEnvironmentCrn(workspaceId, stackIds, environmentCrn, stackTypes).stream().map(s -> stackApiViewToStackViewV4ResponseConverter.convert(s)).collect(Collectors.toSet());
LOGGER.info("Adding environment name and credential to the responses.");
NameOrCrn nameOrCrn = Strings.isNullOrEmpty(environmentCrn) ? NameOrCrn.empty() : NameOrCrn.ofCrn(environmentCrn);
environmentServiceDecorator.prepareEnvironmentsAndCredentialName(stackViewResponses, nameOrCrn);
LOGGER.info("Adding SDX CRN and name to the responses.");
sdxServiceDecorator.prepareMultipleSdxAttributes(stackViewResponses);
return new StackViewV4Responses(stackViewResponses);
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.common.StackType in project cloudbreak by hortonworks.
the class StackOperations method listByEnvironmentName.
public StackViewV4Responses listByEnvironmentName(Long workspaceId, String environmentName, List<StackType> stackTypes) {
Set<StackViewV4Response> stackViewResponses;
LOGGER.info("List for Stack in workspace {} and environmentName {}.", workspaceId, environmentName);
stackViewResponses = stackApiViewService.retrieveStackViewsByWorkspaceIdAndEnvironmentName(workspaceId, environmentName, stackTypes).stream().map(s -> stackApiViewToStackViewV4ResponseConverter.convert(s)).collect(Collectors.toSet());
LOGGER.info("Adding environment name and credential to the responses.");
NameOrCrn nameOrCrn = StringUtils.isEmpty(environmentName) ? NameOrCrn.empty() : NameOrCrn.ofName(environmentName);
environmentServiceDecorator.prepareEnvironmentsAndCredentialName(stackViewResponses, nameOrCrn);
LOGGER.info("Adding SDX CRN and name to the responses.");
sdxServiceDecorator.prepareMultipleSdxAttributes(stackViewResponses);
return new StackViewV4Responses(stackViewResponses);
}
Aggregations