Quick Start
Oracle Database Appliance REST APIs provide a set of APIs to perform management and monitoring functions from a Java application running on any system in your data center. These APIs provide the flexibility to plug Oracle Database Appliance management functions into any custom monitoring and management application. Oracle Database Appliance REST APIs are serviced by the DCS Agent running on every Oracle Database Appliance system. The APIs are authenticated using the same basic authentication mechanism, similar to the authentication used by BUI and odacli. To set up the DCS Agent, see the Oracle Database Appliance Deployment and User's Guide for your hardware model.
Using REST APIs through Oracle Database Appliance Java SDK
- Create a project in an IDE (for example, NetBeans or Eclipse) using the
srcdirectory from the unzippedoda-java-sdk-19.11.0.0.0.zip, available at/opt/oracle/dcs/odajavasdk. - The samples directory contains Java files that demonstrate database lifecycle management (LCM) operations such as create, delete, update, and list. You can also get the job details based on the job ID.
- Add the
src/main/java/samplesandsrc/main/resourcesas the source folders of the created project. - Add
oda-java-sdk-client-19.11.0.0.0.jarfrom thelibdirectory to the build path. - Attach
oda-java-sdk-client-19.11.0.0.0-javadoc.jarfrom thedocsdirectory to the required library added above. Check the IDE settings on how to add docs directory to the build path jars. - Copy the
cwallet.ssofile from/opt/oracle/dcs/conf/dcspublickey_wallet/cwallet.ssoon the Oracle Database Appliance machine to the host where you plan to run your application. - Edit the Java files with the information given in the commented sections. Update IP address or hostname, port, username, that is oda-admin, password, wallet path and alias in
utils/DCSAgentUtil.java. Alias can be found in /opt/oracle/dcs/conf/dcs-agent.json. Set wallet path to the location of cwallet.sso on the local host. - Run a build of the application, without errors. Run any sample file to see the functionality it provides. For example, run
ListDatabases.javato get the list of databases running on your Oracle Database Appliance system. - You can view the output on the console and in the
oda-java-sdk.logfile generated in the logs folder in the project folder.