Page tree
Skip to end of metadata
Go to start of metadata

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

APIMethodDescription
Applications

GETRetrieve the details of one application or all applications
PUT

Update an existing application

POSTCreate a new application
DELETEDelete an application
Execution Plans

  
GETRetrieve the details of one or more Execution Plans
PUTCreate a new Execution Plan or
Update an existing Execution Plan
DELETEDelete an Execution Plan
ScriptsGETRetrieve the details of one script or all scripts
LocationsGETRetrieve the details of all locations
 

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

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.


{
	"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

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

     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
    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
    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
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
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

 

11 Comments

  1.  encryptionType
    Type of encryption used for this attribute

    0 - No encryption

    1,2 - Indicates encryption type


    Great... what does 1 ou 2 mean ?any specific encryption algorythm ?

    1. Hi Stephane,

      I'll check with the developers and update and correct the content in the coming days.

      In the mean time, the options are 0 and 1 (2 is not a valid value). You would use 1 if you are setting a password.

      Regards,

      Sara

      1.  

        1.  

          1.  

  2. Hi,


    I've opened a case 3 days ago without any answer...


    For password I guess  encrypted should be set to 1 and encryptionType may depends on the encryption method 


    Regards

    1.  

  3. Hi Stephane,

    I replied yesterday, but I'm sorry if you cannot see it. I'll add it here, below, and I should be able to update the documentation in the next day or two.

    Regards,

    Sara

    ============Reply from yesterday

    Hi Stephane,

    I'll check with the developers and update and correct the content in the coming days.

    In the mean time, the options are 0 and 1 (2 is not a valid value). You would use 1 if you are setting a password.

    Regards,

    Sara


    1. Hi Sara


      Are you sure ?

      No mismatch between encrypted and encryptionType ?

      What is encryption method used ?


      Lots of doc improvment identified here (smile)

      1. Hi Stephane,

        I updated the documentation. While the content is now more precise—if you are setting a password, set encrypted and encryptionType to 1—I will work to add a specific example for a password attribute with a fuller explanation.

        Thanks for taking the time to comment!

        Regards,

        Sara

        1.