List directory files and subdirectories
Returns the list of directory files and subdirectories for directory specified by $DIR_ID.
NOTE: the listing may contain files that are not fully synchronized or have been deleted in parallel.
For that reason, it's recommended to safeguard consecutive calls referring to the directory children
against ENOENT errors.
NOTE: since version 21.02.5, this endpoint accepts options as JSON body rather than in the query string. Moreover, some of the attributes have been renamed and the list of available ones has been extended. The old behaviour of the endpoint has been retained but is DEPRECATED and scheduled for deletion in the future major release. The following changes in attribute names were introduced:
file_id->fileIdmode->posixPermissionsparent_id->parentFileIdstorage_group_id->displayGidstorage_user_id->displayUidis_fully_replicated->isFullyReplicatedLocallyprovider_id->originProviderIdshares->directShareIdsowner_id->ownerUserIdhardlinks_count->hardlinkCount
Example cURL requests
Get files in space subdirectory
curl -H "X-Auth-Token: $TOKEN" -H 'Content-type: application/json' \
-X GET "https://$PROVIDER_HOST/api/v3/oneprovider/data/$DIR_ID/children" -d '{
"attributes": ["name", "size", "xattr.key"],
"limit": 2
}'
{
"children": [
{
"name": File1.txt,
"size": 1024,
"xattr.key": "extended_attribute_value"
},
{
"name": File2.txt,
"size": 16384,
"xattr.key": null
}
],
"isLast": false,
"nextPageToken": "g2gDZAAKbGlua190b2tlbmgCZAAMY2FjaGVkX3Rva2VuWgADY..."
}
Path parameters
| Parameter | Type & Description |
|---|---|
| id required | string Id of the directory to be listed. |
Query parameters
| Parameter | Type & Description |
|---|---|
| legacy_options | string The old behaviour of the endpoint has been retained but is DEPRECATED and scheduled for deletion in the future major release. You may refer to the docs for 21.02.4, but it's recommended to use the new API with options as JSON body. |
Request body
| Property | Type & Description |
|---|---|
limit integer Specifies the maximum number of entries that can be returned in one result batch. If there are more files, they can be retrieved using options that specify a custom starting point ( | |
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 | |
index string Determines the starting point for listing. The listing will (inclusively) start from the first file whose name is lexicographically greater or equal to the specified index. Cannot be provided alongside the | |
offset integer Expressed in number of entries, further adjusts the starting point of listing indicated by the | |
tuneForLargeContinuousListing boolean This option increases performance of listing large directories (with thousands of files) when using subsequent calls with paging tokens. | |
attributes array of strings List of names of the attributes to be included in the result. For a shared file/directory accessed in public mode, only the following attributes are available: | |
Request Examples
oneprovider-rest-cli listChildren id=$FILE_ID limit=100 index=filename.txtResponses
The list of directory files and subdirectories.
| Property | Type & Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
children array of objects (FileAttributes) The list of directory files and subdirectories.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
isLast boolean (IsLast) Due to delays in synchronization between Oneproviders, the number of returned entries can be smaller than the requested limit, even though there are still some ensuing ones. The | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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
{
"children": [
{
"fileId": "00000CF4706775696423745F772D67686431633765446F4D76546D6...",
"index": "g2gDZAAKbGlzdF9pbmRleG0AAAAEbmFtZW0AAAAHdHJlZV9pZA",
"type": "REG",
"activePermissionsType": "posix",
"posixPermissions": "511",
"acl": [],
"name": "File1.txt@a47b8b7a04b197c6cd99581047b8b7ad",
"conflictingName": "File1.txt",
"path": "/space/Dir1/File1.txt",
"parentFileId": "000006CB66373686172654775696423333964323636616564636562...",
"displayGid": 1101841,
"displayUid": 1935313,
"atime": 1464958683054,
"mtime": 1464958683051,
"ctime": 1464958681054,
"size": 1024,
"isFullyReplicatedLocally": false,
"localReplicationRate": 0.8,
"originProviderId": "a47b8b7a04b197c6cd99581047b8b7ad",
"directShareIds": [
"1d24c36707d99197c6cd995810a43aca",
"6825604b0eb6a47b8b7a04b6369eb24d"
],
"ownerUserId": "b6b6a47b8b7a04b63a45604b07b8b7a2",
"hardlinkCount": 1,
"symlinkValue": null,
"hasCustomMetadata": true,
"effProtectionFlags": [
"data_protection",
"metadata_protection"
],
"effDatasetProtectionFlags": [
"data_protection"
],
"effDatasetInheritancePath": "direct_and_ancestor",
"effQosInheritancePath": "ancestor",
"aggregateQosStatus": "fulfilled",
"archiveRecallRootFileId": "000006431633765446F4D76546D6F47067D67686431633765446F4D76546D6....",
"xattr.key1": "value1",
"xattr.key2": null
}
],
"isLast": false,
"nextPageToken": "g2gDZAAKbGlua190b2tlbmgCZAAMY2FjaGVkX3Rva2VuWgADY..."
}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 - file or directory 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
}
}
}