You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bh...@apache.org on 2012/12/06 20:14:32 UTC
[8/14] git commit: api_refactor: move zone apis to admin pkg
api_refactor: move zone apis to admin pkg
Signed-off-by: Rohit Yadav <bh...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/c3853677
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/c3853677
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/c3853677
Branch: refs/heads/api_refactoring
Commit: c3853677c5ba34d25cb1bfb511e40f434cf175d0
Parents: 7f61d29
Author: Rohit Yadav <bh...@apache.org>
Authored: Thu Dec 6 10:41:10 2012 -0800
Committer: Rohit Yadav <bh...@apache.org>
Committed: Thu Dec 6 10:41:10 2012 -0800
----------------------------------------------------------------------
api/src/com/cloud/api/commands/CreateZoneCmd.java | 161 -------------
api/src/com/cloud/api/commands/DeleteZoneCmd.java | 80 -------
.../api/commands/MarkDefaultZoneForAccountCmd.java | 114 ----------
api/src/com/cloud/api/commands/UpdateZoneCmd.java | 174 ---------------
.../cloud/configuration/ConfigurationService.java | 6 +-
.../api/admin/zone/command/CreateZoneCmd.java | 161 +++++++++++++
.../api/admin/zone/command/DeleteZoneCmd.java | 80 +++++++
.../zone/command/MarkDefaultZoneForAccountCmd.java | 114 ++++++++++
.../api/admin/zone/command/UpdateZoneCmd.java | 174 +++++++++++++++
client/tomcatconf/commands.properties.in | 8 +-
.../configuration/ConfigurationManagerImpl.java | 6 +-
.../cloud/vpc/MockConfigurationManagerImpl.java | 6 +-
12 files changed, 542 insertions(+), 542 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c3853677/api/src/com/cloud/api/commands/CreateZoneCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/CreateZoneCmd.java b/api/src/com/cloud/api/commands/CreateZoneCmd.java
deleted file mode 100755
index 4613e1f..0000000
--- a/api/src/com/cloud/api/commands/CreateZoneCmd.java
+++ /dev/null
@@ -1,161 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.api.commands;
-
-import org.apache.log4j.Logger;
-
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.BaseCmd;
-import org.apache.cloudstack.api.IdentityMapper;
-import org.apache.cloudstack.api.Implementation;
-import org.apache.cloudstack.api.Parameter;
-import org.apache.cloudstack.api.ServerApiException;
-import com.cloud.api.response.ZoneResponse;
-import com.cloud.dc.DataCenter;
-import com.cloud.user.Account;
-import com.cloud.user.UserContext;
-
-@Implementation(description="Creates a Zone.", responseObject=ZoneResponse.class)
-public class CreateZoneCmd extends BaseCmd {
- public static final Logger s_logger = Logger.getLogger(CreateZoneCmd.class.getName());
-
- private static final String s_name = "createzoneresponse";
-
- /////////////////////////////////////////////////////
- //////////////// API parameters /////////////////////
- /////////////////////////////////////////////////////
-
- @Parameter(name=ApiConstants.DNS1, type=CommandType.STRING, required=true, description="the first DNS for the Zone")
- private String dns1;
-
- @Parameter(name=ApiConstants.DNS2, type=CommandType.STRING, description="the second DNS for the Zone")
- private String dns2;
-
- @Parameter(name=ApiConstants.GUEST_CIDR_ADDRESS, type=CommandType.STRING, description="the guest CIDR address for the Zone")
- private String guestCidrAddress;
-
- @Parameter(name=ApiConstants.INTERNAL_DNS1, type=CommandType.STRING, required=true, description="the first internal DNS for the Zone")
- private String internalDns1;
-
- @Parameter(name=ApiConstants.INTERNAL_DNS2, type=CommandType.STRING, description="the second internal DNS for the Zone")
- private String internalDns2;
-
- @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=true, description="the name of the Zone")
- private String zoneName;
-
- @Parameter(name=ApiConstants.DOMAIN, type=CommandType.STRING, description="Network domain name for the networks in the zone")
- private String domain;
-
- @IdentityMapper(entityTableName="domain")
- @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="the ID of the containing domain, null for public zones")
- private Long domainId;
-
- @Parameter(name=ApiConstants.NETWORK_TYPE, type=CommandType.STRING, required=true, description="network type of the zone, can be Basic or Advanced")
- private String networkType;
-
- @Parameter(name=ApiConstants.ALLOCATION_STATE, type=CommandType.STRING, description="Allocation state of this Zone for allocation of new resources")
- private String allocationState;
-
- @Parameter(name=ApiConstants.SECURITY_GROUP_EANBLED, type=CommandType.BOOLEAN, description="true if network is security group enabled, false otherwise")
- private Boolean securitygroupenabled;
-
- @Parameter(name=ApiConstants.LOCAL_STORAGE_ENABLED, type=CommandType.BOOLEAN, description="true if local storage offering enabled, false otherwise")
- private Boolean localStorageEnabled;
-
- /////////////////////////////////////////////////////
- /////////////////// Accessors ///////////////////////
- /////////////////////////////////////////////////////
-
- public String getDns1() {
- return dns1;
- }
-
- public String getDns2() {
- return dns2;
- }
-
- public String getGuestCidrAddress() {
- return guestCidrAddress;
- }
-
- public String getInternalDns1() {
- return internalDns1;
- }
-
- public String getInternalDns2() {
- return internalDns2;
- }
-
- public String getZoneName() {
- return zoneName;
- }
-
- public String getDomain() {
- return domain;
- }
-
- public Long getDomainId(){
- return domainId;
- }
-
- public String getNetworkType(){
- return networkType;
- }
-
- public String getAllocationState() {
- return allocationState;
- }
-
- public Boolean getSecuritygroupenabled() {
- if (securitygroupenabled == null) {
- return false;
- }
- return securitygroupenabled;
- }
-
- public Boolean getLocalStorageEnabled() {
- if (localStorageEnabled == null) {
- return false;
- }
- return localStorageEnabled;
- }
-
- /////////////////////////////////////////////////////
- /////////////// API Implementation///////////////////
- @Override
- public String getCommandName() {
- return s_name;
- }
-
- @Override
- public long getEntityOwnerId() {
- return Account.ACCOUNT_ID_SYSTEM;
- }
-
- @Override
- public void execute(){
- UserContext.current().setEventDetails("Zone Name: "+getZoneName());
- DataCenter result = _configService.createZone(this);
- if (result != null){
- ZoneResponse response = _responseGenerator.createZoneResponse(result,false);
- response.setResponseName(getCommandName());
- this.setResponseObject(response);
- } else {
- throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create a zone");
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c3853677/api/src/com/cloud/api/commands/DeleteZoneCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/DeleteZoneCmd.java b/api/src/com/cloud/api/commands/DeleteZoneCmd.java
deleted file mode 100644
index 5a61a93..0000000
--- a/api/src/com/cloud/api/commands/DeleteZoneCmd.java
+++ /dev/null
@@ -1,80 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.api.commands;
-
-import org.apache.log4j.Logger;
-
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.BaseCmd;
-import org.apache.cloudstack.api.IdentityMapper;
-import org.apache.cloudstack.api.Implementation;
-import org.apache.cloudstack.api.Parameter;
-import org.apache.cloudstack.api.ServerApiException;
-import com.cloud.api.response.SuccessResponse;
-import com.cloud.user.Account;
-import com.cloud.user.UserContext;
-
-@Implementation(description="Deletes a Zone.", responseObject=SuccessResponse.class)
-public class DeleteZoneCmd extends BaseCmd {
- public static final Logger s_logger = Logger.getLogger(DeleteZoneCmd.class.getName());
-
- private static final String s_name = "deletezoneresponse";
-
- /////////////////////////////////////////////////////
- //////////////// API parameters /////////////////////
- /////////////////////////////////////////////////////
-
- @IdentityMapper(entityTableName="data_center")
- @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the Zone")
- private Long id;
-
-
- /////////////////////////////////////////////////////
- /////////////////// Accessors ///////////////////////
- /////////////////////////////////////////////////////
-
- public Long getId() {
- return id;
- }
-
-
- /////////////////////////////////////////////////////
- /////////////// API Implementation///////////////////
- /////////////////////////////////////////////////////
-
- @Override
- public String getCommandName() {
- return s_name;
- }
-
- @Override
- public long getEntityOwnerId() {
- return Account.ACCOUNT_ID_SYSTEM;
- }
-
- @Override
- public void execute(){
- UserContext.current().setEventDetails("Zone Id: "+getId());
- boolean result = _configService.deleteZone(this);
- if (result) {
- SuccessResponse response = new SuccessResponse(getCommandName());
- this.setResponseObject(response);
- } else {
- throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete zone");
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c3853677/api/src/com/cloud/api/commands/MarkDefaultZoneForAccountCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/MarkDefaultZoneForAccountCmd.java b/api/src/com/cloud/api/commands/MarkDefaultZoneForAccountCmd.java
deleted file mode 100644
index 1af9445..0000000
--- a/api/src/com/cloud/api/commands/MarkDefaultZoneForAccountCmd.java
+++ /dev/null
@@ -1,114 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-package com.cloud.api.commands;
-
-import org.apache.log4j.Logger;
-
-import org.apache.cloudstack.api.BaseAsyncCmd;
-import org.apache.cloudstack.api.Implementation;
-import org.apache.cloudstack.api.Parameter;
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.IdentityMapper;
-import com.cloud.user.Account;
-import com.cloud.event.EventTypes;
-import com.cloud.async.AsyncJob;
-import com.cloud.api.response.AccountResponse;
-import org.apache.cloudstack.api.ServerApiException;
-import org.apache.cloudstack.api.BaseCmd;
-
-@Implementation(description="Marks a default zone for this account", responseObject=AccountResponse.class, since="4.0")
-public class MarkDefaultZoneForAccountCmd extends BaseAsyncCmd {
- public static final Logger s_logger = Logger.getLogger(MarkDefaultZoneForAccountCmd.class.getName());
-
- private static final String s_name = "markdefaultzoneforaccountresponse";
-
- /////////////////////////////////////////////////////
- ////////////////API parameters //////////////////////
- /////////////////////////////////////////////////////
-
- @IdentityMapper(entityTableName="account")
- @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, required=true, description="Name of the account that is to be marked.")
- private String accountName;
-
- @IdentityMapper(entityTableName="domain")
- @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, required=true, description="Marks the account that belongs to the specified domain.")
- private Long domainId;
-
- @IdentityMapper(entityTableName="data_center")
- @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, required=true, description="The Zone ID with which the account is to be marked.")
- private Long defaultZoneId;
-
- /////////////////////////////////////////////////////
- /////////////////// Accessors ///////////////////////
- /////////////////////////////////////////////////////
-
- public String getAccountName() {
- return accountName;
- }
-
- public Long getDomainId() {
- return domainId;
- }
-
- public Long getDefaultZoneId() {
- return defaultZoneId;
- }
-
- /////////////////////////////////////////////////////
- /////////////// API Implementation///////////////////
- /////////////////////////////////////////////////////
-
- @Override
- public String getCommandName() {
- return s_name;
- }
-
- @Override
- public long getEntityOwnerId() {
- return Account.ACCOUNT_ID_SYSTEM;
- }
-
- @Override
- public String getEventType() {
- return EventTypes.EVENT_ACCOUNT_MARK_DEFAULT_ZONE;
- }
-
- @Override
- public String getEventDescription() {
- return "Marking account with the default zone: " + getDefaultZoneId();
- }
-
- @Override
- public AsyncJob.Type getInstanceType() {
- return AsyncJob.Type.Account;
- }
-
- @Override
- public void execute(){
- Account result = _configService.markDefaultZone(getAccountName(),getDomainId(), getDefaultZoneId());
- if (result != null) {
- AccountResponse response = _responseGenerator.createAccountResponse(result);
- response.setResponseName(getCommandName());
- this.setResponseObject(response);
- }
- else {
- throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to mark the account with the default zone");
- }
- }
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c3853677/api/src/com/cloud/api/commands/UpdateZoneCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/UpdateZoneCmd.java b/api/src/com/cloud/api/commands/UpdateZoneCmd.java
deleted file mode 100755
index 36c3404..0000000
--- a/api/src/com/cloud/api/commands/UpdateZoneCmd.java
+++ /dev/null
@@ -1,174 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.api.commands;
-
-import java.util.List;
-import java.util.Map;
-
-import org.apache.log4j.Logger;
-
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.BaseCmd;
-import org.apache.cloudstack.api.IdentityMapper;
-import org.apache.cloudstack.api.Implementation;
-import org.apache.cloudstack.api.Parameter;
-import org.apache.cloudstack.api.ServerApiException;
-import com.cloud.api.response.ZoneResponse;
-import com.cloud.dc.DataCenter;
-import com.cloud.user.Account;
-import com.cloud.user.UserContext;
-
-@Implementation(description="Updates a Zone.", responseObject=ZoneResponse.class)
-public class UpdateZoneCmd extends BaseCmd {
- public static final Logger s_logger = Logger.getLogger(UpdateZoneCmd.class.getName());
-
- private static final String s_name = "updatezoneresponse";
-
- /////////////////////////////////////////////////////
- //////////////// API parameters /////////////////////
- /////////////////////////////////////////////////////
-
- @Parameter(name=ApiConstants.DNS1, type=CommandType.STRING, description="the first DNS for the Zone")
- private String dns1;
-
- @Parameter(name=ApiConstants.DNS2, type=CommandType.STRING, description="the second DNS for the Zone")
- private String dns2;
-
- @Parameter(name=ApiConstants.GUEST_CIDR_ADDRESS, type=CommandType.STRING, description="the guest CIDR address for the Zone")
- private String guestCidrAddress;
-
- @IdentityMapper(entityTableName="data_center")
- @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the Zone")
- private Long id;
-
- @Parameter(name=ApiConstants.INTERNAL_DNS1, type=CommandType.STRING, description="the first internal DNS for the Zone")
- private String internalDns1;
-
- @Parameter(name=ApiConstants.INTERNAL_DNS2, type=CommandType.STRING, description="the second internal DNS for the Zone")
- private String internalDns2;
-
- @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="the name of the Zone")
- private String zoneName;
-
- @Parameter(name=ApiConstants.IS_PUBLIC, type=CommandType.BOOLEAN, description="updates a private zone to public if set, but not vice-versa")
- private Boolean isPublic;
-
- @Parameter(name=ApiConstants.ALLOCATION_STATE, type=CommandType.STRING, description="Allocation state of this cluster for allocation of new resources")
- private String allocationState;
-
- @Parameter(name=ApiConstants.DETAILS, type=CommandType.MAP, description="the details for the Zone")
- private Map details;
-
- @Parameter(name=ApiConstants.DHCP_PROVIDER, type=CommandType.STRING, description="the dhcp Provider for the Zone")
- private String dhcpProvider;
-
- @Parameter(name=ApiConstants.DOMAIN, type=CommandType.STRING, description="Network domain name for the networks in the zone; empty string will update domain with NULL value")
- private String domain;
-
- @Parameter(name=ApiConstants.DNS_SEARCH_ORDER, type=CommandType.LIST, collectionType = CommandType.STRING, description="the dns search order list")
- private List<String> dnsSearchOrder;
-
- @Parameter(name=ApiConstants.LOCAL_STORAGE_ENABLED, type=CommandType.BOOLEAN, description="true if local storage offering enabled, false otherwise")
- private Boolean localStorageEnabled;
-
- /////////////////////////////////////////////////////
- /////////////////// Accessors ///////////////////////
- /////////////////////////////////////////////////////
-
- public String getDns1() {
- return dns1;
- }
-
- public String getDns2() {
- return dns2;
- }
-
- public String getGuestCidrAddress() {
- return guestCidrAddress;
- }
-
- public Long getId() {
- return id;
- }
-
- public String getInternalDns1() {
- return internalDns1;
- }
-
- public String getInternalDns2() {
- return internalDns2;
- }
-
- public String getZoneName() {
- return zoneName;
- }
-
- public Boolean isPublic() {
- return isPublic;
- }
-
- public String getAllocationState() {
- return allocationState;
- }
-
- public Map getDetails() {
- return details;
- }
-
- public String getDhcpProvider() {
- return dhcpProvider;
- }
-
- public String getDomain() {
- return domain;
- }
-
- public List<String> getDnsSearchOrder() {
- return dnsSearchOrder;
- }
-
- public Boolean getLocalStorageEnabled() {
- return localStorageEnabled;
- }
-
- /////////////////////////////////////////////////////
- /////////////// API Implementation///////////////////
- /////////////////////////////////////////////////////
-
- @Override
- public String getCommandName() {
- return s_name;
- }
-
- @Override
- public long getEntityOwnerId() {
- return Account.ACCOUNT_ID_SYSTEM;
- }
-
- @Override
- public void execute(){
- UserContext.current().setEventDetails("Zone Id: "+getId());
- DataCenter result = _configService.editZone(this);
- if (result != null) {
- ZoneResponse response = _responseGenerator.createZoneResponse(result, false);
- response.setResponseName(getCommandName());
- this.setResponseObject(response);
- } else {
- throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update zone; internal error.");
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c3853677/api/src/com/cloud/configuration/ConfigurationService.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/configuration/ConfigurationService.java b/api/src/com/cloud/configuration/ConfigurationService.java
index c27e6c7..f807297 100644
--- a/api/src/com/cloud/configuration/ConfigurationService.java
+++ b/api/src/com/cloud/configuration/ConfigurationService.java
@@ -24,13 +24,13 @@ import com.cloud.api.commands.CreateDiskOfferingCmd;
import org.apache.cloudstack.api.admin.network.command.CreateNetworkOfferingCmd;
import com.cloud.api.commands.CreateServiceOfferingCmd;
import com.cloud.api.commands.CreateVlanIpRangeCmd;
-import com.cloud.api.commands.CreateZoneCmd;
+import org.apache.cloudstack.api.admin.zone.command.CreateZoneCmd;
import com.cloud.api.commands.DeleteDiskOfferingCmd;
import org.apache.cloudstack.api.admin.network.command.DeleteNetworkOfferingCmd;
import com.cloud.api.commands.DeletePodCmd;
import com.cloud.api.commands.DeleteServiceOfferingCmd;
import com.cloud.api.commands.DeleteVlanIpRangeCmd;
-import com.cloud.api.commands.DeleteZoneCmd;
+import org.apache.cloudstack.api.admin.zone.command.DeleteZoneCmd;
import com.cloud.api.commands.LDAPConfigCmd;
import com.cloud.api.commands.LDAPRemoveCmd;
import org.apache.cloudstack.api.user.network.command.ListNetworkOfferingsCmd;
@@ -39,7 +39,7 @@ import com.cloud.api.commands.UpdateDiskOfferingCmd;
import org.apache.cloudstack.api.admin.network.command.UpdateNetworkOfferingCmd;
import com.cloud.api.commands.UpdatePodCmd;
import com.cloud.api.commands.UpdateServiceOfferingCmd;
-import com.cloud.api.commands.UpdateZoneCmd;
+import org.apache.cloudstack.api.admin.zone.command.UpdateZoneCmd;
import com.cloud.dc.DataCenter;
import com.cloud.dc.Pod;
import com.cloud.dc.Vlan;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c3853677/api/src/org/apache/cloudstack/api/admin/zone/command/CreateZoneCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/admin/zone/command/CreateZoneCmd.java b/api/src/org/apache/cloudstack/api/admin/zone/command/CreateZoneCmd.java
new file mode 100755
index 0000000..30d288b
--- /dev/null
+++ b/api/src/org/apache/cloudstack/api/admin/zone/command/CreateZoneCmd.java
@@ -0,0 +1,161 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.api.admin.zone.command;
+
+import org.apache.log4j.Logger;
+
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.IdentityMapper;
+import org.apache.cloudstack.api.Implementation;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import com.cloud.api.response.ZoneResponse;
+import com.cloud.dc.DataCenter;
+import com.cloud.user.Account;
+import com.cloud.user.UserContext;
+
+@Implementation(description="Creates a Zone.", responseObject=ZoneResponse.class)
+public class CreateZoneCmd extends BaseCmd {
+ public static final Logger s_logger = Logger.getLogger(CreateZoneCmd.class.getName());
+
+ private static final String s_name = "createzoneresponse";
+
+ /////////////////////////////////////////////////////
+ //////////////// API parameters /////////////////////
+ /////////////////////////////////////////////////////
+
+ @Parameter(name=ApiConstants.DNS1, type=CommandType.STRING, required=true, description="the first DNS for the Zone")
+ private String dns1;
+
+ @Parameter(name=ApiConstants.DNS2, type=CommandType.STRING, description="the second DNS for the Zone")
+ private String dns2;
+
+ @Parameter(name=ApiConstants.GUEST_CIDR_ADDRESS, type=CommandType.STRING, description="the guest CIDR address for the Zone")
+ private String guestCidrAddress;
+
+ @Parameter(name=ApiConstants.INTERNAL_DNS1, type=CommandType.STRING, required=true, description="the first internal DNS for the Zone")
+ private String internalDns1;
+
+ @Parameter(name=ApiConstants.INTERNAL_DNS2, type=CommandType.STRING, description="the second internal DNS for the Zone")
+ private String internalDns2;
+
+ @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=true, description="the name of the Zone")
+ private String zoneName;
+
+ @Parameter(name=ApiConstants.DOMAIN, type=CommandType.STRING, description="Network domain name for the networks in the zone")
+ private String domain;
+
+ @IdentityMapper(entityTableName="domain")
+ @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="the ID of the containing domain, null for public zones")
+ private Long domainId;
+
+ @Parameter(name=ApiConstants.NETWORK_TYPE, type=CommandType.STRING, required=true, description="network type of the zone, can be Basic or Advanced")
+ private String networkType;
+
+ @Parameter(name=ApiConstants.ALLOCATION_STATE, type=CommandType.STRING, description="Allocation state of this Zone for allocation of new resources")
+ private String allocationState;
+
+ @Parameter(name=ApiConstants.SECURITY_GROUP_EANBLED, type=CommandType.BOOLEAN, description="true if network is security group enabled, false otherwise")
+ private Boolean securitygroupenabled;
+
+ @Parameter(name=ApiConstants.LOCAL_STORAGE_ENABLED, type=CommandType.BOOLEAN, description="true if local storage offering enabled, false otherwise")
+ private Boolean localStorageEnabled;
+
+ /////////////////////////////////////////////////////
+ /////////////////// Accessors ///////////////////////
+ /////////////////////////////////////////////////////
+
+ public String getDns1() {
+ return dns1;
+ }
+
+ public String getDns2() {
+ return dns2;
+ }
+
+ public String getGuestCidrAddress() {
+ return guestCidrAddress;
+ }
+
+ public String getInternalDns1() {
+ return internalDns1;
+ }
+
+ public String getInternalDns2() {
+ return internalDns2;
+ }
+
+ public String getZoneName() {
+ return zoneName;
+ }
+
+ public String getDomain() {
+ return domain;
+ }
+
+ public Long getDomainId(){
+ return domainId;
+ }
+
+ public String getNetworkType(){
+ return networkType;
+ }
+
+ public String getAllocationState() {
+ return allocationState;
+ }
+
+ public Boolean getSecuritygroupenabled() {
+ if (securitygroupenabled == null) {
+ return false;
+ }
+ return securitygroupenabled;
+ }
+
+ public Boolean getLocalStorageEnabled() {
+ if (localStorageEnabled == null) {
+ return false;
+ }
+ return localStorageEnabled;
+ }
+
+ /////////////////////////////////////////////////////
+ /////////////// API Implementation///////////////////
+ @Override
+ public String getCommandName() {
+ return s_name;
+ }
+
+ @Override
+ public long getEntityOwnerId() {
+ return Account.ACCOUNT_ID_SYSTEM;
+ }
+
+ @Override
+ public void execute(){
+ UserContext.current().setEventDetails("Zone Name: "+getZoneName());
+ DataCenter result = _configService.createZone(this);
+ if (result != null){
+ ZoneResponse response = _responseGenerator.createZoneResponse(result,false);
+ response.setResponseName(getCommandName());
+ this.setResponseObject(response);
+ } else {
+ throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create a zone");
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c3853677/api/src/org/apache/cloudstack/api/admin/zone/command/DeleteZoneCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/admin/zone/command/DeleteZoneCmd.java b/api/src/org/apache/cloudstack/api/admin/zone/command/DeleteZoneCmd.java
new file mode 100644
index 0000000..1144cb3
--- /dev/null
+++ b/api/src/org/apache/cloudstack/api/admin/zone/command/DeleteZoneCmd.java
@@ -0,0 +1,80 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.api.admin.zone.command;
+
+import org.apache.log4j.Logger;
+
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.IdentityMapper;
+import org.apache.cloudstack.api.Implementation;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import com.cloud.api.response.SuccessResponse;
+import com.cloud.user.Account;
+import com.cloud.user.UserContext;
+
+@Implementation(description="Deletes a Zone.", responseObject=SuccessResponse.class)
+public class DeleteZoneCmd extends BaseCmd {
+ public static final Logger s_logger = Logger.getLogger(DeleteZoneCmd.class.getName());
+
+ private static final String s_name = "deletezoneresponse";
+
+ /////////////////////////////////////////////////////
+ //////////////// API parameters /////////////////////
+ /////////////////////////////////////////////////////
+
+ @IdentityMapper(entityTableName="data_center")
+ @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the Zone")
+ private Long id;
+
+
+ /////////////////////////////////////////////////////
+ /////////////////// Accessors ///////////////////////
+ /////////////////////////////////////////////////////
+
+ public Long getId() {
+ return id;
+ }
+
+
+ /////////////////////////////////////////////////////
+ /////////////// API Implementation///////////////////
+ /////////////////////////////////////////////////////
+
+ @Override
+ public String getCommandName() {
+ return s_name;
+ }
+
+ @Override
+ public long getEntityOwnerId() {
+ return Account.ACCOUNT_ID_SYSTEM;
+ }
+
+ @Override
+ public void execute(){
+ UserContext.current().setEventDetails("Zone Id: "+getId());
+ boolean result = _configService.deleteZone(this);
+ if (result) {
+ SuccessResponse response = new SuccessResponse(getCommandName());
+ this.setResponseObject(response);
+ } else {
+ throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete zone");
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c3853677/api/src/org/apache/cloudstack/api/admin/zone/command/MarkDefaultZoneForAccountCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/admin/zone/command/MarkDefaultZoneForAccountCmd.java b/api/src/org/apache/cloudstack/api/admin/zone/command/MarkDefaultZoneForAccountCmd.java
new file mode 100644
index 0000000..fe130f7
--- /dev/null
+++ b/api/src/org/apache/cloudstack/api/admin/zone/command/MarkDefaultZoneForAccountCmd.java
@@ -0,0 +1,114 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.cloudstack.api.admin.zone.command;
+
+import org.apache.log4j.Logger;
+
+import org.apache.cloudstack.api.BaseAsyncCmd;
+import org.apache.cloudstack.api.Implementation;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.IdentityMapper;
+import com.cloud.user.Account;
+import com.cloud.event.EventTypes;
+import com.cloud.async.AsyncJob;
+import com.cloud.api.response.AccountResponse;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.BaseCmd;
+
+@Implementation(description="Marks a default zone for this account", responseObject=AccountResponse.class, since="4.0")
+public class MarkDefaultZoneForAccountCmd extends BaseAsyncCmd {
+ public static final Logger s_logger = Logger.getLogger(MarkDefaultZoneForAccountCmd.class.getName());
+
+ private static final String s_name = "markdefaultzoneforaccountresponse";
+
+ /////////////////////////////////////////////////////
+ ////////////////API parameters //////////////////////
+ /////////////////////////////////////////////////////
+
+ @IdentityMapper(entityTableName="account")
+ @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, required=true, description="Name of the account that is to be marked.")
+ private String accountName;
+
+ @IdentityMapper(entityTableName="domain")
+ @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, required=true, description="Marks the account that belongs to the specified domain.")
+ private Long domainId;
+
+ @IdentityMapper(entityTableName="data_center")
+ @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, required=true, description="The Zone ID with which the account is to be marked.")
+ private Long defaultZoneId;
+
+ /////////////////////////////////////////////////////
+ /////////////////// Accessors ///////////////////////
+ /////////////////////////////////////////////////////
+
+ public String getAccountName() {
+ return accountName;
+ }
+
+ public Long getDomainId() {
+ return domainId;
+ }
+
+ public Long getDefaultZoneId() {
+ return defaultZoneId;
+ }
+
+ /////////////////////////////////////////////////////
+ /////////////// API Implementation///////////////////
+ /////////////////////////////////////////////////////
+
+ @Override
+ public String getCommandName() {
+ return s_name;
+ }
+
+ @Override
+ public long getEntityOwnerId() {
+ return Account.ACCOUNT_ID_SYSTEM;
+ }
+
+ @Override
+ public String getEventType() {
+ return EventTypes.EVENT_ACCOUNT_MARK_DEFAULT_ZONE;
+ }
+
+ @Override
+ public String getEventDescription() {
+ return "Marking account with the default zone: " + getDefaultZoneId();
+ }
+
+ @Override
+ public AsyncJob.Type getInstanceType() {
+ return AsyncJob.Type.Account;
+ }
+
+ @Override
+ public void execute(){
+ Account result = _configService.markDefaultZone(getAccountName(),getDomainId(), getDefaultZoneId());
+ if (result != null) {
+ AccountResponse response = _responseGenerator.createAccountResponse(result);
+ response.setResponseName(getCommandName());
+ this.setResponseObject(response);
+ }
+ else {
+ throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to mark the account with the default zone");
+ }
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c3853677/api/src/org/apache/cloudstack/api/admin/zone/command/UpdateZoneCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/admin/zone/command/UpdateZoneCmd.java b/api/src/org/apache/cloudstack/api/admin/zone/command/UpdateZoneCmd.java
new file mode 100755
index 0000000..59e715d
--- /dev/null
+++ b/api/src/org/apache/cloudstack/api/admin/zone/command/UpdateZoneCmd.java
@@ -0,0 +1,174 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.api.admin.zone.command;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.log4j.Logger;
+
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.IdentityMapper;
+import org.apache.cloudstack.api.Implementation;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import com.cloud.api.response.ZoneResponse;
+import com.cloud.dc.DataCenter;
+import com.cloud.user.Account;
+import com.cloud.user.UserContext;
+
+@Implementation(description="Updates a Zone.", responseObject=ZoneResponse.class)
+public class UpdateZoneCmd extends BaseCmd {
+ public static final Logger s_logger = Logger.getLogger(UpdateZoneCmd.class.getName());
+
+ private static final String s_name = "updatezoneresponse";
+
+ /////////////////////////////////////////////////////
+ //////////////// API parameters /////////////////////
+ /////////////////////////////////////////////////////
+
+ @Parameter(name=ApiConstants.DNS1, type=CommandType.STRING, description="the first DNS for the Zone")
+ private String dns1;
+
+ @Parameter(name=ApiConstants.DNS2, type=CommandType.STRING, description="the second DNS for the Zone")
+ private String dns2;
+
+ @Parameter(name=ApiConstants.GUEST_CIDR_ADDRESS, type=CommandType.STRING, description="the guest CIDR address for the Zone")
+ private String guestCidrAddress;
+
+ @IdentityMapper(entityTableName="data_center")
+ @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the Zone")
+ private Long id;
+
+ @Parameter(name=ApiConstants.INTERNAL_DNS1, type=CommandType.STRING, description="the first internal DNS for the Zone")
+ private String internalDns1;
+
+ @Parameter(name=ApiConstants.INTERNAL_DNS2, type=CommandType.STRING, description="the second internal DNS for the Zone")
+ private String internalDns2;
+
+ @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="the name of the Zone")
+ private String zoneName;
+
+ @Parameter(name=ApiConstants.IS_PUBLIC, type=CommandType.BOOLEAN, description="updates a private zone to public if set, but not vice-versa")
+ private Boolean isPublic;
+
+ @Parameter(name=ApiConstants.ALLOCATION_STATE, type=CommandType.STRING, description="Allocation state of this cluster for allocation of new resources")
+ private String allocationState;
+
+ @Parameter(name=ApiConstants.DETAILS, type=CommandType.MAP, description="the details for the Zone")
+ private Map details;
+
+ @Parameter(name=ApiConstants.DHCP_PROVIDER, type=CommandType.STRING, description="the dhcp Provider for the Zone")
+ private String dhcpProvider;
+
+ @Parameter(name=ApiConstants.DOMAIN, type=CommandType.STRING, description="Network domain name for the networks in the zone; empty string will update domain with NULL value")
+ private String domain;
+
+ @Parameter(name=ApiConstants.DNS_SEARCH_ORDER, type=CommandType.LIST, collectionType = CommandType.STRING, description="the dns search order list")
+ private List<String> dnsSearchOrder;
+
+ @Parameter(name=ApiConstants.LOCAL_STORAGE_ENABLED, type=CommandType.BOOLEAN, description="true if local storage offering enabled, false otherwise")
+ private Boolean localStorageEnabled;
+
+ /////////////////////////////////////////////////////
+ /////////////////// Accessors ///////////////////////
+ /////////////////////////////////////////////////////
+
+ public String getDns1() {
+ return dns1;
+ }
+
+ public String getDns2() {
+ return dns2;
+ }
+
+ public String getGuestCidrAddress() {
+ return guestCidrAddress;
+ }
+
+ public Long getId() {
+ return id;
+ }
+
+ public String getInternalDns1() {
+ return internalDns1;
+ }
+
+ public String getInternalDns2() {
+ return internalDns2;
+ }
+
+ public String getZoneName() {
+ return zoneName;
+ }
+
+ public Boolean isPublic() {
+ return isPublic;
+ }
+
+ public String getAllocationState() {
+ return allocationState;
+ }
+
+ public Map getDetails() {
+ return details;
+ }
+
+ public String getDhcpProvider() {
+ return dhcpProvider;
+ }
+
+ public String getDomain() {
+ return domain;
+ }
+
+ public List<String> getDnsSearchOrder() {
+ return dnsSearchOrder;
+ }
+
+ public Boolean getLocalStorageEnabled() {
+ return localStorageEnabled;
+ }
+
+ /////////////////////////////////////////////////////
+ /////////////// API Implementation///////////////////
+ /////////////////////////////////////////////////////
+
+ @Override
+ public String getCommandName() {
+ return s_name;
+ }
+
+ @Override
+ public long getEntityOwnerId() {
+ return Account.ACCOUNT_ID_SYSTEM;
+ }
+
+ @Override
+ public void execute(){
+ UserContext.current().setEventDetails("Zone Id: "+getId());
+ DataCenter result = _configService.editZone(this);
+ if (result != null) {
+ ZoneResponse response = _responseGenerator.createZoneResponse(result, false);
+ response.setResponseName(getCommandName());
+ this.setResponseObject(response);
+ } else {
+ throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update zone; internal error.");
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c3853677/client/tomcatconf/commands.properties.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/commands.properties.in b/client/tomcatconf/commands.properties.in
index 1379504..a5d609e 100755
--- a/client/tomcatconf/commands.properties.in
+++ b/client/tomcatconf/commands.properties.in
@@ -26,7 +26,7 @@ disableAccount=org.apache.cloudstack.api.admin.account.command.DisableAccountCmd
enableAccount=org.apache.cloudstack.api.admin.account.command.EnableAccountCmd;7
###lockAccount=com.cloud.api.commands.LockAccountCmd;7
listAccounts=org.apache.cloudstack.api.user.account.command.ListAccountsCmd;15
-markDefaultZoneForAccount=com.cloud.api.commands.MarkDefaultZoneForAccountCmd;1
+markDefaultZoneForAccount=org.apache.cloudstack.api.admin.zone.command.MarkDefaultZoneForAccountCmd;1
#### User commands
createUser=org.apache.cloudstack.api.admin.user.command.CreateUserCmd;3
@@ -209,9 +209,9 @@ deletePod=com.cloud.api.commands.DeletePodCmd;1
listPods=com.cloud.api.commands.ListPodsByCmd;3
#### zone commands
-createZone=com.cloud.api.commands.CreateZoneCmd;1
-updateZone=com.cloud.api.commands.UpdateZoneCmd;1
-deleteZone=com.cloud.api.commands.DeleteZoneCmd;1
+createZone=org.apache.cloudstack.api.admin.zone.command.CreateZoneCmd;1
+updateZone=org.apache.cloudstack.api.admin.zone.command.UpdateZoneCmd;1
+deleteZone=org.apache.cloudstack.api.admin.zone.command.DeleteZoneCmd;1
listZones=org.apache.cloudstack.api.user.zone.command.ListZonesByCmd;15
#### events commands
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c3853677/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
index bff0cd5..f3b1e2f 100755
--- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
+++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
@@ -40,6 +40,8 @@ import javax.naming.directory.InitialDirContext;
import org.apache.cloudstack.api.admin.network.command.DeleteNetworkOfferingCmd;
import org.apache.cloudstack.api.admin.network.command.UpdateNetworkOfferingCmd;
+import org.apache.cloudstack.api.admin.zone.command.CreateZoneCmd;
+import org.apache.cloudstack.api.admin.zone.command.UpdateZoneCmd;
import org.apache.log4j.Logger;
import com.cloud.acl.SecurityChecker;
@@ -50,12 +52,11 @@ import com.cloud.api.commands.CreateDiskOfferingCmd;
import org.apache.cloudstack.api.admin.network.command.CreateNetworkOfferingCmd;
import com.cloud.api.commands.CreateServiceOfferingCmd;
import com.cloud.api.commands.CreateVlanIpRangeCmd;
-import com.cloud.api.commands.CreateZoneCmd;
import com.cloud.api.commands.DeleteDiskOfferingCmd;
import com.cloud.api.commands.DeletePodCmd;
import com.cloud.api.commands.DeleteServiceOfferingCmd;
import com.cloud.api.commands.DeleteVlanIpRangeCmd;
-import com.cloud.api.commands.DeleteZoneCmd;
+import org.apache.cloudstack.api.admin.zone.command.DeleteZoneCmd;
import com.cloud.api.commands.LDAPConfigCmd;
import com.cloud.api.commands.LDAPRemoveCmd;
import org.apache.cloudstack.api.user.network.command.ListNetworkOfferingsCmd;
@@ -63,7 +64,6 @@ import com.cloud.api.commands.UpdateCfgCmd;
import com.cloud.api.commands.UpdateDiskOfferingCmd;
import com.cloud.api.commands.UpdatePodCmd;
import com.cloud.api.commands.UpdateServiceOfferingCmd;
-import com.cloud.api.commands.UpdateZoneCmd;
import com.cloud.capacity.dao.CapacityDao;
import com.cloud.configuration.Resource.ResourceType;
import com.cloud.configuration.dao.ConfigurationDao;
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/c3853677/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java b/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java
index c3496f0..1fd10d0 100644
--- a/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java
+++ b/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java
@@ -28,22 +28,22 @@ import com.cloud.api.commands.CreateDiskOfferingCmd;
import org.apache.cloudstack.api.admin.network.command.CreateNetworkOfferingCmd;
import com.cloud.api.commands.CreateServiceOfferingCmd;
import com.cloud.api.commands.CreateVlanIpRangeCmd;
-import com.cloud.api.commands.CreateZoneCmd;
+import org.apache.cloudstack.api.admin.zone.command.CreateZoneCmd;
import com.cloud.api.commands.DeleteDiskOfferingCmd;
import org.apache.cloudstack.api.admin.network.command.DeleteNetworkOfferingCmd;
import com.cloud.api.commands.DeletePodCmd;
import com.cloud.api.commands.DeleteServiceOfferingCmd;
import com.cloud.api.commands.DeleteVlanIpRangeCmd;
-import com.cloud.api.commands.DeleteZoneCmd;
+import org.apache.cloudstack.api.admin.zone.command.DeleteZoneCmd;
import com.cloud.api.commands.LDAPConfigCmd;
import com.cloud.api.commands.LDAPRemoveCmd;
+import org.apache.cloudstack.api.admin.zone.command.UpdateZoneCmd;
import org.apache.cloudstack.api.user.network.command.ListNetworkOfferingsCmd;
import com.cloud.api.commands.UpdateCfgCmd;
import com.cloud.api.commands.UpdateDiskOfferingCmd;
import org.apache.cloudstack.api.admin.network.command.UpdateNetworkOfferingCmd;
import com.cloud.api.commands.UpdatePodCmd;
import com.cloud.api.commands.UpdateServiceOfferingCmd;
-import com.cloud.api.commands.UpdateZoneCmd;
import com.cloud.configuration.Configuration;
import com.cloud.configuration.ConfigurationManager;
import com.cloud.configuration.ConfigurationService;