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, Release 7.x

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

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

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 https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

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>

Note: This example was added in Release 7.0(3)I7(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 protocol ntp vdc 1

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/media/dme/index.html

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

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>

Note: This example was added in Release 7.0(3)I7(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 protocol ntp vdc 1

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/media/dme/index.html

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

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>

Note: This example was added in Release 7.0(3)I7(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 protocol ptp vdc 1

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/media/dme/index.html

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

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>

Note: This example was added in Release 7.0(3)I7(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 protocol ptp vdc 1

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/media/dme/index.html

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

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>

Note: This example was added in Release 7.0(3)I7(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 protocol none vdc 1

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/media/dme/index.html

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

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>

Note: This example was added in Release 7.0(3)I7(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 protocol none vdc 1

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/media/dme/index.html

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html