Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This operation retrieves table metadata that can be used for grid configuration, export, and Import configuration etcviewing or to derive parameters for other REST APIs. If Last Update feature is enabled, the values stored in the most recent Last Update user and timestamp column will be retrieved as well. The result is returned synchronously.

Info
titleExample - Get metadata


Code Block
$ curl -u user:passw \
http://localhost:9000/api/v1/refdatas/Default.refprofile_star/table/APP.STAR? \
sessionid=vusncl88sjghv7h8nkb0ohja6t


...

Resource path: /refdatas/<Reference Data profile>/table/<table name>/rowset?sessionid=<session id>

HTTP method: PUTResource path

Body:  

This operation executes database queries on specific a Reference Data profile and database table. The query is performed asynchronously and control is returned immediately. You can retrieve the result of the query by using /rowset/<rowset number>?sessionid=<session id>. This operation requires JSON payload as input.

...

titleExample - Get query
Code Block
$ curl -X PUT -T="example.json" -u user:passw \
http://localhost:9000/api/v1/refdatas/Default.refprofile_star/table/APP.STAR/rowset? \
sessionid=vusncl88sjghv7h8nkb0ohja6t

example.json:

Code Block
{
	"executeQuery": {
		"rowsPerPage": 1024,
		"tableName": "APP.STAR",
		"selectedColumns": ["ID", "FIRSTNAME", "LASTNAME"]
	}
}

Get Data Sets

Resource path: /rowset/<rowset number>?sessionid=<session id>

HTTP method: GET

Data sets can be retrieved once downloaded to the file system of the Platform. This operation returns a data set for the given rowset (sequence number). The total number of available data sets can be queried with the status operation.This is where the executeQuery will be included. The executeQuery JSON payload will include these options:

  1. rowsPerPage - the max number of rows(Data Set size) that can be in a rowset of the retrieved result.

  2. selectedColumns - allows for specific columns to be selected.

  3. filterExpression - allows optional definition of query expressions. The query will match all of the specified query expressions.

This operation executes database queries on specific a Reference Data profile and database table. The query is performed asynchronously and control is returned immediately. You can retrieve the result of the query by using /rowset/<rowset number>?sessionid=<session id>. This operation requires input parameters that are passed in a JSON format as part of the HTTP message body.

Note
titleNote!

Any ongoing query process running on the same session will be aborted and a new process for the latest query will be executed.

This operation will clear any uncommitted changes saved in the same session.


Info
titleExample - Get query without query expression in JSON payload body


Code Block
$ curl -X PUT -u user:passw -H 'content-type: application/json' \
http://localhost:9000/api/v1/refdatas/Default.refprofile_star/table/APP.STAR/rowset?sessionid=vusncl88sjghv7h8nkb0ohja6t \
-d '{"executeQuery": {"rowsPerPage":500,"selectedColumns":["ID","FIRSTNAME","LASTNAME"]}}'



Info
titleExample - Get data setsquery with query expression in JSON payload body


Code Block
$ curl -X PUT -u user:passw -H 'content-type: application/json' \
http://localhost:9000/api/v1/rowset/0? \
sessionid=vusncl88sjghv7h8nkb0ohja6t

Get Status

Resource path: /status?sessionid=<session id>

HTTP method: GET

This operation returns a status message. It can be used to retrieve active processes and to query the number of available rows, data sets and status of imports and exports. If Last Update feature is enabled, the values stored in the most recent Last Update user and timestamp column will be retrieved as well.

Note
titleNote!
The status is used by the Web UI to lock the interface during an active process. This prevents a user from initiating another operation before the first operation initiated is complete. However, Abort process can be used before an operation is complete. 
refdatas/Default.refprofile_star/table/APP.STAR/rowset?sessionid=vusncl88sjghv7h8nkb0ohja6t \
-d '{"executeQuery": {"rowsPerPage":500,"selectedColumns":["ID","FIRSTNAME","LASTNAME"],"filterExpression":[{"col":"ID","expr":9,"op":">="},{"col":"LAST_NAME","expr":"Smith","op":"not like"}]}}'



