Get file attributes
This method returns either all or only selected basic attributes associated with file specified by $FILE_ID.
Example cURL requests
Get file size
curl -H "X-Auth-Token: $TOKEN" \
-X GET "https://$HOST/api/v3/oneprovider/data/$FILE_ID?attribute=size"
{
"size": 100
}
Path parameters
| Parameter | Type & Description |
|---|---|
| id required | string File, directory or space Id |
Query parameters
| Parameter | Type & Description |
|---|---|
| attribute | string Name of attribute to query for. When accessing file via share mode following attributes are unavailable: |
Request Examples
oneprovider-rest-cli getAttrs id=$FILE_IDResponses
Returns the requested file attributes.
File name.
Type of the file.
POSIX file permissions in decimal format
Size of the file in bytes.
Last access timestamp (in seconds).
Last modification timestamp (in seconds).
Last attributes modification timestamp (in seconds).
Id of the owner of this file.
Id of the file.
Id of the provider on which this file was created.
Id of the owner of this file on storage.
Id of the group owner of this file on storage.
The list of Ids of shares created for this file.
Example
{
"name": "File1.txt",
"type": "reg",
"mode": 511,
"size": 1024,
"atime": 1464958683054,
"mtime": 1464958683051,
"ctime": 1464958681054,
"owner_id": "MTZjYzc1ZWEtN2ZjNC00Y2QxLTljYzgtMTJmYTMxNTk1YzUw",
"file_id": "NjIwZTE2NDItNGYyZC00NWYyLWI0ZWItMzdmOGE5NThiNDZm",
"provider_id": "YzQ3OThlYjItZGJkMi00ODZmLWFlOTQtMGU2ZmEwYTUwNzFk",
"storage_user_id": 1935313,
"storage_group_id": 1101841,
"shares": [
"1d24c36707d99197c6cd995810a43aca",
"6825604b0eb6a47b8b7a04b6369eb24d"
]
}Invalid request.
Identifier representing internal error code.
Detailed error message.
Example
{
"error": "invalid_token",
"error_description": "Provided token could not be validated."
}Forbidden request.
Identifier representing internal error code.
Detailed error message.
Example
{
"error": "invalid_token",
"error_description": "Provided token could not be validated."
}File not found.
Identifier representing internal error code.
Detailed error message.
Example
{
"error": "invalid_token",
"error_description": "Provided token could not be validated."
}Internal server error.
Identifier representing internal error code.
Detailed error message.
Example
{
"error": "invalid_token",
"error_description": "Provided token could not be validated."
}