20.5. 현재 PTP 클럭 상태 가져오기

노드의 현재 PTP 상태를 가져오려면 다음 이벤트 REST API 중 하나에 GET 작업을 보냅니다.

  • http://localhost:8081/api/ocloudNotifications/v1/cluster/node/<NODE_NAME>/sync/ptp-status/lock-state/CurrentState
  • http://localhost:8081/api/ocloudNotifications/v1/cluster/node/<NODE_NAME>/sync/sync-status/os-clock-sync-state/CurrentState
  • http://localhost:8081/api/ocloudNotifications/v1/cluster/node/<NODE_NAME>/sync/ptp-status/ptp-clock-class-change/CurrentState

응답은 클라우드 네이티브 이벤트 JSON 오브젝트입니다. 예를 들면 다음과 같습니다.

lock-state API 응답 예

{
  "id": "c1ac3aa5-1195-4786-84f8-da0ea4462921",
  "type": "event.sync.ptp-status.ptp-state-change",
  "source": "/cluster/node/compute-1.example.com/sync/ptp-status/lock-state",
  "dataContentType": "application/json",
  "time": "2023-01-10T02:41:57.094981478Z",
  "data": {
    "version": "v1",
    "values": [
      {
        "resource": "/cluster/node/compute-1.example.com/ens5fx/master",
        "dataType": "notification",
        "valueType": "enumeration",
        "value": "LOCKED"
      },
      {
        "resource": "/cluster/node/compute-1.example.com/ens5fx/master",
        "dataType": "metric",
        "valueType": "decimal64.3",
        "value": "29"
      }
    ]
  }
}