跳转到主内容

REST API操作失败"无权执行此命令"

Views:
35
Visibility:
Public
Votes:
0
Category:
ontap-9
Specialty:
core
Last Updated:

适用场景

  • ONTAP 9
  • REST API

问题描述

使用vsadmin用户通过REST API (PATCH /api/storage/volumes/volume_UUID/ )执行卷效率修改操作失败,并显示错误:

"message": "not authorized for that command"

 

示例:

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#

Sign in to view the entire content of this KB article.

New to NetApp?

Learn more about our award-winning Support

NetApp provides no representations or warranties regarding the accuracy or reliability or serviceability of any information or recommendations provided in this publication or with respect to any results that may be obtained by the use of the information or observance of any recommendations provided herein. The information in this document is distributed AS IS and the use of this information or the implementation of any recommendations or techniques herein is a customer's responsibility and depends on the customer's ability to evaluate and integrate them into the customer's operational environment. This document and the information contained herein may be used solely in connection with the NetApp products discussed in this document.