AWS Elemental MediaLive
User Guide

Working with the Schedule (AWS CLI)

You can use the AWS CLI to work with the schedule programmatically. The sections later in this chapter describe how to enter the appropriate commands. These sections assume that you are familiar with the basics of using the AWS CLI. For information about the basics, see the AWS CLI Command Reference.

In the following sections, for each command there is:

  • A description of the AWS CLI command syntax.

  • A description of the schema for the request or response JSON payload. This payload is shown using the syntax for the AWS CLI.

  • An example of the request or response JSON payload. This payload is also shown using the syntax for the AWS CLI.

For details on the JSON contents, we recommend that you read the AWS Elemental MediaLive API Reference. This guide is easy to use because it includes links from elements in the JSON payload to tables that describe the element. But you need to adjust the syntax of the elements in the JSON code because the AWS CLI uses one form of capitalization for elements (for example, SubSegmentNum) and the API uses another form (for example, subSegmentNum).

Combining Create and Delete (AWS CLI)

You can use the batch-update-schedule command to create a batch of create actions or delete actions or both create and delete actions.

For general information on how a batch of actions is processed, see How a Batch Request Works.

The only differences between a command to create one action and a command to create a batch are the following:

  • If you want to create a batch of creates and deletes, then in the command, you include a payload in both the --creates parameter and the --deletes parameter.

  • If you want to create a batch of actions, then in the payload for the --creates parameter, you include several actions. See lower down in this section for details.

  • If you want to delete a batch of actions, then in the payload for the --deletes parameter, you include several actions. See lower down in this section for details.

Combining Create Actions

Here is an example of a JSON body to pass into the --creates parameter of the batch-update-schedule AWS CLI command. It contains two actions to create. In this example, both actions are splice inserts, but in fact you can combine any number and any type of create actions. **check if curly braces are ok for CLI

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

Combining Delete Actions

Here is an example of a JSON body to pass into the --deletes parameter of the batch-update-schedule AWS CLI command. It specifies two actions to delete.

"ActionNames": [ "SpliceInsert-01", "overlay-21" ] }

Combining Create Actions and Delete Actions

To combine a batch of creates and deletes, then in the batch-update-schedule command, include a payload in the --creates parameter and another payload in the --deletes parameter.

To combine create actions and delete actions in the schedule (AWS CLI)

  1. On the command line, enter this command:

    aws medialive batch-update-schedule --channel-id value --creates create content --deletes delete content

  2. In create content, include the appropriate payload.

    You can include one or more actions in the payload.

    The actions each has its own start time.

    For details on forming the command, see the AWS CLI Command Reference. For information about the meaning and values for the fields, see the AWS Elemental MediaLive API Reference

  3. In delete content, include the list of actions to delete by entering an array of ActionNames. You can obtain these ActionNames using the DescribeChannel command (see Viewing the Schedule (AWS CLI).

  4. To submit the command, press Enter. The response appears on the screen. The response repeats the data from the request. If you didn't enter an ActionName for create actions, AWS Elemental MediaLive generates them and includes them in the response.

Important

The --creates parameter appears before the --deletes parameter.

But all the delete actions are always performed before the creates actions.

The following example is for a command that has payloads in both parameters. The payload for the --deletes parameter removes an action to active an image overlay because it has an incorrect start time. The action is named overlay-21. The payload for the --creates parameter inserts that action again, this time with the correct start time.

In this action, the delete action and the create action have the same ActionName. The name is being reused because the batch is a "delete and replace". But the actions could have different names.

Here is the payload for the --deletes parameter:

"ActionNames": [ "overlay-21" ]

Here is the payload for the --creates parameter:

"ScheduleActions": [ { "ScheduleActionStartSettings": { "FixedModeScheduleActionStartSettings": { "Time": "2018-05-21T20:42:19.000Z" } }, "ActionName": "overlay-21", "ScheduleActionSettings": { "StaticImageActivateSettings": { "Image": { "PasswordParam": "imagespassword", "Uri": "s3ssl://banners/banner_A/high-res.bmp", "Username": "medialiveoperator" }, "ImageY": 300, "FadeIn": 1500, "ImageX": 200, "Width": 800, "Opacity": 60, "Layer": 1, "Height": 900 } } } ]