Using Rest API to enable/disable Radius

I cannot figure out how to enable/disable AAA User Radius using the Rest API.

This fails with “Internal Server Error”

curl --location --request PATCH 'https:///rest/user/aaa' \

--header 'Content-Type: application/json' \

--header 'Authorization: ••••••' \

--data '{

"accounting": "true",

"default-group": "read",

"exclude-groups": "",

"interim-update": "0s",

"use-radius": "true"

}'

I figured this out. I changed to a POST and added “set” to the URL.

curl --location 'https:///rest/user/aaa/set' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: ••••••' \
  --data '{ "use-radius": "true" }'

FWIW, in modern curl you can use –json instead of –data and you’d avoid explicitly setting the Content-Type manually. Similarly -X POST (or -X PUT, etc) will force the method to use (but POST is assumed when using –data or –json). Finally you can use -U to set the username/password (or add them to the URL), if you didn’t want to provide the authentication header directly.