DataSet Operation

ListAuthStorageConfig

ListAuthStorageConfig
Acquire the list of authentication configuration
Request path
GET /v1/auth-storage-configs
Request parameter
Query
Name
Type
Required
Descriptions
name
string
No
Configuration Name
limit
int
No
Need to be greater than 0 and the default is 128 with a maximum of 128 for a single acquisition
offset
int
No
The default is 0
Request instance
1
curl --location --request GET '{service}/v1/auth-storage-configs?name=aws_1&limit=1&offset=0' \
2
--header 'x-token: {your_accesskey}' \
3
--header 'Content-Type: application/json'
Copied!
Output
1
# Response status
2
HttpStatus 200
3
# Response result
4
{
5
"configs": [
6
{
7
"name": "aws_1",
8
"type": "s3",
9
"endpoint": "s3.cn-northwest-1.amazonaws.com.cn",
10
"accesskeyId": "AKIKU7KYZCWGOTEV5GNE",
11
"bucketName": "graviti-210415"
12
}
13
],
14
"offset": 0,
15
"recordSize": 1,
16
"totalCount": 1
17
}
Copied!

CreateDataset

Create a dataset
Create a TensorBay dataset with version control. The dataset name must be unique
Request path
POST /v1/datasets
Request parameter
Body
Name
Type
Required
Descriptions
name
string
Yes
Dataset name
type
int
No
The default is 0, 0-normal dataset; 1-Fusion dataset
storageConfig
object
No
Create parameters for using authenticated datasets; mutually exclusive with regions
├─name
string
Yes
Configuration name
├─name
path
No
Create storage path for datasets
Request instance
1
curl --location --request POST '{service}/v1/datasets' \
2
--header 'x-token: {your_accesskey}' \
3
--header 'Content-Type: application/json' \
4
--data-raw '{
5
"name": "my first dataset",
6
"type": 0,
7
"storageConfig": {
8
"name": "aws_1",
9
"path": "graviti"
10
}
11
}'
Copied!
Output
1
# Response status
2
HttpStatus 201
3
# Response result
4
{
5
"id": "154e35bae8954f09969ef8c9445efd2c"
6
}
Copied!
    id: the ID of the created dataset

DeleteDataset

Delete a dataset
DELETE /v1/datasets/{id}
Path
Name
Descriptions
Value
id
Yes
Dataset ID
Body
Name
Type
Required
Descriptions
commit
string
No
Commit ID or commit tag
Request instance
1
curl --location --request DELETE '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c' \
2
--header 'x-token: {your_accesskey}'
Copied!
Output
1
# Response status
2
HttpStatus 200
3
# Response result
4
{}
Copied!

UpdateDataset

Update dataset information
PATCH /v1/datasets/{id}
Path
Name
Descriptions
Value
id
Yes
Dataset ID
Body
Name
Type
Required
Descriptions
name
string
No
dataset name, and the provided value cannot be the empty value "".
Request instance
1
curl --location --request PATCH '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c' \
2
--header 'x-token: {your_accesskey}'\
3
--data-raw '{
4
"name": "my dataset",
5
}'
Copied!
Output
1
# Response status
2
HttpStatus 200
3
# Response result
4
{}
Copied!

ListDataset

List datasets
Return the list of datasets owned by the user:
    Individual users acquire the list of datasets under their personal accounts
    Team users acquire the list of datasets under their enterprise accounts
