netgate-ntp API (22.10)

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

Copyright 2018-2020 Rubicon Communications, LLC.

ntp-config

returns netgate.ntp.NtpConfig

get /data/netgate-ntp:ntp-config

Example URL

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

Network Time Protocol daemon configuration for time keeping and services.

Responses

200

netgate.ntp.NtpConfig

400

Internal error

Request samples

Copy
package main

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

func main() {

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

creates netgate.ntp.NtpConfig

post /data/netgate-ntp:ntp-config

Example URL

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

Network Time Protocol daemon configuration for time keeping and services.

Request Body schema: application/yang-data+json

netgate.ntp.NtpConfig to be added to list

netgate-ntp:ntp-config
object (netgate.ntp.NtpConfig)

Responses

201

Object created

400

Internal error

409

Object already exists

Request samples

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

creates or updates netgate.ntp.NtpConfig

put /data/netgate-ntp:ntp-config

Example URL

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

Network Time Protocol daemon configuration for time keeping and services.

Request Body schema: application/yang-data+json

netgate.ntp.NtpConfig to be added or updated

netgate-ntp:ntp-config-wrapper
object (netgate.ntp.NtpConfigWrapper)

Responses

201

Object created

204

Object modified

400

Internal error

Request samples

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

removes netgate.ntp.NtpConfig

delete /data/netgate-ntp:ntp-config

Example URL

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

Network Time Protocol daemon configuration for time keeping and services.

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-ntp:ntp-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.ntp.ntpconfig.Daemon

get /data/netgate-ntp:ntp-config/daemon

Example URL

https://hostname/restconf/data/netgate-ntp:ntp-config/daemon

NTP daemon configuration parameters.

Responses

200

netgate.ntp.ntpconfig.Daemon

400

Internal error

Request samples

Copy
package main

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

func main() {

	url := "http://hostname/restconf/data/netgate-ntp:ntp-config/daemon"

	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-ntp:daemon-wrapper":
    {
    }
}

creates netgate.ntp.ntpconfig.Daemon

post /data/netgate-ntp:ntp-config/daemon

Example URL

https://hostname/restconf/data/netgate-ntp:ntp-config/daemon

NTP daemon configuration parameters.

Request Body schema: application/yang-data+json

netgate.ntp.ntpconfig.Daemon to be added to list

daemon
object (netgate.ntp.ntpconfig.Daemon)

Responses

201

Object created

400

Internal error

409

Object already exists

Request samples

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

creates or updates netgate.ntp.ntpconfig.Daemon

put /data/netgate-ntp:ntp-config/daemon

Example URL

https://hostname/restconf/data/netgate-ntp:ntp-config/daemon

NTP daemon configuration parameters.

Request Body schema: application/yang-data+json

netgate.ntp.ntpconfig.Daemon to be added or updated

netgate-ntp:daemon-wrapper
object (netgate.ntp.ntpconfig.DaemonWrapper)

Responses

201

Object created

204

Object modified

400

Internal error

Request samples

Content type
application/yang-data+json
Copy
Expand all Collapse all
{
  • "netgate-ntp:daemon-wrapper":
    {