cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ni...@apache.org
Subject git commit: updated refs/heads/master to c171e2c
Date Thu, 20 Feb 2014 02:01:26 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master c93b0967e -> c171e2c3e


CLOUDSTACK-4744: Enhance root admin API updateVolume with chaininfo parameter as a part of
"Better control over first party objects" feature.


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

Branch: refs/heads/master
Commit: c171e2c3e430a8ddb27b54eabf1156f987ddc180
Parents: c93b096
Author: Nitin Mehta <nitin.mehta@citrix.com>
Authored: Wed Feb 19 18:01:18 2014 -0800
Committer: Nitin Mehta <nitin.mehta@citrix.com>
Committed: Wed Feb 19 18:01:18 2014 -0800

----------------------------------------------------------------------
 api/src/com/cloud/storage/VolumeApiService.java       |  2 +-
 api/src/org/apache/cloudstack/api/ApiConstants.java   |  1 +
 .../api/command/user/volume/UpdateVolumeCmd.java      | 11 +++++++++--
 .../cloudstack/api/response/VolumeResponse.java       | 14 +++++++++++++-
 .../com/cloud/api/query/dao/VolumeJoinDaoImpl.java    |  1 +
 server/src/com/cloud/api/query/vo/VolumeJoinVO.java   |  6 ++++++
 .../src/com/cloud/storage/VolumeApiServiceImpl.java   |  6 +++++-
 setup/db/db/schema-430to440.sql                       |  5 +++--
 8 files changed, 39 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c171e2c3/api/src/com/cloud/storage/VolumeApiService.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/storage/VolumeApiService.java b/api/src/com/cloud/storage/VolumeApiService.java
