mirror of https://github.com/apache/cloudstack.git
PublicIpAddress api response: new parameter "associatednetworkname" - the name of the guest network associated with the ip address
Reviewed-by: Frank Zhang
This commit is contained in:
parent
99706c7c45
commit
3f53ada5f3
|
|
@ -313,6 +313,7 @@ public class ApiConstants {
|
|||
public static final String FIREWALL_DEVICE_DEDICATED = "fwdevicededicated";
|
||||
public static final String SERVICE = "service";
|
||||
public static final String ASSOCIATED_NETWORK_ID = "associatednetworkid";
|
||||
public static final String ASSOCIATED_NETWORK_NAME = "associatednetworkname";
|
||||
public static final String SOURCE_NAT_SUPPORTED = "sourcenatsupported";
|
||||
public static final String RESOURCE_STATE = "resourcestate";
|
||||
public static final String PROJECT_INVITE_REQUIRED = "projectinviterequired";
|
||||
|
|
|
|||
|
|
@ -82,6 +82,9 @@ public class IPAddressResponse extends BaseResponse implements ControlledEntityR
|
|||
@SerializedName(ApiConstants.ASSOCIATED_NETWORK_ID) @Param(description="the ID of the Network associated with the IP address")
|
||||
private IdentityProxy associatedNetworkId = new IdentityProxy("networks");
|
||||
|
||||
@SerializedName(ApiConstants.ASSOCIATED_NETWORK_NAME) @Param(description="the name of the Network associated with the IP address")
|
||||
private String associatedNetworkName;
|
||||
|
||||
@SerializedName(ApiConstants.NETWORK_ID) @Param(description="the ID of the Network where ip belongs to")
|
||||
private IdentityProxy networkId = new IdentityProxy("networks");
|
||||
|
||||
|
|
@ -218,4 +221,8 @@ public class IPAddressResponse extends BaseResponse implements ControlledEntityR
|
|||
public void setTags(List<ResourceTagResponse> tags) {
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
public void setAssociatedNetworkName(String associatedNetworkName) {
|
||||
this.associatedNetworkName = associatedNetworkName;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -814,7 +814,12 @@ public class ApiResponseHelper implements ResponseGenerator {
|
|||
}
|
||||
}
|
||||
|
||||
ipResponse.setAssociatedNetworkId(ipAddr.getAssociatedWithNetworkId());
|
||||
if (ipAddr.getAssociatedWithNetworkId() != null) {
|
||||
Network ntwk = ApiDBUtils.findNetworkById(ipAddr.getAssociatedWithNetworkId());
|
||||
ipResponse.setAssociatedNetworkId(ipAddr.getAssociatedWithNetworkId());
|
||||
ipResponse.setAssociatedNetworkName(ntwk.getName());
|
||||
}
|
||||
|
||||
ipResponse.setVpcId(ipAddr.getVpcId());
|
||||
|
||||
// Network id the ip is associated with (if associated networkId is null, try to get this information from vlan)
|
||||
|
|
|
|||
Loading…
Reference in New Issue