Skip to content

Latest commit

 

History

History
21 lines (16 loc) · 1.07 KB

support-for-oci.md

File metadata and controls

21 lines (16 loc) · 1.07 KB

Support for Oracle Cloud Infrastructure

The starter kit now comes with the Oracle Cloud Infrastructure (OCI) Python SDK preinstalled.

  1. Follow the instructions on OCI's Tools Configuration page to generate, upload the API key and configure the SDK.
  2. Place the API key and config file in a subdirectory .oci, under the home directory of the user. In Mac and Linux, the home directory is expressed by the environment variable $HOME, and in Windows, %USERPROFILE%.
  3. Uncomment the following line in devcontainer.json:
    "-v", "${env:HOME}${env:USERPROFILE}/.oci:/home/vscode/.oci",

Running the following Python code should return the user object if the SDK is configured correctly:

import oci

config=oci.config.from_file("~/.oci/config", "DEFAULT")
identity = oci.identity.IdentityClient(config)
user = identity.get_user(config["user"]).data
print(user)