@Override public DescribeSnapshotAttributeResult describeAttribute( DescribeSnapshotAttributeRequest request, ResultCapture<DescribeSnapshotAttributeResult> extractor) { ActionResult result = resource.performAction("DescribeAttribute", request, extractor); if (result == null) return null; return (DescribeSnapshotAttributeResult) result.getData(); }
@Override public DescribeSnapshotAttributeResult describeAttribute(String attribute, ResultCapture<DescribeSnapshotAttributeResult> extractor) { DescribeSnapshotAttributeRequest request = new DescribeSnapshotAttributeRequest() .withAttribute(attribute); return describeAttribute(request, extractor); }
@Override public List<CreateVolumePermission> findCreateVolumePermissions(Account account, Region region, String snapshotId) { AmazonEC2 ec2 = findClient(account, region); DescribeSnapshotAttributeRequest req = new DescribeSnapshotAttributeRequest(); req.setAttribute("createVolumePermission"); req.setSnapshotId(snapshotId); log.debug("start describing snapshot create volume permission for account:{} in region:{} via api", account.getId() + "=>" + account.getName(), region); DescribeSnapshotAttributeResult res = ec2.describeSnapshotAttribute(req); return res.getCreateVolumePermissions(); }
@Override public List<ProductCode> findSnapshotProductCodes(Account account, Region region, String snapshotId) { AmazonEC2 ec2 = findClient(account, region); DescribeSnapshotAttributeRequest req = new DescribeSnapshotAttributeRequest(); req.setAttribute("productCodes"); req.setSnapshotId(snapshotId); log.debug("start describing snapshot productCodes for account:{} in region:{} via api", account.getId() + "=>" + account.getName(), region); DescribeSnapshotAttributeResult res = ec2.describeSnapshotAttribute(req); return res.getProductCodes(); }
@Override public DescribeSnapshotAttributeResult describeSnapshotAttribute(DescribeSnapshotAttributeRequest describeSnapshotAttributeRequest) throws AmazonServiceException, AmazonClientException { throw new UnsupportedOperationException("Not supported in mock"); }
@Override public DescribeSnapshotAttributeResult describeAttribute( DescribeSnapshotAttributeRequest request) { return describeAttribute(request, null); }
/** * Performs the <code>DescribeAttribute</code> action. * * <p> * The following request parameters will be populated from the data of this * <code>Snapshot</code> resource, and any conflicting parameter value set * in the request will be overridden: * <ul> * <li> * <b><code>SnapshotId</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 DescribeSnapshotAttributeRequest */ DescribeSnapshotAttributeResult describeAttribute( DescribeSnapshotAttributeRequest 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>Snapshot</code> resource, and any conflicting parameter value set * in the request will be overridden: * <ul> * <li> * <b><code>SnapshotId</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 DescribeSnapshotAttributeRequest */ DescribeSnapshotAttributeResult describeAttribute( DescribeSnapshotAttributeRequest request, ResultCapture<DescribeSnapshotAttributeResult> extractor);