mirror of https://github.com/apache/cloudstack.git
Merging changes from zonesfeature branch: Adding dhcp_provider parameter to UpdateZoneCmd
This commit is contained in:
parent
86b386e8c0
commit
25fd7cd999
|
|
@ -227,4 +227,5 @@ public class ApiConstants {
|
|||
public static final String NETWORK_DEVICE_TYPE = "networkdevicetype";
|
||||
public static final String NETWORK_DEVICE_PARAMETER_LIST = "networkdeviceparameterlist";
|
||||
public static final String ZONE_TOKEN = "zonetoken";
|
||||
public static final String DHCP_PROVIDER = "dhcpprovider";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,6 +75,8 @@ public class UpdateZoneCmd extends BaseCmd {
|
|||
@Parameter(name=ApiConstants.DETAILS, type=CommandType.MAP, description="the details for the Zone")
|
||||
private Map details;
|
||||
|
||||
@Parameter(name=ApiConstants.DHCP_PROVIDER, type=CommandType.STRING, description="the dhcp Provider for the Zone")
|
||||
private String dhcpProvider;
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
|
|
@ -122,7 +124,11 @@ public class UpdateZoneCmd extends BaseCmd {
|
|||
|
||||
public Map getDetails() {
|
||||
return details;
|
||||
}
|
||||
}
|
||||
|
||||
public String getDhcpProvider() {
|
||||
return dhcpProvider;
|
||||
}
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -73,6 +73,9 @@ public class ZoneResponse extends BaseResponse {
|
|||
|
||||
@SerializedName(ApiConstants.ZONE_TOKEN) @Param(description="Zone Token")
|
||||
private String zoneToken;
|
||||
|
||||
@SerializedName(ApiConstants.DHCP_PROVIDER) @Param(description="the dhcp Provider for the Zone")
|
||||
private String dhcpProvider;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
|
|
@ -208,5 +211,13 @@ public class ZoneResponse extends BaseResponse {
|
|||
|
||||
public void setZoneToken(String zoneToken) {
|
||||
this.zoneToken = zoneToken;
|
||||
}
|
||||
}
|
||||
|
||||
public String getDhcpProvider() {
|
||||
return dhcpProvider;
|
||||
}
|
||||
|
||||
public void setDhcpProvider(String dhcpProvider) {
|
||||
this.dhcpProvider = dhcpProvider;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -767,7 +767,8 @@ public class ApiResponseHelper implements ResponseGenerator {
|
|||
zoneResponse.setDomainId(dataCenter.getDomainId());
|
||||
zoneResponse.setType(dataCenter.getNetworkType().toString());
|
||||
zoneResponse.setAllocationState(dataCenter.getAllocationState().toString());
|
||||
zoneResponse.setZoneToken(dataCenter.getZoneToken());
|
||||
zoneResponse.setZoneToken(dataCenter.getZoneToken());
|
||||
zoneResponse.setDhcpProvider(dataCenter.getDhcpProvider());
|
||||
zoneResponse.setObjectName("zone");
|
||||
return zoneResponse;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1088,6 +1088,7 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura
|
|||
int stopVnetRange = 0;
|
||||
Boolean isPublic = cmd.isPublic();
|
||||
String allocationStateStr = cmd.getAllocationState();
|
||||
String dhcpProvider = cmd.getDhcpProvider();
|
||||
Map detailsMap = cmd.getDetails();
|
||||
|
||||
Map<String, String> newDetails = new HashMap<String, String>();
|
||||
|
|
@ -1244,6 +1245,10 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura
|
|||
zone.setAllocationState(allocationState);
|
||||
}
|
||||
|
||||
if(dhcpProvider != null){
|
||||
zone.setDhcpProvider(dhcpProvider);
|
||||
}
|
||||
|
||||
if (!_zoneDao.update(zoneId, zone)) {
|
||||
throw new CloudRuntimeException("Failed to edit zone. Please contact Cloud Support.");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue