Java 类com.amazonaws.services.rds.model.DBSubnetGroup 实例源码

项目:cfnassist    文件:RDSClient.java   
public List<DBInstance> getDBInstancesForVpc(String vpcId) {    
    DescribeDBInstancesResult result = rdsClient.describeDBInstances();
    List<DBInstance> dbInstances = result.getDBInstances();

    List<DBInstance> filtered = new LinkedList<DBInstance>(); 
    for(DBInstance dbInstance : dbInstances) {
        DBSubnetGroup dbSubnetGroup = dbInstance.getDBSubnetGroup();
        if (dbSubnetGroup!=null) {
            String groupVpcId = dbSubnetGroup.getVpcId();
            if (groupVpcId.equals(vpcId)) {
                filtered.add(dbInstance);
            }
        }
    }
    return filtered;
}
项目:bluegreen-manager    文件:RdsSnapshotRestoreTaskTest.java   
private DBInstance makeInstance(String instanceName, RdsInstanceStatus instanceStatus)
{
  DBInstance dbInstance = new DBInstance();
  dbInstance.setDBInstanceIdentifier(instanceName);
  dbInstance.setDBInstanceStatus(instanceStatus == null ? UNKNOWN_STATUS : instanceStatus.toString());
  Endpoint endpoint = new Endpoint();
  endpoint.setAddress(STAGE_ENDPOINT_ADDRESS);
  dbInstance.setEndpoint(endpoint);
  DBSubnetGroup dbSubnetGroup = new DBSubnetGroup();
  dbSubnetGroup.setDBSubnetGroupName(SUBNET_GROUP);
  dbInstance.setDBSubnetGroup(dbSubnetGroup);
  return dbInstance;
}
项目:cfnassist    文件:VPCVisitor.java   
private void visitRDS(VPCDiagramBuilder vpcDiagram, DBInstance rds) throws CfnAssistException {
    logger.debug("visit rds " + rds.getDBInstanceIdentifier());
    vpcDiagram.addDBInstance(rds);
    DBSubnetGroup dbSubnetGroup = rds.getDBSubnetGroup();

    if (dbSubnetGroup!=null) {
        for(com.amazonaws.services.rds.model.Subnet subnet : dbSubnetGroup.getSubnets()) {
            String subnetId = subnet.getSubnetIdentifier();
            logger.debug("visit rds subnet " + subnetId);
            vpcDiagram.associateDBWithSubnet(rds, subnetId);
        }
    }   
    addDBSecurityGroupsToDiagram(vpcDiagram, rds);
}
项目:cfnassist    文件:VpcTestBuilder.java   
private void addAndAssociate(DBInstance dbInstance) {
    databases.add(dbInstance);

    List<com.amazonaws.services.rds.model.Subnet> rdsSubnets = new LinkedList<>();
    rdsSubnets.add(new com.amazonaws.services.rds.model.Subnet().withSubnetIdentifier(dbSubnet.getSubnetId()));
    DBSubnetGroup dBSubnetGroup = new DBSubnetGroup();
    dBSubnetGroup.setSubnets(rdsSubnets);
    dbInstance.withDBSubnetGroup(dBSubnetGroup);
}