本文整理汇总了Java中com.amazonaws.services.cloudformation.model.DeleteStackRequest类的典型用法代码示例。如果您正苦于以下问题:Java DeleteStackRequest类的具体用法?Java DeleteStackRequest怎么用?Java DeleteStackRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DeleteStackRequest类属于com.amazonaws.services.cloudformation.model包,在下文中一共展示了DeleteStackRequest类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deleteFailedCreate
import com.amazonaws.services.cloudformation.model.DeleteStackRequest; //导入依赖的package包/类
private void deleteFailedCreate(final String stackName, AmazonCloudFormation cf, int statusPollingIntervalMs) {
{
// delete an application in ROLLBACK_COMPLETE status
ListStacksResult r = cf.listStacks();
r.getStackSummaries() //
.stream() //
.filter(x -> x.getStackName().equals(stackName)) //
.limit(1) //
.filter(x -> StackStatus.ROLLBACK_COMPLETE.toString().equals(x.getStackStatus())) //
.forEach(x -> {
log.info("Deleting stack with status " + x.getStackStatus()); //
cf.deleteStack(new DeleteStackRequest().withStackName(stackName));
waitForCompletion(cf, stackName, statusPollingIntervalMs, log);
});
}
}
示例2: after
import com.amazonaws.services.cloudformation.model.DeleteStackRequest; //导入依赖的package包/类
@Override
protected void after() {
this.cloudFormation.deleteStack(new DeleteStackRequest()
.withStackName(this.stackName));
try {
waitForCompletion();
}
catch (InterruptedException e) {
// Ignore the InterruptedException
}
finally {
System.clearProperty("cloud.aws.credentials.accessKey");
System.clearProperty("cloud.aws.credentials.secretKey");
}
}
开发者ID:spring-cloud,项目名称:spring-cloud-stream-app-starters,代码行数:16,代码来源:AwsIntegrationTestStackRule.java
示例3: removeClusterInfrastructure
import com.amazonaws.services.cloudformation.model.DeleteStackRequest; //导入依赖的package包/类
@Override
public void removeClusterInfrastructure() {
autoScaling.deletePolicy(new DeletePolicyRequest().withAutoScalingGroupName(getAutoScalingGroup().getAutoScalingGroupName()).withPolicyName(SCALE_UP_POLICY));
autoScaling.deletePolicy(new DeletePolicyRequest().withAutoScalingGroupName(getAutoScalingGroup().getAutoScalingGroupName()).withPolicyName(SCALE_DOWN_POLICY));
cloudWatch.deleteAlarms(new DeleteAlarmsRequest().withAlarmNames(ESS_OVERLOAD_ALARM, ESS_IDLE_ALARM));
// CloudWatch metrics are stored for two weeks. Old data will be removed automatically.
amazonSQS.deleteQueue(new DeleteQueueRequest().withQueueUrl(ESS_QUEUE_NAME));
cloudFormation.deleteStack(new DeleteStackRequest().withStackName(SystemUtils.getCloudFormationStackName()));
}
示例4: getStackResources
import com.amazonaws.services.cloudformation.model.DeleteStackRequest; //导入依赖的package包/类
private DescribeStackResourcesResult getStackResources(String stackName) throws InterruptedException, IOException {
try {
DescribeStacksResult describeStacksResult = this.amazonCloudFormationClient.describeStacks(new DescribeStacksRequest().withStackName(stackName));
for (Stack stack : describeStacksResult.getStacks()) {
if (isAvailable(stack)) {
return this.amazonCloudFormationClient.describeStackResources(new DescribeStackResourcesRequest().withStackName(stack.getStackName()));
}
if (isError(stack)) {
if (this.stackCreatedByThisInstance) {
throw new IllegalArgumentException("Could not create stack");
}
this.amazonCloudFormationClient.deleteStack(new DeleteStackRequest().withStackName(stack.getStackName()));
return getStackResources(stackName);
}
if (isInProgress(stack)) {
//noinspection BusyWait
Thread.sleep(5000L);
return getStackResources(stackName);
}
}
} catch (AmazonClientException e) {
String templateBody = FileCopyUtils.copyToString(new InputStreamReader(new ClassPathResource(TEMPLATE_PATH).getInputStream()));
this.amazonCloudFormationClient.createStack(new CreateStackRequest().withTemplateBody(templateBody).withOnFailure(OnFailure.DELETE).
withStackName(stackName).withTags(new Tag().withKey("tag1").withValue("value1")).
withParameters(new Parameter().withParameterKey("RdsPassword").withParameterValue(this.rdsPassword)));
this.stackCreatedByThisInstance = true;
}
return getStackResources(stackName);
}
示例5: execute
import com.amazonaws.services.cloudformation.model.DeleteStackRequest; //导入依赖的package包/类
public void execute() {
checkParams();
AmazonEC2Client ec2Client = getOrCreateClient(AmazonEC2Client.class);
ec2Client
.deleteKeyPair(new DeleteKeyPairRequest().withKeyName(keyName));
AmazonCloudFormationClient cloudFormationClient = getOrCreateClient(AmazonCloudFormationClient.class);
cloudFormationClient.deleteStack(new DeleteStackRequest()
.withStackName(stackName));
}
示例6: deleteNetwork
import com.amazonaws.services.cloudformation.model.DeleteStackRequest; //导入依赖的package包/类
@AfterSuite
@Parameters({ "regionName", "vpcStackName" })
public void deleteNetwork(String regionName, @Optional("it-vpc-stack") String vpcStackName) {
AmazonCloudFormationClient client = new AmazonCloudFormationClient();
client.setRegion(RegionUtils.getRegion(regionName));
client.deleteStack(new DeleteStackRequest().withStackName(vpcStackName));
}
示例7: requestDeletion
import com.amazonaws.services.cloudformation.model.DeleteStackRequest; //导入依赖的package包/类
private void requestDeletion(List<String> deletionList) {
for(String stackName : deletionList) {
DeleteStackRequest request = new DeleteStackRequest();
request.setStackName(stackName);
cfnClient.deleteStack(request);
logger.info("Requested deletion of " + stackName);
}
}
示例8: deleteStack
import com.amazonaws.services.cloudformation.model.DeleteStackRequest; //导入依赖的package包/类
public void deleteStack(String stackName) {
LOG.info("Delete stack '{}'", stackName);
cloudFormation.deleteStack(new DeleteStackRequest().withStackName(stackName));
}
示例9: destroy
import com.amazonaws.services.cloudformation.model.DeleteStackRequest; //导入依赖的package包/类
@Override
public void destroy() throws Exception {
if (this.stackCreatedByThisInstance) {
this.amazonCloudFormationClient.deleteStack(new DeleteStackRequest().withStackName(DEFAULT_STACK_NAME));
}
}
示例10: stackDelete
import com.amazonaws.services.cloudformation.model.DeleteStackRequest; //导入依赖的package包/类
/**
*/
public Stack stackDelete() throws Exception {
final DeleteStackRequest request = new DeleteStackRequest();
request.withStackName(name);
amazonClient.deleteStack(request);
final Stack stack = waitForStackDelete();
return stack;
}
示例11: deleteStack
import com.amazonaws.services.cloudformation.model.DeleteStackRequest; //导入依赖的package包/类
/**
* Deletes an existing stack by name.
*
* @param stackId Stack ID.
*/
public void deleteStack(final String stackId) {
final DeleteStackRequest request = new DeleteStackRequest().withStackName(stackId);
cloudFormationClient.deleteStack(request);
}