我正在尝试使用调用 IAM api curl
,特别是organizations.roles.list
方法。
https://cloud.google.com/iam/reference/rest/v1/organizations.roles/list
从文档中,我的请求应该是这样构造的:
https://iam.googleapis.com/v1/organizations/<org-id>/roles
但是,调用它会导致此错误:
{ "error": { "code": 404, "message": "Method ListRoles not found for service iam.googleapis.com", "status": "NOT_FOUND" } }
完整请求:curl -H "Authorization: Bearer $(gcloud auth print-access-token)" https://iam.googleapis.com/v1/organizations/<org-id>/roles
我究竟做错了什么?