incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [5/14] git commit: api_refactor: move disk and service offering to admin pkg
Date Thu, 06 Dec 2012 19:14:32 GMT
api_refactor: move disk and service offering to admin pkg

Signed-off-by: Rohit Yadav <bhaisaab@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/1f1ac79a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/1f1ac79a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/1f1ac79a

Branch: refs/heads/api_refactoring
Commit: 1f1ac79a6c91c562ffcfff1279a5cdbf4b171b4c
Parents: ecc8249
Author: Rohit Yadav <bhaisaab@apache.org>
Authored: Thu Dec 6 10:53:42 2012 -0800
Committer: Rohit Yadav <bhaisaab@apache.org>
Committed: Thu Dec 6 10:53:42 2012 -0800

----------------------------------------------------------------------
 .../cloud/api/commands/CreateDiskOfferingCmd.java  |  121 -----------
 .../api/commands/CreateServiceOfferingCmd.java     |  168 ---------------
 .../cloud/api/commands/DeleteDiskOfferingCmd.java  |   76 -------
 .../api/commands/DeleteServiceOfferingCmd.java     |   77 -------
 .../cloud/api/commands/UpdateDiskOfferingCmd.java  |   98 ---------
 .../api/commands/UpdateServiceOfferingCmd.java     |   99 ---------
 .../cloud/configuration/ConfigurationService.java  |   11 +-
 .../offering/command/CreateDiskOfferingCmd.java    |  121 +++++++++++
 .../offering/command/CreateServiceOfferingCmd.java |  168 +++++++++++++++
 .../offering/command/DeleteDiskOfferingCmd.java    |   76 +++++++
 .../offering/command/DeleteServiceOfferingCmd.java |   77 +++++++
 .../offering/command/UpdateDiskOfferingCmd.java    |   98 +++++++++
 .../offering/command/UpdateServiceOfferingCmd.java |   99 +++++++++
 client/tomcatconf/commands.properties.in           |   12 +-
 .../configuration/ConfigurationManagerImpl.java    |   12 +-
 .../cloud/vpc/MockConfigurationManagerImpl.java    |   12 +-
 16 files changed, 662 insertions(+), 663 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/1f1ac79a/api/src/com/cloud/api/commands/CreateDiskOfferingCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/CreateDiskOfferingCmd.java b/api/src/com/cloud/api/commands/CreateDiskOfferingCmd.java
