cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mc...@apache.org
Subject git commit: updated refs/heads/object_store to ef541a2
Date Mon, 20 May 2013 20:40:02 GMT
Updated Branches:
  refs/heads/object_store 255d08ae7 -> ef541a2a7


Fix CLOUDSTACK-2538: Add name as an optional parameter for addImageStore
api.

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

Branch: refs/heads/object_store
Commit: ef541a2a7bc0aba35009fea38644ae1cb15ad946
Parents: 255d08a
Author: Min Chen <min.chen@citrix.com>
Authored: Mon May 20 13:39:43 2013 -0700
Committer: Min Chen <min.chen@citrix.com>
Committed: Mon May 20 13:39:43 2013 -0700

----------------------------------------------------------------------
 .../command/admin/storage/AddImageStoreCmd.java    |    8 ++++++++
 .../CloudStackImageStoreLifeCycleImpl.java         |    6 +++++-
 .../lifecycle/S3ImageStoreLifeCycleImpl.java       |    3 ++-
 .../lifecycle/SwiftImageStoreLifeCycleImpl.java    |    2 ++
 .../src/com/cloud/storage/StorageManagerImpl.java  |    2 +-
 5 files changed, 18 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ef541a2a/api/src/org/apache/cloudstack/api/command/admin/storage/AddImageStoreCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/storage/AddImageStoreCmd.java
