netgate-netfilter API (19.05)

This YANG module provides a data model for Host Netfilter Tables.

Copyright 2018 Rubicon Communications, LLC.

netfilter-config

returns netgate.netfilter.NetfilterConfig

get /data/netgate-netfilter:netfilter-config

Example URL

https://hostname/restconf/data/netgate-netfilter:netfilter-config

returns netgate.netfilter.NetfilterConfig

Responses

200

netgate.netfilter.NetfilterConfig

400

Internal error

Request samples

Copy
package main

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

func main() {

	url := "http://hostname/restconf/data/netgate-netfilter:netfilter-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-netfilter:netfilter-config":
    {
    }
}

creates netgate.netfilter.NetfilterConfig

post /data/netgate-netfilter:netfilter-config

Example URL

https://hostname/restconf/data/netgate-netfilter:netfilter-config

creates netgate.netfilter.NetfilterConfig

Request Body schema: application/yang-data+json

netgate.netfilter.NetfilterConfig to be added to list

tables
object (netgate.netfilter.netfilterconfig.Tables)

Responses

201

Object created

400

Internal error

409

Object already exists

Request samples

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

creates or updates netgate.netfilter.NetfilterConfig

put /data/netgate-netfilter:netfilter-config

Example URL

https://hostname/restconf/data/netgate-netfilter:netfilter-config

creates or updates netgate.netfilter.NetfilterConfig

Request Body schema: application/yang-data+json

netgate.netfilter.NetfilterConfig to be added or updated

netgate-netfilter:netfilter-config
object (netgate.netfilter.NetfilterConfig)

Responses

201

Object created

204

Object modified

400

Internal error

Request samples

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

removes netgate.netfilter.NetfilterConfig

delete /data/netgate-netfilter:netfilter-config

Example URL

https://hostname/restconf/data/netgate-netfilter:netfilter-config

removes netgate.netfilter.NetfilterConfig

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-netfilter:netfilter-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.netfilter.netfilterconfig.Tables

get /data/netgate-netfilter:netfilter-config/netgate-netfilter:tables

Example URL

https://hostname/restconf/data/netgate-netfilter:netfilter-config/netgate-netfilter:tables

Netfilter ACL and NAT tables for host interfaces.

Responses

200

netgate.netfilter.netfilterconfig.Tables

400

Internal error

Request samples

Copy
package main

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

func main() {

	url := "http://hostname/restconf/data/netgate-netfilter:netfilter-config/netgate-netfilter:tables"

	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-netfilter:tables":
    {
    }
}

creates netgate.netfilter.netfilterconfig.Tables

post /data/netgate-netfilter:netfilter-config/netgate-netfilter:tables

Example URL

https://hostname/restconf/data/netgate-netfilter:netfilter-config/netgate-netfilter:tables

Netfilter ACL and NAT tables for host interfaces.

Request Body schema: application/yang-data+json

netgate.netfilter.netfilterconfig.Tables to be added to list

table
Array of objects (netgate.netfilter.netfilterconfig.tables.Table)

The list of Netfilter tables.

Responses

201

Object created

400

Internal error

409

Object already exists

Request samples

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