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

项目:bluegreen-manager    文件:RdsClient.java   
/**
 * Requests deletion of the instance, without creating a final snapshot or deleting any other related
 * snapshots.
 * <p/>
 * Caller must wait for status=deleted or DBInstanceNotFoundException afterwards.
 */
public DBInstance deleteInstance(String instanceName)
{
  LOGGER.debug("deleteDBInstance(instanceName: " + instanceName + ")");
  StopWatch stopWatch = new StopWatch();
  try
  {
    stopWatch.start();
    DeleteDBInstanceRequest request = new DeleteDBInstanceRequest(instanceName);
    request.setSkipFinalSnapshot(true);
    return awsRdsClient.deleteDBInstance(request);
  }
  finally
  {
    stopWatch.stop();
    LOGGER.debug("deleteDBInstance time elapsed: " + stopWatch);
  }
}
项目:director-aws-plugin    文件:RDSProvider.java   
@Override
public void delete(RDSInstanceTemplate template, Collection<String> virtualInstanceIds)
    throws InterruptedException {

  if (virtualInstanceIds.isEmpty()) {
    return;
  }

  for (String virtualInstanceId : virtualInstanceIds) {
    LOG.info(">> Terminating {}", virtualInstanceId);

    DeleteDBInstanceRequest request = new DeleteDBInstanceRequest()
        .withDBInstanceIdentifier(virtualInstanceId);
    if (template.isSkipFinalSnapshot().or(false)) {
      request.setSkipFinalSnapshot(true);
    } else {
      String snapshotIdentifier = String.format("%s-director-final-snapshot-%d",
          virtualInstanceId, System.currentTimeMillis());
      request.setFinalDBSnapshotIdentifier(snapshotIdentifier);
    }

    try {
      DBInstance deletedDbInstance = client.deleteDBInstance(request);
      LOG.info("<< Result {}", deletedDbInstance);
    } catch (DBInstanceNotFoundException e) {
      LOG.warn("<< Instance {} was not found, assuming already deleted", virtualInstanceId);
    }
  }
}
项目:datamung    文件:RdsActivitiesImpl.java   
/**
 * @inheritDoc
 */
@Override
public void terminateInstance( String instanceName, Identity identity )
{
    AmazonRDS rds =
        ActivityUtils.createClient( AmazonRDSClient.class, identity );
    try
    {
        rds.deleteDBInstance( new DeleteDBInstanceRequest( instanceName ).withSkipFinalSnapshot( true ) );
    }
    catch ( DBInstanceNotFoundException e )
    {
    }
}
项目:obevo    文件:CreateDbInstance.java   
public void delete(String dbInstanceIdentifier) {
    DBInstance dbInstance = client.deleteDBInstance(
            new DeleteDBInstanceRequest(dbInstanceIdentifier).withSkipFinalSnapshot(true)
    );
    System.out.println(dbInstance);
}
项目:cloudml    文件:BeanstalkConnector.java   
public void deleteDBInstance(String dbInstanceIdentifier) {
    DeleteDBInstanceRequest request = new DeleteDBInstanceRequest();
    request.setDBInstanceIdentifier(dbInstanceIdentifier);
    rdsClient.deleteDBInstance(request);

}