Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Panel
Table of Contents
maxlevel1

Anchor
Overview
Overview
Overview

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

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

Anchor
Create a Script
Create a Script
Create a Script


Description

URI

http://host_name/uc/resources/script

HTTP Method

POST

Description

Creates a Script.

Example URI

http://localhost:8080/uc/resources/script

Consumes Content-Type

application/xml, application/json

Produces Content-Type

n/a

Example Request

See Create a Script: Example Request, below.

Example Response

  • Status 200 /OK
    Successfully created the Script with sysId {sysId}.
  • Status 400 /Bad Request
    Create Script failed. A duplicate value has been detected. Name must be unique.

Script Properties

See Create a Script: Script Properties, below.

Notes Properties

See Create a Script: Notes Properties, below.

Anchor
Create a Script Example Request
Create a Script Example Request
Create a Script: Example Request

Anchor
Create a Script Script Properties
Create a Script Script Properties
Create a Script: Script Properties

Property

UI Field Name

Description

Specifications

Required

Anchor
content - SCR
content - SCR
content

Content

Content of the script or SAP definition file.


Y

Anchor
description - SCR
description - SCR
description

Description

User-defined; description of this record.


N

Anchor
excludeRelated - SCR
excludeRelated - SCR
excludeRelated

n/a

Specification for whether or not to exclude related records (Notes) from an update, even if they are provided in the request.

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

N

Anchor
opswiseGroups - SCR
opswiseGroups - SCR
opswisewGroups

Member of Business Services

Business Services that this record belongs to.
 
XML

Panel

 
JSON

Panel


N

Anchor
resolveVariables - SCR
resolveVariables - SCR
resolveVariables

Resolve UAC Variables

Controls whether or not the Script will be parsed in pursuit of Universal Controller variables. It allows the Controller to avoid the overhead of parsing a Script that does not contain variables.


N

Anchor
retainSysIds - SCR
retainSysIds - SCR
retainSysIds

n/a

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

Note
titleNote

In XML web services, retainSysIds is specified as an attribute in the <script> element.

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

N

Anchor
scriptName - SCR
scriptName - SCR
scriptName

Script Name

Name of the script.

This name can be the same as the name of the script file.
 
You also can specify a file extension; the default file extension for Windows is .bat.
 
If the name has the extension .ps1, Windows will run the script as a powershell script.
 
You may have to create the appropriate file association and security for this to work.

Y

Anchor
scriptType - SCR
scriptType - SCR
scriptType

Script Type

Type of Script

Valid Values:

Default is Script (1).

N

Anchor
sysId - SCR
sysId - SCR
sysId

n/a

System ID field in the database for this Script record.

Persisted only if retainSysIds is set to true.

N

Anchor
Create a Script Notes Properties
Create a Script Notes Properties
Create a Script: Notes Properties

Property

UI Field Name

Description

Specifications

Required

Anchor
sysId - Notes
sysId - Notes
sysId

n/a

sys_id used within the Controller to identify this Note.


N

Anchor
text - Notes
text - Notes
text

Text

Text of this note.


N

Anchor
title - Notes
title - Notes
title

Title

Title of this note.


N

Anchor
Delete a Script
Delete a Script
Delete a Script


Description

URI

http://host_name/uc/resources/script

HTTP Method

DELETE

Description

Deletes a Script.

URI Parameters

See Delete a Script: URI Parameters, below.

Example URI

http://localhost:8080/uc/resources/script?scriptname=test

Example Response

  • Status 200 /OK
    Script deleted successfully.
  • Status 400 /Bad Request
    Mutual exclusion violation. Cannot specify scriptname and scriptid at the same time.
  • Status 404 /Not Found
    A Script with {name/id} "test" does not exist.

Anchor
Delete a Script URI Parameters
Delete a Script URI Parameters
Delete a Script: URI Parameters

Parameter

Description

Specifications

Required

Mutually Exclusive With

scriptid

ID used within the Controller to identify this Script.

String; URI parameter.

Y
(unless scriptname
is specified)

scriptname

scriptname

Name used within the Controller to identify this Script.

String; URI parameter.

Y
(unless scriptid
is specified)

scriptid

Anchor
List Scripts
List Scripts
List Scripts


Description

URI

http://host_name/uc/resources/script/list

HTTP Method

GET

Description

Retrieves information on all Scripts.

Example URI

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

Authentication

HTTP Basic

Consumes Content-Type

n/a

Produces Content-Type

application/xml, application/json

Example Response

See List Scripts: Example Response, below.

Script Properties

See Create a Script: Script Properties.

Notes Properties

See Create a Script: Notes Properties.

List Scripts: Example Response

Expand
titleXML Response


