use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.InstanceTemplateV4Base in project cloudbreak by hortonworks.
the class SdxService method updateAwsSpotParameters.
private void updateAwsSpotParameters(StackV4Request stackRequest, SdxAwsSpotParameters sdxSpotParameters) {
stackRequest.getInstanceGroups().stream().map(InstanceGroupV4Request::getTemplate).peek(template -> {
if (template.getAws() == null) {
template.setAws(new AwsInstanceTemplateV4Parameters());
}
}).map(InstanceTemplateV4Base::getAws).peek(aws -> {
if (aws.getSpot() == null) {
aws.setSpot(new AwsInstanceTemplateV4SpotParameters());
}
}).map(AwsInstanceTemplateV4Parameters::getSpot).forEach(spot -> {
spot.setPercentage(sdxSpotParameters.getPercentage());
spot.setMaxPrice(sdxSpotParameters.getMaxPrice());
});
}
Aggregations