Example usage for com.amazonaws.services.elasticbeanstalk.model DescribeEnvironmentsRequest setIncludeDeleted

List of usage examples for com.amazonaws.services.elasticbeanstalk.model DescribeEnvironmentsRequest setIncludeDeleted

Introduction

In this page you can find the example usage for com.amazonaws.services.elasticbeanstalk.model DescribeEnvironmentsRequest setIncludeDeleted.

Prototype


public void setIncludeDeleted(Boolean includeDeleted) 

Source Link

Document

Indicates whether to include deleted environments:

true: Environments that have been deleted after IncludedDeletedBackTo are displayed.

Usage

From source file:br.com.ingenieux.mojo.beanstalk.env.DescribeEnvironmentsMojo.java

License:Apache License

@Override
protected Object executeInternal() throws MojoExecutionException, MojoFailureException {
    DescribeEnvironmentsRequest req = new DescribeEnvironmentsRequest();

    req.setApplicationName(applicationName);
    req.setIncludeDeleted(includeDeleted);

    // TODO add environmentNames / environmentIds / includeDeletedBackTo

    DescribeEnvironmentsResult result = getService().describeEnvironments(req);

    if (null != outputFile) {
        getLog().info("Writing results into " + outputFile.getName());

        try {//from  www .  j  a v  a  2s.  co  m
            ObjectMapper objectMapper = new ObjectMapper();

            ObjectWriter writer = objectMapper.writerWithDefaultPrettyPrinter();

            writer.writeValue(outputFile, result.getEnvironments());
        } catch (Exception e) {
            throw new RuntimeException(e);
        }

        return null;
    }

    return result;
}