Example usage for com.amazonaws.services.ec2.model Image getStateReason

List of usage examples for com.amazonaws.services.ec2.model Image getStateReason

Introduction

In this page you can find the example usage for com.amazonaws.services.ec2.model Image getStateReason.

Prototype


public StateReason getStateReason() 

Source Link

Document

The reason for the state change.

Usage

From source file:com.zotoh.cloudapi.aws.AMImage.java

License:Open Source License

private MachineImage toMI(Image i) {
    MachineImage m = null;/*from   w w w . ja  v a2 s .co m*/
    if (i != null) {
        m = new MachineImage();
        m.setProviderRegionId(_svc.getCloud().getContext().getRegionId());
        m.setArchitecture(toArch(i.getArchitecture()));
        m.setCurrentState(toImageState(i.getState()));

        m.setProviderMachineImageId(i.getImageId());
        m.setName(i.getName());
        m.setProviderOwnerId(i.getOwnerId());
        m.setSoftware("");
        m.setType(toImageType(i.getRootDeviceType()));

        m.addTag("manifest-location", nsb(i.getImageLocation()));
        m.addTag("hypervisor", nsb(i.getHypervisor()));
        m.addTag("alias", nsb(i.getImageOwnerAlias()));
        m.addTag("kernel", nsb(i.getKernelId()));
        m.addTag("public", i.getPublic() ? "true" : "false");
        m.addTag("ramdisk", nsb(i.getRamdiskId()));
        m.addTag("root-dev-name", nsb(i.getRootDeviceName()));
        m.addTag("state-reason", nsb(i.getStateReason()));
        m.addTag("virtualization-type", nsb(i.getVirtualizationType()));

        m.setDescription(i.getDescription());
        m.setPlatform(nsb(i.getPlatform()).toLowerCase().indexOf("windows") >= 0 ? Platform.WINDOWS
                : Platform.UBUNTU);
    }

    return m;
}