netgate-ipsec API (23.02)

This YANG module provides mappings of the CLI command structure to the underlying data-model elements for the Netgate router.

Copyright 2016-2023 Rubicon Communications, LLC.

ipsec-config

returns netgate.ipsec.IpsecConfig

get /data/netgate-ipsec:ipsec-config

Example URL

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

returns netgate.ipsec.IpsecConfig

Responses

200

netgate.ipsec.IpsecConfig

400

Internal error

Request samples

Copy
package main

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

func main() {

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

creates netgate.ipsec.IpsecConfig

post /data/netgate-ipsec:ipsec-config

Example URL

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

creates netgate.ipsec.IpsecConfig

Request Body schema: application/yang-data+json

netgate.ipsec.IpsecConfig to be added to list

netgate-ipsec:ipsec-config
object (netgate.ipsec.IpsecConfig)

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

creates or updates netgate.ipsec.IpsecConfig

put /data/netgate-ipsec:ipsec-config

Example URL

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

creates or updates netgate.ipsec.IpsecConfig

Request Body schema: application/yang-data+json

netgate.ipsec.IpsecConfig to be added or updated

netgate-ipsec:ipsec-config-wrapper
object (netgate.ipsec.IpsecConfigWrapper)

Responses

201

Object created

204

Object modified

400

Internal error

Request samples

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

removes netgate.ipsec.IpsecConfig

delete /data/netgate-ipsec:ipsec-config

Example URL

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

removes netgate.ipsec.IpsecConfig

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

}

creates netgate.ipsec.ipsecconfig.Tunnel

post /data/netgate-ipsec:ipsec-config/tunnel

Example URL

https://hostname/restconf/data/netgate-ipsec:ipsec-config/tunnel

IPsec tunnel configurations

Request Body schema: application/yang-data+json

netgate.ipsec.ipsecconfig.Tunnel to be added to list

tunnel
object (netgate.ipsec.ipsecconfig.Tunnel)

Responses

201

Object created

400

Internal error

409

Object already exists

Request samples

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

returns netgate.ipsec.ipsecconfig.Tunnel

get /data/netgate-ipsec:ipsec-config/tunnel={instance}

Example URL

https://hostname/restconf/data/netgate-ipsec:ipsec-config/tunnel={instance}

IPsec tunnel configurations

path Parameters
instance
required
integer <int64>

Id of tunnel

Responses

200

netgate.ipsec.ipsecconfig.Tunnel

400

Internal error

Request samples

Copy
package main

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

func main() {

	url := "http://hostname/restconf/data/netgate-ipsec:ipsec-config/tunnel=%7Binstance%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

Content type
application/yang-data+json
Copy
Expand all Collapse all
{
  • "netgate-ipsec:tunnel-wrapper":
    {