netgate-host-interface API (19.08)

This YANG module provides a data model for host interfaces.

Copyright 2018-2019 Rubicon Communications, LLC.

host-if-config

returns netgate.host.interface.HostIfConfig

get /data/netgate-host-interface:host-if-config

Example URL

https://hostname/restconf/data/netgate-host-interface:host-if-config

Interface configuration parameters.

Responses

200

netgate.host.interface.HostIfConfig

400

Internal error

Request samples

Copy
package main

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

func main() {

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

creates netgate.host.interface.HostIfConfig

post /data/netgate-host-interface:host-if-config

Example URL

https://hostname/restconf/data/netgate-host-interface:host-if-config

Interface configuration parameters.

Request Body schema: application/yang-data+json

netgate.host.interface.HostIfConfig to be added to list

interface
Array of objects (netgate.host.interface.hostifconfig.Interface)

The list of configured host interfaces on the device.

Responses

201

Object created

400

Internal error

409

Object already exists

Request samples

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

creates or updates netgate.host.interface.HostIfConfig

put /data/netgate-host-interface:host-if-config

Example URL

https://hostname/restconf/data/netgate-host-interface:host-if-config

Interface configuration parameters.

Request Body schema: application/yang-data+json

netgate.host.interface.HostIfConfig to be added or updated

netgate-host-interface:host-if-config
object (netgate.host.interface.HostIfConfig)

Responses

201

Object created

204

Object modified

400

Internal error

Request samples

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

removes netgate.host.interface.HostIfConfig

delete /data/netgate-host-interface:host-if-config

Example URL

https://hostname/restconf/data/netgate-host-interface:host-if-config

Interface configuration parameters.

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-host-interface:host-if-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.host.interface.hostifconfig.Interface

post /data/netgate-host-interface:host-if-config/netgate-host-interface:interface

Example URL

https://hostname/restconf/data/netgate-host-interface:host-if-config/netgate-host-interface:interface

The list of configured host interfaces on the device.

Request Body schema: application/yang-data+json

netgate.host.interface.hostifconfig.Interface to be added to list

ipv4
object (netgate.host.interface.hostifconfig.interface.Ipv4)
ipv6
object (netgate.host.interface.hostifconfig.interface.Ipv6)
name
string

The name of the host interface.

description
string

A textual description of the host interface.

enabled
boolean

This leaf contains the configured, desired state of the interface.

mtu
integer <int32>

The size, in octets, of the largest packet that the interface will send and receive.

Responses

201

Object created

400

Internal error

409

Object already exists

Request samples

Content type
application/yang-data+json
Copy
Expand all Collapse all
{
  • "ipv4":
    {
    },
  • "ipv6":
    {
    },
  • "name": "string",
  • "description": "string",
  • "enabled": true,
  • "mtu": 0
}

returns netgate.host.interface.hostifconfig.Interface

get /data/netgate-host-interface:host-if-config/netgate-host-interface:interface={name}

Example URL

https://hostname/restconf/data/netgate-host-interface:host-if-config/netgate-host-interface:interface={name}

The list of configured host interfaces on the device.

path Parameters
name
required
string

Id of interface

Responses

200

netgate.host.interface.hostifconfig.Interface

400

Internal error

Request samples

Copy
package main

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

func main() {

	url := "http://hostname/restconf/data/netgate-host-interface:host-if-config/netgate-host-interface:interface=%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
Copy
Expand all Collapse all
{
  • "netgate-host-interface:interface":
    {
    }
}

creates netgate.host.interface.hostifconfig.Interface

post /data/netgate-host-interface:host-if-config/netgate-host-interface:interface={name}

Example URL

https://hostname/restconf/data/netgate-host-interface:host-if-config/netgate-host-interface:interface={name}

The list of configured host interfaces on the device.

path Parameters
name
required
string

Id of interface

Request Body schema: application/yang-data+json

netgate.host.interface.hostifconfig.Interface to be added to list

ipv4
object (netgate.host.interface.hostifconfig.interface.Ipv4)
ipv6
object (netgate.host.interface.hostifconfig.interface.Ipv6)
name
string

The name of the host interface.

description
string

A textual description of the host interface.

enabled
boolean

This leaf contains the configured, desired state of the interface.

mtu
integer <int32>

The size, in octets, of the largest packet that the interface will send and receive.

Responses

201

Object created

400

Internal error

409

Object already exists

Request samples

Content type
application/yang-data+json
Copy
Expand all Collapse all
{
  • "ipv4":
    {
    },
  • "ipv6":
    {
    },
  • "name": "string",
  • "description": "string",
  • "enabled": true,
  • "mtu": 0
}

creates or updates netgate.host.interface.hostifconfig.Interface

put /data/netgate-host-interface:host-if-config/netgate-host-interface:interface={name}

Example URL

https://hostname/restconf/data/netgate-host-interface:host-if-config/netgate-host-interface:interface={name}

The list of configured host interfaces on the device.

path Parameters
name
required
string

Id of interface

Request Body schema: application/yang-data+json

netgate.host.interface.hostifconfig.Interface to be added or updated

netgate-host-interface:interface
object (netgate.host.interface.hostifconfig.Interface)

Responses

201

Object created

204

Object modified

400

Internal error

Request samples

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

removes netgate.host.interface.hostifconfig.Interface

delete /data/netgate-host-interface:host-if-config/netgate-host-interface:interface={name}

Example URL

https://hostname/restconf/data/netgate-host-interface:host-if-config/netgate-host-interface:interface={name}

The list of configured host interfaces on the device.

path Parameters
name
required
string

Id of interface

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-host-interface:host-if-config/netgate-host-interface:interface=%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))

}

