Dane o parametrach testów¶
Pobieranie listy dostępnych testów¶
Aby otrzymać listę dostępnych testów należy wysłać wiadomość GET na adres /api/task_types/.
W odpowiedzi powinniśmy otrzymać wiadomość o treści z taką strukturą danych:
{
"count": 2,
"next": null,
"previous": null,
"results": [
{
"id": 20,
"subcategories": [
{
"id": 9,
"category": 4
}
],
"options": {
"params": [
{
"name": "address",
"type": "text",
"label": "Destination address",
"tooltip": {
"color": "blue",
"value": "Destination hostname which ping will travel to",
"placement": "top"
},
"attributes": {
"initial": "8.8.8.8",
"required": 1
},
"validators": [
{
"type": "hostname",
"message": "Enter a valid hostname",
"regex": "^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\\-]*[A-Za-z0-9])$"
}
]
},
{
"name": "count",
"type": "slider",
"label": "Number of ICMP Requests",
"tooltip": {
"color": "blue",
"value": "Send more than 5 ICMP requests to analyze jiter",
"placement": "top"
},
"attributes": {
"step": 1,
"initial": 1,
"max_value": 10,
"min_value": 1
}
},
{
"name": "interval",
"type": "slider",
"label": "Interval between consecutive ICMP Requests",
"attributes": {
"step": 1,
"initial": 1,
"max_value": 10,
"min_value": 1
}
}
],
"additional_options": {
"thresholds": {
"params": [
{
"name": "Mean RTT of ping test",
"param": "mean_rtt"
},
{
"name": "Max RTT of ping test",
"param": "max_rtt"
},
{
"name": "Min RTT of ping test",
"param": "min_rtt"
}
],
"enabled": true
},
"dedicated_instances": {
"enabled": true
}
}
},
"permitted": true,
"command": "network_ping",
"name": "network_ping",
"display_name": "Ping",
"description": "Simple ping test extended with jiter analysis.",
"on_premises_available": true,
"cloud_available": true,
"cost": 0,
"sort_priority": 0
},
{
"id": 21,
"subcategories": [
{
"id": 9,
"category": 4
}
],
"options": {
"params": [
{
"name": "address",
"type": "text",
"label": "Destination address",
"attributes": {
"initial": "8.8.8.8",
"required": 1
},
"validators": [
{
"type": "hostname",
"message": "Enter a valid hostname",
"regex": "^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\\-]*[A-Za-z0-9])$"
}
]
}
],
"additional_options": {}
},
"permitted": true,
"command": "traceroute_test",
"name": "traceroute_test",
"display_name": "Traceroute",
"description": "Traceroute test.",
"on_premises_available": true,
"cloud_available": true,
"cost": 0,
"sort_priority": 0
}
]
}
Pobieranie parametrów testu¶
Aby otrzymać dane szczegółowe testu należy wysłać wiadomość GET na adres /api/task_types/<id>/, gdzie <id> jest id testu, którego dane chcemy pobrać.
W odpowiedzi powinniśmy otrzymać wiadomość o treści z taką strukturą danych:
{
"id": 20,
"subcategories": [
{
"id": 9,
"category": 4
}
],
"options": {
"params": [
{
"name": "address",
"type": "text",
"label": "Destination address",
"tooltip": {
"color": "blue",
"value": "Destination hostname which ping will travel to",
"placement": "top"
},
"attributes": {
"initial": "8.8.8.8",
"required": 1
},
"validators": [
{
"type": "hostname",
"message": "Enter a valid hostname",
"regex": "^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\\-]*[A-Za-z0-9])$"
}
]
},
{
"name": "count",
"type": "slider",
"label": "Number of ICMP Requests",
"tooltip": {
"color": "blue",
"value": "Send more than 5 ICMP requests to analyze jiter",
"placement": "top"
},
"attributes": {
"step": 1,
"initial": 1,
"max_value": 10,
"min_value": 1
}
},
{
"name": "interval",
"type": "slider",
"label": "Interval between consecutive ICMP Requests",
"attributes": {
"step": 1,
"initial": 1,
"max_value": 10,
"min_value": 1
}
}
],
"additional_options": {
"thresholds": {
"params": [
{
"name": "Mean RTT of ping test",
"param": "mean_rtt"
},
{
"name": "Max RTT of ping test",
"param": "max_rtt"
},
{
"name": "Min RTT of ping test",
"param": "min_rtt"
}
],
"enabled": true
},
"dedicated_instances": {
"enabled": true
}
}
},
"permitted": true,
"command": "network_ping",
"name": "network_ping",
"display_name": "Ping",
"description": "Simple ping test extended with jiter analysis.",
"on_premises_available": true,
"cloud_available": true,
"cost": 0,
"sort_priority": 0
}