Search in sources :

Example 1 with ProviderParameterCalculator

use of com.sequenceiq.cloudbreak.common.mappable.ProviderParameterCalculator in project cloudbreak by hortonworks.

the class InstanceTemplateV4RequestToTemplateConverterTest method getSampleGcpRequest.

private InstanceTemplateV4Request getSampleGcpRequest() {
    InstanceTemplateV4Request source = new InstanceTemplateV4Request();
    source.setCloudPlatform(CloudPlatform.GCP);
    source.setRootVolume(getRootVolume(100));
    source.setInstanceType("n1-standard-4");
    GcpInstanceTemplateV4Parameters parameters = new GcpInstanceTemplateV4Parameters();
    GcpEncryptionV4Parameters encryption = new GcpEncryptionV4Parameters();
    encryption.setType(EncryptionType.CUSTOM);
    encryption.setKeyEncryptionMethod(KeyEncryptionMethod.RAW);
    encryption.setKey("myKey");
    parameters.setEncryption(encryption);
    source.setGcp(parameters);
    ProviderParameterCalculator providerParameterCalculator = new ProviderParameterCalculator();
    ReflectionTestUtils.setField(underTest, "providerParameterCalculator", providerParameterCalculator);
    when(missingResourceNameGenerator.generateName(APIResourceType.TEMPLATE)).thenReturn("name");
    return source;
}
Also used : InstanceTemplateV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.instancegroup.template.InstanceTemplateV4Request) GcpInstanceTemplateV4Parameters(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.parameter.template.GcpInstanceTemplateV4Parameters) GcpEncryptionV4Parameters(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.parameter.template.GcpEncryptionV4Parameters) ProviderParameterCalculator(com.sequenceiq.cloudbreak.common.mappable.ProviderParameterCalculator)

Example 2 with ProviderParameterCalculator

use of com.sequenceiq.cloudbreak.common.mappable.ProviderParameterCalculator in project cloudbreak by hortonworks.

the class InstanceTemplateV4RequestToTemplateConverterTest method getSampleAwsRequest.

private InstanceTemplateV4Request getSampleAwsRequest() {
    InstanceTemplateV4Request source = new InstanceTemplateV4Request();
    source.setCloudPlatform(CloudPlatform.AWS);
    source.setRootVolume(getRootVolume(100));
    source.setInstanceType("m5.2xlarge");
    AwsInstanceTemplateV4Parameters parameters = new AwsInstanceTemplateV4Parameters();
    AwsEncryptionV4Parameters encryption = new AwsEncryptionV4Parameters();
    encryption.setType(EncryptionType.CUSTOM);
    encryption.setKey("myKey");
    parameters.setEncryption(encryption);
    source.setAws(parameters);
    ProviderParameterCalculator providerParameterCalculator = new ProviderParameterCalculator();
    ReflectionTestUtils.setField(underTest, "providerParameterCalculator", providerParameterCalculator);
    when(missingResourceNameGenerator.generateName(APIResourceType.TEMPLATE)).thenReturn("name");
    return source;
}
Also used : InstanceTemplateV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.instancegroup.template.InstanceTemplateV4Request) AwsInstanceTemplateV4Parameters(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.parameter.template.AwsInstanceTemplateV4Parameters) AwsEncryptionV4Parameters(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.parameter.template.AwsEncryptionV4Parameters) ProviderParameterCalculator(com.sequenceiq.cloudbreak.common.mappable.ProviderParameterCalculator)

Aggregations

InstanceTemplateV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.instancegroup.template.InstanceTemplateV4Request)2 ProviderParameterCalculator (com.sequenceiq.cloudbreak.common.mappable.ProviderParameterCalculator)2 AwsEncryptionV4Parameters (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.parameter.template.AwsEncryptionV4Parameters)1 AwsInstanceTemplateV4Parameters (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.parameter.template.AwsInstanceTemplateV4Parameters)1 GcpEncryptionV4Parameters (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.parameter.template.GcpEncryptionV4Parameters)1 GcpInstanceTemplateV4Parameters (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.parameter.template.GcpInstanceTemplateV4Parameters)1