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

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

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

ResourceManager.addHost介绍

暂无

代码示例

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

public HostVO allocateNCCResourceForNetwork(Network guestConfig) throws ConfigurationException {
  Map<String, String> _configs;
  List<NetScalerControlCenterVO> ncc = _netscalerControlCenterDao.listAll();
  HostVO hostVO = null;
  if (ncc.size() > 0) {
    NetScalerControlCenterVO nccVO = ncc.get(0);
    String ipAddress = nccVO.getNccip();
    Map hostDetails = new HashMap<String, String>();
    String hostName = "NetscalerControlCenter";
    hostDetails.put("name", hostName);
    hostDetails.put("guid", UUID.randomUUID().toString());
    hostDetails.put("zoneId", Long.toString(guestConfig.getDataCenterId()));
    hostDetails.put("ip", ipAddress);
    hostDetails.put("username", nccVO.getUsername());
    hostDetails.put("password", DBEncryptionUtil.decrypt(nccVO.getPassword()));
    hostDetails.put("deviceName", "netscaler control center");
    hostDetails.put("cmdTimeOut", Long.toString(NumbersUtil.parseInt(_configDao.getValue(Config.NCCCmdTimeOut.key()), 600000)));
    ServerResource resource = new NetScalerControlCenterResource();
    resource.configure(hostName, hostDetails);
    final Host host = _resourceMgr.addHost(guestConfig.getDataCenterId(), resource, Host.Type.NetScalerControlCenter, hostDetails);
    hostVO = _hostDao.findById(host.getId());
  }
  return hostVO;
}

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

Host trafficMonitor = _resourceMgr.addHost(zoneId, resource, Host.Type.TrafficMonitor, hostDetails);
return trafficMonitor;

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

final Host host = resourceManager.addHost(zoneId, odlController, Host.Type.L2Networking, hostParams);
if (host != null) {
  return Transaction.execute(new TransactionCallback<OpenDaylightControllerVO>() {

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

final Host externalFirewall = _resourceMgr.addHost(zoneId, resource, Host.Type.ExternalFirewall, hostDetails);
if (externalFirewall != null) {
  final PhysicalNetworkVO pNetworkFinal = pNetwork;

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

resource.configure(hostName, hostDetails);
final Host host = _resourceMgr.addHost(zoneId, resource, Host.Type.ExternalLoadBalancer, hostDetails);
if (host != null) {

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

resource.configure(cmd.getHost(), hostdetails);
final Host host = resourceMgr.addHost(zoneId, resource, Host.Type.L2Networking, params);
if (host != null) {
  return Transaction.execute(new TransactionCallback<NiciraNvpDeviceVO>() {

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

Host pxeServer = _resourceMgr.addHost(zoneId, resource, Host.Type.BaremetalPxe, params);
if (pxeServer == null) {
  throw new CloudRuntimeException("Cannot add PXE server as a host");

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

resource.configure(cmd.getHost(), hostdetails);
final Host host = _resourceMgr.addHost(zoneId, resource, Host.Type.L2Networking, params);
if (host != null) {
  return Transaction.execute(new TransactionCallback<BrocadeVcsDeviceVO>() {

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

Host pxeServer = _resourceMgr.addHost(zoneId, resource, Host.Type.BaremetalPxe, params);
if (pxeServer == null) {
  throw new CloudRuntimeException("Cannot add PXE server as a host");

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

Host dhcpServer = _resourceMgr.addHost(zoneId, resource, Host.Type.BaremetalDhcp, params);
if (dhcpServer == null) {
  throw new CloudRuntimeException("Cannot add external Dhcp server as a host");

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

((BigSwitchBcfResource) resource).setTopology(topo);
final Host host = _resourceMgr.addHost(zoneId, resource, Host.Type.L2Networking, params);
if (host != null) {
  newBcfDevice = Transaction.execute(new TransactionCallback<BigSwitchBcfDeviceVO>() {

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

@Override
  public Host doInTransaction(TransactionStatus status) throws CloudRuntimeException {
    try {
      GloboDnsResource resource = new GloboDnsResource();
      resource.configure(Provider.GloboDns.getName(), hostDetails);
      Host host = _resourceMgr.addHost(zoneId, resource, resource.getType(), params);
      if (host == null) {
        throw new CloudRuntimeException("Failed to add GloboDNS host");
      }
      // Validate username and password by logging in
      SignInCommand cmd = new SignInCommand(username, password);
      Answer answer = callCommand(cmd, zoneId);
      if (answer == null || !answer.getResult()) {
        // Could not sign in on GloboDNS
        throw new ConfigurationException("Could not sign in on GloboDNS. Please verify URL, username and password.");
      }
      return host;
    } catch (ConfigurationException e) {
      throw new CloudRuntimeException(e);
    }
  }
});

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

Host host = _resourceMgr.addHost(zoneId, resource, Host.Type.L2Networking, hostDetails);
if (host == null) {
  throw new CloudRuntimeException("Failed to add Nuage Vsp Device due to internal error.");

相关文章