List IPs from secondary interfaces

Need a method to list IP’s from all the Network interfaces of the servers in Morpheus. The API call provides only the IP from master interface (eth0). Please advise.

You should get a list of interfaces when you call the /api/servers/id endpoint. Then look for ‘ipAddress’ in each interface in the list.

"interfaces": [
  {
    "id": 5616,
    "refType": null,
    "refId": null,
    "name": "eth0",
    "internalId": "7",
    "externalId": "4000",
    "uniqueId": "morpheus-nic-1005-1062-0",
    "publicIpAddress": "10.200.198.138",
    "publicIpv6Address": null,
    "ipAddress": "10.200.198.138",
    "ipv6Address": "fe80::250:56ff:fea5:c237",
    "ipSubnet": null,
    "ipv6Subnet": null,
    "description": null,
    "dhcp": false,
    "active": true,
    "poolAssigned": false,
    "primaryInterface": true,
    "network": {
        "id": 1006,
        "name": Server"
    },
    "subnet": null,
    "networkGroup": null,
    "networkPosition": null,
    "networkPool": {
        "id": 66,
        "name": "10.200.198.128/26"
    },
    "networkDomain": {
        "id": 48,
        "name": "mydomain.com"
    },
    "type": {
        "id": 4,
        "code": "vmxNet3",
        "name": "VMXNET 3"
    },
    "ipMode": null,
    "macAddress": "00:50:56:a5:c2:37"
  },
  {
    "id": 5617,
    "refType": null,
    "refId": null,
    "name": "eth1",
    "internalId": "8",
    "externalId": "4001",
    "uniqueId": "morpheus-nic-1005-1062-1",
    "publicIpAddress": null,
    "publicIpv6Address": null,
    "ipAddress": "10.200.198.139",
    "ipv6Address": "fe80::250:56ff:fea5:ee19",
    "ipSubnet": null,
    "ipv6Subnet": null,
    "description": null,
    "dhcp": false,
    "active": true,
    "poolAssigned": false,
    "primaryInterface": false,
    "network": {
        "id": 1006,
        "name": "Server"
    },
    "subnet": null,
    "networkGroup": null,
    "networkPosition": null,
    "networkPool": {
        "id": 66,
        "name": "10.200.198.128/26"
    },
    "networkDomain": {
        "id": 48,
        "name": "mydomain.com"
    },
    "type": {
        "id": 4,
        "code": "vmxNet3",
        "name": "VMXNET 3"
    },
    "ipMode": "",
    "macAddress": "00:50:56:a5:ee:19"
  }
]
1 Like