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


Java DBInstance.getDBName方法代码示例

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


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

示例1: scanRDS

import com.amazonaws.services.rds.model.DBInstance; //导入方法依赖的package包/类
/**
 * Collect data for RDS.
 *
 * @param stats
 *            current statistics object.
 * @param account
 *            currently used credentials object.
 * @param region
 *            currently used aws region.
 */
public static void scanRDS(AwsStats stats, AwsAccount account, Regions region) {
	LOG.debug("Scan for RDS in region " + region.getName() + " in account " + account.getAccountId());

	try {
		AmazonRDS rds = new AmazonRDSClient(account.getCredentials());
		rds.setRegion(Region.getRegion(region));

		List<DBInstance> list = rds.describeDBInstances().getDBInstances();

		int totalItems = list.size();
		for (DBInstance dbInstance : list) {
			AwsResource res = new AwsResource(dbInstance.getDBName(), account.getAccountId(), AwsResourceType.RDS, region);
			res.addInfo("DBInstanceIdentifier", dbInstance.getDBInstanceIdentifier());
			stats.add(res);
		}

		LOG.info(totalItems + " RDS instances in region " + region.getName() + " in account " + account.getAccountId());
	} catch (AmazonServiceException ase) {
		LOG.error("Exception of RDS: " + ase.getMessage());
	}
}
 
开发者ID:janloeffler,项目名称:aws-utilization-monitor,代码行数:32,代码来源:AwsScan.java

示例2: fromRdsInstance

import com.amazonaws.services.rds.model.DBInstance; //导入方法依赖的package包/类
private DataSourceInformation fromRdsInstance(DBInstance dbInstance) {
    Assert.notNull(dbInstance, "DbInstance must not be null");
    Assert.notNull(dbInstance.getEndpoint(), "The database instance has no endpoint available!");
    return new DataSourceInformation(DatabaseType.fromEngine(dbInstance.getEngine()),
            dbInstance.getEndpoint().getAddress(), dbInstance.getEndpoint().getPort(),
            StringUtils.hasText(this.databaseName) ? this.databaseName : dbInstance.getDBName(),
            StringUtils.hasText(this.username) ? this.username : dbInstance.getMasterUsername(), this.password);
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-aws,代码行数:9,代码来源:AmazonRdsDataSourceFactoryBean.java

示例3: getPropertyValue

import com.amazonaws.services.rds.model.DBInstance; //导入方法依赖的package包/类
@Override
protected String getPropertyValue(DBInstance dbInstance) {
  return dbInstance.getDBName();
}
 
开发者ID:cloudera,项目名称:director-aws-plugin,代码行数:5,代码来源:RDSInstance.java

示例4: RDSInstance

import com.amazonaws.services.rds.model.DBInstance; //导入方法依赖的package包/类
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 {
      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());
    }
}
 
开发者ID:airbnb,项目名称:billow,代码行数:48,代码来源:RDSInstance.java


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