cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From frankzh...@apache.org
Subject git commit: updated refs/heads/4.5 to c8f7278
Date Tue, 04 Nov 2014 00:41:47 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.5 207ec2574 -> c8f72780e


CLOUDSTACK-7834
Web UI shows all DHCP/PXE providers in cloud when admin click DHCP/PXE IP for A zone

Conflicts:
	plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalKickStartServiceImpl.java


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c8f72780
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c8f72780
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c8f72780

Branch: refs/heads/4.5
Commit: c8f72780ead91837e998a14459019183081a0556
Parents: 207ec25
Author: Frank Zhang <frank.zhang@citrix.com>
Authored: Mon Nov 3 16:43:09 2014 -0800
Committer: Frank Zhang <frank.zhang@citrix.com>
Committed: Mon Nov 3 16:44:53 2014 -0800

----------------------------------------------------------------------
 .../BaremetalDhcpManagerImpl.java               | 28 +++++++++----------
 .../BaremetalKickStartServiceImpl.java          | 22 +++++++++++++--
 .../cloudstack/api/ListBaremetalDhcpCmd.java    | 29 ++++++++++++++------
 .../api/ListBaremetalPxeServersCmd.java         | 25 +++++++++++------
 4 files changed, 71 insertions(+), 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c8f72780/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalDhcpManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalDhcpManagerImpl.java
b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalDhcpManagerImpl.java
index 3299268..2b67abe 100755
--- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalDhcpManagerImpl.java
+++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalDhcpManagerImpl.java
@@ -22,21 +22,6 @@
 // Automatically generated by addcopyright.py at 04/03/2012
 package com.cloud.baremetal.networkservice;
 
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.ejb.Local;
-import javax.inject.Inject;
-import javax.naming.ConfigurationException;
-
-import org.apache.log4j.Logger;
-
-import org.apache.cloudstack.api.AddBaremetalDhcpCmd;
-import org.apache.cloudstack.api.ListBaremetalDhcpCmd;
-
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.api.Answer;
 import com.cloud.agent.api.StartupCommand;
@@ -75,6 +60,18 @@ import com.cloud.vm.ReservationContext;
 import com.cloud.vm.VirtualMachineProfile;
 import com.cloud.vm.dao.NicDao;
 import com.cloud.vm.dao.UserVmDao;
+import org.apache.cloudstack.api.AddBaremetalDhcpCmd;
+import org.apache.cloudstack.api.ListBaremetalDhcpCmd;
+import org.apache.log4j.Logger;
+
+import javax.ejb.Local;
+import javax.inject.Inject;
+import javax.naming.ConfigurationException;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 @Local(value = {BaremetalDhcpManager.class})
 public class BaremetalDhcpManagerImpl extends ManagerBase implements BaremetalDhcpManager,
ResourceStateAdapter {
@@ -310,6 +307,7 @@ public class BaremetalDhcpManagerImpl extends ManagerBase implements BaremetalDh
             sc.and(sc.entity().getDeviceType(), Op.EQ, cmd.getDeviceType());
         }
 
