Get file attributes
This method returns attributes of a file specified by $FILE_ID.
By default, all attributes are returned, except for extended attributes.
The list of requested attributes can be optionally narrowed down, and extended attributes can be retrieved
using the xattr.* attribute(s) (where * is an extended attribute key).
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 selected file attributes
curl -H "X-Auth-Token: $TOKEN" -H 'Content-type: application/json' \
-X GET "https://$PROVIDER_HOST/api/v3/oneprovider/data/$FILE_ID" -d '{
"attributes": ["name", "size", "xattr.key"]
}'
{
"name": "File1.txt",
"size": 100,
"xattr.key": "extended_attribute_value"
}
Path parameters
| Parameter | Type & Description |
|---|---|
| id required | string File, directory or space Id. |
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 |
|---|---|
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 getAttrs id=$FILE_IDResponses
Returns the requested file attributes.
| Property | Type & Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|
fileId string Id of the file/directory. Successor of the deprecated | |||||||||
index string Index pointing to this file/directory that can be provided as a starting point when listing files. | |||||||||
type string (FileType) The type of the file:
Enum: REGDIRSYMLNK | |||||||||
activePermissionsType string Type of permissions that are taken into account when determining access rights to this file/directory. Enum: posixacl | |||||||||
posixPermissions string POSIX file permissions as string expressing octal notation. For a shared file/directory accessed in public mode, only the last byte ( | |||||||||
acl array of objects (Ace) An ACL (Access Control List) is an ordered list of ACEs (Access Control Entries).
| |||||||||
name string Name of the file/directory. In case of name conflicts (when two files with identical names are created simultaneously in two providers), this name is disambiguated by extending it with | |||||||||
conflictingName string The original name of the file/directory in case of file name conflict, as described in | |||||||||
path string Logical path to the file/directory. | |||||||||
parentFileId string Id of the parent directory or | |||||||||
displayGid integer GID of this file/directory displayed in the Oneclient's mounted filesystem. Successor of the deprecated | |||||||||
displayUid integer UID of this file/directory displayed in the Oneclient's mounted filesystem. Successor of the deprecated | |||||||||
creationTime integer Item's creation timestamp (UNIX epoch, in seconds). NOTE: in case of items imported from storage or created in Oneproviders in version 21.02.5 or lower it is assumed as minimum of atime, mtime and ctime. | |||||||||
atime integer Last time an item was accessed. (UNIX epoch, in seconds). | |||||||||
mtime integer Last time the item's content was modified. For regular files, indicates the time of the last write or truncate operation on the file. For directories, updated when a child item is added, renamed or deleted. (UNIX epoch, in seconds). | |||||||||
ctime integer Last time the item's metadata was changed, e.g. permissions. It' s also always updated when the modification time changes. (UNIX epoch, in seconds). | |||||||||
size integer The logical size of the file/directory in bytes. For directories, it can be | |||||||||
isFullyReplicatedLocally boolean Indicates whether a complete file replica is present on the queried provider. Applicable only for regular files ( | |||||||||
localReplicationRate number Ratio ( | |||||||||
originProviderId string Id of the provider in which this file/directory was created. | |||||||||
directShareIds array of strings The list of Ids of shares created for this file/directory. For every share, only the root file/directory will contain the share Id on the list and nested files/directories won't. For a shared file/directory accessed in public mode, shows only the Id of the share in the context of which the file is being accessed. Successor of the deprecated | |||||||||
ownerUserId string User Id of the owner of this file/directory. Successor of the deprecated | |||||||||
hardlinkCount integer The number of hard links (including this one) associated with this file/directory. | |||||||||
symlinkValue string The path to which the symbolic link points. Applicable only for symlinks ( | |||||||||
effProtectionFlags any | |||||||||
effDatasetProtectionFlags any | |||||||||
effDatasetInheritancePath any | |||||||||
effQosInheritancePath any | |||||||||
aggregateQosStatus any (AggregateQosStatus) | |||||||||
archiveRecallRootFileId string Id of the archive recall that this file/directory belongs to (is in the subtree of). Archive recall is a process that creates a copy of a dataset archive (snapshot) in the space filesystem, i.e. creates a regular directory, but the files and directories inside are assigned this attribute. | |||||||||
hasCustomMetadata boolean Indicates whether this file/directory has any custom metadata attached (xattr, JSON or RDF). | |||||||||
hasJsonMetadata boolean Indicates whether this file/directory has any JSON custom metadata attached. | |||||||||
jsonMetadata object JSON metadata associated with the file. Special cases:
| |||||||||
xattr.* string Value of requested extended attribute key ( | |||||||||
Example
{
"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,
"hasJsonMetadata": true,
"effProtectionFlags": [
"data_protection",
"metadata_protection"
],
"effDatasetProtectionFlags": [
"data_protection"
],
"effDatasetInheritancePath": "direct_and_ancestor",
"effQosInheritancePath": "ancestor",
"aggregateQosStatus": "fulfilled",
"archiveRecallRootFileId": "000006431633765446F4D76546D6F47067D67686431633765446F4D76546D6....",
"jsonMetadata": {
"key": "value"
},
"xattr.key1": "value1",
"xattr.key2": null
}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
}
}
}File 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
}
}
}