The REST API provides the following methods for managing lookup tables:

PUT /admin/lookuptables

URI

PUT /admin/lookuptables

Description

Clears the existing lookup tables and loads the provided ones.

This method only accepts table values in a compressed GZIP format (to upload uncompressed values, refer to PUT /admin/lookuptables/<guid>/values). However, Rhapsody cannot compress table values into GZIP format. Therefore, when calling this method from within Rhapsody, they must be compressed externally to Rhapsody. As this method only accepts compressed values, the attribute compressed in the values element must always be present and set to true .

Pre-compression, the content of the values element must be enclosed within double-quotes, with column values comma-separated from each other, for example:

 

"a","b","c"
"1","2","3"

The PUT /admin/lookuptables method is designed to initialize a lookup table once. It is recommended you use:

Request Header

Content-Type: application/xml CSRF Protection Enabled

Content-Type: application/vnd.orchestral.rhapsody.6_1+xml
CSRF Protection Enabled

Request Parameter

commitComment - a string containing the comment to use for the commit.

Request Body

Example...
<lookupTables>
  <lookupTable version="5" guid="7386f2cb-f832-4a60-82fa-f9027cfeb3cf">
    <name>tableB</name>
    <description>This is table B</description>
    <isRecordingFailures>true</isRecordingFailures>
    <autoKeyDefinition>true</autoKeyDefinition>
    <column>
      <name>columnA</name>
      <isKeyColumn>false</isKeyColumn>
      <defaultValue></defaultValue>
    </column>
    <column>
      <name>columnB</name>
      <isKeyColumn>true</isKeyColumn>
      <defaultValue></defaultValue>
    </column>
    <column>
      <name>columnC</name>
      <isKeyColumn>false</isKeyColumn>
      <defaultValue>gnfgn</defaultValue>
    </column>
    <values compressed="true">H4sIAAAAAAAAAFNKVNJRSgLiZCUuJUMgbQTExkoAr9sDYBcAAAA=</values>
  </lookupTable>
  <lookupTable version="5" guid="9ff5fe32-149f-409f-b6cc-1a12a0a2f83c">
    <name>tableA</name>
    <description>This is table A</description>
    <isRecordingFailures>true</isRecordingFailures>
    <autoKeyDefinition>true</autoKeyDefinition>
    <column>
      <name>columnA</name>
      <isKeyColumn>false</isKeyColumn>
      <defaultValue></defaultValue>
    </column>
    <column>
      <name>columnB</name>
      <isKeyColumn>true</isKeyColumn>
      <defaultValue></defaultValue>
    </column>
    <column>
      <name>columnC</name>
      <isKeyColumn>false</isKeyColumn>
      <defaultValue>dg</defaultValue>
    </column>
    <column>
      <name>columnD</name>
      <isKeyColumn>false</isKeyColumn>
      <defaultValue></defaultValue>
    </column>
    <values compressed="true">H4sIAAAAAAAAAAMAAAAAAAAAAAA=</values>
  </lookupTable>
</lookupTables>

Response Status

204 No Content - the lookup tables were loaded successfully.

Response Body

Empty.

Access Rights

'Load/edit lookup tables REST API'.

GET /admin/lookuptables

URI

GET /admin/lookuptables

Description

Returns the lookup tables.

Request Header

Accept: application/xml

Accept: application/vnd.orchestral.rhapsody.6_1+xml

Request Parameter

includeValuestrue or false. Whether the configuration includes the lookup table values. This parameter is optional. The values are saved if this parameter is not set.

Request Body

Empty.

Response Status

200 OK - returns the lookup tables information in XML format.