Request path
GET /v1/datasets
Request parameter
Query
Name
Type
Required
Descriptions
limit
int
No
Need to be greater than 0 and the default is 128 with a maximum of 128 for a single acquisition
offset
int
No
The default is 0
name
string
No
Dataset name
needFuzzyQuery
bool
No
If true, fuzzy query of the dataset name is supported.
sortBy
string
No
Currently sorting is based on created_at and updated_at while entering other content will return InvalidParamsValue.
orderBy
string
No
The default is desc (descending order). The valid content is asc (ascending order) and desc
Request instance
1
curl --location --request GET '{service}/v1/datasets?offset=0&limit=10'\
2
--header 'x-token: {your_accesskey}'\
3
--header 'Content-Type: application/json'
Copied!
Output
1
# Response status
2
HttpStatus 200
3
# Response result
4
{
5
"datasets": [
6
{
7
"id": "154e35bae8954f09969ef8c9445efd2c",
8
"name": "my-great-data-set",
9
"defaultBranch": "main",
10
"type": 0,
11
"updateTime": 1604977282,
12
"owner": ""
13
}
14
],
15
"offset": 0,
16
"recordSize": 1,
17
"totalCount": 1
18
}
Copied!
    datasets: List of datasets
      id: Dataset ID
      name: Dataset name
      defaultBranch: default branch name
      type: the default is 0, 0-normal dataset, 1-Fusion dataset

GetDataset

Request path
GET /v1/datasets/{id}
Request parameter
PATH
Name
Descriptions
Value
id
Yes
Dataset ID
Request instance
1
curl --location --request GET '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c'\
2
--header 'x-token: {your_accesskey}'\
3
--header 'Content-Type: application/json'
Copied!
Output
1
# Response status
2
HttpStatus 200
3
# Response result
4
{
5
"name": "my-great-data-set",
6
"type": 1,
7
"defaultBranch": "main",
8
"commitId": "00000000000000000000000000000000",
9
"updateTime": 1604977282,
10
"owner": ""
11
}
Copied!

CreateBranch

Create a branch
Create a branch
Request path
POST /v1/datasets/{id}/branches
Request parameter
Path
Name
Descriptions
Value
id
Yes
Dataset ID
Query
Name
Type
Required
Descriptions
name
string
Yes
The name of the created branch
commit
string
Yes
The commit that branch is based on. It can be commit ID, commit tag, or branch name
Request instance
1
curl --location --request POST '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/branches' \
2
--header 'x-token: {your_accesskey}' \
3
--header 'Content-Type: application/json'\
4
--data-raw '{
5
"name": main2,
6
"commit": "fde63f357daf46088639e9f57fd81cad"
7
}'
Copied!
Output
1
# Response status
2
HttpStatus 201
3
# Response result
4
{}
Copied!

DeleteBranch

Delete branch
Delete branch
Request path
DELETE /v1/datasets/{id}/branches
Request parameter
Path
Name
Descriptions
Value
id
Yes
Dataset ID
Query
Name
Type
Required
Descriptions
name
string
Yes
Branch name
Request instance
1
curl --location --request DELETE '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/branches' \
2
--header 'x-token: {your_accesskey}' \
3
--header 'Content-Type: application/json'\
4
--data-raw '{
5
"name": main2
6
}'
Copied!
Output
1
# Response status
2
HttpStatus 200
3
# Response result
4
{}
Copied!

ListBranch

Acquire a branch list
Acquire a list of dataset branches
Request path
GET /v1/datasets/{id}/branches
Request parameter
Path
Name
Descriptions
Value
id
Yes
Dataset ID
Query
Name
Type
Required
Descriptions
limit
int
No
Need to be greater than 0 and the default is 128 with a maximum of 128 for a single acquisition
offset
int
No
The default is 0
Request instance
1
curl --location --request GET '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/branches?limit=1&offset=0' \
2
--header 'x-token: {your_accesskey}' \
3
--header 'Content-Type: application/json'
Copied!
Output
1
# Response status
2
HttpStatus 200
3
# Response result
4
{
5
"branches": [
6
{
7
"name": "main",
8
"commitId": "fde63f357daf46088639e9f57fd81cad",
9
"parentCommitId": "f68b1375454f459b8a486b8d1f4d9ddb",
10
"title": "first commit",
11
"committer": {
12
"name": "graviti",
13
"date": 1616579313
14
}
15
}
16
],
17
"offset": 0,
18
"recordSize": 1,
19
"totalCount": 1
20
}
Copied!

CreateDraft

