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

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

Introduction

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

Prototype


public void setState(ImageState state) 

Source Link

Document

The current state of the AMI.

Usage

From source file:com.carrotgarden.maven.aws.ecc.CarrotElasticCompute.java

License:BSD License

private Image newImageWithStatus(final String state, final String code, final String message) {

    final StateReason reason = new StateReason();
    reason.setCode(code);/*from w ww  .  jav  a2s  .  co m*/
    reason.setMessage(message);

    final Image image = new Image();
    image.setState(state);
    image.setStateReason(reason);

    return image;

}

From source file:jp.primecloud.auto.aws.typica.converter.ImageConverter.java

License:Open Source License

@Override
protected Image convertObject(ImageDescription from) {
    Image to = new Image();

    to.setImageId(from.getImageId());//from  w w  w.ja va 2  s . co m
    to.setImageLocation(from.getImageLocation());
    to.setState(from.getImageState());
    to.setOwnerId(from.getImageOwnerId());
    to.setPublic(from.isPublic());
    to.setProductCodes(new ProductCodeConverter().convert(from.getProductCodes()));
    to.setArchitecture(from.getArchitecture());
    to.setImageType(from.getImageType());
    to.setKernelId(from.getKernelId());
    to.setRamdiskId(from.getRamdiskId());
    to.setPlatform(from.getPlatform());

    // 
    to.setStateReason(null);
    to.setImageOwnerAlias(null);
    to.setName(null);
    to.setDescription(null);
    //to.setRootDeviceType(null);
    to.setRootDeviceName(null);
    to.setBlockDeviceMappings(null);
    //to.setVirtualizationType(null);
    to.setTags(null);

    return to;
}