Example usage for com.amazonaws.services.cloudformation.model DescribeStackSetOperationResult getStackSetOperation

List of usage examples for com.amazonaws.services.cloudformation.model DescribeStackSetOperationResult getStackSetOperation

Introduction

In this page you can find the example usage for com.amazonaws.services.cloudformation.model DescribeStackSetOperationResult getStackSetOperation.

Prototype


public StackSetOperation getStackSetOperation() 

Source Link

Document

The specified stack set operation.

Usage

From source file:de.taimos.pipeline.aws.cloudformation.stacksets.CloudFormationStackSet.java

License:Apache License

DescribeStackSetOperationResult waitForOperationToComplete(String operationId, long pollInterval)
        throws InterruptedException {
    this.listener.getLogger().println("Waiting on operationId=" + operationId);
    DescribeStackSetOperationResult result = describeStackOperation(operationId);
    this.listener.getLogger()
            .println("operationId=" + operationId + " status=" + result.getStackSetOperation().getStatus());
    switch (StackSetOperationStatus.fromValue(result.getStackSetOperation().getStatus())) {
    case RUNNING:
        Thread.sleep(pollInterval);
        return waitForOperationToComplete(operationId, pollInterval);
    case SUCCEEDED:
        this.listener.getLogger().println("Stack set operation completed successfully");
        return result;
    case FAILED://from  ww  w. ja  va  2s. co  m
        this.listener.getLogger().println("Stack set operation completed failed");
        throw new StackSetOperationFailedException(operationId);
    default:
        throw new IllegalStateException("Invalid stack set state=" + result.getStackSetOperation().getStatus());
    }
}