mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-6899: Added vmId in listnics response
This commit is contained in:
parent
93c75c73a4
commit
923c0cd89f
@ -98,6 +98,14 @@ public class NicResponse extends BaseResponse {
|
|||||||
@Param(description = "device id for the network when plugged into the virtual machine", since = "4.4")
|
@Param(description = "device id for the network when plugged into the virtual machine", since = "4.4")
|
||||||
private String deviceId;
|
private String deviceId;
|
||||||
|
|
||||||
|
@SerializedName(ApiConstants.VIRTUAL_MACHINE_ID)
|
||||||
|
@Param(description = "Id of the vm to which the nic belongs")
|
||||||
|
private String vmId;
|
||||||
|
|
||||||
|
public void setVmId(String vmId) {
|
||||||
|
this.vmId = vmId;
|
||||||
|
}
|
||||||
|
|
||||||
public String getId() {
|
public String getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3302,9 +3302,15 @@ public class ApiResponseHelper implements ResponseGenerator {
|
|||||||
public NicResponse createNicResponse(Nic result) {
|
public NicResponse createNicResponse(Nic result) {
|
||||||
NicResponse response = new NicResponse();
|
NicResponse response = new NicResponse();
|
||||||
NetworkVO network = _entityMgr.findById(NetworkVO.class, result.getNetworkId());
|
NetworkVO network = _entityMgr.findById(NetworkVO.class, result.getNetworkId());
|
||||||
|
VMInstanceVO vm = _entityMgr.findById(VMInstanceVO.class, result.getInstanceId());
|
||||||
|
|
||||||
response.setId(result.getUuid());
|
response.setId(result.getUuid());
|
||||||
response.setNetworkid(network.getUuid());
|
response.setNetworkid(network.getUuid());
|
||||||
|
|
||||||
|
if (vm != null) {
|
||||||
|
response.setVmId(vm.getUuid());
|
||||||
|
}
|
||||||
|
|
||||||
response.setIpaddress(result.getIp4Address());
|
response.setIpaddress(result.getIp4Address());
|
||||||
|
|
||||||
if (result.getSecondaryIp()) {
|
if (result.getSecondaryIp()) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user