Querying Instances
Function
Adding the Instance Query API
URI
POST /v1/{project_id}/ott/instances
|
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
|
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. |
|
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 |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
instances |
Array of instances objects |
Instance |
|
total |
Integer |
Total number |
|
Parameter |
Type |
Description |
|---|---|---|
|
medialive_mpc |
medialive_mpc object |
Media Live transcoding service |
|
pipeline |
pipeline object |
Channel |
|
audio |
audio object |
Audio |
Status code: 400
|
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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot