List space top datasets
Returns the list of space's top datasets - ones that do not have any parent dataset. In special case when dataset has been established for space root directory, there is only one top dataset.
Datasets in each space are divided into two separate trees based on their states:
attached- this tree represents the hierarchy of datasets, which corresponds to the hierarchy of files in the space. It can be perceived as a "compressed" file tree, containing only the nodes corresponding to files/directories marked as a dataset. For example, dataset A is child of dataset B because B's root directory is ancestor to A's root file and no directory between them is a root of any attached dataset. Consequently, moving dataset's root file to other location may change the dataset location in the tree.detached- this tree represents the hierarchy of datasets for the moment of detachment and does not change when root files are moved. Individual datasets from this tree can be reattached, causing the tree to be restructured in specific cases.
Example cURL requests
List space top datasets
curl -H "X-Auth-Token: $TOKEN" \
-X GET "https://$PROVIDER_HOST/api/v3/oneprovider/spaces/$SPACE_ID/datasets?state=attached"
{
"datasets": [
{
"datasetId": "1f4b762b1380946e73aeca574c77f14c",
"name": "File1.txt"
},
{
"datasetId": "64233339643236366165646365626666",
"name": "Dir2"
}
],
"nextPageToken": "RGlyMjY0MjMzMzM5NjQzMjM2MzY2MTY1NjQ2MzY1NjI2NjY2"
}
Path parameters
| Parameter | Type & Description |
|---|---|
| sid required | string Space Id |
Query parameters
| Parameter | Type & Description |
|---|---|
| state required | string The dataset tree to list from. |
| limit | integer Allows specifying maximum number of entries that should be returned. If there are more datasets, they can be retrieved using |
| offset | integer Offset determining beginning of the list of datasets returned in the response. Expressed in number of entries, further adjusts the starting point of listing indicated by |
| index | string Determines the starting point for listing. The listing will (inclusively) start from the first dataset whose name is lexicographically greater or equal to the specified index. Since the index may include characters that are not URL-safe, it should always be urlencoded. |
| token | string Determines the starting point for listing. The listing will start from the next page (batch) of entries which follows the page previously obtained along with the corresponding |
Request Examples
oneprovider-rest-cli listSpaceTopDatasets sid=$SPACE_ID limit=100 offset=300Responses
The list of space top datasets.
| Property | Type & Description | ||||
|---|---|---|---|---|---|
datasets array of objects The list of dataset Ids.
| |||||
nextPageToken string (ListPageToken) A token in the listing response that can be passed in the consecutive request to start listing from the next page of entries. When end of list is reached, the token is returned with a | |||||
Example
{
"datasets": [
{
"datasetId": "1f4b762b1380946e73aeca574c77f14c",
"name": "File1.txt"
},
{
"datasetId": 6.423333964323636e+31,
"name": "Dir2"
}
],
"nextPageToken": "RGlyMjY0MjMzMzM5NjQzMjM2MzY2MTY1NjQ2MzY1NjI2NjY2"
}Invalid request.
| Property | Type & Description | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
error object (ErrorJson) Object describing an error.
| |||||||||||||||||||||||||||
Example
{
"error": {
"id": "example",
"description": "This is an example error.",
"ctx": {
"timestamp": 1750762637248,
"serviceReleaseVersion": "25.0",
"serviceId": "a7ee2722915b8bf7fb064eb65087cc61ch9357",
"serviceDomain": "dev-oneprovider-krakow.default.svc.cluster.local",
"serviceBuildVersion": "231-g8d26f953c3",
"service": "opw",
"onedataErrorsRevision": "ca3af8cb",
"module": "metadata_req",
"line": 45
}
}
}Forbidden request.
| Property | Type & Description | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
error object (ErrorJson) Object describing an error.
| |||||||||||||||||||||||||||
Example
{
"error": {
"id": "example",
"description": "This is an example error.",
"ctx": {
"timestamp": 1750762637248,
"serviceReleaseVersion": "25.0",
"serviceId": "a7ee2722915b8bf7fb064eb65087cc61ch9357",
"serviceDomain": "dev-oneprovider-krakow.default.svc.cluster.local",
"serviceBuildVersion": "231-g8d26f953c3",
"service": "opw",
"onedataErrorsRevision": "ca3af8cb",
"module": "metadata_req",
"line": 45
}
}
}Invalid path - space not found.
| Property | Type & Description | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
error object (ErrorJson) Object describing an error.
| |||||||||||||||||||||||||||
Example
{
"error": {
"id": "example",
"description": "This is an example error.",
"ctx": {
"timestamp": 1750762637248,
"serviceReleaseVersion": "25.0",
"serviceId": "a7ee2722915b8bf7fb064eb65087cc61ch9357",
"serviceDomain": "dev-oneprovider-krakow.default.svc.cluster.local",
"serviceBuildVersion": "231-g8d26f953c3",
"service": "opw",
"onedataErrorsRevision": "ca3af8cb",
"module": "metadata_req",
"line": 45
}
}
}Internal server error.
| Property | Type & Description | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
error object (ErrorJson) Object describing an error.
| |||||||||||||||||||||||||||
Example
{
"error": {
"id": "example",
"description": "This is an example error.",
"ctx": {
"timestamp": 1750762637248,
"serviceReleaseVersion": "25.0",
"serviceId": "a7ee2722915b8bf7fb064eb65087cc61ch9357",
"serviceDomain": "dev-oneprovider-krakow.default.svc.cluster.local",
"serviceBuildVersion": "231-g8d26f953c3",
"service": "opw",
"onedataErrorsRevision": "ca3af8cb",
"module": "metadata_req",
"line": 45
}
}
}