Example usage for com.amazonaws.services.rds.model DBInstance getEngineVersion

List of usage examples for com.amazonaws.services.rds.model DBInstance getEngineVersion

Introduction

In this page you can find the example usage for com.amazonaws.services.rds.model DBInstance getEngineVersion.

Prototype


public String getEngineVersion() 

Source Link

Document

Indicates the database engine version.

Usage

From source file:com.airbnb.billow.RDSInstance.java

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 {//from  w ww .j  av  a 2s .c  o m
        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());
    }
}

From source file:com.AWSManagementAntTask.dao.RDSDao.java

public AWSMATDto find() {

    List<IAWSDto> dtolist = new ArrayList<IAWSDto>();
    for (DBInstance res : rds.describeDBInstances().getDBInstances()) {
        RDSDto dto = new RDSDto();
        dto.setRegionName(this.dto.getRegionName());
        dto.setDBInstanceIdentifier(res.getDBInstanceIdentifier());
        dto.setDBName(res.getDBName());/*from  ww  w  .  j a  va2 s  .co m*/
        dto.setDBInstanceStatus(res.getDBInstanceStatus());
        dto.setInstanceCreateTime(res.getInstanceCreateTime());
        dto.setEngine(res.getEngine());
        dto.setEngineVersion(res.getEngineVersion());
        dto.setLicenseModel(res.getLicenseModel());
        dto.setStorageType(res.getStorageType());
        dto.setAllocatedStorage(res.getAllocatedStorage());
        dto.setDBInstanceClass(res.getDBInstanceClass());
        dto.setMasterUsername(res.getMasterUsername());
        dtolist.add(dto);
    }
    this.dto.setRdslist(dtolist);
    return this.dto;
}

From source file:com.hangum.tadpole.aws.rds.commons.core.utils.AmazonRDSUtsils.java

License:Open Source License

/**
 * Get RDS to Tadpole UserDB data./*ww  w.j av a 2  s.  c  o  m*/
 * 
 * @param accessKey
 * @param secretKey
 * @param regionName
 * @return 
 * @throws Exception
 */
public static List<AWSRDSUserDBDAO> getDBList(String accessKey, String secretKey, String regionName)
        throws Exception {
    List<AWSRDSUserDBDAO> returnDBList = new ArrayList<AWSRDSUserDBDAO>();

    try {
        BasicAWSCredentials awsCredential = new BasicAWSCredentials(accessKey, secretKey);
        AmazonRDSClient rdsClient = new AmazonRDSClient(awsCredential);
        rdsClient.setRegion(RegionUtils.getRegion(regionName));

        DescribeDBInstancesResult describeDBInstance = rdsClient.describeDBInstances();
        List<DBInstance> listDBInstance = describeDBInstance.getDBInstances();
        for (DBInstance rdsDbInstance : listDBInstance) {
            AWSRDSUserDBDAO rdsUserDB = new AWSRDSUserDBDAO();

            // rds information
            rdsUserDB.setAccessKey(accessKey);
            rdsUserDB.setSecretKey(secretKey);
            rdsUserDB.setEndPoint(regionName);

            // ext information
            rdsUserDB.setExt1(rdsDbInstance.getDBInstanceClass());
            rdsUserDB.setExt2(rdsDbInstance.getAvailabilityZone());

            // db information
            String strDBMStype = rdsDbInstance.getEngine();
            if (strDBMStype.startsWith("sqlserver")) {
                String strEngVer = rdsDbInstance.getEngineVersion();
                //               if(strEngVer.startsWith("11")) 
                //               else strDBMStype = "MSSQL_8_LE";

                strDBMStype = DBDefine.MSSQL_DEFAULT.getDBToString();
            } else if (strDBMStype.startsWith("oracle")) {
                strDBMStype = DBDefine.ORACLE_DEFAULT.getDBToString();
            }

            rdsUserDB.setDbms_types(DBDefine.getDBDefine(strDBMStype).getDBToString());
            rdsUserDB.setDisplay_name(
                    rdsDbInstance.getDBInstanceIdentifier() + "." + rdsDbInstance.getAvailabilityZone());
            rdsUserDB.setOperation_type(DBOperationType.DEVELOP.toString());
            rdsUserDB.setDb(rdsDbInstance.getDBInstanceIdentifier());//getDBName());
            rdsUserDB.setHost(rdsDbInstance.getEndpoint().getAddress());
            rdsUserDB.setPort("" + rdsDbInstance.getEndpoint().getPort());
            rdsUserDB.setLocale(
                    rdsDbInstance.getCharacterSetName() == null ? "" : rdsDbInstance.getCharacterSetName());
            rdsUserDB.setUsers(rdsDbInstance.getMasterUsername());
            rdsUserDB.setPasswd("");

            returnDBList.add(rdsUserDB);
        }
    } catch (Exception e) {
        throw e;
    }

    return returnDBList;
}

From source file:com.jaspersoft.jasperserver.war.amazon.client.AwsDataSourceServiceImpl.java

License:Open Source License

