Search in sources :

Example 6 with TemplateV2Request

use of com.sequenceiq.cloudbreak.api.model.v2.TemplateV2Request in project cloudbreak by hortonworks.

the class OpenstackCloudProvider method template.

@Override
TemplateV2Request template() {
    TemplateV2Request t = new TemplateV2Request();
    String instanceTypeDefaultValue = "m1.xlarge";
    String instanceTypeParam = getTestParameter().get("openstackInstanceType");
    t.setInstanceType(instanceTypeParam == null ? instanceTypeDefaultValue : instanceTypeParam);
    int volumeCountDefault = 1;
    String volumeCountParam = getTestParameter().get("openstackInstanceVolumeCount");
    t.setVolumeCount(volumeCountParam == null ? volumeCountDefault : Integer.parseInt(volumeCountParam));
    int volumeSizeDefault = 50;
    String volumeSizeParam = getTestParameter().get("openstackInstanceVolumeSize");
    t.setVolumeSize(volumeSizeParam == null ? volumeSizeDefault : Integer.parseInt(volumeSizeParam));
    String volumeTypeDefault = "HDD";
    String volumeTypeParam = getTestParameter().get("openstackInstanceVolumeType");
    t.setVolumeType(volumeTypeParam == null ? volumeTypeDefault : volumeTypeParam);
    return t;
}
Also used : TemplateV2Request(com.sequenceiq.cloudbreak.api.model.v2.TemplateV2Request)

Example 7 with TemplateV2Request

use of com.sequenceiq.cloudbreak.api.model.v2.TemplateV2Request in project cloudbreak by hortonworks.

the class AzureCloudProvider method template.

@Override
TemplateV2Request template() {
    TemplateV2Request t = new TemplateV2Request();
    String instanceTypeDefaultValue = "Standard_D3_v2";
    String instanceTypeParam = getTestParameter().get("azureInstanceType");
    t.setInstanceType(instanceTypeParam == null ? instanceTypeDefaultValue : instanceTypeParam);
    int volumeCountDefault = 1;
    String volumeCountParam = getTestParameter().get("azureInstanceVolumeCount");
    t.setVolumeCount(volumeCountParam == null ? volumeCountDefault : Integer.parseInt(volumeCountParam));
    int volumeSizeDefault = 100;
    String volumeSizeParam = getTestParameter().get("azureInstanceVolumeSize");
    t.setVolumeSize(volumeSizeParam == null ? volumeSizeDefault : Integer.parseInt(volumeSizeParam));
    String volumeTypeDefault = "Standard_LRS";
    String volumeTypeParam = getTestParameter().get("azureInstanceVolumeType");
    t.setVolumeType(volumeTypeParam == null ? volumeTypeDefault : volumeTypeParam);
    Map<String, Object> params = new HashMap<>();
    params.put("encrypted", "false");
    params.put("managedDisk", "true");
    t.setParameters(params);
    return t;
}
Also used : HashMap(java.util.HashMap) TemplateV2Request(com.sequenceiq.cloudbreak.api.model.v2.TemplateV2Request)

Aggregations

TemplateV2Request (com.sequenceiq.cloudbreak.api.model.v2.TemplateV2Request)7 InstanceGroupV2Request (com.sequenceiq.cloudbreak.api.model.v2.InstanceGroupV2Request)2 SecurityGroupV2Request (com.sequenceiq.cloudbreak.api.model.v2.SecurityGroupV2Request)1 IntegrationTestContext (com.sequenceiq.it.IntegrationTestContext)1 HashMap (java.util.HashMap)1 BeforeMethod (org.testng.annotations.BeforeMethod)1 Parameters (org.testng.annotations.Parameters)1