Example usage for com.amazonaws.services.rds.model DescribeDBSubnetGroupsRequest DescribeDBSubnetGroupsRequest

List of usage examples for com.amazonaws.services.rds.model DescribeDBSubnetGroupsRequest DescribeDBSubnetGroupsRequest

Introduction

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

Prototype

DescribeDBSubnetGroupsRequest

Source Link

Usage

From source file:com.cloudera.director.aws.rds.RDSInstanceTemplateConfigurationValidator.java

License:Apache License

@VisibleForTesting
void checkDBSubnetGroupName(AmazonRDSClient client, Configured configuration,
        PluginExceptionConditionAccumulator accumulator, LocalizationContext localizationContext) {

    String dbSubnetGroupName = configuration.getConfigurationValue(DB_SUBNET_GROUP_NAME, localizationContext);

    DescribeDBSubnetGroupsRequest request = new DescribeDBSubnetGroupsRequest()
            .withDBSubnetGroupName(dbSubnetGroupName);
    try {/*from ww  w  .  j a v a2  s. c om*/
        client.describeDBSubnetGroups(request);
    } catch (DBSubnetGroupNotFoundException e) {
        addError(accumulator, DB_SUBNET_GROUP_NAME, localizationContext, null, DB_SUBNET_GROUP_NOT_FOUND,
                dbSubnetGroupName);
    } catch (AmazonServiceException e) {
        if (e.getErrorCode().equals(INVALID_PARAMETER_VALUE)) {
            addError(accumulator, DB_SUBNET_GROUP_NAME, localizationContext, null, INVALID_DB_SUBNET_GROUP,
                    dbSubnetGroupName);
        } else {
            throw Throwables.propagate(e);
        }
    }
}