Saving a Blackout – synthetic API


The PUT method of the API saves a Blackout. The same API method is used to create and update the Blackout. 

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

  • The  Blackout API uses the PUT method with a blank ID value to create a Blackout.
  • The  Blackout API uses the PUT method with a valid Blackout ID to update a Blackout.

Request syntax

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

Request with REST client

After accessing the REST client, perform the following steps:

  1. Enter the URL for the API.
    An example of a request to create and save a Blackout is:
    https://localhost/tsws/10.0/api/appvis/synthetic/api/blackouts/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. Enter the json code in the request body
  5. 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. The code returns the ID of the Blackout being saved or an error message.

  • If the "id" field is blank or contains no value, a new Blackout configuration is saved.
  • If the "id" field contains a valid Blackout ID, the existing Blackout configuration is updated.


To create a Blackout

To update a Blackout

Request body parameters

ParameterDescriptionValue
idBlackout ID

For creating the Blackout – ID is set to no value or blank. id=""

For Updating the Blackout – ID is set to a valid Blackout ID

Id = < Blackout ID>
status

Blackout status: ACTIVE or INACTIVE.

  • ACTIVE
  • INACTIVE
name
Name of the Blackout.String. It must be between 1 - 255 characters.

description

Description of the Blackout.

String.

(Optional) It can be blank. If you specify, it must be less than or equal to 255 characters.

scopeBlackout Type

SUSPEND_EXECUTIONS

timeZoneSchedule the Blackout according to the UTC time zone or TEA Agent Local time zone where the Execution Plan runs.
  • UTC
  • AGENT_LOCAL 

Applications



    quantity
Indicates whether single, multiple, or all applications are configured in the Blackout.
  • ALL
  • SINGLE
  • MULTIPLE
    set
Application ID. Used only when the quantity is set to SINGLE or MULTIPLE.
  • ALL - No value is set
  • SINGLE or MULTIPLE
    • "appId"
    • "syntheticId": -1 
  • Note: syntheticId is assigned automatically.

executionPlans



    quantity
Indicates whether single, multiple, or all Execution Plans are configured in the Blackout.
  • ALL
  • SINGLE
  • MULTIPLE
  • Note:
    • SINGLE or MULTIPLE is used ONLY if a single application is configured in the Blackout.
    set
Execution Plan ID. Used only when the quantity is set to SINGLE or MULTIPLE.
  • ALL – no value
  • SINGLE – Execution Plan ID
  • MULTIPLE – Execution Plan IDs (comma separated list)
timeframes

Time Frame IDs

  • Time Frame ID
  • List of Time Frame IDs

Response

The response returns the Blackout ID.


Related topics

Developing

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

Comments