Added "state" parameter to LoadBalancerRules response

This commit is contained in:
alena 2010-12-17 12:49:37 -08:00
parent 75b02e806d
commit 59cf483043
3 changed files with 19 additions and 0 deletions

View File

@ -50,6 +50,9 @@ public class LoadBalancerResponse extends BaseResponse {
@SerializedName("domain") @Param(description="the domain of the load balancer rule")
private String domainName;
@SerializedName("state") @Param(description="the state of the rule")
private String state;
public Long getId() {
return id;
@ -130,4 +133,12 @@ public class LoadBalancerResponse extends BaseResponse {
public void setDomainName(String domainName) {
this.domainName = domainName;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
}

View File

@ -633,6 +633,12 @@ public class ApiResponseHelper implements ResponseGenerator {
lbResponse.setPublicPort(Integer.toString(loadBalancer.getSourcePortStart()));
lbResponse.setPrivatePort(Integer.toString(loadBalancer.getDefaultPortStart()));
lbResponse.setAlgorithm(loadBalancer.getAlgorithm());
FirewallRule.State state = loadBalancer.getState();
String stateToSet = state.toString();
if (state.equals(FirewallRule.State.Revoke)) {
stateToSet = "Deleting";
}
lbResponse.setState(stateToSet);
Account accountTemp = ApiDBUtils.findAccountById(loadBalancer.getAccountId());
if (accountTemp != null) {

View File

@ -2088,6 +2088,8 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
}
}
s_logger.debug("Restarting network " + networkId + "...");
boolean success = true;
if (!applyIpAssociations(network, false)) {
s_logger.warn("Failed to apply ips as a part of network " + networkId + " restart");