Versions Compared

Key

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

...

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 inputInput parameters that are passed in a JSON format as part of the HTTP message body.

Note

Note!

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.

Resource path

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

HTTP method

PUT

Body

This is where the executeQuery will be included. The executeQuery JSON payload format 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 definition of query expressions. The query will match all of the specified query expressions.

Rw ui textbox macro
typetip

Example - Get query without query

with

expression in JSON payload

in the HTTP message

body

Code Block
languagebash
$ curl -X PUT -T="example.json" -u user:passw \
http://localhost:9000/api/v1/refdatas/Default.refprofile_star/table/APP.STAR/rowset? \
sessionid=vusncl88sjghv7h8nkb0ohja6t \
-d '{"executeQuery": {"rowsPerPage":500,"selectedColumns":["ID","FIRSTNAME","LASTNAME"]}}'
Rw ui textbox macro
typetip

Example - Get query

using a

with query expression in JSON payload

file

body

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

Example.json file

Code Block
languagejson
{
	 \
-d '{"executeQuery": {
		"rowsPerPage": 500,
		"selectedColumns": ["ID", "FIRSTNAME", "LASTNAME"]
	}
}

Get Data Sets

...

,"filterExpression":[{"col":"ID","expr":9,"op":">="},{"col":"LAST_NAME","expr":"Smith","op":"not like"}]}}'
Rw ui textbox macro
typetip

Example - Get query using a JSON payload file

Code Block
languagebash
$ 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 file

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

Get Data Sets

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.

...

Rw ui textbox macro
typetip

Example - Get status

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

Abort

...

Process

This operation request the active process to abort.

Note

Note!

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

...

Rw ui textbox macro
typetip

Example - Get status

Code Block
languagebash
$ 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

...

Description

Value

Resource

pathThe

path

to where the resource is located

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

HTTP method

The

HTTP method

of the export command.

POST

Basic Auth

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

user:passw

Body

This is where the exportParams will be included

in url encoding

. The exportParams

format

JSON payload 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.
    1. - designated as all by default.

      1. all - export all rows in the table

      2. selected - export query result

  1. 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
Note

Note!

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

Rw ui textbox macro
typetip

Example - Table export without options

Code Block
languagebash
## 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'"user:passw" \
-d 'exportParams=%7B%7D{}' \
> Export.csv
## exportParams={"opts":{"textQualifier":"\'","separator":";","extent":"all"},"selectedColumns":["CITY","CUSTOMER_NAME"]}

- Table export with options

Rw ui textbox macro
typetip

Example - Table export with options

Code Block
languagebash
Code Block
languagebash
$ 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" \
 
-Hd 'content-type: application/x-www-form-urlencoded' \
  -d '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%7DexportParams={"opts":{"textQualifier":"'\''","separator":";","extent":"all"},"selectedColumns":["CITY","CUSTOMER_NAME"]}'
> Export.csv

Table Import

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

Parameters

Description

Value

Resource path

The path to where the resource is located

Resource path

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

<sessionid> 

HTTP method

The HTTP method of the import command.

POST

Basic Auth

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

user:passw

File Input

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.

Example format: file=@/<path to csv file>/test.csv 'opts={"textQualifier":"\'","separator":",","op":"append","force":false}'

file=@/path/to/import_test.csv 'opts={"textQualifier":"\'","separator":",","op":"append","force":false}'

<sessionid> 

HTTP method

POST

File Input

This is where the file input 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.

Note

Note!

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

Rw ui textbox macro
typetip

Example - Table import without options

Code Block
languagebash
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

...

This operation saves data grid edit modification (post insert/update/delete). Changes are saved within client session. This operation requires JSON payload as input.

Note

Note!

tableName and refProfile are mandatory in order to save. A single table can be modified in a single session only.  

Note

Note!

The save operation is supported either on Oracle (based on ROWID pseudo column) or non-Oracle type tables containing Primary Key constraint. Non-Oracle tables without a Primary Key are not supported for data modifications. 

...

This operation cancels the changes made from being saved. As the input, Json payload specifies either all the changes to be canceled or lists the selected Primary Keys to be cancelled. You can cancel the saving of several changes at the same time (one Primary Key per change). The scope is single or all. The format is the same as for the Save changes operation but the ID fields are stored in a root structure. Ids are in a JSON array to hold multiple Primary Keys to be cancelled.

Note

Note!

The Web UI generates surrogate Primary Keys for inserted rows for the cancel function. 

...

Rw ui textbox macro
typetip

Example response

Code Block
languagejson
{
	"dataEdit": {
		"updates": [{
			"action": "update",
			"ids": [{
				"column": "ORDER_NUM",
				"value": 10398005
			}],
			"undoRow": [{
					"column": "SHIPPING_DATE",
					"value": "2011 - 05 - 24 00: 00: 00"
				},
				{
					"column": "ORDER_NUM",
					"value": 10398005
				},
				{
					"column": "QUANTITY",
					"value": 100
				}
			],
			"values": [{
				"column": "FREIGHT_COMPANY",
				"value": "Zagreb"
			}],
			"SaveSize": 3
		}]
	}
}
Note

Note!

SaveSize indicates the number of changes remaining. 

...