Get file JSON metadata
This method returns the JSON metadata associated with file specified by $FILE_ID.
By default the method returns the complete JSON metadata. But it is possible to request
only a part of the document by specifying filter_type and filter attributes in the query.
If there is no JSON metadata associated with the file, this method returns HTTP 400
code with enodata POSIX error.
Supported filter types are:
- keypath - list of JSON keys which point to requested JSON object,
separated by
., array elements should be expressed as[i](e.g.key1.key2.[2].key3)
Example cURL requests
Get specific JSON value from metadata document
curl -H "X-Auth-Token: $TOKEN" \
-X GET https://$PROVIDER_HOST/api/v3/oneprovider/data/$FILE_ID/metadata/json?filter_type=keypath&filter=key1.key2.[2].key3
{"key4": "value"}
Path parameters
| Parameter | Type & Description |
|---|---|
| id required | string Id of the file. |
Query parameters
| Parameter | Type & Description |
|---|---|
| filter_type | string The type of filter to apply to the metadata document. |
| filter | string The filter to apply to the metadata document before returning. Required if |
| inherited | boolean When set to true, this operation will merge the metadata documents from parent directories as well as entire space into a single JSON document. |
| resolve_symlink | boolean Indicates whether the operation should be performed on the symbolic link itself ( |
Request Examples
oneprovider-rest-cli getJsonMetadata id=$FILE_ID inherited=falseResponses
JSON metadata.
No schema provided.
No JSON metadata associated with the file or invalid request.
No schema provided.
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
}
}
}