Vampiro
Vampiro

Reputation: 335

CLI always returns NotAuthorizedOrNotFound

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.

Upvotes: 1

Views: 4139

Answers (1)

Joe
Joe

Reputation: 2540

-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.

Upvotes: 3

Related Questions