netgate-nat API (22.06)

This YANG module provides a Netgate-defined data-model for Network Address Translation data.

Copyright 2017-2020 Rubicon Communications, LLC.

nat-config

returns netgate.nat.NatConfig

get /data/netgate-nat:nat-config

Example URL

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

Network Address Translation (NAT) data needed to support VPP.

Responses

200

netgate.nat.NatConfig

400

Internal error

Request samples

Copy
package main

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

func main() {

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

creates netgate.nat.NatConfig

post /data/netgate-nat:nat-config

Example URL

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

Network Address Translation (NAT) data needed to support VPP.

Request Body schema: application/yang-data+json

netgate.nat.NatConfig to be added to list

global-options
object (netgate.nat.natconfig.GlobalOptions)
ipfix
object (netgate.nat.natconfig.Ipfix)
dynamic
object (netgate.nat.natconfig.Dynamic)
static
object (netgate.nat.natconfig.Static)
nat64
object (netgate.nat.natconfig.Nat64)

Responses

201

Object created

400

Internal error

409

Object already exists

Request samples

Content type
application/yang-data+json
Copy
Expand all Collapse all
{
  • "global-options":
    {
    },
  • "ipfix":
    {
    },
  • "dynamic":
    {
    },
  • "static":
    {
    },
  • "nat64":
    {
    }
}

creates or updates netgate.nat.NatConfig

put /data/netgate-nat:nat-config

Example URL

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

Network Address Translation (NAT) data needed to support VPP.

Request Body schema: application/yang-data+json

netgate.nat.NatConfig to be added or updated

netgate-nat:nat-config
object (netgate.nat.NatConfig)

Responses

201

Object created

204

Object modified

400

Internal error

Request samples

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

removes netgate.nat.NatConfig

delete /data/netgate-nat:nat-config

Example URL

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

Network Address Translation (NAT) data needed to support VPP.

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-nat:nat-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.nat.natconfig.Dynamic

get /data/netgate-nat:nat-config/netgate-nat:dynamic

Example URL

https://hostname/restconf/data/netgate-nat:nat-config/netgate-nat:dynamic

Dynamic mapping information.

Responses

200

netgate.nat.natconfig.Dynamic

400

Internal error

Request samples

Copy
package main

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

func main() {

	url := "http://hostname/restconf/data/netgate-nat:nat-config/netgate-nat:dynamic"

	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-nat:dynamic":
    {
    }
}

creates netgate.nat.natconfig.Dynamic

post /data/netgate-nat:nat-config/netgate-nat:dynamic

Example URL

https://hostname/restconf/data/netgate-nat:nat-config/netgate-nat:dynamic

Dynamic mapping information.

Request Body schema: application/yang-data+json

netgate.nat.natconfig.Dynamic to be added to list

pool-if-table
object (netgate.nat.natconfig.dynamic.PoolIfTable)