Response Body
Example...
<lookupTables>
  <lookupTable version="5" guid="7386f2cb-f832-4a60-82fa-f9027cfeb3cf">
    <name>tableB</name>
    <description>This is table B</description>
    <isRecordingFailures>true</isRecordingFailures>
    <autoKeyDefinition>true</autoKeyDefinition>
    <column>
      <name>columnA</name>
      <isKeyColumn>false</isKeyColumn>
      <defaultValue></defaultValue>
    </column>
    <column>
      <name>columnB</name>
      <isKeyColumn>true</isKeyColumn>
      <defaultValue></defaultValue>
    </column>
    <column>
      <name>columnC</name>
      <isKeyColumn>false</isKeyColumn>
      <defaultValue>gnfgn</defaultValue>
    </column>
    <values compressed="true">H4sIAAAAAAAAAFNKVNJRSgLiZCUuJUMgbQTExkoAr9sDYBcAAAA=</values>
  </lookupTable>
  <lookupTable version="5" guid="9ff5fe32-149f-409f-b6cc-1a12a0a2f83c">
    <name>tableA</name>
    <description>This is table A</description>
    <isRecordingFailures>true</isRecordingFailures>
    <autoKeyDefinition>true</autoKeyDefinition>
    <column>
      <name>columnA</name>
      <isKeyColumn>false</isKeyColumn>
      <defaultValue></defaultValue>
    </column>
    <column>
      <name>columnB</name>
      <isKeyColumn>true</isKeyColumn>
      <defaultValue></defaultValue>
    </column>
    <column>
      <name>columnC</name>
      <isKeyColumn>false</isKeyColumn>
      <defaultValue>dg</defaultValue>
    </column>
    <column>
      <name>columnD</name>
      <isKeyColumn>false</isKeyColumn>
      <defaultValue></defaultValue>
    </column>
    <values compressed="true">H4sIAAAAAAAAAAMAAAAAAAAAAAA=</values>
  </lookupTable>
</lookupTables>

Access Rights

'Save/view lookup tables REST API'.

GET /admin/lookuptables/info

URI

GET /admin/lookuptables/info

Description

Returns a list of the lookup tables.

Request Header

Accept: application/json

Accept: application/vnd.orchestral.rhapsody.6_2+json

Accept: application/vnd.orchestral.rhapsody.6_3+json

Request Body

Empty.

Response Status

200 OK - returns the lookup tables information in JSON format.

Response Body
Example...
{
    "data": {
        "lookupTableList": [
            {
                "uuid": "4b8bb7e2-75a8-4f89-b345-1b84933bac2b",
                "name": "tableA",
                "description": "This is table A",
                "rowCount": 0,
                "recordingFailures": true,
                "columnNames": [
                    "columnA",
                    "columnB",
                    "columnC",
                    "columnD"
                ]
            },
            {
                "uuid": "b790fe30-72b6-420d-baa0-a25cff69d40c",
                "name": "tableB",
                "description": "This is table B",
                "rowCount": 2,
                "recordingFailures": true,
                "columnNames": [
                    "columnA",
                    "columnB",
                    "columnC"
                ]
            }
        ]
    },
    "error": null
}

Access Rights

'Save/view lookup tables REST API'.

PUT /admin/lookuptables/<guid>

URI

PUT /admin/lookuptables/<guid>

Description

Overwrites the lookup table with the given GUID with the one provided.

This method only accepts table values in a compressed GZIP format (to upload uncompressed values, refer to PUT /admin/lookuptables/<guid>/values). However, Rhapsody cannot compress table values into GZIP format. Therefore when calling this method from within Rhapsody, they must be compressed externally to Rhapsody. As this method only accepts compressed values, the attribute compressed in the values element must always be present and set to true.

Pre-compression, the content of the values element must be enclosed within double-quotes, with column values comma-separated from each other, for example:

 

"a","b","c"
"1","2","3"

Request Header

Content-Type: application/xml
CSRF Protection Enabled

Content-Type: application/vnd.orchestral.rhapsody.6_2+xml
CSRF Protection Enabled

Request Parameter

commitComment - a string containing the comment to use for the commit.

Request Body

