netgate-unbound API (19.05)

This YANG module provides a data-model for the Unbound service.

Copyright 2018-2019 Rubicon Communications, LLC.

unbound-config

returns netgate.unbound.UnboundConfig

get /data/netgate-unbound:unbound-config

Example URL

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

Configuration for the Unbound DNS name resolver daemon.

Responses

200

netgate.unbound.UnboundConfig

400

Internal error

Request samples

Copy
package main

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

func main() {

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

creates netgate.unbound.UnboundConfig

post /data/netgate-unbound:unbound-config

Example URL

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

Configuration for the Unbound DNS name resolver daemon.

Request Body schema: application/yang-data+json

netgate.unbound.UnboundConfig to be added to list

forward-zones
object (netgate.unbound.unboundconfig.ForwardZones)
server
object (netgate.unbound.unboundconfig.Server)
parameters
object (netgate.unbound.unboundconfig.Parameters)

Responses

201

Object created

400

Internal error

409

Object already exists

Request samples

application/yang-data+json
Copy
Expand all Collapse all
{
  • "forward-zones":
    {
    },
  • "server":
    {
    },
  • "parameters":
    {
    }
}

creates or updates netgate.unbound.UnboundConfig

put /data/netgate-unbound:unbound-config

Example URL

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

Configuration for the Unbound DNS name resolver daemon.

Request Body schema: application/yang-data+json

netgate.unbound.UnboundConfig to be added or updated

netgate-unbound:unbound-config
object (netgate.unbound.UnboundConfig)

Responses

201

Object created

204

Object modified

400

Internal error

Request samples

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

removes netgate.unbound.UnboundConfig

delete /data/netgate-unbound:unbound-config

Example URL

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

Configuration for the Unbound DNS name resolver daemon.

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-unbound:unbound-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.unbound.unboundconfig.ForwardZones

get /data/netgate-unbound:unbound-config/netgate-unbound:forward-zones

Example URL

https://hostname/restconf/data/netgate-unbound:unbound-config/netgate-unbound:forward-zones

The forward-zone attributes.

Responses

200

netgate.unbound.unboundconfig.ForwardZones

400

Internal error

Request samples

Copy
package main

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

func main() {

	url := "http://hostname/restconf/data/netgate-unbound:unbound-config/netgate-unbound:forward-zones"

	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-unbound:forward-zones":
    {
    }
}

creates netgate.unbound.unboundconfig.ForwardZones

post /data/netgate-unbound:unbound-config/netgate-unbound:forward-zones

Example URL

https://hostname/restconf/data/netgate-unbound:unbound-config/netgate-unbound:forward-zones

The forward-zone attributes.

Request Body schema: application/yang-data+json

netgate.unbound.unboundconfig.ForwardZones to be added to list

zone
Array of objects (netgate.unbound.unboundconfig.forwardzones.Zone)

Each forward-zone is identified by a domain name. Use '.' as the wildcard domain name. Each zone has a list of nameservers specified as hostnames or host addresses.

Responses

201

Object created

400

Internal error

409

Object already exists

Request samples

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

creates or updates netgate.unbound.unboundconfig.ForwardZones

put /data/netgate-unbound:unbound-config/netgate-unbound:forward-zones

Example URL

https://hostname/restconf/data/netgate-unbound:unbound-config/netgate-unbound:forward-zones

The forward-zone attributes.

Request Body schema: application/yang-data+json

netgate.unbound.unboundconfig.ForwardZones to be added or updated

netgate-unbound:forward-zones
object (netgate.unbound.unboundconfig.ForwardZones)

Responses

201

Object created

204

Object modified

400

Internal error

Request samples

application/yang-data+json
Copy
Expand all Collapse all
{
  • "netgate-unbound:forward-zones":
    {
    }
}

removes netgate.unbound.unboundconfig.ForwardZones

delete /data/netgate-unbound:unbound-config/netgate-unbound:forward-zones

Example URL

https://hostname/restconf/data/netgate-unbound:unbound-config/netgate-unbound:forward-zones

The forward-zone attributes.

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-unbound:unbound-config/netgate-unbound:forward-zones"

	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.unbound.unboundconfig.forwardzones.Zone

post /data/netgate-unbound:unbound-config/netgate-unbound:forward-zones/netgate-unbound:zone

Example URL

https://hostname/restconf/data/netgate-unbound:unbound-config/netgate-unbound:forward-zones/netgate-unbound:zone

Each forward-zone is identified by a domain name. Use '.' as the wildcard domain name. Each zone has a list of nameservers specified as hostnames or host addresses.

Request Body schema: application/yang-data+json

netgate.unbound.unboundconfig.forwardzones.Zone to be added to list

forward-addresses
object (netgate.unbound.unboundconfig.forwardzones.zone.ForwardAddresses)
forward-hosts
object (netgate.unbound.unboundconfig.forwardzones.zone.ForwardHosts)
forward-first
boolean

If true and the query fails using this forwarder first, lookups are then sent to authoritative, root nameservers.

forward-tls-upstream
boolean

If true, queries to this forwarder use TLS for transport.

zone-name
string

The forward-zone domain name. Use '.' as a wildcard to forward all queries.

Responses

201

Object created

400

Internal error

409

Object already exists

Request samples

application/yang-data+json
Copy
Expand all Collapse all
{
  • "forward-addresses":
    {
    },
  • "forward-hosts":
    {
    },
  • "forward-first": true,
  • "forward-tls-upstream": true,
  • "zone-name": "string"
}

returns netgate.unbound.unboundconfig.forwardzones.Zone

get /data/netgate-unbound:unbound-config/netgate-unbound:forward-zones/netgate-unbound:zone={zone-name}

Example URL

https://hostname/restconf/data/netgate-unbound:unbound-config/netgate-unbound:forward-zones/netgate-unbound:zone={zone-name}

Each forward-zone is identified by a domain name. Use '.' as the wildcard domain name. Each zone has a list of nameservers specified as hostnames or host addresses.

path Parameters
zone-name
required
string

Id of zone

Responses

200

netgate.unbound.unboundconfig.forwardzones.Zone

400

Internal error

Request samples

Copy
package main

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

func main() {

	url := "http://hostname/restconf/data/netgate-unbound:unbound-config/netgate-unbound:forward-zones/netgate-unbound:zone=%7Bzone-name%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-unbound:zone":
    {
    }
}

creates netgate.unbound.unboundconfig.forwardzones.Zone

post /data/netgate-unbound:unbound-config/netgate-unbound:forward-zones/netgate-unbound:zone={zone-name}

Example URL

https://hostname/restconf/data/netgate-unbound:unbound-config/netgate-unbound:forward-zones/netgate-unbound:zone={zone-name}

Each forward-zone is identified by a domain name. Use '.' as the wildcard domain name. Each zone has a list of nameservers specified as hostnames or host addresses.

path Parameters
zone-name
required
string

Id of zone

Request Body schema: application/yang-data+json

netgate.unbound.unboundconfig.forwardzones.Zone to be added to list

forward-addresses
object (netgate.unbound.unboundconfig.forwardzones.zone.ForwardAddresses)
forward-hosts
object (netgate.unbound.unboundconfig.forwardzones.zone.ForwardHosts)
forward-first
boolean

If true and the query fails using this forwarder first, lookups are then sent to authoritative, root nameservers.

forward-tls-upstream
boolean

If true, queries to this forwarder use TLS for transport.

zone-name
string

The forward-zone domain name. Use '.' as a wildcard to forward all queries.

Responses

201

Object created

400

Internal error

409

Object already exists

Request samples

application/yang-data+json
Copy
Expand all Collapse all
{
  • "forward-addresses":
    {
    },
  • "forward-hosts":
    {
    },
  • "forward-first": true,
  • "forward-tls-upstream": true,
  • "zone-name": "string"
}

creates or updates netgate.unbound.unboundconfig.forwardzones.Zone

put /data/netgate-unbound:unbound-config/netgate-unbound:forward-zones/netgate-unbound:zone={zone-name}

Example URL

https://hostname/restconf/data/netgate-unbound:unbound-config/netgate-unbound:forward-zones/netgate-unbound:zone={zone-name}

Each forward-zone is identified by a domain name. Use '.' as the wildcard domain name. Each zone has a list of nameservers specified as hostnames or host addresses.

path Parameters
zone-name
required
string

Id of zone

Request Body schema: application/yang-data+json

netgate.unbound.unboundconfig.forwardzones.Zone to be added or updated

netgate-unbound:zone
object (netgate.unbound.unboundconfig.forwardzones.Zone)

Responses

201

Object created

204

Object modified

400

Internal error

Request samples