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
src
directory from the unzippedoda-java-sdk-19.26.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/samples
andsrc/main/resources
as the source folders of the created project. - Add
oda-java-sdk-client-19.26.0.0.0.jar
from thelib
directory to the build path. - Attach
oda-java-sdk-client-19.26.0.0.0-javadoc.jar
from thedocs
directory to the required library added above. Check the IDE settings on how to add docs directory to the build path jars. - Copy the
cwallet.sso
file from/opt/oracle/dcs/conf/dcspublickey_wallet/cwallet.sso
on 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.java
to 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.log
file generated in the logs folder in the project folder.