netgate-nat API (23.02)

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

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

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

Responses

201

Object created

400

Internal error

409

Object already exists

Request samples

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

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-wrapper
object (netgate.nat.NatConfigWrapper)

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

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

Example URL

https://hostname/restconf/data/netgate-nat:nat-config/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/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-wrapper":
    {
    }
}

creates netgate.nat.natconfig.Dynamic

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

Example URL

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

Dynamic mapping information.

Request Body schema: application/yang-data+json

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

dynamic
object (netgate.nat.natconfig.Dynamic)

Responses

201

Object created

400

Internal error

409

Object already exists

Request samples

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