Create a dataset draft
Create a TensorBay dataset draft. Only one draft can be created on a branch
Request path
POST /v1/datasets/{id}/drafts
Request parameter
Path
Name
Required
Descriptions
id
Yes
Dataset ID
Body
Name
Type
Required
Descriptions
title
string
No
Draft name
branchName
string
No
Branch name. The default branch is named as main
Request instance
1
curl --location --request POST '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/drafts' \
2
--header 'x-token: {your_accesskey}' \
3
--header 'Content-Type: application/json' \
4
--data-raw '{
5
"title": "my first draft",
6
"branchName": "main"
7
}'
Copied!
Output
1
# Response status
2
HttpStatus 201
3
# Response result
4
{
5
"draftNumber": 1
6
}
Copied!
    draftNumber: draft number

ListDraft

Acquire a list of dataset drafts
Acquire a list of dataset drafts
Request path
GET /v1/datasets/{id}/drafts
Request parameter
Path
Name
Required
Descriptions
id
Yes
Dataset ID
Query
Name
Type
Required
Descriptions
limit
int
No
Need to be greater than 0 and the default is 128 with a maximum of 128 for a single acquisition
offset
int
No
The default is 0
Request instance
1
curl --location --request GET '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/drafts?limit=1&offset=0' \
2
--header 'x-token: {your_accesskey}' \
3
--header 'Content-Type: application/json'
Copied!
Output
1
# Response status
2
HttpStatus 200
3
# Response result
4
{
5
"drafts": [
6
{
7
"draftNumber": "1",
8
"branchName": "main",
9
"title": "my first draft"
10
}
11
],
12
"offset": 0,
13
"recordSize": 1,
14
"totalCount": 10
15
}
Copied!

CommitDataset

Commit a dataset
Update a dataset with a pending status to a committed status. Once a dataset is published, it cannot be modified.
Request path
POST /v1/datasets/{id}
Request parameter
Path
Name
Descriptions
Value
id
Yes
Dataset ID
Body
Name
Type
Required
Descriptions
draftNumber
int
Yes
Draft number
title
string
yes
The number of characters of the submitted title should be less than 255
tag
string
No
Dataset version tag. The number of characters should range from 2 to 80
Request instance
1
curl --location --request POST '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c'\
2
--header 'x-token: {your_accesskey}'\
3
--header 'Content-Type: application/json' \
4
--data-raw '{
5
"draftNumber": "1",
6
"title": "checkout a new version dataset",
7
"tag": "v1.0"
8
}'
Copied!
Output
1
# Response status
2
HttpStatus 200
3
# Response result
4
{
5
"commitId": "fde63f357daf46088639e9f57fd81cad"
6
}
Copied!

ListCommit

list commits
Acquire a list of dataset commits
Request path
GET /v1/datasets/{id}/commits
Request parameter Path
Name
Descriptions
Value
id
Yes
Dataset ID
Query
Name
Type
Required
Descriptions
commit
string
No
Commit ID, commit tag, or branch name. The default is the default branch
limit
int
No
The default is set to 128. The maximum value for a single time is 128
offset
int
No
The default is 0
Request instance
1
curl --location --request GET '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/commits?commit=main&limit=1&offset=0' \
2
--header 'x-token: {your_accesskey}' \
3
--header 'Content-Type: application/json'
Copied!
Output
1
# Response status
2
HttpStatus 200
3
# Response result
4
{
5
"commits": [
6
{
7
"parentCommitId": "0d213a06a85d46fa8662946bdb1afe7e",
8
"commitId": "fde63f357daf46088639e9f57fd81cad",
9
"title": "checkout a new version dataset",
10
"committer": {
11
"date": 1617268600,
12
"name": "graviti"
13
}
14
}
15
],
16
"offset": 0,
17
"recordSize": 1,
18
"totalCount": 10
19
}
Copied!

CreateTag

