netgate-gre API (19.05)

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

Copyright 2018-2019 Rubicon Communications, LLC.

gre-config

returns netgate.gre.GreConfig

get /data/netgate-gre:gre-config

Example URL

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

Configuration for GRE tunnels.

Responses

200

netgate.gre.GreConfig

400

Internal error

Request samples

Copy
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

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

creates netgate.gre.GreConfig

post /data/netgate-gre:gre-config

Example URL

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

Configuration for GRE tunnels.

Request Body schema: application/yang-data+json

netgate.gre.GreConfig to be added to list

gre-table
object (netgate.gre.greconfig.GreTable)

Responses

201

Object created

400

Internal error

409

Object already exists

Request samples

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

creates or updates netgate.gre.GreConfig

put /data/netgate-gre:gre-config

Example URL

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

Configuration for GRE tunnels.

Request Body schema: application/yang-data+json

netgate.gre.GreConfig to be added or updated

netgate-gre:gre-config
object (netgate.gre.GreConfig)

Responses

201

Object created

204

Object modified

400

Internal error

Request samples

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

removes netgate.gre.GreConfig

delete /data/netgate-gre:gre-config

Example URL

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

Configuration for GRE tunnels.

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

get /data/netgate-gre:gre-config/netgate-gre:gre-table

Example URL

https://hostname/restconf/data/netgate-gre:gre-config/netgate-gre:gre-table

GRE table.

Responses

200

netgate.gre.greconfig.GreTable

400

Internal error

Request samples

Copy
package main

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

func main() {

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

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

creates netgate.gre.greconfig.GreTable

post /data/netgate-gre:gre-config/netgate-gre:gre-table

Example URL

https://hostname/restconf/data/netgate-gre:gre-config/netgate-gre:gre-table

GRE table.

Request Body schema: application/yang-data+json

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

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

GRE tunnel name.

Responses

201

Object created

400

Internal error

409

Object already exists

Request samples

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

creates or updates netgate.gre.greconfig.GreTable

put /data/netgate-gre:gre-config/netgate-gre:gre-table

Example URL

https://hostname/restconf/data/netgate-gre:gre-config/netgate-gre:gre-table

GRE table.

Request Body schema: application/yang-data+json

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

netgate-gre:gre-table
object (netgate.gre.greconfig.GreTable)

Responses

201

Object created

204

Object modified

400

Internal error

Request samples

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

removes netgate.gre.greconfig.GreTable

delete /data/netgate-gre:gre-config/netgate-gre:gre-table

Example URL

https://hostname/restconf/data/netgate-gre:gre-config/netgate-gre:gre-table

GRE table.

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-gre:gre-config/netgate-gre: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

post /data/netgate-gre:gre-config/netgate-gre:gre-table/netgate-gre:tunnel

Example URL

https://hostname/restconf/data/netgate-gre:gre-config/netgate-gre:gre-table/netgate-gre:tunnel

GRE tunnel name.

Request Body schema: application/yang-data+json

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

tunnel-type
string (netgate.gre.GreTunnelType)
Enum:"l3" "teb" "erspan"
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.

erspan-session-id
integer <int64>

VNI value, u24.

encap-route-table
string

Encapsulation route table name.

name
string

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

src-ip-address
string

The source IP address.

dst-ip-address
string

The destination IP address.

Responses

201

Object created

400

Internal error

409

Object already exists

Request samples

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

returns netgate.gre.greconfig.gretable.Tunnel

get /data/netgate-gre:gre-config/netgate-gre:gre-table/netgate-gre:tunnel={name}

Example URL

https://hostname/restconf/data/netgate-gre:gre-config/netgate-gre:gre-table/netgate-gre:tunnel={name}

GRE tunnel name.

path Parameters
name
required
string

Id of tunnel

Responses

200

netgate.gre.greconfig.gretable.Tunnel

400

Internal error

Request samples

Copy
package main

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

func main() {

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

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

creates netgate.gre.greconfig.gretable.Tunnel

post /data/netgate-gre:gre-config/netgate-gre:gre-table/netgate-gre:tunnel={name}

Example URL

https://hostname/restconf/data/netgate-gre:gre-config/netgate-gre:gre-table/netgate-gre:tunnel={name}

GRE tunnel name.

path Parameters
name
required
string

Id of tunnel

Request Body schema: application/yang-data+json

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

tunnel-type
string (netgate.gre.GreTunnelType)
Enum:"l3" "teb" "erspan"
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.

erspan-session-id
integer <int64>

VNI value, u24.

encap-route-table
string

Encapsulation route table name.

name
string

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

src-ip-address
string

The source IP address.

dst-ip-address
string

The destination IP address.

Responses

201

Object created

400

Internal error

409

Object already exists

Request samples

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

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

put /data/netgate-gre:gre-config/netgate-gre:gre-table/netgate-gre:tunnel={name}

Example URL

https://hostname/restconf/data/netgate-gre:gre-config/netgate-gre:gre-table/netgate-gre:tunnel={name}

GRE tunnel name.

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

netgate-gre:tunnel
object (netgate.gre.greconfig.gretable.Tunnel)

Responses

201

Object created

204

Object modified

400

Internal error

Request samples

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

removes netgate.gre.greconfig.gretable.Tunnel

delete /data/netgate-gre:gre-config/netgate-gre:gre-table/netgate-gre:tunnel={name}

Example URL

https://hostname/restconf/data/netgate-gre:gre-config/netgate-gre:gre-table/netgate-gre:tunnel={name}

GRE tunnel name.

path Parameters
name
required
string

Id of tunnel

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-gre:gre-config/netgate-gre:gre-table/netgate-gre: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

get /data/netgate-gre:gre-state

Example URL

https://hostname/restconf/data/netgate-gre:gre-state

State of the GRE tunnels.

Responses

200

netgate.gre.GreState

400

Internal error

Request samples

Copy
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

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

returns netgate.gre.grestate.GreTable

get /data/netgate-gre:gre-state/netgate-gre:gre-table

Example URL

https://hostname/restconf/data/netgate-gre:gre-state/netgate-gre:gre-table

GRE table.

Responses

200

netgate.gre.grestate.GreTable

400

Internal error

Request samples

Copy
package main

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

func main() {

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

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

returns netgate.gre.grestate.gretable.Tunnel

get /data/netgate-gre:gre-state/netgate-gre:gre-table/netgate-gre:tunnel={name}

Example URL

https://hostname/restconf/data/netgate-gre:gre-state/netgate-gre:gre-table/netgate-gre:tunnel={name}

GRE tunnel name.

path Parameters
name
required
string

Id of tunnel

Responses

200

netgate.gre.grestate.gretable.Tunnel

400

Internal error

Request samples

Copy
package main

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

func main() {

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

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