api_refactor: Move host apis to admin pkg

- Moved host related apis to admin pkg
- Change namespace to org.a.cs.api, fix mappings in commands-prop.

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
This commit is contained in:
Rohit Yadav 2012-12-06 10:21:10 -08:00
parent b0ce8fd4ff
commit 2a7fa674c7
16 changed files with 37 additions and 42 deletions

View File

@ -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 {
/**

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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;