Skip to content

Commit bd718c1

Browse files
authored
Merge pull request #54355 from rohennes/OCPBUGS-5149-PTP-current-state-API
OCPBUGS#5149: Adding missing CurrentState API route info - WIP
2 parents ef6a727 + 3926af6 commit bd718c1

File tree

1 file changed

+114
-0
lines changed

1 file changed

+114
-0
lines changed

modules/cnf-fast-event-notifications-api-refererence.adoc

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ Use the following API endpoints to subscribe the `cloud-event-consumer` DU appli
2929
* `api/cloudNotifications/v1/publishers`
3030
- `GET`: Returns an array of `os-clock-sync-state`, `ptp-clock-class-change`, and `lock-state` messages for the cluster node
3131

32+
* `/api/cloudnotifications/v1/<resource_address>/CurrentState`
33+
- `GET`: Returns the current state of one the following event types: `os-clock-sync-state`, `ptp-clock-class-change`, or `lock-state` events
34+
3235
[NOTE]
3336
====
3437
`9089` is the default port for the `cloud-event-consumer` container deployed in the application pod. You can configure a different port for your DU application as required.
@@ -289,3 +292,114 @@ $ oc logs -f linuxptp-daemon-cvgr6 -n openshift-ptp -c cloud-event-proxy
289292
}
290293
}
291294
----
295+
296+
== /api/cloudnotifications/v1/<resource_address>/CurrentState
297+
298+
[discrete]
299+
=== HTTP method
300+
301+
`GET api/cloudNotifications/v1/cluster/node/<node_name>/sync/ptp-status/lock-state/CurrentState`
302+
303+
`GET api/cloudNotifications/v1/cluster/node/<node_name>/sync/sync-status/os-clock-sync-state/CurrentState`
304+
305+
`GET api/cloudNotifications/v1/cluster/node/<node_name>/sync/ptp-status/ptp-clock-class-change/CurrentState`
306+
307+
[discrete]
308+
==== Description
309+
310+
Configure the `CurrentState` API endpoint to return the current state of the `os-clock-sync-state`, `ptp-clock-class-change`, or `lock-state` events for the cluster node.
311+
312+
* `os-clock-sync-state` notifications describe the host operating system clock synchronization state. Can be in `LOCKED` or `FREERUN` state.
313+
* `ptp-clock-class-change` notifications describe the current state of the PTP clock class.
314+
* `lock-state` notifications describe the current status of the PTP equipment lock state. Can be in `LOCKED`, `HOLDOVER` or `FREERUN` state.
315+
316+
.Query parameters
317+
|===
318+
| Parameter | Type
319+
320+
| `<resource_address>`
321+
| string
322+
|===
323+
324+
.Example lock-state API response
325+
[source,json]
326+
----
327+
{
328+
"id": "c1ac3aa5-1195-4786-84f8-da0ea4462921",
329+
"type": "event.sync.ptp-status.ptp-state-change",
330+
"source": "/cluster/node/compute-1.example.com/sync/ptp-status/lock-state",
331+
"dataContentType": "application/json",
332+
"time": "2023-01-10T02:41:57.094981478Z",
333+
"data": {
334+
"version": "v1",
335+
"values": [
336+
{
337+
"resource": "/cluster/node/compute-1.example.com/ens5fx/master",
338+
"dataType": "notification",
339+
"valueType": "enumeration",
340+
"value": "LOCKED"
341+
},
342+
{
343+
"resource": "/cluster/node/compute-1.example.com/ens5fx/master",
344+
"dataType": "metric",
345+
"valueType": "decimal64.3",
346+
"value": "29"
347+
}
348+
]
349+
}
350+
}
351+
----
352+
353+
.Example os-clock-sync-state API response
354+
[source,json]
355+
----
356+
{
357+
"specversion": "0.3",
358+
"id": "4f51fe99-feaa-4e66-9112-66c5c9b9afcb",
359+
"source": "/cluster/node/compute-1.example.com/sync/sync-status/os-clock-sync-state",
360+
"type": "event.sync.sync-status.os-clock-sync-state-change",
361+
"subject": "/cluster/node/compute-1.example.com/sync/sync-status/os-clock-sync-state",
362+
"datacontenttype": "application/json",
363+
"time": "2022-11-29T17:44:22.202Z",
364+
"data": {
365+
"version": "v1",
366+
"values": [
367+
{
368+
"resource": "/cluster/node/compute-1.example.com/CLOCK_REALTIME",
369+
"dataType": "notification",
370+
"valueType": "enumeration",
371+
"value": "LOCKED"
372+
},
373+
{
374+
"resource": "/cluster/node/compute-1.example.com/CLOCK_REALTIME",
375+
"dataType": "metric",
376+
"valueType": "decimal64.3",
377+
"value": "27"
378+
}
379+
]
380+
}
381+
}
382+
----
383+
384+
.Example ptp-clock-class-change API response
385+
[source,json]
386+
----
387+
{
388+
"id": "064c9e67-5ad4-4afb-98ff-189c6aa9c205",
389+
"type": "event.sync.ptp-status.ptp-clock-class-change",
390+
"source": "/cluster/node/compute-1.example.com/sync/ptp-status/ptp-clock-class-change",
391+
"dataContentType": "application/json",
392+
"time": "2023-01-10T02:41:56.785673989Z",
393+
"data": {
394+
"version": "v1",
395+
"values": [
396+
{
397+
"resource": "/cluster/node/compute-1.example.com/ens5fx/master",
398+
"dataType": "metric",
399+
"valueType": "decimal64.3",
400+
"value": "165"
401+
}
402+
]
403+
}
404+
}
405+
----

0 commit comments

Comments
 (0)