{
  "properties": {
    "apiVersion": {
      "type": "string"
    },
    "kind": {
      "type": "string"
    },
    "metadata": {
      "type": "object"
    },
    "spec": {
      "properties": {
        "classes": {
          "items": {
            "enum": [
              "Agent",
              "BGP",
              "Routes"
            ],
            "type": "string"
          },
          "type": "array"
        },
        "node": {
          "type": "string"
        },
        "updatePeriodSeconds": {
          "format": "int32",
          "type": "integer"
        }
      },
      "type": "object",
      "additionalProperties": false
    },
    "status": {
      "properties": {
        "agent": {
          "properties": {
            "birdV4": {
              "properties": {
                "lastBootTime": {
                  "type": "string"
                },
                "lastReconfigurationTime": {
                  "type": "string"
                },
                "routerID": {
                  "type": "string"
                },
                "state": {
                  "enum": [
                    "Ready",
                    "NotReady"
                  ],
                  "type": "string"
                },
                "version": {
                  "type": "string"
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "birdV6": {
              "properties": {
                "lastBootTime": {
                  "type": "string"
                },
                "lastReconfigurationTime": {
                  "type": "string"
                },
                "routerID": {
                  "type": "string"
                },
                "state": {
                  "enum": [
                    "Ready",
                    "NotReady"
                  ],
                  "type": "string"
                },
                "version": {
                  "type": "string"
                }
              },
              "type": "object",
              "additionalProperties": false
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "bgp": {
          "properties": {
            "numberEstablishedV4": {
              "type": "integer"
            },
            "numberEstablishedV6": {
              "type": "integer"
            },
            "numberNotEstablishedV4": {
              "type": "integer"
            },
            "numberNotEstablishedV6": {
              "type": "integer"
            },
            "peersV4": {
              "items": {
                "properties": {
                  "peerIP": {
                    "type": "string"
                  },
                  "since": {
                    "type": "string"
                  },
                  "state": {
                    "enum": [
                      "Idle",
                      "Connect",
                      "Active",
                      "OpenSent",
                      "OpenConfirm",
                      "Established",
                      "Close"
                    ],
                    "type": "string"
                  },
                  "type": {
                    "enum": [
                      "NodeMesh",
                      "NodePeer",
                      "GlobalPeer"
                    ],
                    "type": "string"
                  }
                },
                "type": "object",
                "additionalProperties": false
              },
              "type": "array"
            },
            "peersV6": {
              "items": {
                "properties": {
                  "peerIP": {
                    "type": "string"
                  },
                  "since": {
                    "type": "string"
                  },
                  "state": {
                    "enum": [
                      "Idle",
                      "Connect",
                      "Active",
                      "OpenSent",
                      "OpenConfirm",
                      "Established",
                      "Close"
                    ],
                    "type": "string"
                  },
                  "type": {
                    "enum": [
                      "NodeMesh",
                      "NodePeer",
                      "GlobalPeer"
                    ],
                    "type": "string"
                  }
                },
                "type": "object",
                "additionalProperties": false
              },
              "type": "array"
            }
          },
          "required": [
            "numberEstablishedV4",
            "numberEstablishedV6",
            "numberNotEstablishedV4",
            "numberNotEstablishedV6"
          ],
          "type": "object",
          "additionalProperties": false
        },
        "lastUpdated": {
          "format": "date-time",
          "nullable": true,
          "type": "string"
        },
        "routes": {
          "properties": {
            "routesV4": {
              "items": {
                "properties": {
                  "destination": {
                    "type": "string"
                  },
                  "gateway": {
                    "type": "string"
                  },
                  "interface": {
                    "type": "string"
                  },
                  "learnedFrom": {
                    "properties": {
                      "peerIP": {
                        "type": "string"
                      },
                      "sourceType": {
                        "enum": [
                          "Kernel",
                          "Static",
                          "Direct",
                          "NodeMesh",
                          "BGPPeer"
                        ],
                        "type": "string"
                      }
                    },
                    "type": "object",
                    "additionalProperties": false
                  },
                  "type": {
                    "enum": [
                      "FIB",
                      "RIB"
                    ],
                    "type": "string"
                  }
                },
                "type": "object",
                "additionalProperties": false
              },
              "type": "array"
            },
            "routesV6": {
              "items": {
                "properties": {
                  "destination": {
                    "type": "string"
                  },
                  "gateway": {
                    "type": "string"
                  },
                  "interface": {
                    "type": "string"
                  },
                  "learnedFrom": {
                    "properties": {
                      "peerIP": {
                        "type": "string"
                      },
                      "sourceType": {
                        "enum": [
                          "Kernel",
                          "Static",
                          "Direct",
                          "NodeMesh",
                          "BGPPeer"
                        ],
                        "type": "string"
                      }
                    },
                    "type": "object",
                    "additionalProperties": false
                  },
                  "type": {
                    "enum": [
                      "FIB",
                      "RIB"
                    ],
                    "type": "string"
                  }
                },
                "type": "object",
                "additionalProperties": false
              },
              "type": "array"
            }
          },
          "type": "object",
          "additionalProperties": false
        }
      },
      "type": "object",
      "additionalProperties": false
    }
  },
  "required": [
    "metadata",
    "spec"
  ],
  "type": "object"
}
