List of usage examples for com.amazonaws.services.rds.model Tag getKey
public String getKey()
A key is the required name of the tag.
From source file:com.airbnb.billow.RDSInstance.java
public RDSInstance(DBInstance instance, DBCluster cluster, List<Tag> tagList) { this.allocatedStorage = instance.getAllocatedStorage(); this.autoMinorVersionUpgrade = instance.getAutoMinorVersionUpgrade(); this.availabilityZone = instance.getAvailabilityZone(); this.backupRetentionPeriod = instance.getBackupRetentionPeriod(); this.characterSetName = instance.getCharacterSetName(); this.dBInstanceClass = instance.getDBInstanceClass(); this.dBInstanceIdentifier = instance.getDBInstanceIdentifier(); this.dBInstanceStatus = instance.getDBInstanceStatus(); this.dBClusterIdentifier = instance.getDBClusterIdentifier(); this.dBName = instance.getDBName(); this.dBParameterGroups = instance.getDBParameterGroups(); this.dBSecurityGroups = instance.getDBSecurityGroups(); this.dBSubnetGroup = instance.getDBSubnetGroup(); this.endpoint = instance.getEndpoint(); if (this.endpoint != null) { this.hostname = endpoint.getAddress(); this.privateIP = getPrivateIp(hostname); } else {/*from ww w .java2s .c o m*/ this.hostname = null; this.privateIP = null; } this.engine = instance.getEngine(); this.engineVersion = instance.getEngineVersion(); this.instanceCreateTime = instance.getInstanceCreateTime(); this.iops = instance.getIops(); this.latestRestorableTime = instance.getLatestRestorableTime(); this.licenseModel = instance.getLicenseModel(); this.masterUsername = instance.getMasterUsername(); this.multiAZ = instance.getMultiAZ(); this.optionGroupMemberships = instance.getOptionGroupMemberships(); this.pendingModifiedValues = instance.getPendingModifiedValues(); this.preferredBackupWindow = instance.getPreferredBackupWindow(); this.preferredMaintenanceWindow = instance.getPreferredMaintenanceWindow(); this.publiclyAccessible = instance.getPubliclyAccessible(); this.readReplicaDBInstanceIdentifiers = instance.getReadReplicaDBInstanceIdentifiers(); this.readReplicaSourceDBInstanceIdentifier = instance.getReadReplicaSourceDBInstanceIdentifier(); this.secondaryAvailabilityZone = instance.getSecondaryAvailabilityZone(); this.statusInfos = instance.getStatusInfos(); this.vpcSecurityGroups = instance.getVpcSecurityGroups(); this.isMaster = checkIfMaster(instance, cluster); this.tags = new HashMap<>(tagList.size()); for (Tag tag : tagList) { this.tags.put(tag.getKey(), tag.getValue()); } }
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 v a 2s. com*/ 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.github.blacklocus.rdsecho.utl.RdsFind.java
License:Open Source License
public static Predicate<Tag> tagName(final String name) { return new Predicate<Tag>() { @Override//ww w . j ava 2s. c om public boolean apply(Tag tag) { return tag.getKey().equals(name); } }; }
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()); }/*from w w w . j a v a 2 s. com*/ 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()); }// ww w .j a v a 2s . c o m return userTags; }