Updated on 2025-11-12 GMT+08:00

Querying Instances

Function

Adding the Instance Query API

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:listCesInstances

List

-

-

-

-

URI

POST /v1/{project_id}/ott/instances

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

namespace

Yes

String

Namespace

query

Yes

Array of query objects

Query information

start

No

Integer

Start offset of a query

limit

No

Integer

Query constraint

Table 4 query

Parameter

Mandatory

Type

Description

dim_name

Yes

String

Dimension name

id

No

String

Dimension ID

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

instances

Array of instances objects

Instance

total

Integer

Total number

Table 6 instances

Parameter

Type

Description

medialive_mpc

medialive_mpc object

Media Live transcoding service

pipeline

pipeline object

Channel

audio

audio object

Audio

Table 7 medialive_mpc

Parameter

Type

Description

id

String

Channel ID

name

String

Channel name

Table 8 pipeline

Parameter

Type

Description

id

String

pipeline id

name

String

pipeline name

Table 9 audio

Parameter

Type

Description

id

String

Channel ID

name

String

Channel name

Status code: 400

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error code

error_msg

String

Error message

Example Requests

  • Queries all audio instances in Pipeline 0 of cctv1 under the medialive_mpc dimension (with five audio track instances output).

    POST https://{endpoint}/v1/{project_id}/ott/instances
    
    {
      "namespace" : "SYS.LIVE",
      "query" : [ {
        "dim_name" : "medialive_mpc",
        "id" : "test1112"
      }, {
        "dim_name" : "pipeline"
      }, {
        "dim_name" : "audio"
      } ],
      "start" : 0,
      "limit" : 100
    }
  • Queries all pipeline instances of cctv1 under the medialive_mpc dimension.

    POST https://{endpoint}/v1/{project_id}/ott/instances
    
    {
      "namespace" : "SYS.LIVE",
      "query" : [ {
        "dim_name" : "medialive_mpc",
        "id" : "cctv1"
      }, {
        "dim_name" : "pipeline"
      } ],
      "start" : 0,
      "limit" : 100
    }

Example Responses

Status code: 200

{
  "instances" : [ {
    "medialive_mpc" : {
      "id" : "test1112",
      "name" : "test1112"
    },
    "pipeline" : {
      "id" : "Pipeline0",
      "name" : "Pipeline0"
    },
    "audio" : {
      "id" : "Audio0",
      "name" : "Audio0"
    }
  }, {
    "medialive_mpc" : {
      "id" : "test1112",
      "name" : "test1112"
    },
    "pipeline" : {
      "id" : "Pipeline0",
      "name" : "Pipeline0"
    },
    "audio" : {
      "id" : "Audio1",
      "name" : "Audio1"
    }
  }, {
    "medialive_mpc" : {
      "id" : "test1112",
      "name" : "test1112"
    },
    "pipeline" : {
      "id" : "Pipeline0",
      "name" : "Pipeline0"
    },
    "audio" : {
      "id" : "Audio2",
      "name" : "Audio2"
    }
  }, {
    "medialive_mpc" : {
      "id" : "test1112",
      "name" : "test1112"
    },
    "pipeline" : {
      "id" : "Pipeline0",
      "name" : "Pipeline0"
    },
    "audio" : {
      "id" : "Audio3",
      "name" : "Audio3"
    }
  }, {
    "medialive_mpc" : {
      "id" : "test1112",
      "name" : "test1112"
    },
    "pipeline" : {
      "id" : "Pipeline0",
      "name" : "Pipeline0"
    },
    "audio" : {
      "id" : "Audio4",
      "name" : "Audio4"
    }
  } ],
  "total" : 5
}

Status code: 400

Invalid request parameters.

{
  "error_code" : "LIVE.100011001",
  "error_msg" : "Request parameters is invalid"
}

Status Codes

Status Code

Description

200

400

Invalid request parameters.

Error Codes

See Error Codes.