Skip to content

Commit eacbb4c

Browse files
committed
Merge branch 'master' into ui-add-remove-nics
Conflicts: client/WEB-INF/classes/resources/messages.properties ui/dictionary.jsp
2 parents 6b1da42 + ce7dc70 commit eacbb4c

84 files changed

Lines changed: 6555 additions & 4480 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎api/src/com/cloud/configuration/ConfigurationService.java‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020

2121
import javax.naming.NamingException;
2222

23+
import com.cloud.exception.InvalidParameterValueException;
24+
import com.cloud.exception.InsufficientCapacityException;
25+
import com.cloud.exception.ConcurrentOperationException;
26+
import com.cloud.exception.ResourceUnavailableException;
27+
import com.cloud.exception.ResourceAllocationException;
2328
import org.apache.cloudstack.api.command.admin.config.UpdateCfgCmd;
2429
import org.apache.cloudstack.api.command.admin.ldap.LDAPConfigCmd;
2530
import org.apache.cloudstack.api.command.admin.ldap.LDAPRemoveCmd;
@@ -46,10 +51,6 @@
4651
import com.cloud.dc.DataCenter;
4752
import com.cloud.dc.Pod;
4853
import com.cloud.dc.Vlan;
49-
import com.cloud.exception.ConcurrentOperationException;
50-
import com.cloud.exception.InsufficientCapacityException;
51-
import com.cloud.exception.ResourceAllocationException;
52-
import com.cloud.exception.ResourceUnavailableException;
5354
import com.cloud.network.Networks.TrafficType;
5455
import com.cloud.offering.DiskOffering;
5556
import com.cloud.offering.NetworkOffering;
@@ -65,7 +66,7 @@ public interface ConfigurationService {
6566
* - the command wrapping name and value parameters
6667
* @return updated configuration object if successful
6768
*/
68-
Configuration updateConfiguration(UpdateCfgCmd cmd);
69+
Configuration updateConfiguration(UpdateCfgCmd cmd) throws InvalidParameterValueException;
6970

7071
/**
7172
* Create a service offering through the API
@@ -250,7 +251,7 @@ public interface ConfigurationService {
250251

251252
NetworkOffering getNetworkOffering(long id);
252253

253-
Integer getNetworkOfferingNetworkRate(long networkOfferingId);
254+
Integer getNetworkOfferingNetworkRate(long networkOfferingId, Long dataCenterId);
254255

255256
Account getVlanAccount(long vlanId);
256257

@@ -262,7 +263,7 @@ public interface ConfigurationService {
262263

263264
Long getDefaultPageSize();
264265

265-
Integer getServiceOfferingNetworkRate(long serviceOfferingId);
266+
Integer getServiceOfferingNetworkRate(long serviceOfferingId, Long dataCenterId);
266267

267268
DiskOffering getDiskOffering(long diskOfferingId);
268269

‎api/src/com/cloud/network/NetworkModel.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ Map<PublicIpAddress, Set<Service>> getIpToServices(List<? extends PublicIpAddres
181181
/**
182182
* @return
183183
*/
184-
String getDefaultNetworkDomain();
184+
String getDefaultNetworkDomain(long zoneId);
185185

186186
/**
187187
* @param ntwkOffId

‎api/src/org/apache/cloudstack/api/command/admin/cluster/ListClustersCmd.java‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ public class ListClustersCmd extends BaseListCmd {
7070
@Parameter(name=ApiConstants.MANAGED_STATE, type=CommandType.STRING, description="whether this cluster is managed by cloudstack")
7171
private String managedState;
7272

73+
@Parameter(name=ApiConstants.ZONE_TYPE, type=CommandType.STRING, description="the network type of the zone that the virtual machine belongs to")
74+
private String zoneType;
75+
7376
@Parameter(name=ApiConstants.SHOW_CAPACITIES, type=CommandType.BOOLEAN, description="flag to display the capacity of the clusters")
7477
private Boolean showCapacities;
7578

@@ -114,7 +117,10 @@ public void setManagedstate(String managedstate) {
114117
this.managedState = managedstate;
115118
}
116119

117-
120+
public String getZoneType() {
121+
return zoneType;
122+
}
123+
118124
public Boolean getShowCapacities() {
119125
return showCapacities;
120126
}

‎api/src/org/apache/cloudstack/api/command/admin/config/ListCfgsByCmd.java‎

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,17 @@ public class ListCfgsByCmd extends BaseListCmd {
4545
@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, description = "lists configuration by name")
4646
private String configName;
4747

48-
@Parameter(name=ApiConstants.SCOPE, type = CommandType.STRING, description = "scope(zone/cluster/pool/account) of the parameter that needs to be updated")
49-
private String scope;
48+
@Parameter(name=ApiConstants.ZONE_ID, type=CommandType.UUID, entityType=ZoneResponse.class, description="the ID of the Zone to update the parameter value for corresponding zone")
49+
private Long zone_id;
5050

51-
@Parameter(name=ApiConstants.ID, type = CommandType.UUID, entityType = {ZoneResponse.class, ClusterResponse.class, StoragePoolResponse.class, AccountResponse.class}, description = "corresponding ID of the scope")
52-
private Long id;
51+
@Parameter(name=ApiConstants.CLUSTER_ID, type=CommandType.UUID, entityType=ClusterResponse.class, description="the ID of the Cluster to update the parameter value for corresponding cluster")
52+
private Long cluster_id;
53+
54+
@Parameter(name=ApiConstants.STORAGE_ID, type=CommandType.UUID, entityType=StoragePoolResponse.class, description="the ID of the Storage pool to update the parameter value for corresponding storage pool")
55+
private Long storagepool_id;
56+
57+
@Parameter(name=ApiConstants.ACCOUNT_ID, type=CommandType.UUID, entityType=AccountResponse.class, description="the ID of the Account to update the parameter value for corresponding account")
58+
private Long account_id;
5359

5460

5561
// ///////////////////////////////////////////////////
@@ -64,14 +70,21 @@ public String getConfigName() {
6470
return configName;
6571
}
6672

67-
public String getScope() {
68-
return scope;
73+
public Long getZoneId() {
74+
return zone_id;
75+
}
76+
77+
public Long getClusterId() {
78+
return cluster_id;
6979
}
7080

71-
public Long getId() {
72-
return id;
81+
public Long getStoragepoolId() {
82+
return storagepool_id;
7383
}
7484

85+
public Long getAccountId() {
86+
return account_id;
87+
}
7588

7689
@Override
7790
public Long getPageSizeVal() {
@@ -100,10 +113,17 @@ public void execute() {
100113
for (Configuration cfg : result.first()) {
101114
ConfigurationResponse cfgResponse = _responseGenerator.createConfigurationResponse(cfg);
102115
cfgResponse.setObjectName("configuration");
103-
if (scope != null) {
104-
cfgResponse.setScope(scope);
105-
} else {
106-
cfgResponse.setScope("global");
116+
if(getZoneId() != null) {
117+
cfgResponse.setScope("zone");
118+
}
119+
if(getClusterId() != null) {
120+
cfgResponse.setScope("cluster");
121+
}
122+
if(getStoragepoolId() != null) {
123+
cfgResponse.setScope("storagepool");
124+
}
125+
if(getAccountId() != null) {
126+
cfgResponse.setScope("account");
107127
}
108128
configResponses.add(cfgResponse);
109129
}

‎api/src/org/apache/cloudstack/api/command/admin/config/UpdateCfgCmd.java‎

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,17 @@ public class UpdateCfgCmd extends BaseCmd {
4343
@Parameter(name=ApiConstants.VALUE, type=CommandType.STRING, description="the value of the configuration", length=4095)
4444
private String value;
4545

46-
@Parameter(name=ApiConstants.SCOPE, type = CommandType.STRING, description = "scope(zone/cluster/pool/account) of the parameter that needs to be updated")
47-
private String scope;
46+
@Parameter(name=ApiConstants.ZONE_ID, type=CommandType.UUID, entityType=ZoneResponse.class, description="the ID of the Zone to update the parameter value for corresponding zone")
47+
private Long zone_id;
4848

49-
@Parameter(name=ApiConstants.ID, type = CommandType.UUID, entityType = {ZoneResponse.class, ClusterResponse.class, StoragePoolResponse.class, AccountResponse.class}, description = "corresponding ID of the scope")
50-
private Long id;
49+
@Parameter(name=ApiConstants.CLUSTER_ID, type=CommandType.UUID, entityType=ClusterResponse.class, description="the ID of the Cluster to update the parameter value for corresponding cluster")
50+
private Long cluster_id;
51+
52+
@Parameter(name=ApiConstants.STORAGE_ID, type=CommandType.UUID, entityType=StoragePoolResponse.class, description="the ID of the Storage pool to update the parameter value for corresponding storage pool")
53+
private Long storagepool_id;
54+
55+
@Parameter(name=ApiConstants.ACCOUNT_ID, type=CommandType.UUID, entityType=AccountResponse.class, description="the ID of the Account to update the parameter value for corresponding account")
56+
private Long account_id;
5157

5258
/////////////////////////////////////////////////////
5359
/////////////////// Accessors ///////////////////////
@@ -61,12 +67,20 @@ public String getValue() {
6167
return value;
6268
}
6369

64-
public String getScope() {
65-
return scope;
70+
public Long getZoneId() {
71+
return zone_id;
6672
}
6773

68-
public Long getId() {
69-
return id;
74+
public Long getClusterId() {
75+
return cluster_id;
76+
}
77+
78+
public Long getStoragepoolId() {
79+
return storagepool_id;
80+
}
81+
82+
public Long getAccountId() {
83+
return account_id;
7084
}
7185

7286
/////////////////////////////////////////////////////
@@ -89,12 +103,19 @@ public void execute(){
89103
if (cfg != null) {
90104
ConfigurationResponse response = _responseGenerator.createConfigurationResponse(cfg);
91105
response.setResponseName(getCommandName());
92-
if (scope != null) {
93-
response.setScope(scope);
94-
response.setValue(value);
95-
} else {
96-
response.setScope("global");
106+
if(getZoneId() != null) {
107+
response.setScope("zone");
108+
}
109+
if(getClusterId() != null) {
110+
response.setScope("cluster");
111+
}
112+
if(getStoragepoolId() != null) {
113+
response.setScope("storagepool");
114+
}
115+
if(getAccountId() != null) {
116+
response.setScope("account");
97117
}
118+
response.setValue(value);
98119
this.setResponseObject(response);
99120
} else {
100121
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to update config");

‎api/src/org/apache/cloudstack/api/command/admin/pod/ListPodsByCmd.java‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ public class ListPodsByCmd extends BaseListCmd {
5555
@Parameter(name=ApiConstants.ALLOCATION_STATE, type=CommandType.STRING, description="list pods by allocation state")
5656
private String allocationState;
5757

58+
@Parameter(name=ApiConstants.ZONE_TYPE, type=CommandType.STRING, description="the network type of the zone that the virtual machine belongs to")
59+
private String zoneType;
60+
5861
@Parameter(name=ApiConstants.SHOW_CAPACITIES, type=CommandType.BOOLEAN, description="flag to display the capacity of the pods")
5962
private Boolean showCapacities;
6063

@@ -78,6 +81,10 @@ public String getAllocationState() {
7881
return allocationState;
7982
}
8083

84+
public String getZoneType() {
85+
return zoneType;
86+
}
87+
8188
public Boolean getShowCapacities() {
8289
return showCapacities;
8390
}

‎api/src/org/apache/cloudstack/api/command/admin/systemvm/ListSystemVMsCmd.java‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ public class ListSystemVMsCmd extends BaseListCmd {
7474
description="the storage ID where vm's volumes belong to", since="3.0.1")
7575
private Long storageId;
7676

77+
@Parameter(name=ApiConstants.ZONE_TYPE, type=CommandType.STRING, description="the network type of the zone that the virtual machine belongs to")
78+
private String zoneType;
79+
7780
/////////////////////////////////////////////////////
7881
/////////////////// Accessors ///////////////////////
7982
/////////////////////////////////////////////////////
@@ -110,6 +113,10 @@ public Long getStorageId() {
110113
return storageId;
111114
}
112115

116+
public String getZoneType() {
117+
return zoneType;
118+
}
119+
113120
/////////////////////////////////////////////////////
114121
/////////////// API Implementation///////////////////
115122
/////////////////////////////////////////////////////

‎api/src/org/apache/cloudstack/api/command/user/iso/ListIsosCmd.java‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ public class ListIsosCmd extends BaseListTaggedResourcesCmd {
7878
description="the ID of the zone")
7979
private Long zoneId;
8080

81+
@Parameter(name=ApiConstants.ZONE_TYPE, type=CommandType.STRING, description="the network type of the zone that the virtual machine belongs to")
82+
private String zoneType;
83+
8184
/////////////////////////////////////////////////////
8285
/////////////////// Accessors ///////////////////////
8386
/////////////////////////////////////////////////////
@@ -115,6 +118,10 @@ public Long getZoneId() {
115118
return zoneId;
116119
}
117120

121+
public String getZoneType() {
122+
return zoneType;
123+
}
124+
118125
public boolean listInReadyState() {
119126
Account account = UserContext.current().getCaller();
120127
// It is account specific if account is admin type and domainId and accountName are not null

‎api/src/org/apache/cloudstack/api/command/user/network/ListNetworksCmd.java‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ public class ListNetworksCmd extends BaseListTaggedResourcesCmd {
4848
description="the Zone ID of the network")
4949
private Long zoneId;
5050

51+
@Parameter(name=ApiConstants.ZONE_TYPE, type=CommandType.STRING, description="the network type of the zone that the virtual machine belongs to")
52+
private String zoneType;
53+
5154
@Parameter(name=ApiConstants.TYPE, type=CommandType.STRING, description="the type of the network. Supported values are: Isolated and Shared")
5255
private String guestIpType;
5356

@@ -96,6 +99,10 @@ public Long getZoneId() {
9699
return zoneId;
97100
}
98101

102+
public String getZoneType() {
103+
return zoneType;
104+
}
105+
99106
public String getGuestIpType() {
100107
return guestIpType;
101108
}

‎api/src/org/apache/cloudstack/api/command/user/template/ListTemplatesCmd.java‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ public class ListTemplatesCmd extends BaseListTaggedResourcesCmd {
6868
@Parameter(name=ApiConstants.ZONE_ID, type=CommandType.UUID, entityType = ZoneResponse.class,
6969
description="list templates by zoneId")
7070
private Long zoneId;
71+
72+
@Parameter(name=ApiConstants.ZONE_TYPE, type=CommandType.STRING, description="the network type of the zone that the virtual machine belongs to")
73+
private String zoneType;
74+
7175
/////////////////////////////////////////////////////
7276
/////////////////// Accessors ///////////////////////
7377
/////////////////////////////////////////////////////
@@ -92,6 +96,10 @@ public Long getZoneId() {
9296
return zoneId;
9397
}
9498

99+
public String getZoneType() {
100+
return zoneType;
101+
}
102+
95103
public boolean listInReadyState() {
96104

97105
Account account = UserContext.current().getCaller();

0 commit comments

Comments
 (0)