--- /dev/null
+python3 -m venv venv
+pip3 install pyang cbor
--- /dev/null
+{
+ "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
+ }
+ }
+ }
+}
--- /dev/null
+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;
+ }
+ }
+ }
+ }
+}
+
--- /dev/null
+{
+ "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"
+ }
+}
--- /dev/null
+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;
+ }
+ }
+}
+