Help Center/ Live/ Media Live API Reference/ OTT Channel Management/ Modifying Channel Packaging Information
Updated on 2025-11-12 GMT+08:00

Modifying Channel Packaging Information

Function

Modifies channel packaging information.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the following required identity policy-based permissions. For details about the required permissions, see Permissions Policies and Supported Actions.

Action

Access Level

Resource Type (*: required)

Condition Key

Alias

Dependencies

live:ott:updateChannelEndpoint

Write

-

-

-

-

URI

PUT /v1/{project_id}/ott/channels/endpoints

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain the project ID, see "Obtaining a Project ID".

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

No

String

User token. This parameter is mandatory when token authentication is used. The token can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Authorization

No

String

Authentication information. This parameter is mandatory for AK/SK authentication.

X-Sdk-Date

No

String

Request time. This parameter is mandatory for AK/SK authentication.

X-Project-Id

No

String

Project ID. This parameter is mandatory for AK/SK authentication.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

domain

Yes

String

Ingest domain name of a channel.

app_name

Yes

String

Group name or application name.

id

Yes

String

Unique ID of a channel. This parameter is mandatory.

endpoints

No

Array of EndpointItem objects

Channel output stream information.

Table 4 EndpointItem

Parameter

Mandatory

Type

Description

hls_package

No

Array of HlsPackageItem objects

HLS packaging information.

dash_package

No

Array of DashPackageItem objects

DASH packaging information.

mss_package

No

Array of MssPackageItem objects

MSS packaging information.

Table 5 HlsPackageItem

Parameter

Mandatory

Type

Description

id

No

String

The package unique identifier ID, created by the service and returned during query. It needs to be included when modifying endpoints.

url

No

String

A customized streaming URL, including the method, domain name, and path.

stream_selection

No

Array of StreamSelectionItem objects

Filters out a stream whose bitrate is in the range of [min, max] from all streams. If bitrate filtering is not required, you do not need to specify this parameter.

hls_version

No

String

HLS version number.

segment_duration_seconds

Yes

Integer

Output segment duration of a channel. This parameter is mandatory.

Unit: second. Value range: 1 to 10

NOTE:

Changing the segment duration will affect time-shifted viewing and catch-up TV of the recorded content. Exercise caution when performing this operation.

playlist_window_seconds

No

Integer

Total output segment duration of a channel. The value is the output segment duration multiplied by the number of segments. There are at least three returned segments.

Unit: second. Value range: 0–86,400 (value of converting 24 hours to seconds)

encryption

No

Encryption object

Encryption information.

ads

No

Object

Advertising configuration

ext_args

No

Object

Other additional parameters

request_args

No

PackageRequestArgs object

Playback configuration

ad_marker

No

Array of strings

Advertisement ID.

For HLS, the value is ["ENHANCED_SCTE35"].

enable_access

No

Boolean

When mode is set to ONLY_OS, this parameter specifies whether the output can pull streams from the origin server. The default value is false.

true: allowed

false: not allowed

allow_all_ip_access

No

Boolean

Whether to allow all IP addresses to access. The default value is false.

true: allowed. The ip_whitelist configuration does not take effect.

false: not allowed. The ip_whitelist configuration takes effect. Access is allowed only for IP addresses specified in ip_whitelist.

ip_whitelist

No

String

Whitelist of IP addresses that can pull streams from the origin server when mode is set to ONLY_OS.

cdn_identifier_header

No

HttpHeader object

HTTP header CDN authentication header.

origin_domain_master

No

String

Origin domain name – Primary region

Same as CreateOttChannelInfoReq.region

