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

The following examples show how to use com.amazonaws.services.elasticbeanstalk.model.EnvironmentDescription. 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: AWSTestUtils.java    From aws-ant-tasks with Apache License 2.0 5 votes vote down vote up
public static void waitForEnvironmentToTransitionToStateAndHealth(
        String environmentName, EnvironmentStatus state,
        EnvironmentHealth health, AWSElasticBeanstalkClient bcClient)
        throws InterruptedException {
    System.out.println("Waiting for instance " + environmentName
            + " to transition to " + state + "/" + health);

    int count = 0;
    while (true) {
        Thread.sleep(1000 * 30);
        if (count++ > 100) {
            throw new RuntimeException("Environment " + environmentName
                    + " never transitioned to " + state + "/" + health);
        }

        List<EnvironmentDescription> environments = bcClient
                .describeEnvironments(
                        new DescribeEnvironmentsRequest()
                                .withEnvironmentNames(environmentName))
                .getEnvironments();

        if (environments.size() == 0) {
            System.out
                    .println("No environments with that name were found.");
            return;
        }

        EnvironmentDescription environment = environments.get(0);
        System.out.println(" - " + environment.getStatus() + "/"
                + environment.getHealth());
        if (environment.getStatus().equalsIgnoreCase(state.toString()) == false)
            continue;
        if (health != null
                && environment.getHealth().equalsIgnoreCase(
                        health.toString()) == false)
            continue;
        return;
    }
}
 
Example #2
Source File: EbsVH.java    From pacbot with Apache License 2.0 2 votes vote down vote up
/**
 * Gets the env.
 *
 * @return the env
 */
public EnvironmentDescription getEnv() {
	return env;
}
 
Example #3
Source File: EbsVH.java    From pacbot with Apache License 2.0 2 votes vote down vote up
/**
 * Sets the env.
 *
 * @param env the new env
 */
public void setEnv(EnvironmentDescription env) {
	this.env = env;
}