如何接入对象存储数据
更新时间:2024-12-10
百度智能云对象存储BOS(Baidu Object Storage)提供稳定、安全、高效以及高扩展存储服务,支持单文件最大48.8TB的文本、多媒体、二进制等任何类型的数据存储。"存储+计算框架"让您的数据加上“动力”引擎,让数据在传输、存储、处理和发布4个环节有机融为一体。
操作流程介绍
接口demo
提供iapi、postman、swagger等方式的接口连接,下载后即可请求使用。
接口定义
测试连接
POST /kmss/openapi/s3/connector/testConnect
Body 请求参数
Plain Text
1{
2 "endpoint": "xx.xxx.xxx.xx:8080",
3 "ak": "E59P09X6N812M5852HH0",
4 "sk": "oRGm0hpnb4j5OXuWmv0yOPt6unY1K3plRGp9viFi"
5}
请求参数
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
Accept | header | string | 是 | application/json |
token | header | string | 是 | 3596aebe1f1a3284e8cfed46afab7abd |
userid | header | string | 是 | 获取方法:登录百度智能云;进入甄知首页,打开浏览器检查,定位到/user/current接口 ![]() ![]() |
accountid | header | string | 是 | 获取方法:登录百度智能云;进入甄知首页,打开浏览器检查,定位到/user/current接口 ![]() ![]() |
username | header | string | 是 | 获取方法:登录百度智能云;进入甄知首页,打开浏览器检查,定位到/user/current接口 ![]() ![]() |
body | body | string | 是 | none |
返回示例
成功
Plain Text
1{
2 "code": 200,
3 "msg": null,
4 "data": {
5 "id": "CVUJVZLjh8",
6 "auth": "ucb50OscScDNNPWH0uMKUA==",
7 "content": "{\"ak\":\"E59P09X6N812M5852HH0\",\"endpoint\":\"xx.xx.xxx:8080\",\"sk\":\"oRGm0hpnb4j5OXuWmv0yOPt6unY1K3plRGp9viFi\"}",
8 "type": "s3"
9 }
10}
返回结果
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | ok | 成功 | Inline |
返回数据结构
状态码 200
名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
---|---|---|---|---|---|
» code | integer | true | none | none | |
» msg | null | true | none | none | |
» data | object | true | none | none | |
»» id | string | true | none | none | |
»» auth | string | true | none | none | |
»» content | string | true | none | none | |
»» type | string | true | none | none |
创建任务
POST /kmss/openapi/s3/connector/addTask
Body 请求参数
Plain Text
1{
2 "channelId": "CVUJVZLjh8",
3 "bucket": "s3-bucket"
4}
请求参数
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
Accept | header | string | 是 | application/json |
token | header | string | 是 | 55270a992bea3def14684476a77359e7 |
userid | header | string | 是 | 获取方法:登录百度智能云;进入甄知首页,打开浏览器检查,定位到/user/current接口 ![]() ![]() |
accountid | header | string | 是 | 获取方法:登录百度智能云;进入甄知首页,打开浏览器检查,定位到/user/current接口 ![]() ![]() |
username | header | string | 是 | 获取方法:登录百度智能云;进入甄知首页,打开浏览器检查,定位到/user/current接口 ![]() ![]() |
body | body | object | 是 | none |
返回示例
成功
Plain Text
1{
2 "code": 200,
3 "msg": null,
4 "data": {
5 "id": "zIwXGIb6eO",
6 "source": "s3-bucket",
7 "originalTotal": 0,
8 "total": 0,
9 "status": 0,
10 "createTime": 1718983886396,
11 "updateTime": 1718983886396,
12 "channelId": "CVUJVZLjh8",
13 "errMsg": null,
14 "extendsInfo": null,
15 "spaceGuid": null
16 }
17}
返回结果
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | ok | 成功 | Inline |
返回数据结构
状态码 200
名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
---|---|---|---|---|---|
» code | integer | true | none | none | |
» msg | null | true | none | none | |
» data | object | true | none | none | |
»» id | string | true | none | none | |
»» source | string | true | none | none | |
»» originalTotal | integer | true | none | none | |
»» total | integer | true | none | none | |
»» status | integer | true | none | none | |
»» createTime | integer | true | none | none | |
»» updateTime | integer | true | none | none | |
»» channelId | string | true | none | none | |
»» errMsg | null | true | none | none | |
»» extendsInfo | null | true | none | none | |
»» spaceGuid | null | true | none | none |
触发任务
POST /kmss/openapi/s3/connector/triggerTask
请求参数
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
taskId | query | string | 是 | none |
Accept | header | string | 是 | application/json |
token | header | string | 是 | 3417804908247761dca2f2d3732052b6 |
userid | header | string | 是 | 获取方法:登录百度智能云;进入甄知首页,打开浏览器检查,定位到/user/current接口 ![]() ![]() |
accountid | header | string | 是 | 获取方法:登录百度智能云;进入甄知首页,打开浏览器检查,定位到/user/current接口 ![]() ![]() |
username | header | string | 是 | 获取方法:登录百度智能云;进入甄知首页,打开浏览器检查,定位到/user/current接口 ![]() ![]() |
返回示例
成功
Plain Text
1{
2 "code": 200,
3 "msg": null,
4 "data": null
5}
返回结果
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | ok | 成功 | Inline |
返回数据结构
状态码 200
名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
---|---|---|---|---|---|
» code | integer | true | none | none | |
» msg | null | true | none | none | |
» data | null | true | none | none |
获取分组列表
GET /kmss/openapi/s3/connector/listBuckets
请求参数
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
channelId | query | string | 是 | none |
Accept | header | string | 是 | application/json |
token | header | string | 是 | b11b93cf67faa78bcfa04b2cdb66c2fd |
userid | header | string | 是 | 获取方法:登录百度智能云;进入甄知首页,打开浏览器检查,定位到/user/current接口 ![]() ![]() |
accountid | header | string | 是 | 获取方法:登录百度智能云;进入甄知首页,打开浏览器检查,定位到/user/current接口 ![]() ![]() |
username | header | string | 是 | 获取方法:登录百度智能云;进入甄知首页,打开浏览器检查,定位到/user/current接口 ![]() ![]() |
返回示例
成功
Plain Text
1{
2 "code": 200,
3 "msg": null,
4 "data": [
5 {
6 "name": "ruliu",
7 "owner": {
8 "displayName": "admin",
9 "id": "admin"
10 },
11 "creationDate": 1709879235000
12 },
13 {
14 "name": "s3-bucket",
15 "owner": {
16 "displayName": "admin",
17 "id": "admin"
18 },
19 "creationDate": 1717601696000
20 }
21 ]
22}
返回结果
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | ok | 成功 | Inline |
返回数据结构
状态码 200
名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
---|---|---|---|---|---|
» code | integer | true | none | none | |
» msg | null | true | none | none | |
» data | [object] | true | none | none | |
»» name | string | true | none | none | |
»» owner | object | true | none | none | |
»»» displayName | string | true | none | none | |
»»» id | string | true | none | none | |
»» creationDate | string | true | none | none |
任务信息
GET /kmss/openapi/data/connector/taskInfo
请求参数
名称 | 位置 | 类型 | 必选 | 说明 |
---|---|---|---|---|
id | query | string | 是 | 注册任务时返回的任务id |
Accept | header | string | 是 | application/json |
token | header | string | 是 | 5abeb6c1fadcbf0488d0a6e583b3803b |
userid | header | string | 是 | 获取方法:登录百度智能云;进入甄知首页,打开浏览器检查,定位到/user/current接口 ![]() ![]() |
accountid | header | string | 是 | 获取方法:登录百度智能云;进入甄知首页,打开浏览器检查,定位到/user/current接口 ![]() ![]() |
username | header | string | 是 | 获取方法:登录百度智能云;进入甄知首页,打开浏览器检查,定位到/user/current接口 ![]() ![]() |
返回示例
成功
Plain Text
1{
2 "errno": 0,
3 "msg": "success",
4 "data": {
5 "id": "3xxHRPwcCZ",
6 "source": "test01",
7 "originalTotal": 3,
8 "total": 3,
9 "status": 50,
10 "createTime": "2024-06-21 23:43:15",
11 "updateTime": "2024-06-22 00:02:42",
12 "channelId": "RSmaY8sRgj",
13 "type": "confluence",
14 "host": "http://xxx.xx.xxx:8090",
15 "auth": "Basic YWRtaW46emhlbnpoaTAwMUBBYmM=",
16 "spaceGuid": "o6sNkygHVu",
17 "errMsg": null,
18 "extFields": {}
19 }
20}
返回结果
状态码 | 状态码含义 | 说明 | 数据模型 |
---|---|---|---|
200 | ok | 成功 | Inline |
返回数据结构
状态码 200
名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
---|---|---|---|---|---|
» errno | integer | true | none | none | |
» msg | string | true | none | none | |
» data | object | true | none | none | |
»» id | string | true | none | none | |
»» source | string | true | none | none | |
»» originalTotal | integer | true | none | none | |
»» total | integer | true | none | none | |
»» status | integer | true | none | none | |
»» createTime | string | true | none | none | |
»» updateTime | string | true | none | none | |
»» channelId | string | true | none | none | |
»» type | string | true | none | none | |
»» host | string | true | none | none | |
»» auth | string | true | none | none | |
»» spaceGuid | string | true | none | none | |
»» errMsg | null | true | none | none | |
»» extFields | object | true | none | none |