com.amazonaws.services.elasticbeanstalk.model.DescribeEnvironmentsResult Java Examples

The following examples show how to use com.amazonaws.services.elasticbeanstalk.model.DescribeEnvironmentsResult. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TestSuccessfulBeanstalkDeploymentTask.java    From aws-ant-tasks with Apache License 2.0 6 votes vote down vote up
public void execute() {
    checkParams();
    AWSElasticBeanstalkClient bcClient = getOrCreateClient(AWSElasticBeanstalkClient.class);
    DescribeEnvironmentsRequest deRequest = new DescribeEnvironmentsRequest()
            .withEnvironmentNames(environmentName);
    DescribeEnvironmentsResult result = bcClient
            .describeEnvironments(deRequest);
    if (result.getEnvironments().size() < 1) {
        throw new BuildException(
                "No environments found with the specified name "
                        + environmentName);
    }
    try {
        AWSTestUtils.waitForEnvironmentToTransitionToStateAndHealth(
                environmentName, EnvironmentStatus.Ready, null, bcClient);
    } catch (InterruptedException e) {
        throw new BuildException(e.getMessage());
    }
}