AWS Elemental MediaLive
User Guide

About the BatchUpdateSchedule Command

The BatchUpdateSchedule command lets you modify the schedule of actions for the channel.

It can be used to submit single requests – request to create one action or delete one action.

It can also be used to submit batch requests. You can batch together:

  • Delete actions

  • Create actions

  • Both delete and create actions

How Batch Requests Work

The intention of batching is to pass or fail all the actions together. Therefore the batched actions are all validated together. The validation includes:

  • Ensuring that each action being created or deleted has a UTC start time that is at least 15 seconds in the future.

  • If the action refers to an existing action in the schedule, ensuring that the reference to the existing action is correct.

If the validation fails for any one action, then it fails for all the actions in the batch.

If you don't want the actions to pass or fail together, don't set up a batch. Instead, create each action in its own BatchUpdateSchedule command.

If the validation succeeds, MediaLive processes all the delete requests before the create requests, regardless of the start times of the actions.

Example 1

An important use of batch is to perform several actions that must pass or fail together. For example, assume you want to remove the corporate logo and immediately insert a splice_insert (in order to go to an ad avail).

In need an action to remove the logo and another action to insert the splice_insert.

You don't want MediaLive to insert the remove action if the splice_insert action fails, or vice versa. It is easier for you if both actions fail, you fix the badly formed action, and then submit both actions again.

You therefore submit the two actions together, in one BatchUpdateSchedule command.

Example 2

Another important use of batch is to fix an error in an action in the schedule. For example, you might want to fix an image overlay that had not yet started and that was created with the wrong start time. You submit one BatchUpdateSchedule command that contains:

  • A Delete command to remove the action to activate the image overlay.

  • A Create command to add the action to activate the image overlay. This action contains the correct information.

The JSON Body in the BatchUpdateSchedule Command

To obtain a skeleton of the JSON body from the AWS CLI, we recommend that you use the following AWS CLI command:

aws medialive batch-update-schedule -- generate-cli-skeleton

The output of this command shows all the possible actions for this command. For more information, see the AWS CLI command line help.

To get more familiar with individual actions, we recommend that you use the AWS MediaLive console to create an action. After you have created the action, use the DescribeSchedule command to obtain the raw JSON content for the entire schedule. You can copy individual actions and save them as models to use when working with the AWS CLI.

Here is an example of a JSON body for a request to delete two actions and creates two actions. This JSON body has the Pascal case (upper camel case) that applies to the AWS CLI.

{ "ChannelId": "999999", "Deletes": { "ActionNames": [ "SpliceInsert-01", "overlay-21" ] "Creates": { "ScheduleActions": [ { "ScheduleActionSettings": { "Scte35SpliceInsertSettings": { "Duration": 1350000 "SpliceEventId": 3 } }, "ActionName": "SpliceInsert-01", "ScheduleActionStartSettings": { "FixedModeScheduleActionStartSettings": { "Time": "2018-11-05T16:10:30.000Z" } } }, { "ScheduleActionSettings": { "Scte35SpliceInsertSettings": { "Duration": 2700000, "SpliceEventId": 3 } }, "ActionName": "SpliceInsert-02", "ScheduleActionStartSettings": { "FixedModeScheduleActionStartSettings": { "Time": "2018-11-05T16:30:45.000Z" } } } ] } }