Get file attributes
This method returns either all or only selected basic attributes associated with specified file, directory or space.
To lookup file Id using file path, please use this endpoint.
Example cURL requests
Get file size
curl -X GET -H "X-Auth-Token: $TOKEN" \
"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.
| Property | Type & Description |
|---|---|
name string File name. | |
type string Type of the file. Enum: regdirlnk | |
mode integer POSIX file permissions in decimal format | |
size integer Size of the file in bytes. | |
atime integer Last access timestamp (in seconds). | |
mtime integer Last modification timestamp (in seconds). | |
ctime integer Last attributes modification timestamp (in seconds). | |
owner_id string Id of the owner of this file. | |
file_id string Id of the file. | |
provider_id string Id of the provider on which this file was created. | |
storage_user_id string Id of the owner of this file on storage. | |
storage_group_id string Id of the group owner of this file on storage. | |
shares array of strings 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.
| Property | Type & Description |
|---|---|
error string Identifier representing internal error code. | |
error_description string Detailed error message. | |
Example
{
"error": "invalid_token",
"error_description": "Provided token could not be validated."
}Forbidden request.
| Property | Type & Description |
|---|---|
error string Identifier representing internal error code. | |
error_description string Detailed error message. | |
Example
{
"error": "invalid_token",
"error_description": "Provided token could not be validated."
}File not found.
| Property | Type & Description |
|---|---|
error string Identifier representing internal error code. | |
error_description string Detailed error message. | |
Example
{
"error": "invalid_token",
"error_description": "Provided token could not be validated."
}Internal server error.
| Property | Type & Description |
|---|---|
error string Identifier representing internal error code. | |
error_description string Detailed error message. | |
Example
{
"error": "invalid_token",
"error_description": "Provided token could not be validated."
}