问题
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