...
Note |
---|
Temporary files are created on the Platform host when the user executes queries via Reference Data Management. These temporary files, which stored in $MZ_HOME/tmp/rowset , are removed automatically when the user session expires. Users sessions expire automatically after six (6) hours. |
Restful Operations
The tables below describe the various operation that are available for Reference Data Management.
...
Basic authentication is used and you must pass user credentials for each RESTful call.
Create and Get Session
Resource path: /session
HTTP method: GET
...
Info |
---|
|
Code Block |
---|
$ curl -u \
user:passw http://localhost:9000/api/v1/session |
|
Close Session
Resource path: /session/close?sessionid=<sessionid>
...
Info |
---|
title | Example - Closing a session |
---|
|
Code Block |
---|
$ curl -u user:passw \
http://localhost:9000/api/v1/session/close?sessionid=vusncl88sjghv7h8nkb0ohja6t |
|
Get Reference Data Profiles
Resource path: /refdatas
...
Info |
---|
title | Example - Retrieving a list |
---|
|
Code Block |
---|
$ curl -u \
user:passw http://localhost:9000/api/v1/refdatas
|
|
Resource path: /refdatas/<Reference Data profile>/table/<table name>?sessionid=<session id>
...
Info |
---|
title | Example - Get metadata |
---|
|
Code Block |
---|
$ curl -u user:passw \
http://localhost:9000/api/v1/refdatas/Default.refprofile_star/table/APP.STAR? \
sessionid=vusncl88sjghv7h8nkb0ohja6t |
|
Get Query
Resource path: /refdatas/<Reference Data profile>/table/<table name>/rowset?sessionid=<session id>
...
Info |
---|
|
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>
...
Info |
---|
title | Example - 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>
...
Info |
---|
title | Example - 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>
...
Info |
---|
title | Example - 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.
...
Info |
---|
title | Example - Table export with options |
---|
|
Code Block |
---|
## exportParams={"opts":{"textQualifier":"\'","separator":";","extent":"all"},"selectedColumns":["CITY","CUSTOMER_NAME"]}
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%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'
> 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.
...
Info |
---|
title | Example - 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}' |
|
Save Changes
Resource path: /save?sessionid=<session id>
...
Info |
---|
title | Example - Save changes |
---|
|
Code Block |
---|
$ curl -X PUT -T="example.json" \
http://user:passw@localhost:9000/api/v1/save? \
sessionid=vusncl88sjghv7h8nkb0ohja6t |
example.json: Code Block |
---|
{
"dataEdit": {
"refProfile": "Default.refTest",
"tableName": "MZADMIN.REFRENCE_DATA",
"updates": [{
"action": "insert",
"values": [{
"column": "ID",
"value": 645
}, {
"column": "FIRSTNAME",
"value": "Roberts"
}, {
"column": "LASTNAME",
"value": "Polis"
}]
}]
}
} |
|
Commit Changes
Resource path: /save/commit?force=<true|false>&sessionid=<session id>
...
Info |
---|
title | Example - Commit changes |
---|
|
Code Block |
---|
$ curl -u user:passw \
http://localhost:9000/api/v1/commit? \
force=false&sessionid=vusncl88sjghv7h8nkb0ohja6t |
|
List Changes
Resource path: /save/list?sessionid=<session id>
...
Info |
---|
title | Example - List changes |
---|
|
Code Block |
---|
$ curl -u user:passw \
http://localhost:9000/api/v1/save/list?
\sessionid=vusncl88sjghv7h8nkb0ohja6t |
|
Cancel Changes
Resource path: /save/cancel?sessionid=<session id>
...
Note |
---|
|
SaveSize indicates the number of changes remaining.
|
Show Demo Query
Resource path: /demo/queryRequestParameters
...
This operation shows the json payload format that applies for a query operation e g rowset/.
Show Demo Changes
Resource path: /demo/dataEditRequestParameters
...