netgate-ntp API (19.05)

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

Copyright 2018-2019 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

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

tinker
object (netgate.ntp.ntpconfig.Tinker)
interfaces
object (netgate.ntp.ntpconfig.Interfaces)
servers
object (netgate.ntp.ntpconfig.Servers)
tos
object (netgate.ntp.ntpconfig.Tos)
restrictions
object (netgate.ntp.ntpconfig.Restrictions)
logconfigs
object (netgate.ntp.ntpconfig.Logconfigs)
parameters
object (netgate.ntp.ntpconfig.Parameters)

Responses

201

Object created

400

Internal error

409

Object already exists

Request samples

application/yang-data+json
Copy
Expand all Collapse all
{
  • "tinker":
    {
    },
  • "interfaces":
    {
    },
  • "servers":
    {
    },
  • "tos":
    {
    },
  • "restrictions":
    {
    },
  • "logconfigs":
    {
    },
  • "parameters":
    {
    }
}

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

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.Interfaces

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

Example URL

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

Interface binding specifications.

Responses

200

netgate.ntp.ntpconfig.Interfaces

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:interfaces"

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

creates netgate.ntp.ntpconfig.Interfaces

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

Example URL

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

Interface binding specifications.

Request Body schema: application/yang-data+json

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

interface
Array of objects (netgate.ntp.ntpconfig.interfaces.Interface)

Responses

201

Object created

400

Internal error

409

Object already exists

Request samples

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

creates or updates netgate.ntp.ntpconfig.Interfaces

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

Example URL

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

Interface binding specifications.

Request Body schema: application/yang-data+json

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

netgate-ntp:interfaces
object (netgate.ntp.ntpconfig.Interfaces)

Responses

201

Object created

204

Object modified

400

Internal error

Request samples

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

removes netgate.ntp.ntpconfig.Interfaces

delete /data/netgate-ntp:ntp-config/netgate-ntp:interfaces

Example URL

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

Interface binding specifications.

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

	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.ntp.ntpconfig.interfaces.Interface

post /data/netgate-ntp:ntp-config/netgate-ntp:interfaces/netgate-ntp:interface

Example URL

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

creates netgate.ntp.ntpconfig.interfaces.Interface

Request Body schema: application/yang-data+json

netgate.ntp.ntpconfig.interfaces.Interface to be added to list

sequence
integer <int64>

The sequence numbers provide an ordering for the list of interface commands.

action
string (netgate.ntp.NtpInterfaceAction)
Enum:"listen" "ignore" "drop"
match-ip-prefix
string

Match an IP prefix.

match-all
boolean

Match all interfaces.

match-interface
string

Match an interface name.

Responses

201

Object created

400

Internal error

409

Object already exists

Request samples

application/yang-data+json
Copy
Expand all Collapse all
{
  • "sequence": 0,
  • "action": "listen",
  • "match-ip-prefix": "string",
  • "match-all": true,
  • "match-interface": "string"
}

returns netgate.ntp.ntpconfig.interfaces.Interface

get /data/netgate-ntp:ntp-config/netgate-ntp:interfaces/netgate-ntp:interface={sequence}

Example URL

https://hostname/restconf/data/netgate-ntp:ntp-config/netgate-ntp:interfaces/netgate-ntp:interface={sequence}

returns netgate.ntp.ntpconfig.interfaces.Interface

path Parameters
sequence
required
integer <int64>

Id of interface

Responses

200

netgate.ntp.ntpconfig.interfaces.Interface

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:interfaces/netgate-ntp:interface=%7Bsequence%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-ntp:interface":
    {
    }
}

creates netgate.ntp.ntpconfig.interfaces.Interface

post /data/netgate-ntp:ntp-config/netgate-ntp:interfaces/netgate-ntp:interface={sequence}

Example URL

https://hostname/restconf/data/netgate-ntp:ntp-config/netgate-ntp:interfaces/netgate-ntp:interface={sequence}

creates netgate.ntp.ntpconfig.interfaces.Interface

path Parameters
sequence
required
integer <int64>

Id of interface

Request Body schema: application/yang-data+json

netgate.ntp.ntpconfig.interfaces.Interface to be added to list

sequence
integer <int64>

The sequence numbers provide an ordering for the list of interface commands.

action
string (netgate.ntp.NtpInterfaceAction)
Enum:"listen" "ignore" "drop"
match-ip-prefix
string

Match an IP prefix.

match-all
boolean

Match all interfaces.

match-interface
string

Match an interface name.

Responses

201

Object created

400

Internal error

409

Object already exists

Request samples

application/yang-data+json
Copy
Expand all Collapse all
{
  • "sequence": 0,
  • "action": "listen",
  • "match-ip-prefix": "string",
  • "match-all": true,
  • "match-interface": "string"
}

creates or updates netgate.ntp.ntpconfig.interfaces.Interface

put /data/netgate-ntp:ntp-config/netgate-ntp:interfaces/netgate-ntp:interface={sequence}

Example URL

https://hostname/restconf/data/netgate-ntp:ntp-config/netgate-ntp:interfaces/netgate-ntp:interface={sequence}

creates or updates netgate.ntp.ntpconfig.interfaces.Interface

path Parameters
sequence
required
integer <int64>

Id of interface

Request Body schema: application/yang-data+json

netgate.ntp.ntpconfig.interfaces.Interface to be added or updated

netgate-ntp:interface
object (netgate.ntp.ntpconfig.interfaces.Interface)

Responses

201

Object created

204

Object modified

400

Internal error

Request samples

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

removes netgate.ntp.ntpconfig.interfaces.Interface

delete /data/netgate-ntp:ntp-config/netgate-ntp:interfaces/netgate-ntp:interface={sequence}

Example URL

https://hostname/restconf/data/netgate-ntp:ntp-config/netgate-ntp:interfaces/netgate-ntp:interface={sequence}

removes netgate.ntp.ntpconfig.interfaces.Interface

path Parameters
sequence
required
integer <int64>

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-ntp:ntp-config/netgate-ntp:interfaces/netgate-ntp:interface=%7Bsequence%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.ntp.ntpconfig.Logconfigs

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

Example URL

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

An ordered sequence of NTPD logconfig settings.

Responses

200

netgate.ntp.ntpconfig.Logconfigs

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:logconfigs"

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

creates netgate.ntp.ntpconfig.Logconfigs

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

Example URL

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

An ordered sequence of NTPD logconfig settings.

Request Body schema: application/yang-data+json

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

logconfig
Array of objects (netgate.ntp.ntpconfig.logconfigs.Logconfig)

Responses

201

Object created

400

Internal error

409

Object already exists

Request samples

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

creates or updates netgate.ntp.ntpconfig.Logconfigs

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

Example URL

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

An ordered sequence of NTPD logconfig settings.

Request Body schema: application/yang-data+json

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

netgate-ntp:logconfigs
object (netgate.ntp.ntpconfig.Logconfigs)

Responses

201

Object created

204

Object modified

400

Internal error

Request samples

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

removes netgate.ntp.ntpconfig.Logconfigs

delete /data/netgate-ntp:ntp-config/netgate-ntp:logconfigs

Example URL

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

An ordered sequence of NTPD logconfig settings.

Responses

204

Object deleted

400

Internal error

Request samples