Hello everyone! I have a problem with searching one port via API. I have read this and this, and I don’t know if i’m doing the search in the right way, so I’ll explain better.
For example, I have this ifName: xe-0/1/7 - and i’m trying to search this via API like this:
-
curl -H 'X-Auth-Token: xXxXxXx' https://my-server/api/v0/ports/search/?ifName\=xe-0/1/7
- OR curl -H 'X-Auth-Token: xXxXxXx' https://my-server/api/v0/ports/search/ifName\?ifName\=xe-0/1/7
for the first command:
{
"status": "error",
"message": "No ports found"
}
and this result for the second command:
{
"status": "ok",
"port": [],
"count": 0
}
Is there any way to I get the result searching a port with slash / and get the result like this:
curl -ksH 'X-Auth-Token: xXxXxXx' "https://my-server/api/v0/ports/search/ae0.82"
{
"status": "ok",
"ports": [
{
"device_id": 3,
"port_id": xxx,
"ifIndex": xxx,
"ifName": "ae0.82"
},
{
"device_id": 2,
"port_id": xxx,
"ifIndex": xxx,
"ifName": "ae0.82"
}
]
}
It must be with this exact path api/v0/ports/search
because I need the device_id too with the result… so I cant find a way to get this done.
Thank you so much for your time and help!