Using the Automated Configuration Method
If this is the first time using the OCI CLI, the setup config tool walks you through setup process. When you enter the oci setup config
command it prompts you for the information required for the config file and the API public/private keys and then generates an API key pair and creates the config file.
To configure the OCI CLI using the setup config tool, follow these instructions:
-
From a command window, enter
oci setup config
and follow the prompts. For example:oci setup config This command provides a walkthrough of creating a valid OCI CLI config file. Enter a location for your config [/home/myuserdir/.oci/config]: Enter a user OCID: ocid1.user.unique_ID Enter a tenancy OCID: ocid1.tenancy.unique_ID
Important
For the step Enter a region by index or name, you can't enter the region in the required
system.domain
format. Rather, enter any value from the list because the value is meaningless to Private Cloud Appliance. In Step 2 you change the config file to provide the information needed by Private Cloud Appliance.Enter a region by index or name(e.g. 1: ap-chiyoda-1, 2: ap-chuncheon-1, 3: ap-hyderabad-1, 4: ap-melbourne-1, 5: ap-mumbai-1, 6: ap-osaka-1, 7: ap-seoul-1, 8: ap-sydney-1, 9: ap-tokyo-1, 10: ca-montreal-1, 11: ca-toronto-1, 12: eu-amsterdam-1, 13: eu-frankfurt-1, 14: eu-zurich-1, 15: me-dubai-1, 16: me-jeddah-1, 17: sa-santiago-1, 18: sa-saopaulo-1, 19: sa-vinhedo-1, 20: uk-cardiff-1, 21: uk-gov-cardiff-1, 22: uk-gov-london-1, 23: uk-london-1, 24: us-ashburn-1, 25: us-gov-ashburn-1, 26: us-gov-chicago-1, 27: us-gov-phoenix-1, 28: us-langley-1, 29: us-luke-1, 30: us-phoenix-1, 31: us-sanjose-1): 24
Do you want to generate a new API Signing RSA key pair? (If you decline you will be asked to supply the path to an existing key.) [Y/n]: Y Enter a directory for your keys to be created [/home/myuserdir/.oci]: Enter a name for your key [oci_api_key]: Public key written to: /home/myuserdir/.oci/oci_api_key_public.pem Enter a passphrase for your private key (empty for no passphrase): Private key written to: /home/myuserdir/.oci/oci_api_key.pem Fingerprint: xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx Config written to /home/myuserdir/.oci/config
-
Navigate to the
~/myuserdir/.oci
directory and modify theconfig
file to use the correct region, for example:[DEFAULT] user=ocid1.user.unique_ID fingerprint=xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx key_file=/home/myuserdir/.oci/oci_api_key.pem tenancy=ocid1.tenancy.unique_ID region=pcasys1.example.com
where
pcasys1
is the name of your Private Cloud Appliance andexample.com
is your domain.If you have access to the Service Web UI, you can find the system and domain names on the dashboard. Otherwise, ask a Service Web UI administrator for the information.
-
If you haven't already, upload your API Signing public key through the Compute Web UI. For more information, seeAdding an API Public Key to a User Profile.
What's Next?