Search in sources :

Example 1 with ComputeImageRestRep

use of com.emc.storageos.model.compute.ComputeImageRestRep in project coprhd-controller by CoprHD.

the class ComputeMapper method map.

public static ComputeImageRestRep map(ComputeImage from) {
    if (from == null) {
        return null;
    }
    ComputeImageRestRep to = new ComputeImageRestRep();
    mapDataObjectFields(from, to);
    to.setImageName(from.getImageName());
    to.setImageUrl(ImageServerControllerImpl.maskImageURLPassword(from.getImageUrl()));
    to.setImageType(from.getImageType());
    to.setComputeImageStatus(from.getComputeImageStatus());
    to.setLastImportStatusMessage(from.getLastImportStatusMessage());
    List<NamedRelatedResourceRep> availableServersList = new ArrayList<NamedRelatedResourceRep>();
    List<NamedRelatedResourceRep> failedServersList = new ArrayList<NamedRelatedResourceRep>();
    to.setAvailableImageServers(availableServersList);
    to.setFailedImageServers(failedServersList);
    return to;
}
Also used : ComputeImageRestRep(com.emc.storageos.model.compute.ComputeImageRestRep) ArrayList(java.util.ArrayList) NamedRelatedResourceRep(com.emc.storageos.model.NamedRelatedResourceRep)

Example 2 with ComputeImageRestRep

use of com.emc.storageos.model.compute.ComputeImageRestRep in project coprhd-controller by CoprHD.

the class ComputeImages method edit.

@FlashException("list")
public static void edit(String id) {
    addReferenceData();
    ComputeImageRestRep computeImage = ComputeImageUtils.getComputeImage(id);
    if (computeImage != null) {
        ComputeImageForm computeImages = new ComputeImageForm(computeImage);
        renderArgs.put("availableImageServersNames", computeImages.availableImageServerNames);
        renderArgs.put("failedImageServersNames", computeImages.failedImageServerNames);
        render("@edit", computeImages);
    } else {
        flash.error(MessagesUtils.get(UNKNOWN, id));
        list();
    }
}
Also used : ComputeImageRestRep(com.emc.storageos.model.compute.ComputeImageRestRep) FlashException(controllers.util.FlashException)

Example 3 with ComputeImageRestRep

use of com.emc.storageos.model.compute.ComputeImageRestRep in project coprhd-controller by CoprHD.

the class ComputeImages method createAClone.

public static void createAClone(String imageId) {
    addReferenceData();
    ComputeImageRestRep computeImage = ComputeImageUtils.getComputeImage(imageId);
    ComputeImageForm computeImages = new ComputeImageForm(computeImage, true);
    render("@edit", computeImages);
}
Also used : ComputeImageRestRep(com.emc.storageos.model.compute.ComputeImageRestRep)

Example 4 with ComputeImageRestRep

use of com.emc.storageos.model.compute.ComputeImageRestRep in project coprhd-controller by CoprHD.

the class ComputeImageProvider method getComputeImageOptions.

@Asset("computeImage")
public List<AssetOption> getComputeImageOptions(AssetOptionsContext ctx) {
    debug("getting compute images");
    List<ComputeImageRestRep> availCis = new ArrayList<ComputeImageRestRep>();
    for (ComputeImageRestRep ci : getComputeImages(ctx)) {
        if (ComputeImage.ComputeImageStatus.AVAILABLE.name().equals(ci.getComputeImageStatus())) {
            availCis.add(ci);
        }
    }
    return createBaseResourceOptions(availCis);
}
Also used : ComputeImageRestRep(com.emc.storageos.model.compute.ComputeImageRestRep) ArrayList(java.util.ArrayList) Asset(com.emc.sa.asset.annotation.Asset)

Example 5 with ComputeImageRestRep

use of com.emc.storageos.model.compute.ComputeImageRestRep in project coprhd-controller by CoprHD.

the class ComputeImages method itemDetails.

public static void itemDetails(String id) {
    ComputeImageRestRep computeImage = ComputeImageUtils.getComputeImage(id);
    if (computeImage == null) {
        error(MessagesUtils.get(UNKNOWN, id));
    }
    render(computeImage);
}
Also used : ComputeImageRestRep(com.emc.storageos.model.compute.ComputeImageRestRep)

Aggregations

ComputeImageRestRep (com.emc.storageos.model.compute.ComputeImageRestRep)6 ArrayList (java.util.ArrayList)3 NamedRelatedResourceRep (com.emc.storageos.model.NamedRelatedResourceRep)2 Asset (com.emc.sa.asset.annotation.Asset)1 ComputeImageServer (com.emc.storageos.db.client.model.ComputeImageServer)1 FlashException (controllers.util.FlashException)1