netgate-gre API (24.06)

This YANG module provides a Netgate-defined data-model for GRE data.

Copyright 2018-2020 Rubicon Communications, LLC.

gre-config

returns netgate.gre.GreConfig

Configuration for GRE tunnels.

Responses

Request samples

package main

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

func main() {

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

creates netgate.gre.GreConfig

Configuration for GRE tunnels.

Request Body schema: application/yang-data+json

netgate.gre.GreConfig to be added to list

object (netgate.gre.greconfig.GreTable)

GRE table.

Responses

Request samples

Content type
application/yang-data+json
{
  • "netgate-gre:gre-table": {
    }
}

creates or updates netgate.gre.GreConfig

Configuration for GRE tunnels.

Request Body schema: application/yang-data+json

netgate.gre.GreConfig to be added or updated

object (netgate.gre.GreConfig)

Configuration for GRE tunnels.

Responses

Request samples

Content type
application/yang-data+json
{
  • "netgate-gre:gre-config": {
    }
}

removes netgate.gre.GreConfig

Configuration for GRE tunnels.

Responses

Request samples

package main

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

func main() {

	url := "http://hostname/restconf/data/netgate-gre:gre-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.gre.greconfig.GreTable

GRE table.

Responses

Request samples

package main

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

func main() {

	url := "http://hostname/restconf/data/netgate-gre:gre-config/gre-table"

	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
{
  • "netgate-gre:gre-table": {
    }
}

creates netgate.gre.greconfig.GreTable

GRE table.

Request Body schema: application/yang-data+json

netgate.gre.greconfig.GreTable to be added to list

Array of objects (netgate.gre.greconfig.gretable.Tunnel)

GRE tunnel configuration.

Responses

Request samples

Content type
application/yang-data+json
{
  • "netgate-gre:tunnel": [
    ]
}

creates or updates netgate.gre.greconfig.GreTable

GRE table.

Request Body schema: application/yang-data+json

netgate.gre.greconfig.GreTable to be added or updated

object (netgate.gre.greconfig.GreTable)

GRE table.

Responses

Request samples

Content type
application/yang-data+json
{
  • "netgate-gre:gre-table": {
    }
}

removes netgate.gre.greconfig.GreTable

GRE table.

Responses

Request samples

package main

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

func main() {

	url := "http://hostname/restconf/data/netgate-gre:gre-config/gre-table"

	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.gre.greconfig.gretable.Tunnel

GRE tunnel configuration.

Request Body schema: application/yang-data+json

netgate.gre.greconfig.gretable.Tunnel to be added to list

netgate-gre:tunnel-type
string (netgate.gre.GreTunnelType)
Enum: "l3" "teb" "erspan"
netgate-gre:instance
integer <int64>

Each GRE tunnel creates an interface. The created interface will be named 'gre', where the is the instance number. The instance number must be unique across all GRE entries.

netgate-gre:erspan-session-id
integer <int64>

VNI value, u24.

netgate-gre:encap-route-table
string

Encapsulation route table name.

netgate-gre:name
string

The GRE tunnel identifier. A unique name for this GRE tunnel.

netgate-gre:src-ip-address
string

The source IP address.

netgate-gre:dst-ip-address
string

The destination IP address.

Responses

Request samples

Content type
application/yang-data+json
{
  • "netgate-gre:tunnel-type": "l3",
  • "netgate-gre:instance": 0,
  • "netgate-gre:erspan-session-id": 0,
  • "netgate-gre:encap-route-table": "string",
  • "netgate-gre:name": "string",
  • "netgate-gre:src-ip-address": "string",
  • "netgate-gre:dst-ip-address": "string"
}

returns netgate.gre.greconfig.gretable.Tunnel

GRE tunnel configuration.

path Parameters
name
required
string

Id of tunnel

Responses

Request samples

package main

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

func main() {

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

Content type
application/yang-data+json
{
  • "netgate-gre:tunnel": {
    }
}

creates or updates netgate.gre.greconfig.gretable.Tunnel

GRE tunnel configuration.

path Parameters
name
required
string

Id of tunnel

Request Body schema: application/yang-data+json

netgate.gre.greconfig.gretable.Tunnel to be added or updated

object (netgate.gre.greconfig.gretable.Tunnel)

GRE tunnel configuration.

Responses

Request samples

Content type
application/yang-data+json
{
  • "netgate-gre:tunnel": {
    }
}

removes netgate.gre.greconfig.gretable.Tunnel

GRE tunnel configuration.

path Parameters
name
required
string

Id of tunnel

Responses

Request samples

package main

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

func main() {

	url := "http://hostname/restconf/data/netgate-gre:gre-config/gre-table/tunnel=%7Bname%7D"

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

}

gre-state

returns netgate.gre.GreState

State of the GRE tunnels.

Responses

Request samples

package main

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

func main() {

	url := "http://hostname/restconf/data/netgate-gre:gre-state"

	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
{
  • "netgate-gre:gre-state": {
    }
}

returns netgate.gre.grestate.GreTable

GRE table.

Responses

Request samples

package main

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

func main() {

	url := "http://hostname/restconf/data/netgate-gre:gre-state/gre-table"

	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
{
  • "netgate-gre:gre-table": {
    }
}

returns netgate.gre.grestate.gretable.Tunnel

GRE tunnel name.

path Parameters
name
required
string

Id of tunnel

Responses

Request samples

package main

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

func main() {

	url := "http://hostname/restconf/data/netgate-gre:gre-state/gre-table/tunnel=%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

Content type
application/yang-data+json
{
  • "netgate-gre:tunnel": {
    }
}