diff --git a/api/src/com/cloud/resource/ResourceService.java b/api/src/com/cloud/resource/ResourceService.java index d36ca359b47..d75ed139ed5 100755 --- a/api/src/com/cloud/resource/ResourceService.java +++ b/api/src/com/cloud/resource/ResourceService.java @@ -19,16 +19,15 @@ package com.cloud.resource; import java.util.List; import com.cloud.api.commands.AddClusterCmd; -import com.cloud.api.commands.AddHostCmd; -import com.cloud.api.commands.AddSecondaryStorageCmd; +import org.apache.cloudstack.api.admin.host.command.AddHostCmd; +import org.apache.cloudstack.api.admin.host.command.AddSecondaryStorageCmd; import com.cloud.api.commands.AddSwiftCmd; -import com.cloud.api.commands.CancelMaintenanceCmd; +import org.apache.cloudstack.api.admin.host.command.CancelMaintenanceCmd; import com.cloud.api.commands.DeleteClusterCmd; import com.cloud.api.commands.ListSwiftsCmd; -import com.cloud.api.commands.PrepareForMaintenanceCmd; -import com.cloud.api.commands.ReconnectHostCmd; -import com.cloud.api.commands.UpdateHostCmd; -import com.cloud.api.commands.UpdateHostPasswordCmd; +import org.apache.cloudstack.api.admin.host.command.PrepareForMaintenanceCmd; +import org.apache.cloudstack.api.admin.host.command.*; +import org.apache.cloudstack.api.admin.host.command.UpdateHostCmd; import com.cloud.exception.DiscoveryException; import com.cloud.exception.InvalidParameterValueException; import com.cloud.exception.ResourceInUseException; @@ -37,6 +36,7 @@ import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.org.Cluster; import com.cloud.storage.Swift; import com.cloud.utils.fsm.NoTransitionException; +import org.apache.cloudstack.api.admin.host.command.ReconnectHostCmd; public interface ResourceService { /** diff --git a/api/src/com/cloud/server/ManagementService.java b/api/src/com/cloud/server/ManagementService.java index 1b43662416d..a2ab2063985 100755 --- a/api/src/com/cloud/server/ManagementService.java +++ b/api/src/com/cloud/server/ManagementService.java @@ -24,6 +24,8 @@ import java.util.Set; import com.cloud.alert.Alert; import org.apache.cloudstack.api.ServerApiException; +import org.apache.cloudstack.api.admin.host.command.ListHostsCmd; +import org.apache.cloudstack.api.admin.host.command.UpdateHostPasswordCmd; import org.apache.cloudstack.api.admin.router.command.ListRoutersCmd; import org.apache.cloudstack.api.user.address.command.ListPublicIpAddressesCmd; import org.apache.cloudstack.api.user.resource.command.ListCapabilitiesCmd; @@ -44,7 +46,6 @@ import com.cloud.api.commands.ListCfgsByCmd; import com.cloud.api.commands.ListClustersCmd; import org.apache.cloudstack.api.user.event.command.ListEventsCmd; import org.apache.cloudstack.api.user.guest.command.ListGuestOsCategoriesCmd; -import com.cloud.api.commands.ListHostsCmd; import org.apache.cloudstack.api.user.iso.command.ListIsosCmd; import com.cloud.api.commands.ListPodsByCmd; import org.apache.cloudstack.api.user.ssh.command.ListSSHKeyPairsCmd; @@ -57,7 +58,6 @@ import com.cloud.api.commands.RebootSystemVmCmd; import org.apache.cloudstack.api.user.ssh.command.RegisterSSHKeyPairCmd; import com.cloud.api.commands.StopSystemVmCmd; import com.cloud.api.commands.UpdateDomainCmd; -import com.cloud.api.commands.UpdateHostPasswordCmd; import org.apache.cloudstack.api.user.iso.command.UpdateIsoCmd; import org.apache.cloudstack.api.user.vmgroup.command.UpdateVMGroupCmd; import com.cloud.api.commands.UpgradeSystemVMCmd; @@ -79,7 +79,6 @@ import com.cloud.host.Host; import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.hypervisor.HypervisorCapabilities; import com.cloud.network.IpAddress; -import com.cloud.network.router.VirtualRouter; import com.cloud.offering.DiskOffering; import com.cloud.offering.ServiceOffering; import com.cloud.org.Cluster; diff --git a/api/src/com/cloud/api/commands/AddHostCmd.java b/api/src/org/apache/cloudstack/api/admin/host/command/AddHostCmd.java similarity index 99% rename from api/src/com/cloud/api/commands/AddHostCmd.java rename to api/src/org/apache/cloudstack/api/admin/host/command/AddHostCmd.java index d2e06de0f86..06a065230c2 100755 --- a/api/src/com/cloud/api/commands/AddHostCmd.java +++ b/api/src/org/apache/cloudstack/api/admin/host/command/AddHostCmd.java @@ -14,7 +14,7 @@ // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. -package com.cloud.api.commands; +package org.apache.cloudstack.api.admin.host.command; import java.util.ArrayList; import java.util.List; diff --git a/api/src/com/cloud/api/commands/AddSecondaryStorageCmd.java b/api/src/org/apache/cloudstack/api/admin/host/command/AddSecondaryStorageCmd.java similarity index 98% rename from api/src/com/cloud/api/commands/AddSecondaryStorageCmd.java rename to api/src/org/apache/cloudstack/api/admin/host/command/AddSecondaryStorageCmd.java index c1946d0297c..678a73f1221 100644 --- a/api/src/com/cloud/api/commands/AddSecondaryStorageCmd.java +++ b/api/src/org/apache/cloudstack/api/admin/host/command/AddSecondaryStorageCmd.java @@ -14,7 +14,7 @@ // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. -package com.cloud.api.commands; +package org.apache.cloudstack.api.admin.host.command; import java.util.List; diff --git a/api/src/com/cloud/api/commands/CancelMaintenanceCmd.java b/api/src/org/apache/cloudstack/api/admin/host/command/CancelMaintenanceCmd.java similarity index 98% rename from api/src/com/cloud/api/commands/CancelMaintenanceCmd.java rename to api/src/org/apache/cloudstack/api/admin/host/command/CancelMaintenanceCmd.java index dfd7c88e120..2e84b000140 100644 --- a/api/src/com/cloud/api/commands/CancelMaintenanceCmd.java +++ b/api/src/org/apache/cloudstack/api/admin/host/command/CancelMaintenanceCmd.java @@ -14,7 +14,7 @@ // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. -package com.cloud.api.commands; +package org.apache.cloudstack.api.admin.host.command; import org.apache.log4j.Logger; diff --git a/api/src/com/cloud/api/commands/DeleteHostCmd.java b/api/src/org/apache/cloudstack/api/admin/host/command/DeleteHostCmd.java similarity index 98% rename from api/src/com/cloud/api/commands/DeleteHostCmd.java rename to api/src/org/apache/cloudstack/api/admin/host/command/DeleteHostCmd.java index da68a832094..0f39a043aca 100644 --- a/api/src/com/cloud/api/commands/DeleteHostCmd.java +++ b/api/src/org/apache/cloudstack/api/admin/host/command/DeleteHostCmd.java @@ -14,7 +14,7 @@ // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. -package com.cloud.api.commands; +package org.apache.cloudstack.api.admin.host.command; import org.apache.log4j.Logger; diff --git a/api/src/com/cloud/api/commands/ListHostsCmd.java b/api/src/org/apache/cloudstack/api/admin/host/command/ListHostsCmd.java similarity index 99% rename from api/src/com/cloud/api/commands/ListHostsCmd.java rename to api/src/org/apache/cloudstack/api/admin/host/command/ListHostsCmd.java index 7e1e97cdd0c..ec424c2d11f 100755 --- a/api/src/com/cloud/api/commands/ListHostsCmd.java +++ b/api/src/org/apache/cloudstack/api/admin/host/command/ListHostsCmd.java @@ -14,7 +14,7 @@ // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. -package com.cloud.api.commands; +package org.apache.cloudstack.api.admin.host.command; import java.util.ArrayList; import java.util.EnumSet; diff --git a/api/src/com/cloud/api/commands/PrepareForMaintenanceCmd.java b/api/src/org/apache/cloudstack/api/admin/host/command/PrepareForMaintenanceCmd.java similarity index 98% rename from api/src/com/cloud/api/commands/PrepareForMaintenanceCmd.java rename to api/src/org/apache/cloudstack/api/admin/host/command/PrepareForMaintenanceCmd.java index ffa56ab56bf..b6d178eabfa 100644 --- a/api/src/com/cloud/api/commands/PrepareForMaintenanceCmd.java +++ b/api/src/org/apache/cloudstack/api/admin/host/command/PrepareForMaintenanceCmd.java @@ -14,7 +14,7 @@ // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. -package com.cloud.api.commands; +package org.apache.cloudstack.api.admin.host.command; import org.apache.log4j.Logger; diff --git a/api/src/com/cloud/api/commands/ReconnectHostCmd.java b/api/src/org/apache/cloudstack/api/admin/host/command/ReconnectHostCmd.java similarity index 98% rename from api/src/com/cloud/api/commands/ReconnectHostCmd.java rename to api/src/org/apache/cloudstack/api/admin/host/command/ReconnectHostCmd.java index a2079f21dbf..2c57adecefc 100755 --- a/api/src/com/cloud/api/commands/ReconnectHostCmd.java +++ b/api/src/org/apache/cloudstack/api/admin/host/command/ReconnectHostCmd.java @@ -14,7 +14,7 @@ // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. -package com.cloud.api.commands; +package org.apache.cloudstack.api.admin.host.command; import org.apache.log4j.Logger; diff --git a/api/src/com/cloud/api/commands/UpdateHostCmd.java b/api/src/org/apache/cloudstack/api/admin/host/command/UpdateHostCmd.java similarity index 98% rename from api/src/com/cloud/api/commands/UpdateHostCmd.java rename to api/src/org/apache/cloudstack/api/admin/host/command/UpdateHostCmd.java index e09e4f03a4c..bbb3b6fb10d 100755 --- a/api/src/com/cloud/api/commands/UpdateHostCmd.java +++ b/api/src/org/apache/cloudstack/api/admin/host/command/UpdateHostCmd.java @@ -14,7 +14,7 @@ // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. -package com.cloud.api.commands; +package org.apache.cloudstack.api.admin.host.command; import java.util.List; diff --git a/api/src/com/cloud/api/commands/UpdateHostPasswordCmd.java b/api/src/org/apache/cloudstack/api/admin/host/command/UpdateHostPasswordCmd.java similarity index 98% rename from api/src/com/cloud/api/commands/UpdateHostPasswordCmd.java rename to api/src/org/apache/cloudstack/api/admin/host/command/UpdateHostPasswordCmd.java index 9f8c02e5567..2ace2485e51 100644 --- a/api/src/com/cloud/api/commands/UpdateHostPasswordCmd.java +++ b/api/src/org/apache/cloudstack/api/admin/host/command/UpdateHostPasswordCmd.java @@ -14,7 +14,7 @@ // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. -package com.cloud.api.commands; +package org.apache.cloudstack.api.admin.host.command; import org.apache.log4j.Logger; diff --git a/api/test/src/com/cloud/api/commands/test/AddHostCmdTest.java b/api/test/src/com/cloud/api/commands/test/AddHostCmdTest.java index 4d8e5ea65a7..75c40d2fb50 100644 --- a/api/test/src/com/cloud/api/commands/test/AddHostCmdTest.java +++ b/api/test/src/com/cloud/api/commands/test/AddHostCmdTest.java @@ -19,6 +19,7 @@ package src.com.cloud.api.commands.test; import junit.framework.Assert; import junit.framework.TestCase; +import org.apache.cloudstack.api.admin.host.command.AddHostCmd; import org.junit.Before; import org.junit.Rule; import org.junit.Test; @@ -27,7 +28,6 @@ import org.mockito.Mockito; import org.apache.cloudstack.api.ResponseGenerator; import org.apache.cloudstack.api.ServerApiException; -import com.cloud.api.commands.AddHostCmd; import com.cloud.api.response.HostResponse; import com.cloud.api.response.ListResponse; import com.cloud.exception.DiscoveryException; diff --git a/api/test/src/com/cloud/api/commands/test/AddSecondaryStorageCmdTest.java b/api/test/src/com/cloud/api/commands/test/AddSecondaryStorageCmdTest.java index 87e03fa3275..9b73b0c1081 100644 --- a/api/test/src/com/cloud/api/commands/test/AddSecondaryStorageCmdTest.java +++ b/api/test/src/com/cloud/api/commands/test/AddSecondaryStorageCmdTest.java @@ -19,6 +19,7 @@ package src.com.cloud.api.commands.test; import junit.framework.Assert; import junit.framework.TestCase; +import org.apache.cloudstack.api.admin.host.command.AddSecondaryStorageCmd; import org.junit.Before; import org.junit.Rule; import org.junit.Test; @@ -27,7 +28,6 @@ import org.mockito.Mockito; import org.apache.cloudstack.api.ResponseGenerator; import org.apache.cloudstack.api.ServerApiException; -import com.cloud.api.commands.AddSecondaryStorageCmd; import com.cloud.api.response.HostResponse; import com.cloud.host.Host; import com.cloud.resource.ResourceService; diff --git a/client/tomcatconf/commands.properties.in b/client/tomcatconf/commands.properties.in index 441271bb3aa..a0ac700dca4 100755 --- a/client/tomcatconf/commands.properties.in +++ b/client/tomcatconf/commands.properties.in @@ -229,18 +229,18 @@ addSwift=com.cloud.api.commands.AddSwiftCmd;1 listSwifts=com.cloud.api.commands.ListSwiftsCmd;1 #### host commands -addHost=com.cloud.api.commands.AddHostCmd;3 +addHost=org.apache.cloudstack.api.admin.host.command.AddHostCmd;3 addCluster=com.cloud.api.commands.AddClusterCmd;1 deleteCluster=com.cloud.api.commands.DeleteClusterCmd;1 updateCluster=com.cloud.api.commands.UpdateClusterCmd;1 -reconnectHost=com.cloud.api.commands.ReconnectHostCmd;1 -updateHost=com.cloud.api.commands.UpdateHostCmd;1 -deleteHost=com.cloud.api.commands.DeleteHostCmd;3 -prepareHostForMaintenance=com.cloud.api.commands.PrepareForMaintenanceCmd;1 -cancelHostMaintenance=com.cloud.api.commands.CancelMaintenanceCmd;1 -listHosts=com.cloud.api.commands.ListHostsCmd;3 -addSecondaryStorage=com.cloud.api.commands.AddSecondaryStorageCmd;1 -updateHostPassword=com.cloud.api.commands.UpdateHostPasswordCmd;1 +reconnectHost=org.apache.cloudstack.api.admin.host.command.ReconnectHostCmd;1 +updateHost=org.apache.cloudstack.api.admin.host.command.UpdateHostCmd;1 +deleteHost=org.apache.cloudstack.api.admin.host.command.DeleteHostCmd;3 +prepareHostForMaintenance=org.apache.cloudstack.api.admin.host.command.PrepareForMaintenanceCmd;1 +cancelHostMaintenance=org.apache.cloudstack.api.admin.host.command.CancelMaintenanceCmd;1 +listHosts=org.apache.cloudstack.api.admin.host.command.ListHostsCmd;3 +addSecondaryStorage=org.apache.cloudstack.api.admin.host.command.AddSecondaryStorageCmd;1 +updateHostPassword=org.apache.cloudstack.api.admin.host.command.UpdateHostPasswordCmd;1 #### volume commands attachVolume=org.apache.cloudstack.api.user.volume.command.AttachVolumeCmd;15 diff --git a/server/src/com/cloud/resource/ResourceManagerImpl.java b/server/src/com/cloud/resource/ResourceManagerImpl.java index f3afd905aab..da6539ce293 100755 --- a/server/src/com/cloud/resource/ResourceManagerImpl.java +++ b/server/src/com/cloud/resource/ResourceManagerImpl.java @@ -30,6 +30,7 @@ import java.util.Set; import javax.ejb.Local; import javax.naming.ConfigurationException; +import org.apache.cloudstack.api.admin.host.command.*; import org.apache.log4j.Logger; import com.cloud.agent.AgentManager; @@ -49,16 +50,14 @@ import com.cloud.agent.transport.Request; import org.apache.cloudstack.api.ApiConstants; import com.cloud.api.ApiDBUtils; import com.cloud.api.commands.AddClusterCmd; -import com.cloud.api.commands.AddHostCmd; -import com.cloud.api.commands.AddSecondaryStorageCmd; +import org.apache.cloudstack.api.admin.host.command.AddHostCmd; +import org.apache.cloudstack.api.admin.host.command.AddSecondaryStorageCmd; import com.cloud.api.commands.AddSwiftCmd; -import com.cloud.api.commands.CancelMaintenanceCmd; +import org.apache.cloudstack.api.admin.host.command.CancelMaintenanceCmd; import com.cloud.api.commands.DeleteClusterCmd; import com.cloud.api.commands.ListSwiftsCmd; -import com.cloud.api.commands.PrepareForMaintenanceCmd; -import com.cloud.api.commands.ReconnectHostCmd; -import com.cloud.api.commands.UpdateHostCmd; -import com.cloud.api.commands.UpdateHostPasswordCmd; +import org.apache.cloudstack.api.admin.host.command.PrepareForMaintenanceCmd; +import org.apache.cloudstack.api.admin.host.command.UpdateHostCmd; import com.cloud.capacity.Capacity; import com.cloud.capacity.CapacityVO; import com.cloud.capacity.dao.CapacityDao; diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java index cced7630720..d39dd23eecb 100755 --- a/server/src/com/cloud/server/ManagementServerImpl.java +++ b/server/src/com/cloud/server/ManagementServerImpl.java @@ -80,7 +80,7 @@ import com.cloud.api.commands.ListCapacityCmd; import com.cloud.api.commands.ListCfgsByCmd; import com.cloud.api.commands.ListClustersCmd; import org.apache.cloudstack.api.user.event.command.ListEventsCmd; -import com.cloud.api.commands.ListHostsCmd; +import org.apache.cloudstack.api.admin.host.command.ListHostsCmd; import com.cloud.api.commands.ListPodsByCmd; import org.apache.cloudstack.api.user.address.command.ListPublicIpAddressesCmd; import org.apache.cloudstack.api.user.ssh.command.ListSSHKeyPairsCmd; @@ -91,7 +91,7 @@ import org.apache.cloudstack.api.user.datacenter.command.ListZonesByCmd; import com.cloud.api.commands.RebootSystemVmCmd; import com.cloud.api.commands.StopSystemVmCmd; import com.cloud.api.commands.UpdateDomainCmd; -import com.cloud.api.commands.UpdateHostPasswordCmd; +import org.apache.cloudstack.api.admin.host.command.UpdateHostPasswordCmd; import org.apache.cloudstack.api.user.iso.command.UpdateIsoCmd; import com.cloud.api.commands.UpdateTemplateOrIsoCmd; import org.apache.cloudstack.api.user.vmgroup.command.UpdateVMGroupCmd; @@ -99,7 +99,6 @@ import com.cloud.api.commands.UpgradeSystemVMCmd; import com.cloud.api.commands.UploadCustomCertificateCmd; import com.cloud.api.response.ExtractResponse; import com.cloud.api.view.vo.DomainRouterJoinVO; -import com.cloud.api.view.vo.UserVmJoinVO; import com.cloud.async.AsyncJob; import com.cloud.async.AsyncJobExecutor; import com.cloud.async.AsyncJobManager; @@ -171,7 +170,6 @@ import com.cloud.network.NetworkVO; import com.cloud.network.dao.IPAddressDao; import com.cloud.network.dao.LoadBalancerDao; import com.cloud.network.dao.NetworkDao; -import com.cloud.network.router.VirtualRouter; import com.cloud.org.Cluster; import com.cloud.org.Grouping.AllocationState; import com.cloud.projects.Project; @@ -250,7 +248,6 @@ import com.cloud.vm.ConsoleProxyVO; import com.cloud.vm.DomainRouterVO; import com.cloud.vm.InstanceGroup; import com.cloud.vm.InstanceGroupVO; -import com.cloud.vm.NicVO; import com.cloud.vm.SecondaryStorageVmVO; import com.cloud.vm.UserVmVO; import com.cloud.vm.VMInstanceVO;