use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.parameter.instancegroup.network.gcp.InstanceGroupGcpNetworkV4Parameters in project cloudbreak by hortonworks.
the class InstanceGroupNetworkParameterConverter method convert.
public InstanceGroupGcpNetworkV4Parameters convert(InstanceGroupGcpNetworkV1Parameters gcp, EnvironmentNetworkResponse value, CloudPlatform cloudPlatform) {
InstanceGroupGcpNetworkV4Parameters response = null;
if (CloudPlatform.GCP == cloudPlatform) {
InstanceGroupGcpNetworkV1Parameters params = gcp == null ? new InstanceGroupGcpNetworkV1Parameters() : gcp;
response = convertToGcpNetworkParams(new ImmutablePair<>(params, value));
}
return response;
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.parameter.instancegroup.network.gcp.InstanceGroupGcpNetworkV4Parameters in project cloudbreak by hortonworks.
the class InstanceGroupNetworkParameterConverter method convertToGcpNetworkParams.
private InstanceGroupGcpNetworkV4Parameters convertToGcpNetworkParams(Pair<InstanceGroupGcpNetworkV1Parameters, EnvironmentNetworkResponse> source) {
InstanceGroupGcpNetworkV1Parameters key = source.getKey();
InstanceGroupGcpNetworkV4Parameters response = new InstanceGroupGcpNetworkV4Parameters();
if (key != null) {
List<String> subnetIds = key.getSubnetIds();
if (subnetIdsDefined(subnetIds)) {
response.setSubnetIds(subnetIds);
} else if (source.getValue() != null) {
response.setSubnetIds(List.of(source.getValue().getPreferedSubnetId()));
}
}
return response;
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.parameter.instancegroup.network.gcp.InstanceGroupGcpNetworkV4Parameters in project cloudbreak by hortonworks.
the class StackV4RequestToStackConverter method setUpGcp.
private void setUpGcp(InstanceGroupV4Request instanceGroup, InstanceGroupNetworkV4Request instanceGroupNetworkV4Request, String subnetId) {
if (!StringUtils.isEmpty(subnetId)) {
InstanceGroupGcpNetworkV4Parameters gcp = new InstanceGroupGcpNetworkV4Parameters();
gcp.setSubnetIds(List.of(subnetId));
instanceGroupNetworkV4Request.setGcp(gcp);
instanceGroup.setNetwork(instanceGroupNetworkV4Request);
}
}
Aggregations