Interface Specification
Last Updated:2021-09-15
Content of Request Header(HTTP Request Header)
The API service of MCT needs to contain the following information in HTTP header field of the request:
- host(Required)
- x-bce-date(Required)
- x-bce-request-id(Optional)
- authorization(Required)
- content-type(Optional)
- content-length(Optional)
As an example, the following is the content of a standard request header field when a user accesses the lists of queue:
GET /v3/pipeline/high_priority_pipe HTTP/1.1
accept-encoding: gzip, deflate
x-bce-date: 2015-03-24T13:04:26Z
host: media.bj.baidubce.com
accept: */*
connection: keep-alive
x-bce-request-id: 47281222-f0ff-4f80-9a4d-0140ff77dcd0
content-type: application/json
authorization: bce-auth-v1/46bd9968a6194b4bbdf0341f2286ccce/2015-03-24T13:04:26Z/1800/host;x-bce-date/b1ad7075b37616b846a356d1db86e73abba1aed51b4d7b0d95321f69f17250b1
Format of Request Message Body(HTTP Request Body)
The API service of MCT requires a structural body of JSON format to describe the details of a request. As an example, the following is a standard request message body format when the user creates a task:
{
"targetKey": "output_example.flv",
"sourceKey": "input_example.mp4",
"presetName": "bce.video_mp4_1920x1080_3660kbps"
}
Request Return Format(HTTP Response)
The MCT API service adopts the message body of JSON format as the format of response returned. As an example, the following is a complete request return of a standard user query pipeline:
HTTP/1.1 200 OK
Transfer-Encoding: chunked
x-bce-request-id: 47281222-f0ff-4f80-9a4d-0140ff77dcd0
Cache-Control: no-cache
Server: BWS
Date: Tue, 24 Mar 2015 13:04:27 GMT
Content-Type: application/json;charset=UTF-8
{
"pipelineName": "high_priority_pipe",
"sourceBucket": "examplesourceBucket",
"targetBucket": "exampletargetBucket",
"pipelineSize": 5,
"state":"ACTIVE",
"lastUpdateTime": "15-03-24T13:02:00Z",
"description": "Example Pipeline for Demo Purpose.",
"jobStatus":{
"total": 0,
"running": 0,
"pending": 0,
"success": 0,
"failed": 0
}
}
Error Message Format
HTTP State Code | Error Code | Error Information | Description |
---|---|---|---|
404 | NoSuchPreset | The requested preset does not exist. Please double confirm your preserId or the existence of the preset. | The accessed cluster does not exist. Please re- Confirm if the specified cluster ID is correct or confirming that specifies exists. |
404 | NoSuchPipeline | The requested pipeline does not exist. Please confirm your pipelineName or the existence of the pipeline. | The accessed pipeline does not exist. Please confirm whether the specified pipelineName is correct or the specified pipeline exists. |
404 | NoSuchJob | The requested job does not exist. Please confirm your jobId or the existence of the job. | The accessed Job does not exist. Please re- Confirm if the specified jobId is correct or confirming that Job exists. |
400 | PipelineFull | The requested pipeline is full. Please wait for the pipeline to fullfill more jobs or have a new one. | The requested pipeline is full . Please wait for the pipeline to fulfill more jobs or create a pipeline. |
400 | InvalidBucket | You have no access to bucket: {bucket name}. Please confirm your bucket name or the existence of the bucket. | The bucket specified by users cannot be accessed. Please confirm whether the bucket name is correct or the bucket exists. |
400 | PipelineNotEmpty | Pipeline have jobs in pending or running status. Please wait for the jobs to be completed and try again. | For there are pending or running jobs in the pipeline, you cannot continue with the next operation. Please wait for the jobs to complete and try again. |
404 | PipelineNotActive | Pipeline has been deleted. Please confirm your pipelineName or specify another pipeline. | The pipeline has been identified as deleted. Please confirm your pipelineName or specify another pipeline. |
400 | PresetNotEmpty | Preset has jobs applied in pending or running status. Please wait for the jobs to be completed and try again. | The jobs using this template are in pending or running status. Please wait for all jobs using this template to complete. |
400 | InvalidParameterException | There are field(s) invalied in the request messsage body, please check. | There are one or more field errors in the requested message body. Please check it. |
400 | InvalidDelogo | Delogo (in paint) is not supported if preset is transmux | The delogo is not supported in the transmux mode. |