Skip to content

Commit 7f6bf82

Browse files
committed
Update get_ntp_servers return definition
Support returning details regarding individual NTP servers based on openconfig models (/system/ntp/servers/server)
1 parent 99192df commit 7f6bf82

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

napalm/base/base.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -921,12 +921,23 @@ def get_ntp_servers(self) -> Dict[str, models.NTPServerDict]:
921921
"""
922922
Returns the NTP servers configuration as dictionary.
923923
The keys of the dictionary represent the IP Addresses of the servers.
924-
Inner dictionaries do not have yet any available keys.
924+
Inner dictionaries MAY contain information regarding per-server configuration.
925925
926926
Example::
927927
928928
{
929-
'192.168.0.1': {},
929+
'192.168.0.1':
930+
{
931+
'address': '192.168.0.1',
932+
'port': 123,
933+
'version': 4,
934+
'association_type': 'SERVER',
935+
'iburst': False,
936+
'prefer': False,
937+
'network_instance': 'default',
938+
'source_address': '192.0.2.1',
939+
'key_id': -1,
940+
},
930941
'17.72.148.53': {},
931942
'37.187.56.220': {},
932943
'162.158.20.18': {}

napalm/base/models.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,15 @@
232232
NTPServerDict = TypedDict(
233233
"NTPServerDict",
234234
{
235-
# will populate it in the future wit potential keys
235+
"address": str,
236+
"port": int,
237+
"version": int,
238+
"association_type": str,
239+
"iburst": bool,
240+
"prefer": bool,
241+
"network_instance": str,
242+
"source_address": str,
243+
"key_id": int,
236244
},
237245
total=False,
238246
)

0 commit comments

Comments
 (0)