com.cloud.resource.ResourceManager.checkCIDR()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(89)

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

ResourceManager.checkCIDR介绍

暂无

代码示例

代码示例来源:origin: apache/cloudstack

@Override
public HostVO createHostVOForDirectConnectAgent(HostVO host, StartupCommand[] startup, ServerResource resource, Map<String, String> details, List<String> hostTags) {
  StartupCommand firstCmd = startup[0];
  if (!(firstCmd instanceof StartupRoutingCommand)) {
    return null;
  }
  StartupRoutingCommand ssCmd = ((StartupRoutingCommand)firstCmd);
  if (ssCmd.getHypervisorType() != HypervisorType.XenServer) {
    return null;
  }
  HostPodVO pod = _podDao.findById(host.getPodId());
  DataCenterVO dc = _dcDao.findById(host.getDataCenterId());
  s_logger.info("Host: " + host.getName() + " connected with hypervisor type: " + HypervisorType.XenServer + ". Checking CIDR...");
  _resourceMgr.checkCIDR(pod, dc, ssCmd.getPrivateIpAddress(), ssCmd.getPrivateNetmask());
  return _resourceMgr.fillRoutingHostVO(host, ssCmd, HypervisorType.XenServer, details, hostTags);
}

代码示例来源:origin: apache/cloudstack

@Override
public final HostVO createHostVOForDirectConnectAgent(final HostVO host, final StartupCommand[] startup, final ServerResource resource,
  final Map<String, String> details, final List<String> hostTags) {
  StartupCommand firstCmd = startup[0];
  if (!(firstCmd instanceof StartupRoutingCommand)) {
    return null;
  }
  StartupRoutingCommand ssCmd = ((StartupRoutingCommand)firstCmd);
  if (ssCmd.getHypervisorType() != HypervisorType.Hyperv) {
    return null;
  }
  s_logger.info("Host: " + host.getName() + " connected with hypervisor type: " + HypervisorType.Hyperv + ". Checking CIDR...");
  HostPodVO pod = _podDao.findById(host.getPodId());
  DataCenterVO dc = _dcDao.findById(host.getDataCenterId());
  _resourceMgr.checkCIDR(pod, dc, ssCmd.getPrivateIpAddress(), ssCmd.getPrivateNetmask());
  return _resourceMgr.fillRoutingHostVO(host, ssCmd, HypervisorType.Hyperv, details, hostTags);
}

相关文章