CLI始终返回NotAuthorizedOrNotFound [英] CLI always returns NotAuthorizedOrNotFound
问题描述
我试图让CLI在Ubuntu 16.04.1上运行,但我一直都在运行
I am trying to get the CLI working on Ubuntu 16.04.1, but I always keep running into
(cli_env) rnayak@ubuntuvm:~$ bmcs network vcn list -c c21
ServiceError:
{
"code": "NotAuthorizedOrNotFound",
"message": "Authorization failed or requested resource not found.",
"opc-request-id": "9F219FA4DBAB4E95B3A6F1025DF17507/14CE5DEB567A43B68CC8694D24023497/DD9D0EB116C04F76ACDF93DCFEA06A08",
"status": 404
}
这是我所做的:
Ran
bmcs setup config
输入用户OCID,租用OCID和区域. 还生成了密钥对.
Entered the user OCID, tenancy OCID and region. Also generated a key pair.
然后转到控制台并添加一个API密钥(由CLI从上一步生成的公用密钥.
Then went to the console and added an API key (the public key that was generated by the CLI from the previous step.
但是,每次调用bmcs都会导致"NotAuthorizedOrNotFound"授权失败或找不到请求的资源."
But every invocation of bmcs results in "NotAuthorizedOrNotFound" "Authorization failed or requested resource not found.".
我想念什么?任何指针表示赞赏.
What am I missing? Any pointers appreciated.
推荐答案
-c
(--compartment-id
)带有隔离专区ID(ocid),而不是隔离专区名称.
-c
(--compartment-id
) takes a compartment id (ocid), not a compartment name.
因此,您想要执行以下操作:
C=ocid1.compartment.oc1..aaaaaarhifmvrvuqtye5q65flzp3pp2jojdc6rck6copzqck3ukcypxfga
bmcs network vcn list -c $C
So you'd want to do something like:
C=ocid1.compartment.oc1..aaaaaarhifmvrvuqtye5q65flzp3pp2jojdc6rck6copzqck3ukcypxfga
bmcs network vcn list -c $C
其中C
设置为您的隔离专区的ID.请参阅使用CLI 更多信息.
Where C
is set to your compartment's id. Please see Using the CLI for more info.
这篇关于CLI始终返回NotAuthorizedOrNotFound的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!