/** * Synchronous UnTagging of one or many AWS resources with the provided tags. */ public static void unTagResources(AmazonEC2AsyncClient client, Collection<Tag> tags, String... resourceIds) { if (isAwsClientMock()) { return; } DeleteTagsRequest req = new DeleteTagsRequest() .withTags(tags) .withResources(resourceIds); client.deleteTags(req); }
@Override public Void call() { for (Tag tag : this.tags) { LOG.debug("deleting {}={} tag on instance {}", tag.getKey(), tag.getValue(), this.resourceId); } DeleteTagsRequest request = new DeleteTagsRequest().withResources(this.resourceId).withTags(this.tags); getClient().getApi().deleteTags(request); return null; }
/** * Create Tags. * * @param availabilityZone the availability zone * @param iops the iops * @param size the size * @param snapshotId the snapshot id * @param volumeType the volume type * @return Volume */ protected final boolean deleteTags(final Collection<String> resources, final Collection<Tag> tags) { DeleteTagsRequest req = new DeleteTagsRequest(); req.setResources(resources); req.setTags(tags); DeleteTagsResult result = amazonEC2Client.deleteTags(req); if (result != null) { return true; } return false; }
@Override public void deleteTags(DeleteTagsRequest deleteTagsRequest) throws AmazonServiceException, AmazonClientException { throw new UnsupportedOperationException("Not supported in mock"); }
@Override public void delete(DeleteTagsRequest request) { delete(request, null); }
@Override public void delete(DeleteTagsRequest request, ResultCapture<Void> extractor) { resource.performAction("Delete", request, extractor); }
public void tagDelete(final String resourceId, final String key, final String value) { final DeleteTagsRequest request = new DeleteTagsRequest(); final Collection<String> resourceList = new ArrayList<String>(1); resourceList.add(resourceId); final Collection<Tag> tagList = new ArrayList<Tag>(1); tagList.add(new Tag(key, value)); request.setResources(resourceList); request.setTags(tagList); logger.info("tag delete request=" + request); amazonClient.deleteTags(request); }
/** * Performs the <code>Delete</code> action. * * <p> * The following request parameters will be populated from the data of this * <code>Tag</code> resource, and any conflicting parameter value set in the * request will be overridden: * <ul> * <li> * <b><code>Resources.0</code></b> * - mapped from the <code>ResourceId</code> identifier. * </li> * <li> * <b><code>Tags[0].Key</code></b> * - mapped from the <code>Key</code> identifier. * </li> * <li> * <b><code>Tags[0].Value</code></b> * - mapped from the <code>Value</code> identifier. * </li> * </ul> * * <p> * * @see DeleteTagsRequest */ void delete(DeleteTagsRequest request);
/** * Performs the <code>Delete</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>Tag</code> resource, and any conflicting parameter value set in the * request will be overridden: * <ul> * <li> * <b><code>Resources.0</code></b> * - mapped from the <code>ResourceId</code> identifier. * </li> * <li> * <b><code>Tags[0].Key</code></b> * - mapped from the <code>Key</code> identifier. * </li> * <li> * <b><code>Tags[0].Value</code></b> * - mapped from the <code>Value</code> identifier. * </li> * </ul> * * <p> * * @see DeleteTagsRequest */ void delete(DeleteTagsRequest request, ResultCapture<Void> extractor);