Onedata API Reference

REST API references for Onezone, Oneprovider, and Onepanel.

Get space metrics

GET /metrics/space/{sid}

Returns space related metrics of specified type.

This operation requires space_view_statistics privilege.

Example cURL requests

Get storage space used metrics

curl -X GET -H "X-Auth-Token: $TOKEN" \
"https://$HOST/api/v3/oneprovider/metrics/space/$SPACE_ID?metric=storage_used"

{
  "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 f4f1799f-4954-4d7a-bc31-630998883296; metric storage_used; oneprovider Id 4efc4a0c-0a61-4766-8fe9-c3d7fb414da8; storage_used[bytes]"],
          "step": 300
      }
    }
}

Path parameters

Parameter Type & Description
sid required
string

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

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 json getSpaceMetrics sid=$SPACE_ID metric=storage_quota step=5m

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."
}