|
All properties except for suspended are immutable.
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]
Lists all configured analytic datasets.
Example Request:
GET /api/analytics/v1/datasets HTTP/1.1 Authorization: Basic ab6rt4psMWE= Host: example.zfssa.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]", }, { ... }] }
Gets properties from the specified dataset.
Example Request:
GET /api/analytics/v1/datasets/nfs4.ops HTTP/1.1 Authorization: Basic ab6rt4psMWE= Host: example.zfssa.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 } }
Creates a new dataset.
Example Request:
POST /api/analytics/v1/datasets HTTP/1.1 X-Auth-User: root X-Auth-Key: letmein 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" } }
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 } }
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
Saves a dataset.
Example Request:
PUT /api/analytics/v1/datasets/nfs4.ops/data
Example Response:
HTTP/1.1 202 Accepted
The data within a dataset can be pruned at a granularity value of second, minute, or hour.
|
The endtime is an ISO 8601 time/date string (e.g. 20130531T01:13:58)
Example Request:
DELETE /api/analytics/v1/datasets/nfs4.ops/data?granularity=hour
Example Response:
HTTP/1.1 204 No Content
Gets data from an analytic dataset. Both per-second and granular data retrieval are supported.
|
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 interval, as shown in the following table. When these parameters are used, the seconds parameter is ignored, even if set.
|
If either parameter 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 table shows the dataset data properties that are returned.
|
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: example.zfssa.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&interval=day HTTP/1.1 Authorization: Basic ab6rt4psMWE= Host: example.zfssa.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