Onedata API Reference

REST API references for Onezone, Oneprovider, and Onepanel.

Get space user metrics

GET /metrics/space/{sid}/user/{uid}

Returns space related metrics of specified type for specific user.

This operation requires space_view_statistics privilege.

Example cURL requests

Get user storage block access metrics with 1 hour resolution

curl -X GET -H "X-Auth-Token: $TOKEN" \
"https://$HOST/api/v3/oneprovider/metrics/space/$SPACE_ID/user/$USER_ID?metric=block_access&step=1h"

{
  "providerId": "4efc4a0c-0a61-4766-8fe9-c3d7fb414da8",
  "rrd": {
      "about": "RRDtool graph JSON output",
      "data": [[ 5.6435528434 ], [ 2.6435528434 ], [ 4.6435528434 ] ],
      "meta": {
          "start": 1465466700,
          "end": 1465553100,
          "legend": ["space fe14b4cc-bce0-4220-8394-a911d11a0a53; metric storage_used; oneprovider Id 4efc4a0c-0a61-4766-8fe9-c3d7fb414da8; storage_used[bytes]"],
          "step": 3600
      }
    }
}

Path parameters

Parameter Type & Description
sid required
string

Id of a specific space for which the monitoring metrics should be retrieved.

uid required
string

Id of a specific user within a space for which the monitoring metrics should be limited to.

Query parameters

Parameter Type & Description
metric required
string

The type of metrics to retrieve.

step
string

The resolution of the monitoring data to return - default is 5m [5 minutes].

Request Examples

Shell
oneprovider-rest-cli -ac xml getSpaceUserMetrics sid=$SPACE_ID uid=$USER_ID metric=metadata_access_ops step=1h

Responses

application/json
200

The monitoring data retrieved in the form of RRD record exported to JSON or XML.

No schema provided.

400

Invalid request.

PropertyType & Description
error
string

Identifier representing internal error code.

error_description
string

Detailed error message.

Example

application/json
{
  "error": "invalid_token",
  "error_description": "Provided token could not be validated."
}
403

Forbidden request.

PropertyType & Description
error
string

Identifier representing internal error code.

error_description
string

Detailed error message.

Example

application/json
{
  "error": "invalid_token",
  "error_description": "Provided token could not be validated."
}
404

Oneprovider REST API not available.

PropertyType & Description
error
string

Identifier representing internal error code.

error_description
string

Detailed error message.

Example

application/json
{
  "error": "invalid_token",
  "error_description": "Provided token could not be validated."
}
500

Internal server error.

PropertyType & Description
error
string

Identifier representing internal error code.

error_description
string

Detailed error message.

Example

application/json
{
  "error": "invalid_token",
  "error_description": "Provided token could not be validated."
}