队列接口
更新时间:2021-04-01
创建队列
接口描述
基本接口,用户向服务请求创建任务队列。
请求(Request)
-
请求语法:
Http1POST /v{version}/pipeline HTTP/1.1 2accept-encoding: gzip, deflate 3x-bce-date: {utc-date-string} 4connection: keep-alive 5accept: */* 6host: media.bj.baidubce.com 7x-bce-request-id: {bce-request-id} 8content-type: application/json 9authorization: {bce-authorization-string}
- 请求头域:无特殊Header参数
- 请求参数:
字段名 | 字段类型 | 必要性 | 字段描述 | 可选值 | 参数位置 |
---|---|---|---|---|---|
pipelineName | String | 必选 | 队列名称,允许小写字母、数字以及下划线且必须以字母开头,长度小于40个字符 | - | requestbody参数 |
description | String | 可选 | 队列描述,长度小于128个字符 | - | requestbody参数 |
sourceBucket | String | 必选 | 输入Bucket | - | requestbody参数 |
targetBucket | String | 必选 | 输出Bucket | - | requestbody参数 |
config | Object | 可选 | 队列的配置 | - | requestbody参数 |
+ capacity | Number | 可选 | 队列的并发能力(默认20) | 大于等于1 | requestbody参数 |
+ notification | String | 可选 | 通知名称 | - | requestbody参数 |
+ pipelineType | String | 可选 | 队列类型: 默认 normal,极速转码 acceleration | - | requestbody参数 |
- 请求示例:
Plain Text
1 POST /v3/pipeline HTTP/1.1
2 accept-encoding: gzip, deflate
3 x-bce-date: 2015-03-24T13:02:00Z
4 connection: keep-alive
5 accept: */*
6 host: media.bj.baidubce.com
7 x-bce-request-id: 73c4e74c-3101-4a00-bf44-fe246959c05e
8 content-type: application/json
9 authorization: bce-auth-v1/46bd9968a6194b4bbdf0341f2286ccce/2015-03-24T13:02:00Z/1800/host;x-bce-date/994014d96b0eb26578e039fa053a4f9003425da4bfedf33f4790882fb4c549
10 {
11 "sourceBucket": "exampleIuputBucket",
12 "targetBucket": "exampletargetBucket",
13 "pipelineName": "medium_priority_pipe",
14 "description": "The pipeline holding medium priority jobs.",
15 "config": {
16 "capacity": "5",
17 "notification" : "mct_notification",
18 "pipelineType": "normal"
19 }
20 }
响应(Response)
- 响应头域:无特殊Header参数
- 响应参数:无
-
响应示例:
Http1HTTP/1.1 200 OK 2x-bce-request-id: 73c4e74c-3101-4a00-bf44-fe246959c05e 3Cache-Control: no-cache 4Server: BWS 5Date: Tue, 24 Mar 2015 13:02:01 GMT 6Content-Type: application/json;charset=UTF-8
查询指定队列
接口描述
基本接口,用户通过指定name来查询该指定队列的信息。
请求(Request)
- 请求语法:
Plain Text
1 http
2 GET /v{version}/pipeline/{pipelineName} HTTP/1.1
3 accept-encoding: gzip, deflate
4 x-bce-date: {utc-date-string}
5 host: media.bj.baidubce.com
6 accept: */*
7 connection: keep-alive
8 x-bce-request-id: {bce-request-id}
9 content-type: application/json
10 authorization: {bce-authorization-string}
11
- 请求头域:无特殊Header参数
- 请求参数:无
- 请求示例:
Plain Text
1http
2GET /v3/pipeline/high_priority_pipe HTTP/1.1
3accept-encoding: gzip, deflate
4x-bce-date: 2015-03-24T13:04:26Z
5host: media.bj.baidubce.com
6accept: */*
7connection: keep-alive
8x-bce-request-id: 4cd11be3-fcaf-4ce5-aa4a-135f3c27b12b
9content-type: application/json
10authorization: bce-auth-v1/02296dd93f1940a39913d9a406332486/2015-03-24T13:04:26Z/1800/host;x-bce-date/0ffab05c5001f9d80c8d2630561ff2144cf070d1fe838133412c8245615046f9
11
响应(Response)
- 响应头域:无特殊Header参数
- 响应参数
字段名称 | 字段类型 | 字段描述 |
---|---|---|
pipelineName | String | 用户指定的队列名称,允许小写字母、数字以及下划线且必须以字母开头 |
sourceBucket | String | 用户指定的输入Bucket |
targetBucket | String | 用户指定的输出Bucket |
config | Object | 队列配置的对象 |
+ capacity | Number | 队列的并发能力 |
+ notification | String | 通知名称 |
state | String | 队列状态,分为ACTIVE/INACTIVE |
createTime | String | 创建时间,UTC格式 |
description | String | 用户指定的队列描述 |
jobStatus | Object | 队列中任务的状态集合 |
+ total | Number | 队列中的任务总数 |
+ running | Number | 队列中运行中的任务总数 |
+ pending | Number | 队列中排队中的任务总数 |
+ success | Number | 队列中已执行成功的任务总数 |
+ failed | Number | 队列中执行失败的任务总数 |
- 响应示例:
Plain Text
1 http
2 HTTP/1.1 200 OK
3 Transfer-Encoding: chunked
4 x-bce-request-id: 47281222-f0ff-4f80-9a4d-0140ff77dcd0
5 Cache-Control: no-cache
6 Server: BWS
7 Date: Tue, 24 Mar 2015 13:04:27 GMT
8 Content-Type: application/json;charset=UTF-8
9
10 {
11 "name": "high_priority_pipe",
12 "sourceBucket": "exampleSourceBucket",
13 "targetBucket": "exampleTargetBucket",
14 "config": {
15 "capacity": 5,
16 "notification": "mct_notification"
17 },
18 "state":"ACTIVE",
19 "createTime":"2015-03-24T13:04:26Z",
20 "description":"A pipleine hoding high priority jobs.",
21 "jobStatus":
22 {
23 "total": 10,
24 "running": 2,
25 "pending": 1,
26 "success": 7,
27 "failed": 1
28 }
29 }
30
查询用户所有队列
接口描述
易用性接口,帮助用户查询所拥有的所有队列的详细信息。
请求(Request)
- 请求语法:
Plain Text
1 http
2 GET /v{version}/pipeline HTTP/1.1
3 accept-encoding: gzip, deflate
4 x-bce-date: {utc-date-string}
5 host: media.bj.baidubce.com
6 accept: */*
7 connection: keep-alive
8 x-bce-request-id: {bce-request-id}
9 content-type: application/json
10 authorization: {bce-authorization-string}
11
- 请求头域:无特殊Header参数
- 请求参数:无
- 请求示例:
Plain Text
1 http
2 GET /v3/pipeline HTTP/1.1
3 accept-encoding: gzip, deflate
4 x-bce-date: 2015-03-24T13:03:20Z
5 host: media.bj.baidubce.com
6 accept: */*
7 connection: keep-alive
8 x-bce-request-id: cc7500cb-ebc5-4ac2-9018-4befad8e2479
9 content-type: application/json
10 authorization: bce-auth-v1/46bd9968a6194b4bbdf0341f2286ccce/2015-03-24T13:03:20Z/1800/host;x-bce-date/c5e36c982e5037841925c6729f1e74df53ebb134745d3e6da2722f2333d390a2
11
响应(Response)
- 响应头域:无特殊Header参数
- 响应参数:
字段名 | 字段类型 | 字段描述 |
---|---|---|
pipelines | Object | 用户队列的集合 |
+ pipelineName | String | 用户指定的队列名称 |
+ sourceBucket | String | 用户指定的输入Bucket |
+ targetBucket | String | 用户指定的输出Bucket |
+ config | Object | 队列配置 |
++ capacity | Number | 队列的并发能力 |
++ notification | String | 通知名称 |
+ state | String | 队列状态,分为ACTIVE/INACTIVE |
+ createTime | String | 创建时间,UTC格式 |
+ description | String | 用户指定的队列描述 |
+ status | Object | 队列中任务的状态集合 |
++ total | Number | 队列中的任务总数 |
++ running | Number | 队列中运行中的任务总数 |
++ pending | Number | 队列中排队中的任务总数 |
++ success | Number | 队列中已执行成功的任务总数 |
++ failed | Number | 队列中执行失败的任务总数 |
- 响应示例:
Plain Text
1 http
2 HTTP/1.1 200 OK
3 Transfer-Encoding: chunked
4 x-bce-request-id: cc7500cb-ebc5-4ac2-9018-4befad8e2479
5 Cache-Control: no-cache
6 Server: BWS
7 Date: Tue, 24 Mar 2015 13:03:21 GMT
8 Content-Type: application/json;charset=UTF-8
9
10 {
11 "pipelines": [
12 {
13 "pipelineName": "high_priority_pipe",
14 "sourceBucket": "sampleSourceBucket00",
15 "targetBucket": "sampleTargetBucket00",
16 "config": {
17 "capacity":20,
18 "notification": "mct_notification"
19 },
20 "state": "ACTIVE",
21 "createTime": "2015-03-24T13:03:20Z",
22 "description": "The pipeline holding high priority jobs.",
23 "jobStatus": {
24 "total": 0,
25 "running": 0,
26 "pending": 0,
27 "success": 0,
28 "failed": 0
29 }
30 },
31 {
32 "pipelineName": "medium_priority_pipe",
33 "sourceBucket": "sampleSourceBucket01",
34 "targetBucket": "sampleTargetBucket01",
35 "config": {
36 "capacity":20
37 },
38 "state": "ACTIVE",
39 "createTime": "2015-03-24T13:03:20Z",
40 "description": "The pipeline holding medium priority jobs.",
41 "jobStatus": {
42 "total": 0,
43 "running": 0,
44 "pending": 0,
45 "success": 0,
46 "failed": 0
47 }
48 },
49 {
50 "pipelineName": "low_priority_pipe",
51 "sourceBucket": "sampleSourceBucket02",
52 "targetBucket": "sampleTargetBucket02",
53 "config": {
54 "capacity":20
55 },
56 "state": "ACTIVE",
57 "createTime": "2015-03-24T13:03:20Z",
58 "description": "The pipeline holding low priority jobs.",
59 "jobStatus": {
60 "total": 0,
61 "running": 0,
62 "pending": 0,
63 "success": 0,
64 "failed": 0
65 }
66 }
67 ]
68 }
69
删除指定队列
接口描述
基本接口,用户向服务请求删除指定pipelineName的任务队列。
请求(Request)
- 请求语法:
Plain Text
1 http
2 DELETE /v{version}/pipeline/{pipelineName} HTTP/1.1
3 accept-encoding: gzip, deflate
4 x-bce-date: {utc-date-string}
5 connection: keep-alive
6 accept: */*
7 host: media.bj.baidubce.com
8 x-bce-request-id: {bce-request-id}
9 content-type: application/json
10 authorization: {bce-authorization-string}
11
- 请求头域:无特殊Header参数
- 请求参数:无
- 请求示例:
Plain Text
1 http
2 DELETE /v3/pipeline/high_priority_pipe HTTP/1.1
3 accept-encoding: gzip, deflate
4 x-bce-date: 2015-03-24T13:06:02Z
5 connection: keep-alive
6 accept: */*
7 host: media.bj.baidubce.com
8 x-bce-request-id: 6d0b0a36-2ffe-49d4-9d81-333a9ab9417e
9 content-type: application/json
10 authorization: bce-auth-v1/46bd9968a6194b4bbdf0341f2286ccce/2015-03-24T13:06:02Z/1800/host;x-bce-date/02f64774999996903cffa5ae4d6eef436127a96f581a4e8467497e239d824be8
11
响应(Response)
- 响应头域:无特殊Header参数
- 响应参数:无
- 响应示例:
Plain Text
1 http
2 HTTP/1.1 200 OK
3 x-bce-request-id: 6d0b0a36-2ffe-49d4-9d81-333a9ab9417e
4 Cache-Control: no-cache
更新指定队列
接口描述
基本接口,用户向服务请求更新任务队列。
请求(Request)
-
请求语法:
Http1PUT /v{version}/pipeline/{pipelineName} HTTP/1.1 2accept-encoding: gzip, deflate 3x-bce-date: {utc-date-string} 4connection: keep-alive 5accept: */* 6host: media.bj.baidubce.com 7x-bce-request-id: {bce-request-id} 8content-type: application/json 9authorization: {bce-authorization-string}
- 请求头域:无特殊Header参数
- 请求参数:
字段名 | 字段类型 | 必要性 | 字段描述 | 可选值 | 参数位置 |
---|---|---|---|---|---|
pipelineName | String | 必选 | 要更新队列名称 | - | requestbody参数 |
description | String | 可选 | 队列描述,长度小于128个字符 | - | requestbody参数 |
sourceBucket | String | 必选 | 输入Bucket | - | requestbody参数 |
targetBucket | String | 必选 | 输出Bucket | - | requestbody参数 |
config | Object | 可选 | 队列的配置 | - | requestbody参数 |
+ capacity | Number | 可选 | 队列的并发能力(默认20) | 大于等于1 | requestbody参数 |
+ notification | String | 可选 | 通知名称 | - | requestbody参数 |
- 请求示例:
Plain Text
1 PUT /v3/pipeline/medium_priority_pipe HTTP/1.1
2 accept-encoding: gzip, deflate
3 x-bce-date: 2020-02-14T14:59:24Z
4 connection: keep-alive
5 accept: */*
6 host: media.bj.baidubce.com
7 x-bce-request-id: deda676c-0892-4e14-9881-9d6f842d5728
8 content-type: application/json
9 authorization: bce-auth-v1/46bd9968a6194b4bbdf0341f2286ccce/2020-02-14T14:59:24Z/1800/host;x-bce-date/994014d96b0eb26578e039fa053a4f9003425da4bfedf33f4790882fb4c549
10 {
11 "sourceBucket": "exampleIuputBucket",
12 "targetBucket": "exampletargetBucket",
13 "pipelineName": "medium_priority_pipe",
14 "description": "The pipeline holding medium priority jobs.",
15 "config": {
16 "capacity": "10",
17 "notification" : "mct_notification"
18 }
19 }
响应(Response)
- 响应头域:无特殊Header参数
- 响应参数:无
-
响应示例:
Http1HTTP/1.1 200 OK 2x-bce-request-id: deda676c-0892-4e14-9881-9d6f842d5728 3Cache-Control: no-cache 4Server: BWS 5Date: Fri, 14 Feb 2020 06:59:24 GMT 6Content-Type: application/json;charset=UTF-8