Skip to content

Latest commit

 

History

History
70 lines (45 loc) · 2.47 KB

README.md

File metadata and controls

70 lines (45 loc) · 2.47 KB

Lab 600: Programmatically Talking to Oracle Cloud

Orchestrate ATP instances or any other resource in Oracle Cloud using your favourite programming language. SDK sample scripts available for Python, Java and Node.js

Execute your SDK JAVA app

Download the code

wget --content-disposition https://github.com/vmleon/OracleATPGettingStarted/blob/master/store/sdkjava.zip?raw=true

Unzip the file and change the directory to java

unzip sdkjava.zip && cd sdkjava

There is a config file template we need to copy with the proper name to be picked by the application

cp src/main/resources/config.properties.template src/main/resources/config.properties

Get the value from COMPARTMENT_OCID from Compartment OCID Compartment OCID Compartment OCID

Edit the properties file so it matches your settings. Make sure you change the COMPARTMENT_OCID and REGION_ID, everything else should be fine but make sure it matches your configuration.

vim src/main/resources/config.properties

CONFIG_LOCATION=~/.oci/config
COMPARTMENT_OCID=ocid1.compartment.oc1..blablabla
CONFIG_PROFILE=DEFAULT
REGION_ID=uk-london-1

This is a Gradle project, which means we can install dependencies and run the code all in one simple command.

./gradlew run

It will take some time doing the downloads, compilation, etc but you should see something like this, listing the Availability Domains of London region and the list of Autonomous Databases

uk-london-1 ADs: mDbm:UK-LONDON-1-AD-1, mDbm:UK-LONDON-1-AD-2, mDbm:UK-LONDON-1-AD-3
ATPs: atpworkshop, playground

Explore the code

Feel free to inspect the code on Github in the folder src/sdkjava.

All the meat is in src/sdkjava/src/main/java/page/cateam/SDK.java!

It works

Well done, you configure the SDK Java app to ask to Oracle Cloud for the list of Availability Domains and the list of Autonomous Databases in a compartment.

You can find information about JAVA SDK and other languages at Oracle Cloud SDKs Documentation

Congratulations! You have finish the workshop! Go to appendix for some extra information and much more content available.


<< Prev | home | APPENDIX >>>>>