Go to main content

Oracle® ZFS Storage Appliance RESTful API Guide, Release OS8.8.0

Exit Print View

Updated: November 2018
 
 

Analytics Datasets

Analytics datasets use the following properties. All properties except for suspended are immutable.

Property
Description
name
Name of the underlying statistic for this dataset
grouping
Group to which this statistic belongs
explanation
Explanation of underlying statistic
incore
Bytes of dataset data in-core
size
Bytes of dataset data on-disk
suspended
Boolean indicating whether dataset is currently suspended
activity
Pending dataset activity flag

Available datasets:

  • arc.accesses[hit/miss]

  • arc.l2_accesses[hit/miss]

  • arc.l2_size

  • arc.size

  • arc.size[component]

  • cpu.utilization

  • cpu.utilization[mode]

  • dnlc.accesses[hit/miss]

  • fc.bytes

  • fc.ops

  • ftp.kilobytes

  • http.reqs

  • io.bytes

  • io.bytes[op]

  • io.disks[utilization=95][disk]

  • io.ops

  • io.ops[disk]

  • io.ops[op]

  • iscsi.bytes

  • iscsi.ops

  • metacap.bytesused

  • metacap.percentused

  • ndmp.diskkb

  • nfs2.ops

  • nfs2.ops[op]

  • nfs3.ops

  • nfs3.ops[op]

  • nfs4.ops

  • nfs4.ops[op]

  • nfs4-1.ops

  • nfs4-1.bytes

  • nic.kilobytes

  • nic.kilobytes[device]

  • nic.kilobytes[direction]

  • sftp.kilobytes

  • smb.ops

  • smb.ops[op]

List Datasets

Lists all configured analytic datasets.

Example Request:

GET /api/analytics/v1/datasets HTTP/1.1
Authorization: Basic ab6rt4psMWE=
Host: zfs-storage.example.com:215
Accept: application/json

Example Results:

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 237
X-Zfssa-Analytics-Api: 1.0

{
    "datasets": [{
        "dataset": "dataset-000",
        "href": "/api/analytics/v1/datasets/arc.accesses[hit/miss]",
        "name": "arc.accesses[hit/miss]"
    }, {
        "dataset": "dataset-001",
        "href": "/api/analytics/v1/datasets/arc.l2_accesses[hit/miss]",
        "name": "arc.l2_accesses[hit/miss]",
    }, {
        "dataset": "dataset-002",
        "href": "/api/analytics/v1/datasets/arc.l2_size",
        "name": "arc.l2_size",
    }, {
        "dataset": "dataset-003",
        "href": "/api/analytics/v1/datasets/arc.size",
        "name": "arc.size",
    }, {
        "dataset": "dataset-004",
        "href": "/api/analytics/v1/datasets/arc.size[component]",
        "name": "arc.size[component]",
    }, {
        ...
    }]
}

Get Dataset

Gets properties from the specified dataset.

Example Request:

GET /api/analytics/v1/datasets/nfs4.ops HTTP/1.1
Authorization: Basic ab6rt4psMWE=
Host: zfs-storage.example.com:215
Accept: application/json

Example Results:

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 237
X-Zfssa-Analytics-Api: 1.0

{
    "dataset": {
        "activity": "none",
        "dataset": "dataset-030",
        "explanation": "NFSv4 operations per second",
        "grouping": "Protocol",
        "href": "/api/analytics/v1/datasets/nfs4.ops",
        "incore": 296128,
        "name": "nfs4.ops",
        "size": 53211540,
        "suspended": false
    }
}

Create Datasets

Creates a new dataset.

Example Request:

POST /api/analytics/v1/datasets HTTP/1.1
X-Auth-User: root
X-Auth-Key: password
Content-Type: application/json
Content-Length: 26

{"statistic": "test.sine"}

Example Results:

HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 200
Location: /api/analytics/v1/datasets/test.sine

{
    "dataset":{
        "href": "/api/analytics/v1/datasets",
        "name": "test.sine",
        "grouping": "Test",
        "explanation": "sine per second",
        "incore": 34752,
        "size": 31912,
        "suspended": false,
        "activity": "none"
    }
}

Modify Dataset

The modify dataset command is used to suspend or resume data collection of a single dataset.

Example Suspend Request:

POST /api/analytics/v1/datasets/nfs4.ops

{"suspended":true}

Example Resume Request:

POST /api/analytics/v1/datasets/nfs4.ops
        {"suspended":false}

Example Response:

HTTP/1.1 202 Accepted
Content-Type: application/json
Content-Length: 228
X-Zfssa-Analytics-Api: 1.0

