{
"agentHost": "192.168.50.104",
"agentPassword": "varnish",
"agentPort": 46085,
"agentUsername": "varnish",
"created": "2017-08-08T16:15+0200",
"dash_n": "cache4",
"description": "",
"groupId": "59d623cabf085f6187eb9d5f",
"groupName": "alfredo",
"id": "5989c76d436cde7136986b36",
"name": "192.168.50.104:46085_cache4",
"status": "",
"timestamp": "2017-10-16T11:38+0200",
"varnishName": "varnish",
"varnishRevision": "d266ac5c6",
"varnishVersion": "4.1.8",
"version": ""
}
{
"caches": [
{
"agentHost": "192.168.50.104",
"agentPassword": "varnish",
"agentPort": 46085,
"agentUsername": "varnish",
"created": "2017-08-08T16:15+0200",
"dash_n": "cache4",
"description": "",
"groupId": "59d623cabf085f6187eb9d5f",
"groupName": "alfredo",
"id": "5989c76d436cde7136986b36",
"name": "192.168.50.104:46085_cache4",
"status": "",
"timestamp": "2017-10-16T11:38+0200",
"varnishName": "varnish",
"varnishRevision": "d266ac5c6",
"varnishVersion": "4.1.8",
"version": ""
},
{
"agentHost": "192.168.50.103",
"agentPassword": "varnish",
"agentPort": 36085,
"agentUsername": "varnish",
"created": "2017-08-08T16:15+0200",
"dash_n": "cache3",
"description": "",
"groupId": "59d623cabf085f6187eb9d5f",
"groupName": "alfredo",
"id": "5989c77e436cde7136986b3a",
"name": "192.168.50.103:36085_cache3",
"status": "",
"timestamp": "2017-10-16T11:34+0200",
"varnishName": "varnish",
"varnishRevision": "d266ac5c6",
"varnishVersion": "4.1.8",
"version": ""
},
{
"agentHost": "127.0.0.1",
"agentPassword": "varnish",
"agentPort": 17085,
"agentUsername": "varnish",
"created": "2017-08-08T16:15+0200",
"dash_n": "c1",
"description": "",
"groupId": "59d623cabf085f6187eb9d5f",
"groupName": "alfredo",
"id": "5989c787436cde7136986b3e",
"name": "127.0.0.1:17085_c1",
"status": "",
"timestamp": "2017-10-16T11:37+0200",
"varnishName": "varnish-plus",
"varnishRevision": "ba23f33",
"varnishVersion": "4.1.7r3",
"version": ""
},
{
"agentHost": "192.168.50.101",
"agentPassword": "varnish",
"agentPort": 16085,
"agentUsername": "varnish",
"created": "2017-08-08T16:23+0200",
"dash_n": "cache1",
"description": "",
"groupId": null,
"groupName": "all",
"id": "5989c94f436c77379fbb9e62",
"name": "192.168.50.101:16085_cache1",
"status": "",
"timestamp": "2017-10-05T14:21+0200",
"varnishName": "varnish",
"varnishRevision": "07eff4c29",
"varnishVersion": "4.0.5",
"version": ""
}
]
}
api/v1/cache/1/2
{page_number}=1
{items_per_page}=2
{
"list": [
{
"agentHost": "192.168.50.104",
"agentPassword": "varnish",
"agentPort": 46085,
"agentUsername": "varnish",
"created": "2017-08-08T16:15+0200",
"dash_n": "cache4",
"description": "",
"groupId": "59d623cabf085f6187eb9d5f",
"groupName": "alfredo",
"id": "5989c76d436cde7136986b36",
"name": "192.168.50.104:46085_cache4",
"status": "",
"timestamp": "2017-10-16T11:38+0200",
"varnishName": "varnish",
"varnishRevision": "d266ac5c6",
"varnishVersion": "4.1.8",
"version": ""
},
{
"agentHost": "127.0.0.1",
"agentPassword": "varnish",
"agentPort": 17085,
"agentUsername": "varnish",
"created": "2017-08-08T16:15+0200",
"dash_n": "c1",
"description": "",
"groupId": "59d623cabf085f6187eb9d5f",
"groupName": "alfredo",
"id": "5989c787436cde7136986b3e",
"name": "127.0.0.1:17085_c1",
"status": "",
"timestamp": "2017-10-16T11:37+0200",
"varnishName": "varnish-plus",
"varnishRevision": "ba23f33",
"varnishVersion": "4.1.7r3",
"version": ""
}
]
}
{
"agentHost": "192.168.50.104",
"agentPassword": "varnish",
"agentPort": 46085,
"agentUsername": "varnish",
"created": "2017-08-08T16:15+0200",
"dash_n": "cache4",
"description": "",
"groupId": "59d623cabf085f6187eb9d5f",
"groupName": "alfredo",
"id": "5989c76d436cde7136986b36",
"name": "192.168.50.104:46085_cache4",
"status": "",
"timestamp": "2017-10-16T11:38+0200",
"varnishName": "varnish",
"varnishRevision": "d266ac5c6",
"varnishVersion": "4.1.8",
"version": ""
}
For example it can be sent via curl to cache with id 57a0a98b4a2abf4cba82954f
and default backend:
curl -X PUT -H "Content-Type: application/json"
-u vac:vac
http://localhost:8080/api/v1/cache/57a0a98b4a2abf4cba82954f/setbackend/default/healthy
Note that PATCH is supported. This means that values are merged and unsupported fields are ignored.
Note that foreign key relations are ignored. Explicit API calls are put in place to support these relationships.
For example, the payload could be:
{"name":"varnish-cache-renamed"}
{"name":"varnish-cache-renamed"}
Note that the archive follows the Fibonacci sequence to maximise coverage.
The default {counter}
set are as follows.
The {consolfunc}
function can take the following values:
{
"counter": "cache_hit",
"values": [
{
"time": 1383551626,
"value": 1213
},
{
"time": 1383551627,
"value": 1532
}
]
}
The following samples are supported.
Note that the archive follows the Fibonacci sequence to maximize coverage.
The {consolfunc}
function are as follows.
{
"stats": [
{
"counter": "cache_hit",
"values": [
{
"time": 1383551660,
"value": 1303
},
{
"time": 1383551661,
"value": 1248
}
]
},
{
"counter": "cache_miss",
"values": [
{
"time": 1383551660,
"value": 1333
},
{
"time": 1383551661,
"value": 1220
}
]
},
{
"counter": "cache_hitpass",
"values": [
{
"time": 1383551660,
"value": 1407
},
{
"time": 1383551661,
"value": 1194
}
]
},
{
"counter": "client_req",
"values": [
{
"time": 1383551660,
"value": 1454
},
{
"time": 1383551661,
"value": 1195
}
]
},
{
"counter": "s_hdrbytes",
"values": [
{
"time": 1383551660,
"value": 1521
},
{
"time": 1383551661,
"value": 1121
}
]
},
{
"counter": "s_bodybytes",
"values": [
{
"time": 1383551660,
"value": 1498
},
{
"time": 1383551661,
"value": 1138
}
]
},
{
"counter": "client_conn",
"values": [
{
"time": 1383551660,
"value": 1525
},
{
"time": 1383551661,
"value": 1104
}
]
},
{
"counter": "backend_fail",
"values": [
{
"time": 1383551660,
"value": 1490
},
{
"time": 1383551661,
"value": 1168
}
]
},
{
"counter": "n_wrk_drop",
"values": [
{
"time": 1383551660,
"value": 1458
},
{
"time": 1383551661,
"value": 1185
}
]
},
{
"counter": "client_drop",
"values": [
{
"time": 1383551660,
"value": 1424
},
{
"time": 1383551661,
"value": 1204
}
]
},
{
"counter": "n_wrk_queued",
"values": [
{
"time": 1383551660,
"value": 1389
},
{
"time": 1383551661,
"value": 1230
}
]
},
{
"counter": "n_lru_nuked",
"values": [
{
"time": 1383551660,
"value": 1311
},
{
"time": 1383551661,
"value": 1302
}
]
},
{
"counter": "SMF.s0.c_bytes",
"values": [
{
"time": 1383551660,
"value": 1276
},
{
"time": 1383551661,
"value": 1277
}
]
}
]
}
The following samples are supported.
Note that the archive follows the Fibonacci sequence to maximize coverage.
The default graph supported are as follows.
The purpose of the graph is the group counters with a name.
The consolidation function are as follows.
avghitratio
graph is as follows:
{
"avghitratio": [
{
"cache_hit": 1150,
"cache_hitpass": 1211,
"cache_miss": 1204,
"client_req": 1264,
"time": 1385107726
},
{
"cache_hit": 1474,
"cache_hitpass": 1375,
"cache_miss": 1392,
"client_req": 1377,
"time": 1385107727
}
]
}
This is the same value as issuing the following on the command line:
> date +%s
Query RRD for past data in the vac. The following samples are supported.
The default counter set are as follows.
The consolidation function are as follows.
{
"counter": "cache_hit",
"values":
[
{
"time": 1383551626,
"value": 1213
},
{
"time": 1383551627,
"value": 1532
}
]
}
This is the same value as issuing the following on the command line:
> date +%s
Query RRD for past data in the vac. The following samples are supported.
The consolidation function are as follows.
{
"stats": [
{
"counter": "cache_hit",
"values": [
{
"time": 1383551660,
"value": 1303
},
{
"time": 1383551661,
"value": 1248
}
]
},
{
"counter": "cache_miss",
"values": [
{
"time": 1383551660,
"value": 1333
},
{
"time": 1383551661,
"value": 1220
}
]
},
{
"counter": "cache_hitpass",
"values": [
{
"time": 1383551660,
"value": 1407
},
{
"time": 1383551661,
"value": 1194
}
]
},
{
"counter": "client_req",
"values": [
{
"time": 1383551660,
"value": 1454
},
{
"time": 1383551661,
"value": 1195
}
]
},
{
"counter": "s_hdrbytes",
"values": [
{
"time": 1383551660,
"value": 1521
},
{
"time": 1383551661,
"value": 1121
}
]
},
{
"counter": "s_bodybytes",
"values": [
{
"time": 1383551660,
"value": 1498
},
{
"time": 1383551661,
"value": 1138
}
]
},
{
"counter": "client_conn",
"values": [
{
"time": 1383551660,
"value": 1525
},
{
"time": 1383551661,
"value": 1104
}
]
},
{
"counter": "backend_fail",
"values": [
{
"time": 1383551660,
"value": 1490
},
{
"time": 1383551661,
"value": 1168
}
]
},
{
"counter": "n_wrk_drop",
"values": [
{
"time": 1383551660,
"value": 1458
},
{
"time": 1383551661,
"value": 1185
}
]
},
{
"counter": "client_drop",
"values": [
{
"time": 1383551660,
"value": 1424
},
{
"time": 1383551661,
"value": 1204
}
]
},
{
"counter": "n_wrk_queued",
"values": [
{
"time": 1383551660,
"value": 1389
},
{
"time": 1383551661,
"value": 1230
}
]
},
{
"counter": "n_lru_nuked",
"values": [
{
"time": 1383551660,
"value": 1311
},
{
"time": 1383551661,
"value": 1302
}
]
},
{
"counter": "SMF.s0.c_bytes",
"values": [
{
"time": 1383551660,
"value": 1276
},
{
"time": 1383551661,
"value": 1277
}
]
}
]
}
> date +%s
Query RRD for past data in the vac. The following samples are supported.
The default graph supported are as follows.
The purpose of the graph is the group counters with a name.
The consolidation function are as follows.
avghitratio
graph is as follows:
{
"avghitratio": [
{
"cache_hit": 1150,
"cache_hitpass": 1211,
"cache_miss": 1204,
"client_req": 1264,
"time": 1385107726
},
{
"cache_hit": 1474,
"cache_hitpass": 1375,
"cache_miss": 1392,
"client_req": 1377,
"time": 1385107727
}
]
}
{
"param_changeset": {},
"param_consistent": true,
"responseStatus": 200,
"responseString": "",
"vcl_consistent": true,
"vcl_name": ""
}
{
"panic": "Child has not panicked or panic has been cleared",
"paramChangeset": {
"group": {
"default": "",
"description": "The unprivileged group to run as...",
"unit": "",
"value": "nobody (-2)"
},
"listen_address": {
"default": ":80",
"description": "Whitespace separated list of...",
"unit": "",
"value": "localhost:6080"
},
"user": {
"default": "",
"description": "The unprivileged user to run as...",
"unit": "",
"value": "nobody (-2)"
},
"waiter": {
"default": "default",
"description": "Select the waiter kernel interface...",
"unit": "",
"value": "default (kqueue, poll)"
}
},
"ping": "PONG 1369746345 1.0",
"responseStatus": 200,
"responseString": "",
"status": "Child in state running",
"vclList": {
"vcls": [
{
"name": "boot",
"refs": "0",
"status": "active"
}
]
}
}
{
"acceptor_sleep_decay": {
"default": "0.900",
"description": "If we run out of resources, such as...",
"unit": "",
"value": "0.666000"
},
"acceptor_sleep_incr": {
"default": "0.001",
"description": "If we run out of resources, such as ...",
"unit": "s",
"value": "0.001000"
},
...
}
{
"group": {
"default": "",
"description": "The unprivileged group to run as...",
"unit": "",
"value": "nobody (-2)"
},
"listen_address": {
"default": ":80",
"description": "Whitespace separated list of network endpoints...",
"unit": "",
"value": "localhost:6080"
},
"user": {
"default": "",
"description": "\nThe unprivileged user to run as...",
"unit": "",
"value": "nobody (-2)"
}
}
For example, a vcl.list command can be sent via curl to cache with id 52769fe7b2da640380243e4c
:
curl -X POST -H "Content-Type: text/plain"
-u vac:vac
http://localhost:8080/api/v1/cache/52769fe7b2da640380243e4c/varnishadm
-d "vcl.list" -v
{
"message": "\nactive 0 boot\n"
}
Note that the formatting is “as-is” from varnishadm.
For example, a vcl.list command can issued to the cache with id 52769fe7b2da640380243e4c
using:
{
"command": "vcl.list"
}
{
"message": "\nactive 0 boot\n"
}
Note that the formatting is “as-is” from varnishadm.