Saving an Execution Plan -- API

Synthetic Blackouts in versions 11.3.02 and later

  • Starting from version 11.3.02, the Blackout configuration is no longer part of the Execution Plan APIs. You can use the dedicated Synthetic Blackout and Synthetic Time Frames APIs for that purpose.
  • If you are using version 11.3.01 or earlier, you can continue to use the Execution Plan APIs to access the Blackouts.

The PUT method of the executionplans API saves an Execution Plan.

Before you begin

You must obtain an authToken by using the login API. The token authenticates the user performing the operation. For details, see TSWS authentication .

Synthetic configuration APIs

Notes:

  • If you have upgraded to version 11.3.02, you can access the Synthetic Blackout and Synthetic Time Frames APIs listed in this table.
  • If you are using version 11.3.01 or earlier, you can continue to use the Execution Plan APIs to access the Blackouts.
APIMethodDescription
Applications

GETRetrieve the details of applications
PUT

Update an existing application

POSTCreate a new application
DELETEDelete an application

Execution Plans



GETRetrieve the details of Execution Plans
PUT
DELETEDelete an Execution Plan
ScriptsGETRetrieve the details of scripts
LocationsGETRetrieve the details of all locations

Blackouts

POSTRetrieve the details of Blackouts
PUT
POSTActivate the Blackout
POSTDeactivate the Blackout
POSTDelete a Blackout

Time Frames

POSTRetrieve the details of Time Frames
PUT
POSTDelete Time Frames

To save an Execution Plan

The executionplan API uses the PUT method to save an Execution Plan.

Request syntax

https://<PresentationServerHostName>/tsws/10.0/api/appvis/synthetic/api/executionplans/save

In the above example, <PresentationServerHostName> indicates the host name of the TrueSight Presentation Server.

Request with REST client

After accessing the REST client, perform the following steps:

  1. Enter the URL for API.
    An example of a request for a single Execution Plan is:
    https://localhost/tsws/10.0/api/appvis/synthetic/api/executionplans/save
  2. Add a new header row and select Authorization as the header type.

  3. Enter the text authToken followed by the authToken generated through the login API.
  4. Make sure you have a Content-Type header row with the value application/json.
  5. Insert the JSON code in the request body.
  6. Click Send.

Request parameters

ElementDescription
authToken

Value of authToken

Request body (applicable to versions 11.3.02 and later)

 For versions 11.3.02 and later

The following code is an example of the JSON code to send with the request.

Note

This functionality requires that you send the entire JSON for the Execution Plan you want to save. Sending only the fields you want to update is not sufficient.


Request body parameters (applicable to versions 11.3.02 and later)

ParameterDescriptionValue
executionPlanId

ID of the Execution Plan

  • To create a new Execution Plan use 0.
  • To update a specific Execution Plan use the execution plan ID.
String representing a numeric value
projectType
Type of Silk Performer projectString representing a numeric value
scriptFileName

Name of the script run by the Execution Plan

Content of this parameter is ignored.

String
description
Description of the Execution PlanString
executionPlanName
Name of the Execution PlanString
version

Execution Plan version

This number is updated every time the Execution Plan is updated.

Number
scriptFileCRC

Cyclic Redundancy Check of the script file

Content of this parameter is ignored.

String representing a numeric value
scheduler
Schedule defined for the Execution Plan
    typeOfStart
Start executing the Execution Plan

One of the following:

MULTIPLE_OF_MINUTES and SPECIFIC_TIME
Default value is - MULTIPLE_OF_MINUTES

    specificTime
Set the Execution to start at the exact specified time.When SPECIFIC_TIME is selected as typeOfStart.
The value must be String and the format is mm:ss (minutes:seconds). The range is between 00:00 and 59:59. The default value is 30:00
    mulipleOfMinutesInHour
Set the start time in multiples of specified minutes within the hour. The first run occurs in the next valid multiple of specified minute within the hour at the time Execution Plan is created, updated, or restarted.When MULTIPLE_OF_MINUTES is selected as typeOfStart.
The value is an integer (int) whole number. The range is between 1 and 30 minutes. The default value is 1
    randomDelayEnabled
(Optional) Set this to the maximum range of delay before the Execution Plan starts. A different delay value is randomly set for each location where the Execution Plan runs. In each location, the Execution Plan runs at start time as configured in Initial Execution Schedule + the random delay set for the Execution Plan in that location. You can skip this option if you do not want a random delay.It is optional. The value is boolean (true or false). The default value is true.
    startAtWithRandomDelay
Range, in minutes, within which the Execution Plan starts

