The OCI SDK supports the JavaScript langauge. This code shows how to use it.
To be able to run the sample you have to have NodeJS installed on your environment. We recommend using NVM (Linux and MacOS), in case you would like to maintain several versions at the same time.
The Node and NPM versions used to test the code:
- Node >= v14.18.1
- NPM >= 8.1.1
You have to install the latest version in order to test this code.
To install the Oracle OCI Node SDK
npm install oci-sdk --save
Set your environment variables:
export PROJECT=<project ocid>
export COMPARTMENT=<compartment ocid>
export SUBNET=<subnet ocid>
export LOGGROUP=<log group ocid>
export TENANCY=<ini tenancy name>
export CONFIG=$HOME/.oci/config
- PROJECT: Data Science Service Project OCID
- COMPARTMENT: Data Science Service Project Compartment OCID
- SUBNET: VCN Private Subnet OCID to be used by the Job
- LOGGROUP: Log Group OCID to be used by the Job Runs to create the logs
- TENANCY: The name of the tenancy as set in the $HOME/.oci/config
- CONFIG: OCI API Key configuration location
Run the client to test Job creation and Job Run.
node client.js