Regular expression: ^([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?.){2,}[a-zA-Z]{2,16}$

Maximum length: 255 characters

origin_domain_slave

No

String

Origin domain name – Standby region

Constraints:

Huawei Cloud (International)

Standby origin server of AP-Singapore: CN-Hong Kong

Standby origin server of CN-Hong Kong: AP-Singapore

Standby origin server of ME-Riyadh: AP-Singapore

Standby origin server of AF-Johannesburg: AP-Singapore

manifest_name

No

String

Name of the index file of the output.

Default value: index

Length: 0–128 characters

Character set: letters, digits, hyphens (-), periods (.), and underscores (_). Paths with slashes (/) are not allowed.

slave_url

No

String

Custom streaming URL, including the method, domain name, and path.

Table 6 DashPackageItem

Parameter

Mandatory

Type

Description

id

No

String

The package unique identifier ID, created by the service and returned during query. It needs to be included when modifying endpoints.

url

No

String

A customized streaming URL, including the method, domain name, and path.

stream_selection

No

Array of StreamSelectionItem objects

Filters out a stream whose bitrate is in the range of [min, max] from all streams. If bitrate filtering is not required, you do not need to specify this parameter.

segment_duration_seconds

Yes

Integer

Output segment duration of a channel. This parameter is mandatory.

Unit: second. Value range: 1 to 10

NOTE:

Changing the segment duration will affect time-shifted viewing and catch-up TV of the recorded content. Exercise caution when performing this operation.

playlist_window_seconds

No

Integer

Total output segment duration of a channel. The value is the output segment duration multiplied by the number of segments. There are at least three returned segments.

Unit: second. Value range: 0–86,400 (value of converting 24 hours to seconds)

encryption

No

Encryption object

Encryption information.

ads

No

Object

Advertising configuration

ext_args

No

Object

Other additional parameters

request_args

No

PackageRequestArgs object

Playback configuration

ad_marker

No

String

Advertisement ID.

For DASH, the value is xml+bin.

suggested_presentation_delay

No

Integer

Recommended stream delay

Unit: second. Value range: 1 to 120

minimum_update_period

No

Integer

Shortest index update period

Unit: second. Value range: 1 to 120

min_buffer_time

No

Integer

Minimum buffer time

Unit: second. Value range: 1 to 120

enable_access

No

Boolean

Default value: false

true: allowed

false: not allowed

allow_all_ip_access

No

Boolean

Whether to allow all IP addresses to access. The default value is false.

true: allowed. The ip_whitelist configuration does not take effect.

false: not allowed. The ip_whitelist configuration takes effect. Access is allowed only for IP addresses specified in ip_whitelist.

ip_whitelist

No

String

This parameter is valid when allow_all_ip_access is set to false.

IP addresses allowed for access. Separate multiple IP addresses with commas (,). The value must be in CIDR format.

cdn_identifier_header

No

HttpHeader object

HTTP header CDN authentication header.

origin_domain_master

No

String

Origin domain name – Primary region

Same as CreateOttChannelInfoReq.region

Regular expression: ^([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?.){2,}[a-zA-Z]{2,16}$

Maximum length: 255 characters

origin_domain_slave

No

String

Origin domain name – Standby region

Constraints:

Huawei Cloud (International)

Standby origin server of AP-Singapore: CN-Hong Kong

Standby origin server of CN-Hong Kong: AP-Singapore

Standby origin server of ME-Riyadh: AP-Singapore

Standby origin server of AF-Johannesburg: AP-Singapore

manifest_name

No

String

Name of the index file of the output.

Default value: index

Length: 0–128 characters

Character set: letters, digits, hyphens (-), periods (.), and underscores (_). Paths with slashes (/) are not allowed.

slave_url

No

String

Custom streaming URL, including the method, domain name, and path.

Table 7 MssPackageItem

Parameter

Mandatory

Type

Description

id

No

String

The package unique identifier ID, created by the service and returned during query. It needs to be included when modifying endpoints.

url

No

String

A customized streaming URL, including the method, domain name, and path.

stream_selection

No

Array of StreamSelectionItem objects

Filters out a stream whose bitrate is in the range of [min, max] from all streams. If bitrate filtering is not required, you do not need to specify this parameter.

segment_duration_seconds

Yes

Integer

Output segment duration of a channel. This parameter is mandatory.

Unit: second. Value range: 1 to 10

NOTE:

Changing the segment duration will affect time-shifted viewing and catch-up TV of the recorded content. Exercise caution when performing this operation.

playlist_window_seconds

No

Integer

Total output segment duration of a channel. The value is the output segment duration multiplied by the number of segments. There are at least three returned segments.

Unit: second. Value range: 0–86,400 (value of converting 24 hours to seconds)

encryption

No

Encryption object

Encryption information.

ext_args

No

Object

Other additional parameters

delay_segment

No

Integer

Playback delay, in seconds.

request_args

No

PackageRequestArgs object

Playback configuration

enable_access

No

Boolean

Default value: false

true: allowed

false: not allowed

allow_all_ip_access

No

Boolean

Whether to allow all IP addresses to access. The default value is false.

true: allowed. The ip_whitelist configuration does not take effect.

false: not allowed. The ip_whitelist configuration takes effect. Access is allowed only for IP addresses specified in ip_whitelist.

ip_whitelist

No

String

This parameter is valid when allow_all_ip_access is set to false.

IP addresses allowed for access. Separate multiple IP addresses with commas (,). The value must be in CIDR format.

cdn_identifier_header

No

HttpHeader object

HTTP header CDN authentication header.

origin_domain_master

No

String

Origin domain name – Primary region

Same as CreateOttChannelInfoReq.region

Regular expression: ^([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?.){2,}[a-zA-Z]{2,16}$

Maximum length: 255 characters

origin_domain_slave

No

String

Origin domain name – Standby region

Constraints:

Huawei Cloud (International)

Standby origin server of AP-Singapore: CN-Hong Kong

Standby origin server of CN-Hong Kong: AP-Singapore

Standby origin server of ME-Riyadh: AP-Singapore

Standby origin server of AF-Johannesburg: AP-Singapore

manifest_name

No

String

Name of the index file of the output.

Default value: index

Length: 0–128 characters

Character set: letters, digits, hyphens (-), periods (.), and underscores (_). Paths with slashes (/) are not allowed.

slave_url

No

String

Custom streaming URL, including the method, domain name, and path.

Table 8 StreamSelectionItem

Parameter

Mandatory

Type

Description

key

No

String

Parameter used for bitrate filtering in a streaming URL.

max_bandwidth

No

Integer

Maximum bitrate, in bit/s.

Value range: 0-104,857,600 (100 Mbit/s)

min_bandwidth

No

Integer

Minimum bitrate, in bit/s.

Value range: 0-104,857,600 (100 Mbit/s)

Table 9 Encryption

Parameter

Mandatory

Type

Description

key_rotation_interval_seconds

No

Integer

Key cache time. If the key remains unchanged, the data is cached for seven days by default.

This field is reserved and cannot be configured.

encryption_method

No

String

Encryption mode.

This field is reserved and cannot be configured.

level

No

String

The options are as follows:

  • content: One channel corresponds to one key.

  • profile: One bitrate corresponds to one key.

Default value: content

resource_id

Yes

String

DRM content ID generated by the customer

system_ids

Yes

Array of strings

Enumerated value of system_id.

Options:

HLS: FairPlay

DASH: Widevine, PlayReady

MSS: PlayReady

url

Yes

String

DRM address for obtaining a key

speke_version

Yes

String

DRM SPEKE version. Currently, only version 1.0 is supported.

request_mode

Yes

String

Request mode.

Options:

direct_http: accessing the DRM using HTTP(S)

functiongraph_proxy: accessing the DRM using a FunctionGraph proxy

http_headers

No

Array of HttpHeader objects

Authentication information to be added to the DRM request header. A maximum of five items can be added.

Only the direct_http request mode allows configuring http_headers.

urn

No

String

The functiongraph_proxy request mode requires the URN of FunctionGraph.

Table 10 HttpHeader

Parameter

Mandatory

Type

Description

key

Yes

String

key field name in the request header

value

Yes

String

value corresponding to the key in the request header

Table 11 PackageRequestArgs

Parameter

Mandatory

Type

Description

record

No

Array of RecordRequestArgs objects

Recording configuration

timeshift

No

Array of TimeshiftRequestArgs objects

Time shifting configuration

live

No

Array of LiveRequestArgs objects

Livestreaming configuration

Table 12 RecordRequestArgs

Parameter

Mandatory

Type

Description

start_time

No

String

Start time

end_time

No

String

End time

format

No

String

Format

unit

No

String

Unit

Table 13 TimeshiftRequestArgs

Parameter

Mandatory

Type

Description

back_time

No

String

Time shifting duration field name

unit

No

String

Unit

Table 14 LiveRequestArgs

Parameter

Mandatory

Type

Description

delay

No

String

Delay field

unit

No

String

Unit

Response Parameters

Status code: 200

Table 15 Response body parameters

Parameter

Type

Description

result_code

String

Error code.

result_msg

String

Error description.

domain

String

Ingest domain name.

app_name

String

Group name or application name. This parameter is mandatory.

id

String

Unique ID of a channel. This parameter is mandatory.

sources

Array of SourceRsp objects

Ingest URL list. During channel creation, the ingest URL list is returned only when the input stream protocol is RTMP_PUSH.

Table 16 SourceRsp

Parameter

Type

Description

url

String

RTMP ingest URL.

bitrate

Integer

Bitrate.

Unit: bit/s. Value range: (0, 104,857,600] (100 Mbit/s)

width

Integer

Width corresponding to the resolution. Value range: 0–4096 (4K)

height

Integer

Height corresponding to the resolution. Value range: 0–2160 (4K)

enable_snapshot

Boolean

Whether to use the stream for snapshot capturing.

Status code: 400

Table 17 Response body parameters

Parameter

Type

Description

result_code

String

Error code.

result_msg

String

Error description.

domain

String

Ingest domain name.

app_name

String

Group name or application name. This parameter is mandatory.

id

String

Unique ID of a channel. This parameter is mandatory.

Example Requests

PUT https://{endpoint}/v1/{project_id}/ott/channels/endpoints

{
  "domain" : "push.testott.hls.com",
  "app_name" : "ott",
  "id" : "test",
  "endpoints" : [ {
    "hls_package" : [ {
      "url" : "pull.testott.hls.com/ott/test/index.m3u8",
      "stream_selection" : [ {
        "key" : "sss",
        "max_bandwidth" : 1000,
        "min_bandwidth" : 100
      } ],
      "hls_version" : "1",
      "segment_duration_seconds" : 4,
      "playlist_window_seconds" : 3600
    } ],
    "dash_package" : [ {
      "url" : "pull.testott.hls.com/ott/test/index.mpd",
      "stream_selection" : [ {
        "key" : "bitrate=900000-1800000",
        "max_bandwidth" : 1800000,
        "min_bandwidth" : 900000
      } ],
      "segment_duration_seconds" : 4,
      "playlist_window_seconds" : 3600
    } ],
    "mss_package" : [ {
      "url" : "pull.testott.hls.com/ott/channel/manifest",
      "stream_selection" : [ {
        "key" : "bitrate=900000-1800000",
        "max_bandwidth" : 1800000,
        "min_bandwidth" : 900000
      } ],
      "segment_duration_seconds" : 4,
      "playlist_window_seconds" : 3600
    } ]
  } ]
}

Example Responses

Status code: 200

Demo Information

{
  "result_code" : "LIVE.100000000",
  "result_msg" : "SUCCESS",
  "domain" : "push.testott.hls.com",
  "app_name" : "ott",
  "id" : "test"
}

Status code: 400

Error response

{
  "result_code" : "LIVE.100011001",
  "result_msg" : "param check failed",
  "domain" : "push.testott.hls.com",
  "app_name" : "ott",
  "id" : ""
}

Status Codes

Status Code

Description

200

Demo Information

400

Error response

Error Codes

See Error Codes.