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

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

Introduction

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

Prototype


public Boolean isPublic() 

Source Link

Document

Indicates whether the image has public launch permissions.

Usage

From source file:org.gridgain.grid.spi.cloud.ec2lite.GridEc2LiteCloudSpi.java

License:GNU General Public License

/**
 * Gets image resource from EC2 image.//w w w  .  ja  v a 2  s.co m
 *
 * @param img EC2 image.
 * @return Image resource.
 */
private GridCloudSpiResourceAdapter createImageResource(Image img) {
    assert img != null;

    Map<String, String> params = new HashMap<String, String>();

    params.put(IMG_ARCH, img.getArchitecture());
    params.put(IMG_LOC, img.getImageLocation());
    params.put(IMG_STATE, img.getState());
    params.put(INST_TYPE, img.getImageType());
    params.put(IMG_KERNEL_ID, img.getKernelId());
    params.put(OWNER_ID, img.getOwnerId());
    params.put(INST_PLATFORM, img.getPlatform());
    params.put(IMG_RAMDISK_ID, img.getRamdiskId());
    params.put(IMG_PUBLIC, String.valueOf(img.isPublic()));

    params.put(PRODUCT_CODE_IDS, F.concat(F.transform(img.getProductCodes(), new C1<ProductCode, String>() {
        @Override
        public String apply(ProductCode e) {
            return e.getProductCodeId();
        }
    }), VAL_DELIM));

    return new GridCloudSpiResourceAdapter(img.getImageId(), CLD_IMAGE, cloudId, params);
}