Variable Web Services

Variable Web Services

Overview

Universal Controller supports the following RESTful-based web services for Variable operations, which are listed alphabetically on this page.

Formatting specifications for each web service, including details about parameter requirements, are provided.

Create a Global Variable



Description



Description

URI

http://host_name/uc/resources/variable

HTTP Method

POST

Description

Creates a Global Variable.

Example URI

http://localhost:8080/uc/resources/variable

Consumes Content-Type

application/xml, application/json

Produces Content-Type

n/a

Example Request

See Create a Global Variable: Example Request, below.

Request Properties

See Global Variable Properties, below.

Example Response

  • Status 200 /OK
    Successfully created the variable with sysId {sysId} to version {version}.

Create a Global Variable: Example Request

XML Request

JSON Request

XML Request

JSON Request

<variable retainSysIds="true"> <description>description</description> <name>demo_ops_global</name> <opswiseGroups> <opswiseGroup>group 1</opswiseGroup> <opswiseGroup>group 2</opswiseGroup> </opswiseGroups> <sysId>237f9f6c43d2617201b2bd04063f917a</sysId> <value>Global</value> </variable>

{ "description": "description", "name": "demo_ops_global", "opswiseGroups": ["group 1", "group 2"], "retainSysIds": true, "sysId": "237f9f6c43d2617201b2bd04063f917a", "value": "Global" }


Global Variable Properties

Property

UI Field Name

Description

Specifications

Required

Property

UI Field Name

Description

Specifications

Required

description

Description

User-defined; description of this record.



N

name

Name

Name used within the Controller to identify this Global Variable.

Contains a maximum of 40 alphanumerics.

Y

opswiseGroups

Member of Business Services

Business Services that this record belongs to.
 
XML



HTML



 
JSON



HTML



N

retainSysIds

n/a

Specification for whether or not the Create a Create a Global Variable web service will persist the sysId property.



HTML





Note

In XML, retainSysIds is specified as an attribute in the <variable> element.

Valid values: true/false (default is true).

N

sysId

n/a

System ID field in the database for a record.

Persisted only if retainSysIds is set to true.

N

value

Value

Value of this variable.

Maximum = 25000 characters.

N

Delete a Global Variable



Description



Description

URI

http://host_name/uc/resources/variable

HTTP Method

DELETE

Description

Deletes a Global Variable.

URI Parameters

See Delete a Global Variable: URI Parameters, below.

Example URI

http://localhost:8080/uc/resources/variable?variableid=dadf6b84c0a8016500a01a10da5e2c15

Example Response

  • Status 200 /OK
    Variable deleted successfully.

  • Status 400 /Bad Request
    Mutual exclusion violation. Cannot specify variablename and variableid at the same time.

  • Status 404 /Not Found
    A variable with {name/id} "test" does not exist.

Delete a Global Variable: URI Parameters

Parameter

Description

Specifications

Required

Mutually Exclusive With

Parameter

Description

Specifications

Required

Mutually Exclusive With

variableid

ID used within the Controller to identify this Global Variable.

String; URI parameter.

Y (unless variablename is specified)

variablename

variablename

Name used within the Controller to identify this Global Variable.

String; URI parameter.

Y (unless variableid is specified)

variableid

List Variables



Description



Description

URI

http://host_name/uc/resources/variable/list

HTTP Method

POST

Description

Retrieves information on variables matching specific search criteria.

Example URI

http://localhost:8080/uc/resources/variable/list

Authentication

HTTP Basic

Consumes Content-Type

application/xml, application/json

Produces Content-Type

application/xml, application/json

Example Request

See List Global Variables: XML and JSON Examples.

Request Properties

See List Variables: Request Properties.

Example Response

See List Global Variables: XML and JSON Examples.

Response Properties

See List Variables: Response Properties.

List Variables: XML and JSON Examples

Examples

XML

JSON

Examples

XML

JSON

Example Request