Example...
<lookupTable version="5" guid="9ff5fe32-149f-409f-b6cc-1a12a0a2f83c">
    <name>tableA</name>
    <description>This is table A</description>
    <isRecordingFailures>true</isRecordingFailures>
    <autoKeyDefinition>true</autoKeyDefinition>
    <column>
      <name>columnA</name>
      <isKeyColumn>false</isKeyColumn>
      <defaultValue></defaultValue>
    </column>
    <column>
      <name>columnB</name>
      <isKeyColumn>true</isKeyColumn>
      <defaultValue></defaultValue>
    </column>
    <column>
      <name>columnC</name>
      <isKeyColumn>false</isKeyColumn>
      <defaultValue>dg</defaultValue>
    </column>
    <column>
      <name>columnD</name>
      <isKeyColumn>false</isKeyColumn>
      <defaultValue></defaultValue>
    </column>
    <values compressed="true">H4sIAAAAAAAAAAMAAAAAAAAAAAA=</values>
  </lookupTable>
  • The values are optional. If they are not provided, then any existing values in the lookup table are used.
  • Each record (row) must contain a value for every column.

Response Status

204 No Content - the lookup table was loaded successfully.

Response Body

Empty.

Access Rights

'Load/edit lookup tables REST API'.

GET /admin/lookuptables/<guid>

URI

GET /admin/lookuptables/<guid>

Description

Returns the lookup table with the given GUID.

Request Header

Accept: application/xml

Accept: application/vnd.orchestral.rhapsody.6_2+xml

Request Parameter

includeValuestrue or false. Whether the configuration includes the lookup table values. This parameter is optional. The values are saved if this parameter is not set.

Request Body

Empty.

Response Status

200 OK - returns the lookup table information in XML format.

Response Body
Example...
<lookupTable version="5" guid="9ff5fe32-149f-409f-b6cc-1a12a0a2f83c">
    <name>tableA</name>
    <description>This is table A</description>
    <isRecordingFailures>true</isRecordingFailures>
    <autoKeyDefinition>true</autoKeyDefinition>
    <column>
      <name>columnA</name>
      <isKeyColumn>false</isKeyColumn>
      <defaultValue></defaultValue>
    </column>
    <column>
      <name>columnB</name>
      <isKeyColumn>true</isKeyColumn>
      <defaultValue></defaultValue>
    </column>
    <column>
      <name>columnC</name>
      <isKeyColumn>false</isKeyColumn>
      <defaultValue>dg</defaultValue>
    </column>
    <column>
      <name>columnD</name>
      <isKeyColumn>false</isKeyColumn>
      <defaultValue></defaultValue>
    </column>
    <values compressed="true">H4sIAAAAAAAAAAMAAAAAAAAAAAA=</values>
  </lookupTable>

Access Rights

'Save/view lookup tables REST API'.

PUT /admin/lookuptables/<guid>/values

URI

PUT /admin/lookuptables/<guid>/values

Description

Overwrites the values of the lookup table with the given GUID with the table values provided. This method only accepts table values in an uncompressed CSV format.

Request Header

Content-Type: text/csv
CSRF Protection Enabled

Content-Type: text/vnd.orchestral.rhapsody.6_2+csv
CSRF Protection Enabled

Request Parameter

commitComment - a string containing the comment to use for the commit.

Request Body

columnA,columnB,columnC
"1","2","3"
"A","B","C"
"/", """""",""

The request body is in CSV format where the first row contains the column names which must match the column names and must be in the same order as configured for the lookup table.

Response Status

204 No Content - the lookup table values were loaded successfully.

Response Body

Empty.

Access Rights

'Load/edit lookup tables REST API'.

GET /admin/lookuptables/<guid>/values

URI

GET /admin/lookuptables/<guid>/values

Description

Returns the values of the lookup table with the given GUID.

Request Header

Accept: text /csv

Accept: text/vnd.orchestral.rhapsody.6_2+csv

Request Body

Empty.

Response Status

200 OK - returns the lookup table values in CSV format.

Response Body
columnA,columnB,columnC
"1","2","3"
"A","B","C"
"/", """""",""

Access Rights

'Save/view lookup tables REST API'.

DELETE /admin/lookuptables/<guid>

URI DELETE /admin/lookuptables/<guid>
Description Deletes the lookup table with the given GUID.
Request Header CSRF Protection Enabled
Request Parameter commitComment - a string containing the comment to use for the commit.
Request Body Empty.
Response Status 204 No Content - the lookup table was deleted successfully.
Response Body Empty.
Access Rights 'Load/edit lookup tables REST API'.