gpt4 book ai didi

org.jclouds.openstack.nova.v2_0.domain.zonescoped.ZoneSecurityGroupNameAndPorts.getZone()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-20 00:14:31 24 4
gpt4 key购买 nike

本文整理了Java中org.jclouds.openstack.nova.v2_0.domain.zonescoped.ZoneSecurityGroupNameAndPorts.getZone()方法的一些代码示例,展示了ZoneSecurityGroupNameAndPorts.getZone()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZoneSecurityGroupNameAndPorts.getZone()方法的具体详情如下:
包路径:org.jclouds.openstack.nova.v2_0.domain.zonescoped.ZoneSecurityGroupNameAndPorts
类名称:ZoneSecurityGroupNameAndPorts
方法名:getZone

ZoneSecurityGroupNameAndPorts.getZone介绍

暂无

代码示例

代码示例来源:origin: io.cloudsoft.jclouds.api/openstack-nova

@Override
public SecurityGroupInZone apply(ZoneSecurityGroupNameAndPorts zoneSecurityGroupNameAndPorts) {
 checkNotNull(zoneSecurityGroupNameAndPorts, "zoneSecurityGroupNameAndPorts");
 String zoneId = zoneSecurityGroupNameAndPorts.getZone();
 Optional<? extends SecurityGroupApi> api = novaApi.getSecurityGroupExtensionForZone(zoneId);
 checkArgument(api.isPresent(), "Security groups are required, but the extension is not availablein zone %s!", zoneId);
 logger.debug(">> creating securityGroup %s", zoneSecurityGroupNameAndPorts);
 try {
   SecurityGroup securityGroup = api.get().createWithDescription(
       zoneSecurityGroupNameAndPorts.getName(), zoneSecurityGroupNameAndPorts.getName());
   logger.debug("<< created securityGroup(%s)", securityGroup);
   for (int port : zoneSecurityGroupNameAndPorts.getPorts()) {
    authorizeGroupToItselfAndAllIPsToTCPPort(api.get(), securityGroup, port);
   }
   return new SecurityGroupInZone(api.get().get(securityGroup.getId()), zoneId);
 } catch (IllegalStateException e) {
   logger.trace("<< trying to find securityGroup(%s): %s", zoneSecurityGroupNameAndPorts, e.getMessage());
   SecurityGroup group = find(api.get().list(), nameEquals(zoneSecurityGroupNameAndPorts
       .getName()));
   logger.debug("<< reused securityGroup(%s)", group.getId());
   return new SecurityGroupInZone(group, zoneId);
 }
}

代码示例来源:origin: jclouds/legacy-jclouds

@Override
public SecurityGroupInZone apply(ZoneSecurityGroupNameAndPorts zoneSecurityGroupNameAndPorts) {
 checkNotNull(zoneSecurityGroupNameAndPorts, "zoneSecurityGroupNameAndPorts");
 String zoneId = zoneSecurityGroupNameAndPorts.getZone();
 Optional<? extends SecurityGroupApi> api = novaApi.getSecurityGroupExtensionForZone(zoneId);
 checkArgument(api.isPresent(), "Security groups are required, but the extension is not availablein zone %s!", zoneId);
 logger.debug(">> creating securityGroup %s", zoneSecurityGroupNameAndPorts);
 try {
   SecurityGroup securityGroup = api.get().createWithDescription(
       zoneSecurityGroupNameAndPorts.getName(), zoneSecurityGroupNameAndPorts.getName());
   logger.debug("<< created securityGroup(%s)", securityGroup);
   for (int port : zoneSecurityGroupNameAndPorts.getPorts()) {
    authorizeGroupToItselfAndAllIPsToTCPPort(api.get(), securityGroup, port);
   }
   return new SecurityGroupInZone(api.get().get(securityGroup.getId()), zoneId);
 } catch (IllegalStateException e) {
   logger.trace("<< trying to find securityGroup(%s): %s", zoneSecurityGroupNameAndPorts, e.getMessage());
   SecurityGroup group = find(api.get().list(), nameEquals(zoneSecurityGroupNameAndPorts
       .getName()));
   logger.debug("<< reused securityGroup(%s)", group.getId());
   return new SecurityGroupInZone(group, zoneId);
 }
}

代码示例来源:origin: org.jclouds.api/openstack-nova

@Override
public SecurityGroupInZone apply(ZoneSecurityGroupNameAndPorts zoneSecurityGroupNameAndPorts) {
 checkNotNull(zoneSecurityGroupNameAndPorts, "zoneSecurityGroupNameAndPorts");
 String zoneId = zoneSecurityGroupNameAndPorts.getZone();
 Optional<? extends SecurityGroupApi> api = novaApi.getSecurityGroupExtensionForZone(zoneId);
 checkArgument(api.isPresent(), "Security groups are required, but the extension is not availablein zone %s!", zoneId);
 logger.debug(">> creating securityGroup %s", zoneSecurityGroupNameAndPorts);
 try {
   SecurityGroup securityGroup = api.get().createWithDescription(
       zoneSecurityGroupNameAndPorts.getName(), zoneSecurityGroupNameAndPorts.getName());
   logger.debug("<< created securityGroup(%s)", securityGroup);
   for (int port : zoneSecurityGroupNameAndPorts.getPorts()) {
    authorizeGroupToItselfAndAllIPsToTCPPort(api.get(), securityGroup, port);
   }
   return new SecurityGroupInZone(api.get().get(securityGroup.getId()), zoneId);
 } catch (IllegalStateException e) {
   logger.trace("<< trying to find securityGroup(%s): %s", zoneSecurityGroupNameAndPorts, e.getMessage());
   SecurityGroup group = find(api.get().list(), nameEquals(zoneSecurityGroupNameAndPorts
       .getName()));
   logger.debug("<< reused securityGroup(%s)", group.getId());
   return new SecurityGroupInZone(group, zoneId);
 }
}

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com