use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.instancegroup.network.InstanceGroupNetworkV4Request in project cloudbreak by hortonworks.
the class InstanceGroupNetworkToInstanceGroupNetworkV4RequestConverter method convert.
public InstanceGroupNetworkV4Request convert(InstanceGroupNetwork source) {
InstanceGroupNetworkV4Request response = new InstanceGroupNetworkV4Request();
Json attributes = source.getAttributes();
if (attributes != null) {
Map<String, Object> parameters = attributes.getMap();
ofNullable(attributes).ifPresent(attr -> parameters.putAll(new Json(attr).getMap()));
providerParameterCalculator.parse(parameters, response);
}
return response;
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.instancegroup.network.InstanceGroupNetworkV4Request in project cloudbreak by hortonworks.
the class InstanceGroupNetworkV1ToInstanceGroupNetworkV4Converter method convertToInstanceGroupNetworkV4Request.
public InstanceGroupNetworkV4Request convertToInstanceGroupNetworkV4Request(Pair<InstanceGroupNetworkV1Request, DetailedEnvironmentResponse> network) {
DetailedEnvironmentResponse value = network.getValue();
EnvironmentNetworkResponse environmentNetworkResponse = null;
if (value == null) {
environmentNetworkResponse = new EnvironmentNetworkResponse();
} else {
environmentNetworkResponse = value.getNetwork();
}
InstanceGroupNetworkV1Request key = network.getKey();
if (key == null) {
key = new InstanceGroupNetworkV1Request();
}
InstanceGroupNetworkV4Request request = new InstanceGroupNetworkV4Request();
if (value != null) {
CloudPlatform cloudPlatform = CloudPlatform.valueOf(value.getCloudPlatform());
request.setCloudPlatform(cloudPlatform);
request.setAws(instanceGroupNetworkParameterConverter.convert(key.getAws(), environmentNetworkResponse, cloudPlatform));
request.setAzure(instanceGroupNetworkParameterConverter.convert(key.getAzure(), environmentNetworkResponse, cloudPlatform));
request.setGcp(instanceGroupNetworkParameterConverter.convert(key.getGcp(), environmentNetworkResponse, cloudPlatform));
request.setYarn(instanceGroupNetworkParameterConverter.convert(key.getYarn(), environmentNetworkResponse, cloudPlatform));
request.setMock(instanceGroupNetworkParameterConverter.convert(key.getMock(), environmentNetworkResponse, cloudPlatform));
}
return request;
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.instancegroup.network.InstanceGroupNetworkV4Request in project cloudbreak by hortonworks.
the class AwsCloudProvider method instanceGroupNetworkV4Request.
@Override
public InstanceGroupNetworkV4Request instanceGroupNetworkV4Request(SubnetId subnetId) {
if (awsProperties.getMultiaz()) {
InstanceGroupNetworkV4Request result = new InstanceGroupNetworkV4Request();
result.createAws();
result.getAws().setSubnetIds(subnetId.collectSubnets(new LinkedList<>(awsProperties.getSubnetIds())));
return result;
} else {
return null;
}
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.instancegroup.network.InstanceGroupNetworkV4Request in project cloudbreak by hortonworks.
the class GcpCloudProvider method instanceGroupNetworkV4Request.
@Override
public InstanceGroupNetworkV4Request instanceGroupNetworkV4Request(SubnetId subnetId) {
if (gcpProperties.getMultiaz()) {
InstanceGroupNetworkV4Request result = new InstanceGroupNetworkV4Request();
result.createGcp();
result.getGcp().setSubnetIds(subnetId.collectSubnets(gcpProperties.getNetwork().getSubnetIds()));
return result;
} else {
return null;
}
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.instancegroup.network.InstanceGroupNetworkV4Request in project cloudbreak by hortonworks.
the class StackV4RequestToStackConverter method setUpMock.
private void setUpMock(InstanceGroupV4Request instanceGroup, InstanceGroupNetworkV4Request instanceGroupNetworkV4Request, String subnetId) {
if (!StringUtils.isEmpty(subnetId)) {
InstanceGroupMockNetworkV4Parameters mock = new InstanceGroupMockNetworkV4Parameters();
mock.setSubnetIds(List.of(subnetId));
instanceGroupNetworkV4Request.setMock(mock);
instanceGroup.setNetwork(instanceGroupNetworkV4Request);
}
}
Aggregations