本文整理汇总了Java中org.jclouds.aws.AWSResponseException类的典型用法代码示例。如果您正苦于以下问题:Java AWSResponseException类的具体用法?Java AWSResponseException怎么用?Java AWSResponseException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AWSResponseException类属于org.jclouds.aws包,在下文中一共展示了AWSResponseException类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createPlacementGroupInRegion
import org.jclouds.aws.AWSResponseException; //导入依赖的package包/类
private void createPlacementGroupInRegion(String region, String name) {
checkNotNull(region, "region");
checkNotNull(name, "name");
logger.debug(">> creating placementGroup region(%s) name(%s)", region, name);
try {
ec2Api.getPlacementGroupApi().get().createPlacementGroupInRegion(region, name);
logger.debug("<< created placementGroup(%s)", name);
checkState(placementGroupAvailable.apply(new PlacementGroup(region, name, "cluster", State.PENDING)), String
.format("placementGroup region(%s) name(%s) failed to become available", region, name));
} catch (AWSResponseException e) {
if (e.getError().getCode().equals("InvalidPlacementGroup.Duplicate")) {
logger.debug("<< reused placementGroup(%s)", name);
} else {
throw e;
}
}
}
示例2: testDescribeSpotRequestsInRegionFilterInvalid
import org.jclouds.aws.AWSResponseException; //导入依赖的package包/类
@Test(expectedExceptions = AWSResponseException.class)
public void testDescribeSpotRequestsInRegionFilterInvalid() {
for (String region : Region.DEFAULT_REGIONS) {
SortedSet<SpotInstanceRequest> allResults = ImmutableSortedSet.copyOf(client.getSpotInstanceApi().get()
.describeSpotInstanceRequestsInRegion(region));
assertNotNull(allResults);
if (allResults.size() >= 1) {
SpotInstanceRequest request = allResults.last();
SortedSet<SpotInstanceRequest> result = ImmutableSortedSet.copyOf(client.getSpotInstanceApi().get()
.describeSpotInstanceRequestsInRegionWithFilter(region,
ImmutableMultimap.<String, String>builder()
.put("invalid-filter", request.getId()).build()));
}
}
}
示例3: testPublicWriteOnObject
import org.jclouds.aws.AWSResponseException; //导入依赖的package包/类
@Override
@Test
public void testPublicWriteOnObject() throws InterruptedException,
ExecutionException, TimeoutException, IOException {
try {
super.testPublicWriteOnObject();
Fail.failBecauseExceptionWasNotThrown(AWSResponseException.class);
} catch (AWSResponseException are) {
assertThat(are.getError().getCode()).isEqualTo("NotImplemented");
throw new SkipException("public-read-write-acl not supported", are);
}
}
示例4: testUpdateObjectACL
import org.jclouds.aws.AWSResponseException; //导入依赖的package包/类
@Override
@Test
public void testUpdateObjectACL() throws InterruptedException,
ExecutionException, TimeoutException, IOException {
try {
super.testUpdateObjectACL();
Fail.failBecauseExceptionWasNotThrown(AWSResponseException.class);
} catch (AWSResponseException are) {
assertThat(are.getError().getCode()).isEqualTo("NotImplemented");
throw new SkipException("XML ACLs not supported", are);
}
}
示例5: testUpdateBucketACL
import org.jclouds.aws.AWSResponseException; //导入依赖的package包/类
@Override
@Test
public void testUpdateBucketACL() throws Exception {
try {
super.testUpdateBucketACL();
Fail.failBecauseExceptionWasNotThrown(AWSResponseException.class);
} catch (AWSResponseException are) {
assertThat(are.getError().getCode()).isEqualTo("NotImplemented");
throw new SkipException("XML ACLs not supported", are);
}
}
示例6: testBucketPayer
import org.jclouds.aws.AWSResponseException; //导入依赖的package包/类
@Override
@Test
public void testBucketPayer() throws Exception {
try {
super.testBucketPayer();
Fail.failBecauseExceptionWasNotThrown(AWSResponseException.class);
} catch (AWSResponseException are) {
assertThat(are.getError().getCode()).isEqualTo("NotImplemented");
throw new SkipException("bucket payer not supported", are);
}
}
示例7: testBucketLogging
import org.jclouds.aws.AWSResponseException; //导入依赖的package包/类
@Override
@Test
public void testBucketLogging() throws Exception {
try {
super.testBucketLogging();
Fail.failBecauseExceptionWasNotThrown(AWSResponseException.class);
} catch (AWSResponseException are) {
assertThat(are.getError().getCode()).isEqualTo("NotImplemented");
throw new SkipException("bucket logging not supported", are);
}
}
示例8: testFilterInvalid
import org.jclouds.aws.AWSResponseException; //导入依赖的package包/类
@Test(expectedExceptions = AWSResponseException.class)
public void testFilterInvalid() {
for (String region : supportedRegions) {
SortedSet<PlacementGroup> allResults = newTreeSet(client.getPlacementGroupApi().get()
.describePlacementGroupsInRegion(region));
assertNotNull(allResults);
if (allResults.size() >= 1) {
PlacementGroup group = allResults.last();
client.getPlacementGroupApi().get()
.describePlacementGroupsInRegionWithFilter(region,
ImmutableMultimap.<String, String>builder()
.put("invalid-filter", group.getName()).build());
}
}
}