use of com.sequenceiq.cloudbreak.api.model.v2.TemplateV2Request in project cloudbreak by hortonworks.
the class GcpCloudProvider method template.
@Override
TemplateV2Request template() {
TemplateV2Request t = new TemplateV2Request();
String instanceTypeDefaultValue = "n1-standard-4";
String instanceTypeParam = getTestParameter().get("gcpInstanceType");
t.setInstanceType(instanceTypeParam == null ? instanceTypeDefaultValue : instanceTypeParam);
int volumeCountDefault = 1;
String volumeCountParam = getTestParameter().get("gcpInstanceVolumeCount");
t.setVolumeCount(volumeCountParam == null ? volumeCountDefault : Integer.parseInt(volumeCountParam));
int volumeSizeDefault = 100;
String volumeSizeParam = getTestParameter().get("gcpInstanceVolumeSize");
t.setVolumeSize(volumeSizeParam == null ? volumeSizeDefault : Integer.parseInt(volumeSizeParam));
String volumeTypeDefault = "pd-standard";
String volumeTypeParam = getTestParameter().get("gcpInstanceVolumeType");
t.setVolumeType(volumeTypeParam == null ? volumeTypeDefault : volumeTypeParam);
return t;
}
use of com.sequenceiq.cloudbreak.api.model.v2.TemplateV2Request in project cloudbreak by hortonworks.
the class AwsCloudProvider method template.
@Override
TemplateV2Request template() {
TemplateV2Request t = new TemplateV2Request();
String instanceTypeDefaultValue = "m4.xlarge";
String instanceTypeParam = getTestParameter().get("awsInstanceType");
t.setInstanceType(instanceTypeParam == null ? instanceTypeDefaultValue : instanceTypeParam);
int volumeCountDefault = 1;
String volumeCountParam = getTestParameter().get("awsInstanceVolumeCount");
t.setVolumeCount(volumeCountParam == null ? volumeCountDefault : Integer.parseInt(volumeCountParam));
int volumeSizeDefault = 100;
String volumeSizeParam = getTestParameter().get("awsInstanceVolumeSize");
t.setVolumeSize(volumeSizeParam == null ? volumeSizeDefault : Integer.parseInt(volumeSizeParam));
String volumeTypeDefault = "gp2";
String volumeTypeParam = getTestParameter().get("awsInstanceVolumeType");
t.setVolumeType(volumeTypeParam == null ? volumeTypeDefault : volumeTypeParam);
return t;
}
use of com.sequenceiq.cloudbreak.api.model.v2.TemplateV2Request in project cloudbreak by hortonworks.
the class InstanceGroupV2RequestToHostGroupRequestConverterTest method createSource.
@Override
public InstanceGroupV2Request createSource() {
InstanceGroupV2Request instanceGroupV2Request = new InstanceGroupV2Request();
instanceGroupV2Request.setGroup("master");
instanceGroupV2Request.setNodeCount(4);
instanceGroupV2Request.setParameters(new HashMap<>());
instanceGroupV2Request.setRecipeNames(Sets.newHashSet(Arrays.asList("recipe1", "recipe2")));
instanceGroupV2Request.setRecoveryMode(RecoveryMode.MANUAL);
instanceGroupV2Request.setType(InstanceGroupType.CORE);
TemplateV2Request templateV2Request = new TemplateV2Request();
templateV2Request.setInstanceType("m4.xlarge");
templateV2Request.setParameters(new HashMap<>());
templateV2Request.setVolumeCount(1);
templateV2Request.setVolumeSize(100);
templateV2Request.setVolumeType("ebs");
instanceGroupV2Request.setTemplate(templateV2Request);
SecurityGroupV2Request securityGroupV2Request = new SecurityGroupV2Request();
securityGroupV2Request.setSecurityGroupId("groupid");
securityGroupV2Request.setSecurityRules(new ArrayList<>());
instanceGroupV2Request.setSecurityGroup(securityGroupV2Request);
return instanceGroupV2Request;
}
use of com.sequenceiq.cloudbreak.api.model.v2.TemplateV2Request in project cloudbreak by hortonworks.
the class TemplateToTemplateV2RequestConverter method convert.
@Override
public TemplateV2Request convert(Template source) {
TemplateV2Request templateV2Request = new TemplateV2Request();
templateV2Request.setParameters(source.getAttributes().getMap());
templateV2Request.setInstanceType(source.getInstanceType());
templateV2Request.setVolumeCount(source.getVolumeCount());
templateV2Request.setVolumeSize(source.getVolumeSize());
templateV2Request.setVolumeType(source.getVolumeType());
return templateV2Request;
}
use of com.sequenceiq.cloudbreak.api.model.v2.TemplateV2Request in project cloudbreak by hortonworks.
the class InstanceGroupV2PreparationTest method createTemplateRequest.
@BeforeMethod(dependsOnGroups = "igRequestCreation")
@Parameters({ "group", "instanceType", "volumeType", "volumeSize", "volumeCount" })
public void createTemplateRequest(String group, String instanceType, String volumeType, int volumeSize, int volumeCount) {
TemplateV2Request templateV2Request = new TemplateV2Request();
templateV2Request.setInstanceType(instanceType);
templateV2Request.setVolumeType(volumeType);
templateV2Request.setVolumeSize(volumeSize);
templateV2Request.setVolumeCount(volumeCount);
IntegrationTestContext itContext = getItContext();
Map<String, InstanceGroupV2Request> igMap = itContext.getContextParam(CloudbreakV2Constants.INSTANCEGROUP_MAP, Map.class);
InstanceGroupV2Request instanceGroupV2Request = igMap.get(group);
instanceGroupV2Request.setTemplate(templateV2Request);
}
Aggregations