netgate-route-table API (19.08)

This YANG module provides a Netgate-defined data-model for Route Tables.

Copyright 2017-2019 Rubicon Communications, LLC.

route-table-config

returns netgate.route.table.RouteTableConfig

get /data/netgate-route-table:route-table-config

Example URL

https://hostname/restconf/data/netgate-route-table:route-table-config

Route Table define a set of static IPv4 and IPv6 routes.

Responses

200

netgate.route.table.RouteTableConfig

400

Internal error

Request samples

Copy
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "http://hostname/restconf/data/netgate-route-table:route-table-config"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

Response samples

Content type
application/yang-data+json
Copy
Expand all Collapse all
{
  • "netgate-route-table:route-table-config":
    {
    }
}

creates netgate.route.table.RouteTableConfig

post /data/netgate-route-table:route-table-config

Example URL

https://hostname/restconf/data/netgate-route-table:route-table-config

Route Table define a set of static IPv4 and IPv6 routes.

Request Body schema: application/yang-data+json

netgate.route.table.RouteTableConfig to be added to list

static-routes
object (netgate.route.table.routetableconfig.StaticRoutes)

Responses

201

Object created

400

Internal error

409

Object already exists

Request samples

Content type
application/yang-data+json
Copy
Expand all Collapse all
{
  • "static-routes":
    {
    }
}

creates or updates netgate.route.table.RouteTableConfig

put /data/netgate-route-table:route-table-config

Example URL

https://hostname/restconf/data/netgate-route-table:route-table-config

Route Table define a set of static IPv4 and IPv6 routes.

Request Body schema: application/yang-data+json

netgate.route.table.RouteTableConfig to be added or updated

netgate-route-table:route-table-config
object (netgate.route.table.RouteTableConfig)

Responses

201

Object created

204

Object modified

400

Internal error

Request samples

Content type
application/yang-data+json
Copy
Expand all Collapse all
{
  • "netgate-route-table:route-table-config":
    {
    }
}

removes netgate.route.table.RouteTableConfig

delete /data/netgate-route-table:route-table-config

Example URL

https://hostname/restconf/data/netgate-route-table:route-table-config

Route Table define a set of static IPv4 and IPv6 routes.

Responses

204

Object deleted

400

Internal error

Request samples

Copy
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "http://hostname/restconf/data/netgate-route-table:route-table-config"

	req, _ := http.NewRequest("DELETE", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

returns netgate.route.table.routetableconfig.StaticRoutes

get /data/netgate-route-table:route-table-config/netgate-route-table:static-routes

Example URL

https://hostname/restconf/data/netgate-route-table:route-table-config/netgate-route-table:static-routes

Static routes.

Responses

200

netgate.route.table.routetableconfig.StaticRoutes

400

Internal error

Request samples

Copy
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "http://hostname/restconf/data/netgate-route-table:route-table-config/netgate-route-table:static-routes"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

Response samples

Content type
application/yang-data+json
Copy
Expand all Collapse all
{
  • "netgate-route-table:static-routes":
    {
    }
}

creates netgate.route.table.routetableconfig.StaticRoutes

post /data/netgate-route-table:route-table-config/netgate-route-table:static-routes

Example URL

https://hostname/restconf/data/netgate-route-table:route-table-config/netgate-route-table:static-routes

Static routes.

Request Body schema: application/yang-data+json

netgate.route.table.routetableconfig.StaticRoutes to be added to list

route-table
Array of objects (netgate.route.table.routetableconfig.staticroutes.RouteTable)

Route table entries are indexed by their name. Table names are unique across all address families.

Responses

201

Object created

400

Internal error

409

Object already exists

Request samples

Content type
application/yang-data+json
Copy
Expand all Collapse all
{
  • "route-table":
    [
    ]
}

creates or updates netgate.route.table.routetableconfig.StaticRoutes

put /data/netgate-route-table:route-table-config/netgate-route-table:static-routes

Example URL

https://hostname/restconf/data/netgate-route-table:route-table-config/netgate-route-table:static-routes

Static routes.

Request Body schema: application/yang-data+json

netgate.route.table.routetableconfig.StaticRoutes to be added or updated

netgate-route-table:static-routes
object (netgate.route.table.routetableconfig.StaticRoutes)

Responses

201

Object created

204

Object modified

400

Internal error

Request samples

Content type
application/yang-data+json
Copy
Expand all Collapse all
{
  • "netgate-route-table:static-routes":
    {