Search in sources :

Example 1 with AwsInstanceTemplateV1SpotParameters

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;
}
Also used : AwsInstanceTemplateV1SpotParameters(com.sequenceiq.distrox.api.v1.distrox.model.instancegroup.template.AwsInstanceTemplateV1SpotParameters) AwsInstanceTemplateV1Parameters(com.sequenceiq.distrox.api.v1.distrox.model.instancegroup.template.AwsInstanceTemplateV1Parameters)

Example 2 with AwsInstanceTemplateV1SpotParameters

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;
}
Also used : AwsInstanceTemplateV1SpotParameters(com.sequenceiq.distrox.api.v1.distrox.model.instancegroup.template.AwsInstanceTemplateV1SpotParameters)

Example 3 with AwsInstanceTemplateV1SpotParameters

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;
}
Also used : AwsInstanceTemplateV1SpotParameters(com.sequenceiq.distrox.api.v1.distrox.model.instancegroup.template.AwsInstanceTemplateV1SpotParameters)

Aggregations

AwsInstanceTemplateV1SpotParameters (com.sequenceiq.distrox.api.v1.distrox.model.instancegroup.template.AwsInstanceTemplateV1SpotParameters)3 AwsInstanceTemplateV1Parameters (com.sequenceiq.distrox.api.v1.distrox.model.instancegroup.template.AwsInstanceTemplateV1Parameters)1