deleted file mode 100755
index 7478933..0000000
--- a/api/src/com/cloud/api/commands/CreateDiskOfferingCmd.java
+++ /dev/null
@@ -1,121 +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.DiskOfferingResponse;
-import com.cloud.offering.DiskOffering;
-import com.cloud.offering.ServiceOffering;
-import com.cloud.user.Account;
-
-@Implementation(description="Creates a disk offering.", responseObject=DiskOfferingResponse.class)
-public class CreateDiskOfferingCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateDiskOfferingCmd.class.getName());
-
-    private static final String s_name = "creatediskofferingresponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-    @Parameter(name=ApiConstants.DISK_SIZE, type=CommandType.LONG, required=false, description="size of the disk offering in GB")
-    private Long diskSize;
-
-    @Parameter(name=ApiConstants.DISPLAY_TEXT, type=CommandType.STRING, required=true, description="alternate display text of the disk offering", length=4096)
-    private String displayText;
-
-    @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=true, description="name of the disk offering")
-    private String offeringName;
-
-    @Parameter(name=ApiConstants.TAGS, type=CommandType.STRING, description="tags for the disk offering", length=4096)
-    private String tags;
-
-    @Parameter(name=ApiConstants.CUSTOMIZED, type=CommandType.BOOLEAN, description="whether disk offering is custom or not")
-    private Boolean customized;
-
-    @IdentityMapper(entityTableName="domain")
-    @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="the ID of the containing domain, null for public offerings")
-    private Long domainId;
-
-    @Parameter(name=ApiConstants.STORAGE_TYPE, type=CommandType.STRING, description="the storage type of the disk offering. Values are local and shared.")
-    private String storageType = ServiceOffering.StorageType.shared.toString();
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public Long getDiskSize() {
-        return diskSize;
-    }
-
-    public String getDisplayText() {
-        return displayText;
-    }
-
-    public String getOfferingName() {
-        return offeringName;
-    }
-
-    public String getTags() {
-        return tags;
-    }
-
-    public Boolean isCustomized(){
-        return customized;
-    }
-
-    public Long getDomainId(){
-        return domainId;
-    }
-
-    public String getStorageType() {
-        return storageType;
-    }
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-
-    @Override
-    public long getEntityOwnerId() {
-        return Account.ACCOUNT_ID_SYSTEM;
-    }
-
-    @Override
-    public void execute(){
-        DiskOffering offering = _configService.createDiskOffering(this);
-        if (offering != null) {
-            DiskOfferingResponse response = _responseGenerator.createDiskOfferingResponse(offering);
-            response.setResponseName(getCommandName());
-            this.setResponseObject(response);
-        } else {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create disk offering");
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/1f1ac79a/api/src/com/cloud/api/commands/CreateServiceOfferingCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/CreateServiceOfferingCmd.java b/api/src/com/cloud/api/commands/CreateServiceOfferingCmd.java
deleted file mode 100644
index 5e49912..0000000
--- a/api/src/com/cloud/api/commands/CreateServiceOfferingCmd.java
+++ /dev/null
@@ -1,168 +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.ServiceOfferingResponse;
-import com.cloud.offering.ServiceOffering;
-import com.cloud.user.Account;
-
-@Implementation(description="Creates a service offering.", responseObject=ServiceOfferingResponse.class)
-public class CreateServiceOfferingCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(CreateServiceOfferingCmd.class.getName());
-    private static final String _name = "createserviceofferingresponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-    @Parameter(name=ApiConstants.CPU_NUMBER, type=CommandType.LONG, required=true, description="the CPU number of the service offering")
-    private Long cpuNumber;
-
-    @Parameter(name=ApiConstants.CPU_SPEED, type=CommandType.LONG, required=true, description="the CPU speed of the service offering in MHz.")
-    private Long cpuSpeed;
-
-    @Parameter(name=ApiConstants.DISPLAY_TEXT, type=CommandType.STRING, required=true, description="the display text of the service offering")
-    private String displayText;
-
-    @Parameter(name=ApiConstants.MEMORY, type=CommandType.LONG, required=true, description="the total memory of the service offering in MB")
-    private Long memory;
-
-    @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=true, description="the name of the service offering")
-    private String serviceOfferingName;
-
-    @Parameter(name=ApiConstants.OFFER_HA, type=CommandType.BOOLEAN, description="the HA for the service offering")
-    private Boolean offerHa;
-
-    @Parameter(name=ApiConstants.LIMIT_CPU_USE, type=CommandType.BOOLEAN, description="restrict the CPU usage to committed service offering")
-    private Boolean limitCpuUse;
-
-    @Parameter(name=ApiConstants.STORAGE_TYPE, type=CommandType.STRING, description="the storage type of the service offering. Values are local and shared.")
-    private String storageType;
-
-    @Parameter(name=ApiConstants.TAGS, type=CommandType.STRING, description="the tags for this service offering.")
-    private String tags;
-
-    @IdentityMapper(entityTableName="domain")
-    @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="the ID of the containing domain, null for public offerings")
-    private Long domainId;
-
-    @Parameter(name=ApiConstants.HOST_TAGS, type=CommandType.STRING, description="the host tag for this service offering.")
-    private String hostTag;
-
-    @Parameter(name=ApiConstants.IS_SYSTEM_OFFERING, type=CommandType.BOOLEAN, description="is this a system vm offering")
-    private Boolean isSystem;
-
-    @Parameter(name=ApiConstants.SYSTEM_VM_TYPE, type=CommandType.STRING, description="the system VM type. Possible types are \"domainrouter\", \"consoleproxy\" and \"secondarystoragevm\".")
-    private String systemVmType;
-
-    @Parameter(name=ApiConstants.NETWORKRATE, type=CommandType.INTEGER, description="data transfer rate in megabits per second allowed. Supported only for non-System offering and system offerings having \"domainrouter\" systemvmtype")
-    private Integer networkRate;
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public Long getCpuNumber() {
-        return cpuNumber;
-    }
-
-    public Long getCpuSpeed() {
-        return cpuSpeed;
-    }
-
-    public String getDisplayText() {
-        return displayText;
-    }
-
-    public Long getMemory() {
-        return memory;
-    }
-
-    public String getServiceOfferingName() {
-        return serviceOfferingName;
-    }
-
-    public Boolean getOfferHa() {
-        return offerHa;
-    }
-
-    public Boolean GetLimitCpuUse() {
-        return limitCpuUse;
-    }
-
-    public String getStorageType() {
-        return storageType;
-    }
-
-    public String getTags() {
-        return tags;
-    }
-
-    public Long getDomainId() {
-        return domainId;
-    }
-
-    public String getHostTag() {
-        return hostTag;
-    }
-
-    public Boolean getIsSystem() {
-        return  isSystem == null ? false : isSystem;
-    }
-
-    public String getSystemVmType() {
-        return systemVmType;
-    }
-
-    public Integer getNetworkRate() {
-        return networkRate;
-    }
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-    @Override
-    public String getCommandName() {
-        return _name;
-    }
-
-    @Override
-    public long getEntityOwnerId() {
-        return Account.ACCOUNT_ID_SYSTEM;
-    }
-
-    @Override
-    public void execute(){
-        ServiceOffering result = _configService.createServiceOffering(this);
-        if (result != null) {
-            ServiceOfferingResponse response = _responseGenerator.createServiceOfferingResponse(result);
-            response.setResponseName(getCommandName());
-            this.setResponseObject(response);
-        } else {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create service offering");
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/1f1ac79a/api/src/com/cloud/api/commands/DeleteDiskOfferingCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/DeleteDiskOfferingCmd.java b/api/src/com/cloud/api/commands/DeleteDiskOfferingCmd.java
deleted file mode 100644
index ee17f5f..0000000
--- a/api/src/com/cloud/api/commands/DeleteDiskOfferingCmd.java
+++ /dev/null
@@ -1,76 +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;
-
-@Implementation(description="Updates a disk offering.", responseObject=SuccessResponse.class)
-public class DeleteDiskOfferingCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(DeleteDiskOfferingCmd.class.getName());
-    private static final String s_name = "deletediskofferingresponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-    @IdentityMapper(entityTableName="disk_offering")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="ID of the disk offering")
-    private Long id;
-
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public Long getId() {
-        return id;
-    }
-
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-    public String getCommandName() {
-        return s_name;
-    }
-
-    @Override
-    public long getEntityOwnerId() {
-        return Account.ACCOUNT_ID_SYSTEM;
-    }
-
-    @Override
-    public void execute(){
-        boolean result = _configService.deleteDiskOffering(this);
-        if (result) {
-            SuccessResponse response = new SuccessResponse(getCommandName());
-            this.setResponseObject(response);
-        } else {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete disk offering");
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/1f1ac79a/api/src/com/cloud/api/commands/DeleteServiceOfferingCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/DeleteServiceOfferingCmd.java b/api/src/com/cloud/api/commands/DeleteServiceOfferingCmd.java
deleted file mode 100644
index e2d0d51..0000000
--- a/api/src/com/cloud/api/commands/DeleteServiceOfferingCmd.java
+++ /dev/null
@@ -1,77 +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;
-
-@Implementation(description="Deletes a service offering.", responseObject=SuccessResponse.class)
-public class DeleteServiceOfferingCmd extends BaseCmd{
-    public static final Logger s_logger = Logger.getLogger(DeleteServiceOfferingCmd.class.getName());
-    private static final String s_name = "deleteserviceofferingresponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-    @IdentityMapper(entityTableName="disk_offering")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the service offering")
-    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(){
-        boolean result = _configService.deleteServiceOffering(this);
-        if (result) {
-            SuccessResponse response = new SuccessResponse(getCommandName());
-            this.setResponseObject(response);
-        } else {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete service offering");
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/1f1ac79a/api/src/com/cloud/api/commands/UpdateDiskOfferingCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/UpdateDiskOfferingCmd.java b/api/src/com/cloud/api/commands/UpdateDiskOfferingCmd.java
deleted file mode 100755
index 6e10495..0000000
--- a/api/src/com/cloud/api/commands/UpdateDiskOfferingCmd.java
+++ /dev/null
@@ -1,98 +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.DiskOfferingResponse;
-import com.cloud.offering.DiskOffering;
-import com.cloud.user.Account;
-
-@Implementation(description="Updates a disk offering.", responseObject=DiskOfferingResponse.class)
-public class UpdateDiskOfferingCmd extends BaseCmd{
-    public static final Logger s_logger = Logger.getLogger(UpdateDiskOfferingCmd.class.getName());
-    private static final String s_name = "updatediskofferingresponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-
-    @Parameter(name=ApiConstants.DISPLAY_TEXT, type=CommandType.STRING, description="updates alternate display text of the disk offering with this value", length=4096)
-    private String displayText;
-
-    @IdentityMapper(entityTableName="disk_offering")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="ID of the disk offering")
-    private Long id;
-
-    @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="updates name of the disk offering with this value")
-    private String diskOfferingName;
-
-    @Parameter(name=ApiConstants.SORT_KEY, type=CommandType.INTEGER, description="sort key of the disk offering, integer")
-    private Integer sortKey;
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public String getDisplayText() {
-        return displayText;
-    }
-
-    public Long getId() {
-        return id;
-    }
-
-    public String getDiskOfferingName() {
-        return diskOfferingName;
-    }
-
-    public Integer getSortKey() {
-        return sortKey;
-    }
-
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-
-    @Override
-    public long getEntityOwnerId() {
-        return Account.ACCOUNT_ID_SYSTEM;
-    }
-
-    @Override
-    public void execute(){
-        DiskOffering result = _configService.updateDiskOffering(this);
-        if (result != null){
-            DiskOfferingResponse response = _responseGenerator.createDiskOfferingResponse(result);
-            response.setResponseName(getCommandName());
-            this.setResponseObject(response);
-        } else {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update disk offering");
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/1f1ac79a/api/src/com/cloud/api/commands/UpdateServiceOfferingCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/UpdateServiceOfferingCmd.java b/api/src/com/cloud/api/commands/UpdateServiceOfferingCmd.java
deleted file mode 100755
index 44487fb..0000000
--- a/api/src/com/cloud/api/commands/UpdateServiceOfferingCmd.java
+++ /dev/null
@@ -1,99 +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.ServiceOfferingResponse;
-import com.cloud.offering.ServiceOffering;
-import com.cloud.user.Account;
-
-@Implementation(description="Updates a service offering.", responseObject=ServiceOfferingResponse.class)
-public class UpdateServiceOfferingCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(UpdateServiceOfferingCmd.class.getName());
-    private static final String s_name = "updateserviceofferingresponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-    @IdentityMapper(entityTableName="disk_offering")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the service offering to be updated")
-    private Long id;
-
-    @Parameter(name=ApiConstants.DISPLAY_TEXT, type=CommandType.STRING, description="the display text of the service offering to be updated")
-    private String displayText;
-
-    @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="the name of the service offering to be updated")
-    private String serviceOfferingName;
-
-    @Parameter(name=ApiConstants.SORT_KEY, type=CommandType.INTEGER, description="sort key of the service offering, integer")
-    private Integer sortKey;
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public String getDisplayText() {
-        return displayText;
-    }
-
-    public Long getId() {
-        return id;
-    }
-
-    public String getServiceOfferingName() {
-        return serviceOfferingName;
-    }
-
-    public Integer getSortKey() {
-        return sortKey;
-    }
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-
-    @Override
-    public long getEntityOwnerId() {
-        return Account.ACCOUNT_ID_SYSTEM;
-    }
-
-    @Override
-    public void execute(){
-        //Note
-        //Once an offering is created, we cannot update the domainId field (keeping consistent with zones logic)
-        ServiceOffering result = _configService.updateServiceOffering(this);
-        if (result != null){
-            ServiceOfferingResponse response = _responseGenerator.createServiceOfferingResponse(result);
-            response.setResponseName(getCommandName());
-            this.setResponseObject(response);
-        } else {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update service offering");
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/1f1ac79a/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 be50981..1218146 100644
--- a/api/src/com/cloud/configuration/ConfigurationService.java
+++ b/api/src/com/cloud/configuration/ConfigurationService.java
@@ -20,25 +20,24 @@ import java.util.List;
 
 import javax.naming.NamingException;
 
-import com.cloud.api.commands.CreateDiskOfferingCmd;
+import org.apache.cloudstack.api.admin.offering.command.*;
 import org.apache.cloudstack.api.admin.network.command.CreateNetworkOfferingCmd;
-import com.cloud.api.commands.CreateServiceOfferingCmd;
+import org.apache.cloudstack.api.admin.offering.command.CreateServiceOfferingCmd;
 import com.cloud.api.commands.CreateVlanIpRangeCmd;
+import org.apache.cloudstack.api.admin.offering.command.CreateDiskOfferingCmd;
 import org.apache.cloudstack.api.admin.zone.command.CreateZoneCmd;
-import com.cloud.api.commands.DeleteDiskOfferingCmd;
+import org.apache.cloudstack.api.admin.offering.command.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 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;
 import org.apache.cloudstack.api.admin.config.command.UpdateCfgCmd;
-import com.cloud.api.commands.UpdateDiskOfferingCmd;
+import org.apache.cloudstack.api.admin.offering.command.UpdateDiskOfferingCmd;
 import org.apache.cloudstack.api.admin.network.command.UpdateNetworkOfferingCmd;
 import com.cloud.api.commands.UpdatePodCmd;
-import com.cloud.api.commands.UpdateServiceOfferingCmd;
 import org.apache.cloudstack.api.admin.zone.command.UpdateZoneCmd;
 import com.cloud.dc.DataCenter;
 import com.cloud.dc.Pod;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/1f1ac79a/api/src/org/apache/cloudstack/api/admin/offering/command/CreateDiskOfferingCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/admin/offering/command/CreateDiskOfferingCmd.java b/api/src/org/apache/cloudstack/api/admin/offering/command/CreateDiskOfferingCmd.java
new file mode 100755
index 0000000..d79c916
--- /dev/null
+++ b/api/src/org/apache/cloudstack/api/admin/offering/command/CreateDiskOfferingCmd.java
@@ -0,0 +1,121 @@
+// 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.offering.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.DiskOfferingResponse;
+import com.cloud.offering.DiskOffering;
+import com.cloud.offering.ServiceOffering;
+import com.cloud.user.Account;
+
+@Implementation(description="Creates a disk offering.", responseObject=DiskOfferingResponse.class)
+public class CreateDiskOfferingCmd extends BaseCmd {
+    public static final Logger s_logger = Logger.getLogger(CreateDiskOfferingCmd.class.getName());
+
+    private static final String s_name = "creatediskofferingresponse";
+
+    /////////////////////////////////////////////////////
+    //////////////// API parameters /////////////////////
+    /////////////////////////////////////////////////////
+
+    @Parameter(name=ApiConstants.DISK_SIZE, type=CommandType.LONG, required=false, description="size of the disk offering in GB")
+    private Long diskSize;
+
+    @Parameter(name=ApiConstants.DISPLAY_TEXT, type=CommandType.STRING, required=true, description="alternate display text of the disk offering", length=4096)
+    private String displayText;
+
+    @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=true, description="name of the disk offering")
+    private String offeringName;
+
+    @Parameter(name=ApiConstants.TAGS, type=CommandType.STRING, description="tags for the disk offering", length=4096)
+    private String tags;
+
+    @Parameter(name=ApiConstants.CUSTOMIZED, type=CommandType.BOOLEAN, description="whether disk offering is custom or not")
+    private Boolean customized;
+
+    @IdentityMapper(entityTableName="domain")
+    @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="the ID of the containing domain, null for public offerings")
+    private Long domainId;
+
+    @Parameter(name=ApiConstants.STORAGE_TYPE, type=CommandType.STRING, description="the storage type of the disk offering. Values are local and shared.")
+    private String storageType = ServiceOffering.StorageType.shared.toString();
+
+    /////////////////////////////////////////////////////
+    /////////////////// Accessors ///////////////////////
+    /////////////////////////////////////////////////////
+
+    public Long getDiskSize() {
+        return diskSize;
+    }
+
+    public String getDisplayText() {
+        return displayText;
+    }
+
+    public String getOfferingName() {
+        return offeringName;
+    }
+
+    public String getTags() {
+        return tags;
+    }
+
+    public Boolean isCustomized(){
+        return customized;
+    }
+
+    public Long getDomainId(){
+        return domainId;
+    }
+
+    public String getStorageType() {
+        return storageType;
+    }
+
+    /////////////////////////////////////////////////////
+    /////////////// API Implementation///////////////////
+    /////////////////////////////////////////////////////
+
+    @Override
+    public String getCommandName() {
+        return s_name;
+    }
+
+    @Override
+    public long getEntityOwnerId() {
+        return Account.ACCOUNT_ID_SYSTEM;
+    }
+
+    @Override
+    public void execute(){
+        DiskOffering offering = _configService.createDiskOffering(this);
+        if (offering != null) {
+            DiskOfferingResponse response = _responseGenerator.createDiskOfferingResponse(offering);
+            response.setResponseName(getCommandName());
+            this.setResponseObject(response);
+        } else {
+            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create disk offering");
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/1f1ac79a/api/src/org/apache/cloudstack/api/admin/offering/command/CreateServiceOfferingCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/admin/offering/command/CreateServiceOfferingCmd.java b/api/src/org/apache/cloudstack/api/admin/offering/command/CreateServiceOfferingCmd.java
new file mode 100644
index 0000000..57954ec
--- /dev/null
+++ b/api/src/org/apache/cloudstack/api/admin/offering/command/CreateServiceOfferingCmd.java
@@ -0,0 +1,168 @@
+// 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.offering.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.ServiceOfferingResponse;
+import com.cloud.offering.ServiceOffering;
+import com.cloud.user.Account;
+
+@Implementation(description="Creates a service offering.", responseObject=ServiceOfferingResponse.class)
+public class CreateServiceOfferingCmd extends BaseCmd {
+    public static final Logger s_logger = Logger.getLogger(CreateServiceOfferingCmd.class.getName());
+    private static final String _name = "createserviceofferingresponse";
+
+    /////////////////////////////////////////////////////
+    //////////////// API parameters /////////////////////
+    /////////////////////////////////////////////////////
+
+    @Parameter(name=ApiConstants.CPU_NUMBER, type=CommandType.LONG, required=true, description="the CPU number of the service offering")
+    private Long cpuNumber;
+
+    @Parameter(name=ApiConstants.CPU_SPEED, type=CommandType.LONG, required=true, description="the CPU speed of the service offering in MHz.")
+    private Long cpuSpeed;
+
+    @Parameter(name=ApiConstants.DISPLAY_TEXT, type=CommandType.STRING, required=true, description="the display text of the service offering")
+    private String displayText;
+
+    @Parameter(name=ApiConstants.MEMORY, type=CommandType.LONG, required=true, description="the total memory of the service offering in MB")
+    private Long memory;
+
+    @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=true, description="the name of the service offering")
+    private String serviceOfferingName;
+
+    @Parameter(name=ApiConstants.OFFER_HA, type=CommandType.BOOLEAN, description="the HA for the service offering")
+    private Boolean offerHa;
+
+    @Parameter(name=ApiConstants.LIMIT_CPU_USE, type=CommandType.BOOLEAN, description="restrict the CPU usage to committed service offering")
+    private Boolean limitCpuUse;
+
+    @Parameter(name=ApiConstants.STORAGE_TYPE, type=CommandType.STRING, description="the storage type of the service offering. Values are local and shared.")
+    private String storageType;
+
+    @Parameter(name=ApiConstants.TAGS, type=CommandType.STRING, description="the tags for this service offering.")
+    private String tags;
+
+    @IdentityMapper(entityTableName="domain")
+    @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="the ID of the containing domain, null for public offerings")
+    private Long domainId;
+
+    @Parameter(name=ApiConstants.HOST_TAGS, type=CommandType.STRING, description="the host tag for this service offering.")
+    private String hostTag;
+
+    @Parameter(name=ApiConstants.IS_SYSTEM_OFFERING, type=CommandType.BOOLEAN, description="is this a system vm offering")
+    private Boolean isSystem;
+
+    @Parameter(name=ApiConstants.SYSTEM_VM_TYPE, type=CommandType.STRING, description="the system VM type. Possible types are \"domainrouter\", \"consoleproxy\" and \"secondarystoragevm\".")
+    private String systemVmType;
+
+    @Parameter(name=ApiConstants.NETWORKRATE, type=CommandType.INTEGER, description="data transfer rate in megabits per second allowed. Supported only for non-System offering and system offerings having \"domainrouter\" systemvmtype")
+    private Integer networkRate;
+
+    /////////////////////////////////////////////////////
+    /////////////////// Accessors ///////////////////////
+    /////////////////////////////////////////////////////
+
+    public Long getCpuNumber() {
+        return cpuNumber;
+    }
+
+    public Long getCpuSpeed() {
+        return cpuSpeed;
+    }
+
+    public String getDisplayText() {
+        return displayText;
+    }
+
+    public Long getMemory() {
+        return memory;
+    }
+
+    public String getServiceOfferingName() {
+        return serviceOfferingName;
+    }
+
+    public Boolean getOfferHa() {
+        return offerHa;
+    }
+
+    public Boolean GetLimitCpuUse() {
+        return limitCpuUse;
+    }
+
+    public String getStorageType() {
+        return storageType;
+    }
+
+    public String getTags() {
+        return tags;
+    }
+
+    public Long getDomainId() {
+        return domainId;
+    }
+
+    public String getHostTag() {
+        return hostTag;
+    }
+
+    public Boolean getIsSystem() {
+        return  isSystem == null ? false : isSystem;
+    }
+
+    public String getSystemVmType() {
+        return systemVmType;
+    }
+
+    public Integer getNetworkRate() {
+        return networkRate;
+    }
+
+    /////////////////////////////////////////////////////
+    /////////////// API Implementation///////////////////
+    /////////////////////////////////////////////////////
+
+    @Override
+    public String getCommandName() {
+        return _name;
+    }
+
+    @Override
+    public long getEntityOwnerId() {
+        return Account.ACCOUNT_ID_SYSTEM;
+    }
+
+    @Override
+    public void execute(){
+        ServiceOffering result = _configService.createServiceOffering(this);
+        if (result != null) {
+            ServiceOfferingResponse response = _responseGenerator.createServiceOfferingResponse(result);
+            response.setResponseName(getCommandName());
+            this.setResponseObject(response);
+        } else {
+            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create service offering");
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/1f1ac79a/api/src/org/apache/cloudstack/api/admin/offering/command/DeleteDiskOfferingCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/admin/offering/command/DeleteDiskOfferingCmd.java b/api/src/org/apache/cloudstack/api/admin/offering/command/DeleteDiskOfferingCmd.java
new file mode 100644
index 0000000..39e8804
--- /dev/null
+++ b/api/src/org/apache/cloudstack/api/admin/offering/command/DeleteDiskOfferingCmd.java
@@ -0,0 +1,76 @@
+// 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.offering.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;
+
+@Implementation(description="Updates a disk offering.", responseObject=SuccessResponse.class)
+public class DeleteDiskOfferingCmd extends BaseCmd {
+    public static final Logger s_logger = Logger.getLogger(DeleteDiskOfferingCmd.class.getName());
+    private static final String s_name = "deletediskofferingresponse";
+
+    /////////////////////////////////////////////////////
+    //////////////// API parameters /////////////////////
+    /////////////////////////////////////////////////////
+
+    @IdentityMapper(entityTableName="disk_offering")
+    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="ID of the disk offering")
+    private Long id;
+
+
+    /////////////////////////////////////////////////////
+    /////////////////// Accessors ///////////////////////
+    /////////////////////////////////////////////////////
+
+    public Long getId() {
+        return id;
+    }
+
+
+    /////////////////////////////////////////////////////
+    /////////////// API Implementation///////////////////
+    /////////////////////////////////////////////////////
+
+    public String getCommandName() {
+        return s_name;
+    }
+
+    @Override
+    public long getEntityOwnerId() {
+        return Account.ACCOUNT_ID_SYSTEM;
+    }
+
+    @Override
+    public void execute(){
+        boolean result = _configService.deleteDiskOffering(this);
+        if (result) {
+            SuccessResponse response = new SuccessResponse(getCommandName());
+            this.setResponseObject(response);
+        } else {
+            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete disk offering");
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/1f1ac79a/api/src/org/apache/cloudstack/api/admin/offering/command/DeleteServiceOfferingCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/admin/offering/command/DeleteServiceOfferingCmd.java b/api/src/org/apache/cloudstack/api/admin/offering/command/DeleteServiceOfferingCmd.java
new file mode 100644
index 0000000..643f8a2
--- /dev/null
+++ b/api/src/org/apache/cloudstack/api/admin/offering/command/DeleteServiceOfferingCmd.java
@@ -0,0 +1,77 @@
+// 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.offering.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;
+
+@Implementation(description="Deletes a service offering.", responseObject=SuccessResponse.class)
+public class DeleteServiceOfferingCmd extends BaseCmd{
+    public static final Logger s_logger = Logger.getLogger(DeleteServiceOfferingCmd.class.getName());
+    private static final String s_name = "deleteserviceofferingresponse";
+
+    /////////////////////////////////////////////////////
+    //////////////// API parameters /////////////////////
+    /////////////////////////////////////////////////////
+
+    @IdentityMapper(entityTableName="disk_offering")
+    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the service offering")
+    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(){
+        boolean result = _configService.deleteServiceOffering(this);
+        if (result) {
+            SuccessResponse response = new SuccessResponse(getCommandName());
+            this.setResponseObject(response);
+        } else {
+            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete service offering");
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/1f1ac79a/api/src/org/apache/cloudstack/api/admin/offering/command/UpdateDiskOfferingCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/admin/offering/command/UpdateDiskOfferingCmd.java b/api/src/org/apache/cloudstack/api/admin/offering/command/UpdateDiskOfferingCmd.java
new file mode 100755
index 0000000..6643814
--- /dev/null
+++ b/api/src/org/apache/cloudstack/api/admin/offering/command/UpdateDiskOfferingCmd.java
@@ -0,0 +1,98 @@
+// 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.offering.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.DiskOfferingResponse;
+import com.cloud.offering.DiskOffering;
+import com.cloud.user.Account;
+
+@Implementation(description="Updates a disk offering.", responseObject=DiskOfferingResponse.class)
+public class UpdateDiskOfferingCmd extends BaseCmd{
+    public static final Logger s_logger = Logger.getLogger(UpdateDiskOfferingCmd.class.getName());
+    private static final String s_name = "updatediskofferingresponse";
+
+    /////////////////////////////////////////////////////
+    //////////////// API parameters /////////////////////
+    /////////////////////////////////////////////////////
+
+    @Parameter(name=ApiConstants.DISPLAY_TEXT, type=CommandType.STRING, description="updates alternate display text of the disk offering with this value", length=4096)
+    private String displayText;
+
+    @IdentityMapper(entityTableName="disk_offering")
+    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="ID of the disk offering")
+    private Long id;
+
+    @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="updates name of the disk offering with this value")
+    private String diskOfferingName;
+
+    @Parameter(name=ApiConstants.SORT_KEY, type=CommandType.INTEGER, description="sort key of the disk offering, integer")
+    private Integer sortKey;
+
+    /////////////////////////////////////////////////////
+    /////////////////// Accessors ///////////////////////
+    /////////////////////////////////////////////////////
+
+    public String getDisplayText() {
+        return displayText;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public String getDiskOfferingName() {
+        return diskOfferingName;
+    }
+
+    public Integer getSortKey() {
+        return sortKey;
+    }
+
+
+    /////////////////////////////////////////////////////
+    /////////////// API Implementation///////////////////
+    /////////////////////////////////////////////////////
+
+    @Override
+    public String getCommandName() {
+        return s_name;
+    }
+
+    @Override
+    public long getEntityOwnerId() {
+        return Account.ACCOUNT_ID_SYSTEM;
+    }
+
+    @Override
+    public void execute(){
+        DiskOffering result = _configService.updateDiskOffering(this);
+        if (result != null){
+            DiskOfferingResponse response = _responseGenerator.createDiskOfferingResponse(result);
+            response.setResponseName(getCommandName());
+            this.setResponseObject(response);
+        } else {
+            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update disk offering");
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/1f1ac79a/api/src/org/apache/cloudstack/api/admin/offering/command/UpdateServiceOfferingCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/admin/offering/command/UpdateServiceOfferingCmd.java b/api/src/org/apache/cloudstack/api/admin/offering/command/UpdateServiceOfferingCmd.java
new file mode 100755
index 0000000..909ad7d
--- /dev/null
+++ b/api/src/org/apache/cloudstack/api/admin/offering/command/UpdateServiceOfferingCmd.java
@@ -0,0 +1,99 @@
+// 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.offering.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.ServiceOfferingResponse;
+import com.cloud.offering.ServiceOffering;
+import com.cloud.user.Account;
+
+@Implementation(description="Updates a service offering.", responseObject=ServiceOfferingResponse.class)
+public class UpdateServiceOfferingCmd extends BaseCmd {
+    public static final Logger s_logger = Logger.getLogger(UpdateServiceOfferingCmd.class.getName());
+    private static final String s_name = "updateserviceofferingresponse";
+
+    /////////////////////////////////////////////////////
+    //////////////// API parameters /////////////////////
+    /////////////////////////////////////////////////////
+    @IdentityMapper(entityTableName="disk_offering")
+    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the service offering to be updated")
+    private Long id;
+
+    @Parameter(name=ApiConstants.DISPLAY_TEXT, type=CommandType.STRING, description="the display text of the service offering to be updated")
+    private String displayText;
+
+    @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="the name of the service offering to be updated")
+    private String serviceOfferingName;
+
+    @Parameter(name=ApiConstants.SORT_KEY, type=CommandType.INTEGER, description="sort key of the service offering, integer")
+    private Integer sortKey;
+    /////////////////////////////////////////////////////
+    /////////////////// Accessors ///////////////////////
+    /////////////////////////////////////////////////////
+
+    public String getDisplayText() {
+        return displayText;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public String getServiceOfferingName() {
+        return serviceOfferingName;
+    }
+
+    public Integer getSortKey() {
+        return sortKey;
+    }
+
+    /////////////////////////////////////////////////////
+    /////////////// API Implementation///////////////////
+    /////////////////////////////////////////////////////
+
+
+    @Override
+    public String getCommandName() {
+        return s_name;
+    }
+
+    @Override
+    public long getEntityOwnerId() {
+        return Account.ACCOUNT_ID_SYSTEM;
+    }
+
+    @Override
+    public void execute(){
+        //Note
+        //Once an offering is created, we cannot update the domainId field (keeping consistent with zones logic)
+        ServiceOffering result = _configService.updateServiceOffering(this);
+        if (result != null){
+            ServiceOfferingResponse response = _responseGenerator.createServiceOfferingResponse(result);
+            response.setResponseName(getCommandName());
+            this.setResponseObject(response);
+        } else {
+            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update service offering");
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/1f1ac79a/client/tomcatconf/commands.properties.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/commands.properties.in b/client/tomcatconf/commands.properties.in
index a00118e..e954581 100755
--- a/client/tomcatconf/commands.properties.in
+++ b/client/tomcatconf/commands.properties.in
@@ -107,15 +107,15 @@ listOsTypes=org.apache.cloudstack.api.user.guest.command.ListGuestOsCmd;15
 listOsCategories=org.apache.cloudstack.api.user.guest.command.ListGuestOsCategoriesCmd;15
 
 #### service offering commands
-createServiceOffering=com.cloud.api.commands.CreateServiceOfferingCmd;1
-deleteServiceOffering=com.cloud.api.commands.DeleteServiceOfferingCmd;1
-updateServiceOffering=com.cloud.api.commands.UpdateServiceOfferingCmd;1
+createServiceOffering=org.apache.cloudstack.api.admin.offering.command.CreateServiceOfferingCmd;1
+deleteServiceOffering=org.apache.cloudstack.api.admin.offering.command.DeleteServiceOfferingCmd;1
+updateServiceOffering=org.apache.cloudstack.api.admin.offering.command.UpdateServiceOfferingCmd;1
 listServiceOfferings=org.apache.cloudstack.api.user.offering.command.ListServiceOfferingsCmd;15
 
 #### disk offering commands
-createDiskOffering=com.cloud.api.commands.CreateDiskOfferingCmd;1
-updateDiskOffering=com.cloud.api.commands.UpdateDiskOfferingCmd;1
-deleteDiskOffering=com.cloud.api.commands.DeleteDiskOfferingCmd;1
+createDiskOffering=org.apache.cloudstack.api.admin.offering.command.CreateDiskOfferingCmd;1
+updateDiskOffering=org.apache.cloudstack.api.admin.offering.command.UpdateDiskOfferingCmd;1
+deleteDiskOffering=org.apache.cloudstack.api.admin.offering.command.DeleteDiskOfferingCmd;1
 listDiskOfferings=org.apache.cloudstack.api.user.offering.command.ListDiskOfferingsCmd;15
 
 #### vlan commands

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/1f1ac79a/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 ac5ac68..a4fd640 100755
--- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
+++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
@@ -41,6 +41,8 @@ import javax.naming.directory.InitialDirContext;
 import org.apache.cloudstack.api.admin.config.command.UpdateCfgCmd;
 import org.apache.cloudstack.api.admin.network.command.DeleteNetworkOfferingCmd;
 import org.apache.cloudstack.api.admin.network.command.UpdateNetworkOfferingCmd;
+import org.apache.cloudstack.api.admin.offering.command.CreateDiskOfferingCmd;
+import org.apache.cloudstack.api.admin.offering.command.CreateServiceOfferingCmd;
 import org.apache.cloudstack.api.admin.zone.command.CreateZoneCmd;
 import org.apache.cloudstack.api.admin.zone.command.UpdateZoneCmd;
 import org.apache.log4j.Logger;
@@ -49,21 +51,19 @@ import com.cloud.acl.SecurityChecker;
 import com.cloud.alert.AlertManager;
 import org.apache.cloudstack.api.ApiConstants.LDAPParams;
 import com.cloud.api.ApiDBUtils;
-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.DeleteDiskOfferingCmd;
+import org.apache.cloudstack.api.admin.offering.command.DeleteDiskOfferingCmd;
 import com.cloud.api.commands.DeletePodCmd;
-import com.cloud.api.commands.DeleteServiceOfferingCmd;
+import org.apache.cloudstack.api.admin.offering.command.DeleteServiceOfferingCmd;
 import com.cloud.api.commands.DeleteVlanIpRangeCmd;
 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;
-import com.cloud.api.commands.UpdateDiskOfferingCmd;
+import org.apache.cloudstack.api.admin.offering.command.UpdateDiskOfferingCmd;
 import com.cloud.api.commands.UpdatePodCmd;
-import com.cloud.api.commands.UpdateServiceOfferingCmd;
+import org.apache.cloudstack.api.admin.offering.command.UpdateServiceOfferingCmd;
 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/1f1ac79a/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 e77536e..5277660 100644
--- a/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java
+++ b/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java
@@ -24,26 +24,26 @@ import javax.ejb.Local;
 import javax.naming.ConfigurationException;
 import javax.naming.NamingException;
 
-import com.cloud.api.commands.CreateDiskOfferingCmd;
+import org.apache.cloudstack.api.admin.offering.command.CreateDiskOfferingCmd;
 import org.apache.cloudstack.api.admin.config.command.UpdateCfgCmd;
 import org.apache.cloudstack.api.admin.network.command.CreateNetworkOfferingCmd;
-import com.cloud.api.commands.CreateServiceOfferingCmd;
+import org.apache.cloudstack.api.admin.offering.command.CreateServiceOfferingCmd;
 import com.cloud.api.commands.CreateVlanIpRangeCmd;
+import org.apache.cloudstack.api.admin.offering.command.DeleteDiskOfferingCmd;
+import org.apache.cloudstack.api.admin.offering.command.UpdateServiceOfferingCmd;
 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 org.apache.cloudstack.api.admin.offering.command.DeleteServiceOfferingCmd;
 import com.cloud.api.commands.DeleteVlanIpRangeCmd;
 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.UpdateDiskOfferingCmd;
+import org.apache.cloudstack.api.admin.offering.command.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.configuration.Configuration;
 import com.cloud.configuration.ConfigurationManager;
 import com.cloud.configuration.ConfigurationService;


Mime
View raw message