当前位置: 首页>>代码示例>>Java>>正文


Java TerminateEnvironmentRequest类代码示例

本文整理汇总了Java中com.amazonaws.services.elasticbeanstalk.model.TerminateEnvironmentRequest的典型用法代码示例。如果您正苦于以下问题:Java TerminateEnvironmentRequest类的具体用法?Java TerminateEnvironmentRequest怎么用?Java TerminateEnvironmentRequest使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TerminateEnvironmentRequest类属于com.amazonaws.services.elasticbeanstalk.model包,在下文中一共展示了TerminateEnvironmentRequest类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: tearDown

import com.amazonaws.services.elasticbeanstalk.model.TerminateEnvironmentRequest; //导入依赖的package包/类
@After
public void tearDown() throws InterruptedException {
	bcClient.terminateEnvironment(new TerminateEnvironmentRequest()
			.withEnvironmentName(TEST_ENVIRONMENTNAME));
	AWSTestUtils.waitForEnvironmentToTransitionToStateAndHealth(
			TEST_ENVIRONMENTNAME, EnvironmentStatus.Terminated, null,
			bcClient);
	bcClient.deleteApplication(new DeleteApplicationRequest(TEST_APPNAME));
	while (true) {
		DescribeApplicationsResult appResult = bcClient
				.describeApplications();
		boolean appNameFound = false;
		for (ApplicationDescription appdesc : appResult.getApplications()) {
			if (appdesc.getApplicationName().equals(TEST_APPNAME)) {
				appNameFound = true;
				break;
			}
		}
		if (!appNameFound) {
			break;
		}
	}
}
 
开发者ID:awslabs,项目名称:aws-ant-tasks,代码行数:24,代码来源:DeployAppToBeanstalkTests.java

示例2: terminate

import com.amazonaws.services.elasticbeanstalk.model.TerminateEnvironmentRequest; //导入依赖的package包/类
/**
 * Terminate environment.
 */
public void terminate() {
    if (!this.stable()) {
        throw new DeploymentException(
            String.format(
                "env '%s' is not stable, can't terminate",
                this.eid
            )
        );
    }
    if (!this.terminated()) {
        final TerminateEnvironmentResult res =
            this.client.terminateEnvironment(
                new TerminateEnvironmentRequest()
                    .withEnvironmentId(this.eid)
                    .withTerminateResources(true)
            );
        Logger.info(
            this,
            "Environment '%s/%s/%s' is terminated (label:'%s', status:%s)",
            res.getApplicationName(), res.getEnvironmentName(),
            res.getEnvironmentId(),
            res.getVersionLabel(), res.getStatus()
        );
    }
}
 
开发者ID:jcabi,项目名称:jcabi-beanstalk-maven-plugin,代码行数:29,代码来源:Environment.java

示例3: execute

import com.amazonaws.services.elasticbeanstalk.model.TerminateEnvironmentRequest; //导入依赖的package包/类
public void execute() {
    System.out
            .println("Terminating environment " + environmentName + "...");
    checkParams();
    AWSElasticBeanstalkClient bcClient = getOrCreateClient(AWSElasticBeanstalkClient.class);
    try {
        bcClient.terminateEnvironment(new TerminateEnvironmentRequest()
                .withEnvironmentName(environmentName));
    } catch (Exception e) {
        throw new BuildException("Could not terminate environment "
                + e.getMessage(), e);
    }
    System.out
            .println("The request to terminate the environment has been submitted.");
}
 
开发者ID:awslabs,项目名称:aws-ant-tasks,代码行数:16,代码来源:TerminateBeanstalkEnvironmentTask.java

示例4: terminateEnvironment

import com.amazonaws.services.elasticbeanstalk.model.TerminateEnvironmentRequest; //导入依赖的package包/类
public void terminateEnvironment(String envName) {
    TerminateEnvironmentRequest tr = new TerminateEnvironmentRequest();
    tr.setEnvironmentName(envName);
    beanstalkClient.terminateEnvironment(tr);
}
 
开发者ID:SINTEF-9012,项目名称:cloudml,代码行数:6,代码来源:BeanstalkConnector.java

示例5: createsNewEnvironment

import com.amazonaws.services.elasticbeanstalk.model.TerminateEnvironmentRequest; //导入依赖的package包/类
/**
 * Application can create a new environment.
 * @throws Exception If something is wrong
 */
@Test
public void createsNewEnvironment() throws Exception {
    final String name = "some-app-name";
    final String template = "some-template";
    final Version version = Mockito.mock(Version.class);
    final AWSElasticBeanstalk ebt = Mockito.mock(AWSElasticBeanstalk.class);
    Mockito.doReturn(
        new CheckDNSAvailabilityResult().withAvailable(true)
    ).when(ebt)
        .checkDNSAvailability(
            Mockito.any(CheckDNSAvailabilityRequest.class)
        );
    Mockito.doReturn(
        new CreateEnvironmentResult()
            .withApplicationName(name)
            .withEnvironmentId("f4g5h6j7")
            .withEnvironmentName(name)
    ).when(ebt)
        .createEnvironment(
            Mockito.any(CreateEnvironmentRequest.class)
        );
    Mockito.doReturn(
        new DescribeConfigurationSettingsResult().withConfigurationSettings(
            new ArrayList<ConfigurationSettingsDescription>(0)
        )
    ).when(ebt)
        .describeConfigurationSettings(
            Mockito.any(DescribeConfigurationSettingsRequest.class)
        );
    Mockito.doReturn(
        new DescribeEnvironmentsResult().withEnvironments(
            Arrays.asList(
                new EnvironmentDescription()
                    .withCNAME("")
                    .withEnvironmentName("some-env")
                    .withEnvironmentId("a1b2c3d4")
                    .withStatus("Ready")
            )
        )
    ).when(ebt)
        .describeEnvironments(
            Mockito.any(DescribeEnvironmentsRequest.class)
        );
    Mockito.doReturn(new TerminateEnvironmentResult())
        .when(ebt)
        .terminateEnvironment(
            Mockito.any(TerminateEnvironmentRequest.class)
        );
    final Application app = new Application(ebt, name);
    app.clean(false);
    MatcherAssert.assertThat(
        app.candidate(version, template),
        Matchers.notNullValue()
    );
}
 
开发者ID:jcabi,项目名称:jcabi-beanstalk-maven-plugin,代码行数:60,代码来源:ApplicationTest.java


注:本文中的com.amazonaws.services.elasticbeanstalk.model.TerminateEnvironmentRequest类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。