Onedata API Reference

REST API references for Onezone, Oneprovider, and Onepanel.

List space top datasets

GET /spaces/{sid}/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 or token query parameters.

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 or token parameters. The value can be negative, in such case entries preceding the starting point will be returned.

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 nextPageToken. If both token and index are passed, the token prevails.

Request Examples

Shell
oneprovider-rest-cli listSpaceTopDatasets sid=$SPACE_ID limit=100 offset=300

Responses

application/json
200

The list of space top datasets.

PropertyType & Description
datasets
array of objects

The list of dataset Ids.

datasetId
string

Dataset Id.

name
string

Dataset's root file/directory name.

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 null value.

Example

application/json
{
  "datasets": [
    {
      "datasetId": "1f4b762b1380946e73aeca574c77f14c",
      "name": "File1.txt"
    },
    {
      "datasetId": 6.423333964323636e+31,
      "name": "Dir2"
    }
  ],
  "nextPageToken": "RGlyMjY0MjMzMzM5NjQzMjM2MzY2MTY1NjQ2MzY1NjI2NjY2"
}
400

Invalid request.

PropertyType & Description
error
object (ErrorJson)

Object describing an error.

id required
string

String identifying the error type. Does not change between error instances.

description required
string

Human readable error description. May contain information specific to given error instance.

details
object

Details about the error instance. The object schema is specific to each error type.

ctx required
object (ErrorJsonCtx)

Technical information about error.

timestamp required
integer

Timestamp in milliseconds.

serviceReleaseVersion required
string

Release version of a product, for example "25.0".

serviceId required
string

Identifier of a service instance — either Oneprovider Id or "onezone".

serviceDomain required
string

Domain of the service.

serviceBuildVersion required
string

Build version of the service.

service required
string

Short name of service.

Enum:
ozwopwozpopp
onedataErrorsRevision required
string

Revision of onedata-errors repo, where the error is defined.

module required
string

Module where the error occurred.

line required
integer

Line number in the module where the error occurred.

Example

application/json
{
  "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
    }
  }
}
403

Forbidden request.

PropertyType & Description
error
object (ErrorJson)

Object describing an error.

id required
string

String identifying the error type. Does not change between error instances.

description required
string

Human readable error description. May contain information specific to given error instance.

details
object

Details about the error instance. The object schema is specific to each error type.

ctx required
object (ErrorJsonCtx)

Technical information about error.

timestamp required
integer

Timestamp in milliseconds.

serviceReleaseVersion required
string

Release version of a product, for example "25.0".

serviceId required
string

Identifier of a service instance — either Oneprovider Id or "onezone".

serviceDomain required
string

Domain of the service.

serviceBuildVersion required
string

Build version of the service.

service required
string

Short name of service.

Enum:
ozwopwozpopp
onedataErrorsRevision required
string

Revision of onedata-errors repo, where the error is defined.

module required
string

Module where the error occurred.

line required
integer

Line number in the module where the error occurred.

Example

application/json
{
  "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
    }
  }
}
404

Invalid path - space not found.

PropertyType & Description
error
object (ErrorJson)

Object describing an error.

id required
string

String identifying the error type. Does not change between error instances.

description required
string

Human readable error description. May contain information specific to given error instance.

details
object

Details about the error instance. The object schema is specific to each error type.

ctx required
object (ErrorJsonCtx)

Technical information about error.

timestamp required
integer

Timestamp in milliseconds.

serviceReleaseVersion required
string

Release version of a product, for example "25.0".

serviceId required
string

Identifier of a service instance — either Oneprovider Id or "onezone".

serviceDomain required
string

Domain of the service.

serviceBuildVersion required
string

Build version of the service.

service required
string

Short name of service.

Enum:
ozwopwozpopp
onedataErrorsRevision required
string

Revision of onedata-errors repo, where the error is defined.

module required
string

Module where the error occurred.

line required
integer

Line number in the module where the error occurred.

Example

application/json
{
  "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
    }
  }
}
500

Internal server error.

PropertyType & Description
error
object (ErrorJson)

Object describing an error.

id required
string

String identifying the error type. Does not change between error instances.

description required
string

Human readable error description. May contain information specific to given error instance.

details
object

Details about the error instance. The object schema is specific to each error type.

ctx required
object (ErrorJsonCtx)

Technical information about error.

timestamp required
integer

Timestamp in milliseconds.

serviceReleaseVersion required
string

Release version of a product, for example "25.0".

serviceId required
string

Identifier of a service instance — either Oneprovider Id or "onezone".

serviceDomain required
string

Domain of the service.

serviceBuildVersion required
string

Build version of the service.

service required
string

Short name of service.

Enum:
ozwopwozpopp
onedataErrorsRevision required
string

Revision of onedata-errors repo, where the error is defined.

module required
string

Module where the error occurred.

line required
integer

Line number in the module where the error occurred.

Example

application/json
{
  "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
    }
  }
}