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/4.3 to 3f526fb
Date Fri, 06 Dec 2013 23:46:52 GMT
Updated Branches:
  refs/heads/4.3 d3520a5d1 -> 3f526fb05


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


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

Branch: refs/heads/4.3
Commit: 3f526fb05229ab9ab7e10caac70ac1faf030478f
Parents: d3520a5
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 15:40:48 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, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3f526fb0/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 90e0d41..2176bc0 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/3f526fb0/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 2189ae0..3ce31b5 100644
--- a/api/src/org/apache/cloudstack/api/response/CapabilitiesResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/CapabilitiesResponse.java
@@ -46,10 +46,12 @@ public class CapabilitiesResponse extends BaseResponse {
     @SerializedName(ApiConstants.CUSTOM_DISK_OFF_MAX_SIZE) @Param(description="maximum size
that can be specified when " +
             "create disk from disk offering with custom size")
     private Long diskOffMaxSize;
-
     @SerializedName("regionsecondaryenabled") @Param(description = "true if region wide secondary
is enabled, false otherwise")
     private boolean regionSecondaryEnabled;
 
+    @SerializedName("kvmsnapshotenabled") @Param(description = "true if snapshot is supported
for KVM host, false otherwise")
+    private boolean KVMSnapshotEnabled;
+
     @SerializedName("apilimitinterval") @Param(description="time interval (in seconds) to
reset api count")
     private Integer apiLimitInterval;
 
@@ -89,6 +91,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/3f526fb0/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 1761e52..0e9c483 100755
--- a/server/src/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/com/cloud/server/ManagementServerImpl.java
@@ -3285,6 +3285,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()) {
@@ -3300,6 +3301,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());
 
@@ -3323,6 +3325,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