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

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

Introduction

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

Prototype


public void setApplicationName(String applicationName) 

Source Link

Document

If specified, AWS Elastic Beanstalk restricts the returned descriptions to include only those that are associated with this application.

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 {/*  w  w w  . j  av  a2s  . 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;
}