本文整理匯總了Java中com.amazonaws.services.cloudformation.model.Capability類的典型用法代碼示例。如果您正苦於以下問題:Java Capability類的具體用法?Java Capability怎麽用?Java Capability使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Capability類屬於com.amazonaws.services.cloudformation.model包,在下文中一共展示了Capability類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createChangeSet
import com.amazonaws.services.cloudformation.model.Capability; //導入依賴的package包/類
public String createChangeSet(String changeSetName, String stackName, ChangeSetType changeSetType,
String templateBody, Collection<Parameter> parameters) {
LOG.info("Creating change set for stack {} with name {}, type {} and parameters {}", stackName, changeSetName,
changeSetType, parameters);
final CreateChangeSetRequest changeSetRequest = new CreateChangeSetRequest() //
.withCapabilities(Capability.CAPABILITY_IAM) //
.withStackName(stackName) //
.withDescription(stackName) //
.withChangeSetName(changeSetName) //
.withChangeSetType(changeSetType) //
.withParameters(parameters).withTemplateBody(templateBody);
final CreateChangeSetResult result = cloudFormation.createChangeSet(changeSetRequest);
LOG.info("Change set created: {}", result);
return result.getId();
}
示例2: addConfiguredCapability
import com.amazonaws.services.cloudformation.model.Capability; //導入依賴的package包/類
/**
* Allows you to add any number of nested preconfigured Capability elements.
* Will warn you if the Capability is not supported by our model, but will
* still try to execute.
*
* @param capability
* a preconfigured Capability object.
*/
public void addConfiguredCapability(StackCapability capability) {
String toAdd = capability.getValue();
try {
Capability.fromValue(toAdd);
} catch (IllegalArgumentException e) {
System.out
.println("The capability "
+ toAdd
+ " does not seem to be in our model. If this build fails, this may be why.");
} finally {
capabilities.add(toAdd);
}
}