Fixed list by zoneId in listPhysicalNetworks

This commit is contained in:
Alena Prokharchyk 2011-11-10 20:45:51 -08:00
parent f922698309
commit bfff9ee22c
2 changed files with 10 additions and 41 deletions

View File

@ -26,6 +26,7 @@ import org.apache.log4j.Logger;
import com.cloud.api.ApiConstants;
import com.cloud.api.BaseCmd;
import com.cloud.api.BaseListCmd;
import com.cloud.api.IdentityMapper;
import com.cloud.api.Implementation;
import com.cloud.api.Parameter;
import com.cloud.api.ServerApiException;
@ -44,9 +45,11 @@ public class ListPhysicalNetworksCmd extends BaseListCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
@IdentityMapper(entityTableName="physical_networks")
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="list physical network by id")
private Long id;
@IdentityMapper(entityTableName="data_center")
@Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, description="the Zone ID for the physical network")
private Long zoneId;

View File

@ -21,19 +21,20 @@ package com.cloud.api.response;
import java.util.List;
import com.cloud.api.ApiConstants;
import com.cloud.api.IdentityProxy;
import com.cloud.serializer.Param;
import com.google.gson.annotations.SerializedName;
public class PhysicalNetworkResponse extends BaseResponse{
@SerializedName(ApiConstants.ID) @Param(description="the id of the physical network")
private Long id;
private IdentityProxy id = new IdentityProxy("physical_networks");
@SerializedName(ApiConstants.BROADCAST_DOMAIN_RANGE) @Param(description="Broadcast domain range of the physical network")
private String broadcastDomainRange;
@SerializedName(ApiConstants.ZONE_ID) @Param(description="zone id of the physical network")
private Long zoneId;
private IdentityProxy zoneId = new IdentityProxy("data_center");
@SerializedName(ApiConstants.STATE) @Param(description="state of the physical network")
private String state;
@ -53,46 +54,26 @@ public class PhysicalNetworkResponse extends BaseResponse{
@SerializedName(ApiConstants.NETWORK_SPEED) @Param(description="the speed of the physical network")
private String networkSpeed;
public void setId(Long id) {
this.id = id;
}
public Long getId() {
return this.id;
public void setId(long id) {
this.id.setValue(id);
}
public void setZoneId(Long zoneId) {
this.zoneId = zoneId;
}
public Long getZoneId() {
return this.zoneId;
this.zoneId.setValue(zoneId);
}
public void setState(String state) {
this.state = state;
}
public String getState() {
return this.state;
}
public void setDomainId(Long domainId) {
this.domainId = domainId;
}
public Long getDomainId() {
return this.domainId;
}
public void setVlan(String vlan) {
this.vlan = vlan;
}
public String getVlan() {
return this.vlan;
}
public void setTags(List<String> tags) {
@ -107,27 +88,15 @@ public class PhysicalNetworkResponse extends BaseResponse{
this.tags = buf.delete(buf.length()-1, buf.length()).toString();
}
public String getTags() {
return tags;
}
public void setBroadcastDomainRange(String broadcastDomainRange) {
this.broadcastDomainRange = broadcastDomainRange;
}
public String getBroadcastDomainRange() {
return broadcastDomainRange;
}
public void setNetworkSpeed(String networkSpeed) {
this.networkSpeed = networkSpeed;
}
public String getNetworkSpeed() {
return networkSpeed;
}
public void setIsolationMethods(List<String> isolationMethods) {
if (isolationMethods == null || isolationMethods.size() == 0) {
return;
@ -141,8 +110,5 @@ public class PhysicalNetworkResponse extends BaseResponse{
this.isolationMethods = buf.delete(buf.length()-1, buf.length()).toString();
}
public String getIsolationMethods() {
return isolationMethods;
}
}