Hello,
we are using the AOfN REST API to access data about our virtual machines in an integration pipeline with our service mapping/risk management software. As a part of this client application design, each VM should be connected with IP via Vnic (MAC address).
We are able to get the VMs, and each VM in turn has a reference to a vnics.
{
"results": [
{
"entity_id": "10000:1:7458839171874173769",
"entity_type": "VirtualMachine",
"entity": {
"entity_type": "VirtualMachine",
"entity_id": "10000:1:7458839171874173769",
"name": "Asterisk-czu-1",
"entity_type": "VirtualMachine",
"ip_addresses": [],
"default_gateway": "193.84.47.1",
"default_gateways": [
"193.84.47.1"
],
"vnics": [
{
"entity_id": "10000:18:1894923272103426612",
"entity_type": "Vnic",
"entity_name": "[Asterisk-czu-1]-[Network adapter 1]"
}
],
....}
When we check the specific vnic in the standard UI of the VMWare application, the MAC is there:

However, we are unable to access the same information through the REST API, when accessing the same entity:
POST https://xxx/api/ni/entities/fetch
with body:
{
"entity_ids": [
{
"entity_id": "10000:18:1894923272103426612",
"entity_type": "vnic"
}
]
}
The resulting JSON simply does not contain any MAC:
{
"results": [
{
"entity_id": "10000:18:1894923272103426612",
"entity_type": "Vnic",
"entity": {
"entity_type": "Vnic",
"entity_id": "10000:18:1894923272103426612",
"name": "[Asterisk-czu-1]-[Network adapter 1]",
"entity_type": "Vnic",
"ip_addresses": [],
"layer2_network": {
"entity_id": "10000:12:310139164585131842",
"entity_type": "VlanL2Network",
"entity_name": "vlan-2000"
},
"vlan": {
"begin": 2000,
"end": 2000
},
"vm": {
"entity_id": "10000:1:7458839171874173769",
"entity_type": "VirtualMachine",
"entity_name": "Asterisk-czu-1"
}
}
}
]
}
Would anyone know of a way to access this information?
The only MAC we found via REST API is in the RouterInterface entity, but there seems to be no connection back to the Virtual Machine.
Any help would be greatly appreciated.
Best regards,
Petr