<scripts>
    <script exportReleaseLevel="7.2.0.0" exportTable="ops_script" version="2">
	<content>echo %*</content>
	<description>description</description>
        <notes>
              <note>
                    <sysId>a8756a120a00010357097d05fa5c558e</sysId>
                    <text>test</text>
                    <title>note 1</title>
              </note>
        </notes>
	<opswiseGroups>
              <opswiseGroup>group1</opswiseGroup>
              <opswiseGroup>group2</opswiseGroup>
	</opswiseGroups>
	<resolveVariables>false</resolveVariables>
	<scriptName>test.bat</scriptName>
	<scriptType>Script</scriptType>
	<sysId>f8756a120a00010357097d05fa5c558e</sysId>
    </script>
    <script exportReleaseLevel="7.2.0.0" exportTable="ops_script" version="3">
	<content>echo ?*</content>
	<description>description</description>
        <notes>
              <note>
                    <sysId>a8756a120a00010357097d05fa5c558f</sysId>
                    <text>test</text>
                    <title>note 1</title>
              </note>
        </notes>
	<opswiseGroups>
              <opswiseGroup>group1</opswiseGroup>
              <opswiseGroup>group2</opswiseGroup>
	</opswiseGroups>
	<resolveVariables>false</resolveVariables>
	<scriptName>test2.bat</scriptName>
	<scriptType>Script</scriptType>
	<sysId>f8756a120a00010357097d05fa5c558f</sysId>
    </script>
</scripts>


Expand
titleJSON Response


[
  {
  "content": "echo", 
  "description": "description",
  "notes": [ {
    "sysId": "a8756a120a00010357097d05fa5c558e",
    "text": "test",
    "title": "note"
  } ],
  "opswiseGroups": ["group1","group2"],
  "resolveVariables": false,
  "scriptName": "test.bat",
  "scriptType": "Script",
  "sysId": "f8756a120a00010357097d05fa5c558e",
  "version": 2
  },
  {
  "content": "echo", 
  "description": "description",
  "notes": [ {
    "sysId": "a8756a120a00010357097d05fa5c558f",
    "text": "test",
    "title": "note"
  } ],
  "opswiseGroups": ["group1","group2"],
  "resolveVariables": false,
  "scriptName": "test2.bat",
  "scriptType": "Script",
  "sysId": "f8756a120a00010357097d05fa5c558f",
  "version": 3
  }
]


Anchor
Modify a Script
Modify a Script
Modify a Script


Description

URI

http://host_name/uc/resources/script

HTTP Method

PUT

Description

Modifies the Script specified by the sysId.

Example URI

http://localhost:8080/uc/resources/script

Consumes Content-Type

application/xml, application/json

Produces Content-Type

n/a

Example Request

See Modify a Script: Example Request, below.

Script Properties

See Create a Script: Script Properties.

Notes Properties

See Create a Script: Notes Properties.

Example Response

  • Status 200 /OK
    Successfully updated the Script with sysId <sysId> to version <version>.

Anchor
Modify a Script Example Request
Modify a Script Example Request
Modify a Script: Example Request

Anchor
Read a Script
Read a Script
Read a Script

Anchor
Read a Script URI Parameters
Read a Script URI Parameters
Read a Script: URI Parameters

Parameter

Description

Specifications

Required

Mutually Exclusive With

scriptid

ID used within the Controller to identify this Script.

String; URI parameter.

Y
(unless scriptname
is specified)

scriptname

scriptname

Name used within the Controller to identify this Script.

String; URI parameter.

Y
(unless scriptid
is specified)

scriptid

Read a Script: Example Response

Expand
titleXML Response
<script exportReleaseLevel="7.2.0.0" exportTable="ops_script" retainSysIds="true" version="1">
	<content>echo %*</content>
	<description>description</description>
        <notes>
              <note>
                    <sysId>a8756a120a00010357097d05fa5c558e</sysId>
                    <text>test</text>
                    <title>note 1</title>
              </note>
        </notes>
	<opswiseGroups>
              <opswiseGroup>group1</opswiseGroup>
              <opswiseGroup>group2</opswiseGroup>
	</opswiseGroups>
	<resolveVariables>false</resolveVariables>
	<scriptName>test.bat</scriptName>
	<scriptType>Script</scriptType>
	<sysId>f8756a120a00010357097d05fa5c558e</sysId>
</script>


Expand
titleJSON Response
{
  "content": "echo", 
  "description": "description",
  "notes": [ {
    "sysId": "a8756a120a00010357097d05fa5c558e",
    "text": "test",
    "title": "note"
  } ],
  "opswiseGroups": ["group1","group2"],
  "resolvableVariables": false,
  "retainSysIds": true,
  "scriptName": "test.bat",
  "scriptType": "Script",
  "sysId": "f8756a120a00010357097d05fa5c558e",
  "version": 2
}