+        sc.and(sc.entity().getPhysicalNetworkId(), Op.EQ, cmd.getPhysicalNetworkId());
         List<BaremetalDhcpVO> vos = sc.list();
         for (BaremetalDhcpVO vo : vos) {
             responses.add(generateApiResponse(vo));

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c8f72780/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalKickStartServiceImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalKickStartServiceImpl.java
b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalKickStartServiceImpl.java
index 2786e13..ef37294 100755
--- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalKickStartServiceImpl.java
+++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalKickStartServiceImpl.java
@@ -35,7 +35,6 @@ import org.apache.cloudstack.api.AddBaremetalPxeCmd;
 import org.apache.cloudstack.api.ListBaremetalPxeServersCmd;
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
 import org.apache.log4j.Logger;
-
 import com.cloud.agent.api.Answer;
 import com.cloud.agent.api.baremetal.IpmISetBootDevCommand;
 import com.cloud.agent.api.baremetal.IpmISetBootDevCommand.BootDev;
@@ -43,6 +42,7 @@ import com.cloud.agent.api.baremetal.PrepareKickstartPxeServerCommand;
 import com.cloud.baremetal.database.BaremetalPxeDao;
 import com.cloud.baremetal.database.BaremetalPxeVO;
 import com.cloud.baremetal.networkservice.BaremetalPxeManager.BaremetalPxeType;
+import com.cloud.configuration.Config;
 import com.cloud.dc.DataCenter;
 import com.cloud.deploy.DeployDestination;
 import com.cloud.exception.AgentUnavailableException;
@@ -79,6 +79,22 @@ import com.cloud.vm.ReservationContext;
 import com.cloud.vm.VirtualMachineProfile;
 import com.cloud.vm.dao.DomainRouterDao;
 import com.cloud.vm.dao.NicDao;
+import org.apache.cloudstack.api.AddBaremetalKickStartPxeCmd;
+import org.apache.cloudstack.api.AddBaremetalPxeCmd;
+import org.apache.cloudstack.api.ListBaremetalPxeServersCmd;
+import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
+import org.apache.log4j.Logger;
+
+import javax.ejb.Local;
+import javax.inject.Inject;
+import java.io.File;
+import java.net.URI;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 @Local(value = BaremetalPxeService.class)
 public class BaremetalKickStartServiceImpl extends BareMetalPxeServiceBase implements BaremetalPxeService
{
@@ -374,7 +390,9 @@ public class BaremetalKickStartServiceImpl extends BareMetalPxeServiceBase
imple
             return responses;
         }
 
-        List<BaremetalPxeVO> vos = _pxeDao.listAll();
+        QueryBuilder<BaremetalPxeVO> sc = QueryBuilder.create(BaremetalPxeVO.class);
+        sc.and(sc.entity().getPhysicalNetworkId(), Op.EQ, cmd.getPhysicalNetworkId());
+        List<BaremetalPxeVO> vos = sc.list();
         for (BaremetalPxeVO vo : vos) {
             responses.add(getApiResponse(vo));
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c8f72780/plugins/hypervisors/baremetal/src/org/apache/cloudstack/api/ListBaremetalDhcpCmd.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/baremetal/src/org/apache/cloudstack/api/ListBaremetalDhcpCmd.java
b/plugins/hypervisors/baremetal/src/org/apache/cloudstack/api/ListBaremetalDhcpCmd.java
index b159810..36a62f8 100755
--- a/plugins/hypervisors/baremetal/src/org/apache/cloudstack/api/ListBaremetalDhcpCmd.java
+++ b/plugins/hypervisors/baremetal/src/org/apache/cloudstack/api/ListBaremetalDhcpCmd.java
@@ -18,14 +18,6 @@
 // Automatically generated by addcopyright.py at 01/29/2013
 package org.apache.cloudstack.api;
 
-import java.util.List;
-
-import javax.inject.Inject;
-
-import org.apache.log4j.Logger;
-
-import org.apache.cloudstack.api.response.ListResponse;
-
 import com.cloud.baremetal.networkservice.BaremetalDhcpManager;
 import com.cloud.baremetal.networkservice.BaremetalDhcpResponse;
 import com.cloud.exception.ConcurrentOperationException;
@@ -33,6 +25,12 @@ import com.cloud.exception.InsufficientCapacityException;
 import com.cloud.exception.NetworkRuleConflictException;
 import com.cloud.exception.ResourceAllocationException;
 import com.cloud.exception.ResourceUnavailableException;
+import org.apache.cloudstack.api.response.ListResponse;
+import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
+import org.apache.log4j.Logger;
+
+import javax.inject.Inject;
+import java.util.List;
 
 @APICommand(name = "listBaremetalDhcp", description = "list baremetal dhcp servers", responseObject
= BaremetalDhcpResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
@@ -51,6 +49,21 @@ public class ListBaremetalDhcpCmd extends BaseListCmd {
     @Parameter(name = ApiConstants.DHCP_SERVER_TYPE, type = CommandType.STRING, description
= "Type of DHCP device")
     private String deviceType;
 
+    @Parameter(name = ApiConstants.PHYSICAL_NETWORK_ID,
+            type = CommandType.UUID,
+            entityType = PhysicalNetworkResponse.class,
+            required = true,
+            description = "the Physical Network ID")
+    private Long physicalNetworkId;
+
+    public Long getPhysicalNetworkId() {
+        return physicalNetworkId;
+    }
+
+    public void setPhysicalNetworkId(Long physicalNetworkId) {
+        this.physicalNetworkId = physicalNetworkId;
+    }
+
     public Long getId() {
         return id;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c8f72780/plugins/hypervisors/baremetal/src/org/apache/cloudstack/api/ListBaremetalPxeServersCmd.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/baremetal/src/org/apache/cloudstack/api/ListBaremetalPxeServersCmd.java
b/plugins/hypervisors/baremetal/src/org/apache/cloudstack/api/ListBaremetalPxeServersCmd.java
index 1663663..8707aa2 100755
--- a/plugins/hypervisors/baremetal/src/org/apache/cloudstack/api/ListBaremetalPxeServersCmd.java
+++ b/plugins/hypervisors/baremetal/src/org/apache/cloudstack/api/ListBaremetalPxeServersCmd.java
@@ -18,14 +18,6 @@
 // Automatically generated by addcopyright.py at 01/29/2013
 package org.apache.cloudstack.api;
 
-import java.util.List;
-
-import javax.inject.Inject;
-
-import org.apache.log4j.Logger;
-
-import org.apache.cloudstack.api.response.ListResponse;
-
 import com.cloud.baremetal.networkservice.BaremetalPxeManager;
 import com.cloud.baremetal.networkservice.BaremetalPxeResponse;
 import com.cloud.exception.ConcurrentOperationException;
@@ -33,6 +25,12 @@ import com.cloud.exception.InsufficientCapacityException;
 import com.cloud.exception.NetworkRuleConflictException;
 import com.cloud.exception.ResourceAllocationException;
 import com.cloud.exception.ResourceUnavailableException;
+import org.apache.cloudstack.api.response.ListResponse;
+import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
+import org.apache.log4j.Logger;
+
+import javax.inject.Inject;
+import java.util.List;
 
 @APICommand(name = "listBaremetalPxeServers", description = "list baremetal pxe server",
responseObject = BaremetalPxeResponse.class,
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
@@ -49,6 +47,13 @@ public class ListBaremetalPxeServersCmd extends BaseListCmd {
     @Parameter(name = ApiConstants.ID, type = CommandType.LONG, description = "Pxe server
device ID")
     private Long id;
 
+    @Parameter(name = ApiConstants.PHYSICAL_NETWORK_ID,
+            type = CommandType.UUID,
+            entityType = PhysicalNetworkResponse.class,
+            required = true,
+            description = "the Physical Network ID")
+    private Long physicalNetworkId;
+
     public Long getId() {
         return id;
     }
@@ -57,6 +62,10 @@ public class ListBaremetalPxeServersCmd extends BaseListCmd {
         this.id = id;
     }
 
+    public Long getPhysicalNetworkId() {
+        return physicalNetworkId;
+    }
+
     @Override
     public void execute() throws ResourceUnavailableException, InsufficientCapacityException,
ServerApiException, ConcurrentOperationException,
         ResourceAllocationException, NetworkRuleConflictException {


Mime
View raw message