Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add JSON API on bird-lg #35

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add JSON API on bird-lg #35

wants to merge 2 commits into from

Commits on Jul 16, 2018

  1. Add a method to allow queries on API and return the same data from sh…

    …ow route as JSON value
    
    Example : https://[[LG_MASTER]]/api/[[LG_NODES_LIST]]/ipv4?q=8.8.8.8
    
    Return :
    
    {
    
        "[[LG_NODES_LIST]]": {
            "result": [
                {
                    "origin": "IGP",
                    "med": 0,
                    "via": "1.1.1.2",
                    "last": "2018-07-10",
                    "network": "8.8.8.0",
                    "localPref": 350,
                    "asPath": "15169",
                    "originatorId": {
                        "addr": "4.4.4.4",
                        "reverse": "router.fr.eu"
                    },
                    "community": [
                        "65000:65000"
                    ],
                    "clusterList": [
                        "9.89.6.6",
                        "9.89.8.8"
                    ],
                    "netmask": "24",
                    "fromPeer": "bird",
                    "from": "4.4.4.4",
                    "nextHop": {
                        "addr": "1.1.1.2",
                        "reverse": "google.fr.eu"
                    },
                    "ipType": "IPv4"
                }
            ]
        }
    
    }
    Fabien VINCENT committed Jul 16, 2018
    Configuration menu
    Copy the full SHA
    01ec638 View commit details
    Browse the repository at this point in the history
  2. Allo to show route as JSON value

    Example : https://[[LG_MASTER]]/api/[[LG_NODES_LIST]]/ipv4?q=8.8.8.8
    
    Return :
    
    {
    
        "[[LG_NODES_LIST]]": {
            "result": [
                {
                    "origin": "IGP",
                    "med": 0,
                    "via": "1.1.1.2",
                    "last": "2018-07-10",
                    "network": "8.8.8.0",
                    "localPref": 350,
                    "asPath": "15169",
                    "originatorId": {
                        "addr": "4.4.4.4",
                        "reverse": "router.fr.eu"
                    },
                    "community": [
                        "65000:65000"
                    ],
                    "clusterList": [
                        "9.89.6.6",
                        "9.89.8.8"
                    ],
                    "netmask": "24",
                    "fromPeer": "bird",
                    "from": "4.4.4.4",
                    "nextHop": {
                        "addr": "1.1.1.2",
                        "reverse": "google.fr.eu"
                    },
                    "ipType": "IPv4"
                }
            ]
        }
    
    }
    Fabien VINCENT committed Jul 16, 2018
    Configuration menu
    Copy the full SHA
    9df351a View commit details
    Browse the repository at this point in the history