作者热门文章
- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.jclouds.cloudstack.predicates.ZonePredicates.supportsSecurityGroups()
方法的一些代码示例,展示了ZonePredicates.supportsSecurityGroups()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZonePredicates.supportsSecurityGroups()
方法的具体详情如下:
包路径:org.jclouds.cloudstack.predicates.ZonePredicates
类名称:ZonePredicates
方法名:supportsSecurityGroups
暂无
代码示例来源:origin: apache/jclouds
private void cleanupOrphanedSecurityGroupsInZone(Set<String> groups, String zoneId) {
Zone zone = zoneIdToZone.get().getUnchecked(zoneId);
if (supportsSecurityGroups().apply(zone)) {
for (String group : groups) {
for (SecurityGroup securityGroup : Iterables.filter(client.getSecurityGroupApi().listSecurityGroups(),
SecurityGroupPredicates.nameMatches(namingConvention.create().containsGroup(group)))) {
ZoneAndName zoneAndName = ZoneAndName.fromZoneAndName(zoneId, securityGroup.getName());
logger.debug(">> deleting securityGroup(%s)", zoneAndName);
client.getSecurityGroupApi().deleteSecurityGroup(securityGroup.getId());
// TODO: test this clear happens
securityGroupMap.invalidate(zoneAndName);
logger.debug("<< deleted securityGroup(%s)", zoneAndName);
}
}
}
}
代码示例来源:origin: apache/jclouds
@Test
public void testSupportsSecurityGroups() {
assertTrue(supportsSecurityGroups().apply(
Zone.builder().id("43").securityGroupsEnabled(true).build()
));
assertFalse(supportsSecurityGroups().apply(
Zone.builder().id("44").securityGroupsEnabled(false).build()
));
}
代码示例来源:origin: jclouds/legacy-jclouds
@Test
public void testSupportsSecurityGroups() {
assertTrue(supportsSecurityGroups().apply(
Zone.builder().id("43").securityGroupsEnabled(true).build()
));
assertFalse(supportsSecurityGroups().apply(
Zone.builder().id("44").securityGroupsEnabled(false).build()
));
}
代码示例来源:origin: apache/jclouds
@Override
public SecurityGroup apply(ZoneSecurityGroupNamePortsCidrs input) {
checkNotNull(input, "input");
String zoneId = input.getZone();
Zone zone = zoneIdToZone.get().getUnchecked(zoneId);
checkArgument(supportsSecurityGroups().apply(zone),
"Security groups are required, but the zone %s does not support security groups", zoneId);
logger.debug(">> creating securityGroup %s", input);
try {
SecurityGroup securityGroup = client.getSecurityGroupApi().createSecurityGroup(input.getName());
logger.debug("<< created securityGroup(%s)", securityGroup);
ImmutableSet<String> cidrs;
if (!input.getCidrs().isEmpty()) {
cidrs = ImmutableSet.copyOf(input.getCidrs());
} else {
cidrs = ImmutableSet.of("0.0.0.0/0");
}
for (int port : input.getPorts()) {
authorizeGroupToItselfAndToTCPPortAndCidr(client, securityGroup, port, cidrs);
}
return securityGroup;
} catch (IllegalStateException e) {
logger.trace("<< trying to find securityGroup(%s): %s", input, e.getMessage());
SecurityGroup group = client.getSecurityGroupApi().getSecurityGroupByName(input.getName());
logger.debug("<< reused securityGroup(%s)", group.getId());
return group;
}
}
代码示例来源:origin: apache/jclouds
if (supportsSecurityGroups().apply(zone)) {
List<Integer> inboundPorts = Ints.asList(templateOptions.getInboundPorts());
本文整理了Java中org.jclouds.cloudstack.predicates.ZonePredicates.supportsSecurityGroups()方法的一些代码示例,展示了Zone
我是一名优秀的程序员,十分优秀!