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


Java DBInstance.getDBInstanceIdentifier方法代码示例

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


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

示例1: findSelfNamedParamGroupName

import com.amazonaws.services.rds.model.DBInstance; //导入方法依赖的package包/类
/**
 * Finds the name of the instance's paramgroup whose name embeds the instname, or null if not found.
 * We are assuming there is at most one such paramgroup!
 */
public String findSelfNamedParamGroupName(DBInstance dbInstance)
{
  if (dbInstance != null && CollectionUtils.isNotEmpty(dbInstance.getDBParameterGroups()))
  {
    String instanceName = dbInstance.getDBInstanceIdentifier();
    for (DBParameterGroupStatus paramGroup : dbInstance.getDBParameterGroups())
    {
      String paramGroupName = paramGroup.getDBParameterGroupName();
      if (StringUtils.contains(paramGroupName, instanceName))
      {
        return paramGroup.getDBParameterGroupName();
      }
    }
  }
  return null;
}
 
开发者ID:Nike-Inc,项目名称:bluegreen-manager,代码行数:21,代码来源:RdsAnalyzer.java

示例2: fetchInstanceMetrics

import com.amazonaws.services.rds.model.DBInstance; //导入方法依赖的package包/类
private void fetchInstanceMetrics() throws CandlestackAWSException, CandlestackException {
	Set<String> replicaInstances = RDSUtil.getReplicaInstances( rdsClient );

	DescribeDBInstancesResult dbInstanceResults = rdsClient.describeDBInstances();
	for ( DBInstance dbInstance : dbInstanceResults.getDBInstances() ) {

		String dbInstanceId = dbInstance.getDBInstanceIdentifier();
		RDSType rdsType = RDSType.getTypeFromEngine( dbInstance.getEngine() );
		if ( !RDSUtil.isDBInstanceEligible( dbInstanceId, dbInstancePrefix, dbInstanceRegex, rdsType ) ) {
			continue;
		}

		for ( RDSCloudWatchMetric cloudWatchMetric : cloudWatchMetrics ) {
			if ( cloudWatchMetric.isRDSTypeSupported( rdsType ) && !cloudWatchMetric.isClusterOnlyMetric() && ( !cloudWatchMetric.isReplicaOnlyMetric() || replicaInstances.contains( dbInstanceId ) ) ) {
				cloudWatchAccessor.lookupAndSaveMetricData( cloudWatchMetric, dbInstanceId, RDSUtil.TYPE_NAME );
			}
		}

	}
}
 
开发者ID:CodeArcsInc,项目名称:candlestack,代码行数:21,代码来源:RDSMetricsFetcher.java

示例3: waitTilInstanceIsDeleted

import com.amazonaws.services.rds.model.DBInstance; //导入方法依赖的package包/类
/**
 * Creates a Waiter and returns when the instance is fully deleted.
 */
private void waitTilInstanceIsDeleted(DBInstance initialInstance)
{
  LOGGER.info(context() + "Waiting for instance to be deleted");
  RdsInstanceProgressChecker progressChecker = new RdsInstanceProgressChecker(initialInstance.getDBInstanceIdentifier(),
      context(), rdsClient, initialInstance, RdsInstanceStatus.DELETING);
  Waiter<DBInstance> waiter = new Waiter(waiterParameters, threadSleeper, progressChecker);
  DBInstance dbInstance = waiter.waitTilDone();
  if (dbInstance == null)
  {
    throw new RuntimeException(context() + progressChecker.getDescription() + " was not deleted");
  }
}
 
开发者ID:Nike-Inc,项目名称:bluegreen-manager,代码行数:16,代码来源:RdsInstanceDeleteTask.java

示例4: checkInstanceId

import com.amazonaws.services.rds.model.DBInstance; //导入方法依赖的package包/类
/**
 * Asserts that the instance has the expected id.
 */
private void checkInstanceId(DBInstance dbInstance)
{
  final String responseInstanceId = dbInstance.getDBInstanceIdentifier();
  if (!StringUtils.equals(instanceId, responseInstanceId))
  {
    throw new IllegalStateException(logContext + "We requested instance id '" + instanceId
        + "' but RDS replied with identifier '" + responseInstanceId + "'");
  }
}
 
开发者ID:Nike-Inc,项目名称:bluegreen-manager,代码行数:13,代码来源:RdsInstanceProgressChecker.java

示例5: lookupHostsToMonitor

