Onedata API Reference

REST API references for Onezone, Oneprovider, and Onepanel.

Get shared file or directory info

HEAD /shares/data/{file_id}/{subpath}

HEAD counterpart of Get shared file or directory data. Redirects (in the same way as the GET variant) to the corresponding REST endpoint in one of the supporting Oneproviders, so that the request can be served without any authentication. The provided query string (if any) is preserved during redirection.

In practice, HEAD is only meaningful for the {...}/$FILE_ID/content subpath and only for regular files, where it returns content headers such as Content-Length and Accept-Ranges (see the Oneprovider REST endpoint). It is not supported for directories, since the resulting TAR archive is created on the fly and its Content-Length cannot be determined up front.

The endpoint will return 503 Service Unavailable when there is no suitable Oneprovider to handle the request and 501 Not Implemented when all available Oneproviders are in versions older than 20.02.*. If an invalid subpath is requested, the target Oneprovider will respond with a proper error.

Example cURL requests

Get shared file content headers

curl -v -I https://$ZONE_HOST/api/v3/onezone/shares/data/$FILE_ID/content

< HTTP/1.1 307 Temporary Redirect
< location: https://provider.example.com/api/v3/oneprovider/data/$FILE_ID/content

# automatically follow redirects with -L option
curl -L -I https://$ZONE_HOST/api/v3/onezone/shares/data/$FILE_ID/content

HTTP/1.1 200 OK
content-length: 15
accept-ranges: bytes

Path parameters

Parameter Type & Description
file_id required
string

Shared file/directory Id.

subpath required
string

Subpath corresponding to desired Oneprovider REST API operation.

Request Examples

Shell
onezone-rest-cli getSharedDataInfo file_id=000000000055D4E4836803640004677569646D00 subpath='content'

Responses

application/json
307

Redirection to one of the supporting providers in the response Location header.

400

Invalid request.

Property
Type & Description
error
object

Object describing an error.

id required
string

String identifying the error type. Does not change between error instances.

description required
string

Human readable error description. May contain information specific to given error instance.

details
object

Details about the error instance. The object schema is specific to each error type.

Example

application/json
{
  "error": {
    "id": "badValueString",
    "details": {
      "key": "name"
    },
    "description": "Bad value: provided \"name\" must be a string."
  }
}
401

Authentication error.

Property
Type & Description
error
object

Object describing an error.

id required
string

String identifying the error type. Does not change between error instances.

description required
string

Human readable error description. May contain information specific to given error instance.

details
object

Details about the error instance. The object schema is specific to each error type.

Example

application/json
{
  "error": {
    "id": "badValueString",
    "details": {
      "key": "name"
    },
    "description": "Bad value: provided \"name\" must be a string."
  }
}
403

Authorization error.

Property
Type & Description
error
object

Object describing an error.

id required
string

String identifying the error type. Does not change between error instances.

description required
string

Human readable error description. May contain information specific to given error instance.

details
object

Details about the error instance. The object schema is specific to each error type.

Example

application/json
{
  "error": {
    "id": "badValueString",
    "details": {
      "key": "name"
    },
    "description": "Bad value: provided \"name\" must be a string."
  }
}
404

Resource not found.

Property
Type & Description
error
object

Object describing an error.

id required
string

String identifying the error type. Does not change between error instances.

description required
string

Human readable error description. May contain information specific to given error instance.

details
object

Details about the error instance. The object schema is specific to each error type.

Example

application/json
{
  "error": {
    "id": "badValueString",
    "details": {
      "key": "name"
    },
    "description": "Bad value: provided \"name\" must be a string."
  }
}
500

Internal server Error.

Property
Type & Description
error
object

Object describing an error.

id required
string

String identifying the error type. Does not change between error instances.

description required
string

Human readable error description. May contain information specific to given error instance.

details
object

Details about the error instance. The object schema is specific to each error type.

Example

application/json
{
  "error": {
    "id": "badValueString",
    "details": {
      "key": "name"
    },
    "description": "Bad value: provided \"name\" must be a string."
  }
}
501

Not Implemented - all available providers are in versions older than 20.02.*.

Property
Type & Description
error
object

Object describing an error.

id required
string

String identifying the error type. Does not change between error instances.

description required
string

Human readable error description. May contain information specific to given error instance.

details
object

Details about the error instance. The object schema is specific to each error type.

Example

application/json
{
  "error": {
    "id": "badValueString",
    "details": {
      "key": "name"
    },
    "description": "Bad value: provided \"name\" must be a string."
  }
}
503

Service Unavailable - there is no suitable provider to handle the request.

Property
Type & Description
error
object

Object describing an error.

id required
string

String identifying the error type. Does not change between error instances.

description required
string

Human readable error description. May contain information specific to given error instance.

details
object

Details about the error instance. The object schema is specific to each error type.

Example

application/json
{
  "error": {
    "id": "badValueString",
    "details": {
      "key": "name"
    },
    "description": "Bad value: provided \"name\" must be a string."
  }
}