private List<AwsDBInstanceDTO> toRDSInstancesDTOs(List<DBInstance> dbInstances, String amazonDBService) {
    List<AwsDBInstanceDTO> awsDBInstanceDTOs = new ArrayList<AwsDBInstanceDTO>();
    if (dbInstances != null && dbInstances.size() > 0) {
        for (DBInstance dbInstance : dbInstances) {
            if (dbInstance.getDBInstanceStatus().toLowerCase().equals(awsDataSourceActiveStatus)) {
                AwsDBInstanceDTO awsDBInstanceDTO = new AwsDBInstanceDTO();
                awsDBInstanceDTO.setdBInstanceIdentifier(dbInstance.getDBInstanceIdentifier());
                awsDBInstanceDTO.setdBName(dbInstance.getDBName());
                awsDBInstanceDTO.setEngine(dbInstance.getEngine());
                awsDBInstanceDTO.setEngineVersion(dbInstance.getEngineVersion());
                awsDBInstanceDTO.setAddress(dbInstance.getEndpoint().getAddress());
                awsDBInstanceDTO.setPort(dbInstance.getEndpoint().getPort());
                awsDBInstanceDTO.setAmazonDbService(amazonDBService.toLowerCase());

                updateWithConnectionUrl(awsDBInstanceDTO);

                awsDBInstanceDTOs.add(awsDBInstanceDTO);
            }/*from  w  w w  . j a v  a  2  s  . c om*/
        }
    } else {
        return generateDBServiceInfoStatus(amazonDBService, "resource.dataSource.aws.empty");
    }
    return awsDBInstanceDTOs;
}

From source file:com.msi.tough.rdsquery.RDSQueryUtil.java

public static void marshalDBInstance(XMLNode parent, DBInstance dbInstance) {
    XMLNode n = new XMLNode(RDS_Constants.NODE_DBINSTANCE);
    parent.addNode(n);/*from ww  w .  jav a  2  s. co m*/

    QueryUtil.addNode(n, RDS_Constants.NODE_ALLOCATEDSTORAGE, "" + dbInstance.getAllocatedStorage());
    QueryUtil.addNode(n, RDS_Constants.NODE_AUTOMINORVERSIONUPGRADE, dbInstance.getAutoMinorVersionUpgrade());
    QueryUtil.addNode(n, RDS_Constants.NODE_AVAILABILITYZONE, dbInstance.getAvailabilityZone());
    QueryUtil.addNode(n, RDS_Constants.NODE_BACKUPRETENTIONPERIOD, dbInstance.getBackupRetentionPeriod());
    QueryUtil.addNode(n, RDS_Constants.NODE_DBINSTANCECLASS, dbInstance.getDBInstanceClass());
    QueryUtil.addNode(n, RDS_Constants.NODE_DBINSTANCEIDENTIFIER, dbInstance.getDBInstanceIdentifier());
    QueryUtil.addNode(n, RDS_Constants.NODE_DBNAME, dbInstance.getDBName());
    QueryUtil.addNode(n, RDS_Constants.NODE_DBINSTANCESTATUS, dbInstance.getDBInstanceStatus());

    RDSQueryUtil.marshalDBParameterGroupStatus(n, dbInstance);
    RDSQueryUtil.marshalDBSecurityGroups(n, dbInstance);
    RDSQueryUtil.marshalEndpoint(n, dbInstance);

    QueryUtil.addNode(n, RDS_Constants.NODE_ENGINE, dbInstance.getEngine().toLowerCase());
    QueryUtil.addNode(n, RDS_Constants.NODE_ENGINEVERSION, dbInstance.getEngineVersion());
    QueryUtil.addNode(n, RDS_Constants.INSTANCE_CREATETIME, dbInstance.getInstanceCreateTime());
    QueryUtil.addNode(n, RDS_Constants.NODE_LICENSEMODEL, dbInstance.getLicenseModel());
    QueryUtil.addNode(n, RDS_Constants.NODE_LATESTRESTORABLETIME, dbInstance.getLatestRestorableTime());
    QueryUtil.addNode(n, RDS_Constants.NODE_MULTIAZ, dbInstance.getMultiAZ());

    RDSQueryUtil.marshalPendingModifiedValues(n, dbInstance.getPendingModifiedValues());

    QueryUtil.addNode(n, RDS_Constants.PREFERREDBACKUPWINDOW, dbInstance.getPreferredBackupWindow());
    QueryUtil.addNode(n, RDS_Constants.NODE_PREFERREDMAINTENANCEWINDOW,
            dbInstance.getPreferredMaintenanceWindow());

    RDSQueryUtil.marshalReadReplicaDBInstanceIdentifiers(n, dbInstance.getReadReplicaDBInstanceIdentifiers());

    QueryUtil.addNode(n, RDS_Constants.NODE_READREPLICASOURCEDBINSTANCEIDENTIFIER,
            dbInstance.getReadReplicaSourceDBInstanceIdentifier());

    QueryUtil.addNode(n, RDS_Constants.NODE_MASTERUSERNAME, dbInstance.getMasterUsername());

}