Core dataset
Core dataset operations.
Fields#
- pk: int
- name: str
- description: str
- version: int
- previous_version: int
- project: project ID
- licence: license ID
- tags: str
- is_public: bool
- creator: user ID
- creation_time: timestamp
- deletion_time: timestamp
-
files (object):
- file name (str): cache ID (str)
Actions#
List#
Lists the datasets present on the server.
Method#
POST
URL#
/v1/datasets/list
Permissions#
Body (optional)#
Response#
- A JSON array of objects containing each dataset's fields
Create#
Creates a new dataset.
Method#
POST
URL#
/v1/datasets/create
Body#
- name: str
- description: str
- project: project ID
- licence: license ID
- tags: str
- is_public: bool
Permissions#
Response#
- A JSON object containing the newly-created dataset's fields
Retrieve#
Gets the information about a specific dataset.
Method#
GET
URL#
/v1/datasets/{PK}
Parameters#
PK
: int (primary key of the dataset)
Permissions#
Response#
- A JSON object containing the dataset's fields
Update#
Updates a specific dataset.
Method#
PUT
URL#
/v1/datasets/{PK}
Parameters#
PK
: int (primary key of the dataset)
Body#
- name: str
- description: str
- project: project ID
- licence: license ID
- tags: str
- is_public: bool
Permissions#
- user is a member of the team that owns the dataset with write permission, or
- user is admin, or
- both:
Response#
- A JSON object containing the updated dataset's fields
Partial Update#
Updates a specific dataset.
Method#
PATCH
URL#
/v1/datasets/{PK}
Parameters#
PK
: int (primary key of the dataset)
Body#
- name (optional): str
- description (optional): str
- project (optional): project ID
- licence (optional): license ID
- tags (optional): str
- is_public (optional): bool
Permissions#
- user is a member of the team that owns the dataset with write permission, or
- user is admin, or
- both:
Response#
- A JSON object containing the updated dataset's fields
Destroy#
Flags a dataset as deleted, it can be reinstated. To permanently delete, see Hard Delete.
Method#
DELETE
URL#
/v1/datasets/{PK}
Parameters#
PK
: int (primary key of the dataset)
Permissions#
Clear Dataset#
Removes all meta-data and annotations from a dataset.
Method#
DELETE
URL#
/v1/datasets/{PK}/clear
Parameters#
PK
: int (primary key of the dataset)
Permissions#
- user is a member of the team that owns the dataset with write permission, or
- user is admin, or
- both:
Response#
- A JSON object containing the cleared dataset's fields
Merge#
Merges the files from a source dataset into a target dataset.
Method#
POST
URL#
/v1/datasets/{PK}/merge/{OTHER}
Parameters#
PK
: int (primary key of the target dataset)OTHER
: int (primary key of the source dataset)
Body#
- delete: bool (whether to delete the source dataset after the merge)
- hard (optional): bool (whether to hard-delete, ignored if
delete
isfalse
, default is false)
Permissions#
- user is a member of the team that owns the dataset with write permission, or
- user is admin, or
- both:
Response#
- A JSON object containing the target dataset's fields
Download#
Downloads a dataset.
Method#
POST
URL#
/v1/datasets/{PK}/download
Parameters#
PK
: int (primary key of the dataset)
Body#
- params (optional): JSON Object (must be empty if supplied, ignored)
- filetype (optional): str (one of "zip" or "tar.gz", defaults to "zip")
Permissions#
Response#
- The dataset as an archive, containing the files in the dataset.
Copy#
Creates a copy of a dataset.
Method#
POST
URL#
/v1/datasets/{PK}/copy
Parameters#
PK
: int (primary key of the dataset)
Body#
- new_name (optional): str (creates a new dataset if supplied, or a new version of the source dataset if not)
- only_files (optional): array of str (the files to include in the copy, or all files if omitted)
Permissions#
Response#
- A JSON object containing the newly-created dataset's fields
Add File#
Adds a file to a dataset.
Method#
POST
URL#
/v1/datasets/{PK}/files/{FILENAME}
Parameters#
PK
: int (primary key of the dataset)FILENAME
: str (name of the new file)
Body#
File binary data.
Permissions#
- user is a member of the team that owns the dataset with write permission, or
- user is admin, or
- both:
Response#
- filename: str
- handle: str (handle to the file's data on the server)
Add Files#
Adds files to a dataset.
Method#
POST
URL#
/v1/datasets/{PK}/files-multi
Parameters#
PK
: int (primary key of the dataset)
Body#
Binary data of a zip archive containing the files to add.
Permissions#
- user is a member of the team that owns the dataset with write permission, or
- user is admin, or
- both:
Response#
-
array of:
- filename: str
- handle: str (handle to the file's data on the server)
Get File#
Gets a file from a dataset.
Method#
GET
URL#
/v1/datasets/{PK}/files/{FILENAME}
Parameters#
PK
: int (primary key of the dataset)FILENAME
: str (name of the file)
Permissions#
Response#
File binary data.
Delete File#
Deletes a file from the dataset.
Method#
DELETE
URL#
/v1/datasets/{PK}/files/{FILENAME}
Parameters#
PK
: int (primary key of the dataset)FILENAME
: str (name of the file)
Permissions#
- user is a member of the team that owns the dataset with write permission, or
- user is admin, or
- both:
Response#
- filename: str
- handle: str (handle to the file's data on the server)
Set Metadata#
Sets the metadata for a file in a dataset.
Method#
POST
URL#
/v1/datasets/{PK}/metadata/{FILENAME}
Parameters#
PK
: int (primary key of the dataset)FILENAME
: str (name of the file)
Body#
- metadata: str
Permissions#
- user is a member of the team that owns the dataset with write permission, or
- user is admin, or
- both:
Response#
- metadata: str
Get Metadata#
Gets the metadata for a file in a dataset.
Method#
GET
URL#
/v1/datasets/{PK}/metadata/{FILENAME}
Parameters#
PK
: int (primary key of the dataset)FILENAME
: str (name of the file)
Permissions#
Response#
- metadata: str
Get All Metadata#
Gets the metadata for all files in a dataset.
Method#
GET
URL#
/v1/datasets/{PK}/metadata
Parameters#
PK
: int (primary key of the dataset)
Permissions#
Response#
JSON object from filename to metadata
Hard Delete#
Permanently deletes a dataset. For soft-deletion, see Destroy.
METHOD#
DELETE
URL#
/v1/datasets/{PK}/hard
Parameters#
PK
: int (primary key of the dataset)
Permissions#
Response#
- JSON object containing the fields of the hard-deleted dataset.
Reinstate#
Undeletes a previously soft-deleted dataset.
Method#
DELETE
URL#
/v1/datasets/{PK}/reinstate
Parameters#
PK
: int (primary key of the dataset)
Permissions#
Response#
- JSON object containing the fields of the reinstated dataset.