本文整理了Java中org.jclouds.openstack.nova.v2_0.domain.zonescoped.ZoneSecurityGroupNameAndPorts.<init>()
方法的一些代码示例,展示了ZoneSecurityGroupNameAndPorts.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZoneSecurityGroupNameAndPorts.<init>()
方法的具体详情如下:
包路径:org.jclouds.openstack.nova.v2_0.domain.zonescoped.ZoneSecurityGroupNameAndPorts
类名称:ZoneSecurityGroupNameAndPorts
方法名:<init>
暂无
代码示例来源:origin: io.cloudsoft.jclouds.api/openstack-nova
public SecurityGroup createSecurityGroup(String name, String zone) {
String markerGroup = namingConvention.create().sharedNameForGroup(name);
ZoneSecurityGroupNameAndPorts zoneAndName = new ZoneSecurityGroupNameAndPorts(zone, markerGroup, ImmutableSet.<Integer> of());
SecurityGroupInZone rawGroup = groupCreator.apply(zoneAndName);
return groupConverter.apply(rawGroup);
}
代码示例来源:origin: io.cloudsoft.jclouds.api/openstack-nova
@Override
public boolean removeSecurityGroup(String id) {
checkNotNull(id, "id");
ZoneAndId zoneAndId = ZoneAndId.fromSlashEncoded(id);
String zone = zoneAndId.getZone();
String groupId = zoneAndId.getId();
Optional<? extends SecurityGroupApi> sgApi = api.getSecurityGroupExtensionForZone(zone);
if (!sgApi.isPresent()) {
return false;
}
if (sgApi.get().get(groupId) == null) {
return false;
}
sgApi.get().delete(groupId);
// TODO: test this clear happens
groupCreator.invalidate(new ZoneSecurityGroupNameAndPorts(zone, groupId, ImmutableSet.<Integer> of()));
return true;
}
代码示例来源:origin: jclouds/legacy-jclouds
@Test
public void testWhenNotFoundCreatesANewSecurityGroup() throws Exception {
Predicate<AtomicReference<ZoneAndName>> returnSecurityGroupExistsInZone = Predicates.alwaysFalse();
SecurityGroupInZone securityGroupInZone = createMock(SecurityGroupInZone.class);
ZoneSecurityGroupNameAndPorts input = new ZoneSecurityGroupNameAndPorts("zone", "groupName", ImmutableSet
.<Integer> of(22, 8080));
Function<ZoneSecurityGroupNameAndPorts, SecurityGroupInZone> groupCreator = Functions.forMap(ImmutableMap
.<ZoneSecurityGroupNameAndPorts, SecurityGroupInZone> of(input, securityGroupInZone));
FindSecurityGroupOrCreate parser = new FindSecurityGroupOrCreate(
returnSecurityGroupExistsInZone, groupCreator);
assertEquals(parser.load(input), securityGroupInZone);
}
代码示例来源:origin: jclouds/legacy-jclouds
String securityGroupName = namingConvention.create().sharedNameForGroup(group);
try {
securityGroupCache.get(new ZoneSecurityGroupNameAndPorts(zone, securityGroupName, inboundPorts));
} catch (ExecutionException e) {
throw Throwables.propagate(e.getCause());
代码示例来源:origin: io.cloudsoft.jclouds.api/openstack-nova
String securityGroupName = namingConvention.create().sharedNameForGroup(group);
try {
securityGroupCache.get(new ZoneSecurityGroupNameAndPorts(zone, securityGroupName, inboundPorts));
} catch (ExecutionException e) {
throw Throwables.propagate(e.getCause());
代码示例来源:origin: org.jclouds.api/openstack-nova
String securityGroupName = namingConvention.create().sharedNameForGroup(group);
try {
securityGroupCache.get(new ZoneSecurityGroupNameAndPorts(zone, securityGroupName, inboundPorts));
} catch (ExecutionException e) {
throw Throwables.propagate(e.getCause());
代码示例来源:origin: jclouds/legacy-jclouds
new ZoneSecurityGroupNameAndPorts("az-1.region-a.geo-1", "jclouds_mygroup", ImmutableSet.of(22, 8080)))
.toString(), new SecurityGroupInZone(new ParseComputeServiceTypicalSecurityGroupTest().expected(),
"az-1.region-a.geo-1").toString());
代码示例来源:origin: jclouds/legacy-jclouds
new ZoneSecurityGroupNameAndPorts("az-1.region-a.geo-1", "jclouds_mygroup", ImmutableSet.of(22, 8080)))
.toString(), new SecurityGroupInZone(new ParseComputeServiceTypicalSecurityGroupTest().expected(),
"az-1.region-a.geo-1").toString());
内容来源于网络,如有侵权,请联系作者删除!