Search in sources :

Example 1 with OpenstackBaseImage

use of com.netflix.spinnaker.halyard.config.model.v1.providers.openstack.OpenstackBaseImage in project halyard by spinnaker.

the class OpenstackAddBaseImageCommand method buildBaseImage.

@Override
protected BaseImage buildBaseImage(String baseImageId) {
    OpenstackBaseImage baseImage = new OpenstackBaseImage();
    OpenstackBaseImage.OpenstackImageSettings imageSettings = new OpenstackBaseImage.OpenstackImageSettings();
    baseImage.setBaseImage(imageSettings);
    // TODO(edwinavalos) Support multiple virtualization settings
    List<OpenstackBaseImage.OpenstackVirtualizationSettings> vsList = new ArrayList<>();
    OpenstackBaseImage.OpenstackVirtualizationSettings virtualizationSettings = new OpenstackBaseImage.OpenstackVirtualizationSettings();
    virtualizationSettings.setSourceImageId(sourceImageId);
    virtualizationSettings.setRegion(region);
    virtualizationSettings.setInstanceType(instanceType);
    virtualizationSettings.setSshUserName(sshUserName);
    vsList.add(virtualizationSettings);
    baseImage.setVirtualizationSettings(vsList);
    return baseImage;
}
Also used : ArrayList(java.util.ArrayList) OpenstackBaseImage(com.netflix.spinnaker.halyard.config.model.v1.providers.openstack.OpenstackBaseImage)

Aggregations

OpenstackBaseImage (com.netflix.spinnaker.halyard.config.model.v1.providers.openstack.OpenstackBaseImage)1 ArrayList (java.util.ArrayList)1