Info
titleExample - Get statusquery using a JSON payload file


Code Block
$ curl -X PUT -T="example.json" -u user:passw \
-H 'content-type: application/json' \
'http://localhost:9000/api/v1/status? \
sessionid=vusncl88sjghv7h8nkb0ohja6t   

Abort process

Resource path: /status/abort?sessionid=<session id>

HTTP method: GET

This operation request the active process to abort.

...

titleExample - Abort process
Code Block
$ curl -u user:passw \
http://localhost:9000/api/v1/status/abort? \
sessionid=vusncl88sjghv7h8nkb0ohja6t

Table export

This operation performs a database table export. Input parameters are passed in a JSON format as part of the HTTP message body as a APPLICATION_FORM_URLENCODED string. 

...

This is a required parameter which contains the Image Removed username and password. 

...

This is where the exportParams will be included in url encoding. The exportParams format will include these optional options:

  1. opts
    1. textQualifier - designated as double quotes by default.
    2. separator - designated as a comma by default.
    3. extent - designated as all by default.
  2. selectedColumns - allows for specific columns to be selected.

...

Example format: exportParams={"opts":{"textQualifier":"\'","separator":";","extent":"all"},"selectedColumns":["COLUMN1","COLUMN2"]}

exportParams=%7B%22opts%22%3A%7B%22textQualifier%22%3A%22%5C'\''%22%2C%22separator%22%3A%22%3B%22%2C%22extent%22%3A%22all%22%7D%2C%22selectedColumns%22%3A%5B%22CITY%22%2C%22CUSTOMER_NAME%22%5D%7D

Info
titleExample - Table export without options
Code Block
## exportParams={}

curl -X POST \
'http://localhost:9000/api/v1/refdatas/ref_data_mgmt_oracle.ref_data_mgmt_pf/table/TABLE.CUSTOMERS/download?sessionid=p3hce86dkb4rmls9peh4e8rps9' \
-u "user:passw" \
-H 'content-type: application/x-www-form-urlencoded' \
-d 'exportParams=%7B%7D' \
> Export.csv
Info
titleExample - Table export with options
Code Block
## exportParams={"opts":{"textQualifier":"\'","separator":";","extent":"all"},"selectedColumns":["CITY","CUSTOMER_NAME"]}

curl -X POST \
  '/refdatas/Default.refprofile_star/table/APP.STAR/rowset?sessionid=vusncl88sjghv7h8nkb0ohja6t

example.json:

Code Block
{
	"executeQuery": {
		"rowsPerPage": 500,
		"selectedColumns": ["ID", "FIRSTNAME", "LASTNAME"]
	}
}


Get Data Sets

Resource path: /rowset/<rowset number>?sessionid=<session id>

HTTP method: GET

Data sets can be retrieved once downloaded to the file system of the Platform. This operation returns a data set for the given rowset (sequence number). The total number of available data sets can be queried with the status operation.

Info
titleExample - Get data sets


Code Block
$ curl -u user:passw \
http://localhost:9000/api/v1/rowset/0?sessionid=vusncl88sjghv7h8nkb0ohja6t


Get Status

Resource path: /status?sessionid=<session id>

HTTP method: GET

This operation returns a status message. It can be used to retrieve active processes and to query the number of available rows, data sets and status of imports and exports. If Last Update feature is enabled, the values stored in the most recent Last Update user and timestamp column will be retrieved as well.

Info
titleExample - Get status


Code Block
$ curl -u user:passw \
http://localhost:9000/api/v1/status?sessionid=vusncl88sjghv7h8nkb0ohja6t   


Abort process

Resource path: /status/abort?sessionid=<session id>

HTTP method: GET

This operation request the active process to abort.

Note
titleNote!

