15.1 Configuring REST Service Using ORDS

Oracle Trace File Analyzer includes REST support allowing invocation and query over HTTPS.

tfactl rest Command-Line Options to Configure REST Service

Syntax

To facilitate this REST support Oracle REST Data Services (ORDS) is included within the installation.

tfactl rest [-status|-start|-stop|] [-dir dir] [-port port] [-user user] [-debug [-level]]

Note:

You can run the REST command only as root user.

Parameters

Table 15-1 REST Command Parameters

Parameter Description

-status

Prints the current status.

-start

Starts Oracle Trace File Analyzer REST services if not already running.

-stop

Stops Oracle Trace File Analyzer REST services if running.

–dir dir

Specify the directory to use to store the Oracle Trace File Analyzer REST configuration details.

Defaults to the users home directory.

–port port

Specify the port to run ORDS on.

Defaults to 9090.

-user user

Specify the user to run ORDS.

Defaults to the GRID owner.

–debug

Enables debug.

–level

The level of debug to use, where available levels are:
  • 1 – FATAL

  • 2 – ERROR

  • 3 – WARNING

  • 4 – INFO (default)

  • 5 – DEBUG

  • 6 – TRACE

Once ORDS is running, you can invoke REST using the following APIs using requests of the form:
https://host:port/ords/api
For example:
https://host:port/ords/tfactl/print/status

REST Authentication

Oracle Trace File Analyzer REST uses first-party cookie-based authentication (basic authentication).

The Oracle Trace File Analyzer REST application is able to authenticate and authorize itself to the RESTful API using the same cookie session that the web application is using. The first party application has full access to the RESTful API.

During start-up Oracle Trace File Analyzer prompts you for the password for the tfaadmin and tfarest users.

  • Use tfarest user for REST calls

  • Use tfaadmin for making REST calls and to manage the REST service, for example, changing the logging level

# tfactl rest -start

Configuring TFA REST Services using ORDS : 

This might take couple of minutes. Please be patient.

Adding Dependency Jars to ORDS

Adding users to ORDS :

Enter a password for user tfaadmin: 
Confirm password for user tfaadmin: 

Enter a password for user tfarest: 
Confirm password for user tfarest: 

Starting TFA REST Services

Successfully started TFA REST Services [PID : 32650]

URL : https://myserver:9090/ords/tfactl/print/status
Access the web service from a browser using the following URL:
https://host_name:9090/ords/tfactl/print/status

You are presented with a 401 message, which includes a sign in link. Click the link, sign in with tfarest credentials you just created, and you will be directed to REST output.

Alternatively, you can also specify the credentials in a curl command.

# curl -k --user tfarest:mypassword https://myserver:9090/ords/tfactl/print/status
[ {
  "status" : "CheckOK",
  "hostname" : "myserver",
  "pid" : 2430,
  "port" : 5000,
  "version" : "latest-version",
  "buildId" : "latest-build-ID",
  "inventoryStatus" : "COMPLETE"
} ]