List of usage examples for com.amazonaws.services.ec2.model DescribeImageAttributeRequest DescribeImageAttributeRequest
public DescribeImageAttributeRequest()
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 w w w .j a v a2s . c o m return rc; }