|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface TagApi
Provides access to Amazon EC2 via the Query API
| Method Summary | |
|---|---|
void |
applyToResources(Iterable<String> tags,
Iterable<String> resourceIds)
Adds or overwrites one or more tags for the specified resource or resources. |
void |
applyToResources(Map<String,String> tags,
Iterable<String> resourceIds)
like applyToResources(Map, Iterable) except that the tags have no
values. |
void |
conditionallyDeleteFromResources(Map<String,String> conditionalTagValues,
Iterable<String> resourceIds)
like deleteFromResources(Iterable, Iterable), except that the
tags are only deleted if they match the value. |
void |
deleteFromResources(Iterable<String> tags,
Iterable<String> resourceIds)
Deletes a specific set of tags from a specific set of resources. |
com.google.common.collect.FluentIterable<Tag> |
filter(com.google.common.collect.Multimap<String,String> filter)
Describes tags for your EC2 resources qualified by a filter |
com.google.common.collect.FluentIterable<Tag> |
list()
Describes all of your tags for your EC2 resources. |
| Method Detail |
|---|
@Named(value="CreateTags")
void applyToResources(Iterable<String> tags,
Iterable<String> resourceIds)
tagApi.applyToResources(ImmutableMap.of("group", "backend"), ImmutableSet.of("i-1a2b3c4d"));
tags - key to an optional value.resourceIds - The ID of a resource to tag. For example, ami-1a2b3c4d
@Named(value="CreateTags")
void applyToResources(Map<String,String> tags,
Iterable<String> resourceIds)
applyToResources(Map, Iterable) except that the tags have no
values.
tagApi.applyToResources(ImmutableSet.of("production", "pci-compliant"), ImmutableSet.of("i-1a2b3c4d"));
applyToResources(Map, Iterable)@Named(value="DescribeTags") com.google.common.collect.FluentIterable<Tag> list()
@Named(value="DescribeTags") com.google.common.collect.FluentIterable<Tag> filter(com.google.common.collect.Multimap<String,String> filter)
tags = tagApi.filter(new TagFilterBuilder().image().put("version", "1.0").build());
filter - which is typically built by TagFilterBuilder
@Named(value="DeleteTags")
void deleteFromResources(Iterable<String> tags,
Iterable<String> resourceIds)
list or filter call. You first determine what tags a resource has, and then you
call delete with
the resource ID and the specific tags you want to delete.
tagApi.deleteFromResources(ImmutableSet.of("Purpose"), ImmutableSet.of("ami-1a2b3c4d"));
tags - the tag keysresourceIds - The ID of a resource with the tag. For example,
ami-1a2b3c4d
@Named(value="DeleteTags")
void conditionallyDeleteFromResources(Map<String,String> conditionalTagValues,
Iterable<String> resourceIds)
deleteFromResources(Iterable, Iterable), except that the
tags are only deleted if they match the value.
tagApi.conditionallyDeleteFromResources(ImmutableMap.of("Purpose", "production"), ImmutableSet.of("ami-1a2b3c4d"));
conditionalTagValues - tag id to value it must match before deleting. For a tag without
a value, supply empty string.resourceIds - The ID of a resource with the tag. For example,
ami-1a2b3c4ddeleteFromResources(Iterable, Iterable)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||