CLOUDSTACK-9630: Cannot use listNics API as advertised#1797
CLOUDSTACK-9630: Cannot use listNics API as advertised#1797karuturi merged 1 commit intoapache:masterapache/cloudstack:masterfrom
Conversation
| response.setMacAddress(result.getMacAddress()); | ||
|
|
||
| if (result.getBroadcastUri() != null) { | ||
| response.setBroadcastUri(result.getBroadcastUri().toString()); |
There was a problem hiding this comment.
should these two only be visible for root admin?
There was a problem hiding this comment.
@ustcweizhou As per api doc these info should be part of response. Even listVirtualMachines with details=nics
command=listVirtualMachines&details=nics&id=6eea5ceb-e943-4ef3-9f40-4671364d03ab&response=json provides these details.
There was a problem hiding this comment.
@sudhansu7 have you had a chance to think about @ustcweizhou's feedback?
|
@sudhansu7 could you please either add or update an existing a Marvin test case to verify this change? Also, this change seems like it would be useful for LTS users. Could you please change the base branch to 4.9? |
f5e6136 to
0eb5814
Compare
|
@jburwell I have modified the base branch to 4.9 . Also added a marvin test to check nic details. |
|
as it been confirmed the the attribute |
|
@pdion891 As per code there is no restriction on broadcasturi. If broadcasturi is not null then it will part of vm response. |
|
Have you tested as @jburwell comments, |
0eb5814 to
f5e6136
Compare
|
LGTM on the code changes. Make sense to keep listVirtualMachines and listNics in sync for nic response. |
f5e6136 to
5758ab8
Compare
|
@pdion891 removed broadcasturi from api response. Also added marvin test . |
|
Test LGTM based on manual testing of the fix: Before Fix: d82b2278-ca19-46da-b532-0a044e778bb8 71424164-015c-4163-9dde-74019fb22ce2 255.255.255.0 10.1.1.1 10.1.1.119 Guest Isolated true 02:00:1c:fe:00:01 0 71a0be44-69e4-4821-b8d9-e579ed04d52aAfter Fix: Type of NIC is displayed |
5758ab8 to
0028835
Compare
added missing details for listNics API response.
0028835 to
e7326b1
Compare
ACS CI BVT RunSumarry: Link to logs Folder (search by build_no): https://www.dropbox.com/sh/yj3wnzbceo9uef2/AAB6u-Iap-xztdm6jHX9SjPja?dl=0 Failed tests:
Skipped tests: Passed test suits: |
|
tag:mergeready |
|
failures in BVT are not related to this PR. merging. |
listNics API for a VM, "type" was not returned within API response.
EXPECTED BEHAVIOR
The listNics API response return type of NIC (type), as specified in https://cloudstack.apache.org/api/apidocs-4.8/user/listNics.html
ACTUAL BEHAVIOR
The listNics API response does not return type of NIC.
(local) 🐵 > list nics virtualmachineid=a69edaf5-8f21-41ff-8c05-263dc4bd5354
count = 1
nic:
id = 211e0d46-6b94-4425-99f7-e8e9efea2472
deviceid = 0
gateway = 10.1.1.1
ipaddress = 10.1.1.45
isdefault = True
macaddress = 02:00:06:f6:00:01
netmask = 255.255.255.0
networkid = c08fddf1-fd77-4810-a062-ea9d03c5c7e6
virtualmachineid = a69edaf5-8f21-41ff-8c05-263dc4bd5354
Solution:
added "type" details for listNics API response.
After Fix:
(local) 🐵 > list nics virtualmachineid=a69edaf5-8f21-41ff-8c05-263dc4bd5354
count = 1
nic:
id = 211e0d46-6b94-4425-99f7-e8e9efea2472
broadcasturi = vlan://743
deviceid = 0
gateway = 10.1.1.1
ipaddress = 10.1.1.45
isdefault = True
isolationuri = vlan://743
macaddress = 02:00:06:f6:00:01
netmask = 255.255.255.0
networkid = c08fddf1-fd77-4810-a062-ea9d03c5c7e6
traffictype = Guest
type = Isolated
virtualmachineid = a69edaf5-8f21-41ff-8c05-263dc4bd5354