0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-11-09 12:48:43 +00:00

YANG: just some auxiliary files

This commit is contained in:
Maria Matejka 2023-11-15 11:17:55 +01:00
parent 31aa62ae6d
commit 1b9939b936
5 changed files with 163 additions and 0 deletions

2
yang/create-venv.sh Executable file
View File

@ -0,0 +1,2 @@
python3 -m venv venv
pip3 install pyang cbor

31
yang/show_memory.json Normal file
View File

@ -0,0 +1,31 @@
{
"show_memory:message": {
"header": "BIRD memory usage",
"body": {
"routing_tables": {
"effective": 324,
"overhead": 48
},
"route_attributes": {
"effective": 324,
"overhead": 48
},
"protocols": {
"effective": 324,
"overhead": 48
},
"current_config": {
"effective": 324,
"overhead": 48
},
"standby_memory": {
"effective": 324,
"overhead": 48
},
"total": {
"effective": 324,
"overhead": 48
}
}
}
}

66
yang/show_memory.yang Normal file
View File

@ -0,0 +1,66 @@
module show_memory {
namespace ".";
prefix "memory";
description "cli show memory format";
container message {
leaf header {
type string;
}
container body {
container routing_tables {
leaf effective {
type int32;
}
leaf overhead {
type int32;
}
}
container route_attributes {
leaf effective {
type int32;
}
leaf overhead {
type int32;
}
}
container protocols {
leaf effective {
type int32;
}
leaf overhead {
type int32;
}
}
container current_config {
leaf effective {
type int32;
}
leaf overhead {
type int32;
}
}
container standby_memory {
leaf effective {
type int32;
}
leaf overhead {
type int32;
}
}
container total {
leaf effective {
type int32;
}
leaf overhead {
type int32;
}
}
}
}
}

16
yang/show_status.json Normal file
View File

@ -0,0 +1,16 @@
{
"show_status:message": {
"header": {
"bird": "BIRD ",
"version": "2.14"
},
"body": {
"router_id": "35496",
"hostname": "bird",
"server_time": "2020-10-10T10:10:10+00:00" ,
"last_reboot": "2020-10-10T10:10:10+00:00" ,
"last_reconfiguration": "2020-10-10T10:10:10+00:00"
},
"state": "Daemon is up and running"
}
}

48
yang/show_status.yang Normal file
View File

@ -0,0 +1,48 @@
module show_status {
namespace ".";
prefix "status";
description "cli show status format";
typedef date-and-time {
type string {
pattern '\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?'
+ '(Z|[\+\-]\d{2}:\d{2})';
}
}
container message {
container header {
leaf bird {
type string;
}
leaf version {
type string;
}
}
container body {
leaf router_id {
type string;
}
leaf hostname {
type string;
}
leaf server_time {
type date-and-time;
}
leaf last_reboot {
type date-and-time;
}
leaf last_reconfiguration {
type date-and-time;
}
}
leaf state {
type string;
}
}
}