use of com.sequenceiq.distrox.api.v1.distrox.model.instancegroup.template.AwsInstanceTemplateV1SpotParameters in project cloudbreak by hortonworks.
the class DistroXTestDto method withSpotPercentage.
public DistroXTestDto withSpotPercentage(int spotPercentage) {
getRequest().getInstanceGroups().stream().map(InstanceGroupV1Request::getTemplate).forEach(instanceTemplateV1Request -> {
AwsInstanceTemplateV1Parameters aws = instanceTemplateV1Request.getAws();
if (Objects.isNull(aws)) {
aws = new AwsInstanceTemplateV1Parameters();
instanceTemplateV1Request.setAws(aws);
}
AwsInstanceTemplateV1SpotParameters spot = new AwsInstanceTemplateV1SpotParameters();
spot.setPercentage(spotPercentage);
aws.setSpot(spot);
});
return this;
}
use of com.sequenceiq.distrox.api.v1.distrox.model.instancegroup.template.AwsInstanceTemplateV1SpotParameters in project cloudbreak by hortonworks.
the class InstanceTemplateParameterConverter method convert.
private AwsInstanceTemplateV1SpotParameters convert(AwsInstanceTemplateV4SpotParameters source) {
AwsInstanceTemplateV1SpotParameters awsInstanceGroupV1SpotParameters = new AwsInstanceTemplateV1SpotParameters();
awsInstanceGroupV1SpotParameters.setPercentage(source.getPercentage());
awsInstanceGroupV1SpotParameters.setMaxPrice(source.getMaxPrice());
return awsInstanceGroupV1SpotParameters;
}
use of com.sequenceiq.distrox.api.v1.distrox.model.instancegroup.template.AwsInstanceTemplateV1SpotParameters in project cloudbreak by hortonworks.
the class AwsCloudProvider method getAwsInstanceTemplateV1SpotParameters.
private AwsInstanceTemplateV1SpotParameters getAwsInstanceTemplateV1SpotParameters() {
AwsInstanceTemplateV1SpotParameters awsInstanceTemplateV1SpotParameters = new AwsInstanceTemplateV1SpotParameters();
awsInstanceTemplateV1SpotParameters.setPercentage(getSpotPercentage());
return awsInstanceTemplateV1SpotParameters;
}
Aggregations