returns netgate.host.interface.hostifconfig.interface.Ipv4

get /data/netgate-host-interface:host-if-config/netgate-host-interface:interface={name}/netgate-host-interface:ipv4

Example URL

https://hostname/restconf/data/netgate-host-interface:host-if-config/netgate-host-interface:interface={name}/netgate-host-interface:ipv4

Parameters for the IPv4 address family.

path Parameters
name
required
string

Id of interface

Responses

200

netgate.host.interface.hostifconfig.interface.Ipv4

400

Internal error

Request samples

Copy
package main

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

func main() {

	url := "http://hostname/restconf/data/netgate-host-interface:host-if-config/netgate-host-interface:interface=%7Bname%7D/netgate-host-interface:ipv4"

	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-host-interface:ipv4":
    {
    }
}

creates netgate.host.interface.hostifconfig.interface.Ipv4

post /data/netgate-host-interface:host-if-config/netgate-host-interface:interface={name}/netgate-host-interface:ipv4

Example URL

https://hostname/restconf/data/netgate-host-interface:host-if-config/netgate-host-interface:interface={name}/netgate-host-interface:ipv4

Parameters for the IPv4 address family.

path Parameters
name
required
string

Id of interface

Request Body schema: application/yang-data+json

netgate.host.interface.hostifconfig.interface.Ipv4 to be added to list

address
object (netgate.host.interface.hostifconfig.interface.ipv4.Address)

Responses

201

Object created

400

Internal error

409

Object already exists

Request samples

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

creates or updates netgate.host.interface.hostifconfig.interface.Ipv4

put /data/netgate-host-interface:host-if-config/netgate-host-interface:interface={name}/netgate-host-interface:ipv4

Example URL

https://hostname/restconf/data/netgate-host-interface:host-if-config/netgate-host-interface:interface={name}/netgate-host-interface:ipv4

Parameters for the IPv4 address family.

path Parameters
name
required
string

Id of interface

Request Body schema: application/yang-data+json

netgate.host.interface.hostifconfig.interface.Ipv4 to be added or updated

netgate-host-interface:ipv4
object (netgate.host.interface.hostifconfig.interface.Ipv4)

Responses

201

Object created

204

Object modified

400

Internal error

Request samples

Content type
application/yang-data+json
Copy
Expand all Collapse all
{
  • "netgate-host-interface:ipv4":
    {
    }
}

removes netgate.host.interface.hostifconfig.interface.Ipv4

delete /data/netgate-host-interface:host-if-config/netgate-host-interface:interface={name}/netgate-host-interface:ipv4

Example URL

https://hostname/restconf/data/netgate-host-interface:host-if-config/netgate-host-interface:interface={name}/netgate-host-interface:ipv4

Parameters for the IPv4 address family.

path Parameters
name
required
string

Id of interface

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-host-interface:host-if-config/netgate-host-interface:interface=%7Bname%7D/netgate-host-interface:ipv4"

	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.host.interface.hostifconfig.interface.ipv4.Address

get /data/netgate-host-interface:host-if-config/netgate-host-interface:interface={name}/netgate-host-interface:ipv4/netgate-host-interface:address

Example URL

https://hostname/restconf/data/netgate-host-interface:host-if-config/netgate-host-interface:interface={name}/netgate-host-interface:ipv4/netgate-host-interface:address

returns netgate.host.interface.hostifconfig.interface.ipv4.Address

path Parameters
name
required
string

Id of interface

Responses

200

netgate.host.interface.hostifconfig.interface.ipv4.Address

400

Internal error

Request samples

Copy
package main

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

func main()