ListAuthStorageConfig
获取授权配置列表
获取授权配置的列表
请求路径
GET /v1/auth-storage-configs
请求参数
Query
请求示例
curl --location --request GET '{service}/v1/auth-storage-configs?name=aws_1&limit=1&offset=0' \
--header 'x-token: {your_accesskey}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{
"configs": [
{
"name": "aws_1",
"type": "s3",
"endpoint": "s3.cn-northwest-1.amazonaws.com.cn",
"accesskeyId": "AKIKU7KYZCWGOTEV5GNE",
"bucketName": "graviti-210415"
}
],
"offset": 0,
"recordSize": 1,
"totalCount": 1
}
ListStorageConfigs
获取配置列表
请求路径
GET /v1/storage-configs
请求参数
Query
请求示例
curl --location --request GET '{service}/v1/storage-configs?limit=1&offset=0' \
--header 'x-token: {your_accesskey}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{
"configs":[
{
"name":"AliCloud-oss-cn-shanghai",
"filePath":"",
"type":"oss",
"isGravitiStorage":true
}
],
"offset":0,
"recordSize":1,
"totalCount":1
}
CreateStorageConfigOSS
创建OSS存储配置
请求路径
POST /v1/storage-configs/oss
请求参数
Body
请求示例
curl --location --request POST '{service}/v1/storage-configs/oss' \
--header 'x-token: {your_accesskey}' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "configName",
"filePath": "car",
"accesskeyId": "AFIAU57BYHCWGOTEAV9GNE",
"accesskeySecret": "secret",
"endpoint": "oss-sn-hangzhou.aliyuncs.com",
"bucketName": "testBucket"
}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{}
CreateStorageConfigS3
创建S3存储配置
请求路径
POST /v1/storage-configs/s3
请求参数
Body
请求示例
curl --location --request POST '{service}/v1/storage-configs/s3' \
--header 'x-token: {your_accesskey}' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "configName",
"filePath": "car",
"accesskeyId": "AFIAU57BYHCWGOTEAV9GNE",
"accesskeySecret": "secret",
"endpoint": "s3-sn-hangzhou.aliyuncs.com",
"bucketName": "testBucket"
}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{}
CreateStorageConfigAzure
创建Azure存储配置
请求路径
POST /v1/storage-configs/azure
请求参数
Body
请求示例
curl --location --request POST '{service}/v1/storage-configs/azure' \
--header 'x-token: {your_accesskey}' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "configName",
"filePath": "car",
"accesskeyId": "AFIAU57BYHCWGOTEAV9GNE",
"accesskeySecret": "secret",
"containerName": "test_container",
"accountType": "Azure_china"
}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{}
CreateStorageConfigLocalFs
创建本地文件系统存储配置
请求路径
POST /v1/storage-configs/local
请求参数
Body
请求示例
curl --location --request POST '{service}/v1/storage-configs/local' \
--header 'x-token: {your_accesskey}' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "configName",
"filePath": "car",
"endpoint": "192.168.1.1:8888"
}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{}
DeleteStorageConfig
删除storage config
DELETE /v1/storage-configs/{name}
Path
请求示例
curl --location --request DELETE '{service}/v1/storage-configs/configName' \
--header 'x-token: {your_accesskey}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{}
CreateDataset
创建数据集
创建tensorbay数据集,默认支持版本管理,数据集名称不可重复
请求路径
POST /v1/datasets
请求参数
Body
请求示例
curl --location --request POST '{service}/v1/datasets' \
--header 'x-token: {your_accesskey}' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "my first dataset",
"alias": "dataset alias",
"type": 0,
"configName": "example config name",
"isPublic": true
}'
返回结果
# 响应状态
HttpStatus 201
# 响应结果
{
"id": "154e35bae8954f09969ef8c9445efd2c"
}
DeleteDataset
删除dataset
DELETE /v1/datasets/{id}
Path
请求示例
curl --location --request DELETE '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c' \
--header 'x-token: {your_accesskey}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{}
UpdateDataset
更新dataset信息
PATCH /v1/datasets/{id}
Path
Body
数据集是否公开,true 对应公开, false 对应私有
请求示例
curl --location --request PATCH '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c' \
--header 'x-token: {your_accesskey}'\
--header 'Content-Type: application/json' \
--data-raw '{
"name": "my dataset",
"alias": "datasetAlias",
"isPublic": false,
"defaultBranch": "main"
}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{}
ListDataset
获取数据集列表
返回用户拥有的数据集列表:
请求路径
GET /v1/datasets
请求参数
Query
默认false 若为true,则支持数据集名称模糊搜索
默认false,当用户为团队用户且该值为true,则返回整个团队的数据集
排序的字段,默认updated_at(更新时间), 目前支持created_at(创建时间)和updated_at,传入其他内容会返回InvalidParamsValue
默认desc(倒序),合法内容为asc(顺序)和desc
请求示例
curl --location --request GET '{service}/v1/datasets?offset=0&limit=10'\
--header 'x-token: {your_accesskey}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{
"datasets": [
{
"id": "154e35bae8954f09969ef8c9445efd2c",
"name": "my-great-data-set",
"alias": "dataset alias",
"defaultBranch": "main",
"type": 0,
"updateTime": 1604977282,
"owner": "",
"commitId": "00000000000000000000000000000000",
"coverUrl": "https://example.com/image.jpg",
"dataSize": 100,
"dataCount": 10,
"tabs": {
"labelType": [{
"id":"06181d4e05484c1fa011f585a9e255cf",
"name":"BOX2D"
}
]
}
}
],
"offset": 0,
"recordSize": 1,
"totalCount": 1
}
datasets: 数据集列表
type: 数据集类型,0-普通数据集,1-融合数据集
dataCount: 默认分支上最新提交的数据数量
GetDataset
请求路径
GET /v1/datasets/{id}
请求参数
PATH
请求示例
curl --location --request GET '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c'\
--header 'x-token: {your_accesskey}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{
"name": "my-great-data-set",
"alias": "dataset alias",
"coverUrl": "https://example.com/image.jpg",
"type": 1,
"defaultBranch": "main",
"commitId": "00000000000000000000000000000000",
"updateTime": 1604977282,
"owner": "",
"isPublic": false,
"configName": "exampleConfigName"
}
CreateBranch
创建branch
创建数据集新branch
请求路径
POST /v1/datasets/{id}/branches
请求参数 Path
Body
从哪个commit切出branch, commit 可为 commit id, commit tag 或者 branch name
请求示例
curl --location --request POST '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/branches' \
--header 'x-token: {your_accesskey}' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": main2,
"commit": "fde63f357daf46088639e9f57fd81cad"
}'
返回结果
# 响应状态
HttpStatus 201
# 响应结果
{}
DeleteBranch
删除branch
删除数据集branch
请求路径
DELETE /v1/datasets/{id}/branches
请求参数 Path
Body
请求示例
curl --location --request DELETE '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/branches' \
--header 'x-token: {your_accesskey}' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": main2
}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{}
ListBranches
获取branch列表
获取数据集的branch列表
请求路径
GET /v1/datasets/{id}/branches
请求参数 Path
Query
请求示例
curl --location --request GET '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/branches?limit=1&offset=0' \
--header 'x-token: {your_accesskey}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{
"branches": [
{
"name": "main",
"commitId": "fde63f357daf46088639e9f57fd81cad",
"parentCommitId": "f68b1375454f459b8a486b8d1f4d9ddb",
"title": "first commit",
"description": "desc",
"committer": {
"name": "graviti",
"date": 1616579313
}
}
],
"offset": 0,
"recordSize": 1,
"totalCount": 1
}
CreateDraft
创建数据集草稿
创建tensorbay数据集草稿, 目前仅支持一个分支上创建一个数据集草稿
请求路径
POST /v1/datasets/{id}/drafts
请求参数
Path
Body
请求示例
curl --location --request POST '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/drafts' \
--header 'x-token: {your_accesskey}' \
--header 'Content-Type: application/json' \
--data-raw '{
"title": "my first draft",
"branchName": "main"
}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{
"draftNumber": 1
}
UpdateDraft
更新数据集草稿
请求路径
PATCH /v1/datasets/{id}/drafts/{draftNumber}
请求参数
Path
Body
请求示例
curl --location --request POST '{service}/v1/datasets/11df9efe26644d0d99c566325779b415/drafts/1' \
--header 'x-token: {your_accesskey}' \
--header 'Content-Type: application/json' \
--data-raw '{
"title": "my first draft",
"description": "desc change",
"status": "OPEN"
}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{}
ListDraft
获取数据集草稿列表
获取数据集的草稿列表
请求路径
GET /v1/datasets/{id}/drafts
请求参数
Path
Query
基于状态进行筛选,支持 "OPEN", "COMMITTED", "CLOSED" 和 "ALL",默认为"OPEN"
请求示例
curl --location --request GET '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/drafts?limit=1&offset=0' \
--header 'x-token: {your_accesskey}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{
"drafts": [
{
"branchName": "main",
"title": "my first draft",
"number": 1,
"description": "desc",
"status": "OPEN",
"parentCommitId": "00000000000000000000000000000000",
"author": "aaa",
"updateAt": 1616579313
}
],
"offset": 0,
"recordSize": 1,
"totalCount": 10
}
CommitDataset
提交数据集
将待提交状态的数据集更新为已提交状态,数据集一旦发布之后,该数据集不可再修改。
请求路径
POST /v1/datasets/{id}/commits
请求参数
Path
Body
请求示例
curl --location --request POST '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c'\
--header 'x-token: {your_accesskey}'\
--header 'Content-Type: application/json' \
--data-raw '{
"draftNumber": "1",
"title": "checkout a new version dataset",
"description": "some desc",
"tag": "v1.0"
}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{
"commitId": "fde63f357daf46088639e9f57fd81cad"
}
ListCommit
获取commit列表
获取数据集的commit列表
请求路径
GET /v1/datasets/{id}/commits
请求参数 Path
Query
commit id 或者 commit tag 或者 branch name, 缺省为默认branch
请求示例
curl --location --request GET '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/commits?commit=main&limit=1&offset=0' \
--header 'x-token: {your_accesskey}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{
"commits": [
{
"parentCommitId": "0d213a06a85d46fa8662946bdb1afe7e",
"commitId": "fde63f357daf46088639e9f57fd81cad",
"title": "checkout a new version dataset",
"description": "some desc",
"dataCount": 10,
"committer": {
"date": 1617268600,
"name": "graviti"
}
}
],
"offset": 0,
"recordSize": 1,
"totalCount": 10
}
CreateTag
创建tag
创建tag
请求路径
POST /v1/datasets/{id}/tags
请求参数 Path
Body
commit id 或者 commit tag 或者 branch name
请求示例
curl --location --request POST '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/tags' \
--header 'x-token: {your_accesskey}' \
--header 'Content-Type: application/json' \
--data-raw '{
"commit": "fde63f357daf46088639e9f57fd81cad",
"name": "v1"
}'
返回结果
# 响应状态
HttpStatus 201
# 响应结果
{}
DeleteTag
删除tag
删除tag
请求路径
DELETE /v1/datasets/{id}/tags
请求参数 Path
Body
请求示例
curl --location --request DELETE '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/tags' \
--header 'x-token: {your_accesskey}' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "v1"
}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{}
ListTag
获取tag
获取数据集的tag列表
请求路径
GET /v1/datasets/{id}/tags
请求参数 Path
Query
请求示例
curl --location --request GET '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/tags?name=v1&limit=1&offset=0' \
--header 'x-token: {your_accesskey}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{
"tags": [
{
"name": "v1",
"commitId": "fde63f357daf46088639e9f57fd81cad",
"parentCommitId": "f68b1375454f459b8a486b8d1f4d9ddb",
"title": "first commit",
"description": "some desc",
"committer": {
"name": "graviti",
"date": 1617268600
}
}
],
"offset": 0,
"recordSize": 1,
"totalCount": 1
}
UpdateNote
更新数据集notes 更新数据集note 请求路径
PATCH /v1/datasets/{id}/notes
请求参数 Path
Body
请求示例
curl --location --request PATCH '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/notes' \
--header 'x-token: {your_accesskey}' \
--header 'Content-Type: application/json' \
--data-raw '{
"draftNumber": 1,
"fileFormat": {
"draftNumber": 1,
"binPointCloudFields": [
"X",
"Y",
"Z",
"Intensity"
],
"isContinuous": true
}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{}
GetNote
获取note
获取数据集的note
请求路径
GET /v1/datasets/{id}/notes
请求参数 Path
Query
草稿编号,draft和commit二者必须存在一个,但不可全部存在
当commit不为空且正确时,查询该commit的data数据
请求示例
curl --location --request GET '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/notes?draftNumber=1' \
--header 'x-token: {your_accesskey}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{
"isContinuous": true,
"binPointCloudFields": [
"X",
"Y",
"Z",
"Intensity"
]
}
GetUser
获取用户信息
请求路径
GET /v1/users
请求示例
curl --location --request GET '{service}/v1/users' \
--header 'x-token: {your_accesskey}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{
"id":"f74836a28f2051d97d60944c48b766d1",
"nickname":"Graviti",
"email":null,
"mobile":"1234567890",
"description":"",
"team":{
"id":"xxx",
"name":"teamName",
"email":"team email",
"description":"team desc"
}
}
ListBenchmarks
获取benchmark列表
请求路径
GET /v1/benchmarks
请求参数
Query
请求示例
curl --location --request GET '{service}/v1/benchmarks' \
--header 'x-token: {your_accesskey}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{
"benchmarks":[
{
"name":"test",
"benchmarkId":"675284b0926b4b96a725ef3fed77d0aa"
}
],
"offset":0,
"recordSize":1,
"totalCount":1
}
CreateEvaluation
创建评估
请求路径
POST /v1/benchmarks/{benchmarkId}/evaluations
请求参数
Path
Body
请求示例
curl --location --request POST '{service}/v1/benchmarks/675284b0926b4b96a725ef3fed77d0aa/evaluations' \
--header 'x-token: {your_accesskey}' \
--header 'Content-Type: application/json' \
--data-raw '{
"datasetId": "11df9efe26644d0d99c566325779b415",
"commitId": "ce3be905ba0f465c84c9fc39e53a89f8"
}'
返回结果
# 响应状态
HttpStatus 201
# 响应结果
{
"evaluationId": "154e35bae8954f09969ef8c9445efd2c"
}
ListEvaluations
获取评估列表
请求路径
GET /v1/benchmarks/{benchmarkId}/evaluations
请求参数
Path
Query
请求示例
curl --location --request GET '{service}/v1/benchmarks/675284b0926b4b96a725ef3fed77d0aa/evaluations' \
--header 'x-token: {your_accesskey}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{
"evaluations":[
{
"name":"",
"evaluationId":"aa50f8a172bc4064abab4d98a1283080",
"number":0,
"createdAt":1647353362,
"finishedAt":null,
"author":"Graviti",
"status":"failed"
}
],
"offset":0,
"recordSize":1,
"totalCount":1
}
GetEvaluationResult
获取评估结果
请求路径
GET /v1/benchmarks/{benchmarkId}/evaluations/{evaluationId}/results
请求参数
Path
请求示例
curl --location --request GET '{service}/v1/benchmarks/675284b0926b4b96a725ef3fed77d0aa/evaluations/aa50f8a172bc4064abab4d98a1283080/results' \
--header 'x-token: {your_accesskey}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{
"result":{
"categories":{
},
"overall":{
}
}
}
CreateOrder
创建订单(团队账户可用)
请求路径
POST /v1/orders
请求参数
Body
请求示例
curl --location --request POST '{service}/v1/orders' \
--header 'x-token: {your_accesskey}' \
--header 'Content-Type: application/json' \
--data-raw '{
"datasetId": "11df9efe26644d0d99c566325779b415",
"commitId": "ce3be905ba0f465c84c9fc39e53a89f8",
"name": "order name",
"deliveryTime": "2022-02-22",
"labelType": "BOX2D"
}'
返回结果
# 响应状态
HttpStatus 201
# 响应结果
{
"id": "154e35bae8954f09969ef8c9445efd2c"
}
CreateTask
创建任务
请求路径
POST /v1/datasets/{id}/jobs
请求参数
Path
Body
任务类型 squashAndMerge,basicSearch
当不是用已有操作时移动重名时的策略,可选项有:abort,override 和 skip,缺省为 abort
请求示例
curl --location --request POST '{service}/v1/datasets/4a9e62ea88fd47b9b4b5f6bbbfe8ef64/jobs' \
--header 'x-token: {your_accesskey}' \
--header 'Content-Type: application/json' \
--data-raw '{
"title": "taskTitle",
"jobType": "squashAndMerge",
"arguments": {
"sourceBranchName":"main",
"targetBranchName":"test",
"title":"argTitle"
}
}'
返回结果
# 响应状态
HttpStatus 201
# 响应结果
{
"jobId":"7e412ceb61c943178e70fa7b032a9d10",
"createdAt":1647489812
}
DeleteTask
删除Job
请求路径
DELETE /v1/datasets/{id}/jobs/{taskId}
请求参数 Path
Body
任务类型 squashAndMerge,basicSearch
请求示例
curl --location --request DELETE '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/jobs/7e412ceb61c943178e70fa7b032a9d10' \
--header 'x-token: {your_accesskey}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{}
StopTask
中止Job
请求路径
POST /v1/datasets/{id}/jobs/{taskId}/abort
请求参数 Path
Body
任务类型 squashAndMerge,basicSearch
请求示例
curl --location --request POST '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/jobs/7e412ceb61c943178e70fa7b032a9d10/abort' \
--header 'x-token: {your_accesskey}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{}
GetTask
获取job详情
请求路径
GET /v1/datasets/{id}/jobs/{taskId}
请求参数
Path
Query
任务类型 squashAndMerge,basicSearch
请求示例
curl --location --request GET '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/jobs/7e412ceb61c943178e70fa7b032a9d10' \
--header 'x-token: {your_accesskey}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{
"title":"task title",
"jobId":"7e412ceb61c943178e70fa7b032a9d10",
"jobType":"squashAndMerge",
"arguments":{
"description":"argDesc",
"sourceBranchName":"branch1",
"strategy":"abort",
"targetBranchName":"main",
"title":"argTitle"
},
"createdAt":1647489813,
"startedAt":1647489813,
"status":"FAILED",
"errorMessage":"",
"description":"task desc ",
"result":{
"draftNumber":4
}
}
ListTasks
获取job列表
请求路径
GET /v1/datasets/{id}/jobs
请求参数
Path
Query
任务类型 squashAndMerge,basicSearch
请求示例
curl --location --request GET '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/jobs' \
--header 'x-token: {your_accesskey}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{
"jobs":[
{
"title":"task title",
"jobId":"7e412ceb61c943178e70fa7b032a9d10",
"jobType":"squashAndMerge",
"arguments":{
"description":"argDesc",
"sourceBranchName":"branch1",
"strategy":"abort",
"targetBranchName":"main",
"title":"argTitle"
},
"createdAt":1647489813,
"startedAt":1647489813,
"status":"FAILED",
"errorMessage":"",
"description":"task desc ",
"result":{
"draftNumber":4
}
}
],
"offset":0,
"recordSize":128,
"totalCount":1
}
RetryTask
重试Job
请求路径
POST /v1/datasets/{id}/jobs/{taskId}/retry
请求参数 Path
Body
任务类型 squashAndMerge,basicSearch
请求示例
curl --location --request POST '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/jobs/7e412ceb61c943178e70fa7b032a9d10/retry' \
--header 'x-token: {your_accesskey}'
返回结果
# 响应状态
HttpStatus 200
# 响应结果
{}