netgate-route-table API (19.05)

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

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

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

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

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

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

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

removes netgate.route.table.routetableconfig.StaticRoutes

delete /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

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/netgate-route-table:static-routes"

	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))

}

creates netgate.route.table.routetableconfig.staticroutes.RouteTable

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

Example URL

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

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

Request Body schema: application/yang-data+json

netgate.route.table.routetableconfig.staticroutes.RouteTable to be added to list

name
string

The name of a Route Table.

ipv4-routes
object (netgate.route.table.routetableconfig.staticroutes.routetable.Ipv4Routes)
description
string

A description of the route table.

ipv6-routes
object (netgate.route.table.routetableconfig.staticroutes.routetable.Ipv6Routes)
address-family
string (netgate.common.IpAddressFamily)
Enum:"ipv4" "ipv6"

Responses

201

Object created

400

Internal error

409

Object already exists

Request samples

application/yang-data+json
Copy
Expand all Collapse all
{
  • "name": "string",
  • "ipv4-routes":
    {
    },
  • "description": "string",
  • "ipv6-routes":
    {
    },
  • "address-family": "ipv4"
}

returns netgate.route.table.routetableconfig.staticroutes.RouteTable

get /data/netgate-route-table:route-table-config/netgate-route-table:static-routes/netgate-route-table:route-table={name}

Example URL

https://hostname/restconf/data/netgate-route-table:route-table-config/netgate-route-table:static-routes/netgate-route-table:route-table={name}

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

path Parameters
name
required
string

Id of route-table

Responses

200

netgate.route.table.routetableconfig.staticroutes.RouteTable

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/netgate-route-table:route-table=%7Bname%7D"

	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

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

creates netgate.route.table.routetableconfig.staticroutes.RouteTable

post /data/netgate-route-table:route-table-config/netgate-route-table:static-routes/netgate-route-table:route-table={name}

Example URL

https://hostname/restconf/data/netgate-route-table:route-table-config/netgate-route-table:static-routes/netgate-route-table:route-table={name}

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

path Parameters
name
required
string

Id of route-table

Request Body schema: application/yang-data+json

netgate.route.table.routetableconfig.staticroutes.RouteTable to be added to list

name
string

The name of a Route Table.

ipv4-routes
object (netgate.route.table.routetableconfig.staticroutes.routetable.Ipv4Routes)
description
string

A description of the route table.

ipv6-routes
object (netgate.route.table.routetableconfig.staticroutes.routetable.Ipv6Routes)
address-family
string (netgate.common.IpAddressFamily)
Enum:"ipv4" "ipv6"

Responses

201

Object created

400

Internal error

409

Object already exists

Request samples