The REST API provides the following methods to manage templates configurations specifically in automated deployment scenarios:

GET /admin/templates/status/<id>

URI

GET /admin/templates/status/<id>

Description

Returns the status of the current templates configuration load.

Request Header

Content-Type: application/json

Content-Type: application/vnd.orchestral.rhapsody.6_4+json

Request Body

Empty.

Response Status

204 No Content - operation successful.

Response Body

Status of the current load in JSON format. The response body has the following structure:

  • state - the current state of the load: RUNNING, COMPLETED, FAILED.
  • result - the result, if the state is COMPLETED.
    • resultType - the actual result: FAIL_WITH_ERRORS, SUCCESS, SUCCESS_NO_CHANGES, SUCCESS_WITH_WARNING.
    • configErrors - [list] all configuration errors and/or warnings.
      • errorCode - [string] the error code.
      • severity - error severity: FATAL, ERROR, WARNING.
      • errorMessage - [string] the error message.

For example:

COMPLETED Response
{"data":{"state":"COMPLETED","result":{"resultType":"SUCCESS","configErrors":null}},"error":null}
RUNNING Response
{"data":{"state":"RUNNING","result":null},"error":null}

Access Rights

'Log in to Rhapsody IDE.
'Load configurations'.
'Clear configurations'.
'Load templates REST API'.

GET /admin/templates

URI

GET /admin/templates

Description

Returns the templates configuration in the datastore in a ZIP format (the templates configuration in this format can only be loaded onto the engine through the POST /admin/templates method).

Request Header

Accept: application/zip

Accept: application/vnd.orchestral.rhapsody.6_4+zip

Request Body

Empty.

Response Status

200 OK - returns the templates configuration in ZIP format.

Response Body

The response body has the following structure:

  • auxiliary - [folder] stores auxiliary files. The sub-folders are named after the UUID of the component that owns them.

The configuration XML file has the following structure:

  • configuration - the root configuration element.
    • templates - contains all template configurations.
      • routescontains all route template configurations.
      • communicationPointscontains all communication point template configurations.
      • filterscontains all filter template configurations.

Access Rights

'Log in to Rhapsody IDE'.
'Save configurations'.
'Save templates REST API'.

POST /admin/templates

URI

POST /admin/templates

Description

Clears the existing templates configuration and loads the one provided in ZIP format (as created by calling the GET /admin/templates method).

The configuration will fail to load if you do not have the 'Clear configurations' access right.

Request Header

Content-Type: application/zip
CSRF Protection Enabled

Content-Type: application/vnd.orchestral.rhapsody.6_4+zip
CSRF Protection Enabled

Request Parameter

commitComment - a string containing the comment to use for the commit. This parameter is mandatory.

Request Body

The content of the templates configuration in the data store in ZIP format.

Response Status

204 No Content - operation successful.
202 Accepted - the request is being processed. The URI provided in the Response Header can be used to check the status of the operation. Refer to GET /admin/templates/status/<id> for details on fetching the load state. 

Response Header

The load status URI:

Location: https://localhost:8444/admin/templates/status/1

Response Body

Empty when the operation is successful.

Access Rights

'Log in to Rhapsody IDE'.
'Make changes with Rhapsody IDE'.
'Clear configurations'.
'Load configurations'.
'Load templates REST API'.