Onedata API Reference

REST API references for Onezone, Oneprovider, and Onepanel.

Get dataset information

GET /datasets/{did}

Returns the basic information about a dataset.

Example cURL requests

Get the basic information about dataset

curl -H "X-Auth-Token: $TOKEN" -X GET "https://$PROVIDER_HOST/api/v3/oneprovider/datasets/$DATASET_ID"

{
    "state": "attached",
    "datasetId": "1f4b762b1380946e73aeca574c77f14c",
    "parentId": null,
    "rootFileId": "00000000006CB663736861726547756964233339643236366165646365...",
    "rootFileType": "DIR",
    "rootFilePath": "/MySpace/dir",
    "rootFileDeleted": false,
    "protectionFlags": ["data_protection"],
    "effectiveProtectionFlags": ["data_protection", "metadata_protection"],
    "creationTime": 1576152793,
    "archiveCount": 5
}

Path parameters

Parameter Type & Description
did required
string

Dataset Id

Request Examples

Shell
oneprovider-rest-cli getDataset did=$DATASET_ID

Responses

application/json
200

The dataset information.

PropertyType & Description
state
string (DatasetState)

The state of the dataset:

  • attached - the dataset is coupled with its root file/directory, which means that the file/directory is treated as a dataset and offers some additional features (e.g. protection flags). The root file/directory contents are directly the dataset contents.

  • detached - the dataset is decoupled from its root file/directory and serves only archival purposes. The dataset does not correspond to any physical content in the file tree and changes to the original root file/directory contents are not reflected in the dataset.

    A detached dataset can be reattached, but only to the original file/directory and only if it still exists. Once a dataset has been established, its root file/directory can no longer be changed.

Enum:
attacheddetached
datasetId
string

Dataset Id.

parentId
string

Parent dataset Id or null in case of top dataset.

rootFileId
string

Id of file or directory being the dataset root. Once the dataset has been established the root file can no longer be changed. Even after detaching dataset it can be reattached only to the same file and only if it still exists.

rootFileType
string (FileType)

The type of the file:

  • REG - regular file,
  • DIR - directory,
  • SYMLNK - symbolic link.
Enum:
REGDIRSYMLNK
rootFilePath
string

Path to the file or directory in the virtual file system. For datasets in detached state this field is frozen and shows the value it had at the time of detaching. It is done for archival purposes as file may have been renamed or removed.

rootFileDeleted
boolean

Flag informing whether dataset's root file has been deleted. Only relevant for detached datasets. If the root file has been deleted, it is no longer possible to reattach the dataset.

protectionFlags
array of strings

Dataset protection flags:

  • data_protection - causes all dataset's files and directories to be protected from modifying their content.

  • metadata_protection - causes all dataset's files and directories to be protected from modifying their metadata (custom metadata, ACL, etc.). Can be enabled only when data_protection is enabled.

NOTE: the file/directory can be deleted if data_protection flag is disabled, or when the flag is enabled but is inherited through one of its hard links.

Requests to modify the data/metadata when protection is enabled will be rejected with the EPERM POSIX error.

The protection flags are ignored when the dataset is in detached state.

Changing the protection flags may not have an immediate effect, especially for files that were already opened before the change.

Note however that some basic readonly file attributes (such as e.g. atime updated when a file is read) will be modified regardless.

effectiveProtectionFlags
any
creationTime
integer (Timestamp)

Timestamp in seconds (UNIX epoch), e.g. 1563819329.

archiveCount
integer

Number of archives created from the dataset.

Example

application/json
{
  "state": "attached",
  "datasetId": "1f4b762b1380946e73aeca574c77f14c",
  "parentId": null,
  "rootFileId": "00000000006CB663736861726547756964233339643236366165646365...",
  "rootFileType": "DIR",
  "rootFilePath": "/MySpace/dir",
  "protectionFlags": [
    "metadata_protection"
  ],
  "effectiveProtectionFlags": [
    "data_protection",
    "metadata_protection"
  ],
  "creationTime": 1576152793,
  "archiveCount": 5
}
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

Dataset 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
    }
  }
}