Configuring Clock Settings
This section uses examples to demonstrate how to configure clock settings such as the network time protocol (NTP) and the precision time protocol (PTP). For more information, see the Cisco Nexus 9000 Series NX-OS System Management Configuration Guide:
Configuring the Clock Settings
Configuring the Clock Settings
POST http://<IP_Address>/api/mo/sys/clock.json
{
"datetimeClock": {
"attributes": {
"format": "12hours",
"protocol": "ntp",
"vdcId": "1"
},
"children": [
{
"datetimeTimezone": {
"attributes": {
"hours": "-8",
"minutes": "0",
"nameT": "PST"
}}},{
"datetimeSummerT": {
"attributes": {
"endDay": "Sunday",
"endMon": "November",
"endTime": "02:00",
"endWeek": "1",
"nameT": "PDT",
"offsetMin": "60",
"startDay": "Sunday",
"startMon": "March",
"startTime": "02:00",
"startWeek": "1"
}}}]}}
<System>
<clock-items>
<format>12hours</format>
<protocol>ntp</protocol>
<vdcId>1</vdcId>
<timezone-items>
<hours>-8</hours>
<minutes>0</minutes>
<nameT>PST</nameT>
</timezone-items>
<summertime-items>
<endDay>Sunday</endDay>
<endMon>November</endMon>
<endTime>02:00</endTime>
<endWeek>1</endWeek>
<nameT>PDT</nameT>
<offsetMin>60</offsetMin>
<startDay>Sunday</startDay>
<startMon>March</startMon>
<startTime>02:00</startTime>
<startWeek>1</startWeek>
</summertime-items>
</clock-items>
</System>
This example configures clock settings
CLI Commands
The CLI commands and options listed below are the equivalent to the payload example displayed in the pane on the right.
clock protocol ntp vdc 1
clock timezone PST -8 0
clock format 12-hours
clock summer-time PDT 1 Sunday March 02:00 1 Sunday November 02:00 60
Note: The property information for this example was added in Release 9.3(3).
Verifying a DME Configuration
The following table contains the distinguished name (DN) for each managed object (MO) in the DME payload. Issue a GET request using the DN to verify the configuration was posted or to get information about the configured properties of a particular object.
MO | DN |
---|---|
datetimeClock | sys/clock |
datetimeTimezone | sys/clock/timezone |
datetimeSummerT | sys/clock/summertime |
datetimeClock Properties
The following table contains information about the datetimeClock properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.
Property Name | Data Type | Description | Values |
---|---|---|---|
format | datetime:ClockFormat (scalar:Enum8) | Clock Format | SELECTION: 0 - 24hours 1 - 12hours DEFAULT: 24hours |
protocol | datetime:ClockProtocol (scalar:Enum8) | Protocol Type | SELECTION: 0 - unspecified 1 - ptp 2 - ntp 3 - none DEFAULT: ntp |
vdcId | datetime:VdcId (scalar:Uint16) | Vdc | RANGE: [0, 65535] DEFAULT: 1 |
datetimeTimezone Properties
The following table contains information about the datetimeTimezone properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.
Property Name | Data Type | Description | Values |
---|---|---|---|
hours | datetime:HourOffset (scalar:Sint16) | Hours offset from UTC | RANGE: [-12 , 14] |
minutes | datetime:MinuteOffsetTz (scalar:Uint16) | Minutes offset from UTC | RANGE: [0 , 59] |
nameT | string:Basic | Name of timezone | A sequence of characters |
datetimeSummerT Properties
The following table contains information about the datetimeSummerT properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.
Property Name | Data Type | Description | Values |
---|---|---|---|
endDay | string:Basic | Weekday to end | A sequence of characters DEFAULT: Sun |
endMon | string:Basic | Month to end | A sequence of characters DEFAULT: Nov |
endTime | string:Basic | HH:MM Time to end | A sequence of characters DEFAULT: 02:00 |
endWeek | datetime:WeekNum (scalar:Uint16) | Week number to end | RANGE: [1 , 5] DEFAULT: 1 |
nameT | string:Basic | Name of timezone in summer | A sequence of characters |
offsetMin | datetime:MinuteOffsetSt (scalar:Uint16) | Offset to add in minutes | RANGE: [1 , 1440] DEFAULT: 60 |
startDay | string:Basic | Weekday to start | A sequence of characters DEFAULT: Sun |
startMon | string:Basic | Month to start | A sequence of characters DEFAULT: Mar |
startTime | string:Basic | HH:MM Time to start | A sequence of characters DEFAULT: 02:00 |
startWeek | datetime:WeekNum (scalar:Uint16) | Week number to start | RANGE: [1 , 5] DEFAULT: 2 |
Related Documentation
For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/
For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide:
Configuring The NTP Clock Protocol
Configuring The NTP Clock Protocol
POST http://<mgmt0_IP>/api/mo/sys.json
{
"topSystem": {
"children": [
{
"datetimeClock": {
"attributes": {
"protocol": "ntp",
"vdcId": "1"
}}}]}}
{
"imdata": []
}
<System>
<clock-items>
<protocol>ntp</protocol>
<vdcId>1</vdcId>
</clock-items>
</System>
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.
clock protocol ntp vdc 1
Note: The property information for this example was added in Release 9.3(3).
Verifying a DME Configuration
The following table contains the distinguished name (DN) for each managed object (MO) in the DME payload. Issue a GET request using the DN to verify the configuration was posted or to get information about the configured properties of a particular object.
MO | DN |
---|---|
topSystem | sys |
datetimeClock | sys/clock |
datetimeClock Properties
The following table contains information about the datetimeClock properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.
Property Name | Data Type | Description | Values |
---|---|---|---|
protocol | datetime:ClockProtocol (scalar:Enum8) | Protocol Type | SELECTION: 0 - unspecified 1 - ptp 2 - ntp 3 - none DEFAULT: ntp |
vdcId | datetime:VdcId (scalar:Uint16) | Vdc | RANGE: [0, 65535] DEFAULT: 1 |
Related Documentation
For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/
For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide:
Deleting The NTP Clock Protocol
Deleting The NTP Clock Protocol
POST http://<mgmt0_IP>/api/mo/sys.json
{
"topSystem": {
"children": [
{
"datetimeClock": {
"attributes": {
"protocol": "unspecified",
"vdcId": "1"
}}}]}}
{
"imdata": []
}
<System>
<clock-items>
<protocol>unspecified</protocol>
<vdcId>1</vdcId>
</clock-items>
</System>
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.
no clock protocol ntp vdc 1
Note: The property information for this example was added in Release 9.3(3).
Verifying a DME Configuration
The following table contains the distinguished name (DN) for each managed object (MO) in the DME payload. Issue a GET request using the DN to verify the configuration was posted or to get information about the configured properties of a particular object.
MO | DN |
---|---|
topSystem | sys |
datetimeClock | sys/clock |
datetimeClock Properties
The following table contains information about the datetimeClock properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.
Property Name | Data Type | Description | Values |
---|---|---|---|
protocol | datetime:ClockProtocol (scalar:Enum8) | Protocol Type | SELECTION: 0 - unspecified 1 - ptp 2 - ntp 3 - none DEFAULT: ntp |
vdcId | datetime:VdcId (scalar:Uint16) | Vdc | RANGE: [0, 65535] DEFAULT: 1 |
Related Documentation
For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/
For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide:
Configuring The PTP Clock Protocol
Configuring The PTP Clock Protocol
POST http://<mgmt0_IP>/api/mo/sys.json
{
"topSystem": {
"children": [
{
"datetimeClock": {
"attributes": {
"protocol": "ptp",
"vdcId": "1"
}}}]}}
{
"imdata": []
}
<System>
<clock-items>
<protocol>ptp</protocol>
<vdcId>1</vdcId>
</clock-items>
</System>
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.
clock protocol ptp vdc 1
Note: The property information for this example was added in Release 9.3(3).
Verifying a DME Configuration
The following table contains the distinguished name (DN) for each managed object (MO) in the DME payload. Issue a GET request using the DN to verify the configuration was posted or to get information about the configured properties of a particular object.
MO | DN |
---|---|
topSystem | sys |
datetimeClock | sys/clock |
datetimeClock Properties
The following table contains information about the datetimeClock properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.
Property Name | Data Type | Description | Values |
---|---|---|---|
protocol | datetime:ClockProtocol (scalar:Enum8) | Protocol Type | SELECTION: 0 - unspecified 1 - ptp 2 - ntp 3 - none DEFAULT: ntp |
vdcId | datetime:VdcId (scalar:Uint16) | Vdc | RANGE: [0, 65535] DEFAULT: 1 |
Related Documentation
For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/
For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide:
Deleting The PTP Clock Protocol
Deleting The PTP Clock Protocol
POST http://<mgmt0_IP>/api/mo/sys.json
{
"topSystem": {
"children": [
{
"datetimeClock": {
"attributes": {
"protocol": "unspecified",
"vdcId": "1"
}}}]}}
{
"imdata": []
}
<System>
<clock-items>
<protocol>unspecified</protocol>
<vdcId>1</vdcId>
</clock-items>
</System>
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.
no clock protocol ptp vdc 1
Note: The property information for this example was added in Release 9.3(3).
Verifying a DME Configuration
The following table contains the distinguished name (DN) for each managed object (MO) in the DME payload. Issue a GET request using the DN to verify the configuration was posted or to get information about the configured properties of a particular object.
MO | DN |
---|---|
topSystem | sys |
datetimeClock | sys/clock |
datetimeClock Properties
The following table contains information about the datetimeClock properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.
Property Name | Data Type | Description | Values |
---|---|---|---|
protocol | datetime:ClockProtocol (scalar:Enum8) | Protocol Type | SELECTION: 0 - unspecified 1 - ptp 2 - ntp 3 - none DEFAULT: ntp |
vdcId | datetime:VdcId (scalar:Uint16) | Vdc | RANGE: [0, 65535] DEFAULT: 1 |
Related Documentation
For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/
For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide:
Configuring Clock Protocol As None
Configuring Clock Protocol As None
POST http://<mgmt0_IP>/api/mo/sys.json
{
"topSystem": {
"children": [
{
"datetimeClock": {
"attributes": {
"protocol": "none",
"vdcId": "1"
}}}]}}
{
"imdata": []
}
<System>
<clock-items>
<protocol>none</protocol>
<vdcId>1</vdcId>
</clock-items>
</System>
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.
clock protocol none vdc 1
Note: The property information for this example was added in Release 9.3(3).
Verifying a DME Configuration
The following table contains the distinguished name (DN) for each managed object (MO) in the DME payload. Issue a GET request using the DN to verify the configuration was posted or to get information about the configured properties of a particular object.
MO | DN |
---|---|
topSystem | sys |
datetimeClock | sys/clock |
datetimeClock Properties
The following table contains information about the datetimeClock properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.
Property Name | Data Type | Description | Values |
---|---|---|---|
protocol | datetime:ClockProtocol (scalar:Enum8) | Protocol Type | SELECTION: 0 - unspecified 1 - ptp 2 - ntp 3 - none DEFAULT: ntp |
vdcId | datetime:VdcId (scalar:Uint16) | Vdc | RANGE: [0, 65535] DEFAULT: 1 |
Related Documentation
For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/
For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide:
Deleting Clock Protocol Configured As None
Deleting Clock Protocol Configured As None
POST http://<mgmt0_IP>/api/mo/sys.json
{
"topSystem": {
"children": [
{
"datetimeClock": {
"attributes": {
"protocol": "unspecified",
"vdcId": "1"
}}}]}}
{
"imdata": []
}
<System>
<clock-items>
<protocol>unspecified</protocol>
<vdcId>1</vdcId>
</clock-items>
</System>
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.
no clock protocol none vdc 1
Note: The property information for this example was added in Release 9.3(3).
Verifying a DME Configuration
The following table contains the distinguished name (DN) for each managed object (MO) in the DME payload. Issue a GET request using the DN to verify the configuration was posted or to get information about the configured properties of a particular object.
MO | DN |
---|---|
topSystem | sys |
datetimeClock | sys/clock |
datetimeClock Properties
The following table contains information about the datetimeClock properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.
Property Name | Data Type | Description | Values |
---|---|---|---|
protocol | datetime:ClockProtocol (scalar:Enum8) | Protocol Type | SELECTION: 0 - unspecified 1 - ptp 2 - ntp 3 - none DEFAULT: ntp |
vdcId | datetime:VdcId (scalar:Uint16) | Vdc | RANGE: [0, 65535] DEFAULT: 1 |
Related Documentation
For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/
For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide:
Enabling the Configured Timezone in Debugs
Enabling the Configured Timezone in Debugs
POST http://<mgmt0_IP>/api/mo/sys.json
{
"topSystem": {
"children": [
{
"datetimeClock": {
"attributes": {
"formatDebug": "yes"
}}}]}}
{
imdata:[]
}
<System>
<clock-items>
<formatDebug>true</formatDebug>
</clock-items>
</System>
Note: This example was added in Release 9.3(3).
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.
clock format show-timezone debug
Verifying a DME Configuration
The following table contains the distinguished name (DN) for each managed object (MO) in the DME payload. Issue a GET request using the DN to verify the configuration was posted or to get information about the configured properties of a particular object.
MO | DN |
---|---|
topSystem | sys |
datetimeClock | sys/clock |
datetimeClock Properties
The following table contains information about the datetimeClock properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.
Property Name | Data Type | Description | Values |
---|---|---|---|
formatDebug | scalar:Bool | enable/disable Clock Format for debug | SELECTION: true or false |
Related Documentation
For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/
For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide:
Deleting the Configured Timezone in Debugs
Deleting the Configured Timezone in Debugs
POST http://<mgmt0_IP>/api/mo/sys.json
{
"topSystem": {
"children": [
{
"datetimeClock": {
"attributes": {
"formatDebug": "no"
}}}]}}
{
imdata:[]
}
<System>
<clock-items>
<formatDebug>false</formatDebug>
</clock-items>
</System>
Note: This example was added in Release 9.3(3).
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.
no clock format show-timezone debug
Verifying a DME Configuration
The following table contains the distinguished name (DN) for each managed object (MO) in the DME payload. Issue a GET request using the DN to verify the configuration was posted or to get information about the configured properties of a particular object.
MO | DN |
---|---|
topSystem | sys |
datetimeClock | sys/clock |
datetimeClock Properties
The following table contains information about the datetimeClock properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.
Property Name | Data Type | Description | Values |
---|---|---|---|
formatDebug | scalar:Bool | enable/disable Clock Format for debug | SELECTION: true or false |
Related Documentation
For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/
For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide:
Enabling the configured Timezone in Syslogs
Enabling the configured Timezone in Syslogs
POST http://<mgmt0_IP>/api/mo/sys.json
{
"topSystem": {
"children": [
{
"datetimeClock": {
"attributes": {
"formatSyslog": "yes"
}}}]}}
{
imdata:[]
}
<System>
<clock-items>
<formatSyslog>true</formatSyslog>
</clock-items>
</System>
Note: This example was added in Release 9.3(3).
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.
clock format show-timezone syslog
Verifying a DME Configuration
The following table contains the distinguished name (DN) for each managed object (MO) in the DME payload. Issue a GET request using the DN to verify the configuration was posted or to get information about the configured properties of a particular object.
MO | DN |
---|---|
topSystem | sys |
datetimeClock | sys/clock |
datetimeClock Properties
The following table contains information about the datetimeClock properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.
Property Name | Data Type | Description | Values |
---|---|---|---|
formatSyslog | scalar:Bool | enable/disable Clock Format for syslog | SELECTION: true or false |
Related Documentation
For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/
For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide:
Deleting the Configured Timezone in Syslogs
Deleting the Configured Timezone in Syslogs
POST http://<mgmt0_IP>/api/mo/sys.json
{
"topSystem": {
"children": [
{
"datetimeClock": {
"attributes": {
"formatSyslog": "no"
}}}]}}
{
imdata:[]
}
<System>
<clock-items>
<formatSyslog>false</formatSyslog>
</clock-items>
</System>
Note: This example was added in Release 9.3(3).
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.
no clock format show-timezone syslog
Verifying a DME Configuration
The following table contains the distinguished name (DN) for each managed object (MO) in the DME payload. Issue a GET request using the DN to verify the configuration was posted or to get information about the configured properties of a particular object.
MO | DN |
---|---|
topSystem | sys |
datetimeClock | sys/clock |
datetimeClock Properties
The following table contains information about the datetimeClock properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.
Property Name | Data Type | Description | Values |
---|---|---|---|
formatSyslog | scalar:Bool | enable/disable Clock Format for syslog | SELECTION: true or false |
Related Documentation
For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/
For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide: