當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。