Global Variable <variable-query-filter> <scope>global</scope> </variable-query-filter> <variable-query-filter> <scope>global</scope> <variableName>demo*</variableName> </variable-query-filter> Local Variable <variable-query-filter> <scope>local</scope> </variable-query-filter> <variable-query-filter> <scope>local</scope> <variableName>*2</variableName> </variable-query-filter> Task Variable <variable-query-filter> <scope>task</scope> <taskName>UT-WS-Task</taskName> </variable-query-filter> <variable-query-filter> <scope>task</scope> <taskName>UT-WS-Task</taskName> <variableName>UT*2</variableName> </variable-query-filter> Trigger Variable <variable-query-filter> <scope>trigger</scope> <triggerName>UT-WS-Trigger</triggerName> </variable-query-filter> <variable-query-filter> <scope>trigger</scope> <triggerName>UT-WS-Trigger</triggerName> <variableName>*2</variableName> </variable-query-filter>

Global Variable { "scope": "global" } { "scope": "global", "variableName": "demo*" } Local Variable { "scope": "local" } { "scope": "local", "variableName": "*2" } Task Variable { "scope": "task", "taskName": "UT-WS-Task" } { "scope": "task", "taskName": "UT-WS-Task", "variableName": "UT*2" } Trigger Variable { "scope": "trigger", "triggerName": "UT-WS-Trigger" } { "scope": "trigger", "triggerName": "UT-WS-Trigger", "variableName": "*2" }

Example Response

Example 1 <variables> <variable> <description /> <name>demo_ops_download_dir</name> <sysId>db5c436ac0a8016501f1ab660b585961</sysId> <type>Global</type> <version>1</version> <value>/home/uc/download</value> </variable> <variable> <description /> <name>demo_ops_linux_rc</name> <sysId>db5c7b72c0a80165004cda781dbf3115</sysId> <type>Global</type> <version>1</version> <value>0</value> </variable> </variables>   Example 2 <variables> <variable>
<allowEmptyOption>false</allowEmptyOption>
<allowUnlistedOption>false</allowEmptyOption> <description>varDescription2</description> <name>UT_WS_var_2</name>
<options>
<option>option1</option>
<option>option2</option>
</options> <sysId>164a03300a0a0a6475b497e5d985c1aa</sysId> <taskId>164a02a80a0a0a644fc9a3d6dd33f72b</taskId> <taskName>UT-WS-Task</taskName> <type>Task</type> <value>varVal2</value>
</variable> <variable>
<allowEmptyOption>true</allowEmptyOption>
<allowUnlistedOption>true</allowEmptyOption> <description /> <name>UT_WS_var_2</name>
<options>
<option>111</option>
<option>222</option>
</options> <sysId>164ea9ff0a0a0a6449f209da49f594c0</sysId> <triggerId>164ea9a40a0a0a647df8372b88eb2394</triggerId> <triggerName>UT-WS-Trigger</triggerName> <type>Trigger</type> <value>val</value> </variable> </variables>

Example 1 [ { "description": null, "name": "demo_ops_download_dir", "sysId": "db5c436ac0a8016501f1ab660b585961", "type": "Global", "version": 1, "value": "/home/uc/download" }, { "description": null, "name": "demo_ops_linux_rc", "sysId": "db5c7b72c0a80165004cda781dbf3115", "type": "Global", "version": 1, "value": 0 } ]   Example 2 [ { "allowEmptyOption": false,
"allowUnlistedOption": false,
"description": "varDescription2", "name": "UT_WS_var_2",
"options": [
"option1",
"option2"
]
"sysId": "164a03300a0a0a6475b497e5d985c1aa", "taskId": "164a02a80a0a0a644fc9a3d6dd33f72b", "taskName": "UT-WS-Task", "type": "Task", "value": "varVal2" }, {
"allowEmptyOption": true,
"allowUnlistedOption": true, "description" null, "name": "UT_WS_var_2",
"options": [
"111",
"222"
] "sysId": "164ea9ff0a0a0a6449f209da49f594c0", "triggerId": "164ea9a40a0a0a647df8372b88eb2394", "triggerName": "UT-WS-Trigger", "type": "Trigger", "value": "val" } ]

List Variables: Request Properties

Property

UI Field Name

Description

Specifications

Required

Property

UI Field Name

Description

Specifications

Required

scope

n/a

Type of variable to be returned in the Response.

Valid values (case insensitive):

  • global

  • local

  • task

  • trigger

Default is global.

N