import com.amazonaws.services.rds.model.DBInstance; //导入方法依赖的package包/类
@Override
public List<HostGroup> lookupHostsToMonitor() throws CandlestackException {

	// Initialize the host groups array
	List<HostGroup> hostGroups = new ArrayList<>();

	// Check for clusters and create a hostgroup for them
	Map<String, HostGroup> clusterGroups = lookupClusterGroups();

	// Create a host group for non clustered instances
	HostGroup nonClusterHostGroup = new HostGroup( "aws_rds_non_cluster", "AWS RDS Non-Clustered Instances" );

	// Figure out the minimum launch age for the instance to monitored
	Date minLaunchAge = new Date( System.currentTimeMillis() - newResourceMonitorDelayMillis );

	// Get the DB instances and add them to the correct host group
	Set<String> replicaInstances = RDSUtil.getReplicaInstances( rdsClient );
	DescribeDBInstancesResult dbInstanceResults = rdsClient.describeDBInstances();
	for ( DBInstance dbInstance : dbInstanceResults.getDBInstances() ) {

		// Make sure the DB instance is eligible
		String dbInstanceId = dbInstance.getDBInstanceIdentifier();
		RDSType rdsType = RDSType.getTypeFromEngine( dbInstance.getEngine() );
		if ( !RDSUtil.isDBInstanceEligible( dbInstanceId, dbInstancePrefix, dbInstanceRegex, rdsType ) ) {
			continue;
		}

		// Make sure the DB instance is old enough to be monitored
		if ( minLaunchAge.before( dbInstance.getInstanceCreateTime() ) ) {
			continue;
		}

		// Figure out the correct host group
		HostGroup applicableHostGroup = clusterGroups.get( dbInstanceId );
		if ( applicableHostGroup == null ) {
			applicableHostGroup = nonClusterHostGroup;
		}

		// Add the instance to the host group
		applicableHostGroup.addHost( createHostForDBInstance( dbInstance, rdsType, replicaInstances.contains( dbInstance.getDBInstanceIdentifier() ) ) );

	}

	// Check to see if the non cluster group has any instances
	if ( !nonClusterHostGroup.getHosts().isEmpty() ) {
		hostGroups.add( nonClusterHostGroup );
	}

	// Check the cluster groups to see if it has any instances
	for ( HostGroup clusterGroup : clusterGroups.values() ) {
		if ( clusterGroup.getHosts().size() > 1 ) {
			hostGroups.add( clusterGroup );
		} else if ( clusterGroup.getHosts().size() == 1 && !clusterGroup.getHosts().get( 0 ).getName().equals( clusterGroup.getName() ) ) {
			hostGroups.add( clusterGroup );
		}
	}

	return hostGroups;

}
 
开发者ID:CodeArcsInc,项目名称:candlestack,代码行数:61,代码来源:RDSHostMonitorLookup.java

示例6: getPropertyValue

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

示例7: 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

示例8: addDBInstance

import com.amazonaws.services.rds.model.DBInstance; //导入方法依赖的package包/类
public void addDBInstance(DBInstance rds) throws CfnAssistException {
	String rdsId = rds.getDBInstanceIdentifier();
	String label = AmazonVPCFacade.createLabelFromNameAndID(rdsId, rds.getDBName());
	networkDiagram.addDBInstance(rdsId, label);
	securityDiagram.addDBInstance(rdsId, label);
}
 
开发者ID:cartwrightian,项目名称:cfnassist,代码行数:7,代码来源:VPCDiagramBuilder.java

示例9: createHostForDBInstance

import com.amazonaws.services.rds.model.DBInstance; //导入方法依赖的package包/类
private Host createHostForDBInstance( DBInstance dbInstance, RDSType rdsType, boolean isReplica ) throws CandlestackPropertiesException {

		Host host = new Host( dbInstance.getDBInstanceIdentifier(), "", dbInstance.getEndpoint().getAddress(), contactGroups );

		for ( RDSCloudWatchMetric metric : cloudWatchMetrics ) {
			if ( metric.isRDSTypeSupported( rdsType ) && !metric.isClusterOnlyMetric() && ( !metric.isReplicaOnlyMetric() || isReplica ) ) {
				host.addService( metric.getService( dbInstance.getDBInstanceIdentifier(), contactGroups ) );
			}
		}

		return host;

	}
 
开发者ID:CodeArcsInc,项目名称:candlestack,代码行数:14,代码来源:RDSHostMonitorLookup.java

示例10: checkInstanceIsManagedByDirector

import com.amazonaws.services.rds.model.DBInstance; //导入方法依赖的package包/类
/**
 * Performs a sequence of strict instance ownership checks to avoid any potential harmful
 * accidents.
 *
 * @param instance the instance
 * @param template the template from which the instance was created, or <code>null</code>
 *                 if it is unknown (such as during a delete call)
 * @return the virtual instance ID
 */
@SuppressWarnings("PMD.UnusedFormalParameter")
private String checkInstanceIsManagedByDirector(DBInstance instance,
    RDSInstanceTemplate template) {
  // TODO perform any desired tag validation
  return instance.getDBInstanceIdentifier();
}
 
开发者ID:cloudera,项目名称:director-aws-plugin,代码行数:16,代码来源:RDSProvider.java


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