cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alena1...@apache.org
Subject git commit: updated refs/heads/master to 15338e4
Date Sat, 07 Dec 2013 00:06:08 GMT
Updated Branches:
  refs/heads/master 782bd4d9b -> 15338e42a


cloudstack-4308 Add API listCapabilities for KVMSnapshotEnabled so that UI can use it for
recurring snapshot.

Conflicts:
	api/src/org/apache/cloudstack/api/command/user/config/ListCapabilitiesCmd.java
	api/src/org/apache/cloudstack/api/response/CapabilitiesResponse.java
	server/src/com/cloud/server/ManagementServerImpl.java

Conflicts:
	api/src/org/apache/cloudstack/api/response/CapabilitiesResponse.java


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

Branch: refs/heads/master
Commit: 15338e42a8fe9dd17a70bc0e58ac7246a6f4c134
Parents: 782bd4d
Author: Fang Wang <fang.wang@citrix.com>
Authored: Tue Aug 13 17:15:33 2013 -0700
Committer: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Committed: Fri Dec 6 16:05:57 2013 -0800

----------------------------------------------------------------------
 .../api/command/user/config/ListCapabilitiesCmd.java         | 1 +
 .../apache/cloudstack/api/response/CapabilitiesResponse.java | 8 ++++++++
 server/src/com/cloud/server/ManagementServerImpl.java        | 3 +++
 3 files changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/15338e42/api/src/org/apache/cloudstack/api/command/user/config/ListCapabilitiesCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/config/ListCapabilitiesCmd.java
b/api/src/org/apache/cloudstack/api/command/user/config/ListCapabilitiesCmd.java
index ccc5a89..5c00814 100644
--- a/api/src/org/apache/cloudstack/api/command/user/config/ListCapabilitiesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/config/ListCapabilitiesCmd.java
@@ -54,6 +54,7 @@ public class ListCapabilitiesCmd extends BaseCmd {
         response.setAllowUsersCreateProjects((Boolean)capabilities.get("allowusercreateprojects"));
         response.setDiskOffMaxSize((Long)capabilities.get("customDiskOffMaxSize"));
         response.setRegionSecondaryEnabled((Boolean)capabilities.get("regionSecondaryEnabled"));
+        response.setKVMSnapshotEnabled((Boolean)capabilities.get("KVMSnapshotEnabled"));
         if (capabilities.containsKey("apiLimitInterval")) {
             response.setApiLimitInterval((Integer)capabilities.get("apiLimitInterval"));
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/15338e42/api/src/org/apache/cloudstack/api/response/CapabilitiesResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/CapabilitiesResponse.java b/api/src/org/apache/cloudstack/api/response/CapabilitiesResponse.java
index 17dcdd8..4840c60 100644
--- a/api/src/org/apache/cloudstack/api/response/CapabilitiesResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/CapabilitiesResponse.java
@@ -61,6 +61,10 @@ public class CapabilitiesResponse extends BaseResponse {
     @Param(description = "time interval (in seconds) to reset api count")
     private Integer apiLimitInterval;
 
+    @SerializedName("kvmsnapshotenabled")
+    @Param(description = "true if snapshot is supported for KVM host, false otherwise")
+    private boolean KVMSnapshotEnabled;
+
     @SerializedName("apilimitmax")
     @Param(description = "Max allowed number of api requests within the specified interval")
     private Integer apiLimitMax;
@@ -97,6 +101,10 @@ public class CapabilitiesResponse extends BaseResponse {
         this.regionSecondaryEnabled = regionSecondaryEnabled;
     }
 
+    public void setKVMSnapshotEnabled(boolean KVMSnapshotEnabled) {
+        this.KVMSnapshotEnabled = KVMSnapshotEnabled;
+    }
+
     public void setApiLimitInterval(Integer apiLimitInterval) {
         this.apiLimitInterval = apiLimitInterval;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/15338e42/server/src/com/cloud/server/ManagementServerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java
index dbb3647..c0f10aa 100755
--- a/server/src/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/com/cloud/server/ManagementServerImpl.java
@@ -3251,6 +3251,7 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
         Account caller = CallContext.current().getCallingAccount();
         boolean securityGroupsEnabled = false;
         boolean elasticLoadBalancerEnabled = false;
+        boolean KVMSnapshotEnabled = false;
         String supportELB = "false";
         List<NetworkVO> networks = _networkDao.listSecurityGroupEnabledNetworks();
         if (networks != null && !networks.isEmpty()) {
@@ -3266,6 +3267,7 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
         }
 
         long diskOffMaxSize = Long.valueOf(_configDao.getValue(Config.CustomDiskOfferingMaxSize.key()));
+        KVMSnapshotEnabled = Boolean.parseBoolean(_configDao.getValue("KVM.snapshot.enabled"));
 
         boolean userPublicTemplateEnabled = TemplateManager.AllowPublicUserTemplates.valueIn(caller.getId());
 
@@ -3289,6 +3291,7 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
         capabilities.put("allowusercreateprojects", _projectMgr.allowUserToCreateProject());
         capabilities.put("customDiskOffMaxSize", diskOffMaxSize);
         capabilities.put("regionSecondaryEnabled", regionSecondaryEnabled);
+        capabilities.put("KVMSnapshotEnabled", KVMSnapshotEnabled);
         if (apiLimitEnabled) {
             capabilities.put("apiLimitInterval", apiLimitInterval);
             capabilities.put("apiLimitMax", apiLimitMax);


Mime
View raw message