translate poe power-cycle command to REST API

Can anyone help translate/convert the following command I use for power-cycling a PoE port to a working REST API call?

/interface ethernet poe power-cycle ether1 duration=5

I’ve been unable to find a relevant example in the docs or the web.

Thanks.

Through some trial and error, I figured out something that works.
End point is: /rest/interface/ethernet/poe/power-cycle
And the JSON payload uses .id (using “name”: “ether1” does not work)

Here is the curl command:
curl -k -u ‘MYUSERNAME:MYPASSWORD’
–request POST
–url https://MYROUTER.ADDRESS.COM/rest/interface/ethernet/poe/power-cycle
–header ‘Content-Type: application/json’
–data ‘{
“.id”: “*1”,
“duration”: “5”
}’

The .id can be determined by doing a GET on /rest/interface/ethernet/poe

Thank you!

This was exactly what I was looking for, it saved me a lot of headache :slight_smile: