netgate-ntp API (22.02)

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

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

system
object (netgate.ntp.ntpconfig.System)
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
{
  • "system":
    {
    },
  • "daemon":
    {
    }
}

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
object (netgate.ntp.NtpConfig)

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

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/netgate-ntp:daemon

Example URL

https://hostname/restconf/data/netgate-ntp:ntp-config/netgate-ntp: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/netgate-ntp: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":
    {
    }
}

creates netgate.ntp.ntpconfig.Daemon

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

Example URL

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

NTP daemon configuration parameters.

Request Body schema: application/yang-data+json

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

tinker
object (netgate.ntp.ntpconfig.daemon.Tinker)
interfaces
object (netgate.ntp.ntpconfig.daemon.Interfaces)
servers
object (netgate.ntp.ntpconfig.daemon.Servers)
tos
object (netgate.ntp.ntpconfig.daemon.Tos)
restrictions
object (netgate.ntp.ntpconfig.daemon.Restrictions)
logconfigs
object (netgate.ntp.ntpconfig.daemon.Logconfigs)
parameters
object (netgate.ntp.ntpconfig.daemon.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
{
  • "tinker":
    {
    },
  • "interfaces":
    {
    },
  • "servers":
    {
    },
  • "tos":
    {
    },
  • "restrictions":
    {
    },
  • "logconfigs":
    {
    },
  • "parameters":
    {
    }
}

creates or updates netgate.ntp.ntpconfig.Daemon

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