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.
API
Method
Description
Applications

GET
Retrieve the details of applications
PUT
Update an existing application
POST
Create a new application
DELETE
Delete an application
Execution Plans

GET
Retrieve the details of Execution Plans
PUT
DELETE
Delete an Execution Plan
Scripts
GET
Retrieve the details of scripts
Locations
GET
Retrieve the details of all locations
Blackouts
POST
Retrieve the details of Blackouts
PUT
POST
Activate the Blackout
POST
Deactivate the Blackout
POST
Delete a Blackout
Time Frames
POST
Retrieve the details of Time Frames
PUT
POST
Delete 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

Element

Description

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

{
 "id": "",
 "status": "INACTIVE",
 "name": "New Year's Eve",
 "description": "New Year's Eve",
 "scope": "SUSPEND_EXECUTIONS",
 "timeZone": "UTC",
 "applications": {
   "quantity": "SINGLE",
   "set": [
     {
       "syntheticId": -1,
       "appId": "5dce6bbb-dae8-4896-b7e6-2c2c5239e64c2C"
     }
   ]
 },
 "executionPlans": {
   "quantity": "ALL",
   "set": []
 },
 "timeframes": [
   "763de7d7-451f-45fa-985e-f70f21b9010"
 ]
}

To update a Blackout

{
 "id": "95343ff6-e627-4874-91fd-be3ed0c83872",
 "status": "ACTIVE",
 "name": "New Year's Eve",
 "description": "New Year's Eve",
 "scope": "SUSPEND_EXECUTIONS",
 "timeZone": "UTC",
 "applications": {
   "quantity": "SINGLE",
   "set": [
     {
       "syntheticId": -1,
       "appId": "5dce6bbb-dae8-4896-b7e6-2c2c5239e64c2C"
     }
   ]
 },
 "executionPlans": {
   "quantity": "ALL",
   "set": []
 },
 "timeframes": [
   "763de7d7-451f-45fa-985e-f70f21b9010"
 ]
}

Request body parameters

Parameter

Description

Value

id

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

scope

Blackout Type

SUSPEND_EXECUTIONS

timeZone

Schedule 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

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*