{
    "dataset" {
        ...
        "suspended": false
    }
}

Destroy Datasets

Destroys a dataset.

Example Request:

DELETE /api/analytics/v1/datasets/test.sine HTTP/1.1

Example Response:

HTTP/1.1 204 No Content
X-Zfssa-Analytics-Api: 1.0

Save Dataset

Saves a dataset.

Example Request:

PUT /api/analytics/v1/datasets/nfs4.ops/data

Example Response:

HTTP/1.1 202 Accepted

Prune Dataset Data

The following table shows query parameters that are used in pruning datasets.

Parameter
Description
granularity
Prune granularity. The data within a dataset can be pruned at a granularity value of second, minute, or hour.
endtime
Prune data collected prior to the given endtime. The endtime is an ISO 8601 time/date string such as 20130531T01:13:58.

Example Request:

DELETE /api/analytics/v1/datasets/nfs4.ops/data?granularity=hour

Example Response:

HTTP/1.1 204 No Content

Get Dataset Data

Gets data from an analytic dataset. Both per-second and granular data retrieval are supported.

The following table shows time-based query parameters for getting dataset data.

Parameter
Description
start
The time to start collecting sample data. The default value is the current time.
seconds
Number of seconds to collect sample data. The default value is 1. The seconds parameter is ignored if the span and interval parameters are specified.
span
Duration of time to collect sample data: minute, hour, day, week, month, or year.
granularity
The granularity within a given span from which the average of data points is given: minute, hour, day, week, month, or year.

If the start parameter is not supplied, the start time is set to the current time minus the number of seconds of sample data specified. The start time cannot be in the future. If the number of seconds to collect data goes beyond the current time, the server waits for each sample before returning the data.

To retrieve granular data, use a combination of parameters span and granularity. When span and granularity are used, the seconds parameter is ignored. If either span or granularity is entered incorrectly, the request is ignored and the seconds parameter is used instead. An incorrect or unsupported request displays the error message "Input span and granularity are not supported."

The following list describes how the span and granularity parameters can be combined:

  • If span is minute, granularity can only be minute.

  • If span is hour, granularity can be minute or hour.

  • If span is day, granularity can be minute, hour, or day.

  • If span is week, granularity can be hour, day, or week.

  • If span is month, granularity can be day, week, or month.

  • If span is year, granularity can be week, month, or year.

The following table shows the dataset data properties that are returned.

Property
Description
startTime
The time of the first sample returned
sample
The sample index of the first sample returned
data
Array of sample data
min
The minimum value per second within the specified granularity
max
The maximum value per second within the specified granularity

The startTime property can be in one of the following formats:

  • An ISO 8601 time/date string (for example, 20130531T01:13:58)

  • Sample index number

  • The string literal now

Example request to collect three seconds of live data:

GET /api/analytics/v1/datasets/nfs4.ops%5Bfile%5D/data?start=now&seconds=3 HTTP/1.1
Authorization: Basic ab6rt4psMWE=
Host: zfs-storage.example.com:215
Accept: text/x-yaml

Example Results:

HTTP/1.1 200 OK
Content-Type: text/x-yaml
X-Zfssa-Analytics-Api: 1.0
Transfer-Encoding: chunked

---
data:
  - sample: 239024557
    data:
        value:      5
    startTime:      20130912T21:42:38
    samples:        239024558

  - sample: 239024558
    data:
        value:      15
    startTime:      20130912T21:42:39
    samples:        239024559

  - sample: 239024559
    data:
        value:      25
    startTime:      20130912T21:42:40
    samples:        239024560

size:       3
---

Example request to collect seven days of live data within the span of one week:

GET /api/analytics/v1/datasets/nfs4.ops%5Bfile%5D/data?start=239024557&span=week&granularity=day
    HTTP/1.1 
Authorization: Basic ab6rt4psMWE= 
Host: zfs-storage.example.com:215
Accept: text/x-yaml

Example Results:

HTTP/1.1 200 OK
Content-Type: text/x-yaml
X-Zfssa-Analytics-Api: 1.0
Transfer-Encoding: chunked

---
data:   
  - sample: 239024557     
    data:        
       value:      5     
    max:        79     
    min:        0
    startTime:      20130912T21:42:38     
    samples:        240074328
 
  - sample: 239110957     
    data:         
        value:      15
     max:        150     
     min:        1    
     startTime:      20130913T21:42:38     
     samples:        240074328

    ... 

   - sample: 239629357     
     data:         
         value:      25
     max:        120     
     min:        2    
     startTime:      20130914T21:42:38     
     samples:        240074328

size:       7