Create a tag
Create a tag
Request path
POST /v1/datasets/{id}/tags
Request parameter
Path
Name
Descriptions
Value
id
Yes
Dataset ID
Body
Name
Type
Required
Descriptions
commit
string
Yes
Commit ID, commit tag, or branch name
name
string
Yes
Tag name. The number of characters should range from 2 to 80
Request instance
1
curl --location --request POST '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/tags' \
2
--header 'x-token: {your_accesskey}' \
3
--header 'Content-Type: application/json' \
4
--data-raw '{
5
"commit": "fde63f357daf46088639e9f57fd81cad",
6
"name": "v1"
7
}'
Copied!
Output
1
# Response status
2
HttpStatus 201
3
# Response result
4
{}
Copied!

DeleteTag

Delete a tag
Delete a tag
Request path
DELETE /v1/datasets/{id}/tags
Request parameter
Path
Name
Descriptions
Value
id
Yes
Dataset ID
Body
Name
Type
Required
Descriptions
name
string
Yes
tag name
Request instance
1
curl --location --request DELETE '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/tags' \
2
--header 'x-token: {your_accesskey}' \
3
--header 'Content-Type: application/json' \
4
--data-raw '{
5
"name": "v1"
6
}'
Copied!
Output
1
# Response status
2
HttpStatus 200
3
# Response result
4
{}
Copied!

ListTag

List tags
Acquire a list of dataset tags
Request path
GET /v1/datasets/{id}/tags
Request parameter
Path
Name
Descriptions
Value
id
Yes
Dataset ID
Query
Name
Type
Required
Descriptions
name
string
tag name
limit
int
No
The default is set to 128. The maximum value for a single time is 128
offset
int
No
The default is 0
Request instance
1
curl --location --request GET '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/tags?name=v1&limit=1&offset=0' \
2
--header 'x-token: {your_accesskey}' \
3
--header 'Content-Type: application/json'
Copied!
Output
1
# Response status
2
HttpStatus 200
3
# Response result
4
{
5
"tags": [
6
{
7
"name": "v1",
8
"commitId": "fde63f357daf46088639e9f57fd81cad",
9
"parentCommitId": "f68b1375454f459b8a486b8d1f4d9ddb",
10
"title": "first commit",
11
"committer": {
12
"name": "graviti",
13
"date": 1617268600
14
}
15
}
16
],
17
"offset": 0,
18
"recordSize": 1,
19
"totalCount": 1
20
}
Copied!

updateNote

Update a dataset note
Update a dataset note
Request path
PATCH /v1/datasets/{id}/notes
Request parameter
Path
Name
Descriptions
Value
id
Yes
Dataset ID
Body
Name
Type
Required
Descriptions
draftNumber
int
Yes
draft number
binPointCloudFields
string[]
No
Dimension name of the point cloud in bin format
isContinuous
bool
No
Is it continuous
Request instance
1
curl --location --request PATCH '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/notes' \
2
--header 'x-token: {your_accesskey}' \
3
--header 'Content-Type: application/json' \
4
--data-raw '{
5
"draftNumber": 1,
6
"fileFormat": {
7
"draftNumber": 1,
8
"binPointCloudFields": [
9
"X",
10
"Y",
11
"Z",
12
"Intensity"
13
],
14
"isContinuous": true
15
}'
Copied!
Output
1
# Response status
2
HttpStatus 200
3
# Response result
4
{}
Copied!

GetNote

Get note
Get the note of a dataset
Request path
GET /v1/datasets/{id}/notes
Request parameter
Path
Name
Descriptions
Value
id
Yes
Dataset ID
Query
Name
Type
Required
Descriptions
draftNumber
int
No
Draft number. Only one of draft and commit should exist, but they should not exist at the same time
commit
string
No
Commit ID, commit tag, or branch name
Request instance
1
curl --location --request GET '{service}/v1/datasets/154e35bae8954f09969ef8c9445efd2c/notes?draftNumber=1' \
2
--header 'x-token: {your_accesskey}' \
3
--header 'Content-Type: application/json'
Copied!
Output
1
# Response status
2
HttpStatus 200
3
# Response result
4
{
5
"isContinuous": true,
6
"binPointCloudFields": [
7
"X",
8
"Y",
9
"Z",
10
"Intensity"
11
]
12
}
Copied!
Last modified 4mo ago