]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
YANG: just some auxiliary files
authorMaria Matejka <mq@ucw.cz>
Wed, 15 Nov 2023 10:17:55 +0000 (11:17 +0100)
committerMaria Matejka <mq@ucw.cz>
Wed, 15 Nov 2023 10:17:55 +0000 (11:17 +0100)
yang/create-venv.sh [new file with mode: 0755]
yang/show_memory.json [new file with mode: 0644]
yang/show_memory.yang [new file with mode: 0644]
yang/show_status.json [new file with mode: 0644]
yang/show_status.yang [new file with mode: 0644]

diff --git a/yang/create-venv.sh b/yang/create-venv.sh
new file mode 100755 (executable)
index 0000000..07428c5
--- /dev/null
@@ -0,0 +1,2 @@
+python3 -m venv venv
+pip3 install pyang cbor
diff --git a/yang/show_memory.json b/yang/show_memory.json
new file mode 100644 (file)
index 0000000..f5c7127
--- /dev/null
@@ -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
+       }
+     }
+  }
+}
diff --git a/yang/show_memory.yang b/yang/show_memory.yang
new file mode 100644 (file)
index 0000000..93f4e1d
--- /dev/null
@@ -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;
+        }
+      }
+    }
+  }
+}
+
diff --git a/yang/show_status.json b/yang/show_status.json
new file mode 100644 (file)
index 0000000..276d448
--- /dev/null
@@ -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"
+  }
+}
diff --git a/yang/show_status.yang b/yang/show_status.yang
new file mode 100644 (file)
index 0000000..a3573ef
--- /dev/null
@@ -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;
+    }
+  }
+}
+