Saving an Execution Plan -- API
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
API | Method | Description |
---|---|---|
Applications | GET | Retrieve the details of one application or all applications |
PUT | Update an existing application | |
POST | Create a new application | |
DELETE | Delete an application | |
Execution Plans | GET | Retrieve the details of one or more Execution Plans |
PUT | ||
DELETE | Delete an Execution Plan | |
Scripts | GET | Retrieve the details of one script or all scripts |
Locations | GET | Retrieve the details of all locations |
To save an Execution Plan
The executionplan API uses the PUT method to save an Execution Plan.
Request syntax
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:
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
- Add a new header row and select Authorization as the header type.
- Enter the text authToken followed by the authToken generated through the login API.
- Make sure you have a Content-Type header row with the value application/json.
- Insert the json code in the request body.
- Click Send.
Request parameters
Element | Description |
---|---|
authToken | Value of authToken |
Request body
The following code is an example of the JSON code to send with the request.
"executionPlanId" : 102,
"blackOuts" : [{
"startAtTimeOffset" : "UTC",
"terminateAt" : "0",
"daysOfRunTillHour" : "17:00",
"daysOfRunFromHour" : "08:00",
"daysOfMonth" : null,
"triggerType" : "DAYS_OF_WEEK_BLACKOUT",
"daysOfWeek" : "1,2",
"blackoutName" : null,
"startAt" : "0"
}, {
"startAtTimeOffset" : "UTC",
"terminateAt" : "2016-02-25T08:10:00",
"daysOfRunTillHour" : "17:00",
"daysOfRunFromHour" : "08:00",
"daysOfMonth" : null,
"triggerType" : "DAYS_OF_WEEK_BLACKOUT",
"daysOfWeek" : "1,2",
"blackoutName" : null,
"startAt" : "2016-02-23T08:10:00"
}
],
"projectType" : 0,
"scriptFileName" : "Pinger.ltz",
"description" : "",
"executionPlanName" : "ep_dot_auto",
"version" : 4,
"scriptFileCRC" : 1112554905,
"scheduler" : {
"startAtTimeOffset" : "UTC",
"terminateAt" : "0",
"daysOfRunTillHour" : "0:00",
"daysOfRunFromHour" : "0:00",
"daysOfMonth" : null,
"transactionTimeout" : 15,
"startAtWithRandomDelay" : 5,
"triggerType" : "CONTINUOUS",
"daysOfWeek" : null,
"startAt" : "0",
"intervalInMinutes" : 5
},
"scriptId" : 3,
"agentGroups" : [],
"scriptFileSize" : 67346,
"activeStatus" : 1,
"useGlobalScheduler" : false,
"attributeChangedEnvelopVersion" : 4,
"activeBy" : [true, true],
"attributes" : [{
"encrypted" : 0,
"defaultValue" : "1",
"name" : "Number of Pings",
"encryptionType" : 0,
"description" : "Number of pings to be sent",
"type" : "number",
"value" : "1",
"order" : 2
}, {
"encrypted" : 0,
"defaultValue" : "Sv_ICMP Ping",
"name" : "Timer Name",
"encryptionType" : 0,
"description" : "Name of the ICMP Ping Timer",
"type" : "string",
"value" : "Sv_ICMP Ping",
"order" : 4
}, {
"encrypted" : 0,
"defaultValue" : "",
"name" : "Host",
"encryptionType" : 0,
"description" : "The host being monitored",
"type" : "string",
"value" : "1.1.1.1",
"order" : 0
}, {
"encrypted" : 0,
"defaultValue" : "1.000000000",
"name" : "Ping Timeout",
"encryptionType" : 0,
"description" : "Timeout value for the ping in seconds",
"type" : "float",
"value" : "1.000000000",
"order" : 1
}, {
"encrypted" : 0,
"defaultValue" : "32",
"name" : "Data Size",
"encryptionType" : 0,
"description" : "\n Size of the data package to be sent in bytes\n ",
"type" : "number",
"value" : "32",
"order" : 3
}
],
"useGlobalBlackout" : false,
"applicationId" : 5,
"syntheticApplicationId" : 3,
"syntheticApplicationName" : null,
"attributeChangedScriptVersion" : 1
}
Request body parameters
Parameter | Description | Value |
---|---|---|
executionPlanId | ID of the Execution Plan
| String representing a numeric value |
blackOuts | Blackout periods defined for the Execution Plan (can be multiple) |
|
startAtTimeOffset | Clock used for calculating the blackout period |
|
terminateAt | Date from when the blackout period is no longer used | One of the following:
|
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 |
triggerType | Trigger for the blackout period | DAYS_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:
|
projectType | Type of Silk Performer project | String 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 Plan | String |
executionPlanName | Name of the Execution Plan | String |
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 |
|
terminateAt | Date from when the schedule is no longer used | One of the following:
|
transactionTimeout | Number of minutes a transaction is allowed to run before it is automatically timed out | String representing a numeric value |
startAtWithRandomDelay | Range, in minutes, within which the Execution Plan starts | String representing a numeric value |
startAt | Date from when the schedule is in use | One of the following:
|
intervalInMinutes | Number of minutes between runs of the Execution Plan | String representing a numeric value |
scriptId | ID of the script used by the Execution Plan
| String representing a numeric value |
agentGroups | Locations defined for the Execution Plan |
|
name | Name of the Location | String |
id | ID of the Location | Number |
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 name | String 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 level | Array |
executionPlanName | Name of the Execution Plan | String |
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 attribute | Varies, depending on the attribute |
name | Name of the attribute | String |
encryptionType | Indicates whether the value parameter for the attribute is encoded | 0—value is not encoded 1—value is encoded; used when you are setting a password attribute |
description | Description of the attribute | String |
type | Data type of the attribute |
|
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 interface | Number |
applicationId | (Mandatory) ID of the application on the Presentation Server | String 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 application | String |
attributeChangedScriptVersion | Version number that is incremented each time there is a change in script attributes | String representing a numeric value |