@Override public DescribeImageAttributeResult describeAttribute( DescribeImageAttributeRequest request, ResultCapture<DescribeImageAttributeResult> extractor) { ActionResult result = resource.performAction("DescribeAttribute", request, extractor); if (result == null) return null; return (DescribeImageAttributeResult) result.getData(); }
@Override public DescribeImageAttributeResult describeAttribute(String attribute, ResultCapture<DescribeImageAttributeResult> extractor) { DescribeImageAttributeRequest request = new DescribeImageAttributeRequest() .withAttribute(attribute); return describeAttribute(request, extractor); }
@Override public List<LaunchPermission> findImageLaunchPermissions(Account account, Region region, String imageId) { AmazonEC2 ec2 = findClient(account, region); DescribeImageAttributeRequest req = new DescribeImageAttributeRequest(); req.setAttribute("launchPermission"); req.setImageId(imageId); log.debug("start describing image launch permission for account:{} in region:{} via api", account.getId() + "=>" + account.getName(), region); DescribeImageAttributeResult res = ec2.describeImageAttribute(req); List<LaunchPermission> launchPermissions = res.getImageAttribute().getLaunchPermissions(); return removeGroup(launchPermissions); }
@Override public DescribeImageAttributeResult describeImageAttribute(DescribeImageAttributeRequest describeImageAttributeRequest) throws AmazonServiceException, AmazonClientException { throw new UnsupportedOperationException("Not supported in mock"); }
@Override public DescribeImageAttributeResult describeAttribute( DescribeImageAttributeRequest request) { return describeAttribute(request, null); }
@Override public DescribeImageAttributeResult describeAttribute(String attribute) { return describeAttribute(attribute, (ResultCapture<DescribeImageAttributeResult>)null); }
/** * Performs the <code>DescribeAttribute</code> action. * * <p> * The following request parameters will be populated from the data of this * <code>Image</code> resource, and any conflicting parameter value set in * the request will be overridden: * <ul> * <li> * <b><code>ImageId</code></b> * - mapped from the <code>Id</code> identifier. * </li> * </ul> * * <p> * * @return The response of the low-level client operation associated with * this resource action. * @see DescribeImageAttributeRequest */ DescribeImageAttributeResult describeAttribute(DescribeImageAttributeRequest request);
/** * Performs the <code>DescribeAttribute</code> action and use a * ResultCapture to retrieve the low-level client response. * * <p> * The following request parameters will be populated from the data of this * <code>Image</code> resource, and any conflicting parameter value set in * the request will be overridden: * <ul> * <li> * <b><code>ImageId</code></b> * - mapped from the <code>Id</code> identifier. * </li> * </ul> * * <p> * * @return The response of the low-level client operation associated with * this resource action. * @see DescribeImageAttributeRequest */ DescribeImageAttributeResult describeAttribute(DescribeImageAttributeRequest request, ResultCapture<DescribeImageAttributeResult> extractor);
/** * The convenient method form for the <code>DescribeAttribute</code> action. * * @see #describeAttribute(DescribeImageAttributeRequest) */ DescribeImageAttributeResult describeAttribute(String attribute);
/** * The convenient method form for the <code>DescribeAttribute</code> action. * * @see #describeAttribute(DescribeImageAttributeRequest, ResultCapture) */ DescribeImageAttributeResult describeAttribute(String attribute, ResultCapture<DescribeImageAttributeResult> extractor);