The REST API provides the following methods for managing variables:
GET /admin/variables
URI |
|
---|---|
Description |
Returns a list of all variables and their values. All encrypted values are returned as "********". |
Request Header |
|
The parameters |
|
Accept: application/vnd.orchestral.rhapsody.6_2_3+json |
|
Request Body |
Empty. |
Response Status | 200 OK - operation successful. |
Response Body |
{ "data":{ "variables":[ { "value":"********", "encrypted":true, "name":"var10", "overrideValue": "********", "overridden": false }, { "value":"abcde", "encrypted":false, "name":"var11", "overrideValue": "defghi", "overridden": true }, { "value":"12345", "encrypted":false, "name":"var12", "overrideValue": "67890", "overridden": false } ] }, "error":null } |
Access Rights |
'Read variables REST API'. |
PUT /admin/variables
URI |
|
---|---|
Description |
Replaces all existing variables in the engine with the variables and their attributes (values and encryption status) you provide. An optional commit comment can be provided. This method should only be used to modify variables for set-up purposes only; it does not update any dependent components referencing those variables. We strongly recommend against modifying Rhapsody variables dynamically (at run-time) via the REST API. It is recommended you use HTTPS when sending the plain text values of variables that are to be encrypted. |
Request Header |
|
The parameters |
|
|
|
Request Parameter |
|
Request Body |
An array of variables, for example: { "variables":[ { "name":"database_password", "value": "pa55w0rd", "encrypted": true, "overrideValue": "alt_pa55w0rd", "overridden": true }, { "name":"_DbServ", "value": "devsql2005", "encrypted": false, "overrideValue": "prodsql2005", "overridden": true }, { "name":"_userpass", "value": "servicedelivery", "encrypted": false, "overrideValue": "", "overridden": false } ], "commitComment":"myComment" } |
Response Status |
|
Response Body | Empty. |
Access Rights |
'Write variables REST API'. |
GET /admin/variables/<name>
URI |
|
---|---|
Description |
Returns the value of the named variable. All encrypted values are returned as "********". |
Request Header |
|
The parameters |
|
Accept: application/vnd.orchestral.rhapsody.6_2_3+json |
|
Request Body |
Empty. |
Response Status |
|
Response Body |
{ "data: { "name":"database_password", "value": "********", "encrypted": true, "overrideValue": "********", "overridden": false }, "error":null } |
Access Rights |
'Read variables REST API'. |
PUT /admin/variables/<name>
URI |
|
---|---|
Description |
Updates the parameters (the value and encryption status) of the named variable as specified. If the variable does not exist, a new variable is created with the data provided. An optional commit comment can be provided. This method should only be used to modify variables for set-up purposes only; it does not update any dependent components referencing those variables. We strongly recommend against modifying Rhapsody variables dynamically (at run-time) via the REST API. It is recommended you use HTTPS when sending the plain text values of variables that are to be encrypted. |
Request Header |
|
The parameters |
|
Accept: application/vnd.orchestral.rhapsody.6_2_3+json CSRF Protection Enabled |
|
Request Body |
A variable object, for example: { "value": "pa55w000rd", "encrypted": true, "commitComment":"myComment", "overrideValue": "alt_pa55w000rd", "overridden": true } |
Response Status |
|
Response Body | Empty. |
Access Rights |
'Write variables REST API'. |