This is optional and based on whether the randomDelayEnabled field is set to true or false. String representing a numeric value as follows:

  • Minimum is 1 minute.
  • Maximum is 60 minutes.
  • Default is 5 minutes.
    startAtTimeOffset
Clock used for calculating the schedule
  • UTC—Universal Coordinated Time
  • LOCAL—Local time on the computer where the TEA Agent is installed
    terminateAt
Date from when the schedule is no longer used

One of the following:

  • Date in format: YYYY-MM-DDThh:mm:ss
    Example: 2017-12-31T12:00:00
  • 0—Indicates that the schedule never expires
    daysOfRunTillHour
Not implemented

0:00

    daysOfRunFromHour
Not implemented

0:00

    daysOfMonth
Not implementednull
    transactionTimeout
Number of minutes a transaction is allowed to run before it is automatically timed outString representing a numeric value
    startAtWithRandomDelay
Range, in minutes, within which the Execution Plan starts


    triggerType
Not implementedCONTINUOUS
    daysOfWeek
Not implementednull
    startAt
Date from when the schedule is in use

One of the following:

  • Date in format: YYYY-MM-DDThh:mm:ss
    Example: 2016-01-05T12:00:00
  • 0—Indicates that the schedule period is effective immediately
    intervalInMinutes
Number of minutes between runs of the Execution PlanString representing a numeric value
scriptId

ID of the script used by the Execution Plan

  • When creating a new Execution Plan, you must enter a scriptId.
  • When updating an existing Execution Plan, this cannot be modified.
String representing a numeric value
agentGroups
Locations defined for the Execution Plan
    name
Name of the LocationString
    id
ID of the LocationNumber
scriptFileSize

Size of the script file used by the Execution Plan in bytes

Content of this parameter is ignored.

String representing a numeric value
activeStatus
Indication if the Execution Plan is active or not

String representing a numeric value

Valid values:

0—False

1—True

attributeChangedEnvelopVersion
Version number that is incremented each time there is a change in blackouts, schedule, or Execution Plan nameString representing a numeric value
activeBy
Array of two Boolean values indicating if the Execution Plan is active at the Execution Plan level, and at the Application levelArray
attributes

Attributes of the script run by the Execution Plan (can be multiple)

You can obtain a list of attributes in a script from the Retrieving script details -- API.


    encrypted
Indicates whether or not the attribute is encrypted

0—False

1—True; used for a password attribute

    length
Length of the attribute. The length is calculated by the Server

0—default length

You can type 0 (zero) as an input to the API.

    defaultValue
Default value of the attributeVaries, depending on the attribute
    name
Name of the attributeString
    encryptionType

Indicates whether the value parameter for the attribute is encoded

0value is not encoded

1value is encoded; used when you are setting a password attribute

    description
Description of the attributeString
    type
Data type of the attribute
  • boolean
  • float
  • number
  • string
    value

Value of the attribute

Varies, depending on the attribute

For a password enter the Base64 encoded value, and set encryptionType to 1.

    order
Serial number of the appearance of the attribute in the user interfaceNumber
applicationId(Mandatory) ID of the application on the Presentation ServerString representing a numeric value
syntheticApplicationId

Synthetic application ID

This parameter is not updated by this API request.

String representing a numeric value
syntheticApplicationName
Name of the applicationString
attributeChangedScriptVersion
Version number that is incremented each time there is a change in script attributesString representing a numeric value
executionLogSettingWhether the Execution Log is saved.
  • ALWAYS
  • ON_ERROR
  • NEVER

Request body (applicable to versions 11.3.01 and earlier)

 For versions 11.3.01 and earlier

The following code is an example of the JSON code to send with the request.

Note

This functionality requires that you send the entire JSON for the Execution Plan you want to save. Sending only the fields you want to update is not sufficient.


Request body parameters (applicable to versions 11.3.01 and earlier)

ParameterDescriptionValue
executionPlanId

ID of the Execution Plan

  • To create a new Execution Plan use 0.
  • To update a specific Execution Plan use the execution plan ID.
String representing a numeric value
blackOuts
Blackout periods defined for the Execution Plan (can be multiple)
     startAtTimeOffset
Clock used for calculating the blackout period
  • UTC—Universal Coordinated Time
  • LOCAL—Local time on the computer where the TEA Agent is installed
     terminateAt
Date from when the blackout period is no longer used

One of the following:

  • Date in format: YYYY-MM-DDThh:mm:ss
    Example: 2017-12-31T12:00:00
  • 0—Indicates that the blackout period never expires
     daysOfRunTillHour
End time for the blackout period

Format: hh:mm

Example: 21:00

     daysOfRunFromHour
