CLI always returns NotAuthorizedOrNotFound

。_饼干妹妹 提交于 2020-01-06 06:01:51

问题


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
}

Here is what I have done:

Ran

bmcs setup config

Entered the user OCID, tenancy OCID and region. Also generated a key pair.

Then went to the console and added an API key (the public key that was generated by the CLI from the previous step.

But every invocation of bmcs results in "NotAuthorizedOrNotFound" "Authorization failed or requested resource not found.".

What am I missing? Any pointers appreciated.


回答1:


-c (--compartment-id) takes a compartment id (ocid), not a compartment name.

So you'd want to do something like: C=ocid1.compartment.oc1..aaaaaarhifmvrvuqtye5q65flzp3pp2jojdc6rck6copzqck3ukcypxfga bmcs network vcn list -c $C

Where C is set to your compartment's id. Please see Using the CLI for more info.



来源:https://stackoverflow.com/questions/44266163/cli-always-returns-notauthorizedornotfound

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!