b/api/src/org/apache/cloudstack/api/command/admin/storage/AddImageStoreCmd.java
index 08112f0..1e383c9 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/storage/AddImageStoreCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/storage/AddImageStoreCmd.java
@@ -44,6 +44,9 @@ public class AddImageStoreCmd extends BaseCmd {
     //////////////// API parameters /////////////////////
     /////////////////////////////////////////////////////
 
+    @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="the name for
the image store")
+    private String name;
+
     @Parameter(name=ApiConstants.URL, type=CommandType.STRING, description="the URL for the
image store")
     private String url;
 
@@ -65,10 +68,15 @@ public class AddImageStoreCmd extends BaseCmd {
     /////////////////// Accessors ///////////////////////
     /////////////////////////////////////////////////////
 
+
     public String getUrl() {
         return url;
     }
 
+    public String getName() {
+        return name;
+    }
+
     public Long getZoneId() {
         return zoneId;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ef541a2a/plugins/storage/image/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackImageStoreLifeCycleImpl.java
----------------------------------------------------------------------
diff --git a/plugins/storage/image/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackImageStoreLifeCycleImpl.java
b/plugins/storage/image/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackImageStoreLifeCycleImpl.java
index 84df712..d550f0b 100644
--- a/plugins/storage/image/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackImageStoreLifeCycleImpl.java
+++ b/plugins/storage/image/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackImageStoreLifeCycleImpl.java
@@ -80,6 +80,10 @@ public class CloudStackImageStoreLifeCycleImpl implements ImageStoreLifeCycle
{
 
         Long dcId = (Long) dsInfos.get("zoneId");
         String url = (String) dsInfos.get("url");
+        String name = (String)dsInfos.get("name");
+        if ( name == null ){
+            name = url;
+        }
         String providerName = (String)dsInfos.get("providerName");
         DataStoreRole role =(DataStoreRole) dsInfos.get("role");
         Map<String, String> details = (Map<String, String>)dsInfos.get("details");
@@ -111,7 +115,7 @@ public class CloudStackImageStoreLifeCycleImpl implements ImageStoreLifeCycle
{
 
 
         Map<String, Object> imageStoreParameters = new HashMap<String, Object>();
-        imageStoreParameters.put("name", url);
+        imageStoreParameters.put("name", name);
         imageStoreParameters.put("zoneId", dcId);
         imageStoreParameters.put("url", url);
         imageStoreParameters.put("protocol", uri.getScheme().toLowerCase());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ef541a2a/plugins/storage/image/s3/src/org/apache/cloudstack/storage/datastore/lifecycle/S3ImageStoreLifeCycleImpl.java
----------------------------------------------------------------------
diff --git a/plugins/storage/image/s3/src/org/apache/cloudstack/storage/datastore/lifecycle/S3ImageStoreLifeCycleImpl.java
b/plugins/storage/image/s3/src/org/apache/cloudstack/storage/datastore/lifecycle/S3ImageStoreLifeCycleImpl.java
index 1b5e2d5..4ea97e5 100644
--- a/plugins/storage/image/s3/src/org/apache/cloudstack/storage/datastore/lifecycle/S3ImageStoreLifeCycleImpl.java
+++ b/plugins/storage/image/s3/src/org/apache/cloudstack/storage/datastore/lifecycle/S3ImageStoreLifeCycleImpl.java
@@ -84,6 +84,7 @@ public class S3ImageStoreLifeCycleImpl implements ImageStoreLifeCycle {
 
         Long dcId = (Long) dsInfos.get("zoneId");
         String url = (String) dsInfos.get("url");
+        String name = (String)dsInfos.get("name");
         String providerName = (String)dsInfos.get("providerName");
         ScopeType scope = (ScopeType)dsInfos.get("scope");
         DataStoreRole role =(DataStoreRole) dsInfos.get("role");
@@ -102,7 +103,7 @@ public class S3ImageStoreLifeCycleImpl implements ImageStoreLifeCycle
{
         */
 
         Map<String, Object> imageStoreParameters = new HashMap<String, Object>();
-        imageStoreParameters.put("name", url);
+        imageStoreParameters.put("name", name);
         imageStoreParameters.put("zoneId", dcId);
         imageStoreParameters.put("url", url);
         String protocol = "http";

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ef541a2a/plugins/storage/image/swift/src/org/apache/cloudstack/storage/datastore/lifecycle/SwiftImageStoreLifeCycleImpl.java
----------------------------------------------------------------------
diff --git a/plugins/storage/image/swift/src/org/apache/cloudstack/storage/datastore/lifecycle/SwiftImageStoreLifeCycleImpl.java
b/plugins/storage/image/swift/src/org/apache/cloudstack/storage/datastore/lifecycle/SwiftImageStoreLifeCycleImpl.java
index 411e052..3fc68a1 100644
--- a/plugins/storage/image/swift/src/org/apache/cloudstack/storage/datastore/lifecycle/SwiftImageStoreLifeCycleImpl.java
+++ b/plugins/storage/image/swift/src/org/apache/cloudstack/storage/datastore/lifecycle/SwiftImageStoreLifeCycleImpl.java
@@ -80,6 +80,7 @@ public class SwiftImageStoreLifeCycleImpl implements ImageStoreLifeCycle
{
 
         Long dcId = (Long) dsInfos.get("zoneId");
         String url = (String) dsInfos.get("url");
+        String name = (String)dsInfos.get("name");
         ScopeType scope = (ScopeType)dsInfos.get("scope");
         String providerName = (String)dsInfos.get("providerName");
         DataStoreRole role =(DataStoreRole) dsInfos.get("role");
@@ -90,6 +91,7 @@ public class SwiftImageStoreLifeCycleImpl implements ImageStoreLifeCycle
{
 
         // just need to insert an entry in DB
         Map<String, Object> imageStoreParameters = new HashMap<String, Object>();
+        imageStoreParameters.put("name", name);
         imageStoreParameters.put("zoneId", dcId);
         imageStoreParameters.put("url", url);
         imageStoreParameters.put("protocol", "http");

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ef541a2a/server/src/com/cloud/storage/StorageManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/StorageManagerImpl.java b/server/src/com/cloud/storage/StorageManagerImpl.java
index 504cdc6..ba6b343 100755
--- a/server/src/com/cloud/storage/StorageManagerImpl.java
+++ b/server/src/com/cloud/storage/StorageManagerImpl.java
@@ -1892,7 +1892,7 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager,
C
         Map<String, Object> params = new HashMap<String, Object>();
         params.put("zoneId", dcId);
         params.put("url", cmd.getUrl());
-        params.put("name", cmd.getUrl());
+        params.put("name", cmd.getName());
         params.put("details", details);
         params.put("scope", scopeType);
         params.put("providerName", storeProvider.getName());


Mime
View raw message