netgate-ntp API (19.02)

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

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

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

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

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

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

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

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

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