mirror of https://github.com/apache/cloudstack.git
cloudstack-4308 Add API listCapabilities for KVMSnapshotEnabled so that UI can use it for recurring snapshot.
This commit is contained in:
parent
c850f0a0e3
commit
8df22d1818
|
|
@ -52,6 +52,7 @@ public class ListCapabilitiesCmd extends BaseCmd {
|
|||
response.setProjectInviteRequired((Boolean)capabilities.get("projectInviteRequired"));
|
||||
response.setAllowUsersCreateProjects((Boolean)capabilities.get("allowusercreateprojects"));
|
||||
response.setDiskOffMaxSize((Long)capabilities.get("customDiskOffMaxSize"));
|
||||
response.setKVMSnapshotEnabled((Boolean)capabilities.get("KVMSnapshotEnabled"));
|
||||
if (capabilities.containsKey("apiLimitInterval")) {
|
||||
response.setApiLimitInterval((Integer) capabilities.get("apiLimitInterval"));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,6 +46,9 @@ public class CapabilitiesResponse extends BaseResponse {
|
|||
"create disk from disk offering with custom size")
|
||||
private Long diskOffMaxSize;
|
||||
|
||||
@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;
|
||||
|
||||
|
|
@ -81,6 +84,10 @@ public class CapabilitiesResponse extends BaseResponse {
|
|||
this.diskOffMaxSize = diskOffMaxSize;
|
||||
}
|
||||
|
||||
public void setKVMSnapshotEnabled(boolean KVMSnapshotEnabled) {
|
||||
this.KVMSnapshotEnabled = KVMSnapshotEnabled;
|
||||
}
|
||||
|
||||
public void setApiLimitInterval(Integer apiLimitInterval) {
|
||||
this.apiLimitInterval = apiLimitInterval;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3254,6 +3254,7 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
|
|||
Account caller = UserContext.current().getCaller();
|
||||
boolean securityGroupsEnabled = false;
|
||||
boolean elasticLoadBalancerEnabled = false;
|
||||
boolean KVMSnapshotEnabled = false;
|
||||
String supportELB = "false";
|
||||
List<NetworkVO> networks = _networkDao.listSecurityGroupEnabledNetworks();
|
||||
if (networks != null && !networks.isEmpty()) {
|
||||
|
|
@ -3269,6 +3270,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"));
|
||||
|
||||
String userPublicTemplateEnabled = _configServer.getConfigValue(Config.AllowPublicUserTemplates.key(), Config.ConfigurationParameterScope.account.toString(), caller.getId());
|
||||
|
||||
|
|
@ -3285,6 +3287,7 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
|
|||
capabilities.put("projectInviteRequired", _projectMgr.projectInviteRequired());
|
||||
capabilities.put("allowusercreateprojects", _projectMgr.allowUserToCreateProject());
|
||||
capabilities.put("customDiskOffMaxSize", diskOffMaxSize);
|
||||
capabilities.put("KVMSnapshotEnabled", KVMSnapshotEnabled);
|
||||
if (apiLimitEnabled) {
|
||||
capabilities.put("apiLimitInterval", apiLimitInterval);
|
||||
capabilities.put("apiLimitMax", apiLimitMax);
|
||||
|
|
|
|||
Loading…
Reference in New Issue