当前位置: 首页>>代码示例>>Java>>正文


Java DBSubnetGroup类代码示例

本文整理汇总了Java中com.amazonaws.services.rds.model.DBSubnetGroup的典型用法代码示例。如果您正苦于以下问题:Java DBSubnetGroup类的具体用法?Java DBSubnetGroup怎么用?Java DBSubnetGroup使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DBSubnetGroup类属于com.amazonaws.services.rds.model包,在下文中一共展示了DBSubnetGroup类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getDBInstancesForVpc

import com.amazonaws.services.rds.model.DBSubnetGroup; //导入依赖的package包/类
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;
}
 
开发者ID:cartwrightian,项目名称:cfnassist,代码行数:17,代码来源:RDSClient.java

示例2: makeInstance

import com.amazonaws.services.rds.model.DBSubnetGroup; //导入依赖的package包/类
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;
}
 
开发者ID:Nike-Inc,项目名称:bluegreen-manager,代码行数:14,代码来源:RdsSnapshotRestoreTaskTest.java

示例3: visitRDS

import com.amazonaws.services.rds.model.DBSubnetGroup; //导入依赖的package包/类
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);
}
 
开发者ID:cartwrightian,项目名称:cfnassist,代码行数:15,代码来源:VPCVisitor.java

示例4: addAndAssociate

import com.amazonaws.services.rds.model.DBSubnetGroup; //导入依赖的package包/类
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);
}
 
开发者ID:cartwrightian,项目名称:cfnassist,代码行数:10,代码来源:VpcTestBuilder.java


注:本文中的com.amazonaws.services.rds.model.DBSubnetGroup类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。