List of usage examples for com.amazonaws.services.ec2.model DescribeImageAttributeResult getImageAttribute
public ImageAttribute getImageAttribute()
Describes an image attribute.
From source file:com.zotoh.cloudapi.aws.AMImage.java
License:Open Source License
@Override public Iterable<String> listShares(String ami) throws CloudException, InternalException { tstEStrArg("image-id", ami); DescribeImageAttributeResult res = _svc.getCloud().getEC2() .describeImageAttribute(new DescribeImageAttributeRequest().withImageId(ami)); ImageAttribute attr = res == null ? null : res.getImageAttribute(); List<LaunchPermission> lst = attr == null ? null : attr.getLaunchPermissions(); List<String> rc = LT(); if (lst != null) for (int i = 0; i < lst.size(); ++i) { rc.add(lst.get(i).getUserId()); }/*from www.j a v a 2 s. c om*/ return rc; }