Scheduler REST Client API

Besides the Scheduler RMI Client API you can also interact with the Scheduler servers through a REST API provided by the Scheduler Administration Tool. The documentation of this REST API is available on http://<host>:<port>/webadmin/denodo-scheduler-admin/swagger-ui.html

However first of all, in order to use this API an authentication action needs to be done. There are two different ways to do it: public which uses HTTP Basic Authentication (RFC 7617) in all requests or private which performs a login before any request and logout after all them. The private alternative is deprecated to be used by external REST API clients and they should use the public.

Public

In order to perform a request with Basic Authentication it is necessary to follow next indications:

  1. Construct the user-pass by concatenating the user-id, a single colon (“:”) character and the password

  2. Encode the user-pass using Base64 into a sequence of US-ASCII characters

  3. Build a header “Authorization” and the value “Basic <BASE64-user-pass>”

An example to retrieve the list of projects by calling /public/api/projects and assuming user password admin/admin was:

curl --location --request GET 'http://localhost:9090/webadmin/denodo-scheduler-admin/public/api/projects?uri=//localhost:8000' --header 'Authorization: Basic YWRtaW46YWRtaW4='

And for adding a new project:

curl --location --request POST 'http://localhost:9090/webadmin/denodo-scheduler-admin/public/api/projects?uri=//localhost:8000' --header 'Authorization: Basic YWRtaW46YWRtaW4=' --header 'Content-Type: application/json' --data-raw '{"description": "Postman Test project","name": "Test project 1"}'

Private (Deprecated)

The steps in order to perform a successful authentication are:

  1. GET http://<host>:<port>/webadmin/denodo-scheduler-admin/Ping

  2. Extract from response: X-XSRF-TOKEN value from header and JSESSIONID from cookie

  3. POST http://<host>:<port>/webadmin/denodo-scheduler-admin/login

Note

It is necessary to add in the request:

Header X-XSRF-TOKEN with the value of X-XSRF-TOKEN header got in 2

Cookie JSESSIONID with the value of JSESSIONID cookie got in 2

  1. Extract from response: X-XSRF-TOKEN value from header and JSESSIONID from cookie

  2. Request any API endpoint with:

    1. GET requests:

    Note

    It is necessary to add in the request:

    Cookie JSESSIONID with the value of last JSESSIONID cookie got

    1. POST requests:

    Note

    It is necessary to add in the request:

    Header X-XSRF-TOKEN with the value of last X-XSRF-TOKEN header got

    Cookie JSESSIONID with the value of last JSESSIONID cookie got

  3. POST http://<host>:<port>/webadmin/denodo-scheduler-admin/logout

Note

It is necessary to add in the request:

Header X-XSRF-TOKEN with the value of last X-XSRF-TOKEN header got

Cookie JSESSIONID with the value of last JSESSIONID cookie got

An example to retrieve the list of projects by calling /api/projects and create a new project was:

  1. Ping

curl --location --request GET 'http://localhost:9090/webadmin/denodo-scheduler-admin/Ping' --header 'URI: //localhost:8000' -i
  1. Login

curl --location --request POST 'http://localhost:9090/webadmin/denodo-scheduler-admin/login' --header 'X-XSRF-TOKEN: <XSRF-TOKEN-VALUE-FROM-HEADER>' --header 'Cookie: JSESSIONID=<JSESSIONID-VALUE-FROM-COOKIE>' --form 'username=admin' --form 'password=admin' --form 'uri=//localhost:8000' -i
  1. Projects list

curl --location --request GET 'http://localhost:9090/webadmin/denodo-scheduler-admin/api/projects' --header 'URI: //localhost:8000' --header 'Cookie: JSESSIONID=<JSESSIONID-VALUE-FROM-COOKIE>' -i
  1. Add new project

curl --location --request POST 'http://localhost:9090/webadmin/denodo-scheduler-admin/api/projects' --header 'URI: //localhost:8000' --header 'Content-Type: application/json' --header 'X-XSRF-TOKEN: <XSRF-TOKEN-VALUE-FROM-HEADER>' --header 'Cookie: JSESSIONID=<JSESSIONID-VALUE-FROM-COOKIE>' --data-raw '{"description": "projDesc","name": "proj"}' -i
  1. Logout

curl --location --request POST 'http://localhost:9090/webadmin/denodo-scheduler-admin/logout' --header 'URI: //localhost:8000' --header 'X-XSRF-TOKEN: <XSRF-TOKEN-VALUE-FROM-HEADER>' --header 'Cookie: JSESSIONID=<JSESSIONID-VALUE-FROM-COOKIE>' -i