UploadData
上传数据到数据集
用户往数据集中上传数据。
GetPolicy
获取上传凭证
请求路径
GET /v1/datasets/{id}/policies
请求参数
Path
Query
名称 | 类型 | 是否必须 | 描述 |
---|
| | | |
| | | |
| | | |
| | | 令牌过期时间,以秒为单位,不可为负,默认60, 大于300会按照300处理 |
请求示例
curl --location --request GET '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/policies?expired=60&draftNumber=1' \
--header 'x-token: {your_accesskey}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{
"result": {
"OSSAccessKeyId": "OSSACCESSKEYID",
"Signature": "QbkCDeZtX37gb2zoemel3VCxz3k=",
"policy": "eyJjb25kaXRpb25zIjpbWyJzdGFydHMtd2l0aCIsIiRrZXkiLCI4ZjgzNWVlOWNmZWIwZDRlZjBkMmQyODJmOTdlNzM1OS9jOTQ4YTY0NC03NTJjLTRkOTItOTI3Yi1mNjkwYzYyZGM5Y2YvIl1dLCJleHBpcmF0aW9uIjoiMjAyMC0xMS0xM1QwMzozNjo1OVoifQ==",
"success_action_status": "200",
"multipleUploadLimit": 10
},
"extra": {
"backendType": "oss",
"host": "https://content-store-fat-version.oss-cn-qingdao.aliyuncs.com",
"objectPrefix": ""
},
"expireAt": 1605238559
}
根据获取的凭证前端直传
获取的result直接反序列化,进行oss直传即可,extra host是访问地址
请求路径
POST 源自从policy接口获取的result字段"extra"中的"host"
请求参数
body
名称 | 类型 | 是否必须 | 描述 |
---|
| | | 与之前获取的凭证返回值OSSAccessKeyId一致 |
| | | |
| | | |
| | | 之前的获取凭证返回的objectPrefix + 计算文件的cheksum值。用sha1加密算法获取文件checksum值 |
| | | |
请求示例
curl --location --request POST 'https://content-store-version.oss-cn-qingdao.aliyuncs.com' \
--form 'OSSAccessKeyId=OSSACCESSKEYID' \
--form 'Signature=jVbcWO5v4Ujm7duQX+gqb0UBT2E=' \
--form 'policy=eyJjb25kaXRpb25zIjpbWyJzdGFydHMtd2l0aCIsIiRrZXkiLCJlNWEyN2FlOGI3NDM4N2NlMjA4YTI2YjVjMzBjZGI2MS9mNDhjOGY3ZC0xOGVmLTQ2OGEtYjA2ZS0yNzg5MzQ3MDVhNTMvLnNlZ21lbnQvZGF5VGVzdC9kYXlTZXF1ZW5jZTAxLy5zZWdtZW50X2VuZC8iXV0sImV4cGlyYXRpb24iOiIyMDIwLTEyLTE0VDA5OjAwOjI1WiJ9' \
--form 'key={objectPrefix}{checksum}' \
--form 'file=@/{localFile}'
返回结果
# 响应状态
HttpStatus 204
# 响应结果
返回为空
{}
PutCallback
上传完毕回调
请求路径
PUT /v1/datasets/{id}/callback
请求参数
Path
body
名称 | 类型 | 是否必须 | 描述 |
---|
| | | |
| | | 上传的文件的checksum,用sha1加密算法获取文件checksum值 |
| | | |
| | | |
| | | |
| | | 融合类数据上传必传,帧id, ulid格式,参考 https://github.com/oklog/ulid |
| | | |
| | | 该文件的标注标签信息,具体可参考uploadLabel |
| | | |
请求示例
curl --location --request PUT '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/callback' \
--header 'x-token: {your_accesskey}' \
--header 'Content-Type: application/json' \
--data-raw '{
"draftNumber": "1",
"remotePath": "car1.jpg",
"checksum": "b9676b075dff6d3333bbebb7cdd154f3631bb926",
"frameId": "01D78XYFJ1PRM1WPBCBT3VHMNV",
"segmentName": "car",
"sensorName": "camera_car",
"timestamp": 1532402934,
"label":{},
"fileSize": 10
}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{}
MultiPutCallback
上传完毕批量回调
请求路径
PUT /v1/datasets/{id}/multi/callback
请求参数
Path
body
名称 | 类型 | 是否必须 | 描述 |
---|
| | | |
| | | |
| | | |
| | | 上传的文件的checksum,用sha1加密算法获取文件checksum值 |
| | | |
| | | |
| | | 融合类数据上传必传,帧id, ulid格式,参考 https://github.com/oklog/ulid |
| | | |
| | | 该文件的标注标签信息,具体可参考uploadLabel |
| | | |
请求示例
curl --location --request PUT '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/callback' \
--header 'x-token: {your_accesskey}' \
--header 'Content-Type: application/json' \
--data-raw '{
"draftNumber": "1",
"segmentName": "car",
"objects": [
{
"remotePath": "car1.jpg",
"checksum": "b9676b075dff6d3333bbebb7cdd154f3631bb926",
"frameId": "01D78XYFJ1PRM1WPBCBT3VHMNV",
"sensorName": "camera_car",
"timestamp": 1532402934,
"label":{},
"fileSize": 10
}
]
}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{}
CreateSegment
创建segment
POST /v1/datasets/{id}/segments
请求参数
Path
Query
Body
名称 | 类型 | 是否必须 | 描述 |
---|
| | | |
| | | segment 名称, 当不是用已有操作时 不可为null,name中不可包含".","\" |
| | | |
| | | 当不是用已有操作时移动重名时的策略,可选项有:abort,override 和 skip,缺省为 abort |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
请求示例
curl --location --request POST '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/segments'\
--header 'x-token: {your_accesskey}' \
--header 'Content-Type: application/json' \
--data-raw '{
"draftNumber":1,
"name": "graviti",
"description": "this is a segment"
}'
返回结果
# 响应状态
HttpStatus 201
# 响应结果
{}
DeleteSegment
删除Segment
DELETE /v1/datasets/{id}/segments
Path
Body
请求示例
curl --location --request DELETE '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/segments' \
--header 'x-token: {your_accesskey}' \
--header 'Content-Type: application/json' \
--data-raw '{
"draftNumber":1,
"segmentName": "car",
}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{}
ListSegment
获取数据集segment
GET /v1/datasets/{id}/segments
请求参数
Path
Query
名称 | 类型 | 是否必须 | 描述 |
---|
| | | 草稿编号,draft和commit二者必须存在一个,但不可全部存在 |
| | | commit id 或者 commit tag 或者 branch name |
| | | |
| | | |
| | | 排序的字段,默认update_at(更新时间), 目前支持create_at(创建时间)和update_at,传入其他内容会返回InvalidParamsValue |
| | | 默认desc(倒序),合法内容为asc(顺序)和desc |
请求示例
curl --location --request GET '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/segments?commit=v1&offset=0&limit=2'\
--header 'x-token: {your_accesskey}'
返回结果
# 响应状态
HttpStatus 200
{
"segments": [
{
"name": "car",
"description": "this is car"
},
{
"name": "graviti",
"description": "this is a segment"
}
],
"offset": 0,
"recordSize": 2,
"totalCount": 10
}
UploadLabelCatalog
上传labelCatalog
PUT /v1/datasets/{id}/labels/catalogs
请求参数
Path
Body
名称 | 类型 | 是否必须 | 描述 |
---|
| | | |
| | | 标注类型。
key:
CLASSIFICATION: 分类标注
BOX2D: 2D 框标注
BOX3D: 3D 框标注
POLYGON2D: 2D 多边形标注
POLYLINE2D: 2D 折线标注
KEYPOINTS2D: 2D 关键点标注
CUBOID2D: 2D 立体框标注
SENTENCE: 语音转写标注
以上标注类型,每类标注类型都有自己的结构,具体可看示例或参考标签格式,请严格遵循该标注类型格式传值 |
| | | |
| | | 用于分割category父子关系的分割符,缺省为不支持父子关系,推荐分隔符为"." |
| | | |
| | | item 类型: object,category 列表,包含所有 category 信息 |
| | | |
| | | |
| | | |
| | | |
| | | attribute type:string, boolean, integer, number, array, null,例如"interger", ["integer", "null"] |
| | | 属性值最小值,当属性为数字时该字段定义了其最小值(闭区间) |
| | | 属性值最大值,当属性为数字时该字段定义了其最大值(闭区间) |
| | | |
| | | |
| | | 关联类别,表示该属性隶属于哪些类别,为空则表示全局属性 |
| | | item类型,多选属性定义,(当"type"字段为"array"时,表示多选属性) |
| | | 多选属性值类型:string, boolean, integer, number, array, null,例如"interger", ["integer", "null"] |
| | | |
| | | |
| | | |
请求示例
curl --location --request PUT '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/labels/catalogs'\
--header 'x-token: {your_accesskey}' \
--header 'Content-Type: application/json' \
--data-raw '{
"draftNumber": 1,
"BOX2D": {
"attributes": [
{
"description": "attribute 'traffic_light_color' is a multiple choice attribute",
"items": {
"enum": [
"unknown",
"red",
"yellow",
"green"
]
},
"name": "traffic_light_color",
"parentCategories": [
"traffic_light"
],
"type": "array"
},
{
"description": "attribute 'visibility' is a float value between 0 to 1",
"maximum": 1,
"minimum": 0,
"name": "visibility",
"type": "number"
},
{
"description": "this is color",
"enum": [
"red",
"blue",
"green"
],
"name": "color",
"parentCategories": [
"car"
],
"type": "string"
}
],
"categories": [
{
"description": "this is a car",
"name": "car"
}
],
"categoryDelimiter": ".",
"description": "this is a description of label catalog",
"isTracking": false
},
"BOX3D": {
"attributes": [
{
"description": "attribute 'traffic_light_color' is a multiple choice attribute",
"items": {
"enum": [
"unknown",
"red",
"yellow",
"green"
]
},
"name": "traffic_light_color",
"parentCategories": [
"traffic_light"
],
"type": "array"
},
{
"description": "attribute 'visibility' is a float value between 0 to 1",
"maximum": 1,
"minimum": 0,
"name": "visibility",
"type": "number"
},
{
"description": "this is color",
"enum": [
"red",
"blue",
"green"
],
"name": "color",
"parentCategories": [
"car"
],
"type": "string"
}
],
"categories": [
{
"description": "this is a car",
"name": "car"
}
],
"categoryDelimiter": ".",
"description": "this is a description of label catalog",
"isTracking": false
},
"CLASSIFICATION": {
"attributes": [
{
"description": "attribute 'traffic_light_color' is a multiple choice attribute",
"items": {
"enum": [
"unknown",
"red",
"yellow",
"green"
]
},
"name": "traffic_light_color",
"parentCategories": [
"traffic_light"
],
"type": "array"
},
{
"description": "attribute 'visibility' is a float value between 0 to 1",
"maximum": 1,
"minimum": 0,
"name": "visibility",
"type": "number"
},
{
"description": "this is color",
"enum": [
"red",
"blue",
"green"
],
"name": "color",
"parentCategories": [
"car"
],
"type": "string"
}
],
"categories": [
{
"description": "this is a car",
"name": "car"
}
],
"categoryDelimiter": ".",
"description": "this is a description of label catalog"
},
"CUBOID2D": {
"attributes": [
{
"description": "attribute 'traffic_light_color' is a multiple choice attribute",
"items": {
"enum": [
"unknown",
"red",
"yellow",
"green"
]
},
"name": "traffic_light_color",
"parentCategories": [
"traffic_light"
],
"type": "array"
},
{
"description": "attribute 'visibility' is a float value between 0 to 1",
"maximum": 1,
"minimum": 0,
"name": "visibility",
"type": "number"
},
{
"description": "this is color",
"enum": [
"red",
"blue",
"green"
],
"name": "color",
"parentCategories": [
"car"
],
"type": "string"
}
],
"categories": [
{
"description": "this is a car",
"name": "car"
}
],
"categoryDelimiter": ".",
"description": "this is a description of label catalog",
"isTracking": false
},
"KEYPOINTS2D": {
"attributes": [
{
"description": "attribute 'traffic_light_color' is a multiple choice attribute",
"items": {
"enum": [
"unknown",
"red",
"yellow",
"green"
]
},
"name": "traffic_light_color",
"parentCategories": [
"traffic_light"
],
"type": "array"
},
{
"description": "attribute 'visibility' is a float value between 0 to 1",
"maximum": 1,
"minimum": 0,
"name": "visibility",
"type": "number"
},
{
"description": "this is color",
"enum": [
"red",
"blue",
"green"
],
"name": "color",
"parentCategories": [
"car"
],
"type": "string"
}
],
"categories": [
{
"description": "this is a car",
"name": "car"
}
],
"categoryDelimiter": ".",
"description": "this is a description of label catalog",
"isTracking": false,
"keypoints": [
{
"description": "this is key point",
"names": [
"ear",
"leg",
"mouse"
],
"number": 3,
"parentCategories": [],
"skeleton": [
[
0,
1
],
[
1,
2
]
],
"visible": "1"
}
]
},
"POLYGON2D": {
"attributes": [
{
"description": "attribute 'traffic_light_color' is a multiple choice attribute",
"items": {
"enum": [
"unknown",
"red",
"yellow",
"green"
]
},
"name": "traffic_light_color",
"parentCategories": [
"traffic_light"
],
"type": "array"
},
{
"description": "attribute 'visibility' is a float value between 0 to 1",
"maximum": 1,
"minimum": 0,
"name": "visibility",
"type": "number"
},
{
"description": "this is color",
"enum": [
"red",
"blue",
"green"
],
"name": "color",
"parentCategories": [
"car"
],
"type": "string"
}
],
"categories": [
{
"description": "this is a car",
"name": "car"
}
],
"categoryDelimiter": ".",
"description": "this is a description of label catalog",
"isTracking": false
},
"POLYLINE2D": {
"attributes": [
{
"description": "attribute 'traffic_light_color' is a multiple choice attribute",
"items": {
"enum": [
"unknown",
"red",
"yellow",
"green"
]
},
"name": "traffic_light_color",
"parentCategories": [
"traffic_light"
],
"type": "array"
},
{
"description": "attribute 'visibility' is a float value between 0 to 1",
"maximum": 1,
"minimum": 0,
"name": "visibility",
"type": "number"
},
{
"description": "this is color",
"enum": [
"red",
"blue",
"green"
],
"name": "color",
"parentCategories": [
"car"
],
"type": "string"
}
],
"categories": [
{
"description": "this is a car",
"name": "car"
}
],
"categoryDelimiter": ".",
"description": "this is a description of label catalog",
"isTracking": false
},
"SENTENCE": {
"attributes": [
{
"description": "this is a description of attribute",
"enum": [
"red",
"blue",
"green"
],
"items": {
"enum": [
"red",
"blue",
"green"
],
"maximum": 10,
"minimum": 0,
"type": {}
},
"maximum": 10,
"minimum": 0,
"name": "color",
"parentCategories": [],
"type": {}
}
],
"description": "this is a description of label catalog",
"isSample": false,
"lexicon": "[[\"啊\", \"aa\", \"a1\"], [\"阿婆\": \"aa\", \"a1\", \"p\", \"o2\"], [\"爱\", \"aa\", \"ai4\"], [\"爱祖国\",\"aa\", \"ai4\", \"z\", \"u3\", \"g\", \"uo2\"]]",
"sampleRate": 32
}
}'
返回结果
GetLabelCatalog
获取数据集标签目录
GET /v1/datasets/{id}/labels/catalogs
请求参数
Path
Query
名称 | 类型 | 是否必须 | 描述 |
---|
| | | 草稿编号,draft和commit二者必须存在一个,但不可全部存在 |
| | | commit id 或者 commit tag 或者 branch name |
请求示例
curl --location --request GET '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/labels/catalogs?commit=v1'\
--header 'x-token: {your_accesskey}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{
"catalog": {
"BOX2D": {
"attributes": [
{
"name": "color"
}
],
"categories": [
{
"description": "hello",
"name": "car"
}
]
}
}
}
UploadSensor
上传sensor
POST /v1/datasets/{id}/sensors
Path
Body
名称 | 类型 | 是否必须 | 描述 |
---|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | 畸变系数 (p1, p2, k1, k2, k3,还可以有"k4", "k5", "k6"等等,给的越多计算越精确) |
| | | |
| | | |
| | | |
| | | |
| | | |
请求示例
curl --location --request POST '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/sensors' \
--header 'x-token: {your_accesskey}' \
--header 'Content-Type: application/json' \
--data-raw '{
"description": "This is a example camera sensor",
"extrinsics": {
"rotation": {
"w": 0.6924185592174665,
"x": -0.7031619420114925,
"y": -0.11648342771943819,
"z": 0.11203317912370753
},
"translation": {
"x": 1.03569100218,
"y": 0.484795032713,
"z": 1.59097014818
}
},
"intrinsics": {
"cameraMatrix": {
"cx": 1256.7414812095406,
"cy": 492.7757465151356,
"fx": 1256.7414812095406,
"fy": 792.1125740759628,
"skew": 122.7757465151356
},
"distortionCoefficients": {
"k1": 0.12,
"k2": 0.33,
"k3": 0.13,
"k4": 0.93,
"k5": 0.23,
"p1": 1,
"p2": 0.3
}
},
"name": "camera_01",
"segmentName": "car",
"type": "CAMERA"
}'
返回结果
DeleteSensor
删除sensor
DELETE /v1/datasets/{id}/sensors
Path
Body
请求示例
curl --location --request DELETE '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/sensors' \
--header 'x-token: {your_accesskey}' \
--header 'Content-Type: application/json' \
--data-raw '{
"draftNumber": 1,
"segmentName": "car",
"sensorName": "sensor1",
}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{}
ListSensor
获取sensor
GET /v1/datasets/{id}/sensors
Path
Query
名称 | 类型 | 是否必须 | 描述 |
---|
| | | 草稿编号,draft和commit二者必须存在一个,但不可全部存在 |
| | | commit id 或者 commit tag 或者 branch name |
| | | |
请求示例
curl --location --request GET '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/sensors?segmentName=car&commit=v1' \
--header 'x-token: {your_accesskey}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{
"segmentName": "car",
"sensors": [
{
"name": "sensor1",
"type": "camera",
"extrinsics": {
"rotation": {
"w": 1.1,
"x": 1.2,
"y": 1.3,
"z": 1.4
},
"translation": {
"x": 1.2,
"y": 1.3,
"z": 1.4
}
},
"intrinsics": {
"cameraMatrix": {
"cx": 1.1,
"cy": 1.2,
"fx": 1.1,
"fy": 1.2,
"skew": 1.3
},
"distortionCoefficient": {
"k1": 1.4,
"k2": 1.5,
"k3": 1.6,
"k4": 1.7,
"k5": 1.8,
"k6": 1.9,
"p1": 1.2,
"p2": 1.3
}
},
"description": "this is a sensor"
},
{
"name": "sensor2",
"type": "camera",
"extrinsics": {
"rotation": {
"w": 1.1,
"x": 1.2,
"y": 1.3,
"z": 1.4
},
"translation": {
"x": 1.2,
"y": 1.3,
"z": 1.4
}
},
"intrinsics": {
"cameraMatrix": {
"cx": 1.1,
"cy": 1.2,
"fx": 1.1,
"fy": 1.2,
"skew": 1.3
},
"distortionCoefficient": {
"k1": 1.4,
"k2": 1.5,
"k3": 1.6,
"k4": 1.7,
"k5": 1.8,
"k6": 1.9,
"p1": 1.2,
"p2": 1.3
}
},
"description": "this is a sensor"
}
]
}
ListData
获取数据集数据列表
GET /v1/datasets/{id}/data
请求参数
Path
Query
名称 | 类型 | 是否必须 | 描述 |
---|
| | | 草稿编号,draft和commit二者必须存在一个,但不可全部存在 |
| | | commit id 或者 commit tag 或者 branch name |
| | | |
| | | |
| | | |
| | | 排序的字段,默认updated_at(更新时间), 目前支持created_at(创建时间)和updated_at,传入其他内容会返回InvalidParamsValue |
| | | 默认desc(倒序),合法内容为asc(顺序)和desc |
请求示例
curl --location --request GET '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/data?draftNumber=1&segmentName=car'\
--header 'x-token: {your_accesskey}'
返回结果
普通数据集
{
"segmentName": "car",
"type": 0,
"data": [{"remotePath": "car.jpg."}],
"offset": 0,
"recordSize": 1,
"totalCount": 1
}
融合数据集
{
"segmentName": "car",
"type": 1,
"data": [
{
"frameId": "01ARZ3NDEKTSV4RRFFQ69G5FAV",
"frameIndex": 1,
"frame": [
{
"sensorname": "camera_car",
"remotePath": "fusion_data_car3.jpg",
"timestamp":1609430401,
}
]
}
],
"offset": 0,
"recordSize": 1,
"totalCount": 1
}
ListDataDetails
获取数据集数据详情列表
GET /v1/datasets/{id}/data/details
请求参数
Path
Query
名称 | 类型 | 是否必须 | 描述 |
---|
| | | 草稿编号,draft和commit二者必须存在一个,但不可全部存在 |
| | | commit id 或者 commit tag 或者 branch name |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | 排序的字段,默认updated_at(更新时间), 目前支持created_at(创建时间)和updated_at,传入其他内容会返回InvalidParamsValue |
| | | 默认desc(倒序),合法内容为asc(顺序)和desc |
请求示例
curl --location --request GET '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/data/details?draftNumber=1&segmentName=car'\
--header 'x-token: {your_accesskey}'
返回结果
普通数据集
{
"segmentName": "car",
"type": 0,
"dataDetails": [{"remotePath": "car.jpg."}],
"offset": 0,
"recordSize": 1,
"totalCount": 1
}
融合数据集
{
"segmentName": "car",
"type": 1,
"dataDetails": [
{
"frameId": "01ARZ3NDEKTSV4RRFFQ69G5FAV",
"frameIndex": 1,
"frame": [
{
"sensorname": "camera_car",
"remotePath": "fusion_data_car3.jpg",
"timestamp":1609430401,
}
]
}
],
"offset": 0,
"recordSize": 1,
"totalCount": 1
}
ListDataUri
获取数据资源地址
GET /v1/datasets/{id}/data/urls
请求参数
Path
Query
名称 | 类型 | 是否必须 | 描述 |
---|
| | | 草稿编号,draft和commit二者必须存在一个,但不可全部存在 |
| | | commit id 或者 commit tag 或者 branch name |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | 排序的字段,默认按照名字(remotePath)排序, 目前支持created_at(创建时间)和updated_at,传入其他内容会返回InvalidParamsValue |
| | | 默认desc(倒序),合法内容为asc(顺序)和desc |
请求示例
curl --location --request GET '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/data/urls?draftNumber=1&remotePath=graviti.jpg&segmentName=car' \
--header 'x-token: {your_accesskey}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{
"offset": 0,
"recordSize": 5,
"totalCount": 5,
"segmentName": "car",
"urls": [
{
"remotePath": "第二段_00000010.jpg",
"url": "https://content-store-dev-version.oss-cn-qingdao.aliyuncs.com/61457d9174d2367811a2adae3ad94eae%2F63bedc17-8b4f-423f-893c-42b9ceff028e%2F%E7%AC%AC%E4%BA%8C%E6%AE%B5_00000010.jpg?Expires=1611304780&OSSAccessKeyId=OSSACCESSKEYID&Signature=DJbZOXSF1FSBQT4wEv69O%2B3OhyI%3D&versionId=CAEQPRiBgMD1o.mEshciIDk4ZmZkMWM2NmQ5ZTQ1NWRhNTBmZDZjNzJjNjM4OGRl"
},
{
"remotePath": "第二段_00040820.jpg",
"url": "https://content-store-dev-version.oss-cn-qingdao.aliyuncs.com/61457d9174d2367811a2adae3ad94eae%2F63bedc17-8b4f-423f-893c-42b9ceff028e%2F%E7%AC%AC%E4%BA%8C%E6%AE%B5_00040820.jpg?Expires=1611304780&OSSAccessKeyId=OSSACCESSKEYID&Signature=DihdFjHDtE3xEyIx3eGbTmN%2B%2Bzc%3D&versionId=CAEQPRiBgMD_pOmEshciIGFjYjVjY2FjYmZkMzRjYjVhZTQ5ZjQxZWMwMzhkOTMx"
},
{
"remotePath": "第二段_00040890.jpg",
"url": "https://content-store-dev-version.oss-cn-qingdao.aliyuncs.com/61457d9174d2367811a2adae3ad94eae%2F63bedc17-8b4f-423f-893c-42b9ceff028e%2F%E7%AC%AC%E4%BA%8C%E6%AE%B5_00040890.jpg?Expires=1611304780&OSSAccessKeyId=OSSACCESSKEYID&Signature=pwhm9liDx9%2BbDp2VlPghd1Kw0as%3D&versionId=CAEQPRiBgMD0pemEshciIGExZDdlOTBjMmQxMDQxMmFiM2QxMTAzNmU3N2I5ODFk"
},
{
"remotePath": "第二段_00040900.jpg",
"url": "https://content-store-dev-version.oss-cn-qingdao.aliyuncs.com/61457d9174d2367811a2adae3ad94eae%2F63bedc17-8b4f-423f-893c-42b9ceff028e%2F%E7%AC%AC%E4%BA%8C%E6%AE%B5_00040900.jpg?Expires=1611304780&OSSAccessKeyId=OSSACCESSKEYID&Signature=GpvY%2BJqbX7qKA70E7t58bRVn%2FcI%3D&versionId=CAEQPRiBgMC9p.mEshciIGY2YzIzNGZmM2EyZDQwMzZiODc4MzNmMmVlY2E0MTAy"
},
{
"remotePath": "第二段_00040940.jpg",
"url": "https://content-store-dev-version.oss-cn-qingdao.aliyuncs.com/61457d9174d2367811a2adae3ad94eae%2F63bedc17-8b4f-423f-893c-42b9ceff028e%2F%E7%AC%AC%E4%BA%8C%E6%AE%B5_00040940.jpg?Expires=1611304780&OSSAccessKeyId=OSSACCESSKEYID&Signature=TguAbiIM0pjWFse1S0MQRUbMuBg%3D&versionId=CAEQPRiBgIDLqemEshciIGM2YmRkZGJlNmY2OTQ5NmViNTEzMDg0NjFmNjczNmYw"
}
]
}
融合数据集
# 响应状态
HttpStatus 200
# 响应结果
{
"segmentName": "car",
"type": 1,
"data": [
{
"frameId": "01ARZ3NDEKTSV4RRFFQ69G5FAV",
"frameIndex": 1,
"frame": [
{
"sensorname": "camera_car",
"remotePath": "第二段_00000010.jpg",
"url": "https://content-store-dev-version.oss-cn-qingdao.aliyuncs.com/61457d9174d2367811a2adae3ad94eae%2F63bedc17-8b4f-423f-893c-42b9ceff028e%2F%E7%AC%AC%E4%BA%8C%E6%AE%B5_00000010.jpg?Expires=1611304780&OSSAccessKeyId=OSSACCESSKEYID&Signature=DJbZOXSF1FSBQT4wEv69O%2B3OhyI%3D&versionId=CAEQPRiBgMD1o.mEshciIDk4ZmZkMWM2NmQ5ZTQ1NWRhNTBmZDZjNzJjNjM4OGRl"
}
]
}
],
"offset": 0,
"recordSize": 1,
"totalCount": 1
}
ListMaskUrls
获取标注url列表
GET /v1/datasets/{id}/masks/urls
请求参数
Path
Query
名称 | 类型 | 是否必须 | 描述 |
---|
| | | 草稿编号,draft和commit二者必须存在一个,但不可全部存在 |
| | | commit id 或者 commit tag 或者 branch name |
| | | |
| | | |
| | | mask 标注类型,可选项有 "SEMANTIC_MASK", "INSTANCE_MASK" 和 "PANOPTIC_MASK" |
| | | |
| | | |
| | | |
| | | 排序的字段,默认updated_at(更新时间), 目前支持created_at(创建时间)和updated_at,传入其他内容会返回InvalidParamsValue |
| | | 默认desc(倒序),合法内容为asc(顺序)和desc |
请求示例
curl --location --request GET '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/masks/urls?draftNumber=1&segmentName=car&maskType=SEMANTIC_MASK'\
--header 'x-token: {your_accesskey}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{
"offset": 0,
"recordSize": 5,
"totalCount": 5,
"segmentName": "car",
"urls": ["url1","url2"]
}
融合数据集
# 响应状态
HttpStatus 200
# 响应结果
{
"segmentName": "car",
"type": 1,
"data": [
{
"frameId": "01ARZ3NDEKTSV4RRFFQ69G5FAV",
"frameIndex": 1,
"frame": [
{
"sensorname": "camera_car",
"remotePath": "第二段_00000010.jpg",
"url": "https://content-store-dev-version.oss-cn-qingdao.aliyuncs.com/61457d9174d2367811a2adae3ad94eae%2F63bedc17-8b4f-423f-893c-42b9ceff028e%2F%E7%AC%AC%E4%BA%8C%E6%AE%B5_00000010.jpg?Expires=1611304780&OSSAccessKeyId=OSSACCESSKEYID&Signature=DJbZOXSF1FSBQT4wEv69O%2B3OhyI%3D&versionId=CAEQPRiBgMD1o.mEshciIDk4ZmZkMWM2NmQ5ZTQ1NWRhNTBmZDZjNzJjNjM4OGRl"
}
]
}
],
"offset": 0,
"recordSize": 1,
"totalCount": 1
}
GetDataUrls
根据path获取数据资源地址
POST /v1/datasets/{id}/data/urls-by-paths
请求参数
Path
Body
名称 | 类型 | 是否必须 | 描述 |
---|
| | | commit id 或者 commit tag 或者 branch name |
| | | 根据数据分段名分组的数据路径,键为数据分段名,值为数据路径列表 |
请求示例
curl --location --request POST '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/data/urls-by-paths' \
--header 'x-token: {your_accesskey}' \
--header 'Content-Type: application/json' \
--data-raw '{
"commit":"main",
"remotePaths":{
"segment1":["cat.png","dog.png"]
}
}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{
"urls":{
"segment1":{
cat.png":"https://content-store-prod-version.oss-cn-shanghai.aliyuncs.com/d984afcf439bf3d8.jpg"
}
}
}
GetTotalSize
获取所有文件大小
GET /v1/datasets/{id}/total-size
请求参数
Path
Query
名称 | 类型 | 是否必须 | 描述 |
---|
| | | commit id 或者 commit tag 或者 branch name |
请求示例
curl --location --request GET '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/total-size?commit=main' \
--header 'x-token: {your_accesskey}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{
"totalSize":66712051577
}
ListCloudFiles
获取云端文件列表
GET /v1/cloud/{configName}/files
请求参数
Path
Query
请求示例
curl --location --request GET '{service}/v1/cloud/aws1/files'\
--header 'x-token: {your_accesskey}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{
"cloudFiles": ["xxxx","yyyy"],
"truncated": false,
"nextMarker": "zzzz"
}
GetCloudFileUrl
获取云端文件列表
GET /v1/cloud/{configName}/files/urls
请求参数
Path
Query
请求示例
curl --location --request GET '{service}/v1/cloud/aws1/files/urls?filePath=xxx'\
--header 'x-token: {your_accesskey}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{
"url":"example.com/example.jpg"
}
CloudCallback
获取云端文件列表
PUT /v1/datasets/{id}/multi/cloud-callback
请求参数
Path
Body
名称 | 类型 | 是否必须 | 描述 |
---|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | 融合数据帧 ID, ulid 格式,参考 https://github.com/oklog/ulid, 融合类数据上传必传 |
| | | 该文件的标注标签信息,具体可参考uploadLabel |
请求示例
curl --location --request PUT '{service}/v1/datasets/4a9e62ea88fd47b9b4b5f6bbbfe8ef64/multi/cloud-callback'\
--header 'x-token: {your_accesskey}' \
--header 'Content-Type: application/json' \
--data-raw '{
"segmentName": "car",
"draftNumber": 1,
"objects":[
{
"label": {
"BOX2D": [
{
"attributes": {
"color": "blue"
},
"box2d": {
"xmax": 10,
"xmin": 1,
"ymax": 18,
"ymin": 6
},
"category": "car",
"instance": "400a7ec7faa643e38e7ab220463bc4b5"
}
],
"BOX3D": [
{
"attributes": {
"color": "blue"
},
"box3d": {
"rotation": {
"w": 1,
"x": 1.1,
"y": 1.2,
"z": 1.3
},
"size": {
"x": 1.1,
"y": 1.2,
"z": 1.3
},
"translation": {
"x": 1.1,
"y": 1.2,
"z": 1.3
}
},
"category": "car",
"instance": "400a7ec7faa643e38e7ab220463bc4b5"
}
],
"CLASSIFICATION": {
"attributes": {
"color": "blue"
},
"category": "car"
},
"CUBOID2D": [
{
"attributes": {
"color": "blue"
},
"category": "car",
"cuboid2d": {
"back": [
{
"x": 1,
"y": 2
},
{
"x": 1.1,
"y": 2.1
},
{
"x": 1.2,
"y": 2.2
},
{
"x": 1.3,
"y": 2.3
}
],
"front": [
{
"x": 1,
"y": 2
},
{
"x": 1.1,
"y": 2.1
},
{
"x": 1.2,
"y": 2.2
},
{
"x": 1.3,
"y": 2.3
}
]
},
"instance": "400a7ec7faa643e38e7ab220463bc4b5"
}
],
"KEYPOINTS2D": [
{
"attributes": {
"color": "blue"
},
"category": "car",
"instance": "400a7ec7faa643e38e7ab220463bc4b5",
"keypoints2d": [
{
"v": 1.3,
"x": 1.1,
"y": 1.2
}
]
}
],
"POLYGON2D": [
{
"attributes": {
"color": "blue"
},
"category": "car",
"instance": "400a7ec7faa643e38e7ab220463bc4b5",
"polygon2d": [
{
"x": 1.1,
"y": 1.2
}
]
}
],
"POLYLINE2D": [
{
"attributes": {
"color": "blue"
},
"category": "car",
"instance": "400a7ec7faa643e38e7ab220463bc4b5",
"polyline2d": [
{
"x": 1.1,
"y": 1.2
}
]
}
],
"SENTENCE": [
{
"attributes": {
"color": "blue"
},
"category": "car",
"instance": "400a7ec7faa643e38e7ab220463bc4b5",
"phone": [
{
"begin": "b",
"end": "e",
"text": "hello"
}
],
"sentence": [
{
"begin": "b",
"end": "e",
"text": "hello"
}
],
"spell": [
{
"begin": "b",
"end": "e",
"text": "hello"
}
]
}
]
}
}
]
}
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{}
UploadLabel
上传标签
PUT /v1/datasets/{id}/labels
请求参数
Path
Body
名称 | 类型 | 是否必须 | 描述 |
---|
| | | |
| | | |
| | | |
| | | 标签。
key:
CLASSIFICATION: 分类标注
BOX2D: 2D 框标注
BOX3D: 3D 框标注
POLYGON2D: 2D 多边形标注
POLYLINE2D: 2D 折线标注
KEYPOINTS2D: 2D 关键点标注
CUBOID2D: 2D 立体框标注
SENTENCE: 语音转写标注
每种key对应的value格式内容请参考请求示例,请严格按照对应格式传递参数 |
请求示例
curl --location --request PUT '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/labels' \
--header 'x-token: {your_accesskey}' \
--header 'Content-Type: application/json' \
--data-raw '{
"remotePath": "car1.jpg",
"segmentName": "car",
"draftNumber": 1,
"label": {
"BOX2D": [
{
"attributes": {
"color": "blue"
},
"box2d": {
"xmax": 10,
"xmin": 1,
"ymax": 18,
"ymin": 6
},
"category": "car",
"instance": "400a7ec7faa643e38e7ab220463bc4b5"
}
],
"BOX3D": [
{
"attributes": {
"color": "blue"
},
"box3d": {
"rotation": {
"w": 1,
"x": 1.1,
"y": 1.2,
"z": 1.3
},
"size": {
"x": 1.1,
"y": 1.2,
"z": 1.3
},
"translation": {
"x": 1.1,
"y": 1.2,
"z": 1.3
}
},
"category": "car",
"instance": "400a7ec7faa643e38e7ab220463bc4b5"
}
],
"CLASSIFICATION": {
"attributes": {
"color": "blue"
},
"category": "car"
},
"CUBOID2D": [
{
"attributes": {
"color": "blue"
},
"category": "car",
"cuboid2d": {
"back": [
{
"x": 1,
"y": 2
},
{
"x": 1.1,
"y": 2.1
},
{
"x": 1.2,
"y": 2.2
},
{
"x": 1.3,
"y": 2.3
}
],
"front": [
{
"x": 1,
"y": 2
},
{
"x": 1.1,
"y": 2.1
},
{
"x": 1.2,
"y": 2.2
},
{
"x": 1.3,
"y": 2.3
}
]
},
"instance": "400a7ec7faa643e38e7ab220463bc4b5"
}
],
"KEYPOINTS2D": [
{
"attributes": {
"color": "blue"
},
"category": "car",
"instance": "400a7ec7faa643e38e7ab220463bc4b5",
"keypoints2d": [
{
"v": 1.3,
"x": 1.1,
"y": 1.2
}
]
}
],
"POLYGON2D": [
{
"attributes": {
"color": "blue"
},
"category": "car",
"instance": "400a7ec7faa643e38e7ab220463bc4b5",
"polygon2d": [
{
"x": 1.1,
"y": 1.2
}
]
}
],
"POLYLINE2D": [
{
"attributes": {
"color": "blue"
},
"category": "car",
"instance": "400a7ec7faa643e38e7ab220463bc4b5",
"polyline2d": [
{
"x": 1.1,
"y": 1.2
}
]
}
],
"SENTENCE": [
{
"attributes": {
"color": "blue"
},
"category": "car",
"instance": "400a7ec7faa643e38e7ab220463bc4b5",
"phone": [
{
"begin": "b",
"end": "e",
"text": "hello"
}
],
"sentence": [
{
"begin": "b",
"end": "e",
"text": "hello"
}
],
"spell": [
{
"begin": "b",
"end": "e",
"text": "hello"
}
]
}
]
}
}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{}
ListLabel
获取数据集标签
GET /v1/datasets/{id}/labels
请求参数
Path
Query
名称 | 类型 | 是否必须 | 描述 |
---|
| | | 草稿编号,draft和commit二者必须存在一个,但不可全部存在 |
| | | commit id 或者 commit tag 或者 branch name |
| | | |
| | | |
| | | |
| | | |
| | | 排序的字段,默认updated_at(更新时间), 目前支持created_at(创建时间)和updated_at,传入其他内容会返回InvalidParamsValue |
| | | 默认desc(倒序),合法内容为asc(顺序)和desc |
请求示例
curl --location --request GET '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/labels?draftNumber=1&offset=0&limit=1&segmentName=car'\
--header 'x-token: {your_accesskey}'
返回结果 普通数据集
# 响应状态
HttpStatus 200
{
"segmentName": "car",
"type": 0,
"labels": [
{
"remotePath": "data_car.jpg",
"label": {
}
}
],
"offset": 0,
"recordSize": 1,
"totalCount": 1
}
融合数据集
# 响应状态
HttpStatus 200
{
"segmentName": "car"
"type": 1,
"labels": [
{
"frameId": "01ARZ3NDEKTSV4RRFFQ69G5FAV",
"order": 1,
"frame": [
{
"sensorName": "camera_car",
"remotePath": "fusion_data_car2.jpg",
"timestamp":1609430400,
"label": {
}
},
{
"sensorname": "camera_car",
"remotePath": "fusion_data_car3.jpg",
"timestamp":1609430401,
"label": {
}
}
]
}
],
"offset": 0,
"recordSize": 1,
"totalCount": 1
}
MultiUploadLabel
批量上传标签
PUT /v1/datasets/{id}/multi/data/labels
请求参数
Path
Body
名称 | 类型 | 是否必须 | 描述 |
---|
| | | |
| | | |
| | | |
| | | |
| | | 该文件的标注标签信息,具体可参考uploadLabel |
请求示例
curl --location --request PUT '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/multi/data/labels' \
--header 'x-token: {your_accesskey}' \
--header 'Content-Type: application/json' \
--data-raw '{
"segmentName": "car",
"draftNumber": 1,
"objects":[
{
"remotePath": "car1.jpg",
"label": {
"BOX2D": [
{
"attributes": {
"color": "blue"
},
"box2d": {
"xmax": 10,
"xmin": 1,
"ymax": 18,
"ymin": 6
},
"category": "car",
"instance": "400a7ec7faa643e38e7ab220463bc4b5"
}
],
"BOX3D": [
{
"attributes": {
"color": "blue"
},
"box3d": {
"rotation": {
"w": 1,
"x": 1.1,
"y": 1.2,
"z": 1.3
},
"size": {
"x": 1.1,
"y": 1.2,
"z": 1.3
},
"translation": {
"x": 1.1,
"y": 1.2,
"z": 1.3
}
},
"category": "car",
"instance": "400a7ec7faa643e38e7ab220463bc4b5"
}
],
"CLASSIFICATION": {
"attributes": {
"color": "blue"
},
"category": "car"
},
"CUBOID2D": [
{
"attributes": {
"color": "blue"
},
"category": "car",
"cuboid2d": {
"back": [
{
"x": 1,
"y": 2
},
{
"x": 1.1,
"y": 2.1
},
{
"x": 1.2,
"y": 2.2
},
{
"x": 1.3,
"y": 2.3
}
],
"front": [
{
"x": 1,
"y": 2
},
{
"x": 1.1,
"y": 2.1
},
{
"x": 1.2,
"y": 2.2
},
{
"x": 1.3,
"y": 2.3
}
]
},
"instance": "400a7ec7faa643e38e7ab220463bc4b5"
}
],
"KEYPOINTS2D": [
{
"attributes": {
"color": "blue"
},
"category": "car",
"instance": "400a7ec7faa643e38e7ab220463bc4b5",
"keypoints2d": [
{
"v": 1.3,
"x": 1.1,
"y": 1.2
}
]
}
],
"POLYGON2D": [
{
"attributes": {
"color": "blue"
},
"category": "car",
"instance": "400a7ec7faa643e38e7ab220463bc4b5",
"polygon2d": [
{
"x": 1.1,
"y": 1.2
}
]
}
],
"POLYLINE2D": [
{
"attributes": {
"color": "blue"
},
"category": "car",
"instance": "400a7ec7faa643e38e7ab220463bc4b5",
"polyline2d": [
{
"x": 1.1,
"y": 1.2
}
]
}
],
"SENTENCE": [
{
"attributes": {
"color": "blue"
},
"category": "car",
"instance": "400a7ec7faa643e38e7ab220463bc4b5",
"phone": [
{
"begin": "b",
"end": "e",
"text": "hello"
}
],
"sentence": [
{
"begin": "b",
"end": "e",
"text": "hello"
}
],
"spell": [
{
"begin": "b",
"end": "e",
"text": "hello"
}
]
}
]
}
}
]
}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{}
GetLabelStatistics
获取数据集标签数据
GET /v1/datasets/{id}/labels/statistics
请求参数
Path
Query
名称 | 类型 | 是否必须 | 描述 |
---|
| | | 草稿编号,draft和commit二者必须存在一个,但不可全部存在 |
| | | commit id 或者 commit tag 或者 branch name |
请求示例
curl --location --request GET '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/labels/statistics?commit=v1'\
--header 'x-token: {your_accesskey}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{
"labelStatistics": {
"CLASSIFICATION":{
"attributes":null,
"categories":[
{
"attributes":null,
"name":"0",
"quantity":6903
}
],
"quantity":69999
}
}
}
ConvertLabelFromAli
从阿里转换标签数据
POST /v1/datasets/{id}/convert-labels
请求参数
Path
Body
请求示例
curl --location --request POST '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/convert-labels'\
--header 'x-token: {your_accesskey}' \
--header 'Content-Type: application/json' \
--data-raw '{
"commit": "ajhfk2hjk3h89u3i',
"labelUrl": "https://abc.xyz/ajdfls"
}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{
"taskId":"6d3a420485984e37abd10436fc4c41de"
}
DeleteData
删除data
DELETE /v1/datasets/{id}/data
Path
Body
请求示例
curl --location --request DELETE '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/segments' \
--header 'x-token: {your_accesskey}' \
--header 'Content-Type: application/json' \
--data-raw '{
"draftNumber": 1,
"segmentName": "test",
"remotePath": "car1.jpg"
}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{}
OperateData
操作data
POST /v1/datasets/{id}/data
Path
Query
Body
名称 | 类型 | 是否必须 | 描述 |
---|
| | | |
| | | |
| | | 移动重名时的策略,可选项有:abort,override 和 skip,缺省为 abort |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
请求示例
curl --location --request POST '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/data?copy=true' \
--header 'x-token: {your_accesskey}' \
--header 'Content-Type: application/json' \
--data-raw '{
"draftNumber": 1,
"segmentName": "test",
"remotePath": "car1.jpg",
"source":{
"remotePath": "carold.jpg",
"draftNumber": 1,
"segmentName": "test",
"remotePath": "car1.jpg",
"id": "154e35bae8954f09969ef8c9445efd2c"
}
}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{}
DeleteFrame
删除frame
DELETE /v1/datasets/{id}/frames
Path
Body
请求示例
curl --location --request DELETE '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/frames' \
--header 'x-token: {your_accesskey}' \
--header 'Content-Type: application/json' \
--data-raw '{
"draftNumber": 1,
"segmentName": "test",
"frameId": "00000009RGDGYHFNXRR8QF2DHJ"
}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{}
GetDiff
获取两版本差异
GET /v1/datasets/{id}/diffs/{baseHead}
请求参数
Path
名称 | 是否必须 | 描述 |
---|
| | |
| | 格式为 commit-commitId/draft-draftNumber...commit-commitId/draft-draftNumber,
后者没传默认找父提交,目前只需要支持与父提交的比较 |
请求示例
curl --location --request GET '{service}/v1/datasets/11df9efe26644d0d99c566325779b415/diffs/draft-1' \
--header 'x-token: {your_accesskey}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{
"action":"",
"segments":{
"stats":{
"total":1,
"additions":0,
"deletions":0,
"modifications":1
}
},
"notes":{
"action":""
},
"catalog":{
"action":""
},
"data":{
"stats":{
"total":13,
"additions":0,
"deletions":13,
"modifications":0
}
}
}
ListSegmentDiffs
获取两版本segment差异列表
GET /v1/datasets/{id}/diffs/{baseHead}/segments
请求参数
Path
名称 | 是否必须 | 描述 |
---|
| | |
| | 格式为 commit-commitId/draft-draftNumber...commit-commitId/draft-draftNumber,
后者没传默认找父提交,目前只需要支持与父提交的比较 |
Query
请求示例
curl --location --request GET '{service}/v1/datasets/11df9efe26644d0d99c566325779b415/diffs/draft-1/segments' \
--header 'x-token: {your_accesskey}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{
"segments":[
{
"name":"v1.0-mini_scene-0061",
"action":"modify",
"data":{
"stats":{
"total":13,
"additions":0,
"deletions":13,
"modifications":0
}
},
"sensor":{
"action":""
}
}
],
"offset":0,
"recordSize":1,
"totalCount":1
}
GetSegmentDiff
获取两版本segment差异
GET /v1/datasets/{id}/diffs/{baseHead}/segments/{segmentName}
请求参数
Path
名称 | 是否必须 | 描述 |
---|
| | |
| | 格式为 commit-commitId/draft-draftNumber...commit-commitId/draft-draftNumber,
后者没传默认找父提交,目前只需要支持与父提交的比较 |
| | |
请求示例
curl --location --request GET '{service}/v1/datasets/11df9efe26644d0d99c566325779b415/diffs/draft-1/segments/v1.0-mini_scene-0061' \
--header 'x-token: {your_accesskey}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{
"name":"v1.0-mini_scene-0061",
"action":"modified",
"data":{
"stats":{
"total":13,
"additions":0,
"deletions":13,
"modifications":0
}
},
"sensor":{
"action":""
}
}
ListDataDiffs
获取两版本数据差异
GET /v1/datasets/{id}/diffs/{baseHead}/segments/{segmentName}/data
请求参数
Path
名称 | 是否必须 | 描述 |
---|
| | |
| | 格式为 commit-commitId/draft-draftNumber...commit-commitId/draft-draftNumber,
后者没传默认找父提交,目前只需要支持与父提交的比较 |
| | |
Query
请求示例
curl --location --request GET '{service}/v1/datasets/11df9efe26644d0d99c566325779b415/diffs/draft-1/segments/v1.0-mini_scene-0061/data' \
--header 'x-token: {your_accesskey}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{
"data":[
{
"remotePath":"n015-2018-07-24-11-22-45+0800__CAM_BACK_LEFT__1532402927647423.jpg",
"action":"delete",
"file":{
"action":"delete"
},
"label":{
"action":"unmodify"
}
}
],
"offset":0,
"recordSize":13,
"totalCount":13
}