REST API operation fails "not authorized for that command"
Applies to
- ONTAP 9
- REST API
Issue
Volume efficiency modify operations via REST API (PATCH /api/storage/volumes/volume_UUID/) fail using vsadmin user with error:
"message": "not authorized for that command"
Example:
root@SERVER:~/NetAppTemp#curl -s -X PATCH -u 'vsadmin-api:<REDACTED>' -k https://8.8.8.8/api/storage/volumes/<1234-5678-9101112>/ -d '{"efficiency.policy.name": "Efficiency_Policy_Name"}''
{
"job": {
"uuid": "<1234-5678-9101112>",
"_links": {
"self": {
"href": "/api/cluster/jobs/<1234-5678-9101112>"
}
}
}
}root@SERVER:~/NetAppTemp#./volHandler.sh queryJob 8.8.8.8 <1234-5678-9101112>
{
"uuid": "<1234-5678-9101112>",
"description": "PATCH /api/storage/volumes/<1234-5678-9101112>/",
"state": "failure",
"message": "not authorized for that command",
"code": 6,
"start_time": "2024-05-07T09:01:40+02:00",
"end_time": "2024-05-07T09:01:41+02:00",
"svm": {
"name": "svm_name",
"uuid": "<1234-5678-9101112>",
"_links": {
"self": {
"href": "/api/svm/svms/<1234-5678-9101112>"
}
}
},
"error": {
"message": "not authorized for that command",
"code": "6"
},
"_links": {
"self": {
"href": "/api/cluster/jobs/<1234-5678-9101112>"
}
}
}root@SERVER:~/NetAppTemp# date
Tue May 7 09:01:56 AM CEST 2024
root@SERVER:~/NetAppTemp#
