Example usage for com.amazonaws.services.ec2.model DeleteTagsRequest withResources

List of usage examples for com.amazonaws.services.ec2.model DeleteTagsRequest withResources

Introduction

In this page you can find the example usage for com.amazonaws.services.ec2.model DeleteTagsRequest withResources.

Prototype


public DeleteTagsRequest withResources(java.util.Collection<String> resources) 

Source Link

Document

The IDs of the resources, separated by spaces.

Usage

From source file:hudson.plugins.ec2.EC2AbstractSlave.java

License:Open Source License

protected void clearLiveInstancedata() throws AmazonClientException {
    Instance inst = getInstance(getInstanceId(), getCloud());

    /* Now that we have our instance, we can clear the tags on it */
    if (!tags.isEmpty()) {
        HashSet<Tag> inst_tags = new HashSet<Tag>();

        for (EC2Tag t : tags) {
            inst_tags.add(new Tag(t.getName(), t.getValue()));
        }//from  w  w  w .  j  av a 2s .co  m

        DeleteTagsRequest tag_request = new DeleteTagsRequest();
        tag_request.withResources(inst.getInstanceId()).setTags(inst_tags);
        getCloud().connect().deleteTags(tag_request);
    }
}