index 09ac3ee..310f69e 100644
--- a/api/src/com/cloud/storage/VolumeApiService.java
+++ b/api/src/com/cloud/storage/VolumeApiService.java
@@ -82,7 +82,7 @@ public interface VolumeApiService {
 
     Snapshot allocSnapshot(Long volumeId, Long policyId) throws ResourceAllocationException;
 
-    Volume updateVolume(long volumeId, String path, String state, Long storageId, Boolean
displayVolume, String customId, long owner);
+    Volume updateVolume(long volumeId, String path, String state, Long storageId, Boolean
displayVolume, String customId, long owner, String chainInfo);
 
     /**
      * Extracts the volume to a particular location.

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c171e2c3/api/src/org/apache/cloudstack/api/ApiConstants.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/ApiConstants.java b/api/src/org/apache/cloudstack/api/ApiConstants.java
index 3b9b19c..3699102 100755
--- a/api/src/org/apache/cloudstack/api/ApiConstants.java
+++ b/api/src/org/apache/cloudstack/api/ApiConstants.java
@@ -41,6 +41,7 @@ public class ApiConstants {
     public static final String PRIVATE_KEY = "privatekey";
     public static final String DOMAIN_SUFFIX = "domainsuffix";
     public static final String DNS_SEARCH_ORDER = "dnssearchorder";
+    public static final String CHAIN_INFO = "chaininfo";
     public static final String CIDR = "cidr";
     public static final String IP6_CIDR = "ip6cidr";
     public static final String CIDR_LIST = "cidrlist";

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c171e2c3/api/src/org/apache/cloudstack/api/command/user/volume/UpdateVolumeCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/UpdateVolumeCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/UpdateVolumeCmd.java
index 65d2849..78d402b 100644
--- a/api/src/org/apache/cloudstack/api/command/user/volume/UpdateVolumeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/volume/UpdateVolumeCmd.java
@@ -47,6 +47,9 @@ public class UpdateVolumeCmd extends BaseAsyncCustomIdCmd {
     @Parameter(name = ApiConstants.PATH, type = CommandType.STRING, description = "The path
of the volume")
     private String path;
 
+    @Parameter(name = ApiConstants.CHAIN_INFO, type = CommandType.STRING, description = "The
chain info of the volume")
+    private String chainInfo;
+
     @Parameter(name = ApiConstants.STORAGE_ID,
                type = CommandType.UUID,
                entityType = StoragePoolResponse.class,
@@ -86,7 +89,10 @@ public class UpdateVolumeCmd extends BaseAsyncCustomIdCmd {
         return displayVolume;
     }
 
-/////////////////////////////////////////////////////
+    public String getChainInfo() {
+        return chainInfo;
+    }
+    /////////////////////////////////////////////////////
     /////////////// API Implementation///////////////////
     /////////////////////////////////////////////////////
 
@@ -139,7 +145,8 @@ public class UpdateVolumeCmd extends BaseAsyncCustomIdCmd {
     @Override
     public void execute() {
         CallContext.current().setEventDetails("Volume Id: " + getId());
-        Volume result = _volumeService.updateVolume(getId(), getPath(), getState(), getStorageId(),
getDisplayVolume(), getCustomId(), getEntityOwnerId());
+        Volume result = _volumeService.updateVolume(getId(), getPath(), getState(), getStorageId(),
getDisplayVolume(),
+                getCustomId(), getEntityOwnerId(), getChainInfo());
         if (result != null) {
             VolumeResponse response = _responseGenerator.createVolumeResponse(result);
             response.setResponseName(getCommandName());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c171e2c3/api/src/org/apache/cloudstack/api/response/VolumeResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/VolumeResponse.java b/api/src/org/apache/cloudstack/api/response/VolumeResponse.java
index daf5350..4cba2a1 100644
--- a/api/src/org/apache/cloudstack/api/response/VolumeResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/VolumeResponse.java
@@ -193,13 +193,17 @@ public class VolumeResponse extends BaseResponse implements ControlledViewEntity
     private Boolean displayVolume;
 
     @SerializedName(ApiConstants.PATH)
-    @Param(description = "The path of the volume")
+    @Param(description = "the path of the volume")
     private String path;
 
     @SerializedName(ApiConstants.STORAGE_ID)
     @Param(description = "id of the primary storage hosting the disk volume; returned to
admin user only", since = "4.3")
     private String storagePoolId;
 
+    @SerializedName(ApiConstants.CHAIN_INFO)
+    @Param(description = "the chain info of the volume", since = "4.4")
+    String chainInfo;
+
     public String getPath() {
         return path;
     }
@@ -417,4 +421,12 @@ public class VolumeResponse extends BaseResponse implements ControlledViewEntity
     public void setStoragePoolId(String storagePoolId) {
         this.storagePoolId = storagePoolId;
     }
+
+    public String getChainInfo() {
+        return chainInfo;
+    }
+
+    public void setChainInfo(String chainInfo) {
+        this.chainInfo = chainInfo;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c171e2c3/server/src/com/cloud/api/query/dao/VolumeJoinDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/dao/VolumeJoinDaoImpl.java b/server/src/com/cloud/api/query/dao/VolumeJoinDaoImpl.java
index 5fa27dc..0c56935 100644
--- a/server/src/com/cloud/api/query/dao/VolumeJoinDaoImpl.java
+++ b/server/src/com/cloud/api/query/dao/VolumeJoinDaoImpl.java
@@ -209,6 +209,7 @@ public class VolumeJoinDaoImpl extends GenericDaoBase<VolumeJoinVO,
Long> implem
 
         volResponse.setExtractable(isExtractable);
         volResponse.setDisplayVolume(volume.isDisplayVolume());
+        volResponse.setChainInfo(volume.getChainInfo());
 
         // set async job
         if (volume.getJobId() != null) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c171e2c3/server/src/com/cloud/api/query/vo/VolumeJoinVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/vo/VolumeJoinVO.java b/server/src/com/cloud/api/query/vo/VolumeJoinVO.java
index f288c2f..1d1b37d 100644
--- a/server/src/com/cloud/api/query/vo/VolumeJoinVO.java
+++ b/server/src/com/cloud/api/query/vo/VolumeJoinVO.java
@@ -264,6 +264,9 @@ public class VolumeJoinVO extends BaseViewVO implements ControlledViewEntity
{
     @Column(name = "path")
     protected String path;
 
+    @Column(name = "chain_info", length = 65535)
+    String chainInfo;
+
     public VolumeJoinVO() {
     }
 
@@ -567,4 +570,7 @@ public class VolumeJoinVO extends BaseViewVO implements ControlledViewEntity
{
         return path;
     }
 
+    public String getChainInfo() {
+        return chainInfo;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c171e2c3/server/src/com/cloud/storage/VolumeApiServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/VolumeApiServiceImpl.java b/server/src/com/cloud/storage/VolumeApiServiceImpl.java
index 252d925..614834e 100644
--- a/server/src/com/cloud/storage/VolumeApiServiceImpl.java
+++ b/server/src/com/cloud/storage/VolumeApiServiceImpl.java
@@ -1205,7 +1205,7 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
 
     @Override
     @ActionEvent(eventType = EventTypes.EVENT_VOLUME_UPDATE, eventDescription = "updating
volume", async = true)
-    public Volume updateVolume(long volumeId, String path, String state, Long storageId,
Boolean displayVolume, String customId, long entityOwnerId) {
+    public Volume updateVolume(long volumeId, String path, String state, Long storageId,
Boolean displayVolume, String customId, long entityOwnerId, String chainInfo) {
 
         VolumeVO volume = _volumeDao.findById(volumeId);
 
@@ -1217,6 +1217,10 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
             volume.setDisplayVolume(displayVolume);
         }
 
+        if(chainInfo != null){
+            volume.setChainInfo(chainInfo);
+        }
+
         if (state != null) {
             try {
                 Volume.State volumeState = Volume.State.valueOf(state);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c171e2c3/setup/db/db/schema-430to440.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-430to440.sql b/setup/db/db/schema-430to440.sql
index d1d0d06..a98df26 100644
--- a/setup/db/db/schema-430to440.sql
+++ b/setup/db/db/schema-430to440.sql
@@ -122,9 +122,10 @@ CREATE VIEW `cloud`.`volume_view` AS
         volumes.attached,
         volumes.removed,
         volumes.pod_id,
-    volumes.display_volume,
+        volumes.display_volume,
         volumes.format,
-    volumes.path,
+        volumes.path,
+        volumes.chain_info,
         account.id account_id,
         account.uuid account_uuid,
         account.account_name account_name,


Mime
View raw message