To prevent a user from initiating another operation before the first operation initiated is complete, Abort Process can be used before an operation is complete. 


Info
titleExample - Abort process


Code Block
$ curl -u user:passw \
http://localhost:9000/api/v1/status/refdatas/ref_data_mgmt_oracle.ref_data_mgmt_pf/table/TABLE.CUSTOMERSabort?sessionid=vusncl88sjghv7h8nkb0ohja6t


Table Export

Resource path: /refdatas/<Reference Data profile>/table/<table name>/download?sessionid=

...

Table Import

This operation performs a database table import. Input parameters are passed in a JSON format as part of the HTTP message body.

...

This is a required parameter which contains the Image Removed username and password. 

...

This is where the file input will be included in url encoding. The exportParams format will include these optional opts:

  1. textQualifier - designated as double quotes by default.
  2. separator - designated as a comma by default.
  3. append/truncate - designated as append by default. Changing to truncate will result in the existing data in the table to be truncated before the import is executed.
  4. force - designated as false by default.

...

<sessionid> 

HTTP method: POST

Body: This is where the exportParams will be included. The exportParams JSON payload will include these options:

  1. opts

    1. textQualifier - designated as double quotes by default.

    2. separator - designated as a comma by default.

    3. extent - designated as all by default.

      1. all - export all rows in the table

      2. selected - export rows from the result of Get Query

  2. selectedColumns - allows for specific columns to be selected.

Note
titleNote!

For the extend option, selected value is only applicable when Get Query is applied prior Table Export.  

This operation performs a database table export. Input parameters are passed in a JSON format as part of the HTTP message body.

Info
titleExample - Table export without options


Code Block
$ curl -X POST \
'http://localhost:9000/api/v1/refdatas/ref_data_mgmt_oracle.ref_data_mgmt_pf/table/TABLE.CUSTOMERS/download?sessionid=p3hce86dkb4rmls9peh4e8rps9' \
-u "user:passw" \
-d 'exportParams={}' \
> Export.csv



Info
titleExample - Table export with options


Code Block
$ curl -X POST \
'http://localhost:9000/api/v1/refdatas/ref_data_mgmt_oracle.ref_data_mgmt_pf/table/TABLE.CUSTOMERS/download?sessionid=p3hce86dkb4rmls9peh4e8rps9' \
-u "user:passw" \
-d 'exportParams={"opts":{"textQualifier":"'\''","separator":";","extent":"all"},"

...

selectedColumns":["

...

CITY","CUSTOMER_NAME"]}'
> Export.csv


Table Import

Resource path: /refdatas/<Reference Data profile>/table/<table name>/upload?sessionid=<sessionid>

HTTP method: POST

Body: This is where the file and the input parameters will be included. The exportParams format will include these optional opts:

  1. textQualifier - designated as double quotes by default.

  2. separator - designated as a comma by default.

  3. opts - designated as append by default.

    1. append - import rows will be appended to the table

    2. truncate - the existing data in the table will be truncated before the import is executed.

  4. force - designated as false by default.

This operation performs a database table import. Input parameters are passed in a JSON format as part of the HTTP message body.

Info
titleExample - Table import without options


Code Block
$ curl -i -u "user:passw" \

 'http://localhost:9000/api/v1/refdatas/ref_data_mgmt_oracle.ref_data_mgmt_pf/table/TABLE.CUSTOMERS/upload?sessionid=rssrh20dcd8lc1j505b3bqnstc' \
  -F file=@/path/to/import_test.csv


...

Info
titleExample - Table import with options


Code Block
$ curl -i -u "user:passw" \
 
'http://localhost:9000/api/v1/refdatas/ref_data_mgmt_oracle.ref_data_mgmt_pf/table/TABLE.CUSTOMERS/upload?sessionid=p3hce86dkb4rmls9peh4e8rps9' \
  -F file=@/path/to/import_test.csv \
 
-F 'opts={"textQualifier":"\'","separator":",","op":"truncate","force":false}'


...