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 -H "X-Auth-Token: $TOKEN" \
-X GET "https://$HOST/api/v3/oneprovider/metrics/space/$SPACE_ID?metric=storage_used"

{
  "providerId": "a0b1d2e6ad583ba1b14caf3b71bc6129ch4f74",
  "rrd": {
      "about": "RRDtool graph JSON output",
      "data": [[ 5.6435528434 ], [ 2.6435528434 ], [ 4.6435528434 ] ],
      "meta": {
          "start": 1465466700,
          "end": 1465553100,
          "legend": ["space fb519d81146bcc635b890ff03a5da0fdch34fe; metric storage_used; oneprovider Id a0b1d2e6ad583ba1b14caf3b71bc6129ch4f74; 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.

Property
Type & 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.

Property
Type & 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.

Property
Type & 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.

Property
Type & 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."
}