Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 23 Next »

Database operations are supported via a RESTful HTTP Interface on the Platform.

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. 

The service endpoint URI is http://<Platform host>:<port>/api/v1.

If encryption is enabled, the URI is https://<Platform host>:<port>/api/v1.

For further information about enabling encryption, see Network Security in the System Administration user's guide.

Basic authentication is used and you must pass user credentials for each RESTful call.

Create and Get Session

This operation returns a session id which should be appended to all subsequent API calls where this parameter is applicable.

Resource path

/session

HTTP method

GET

Close Session

This operation closes a session. This session id is no longer valid for any subsequent API calls.

Resource path

/session/close?sessionid=<sessionid>

HTTP method

GET

Get Reference Data Profiles

This operation retrieves a list of all Reference Data profiles that are available to the user.

Resource path

/refdatas

HTTP method

GET

Get Metadata

This operation retrieves table metadata that can be used for viewing 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.

Resource path

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

HTTP method

GET

Get Query

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!

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

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.

Resource path

/rowset/<rowset number>?sessionid=<session id>

HTTP method

GET

Get Status

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.

Resource path

/status?sessionid=<session id>

HTTP method

GET

Abort Process

This operation request the active process to abort.

Note!

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. 

Resource path

/status/abort?sessionid=<session id>

HTTP method

GET

Table Export

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

Resource path

/refdatas/<Reference Data profile>/table/<table name>/download?sessionid=<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!

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

Table Import

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

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.

Save Changes

This operation saves data modification(insert/update/delete). Changes are saved within client session. Input parameters are passed in a JSON format as part of the HTTP message body. 

Note!

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

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. 

Resource path

/save?sessionid=<session id> 

HTTP method

PUT

Body

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

  1. refProfile - Reference Data Management Profile

  2. tableName - Database table name

  3. updates - modification parameters

    1. action - to specify the type of modification

      1. insert - insert a new row to the table

      2. update - edit an existing row in the table

      3. delete - delete an existing row in the table

    2. ids - to specify column value pairs of primary key(s)

      1. column - private key column name

      2. value - private key value for the respective column

    3. values - to specify column value pairs to be inserted/updated

      1. column - column name to be inserted/updated

      2. value - insert/update value for the respective column

Note!

When insert row, specifying a pseudo ids column value pair allows Cancel Changes to be applied on that specific insert row modification.

Commit Changes

This operation applies saved edits in the database and commits the work in case of success. You can use force commit in case of errors. 

Resource path

/save/commit?force=<true|false>&sessionid=<session id> 

HTTP method

GET

List Changes

This operation returns a list of the modifications saved.

Resource path

/save/list?sessionid=<session id>

HTTP method

GET

Cancel Changes

This operation cancels the changes made from being saved. Input parameters are passed in a JSON format as part of the HTTP message body.

Note!

Pseudo Primary Keys for inserted rows can be included in the Save Changes operation to allow cancel function on a specific insert row modification. 

Note!

SaveSize in the Cancel Changes response indicates the number of changes remaining. 

Resource path

/save/cancel?sessionid=<session id>

HTTP method

PUT

Body

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

  1. scope - specify the scope of changes to be canceled

    1. single - allow only specific modifications identified by ids to be cancelled

    2. all - allow all the modifications to be canceled

  2. ids - to specify column value pairs of primary key(s). This is only required when the scope is single.

    1. column - private key column name

    2. value - private key value for the respective column

Show Demo Query

This operation shows an example json payload format that applies for a Get Query operation. 

Resource path

/demo/queryRequestParameters

HTTP method

GET

Show Demo Changes

This operation shows and example json payload format that applies for a Save Changes operation. 

Resource path

/demo/dataEditRequestParameters

HTTP method

GET

  • No labels