netgate-unbound API (19.08)

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

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

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

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

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