Start time for the blackout period

Format: hh:mm

Example: 17:00

     daysOfMonth
Not implementednull
     triggerType
Trigger for the blackout periodDAYS_OF_WEEK_BLACKOUT
     daysOfWeek
Days of the week when the blackout period is in effect

Comma-separated numeric values (0-6).

Example: 0,2,5 indicates that the blackout is in effect on Sunday, Tuesday, and Friday.

     blackoutName
Name of the blackout period

String

Name given to the blackout period

     startAt
Date from when the blackout period is in use

One of the following:

  • Date in format: YYYY-MM-DDThh:mm:ss
    Example: 2016-01-05T12:00:00
  • 0—Indicates that the blackout period is effective immediately
projectType
Type of Silk Performer projectString representing a numeric value
scriptFileName

Name of the script run by the Execution Plan

Content of this parameter is ignored.

String
description
Description of the Execution PlanString
executionPlanName
Name of the Execution PlanString
version

Execution Plan version

This number is updated every time the Execution Plan is updated.

Number
scriptFileCRC

Cyclic Redundancy Check of the script file

Content of this parameter is ignored.

String representing a numeric value
scheduler
Schedule defined for the Execution Plan
    startAtTimeOffset
Clock used for calculating the schedule
  • UTC—Universal Coordinated Time
  • LOCAL—Local time on the computer where the TEA Agent is installed
    terminateAt
Date from when the schedule is no longer used

One of the following:

  • Date in format: YYYY-MM-DDThh:mm:ss
    Example: 2017-12-31T12:00:00
  • 0—Indicates that the schedule never expires
    daysOfRunTillHour
Not implemented

0:00

    daysOfRunFromHour
Not implemented

0:00

    daysOfMonth
Not implementednull
    transactionTimeout
Number of minutes a transaction is allowed to run before it is automatically timed outString representing a numeric value
    startAtWithRandomDelay
Range, in minutes, within which the Execution Plan startsString representing a numeric value
    triggerType
Not implementedCONTINUOUS
    daysOfWeek
Not implementednull
    startAt
Date from when the schedule is in use

One of the following:

  • Date in format: YYYY-MM-DDThh:mm:ss
    Example: 2016-01-05T12:00:00
  • 0—Indicates that the schedule period is effective immediately
    intervalInMinutes
Number of minutes between runs of the Execution PlanString representing a numeric value
scriptId

ID of the script used by the Execution Plan

  • When creating a new Execution Plan, you must enter a scriptId.
  • When updating an existing Execution Plan, this cannot be modified.
String representing a numeric value
agentGroups
Locations defined for the Execution Plan
    name
Name of the LocationString
    id
ID of the LocationNumber
scriptFileSize

Size of the script file used by the Execution Plan in bytes

Content of this parameter is ignored.

String representing a numeric value
activeStatus
Indication if the Execution Plan is active or not

String representing a numeric value

Valid values:

0—False

1—True

useGlobalScheduler
Not implementedfalse
attributeChangedEnvelopVersion
Version number that is incremented each time there is a change in blackouts, schedule, or Execution Plan nameString representing a numeric value
activeBy
Array of two Boolean values indicating if the Execution Plan is active at the Execution Plan level, and at the Application levelArray
executionPlanName      
Name of the Execution PlanString
attributes

Attributes of the script run by the Execution Plan (can be multiple)

You can obtain a list of attributes in a script from the Retrieving script details -- API.


    encrypted
Indicates whether or not the attribute is encrypted

0—False

1—True; used for a password attribute

    defaultValue
Default value of the attributeVaries, depending on the attribute
    name
Name of the attributeString
    encryptionType

Indicates whether the value parameter for the attribute is encoded

0value is not encoded

1value is encoded; used when you are setting a password attribute

    description
Description of the attributeString
    type
Data type of the attribute
  • boolean
  • float
  • number
  • string
    value

Value of the attribute

Varies, depending on the attribute

For a password enter the Base64 encoded value, and set encryptionType to 1.

    order
Serial number of the appearance of the attribute in the user interfaceNumber
useGlobalBlackout
Not implementedfalse
applicationId(Mandatory) ID of the application on the Presentation ServerString representing a numeric value
syntheticApplicationId

Synthetic application ID

This parameter is not updated by this API request.

String representing a numeric value
syntheticApplicationName
Name of the applicationString
attributeChangedScriptVersion
Version number that is incremented each time there is a change in script attributesString representing a numeric value
executionLogSettingWhether the Execution Log is saved.
  • ALWAYS
  • ON_ERROR
  • NEVER

 

Was this page helpful? Yes No Submitting... Thank you

Comments