List of usage examples for com.amazonaws.services.rds.model ListTagsForResourceResult getTagList
public java.util.List<Tag> getTagList()
List of tags returned by the ListTagsForResource operation.
From source file:com.github.blacklocus.rdsecho.utl.RdsFind.java
License:Open Source License
public Iterable<Tag> instanceTags(String instanceArn, Predicate<Tag> predicate) { ListTagsForResourceResult result = rds .listTagsForResource(new ListTagsForResourceRequest().withResourceName(instanceArn)); return Iterables.filter(result.getTagList(), predicate); }
From source file:com.github.blacklocus.rdsecho.utl.RdsFind.java
License:Open Source License
public Predicate<DBInstance> instanceHasTag(final String region, final String accountNumber, final String tagKey, final String tagValue) { return new Predicate<DBInstance>() { @Override/*from w ww . j a va2s .c om*/ public boolean apply(DBInstance instance) { String rdsInstanceArn = instanceArn(region, accountNumber, instance.getDBInstanceIdentifier()); ListTagsForResourceResult result = rds .listTagsForResource(new ListTagsForResourceRequest().withResourceName(rdsInstanceArn)); return Iterables.any(result.getTagList(), new Predicate<Tag>() { @Override public boolean apply(Tag tag) { return tagKey.equals(tag.getKey()) && tagValue.equals(tag.getValue()); } }); } }; }
From source file:com.optimalbi.Services.LocalRDSService.java
License:Apache License
public Map<String, String> getTags() { AmazonRDS rds = new AmazonRDSClient(this.getCredentials().getCredentials()); String arn = thisService.getTdeCredentialArn(); ListTagsForResourceResult tagsList = rds .listTagsForResource(new ListTagsForResourceRequest().withResourceName(arn)); List<Tag> tagList = tagsList.getTagList(); Map<String, String> tagMap = new HashMap<>(); for (Tag t : tagList) { tagMap.put(t.getKey(), t.getValue()); }//w w w . j a v a 2 s . c om return tagMap; }
From source file:org.springframework.cloud.aws.jdbc.rds.AmazonRdsDataSourceUserTagsFactoryBean.java
License:Apache License
@Override protected Map<String, String> createInstance() throws Exception { LinkedHashMap<String, String> userTags = new LinkedHashMap<>(); ListTagsForResourceResult tagsForResource = this.amazonRds.listTagsForResource( new ListTagsForResourceRequest().withResourceName(getDbInstanceResourceName())); for (Tag tag : tagsForResource.getTagList()) { userTags.put(tag.getKey(), tag.getValue()); }/*from w w w.j a v a 2 s. co m*/ return userTags; }