Skip to content

Commit e00b234

Browse files
committed
Updates PTP API reference
1 parent 50da853 commit e00b234

File tree

1 file changed

+25
-72
lines changed

1 file changed

+25
-72
lines changed

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

Lines changed: 25 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,18 @@
77

88
You can use the PTP fast event notifications REST API to subscribe an application to the PTP events that are generated for the parent node. PTP fast events notifications are available on each node where a PTP capable network interface is configured.
99

10-
You can subscribe DU applications to PTP event notifications by using the resource address `/cluster/node/<node_name>/ptp`, where `<node_name>` is the cluster node running the DU application.
10+
You can subscribe distributed unit (DU) applications to PTP event notifications by using the resource address `/cluster/node/<node_name>/ptp`, where `<node_name>` is the cluster node running the DU application.
1111

12-
Status request are sent by making a REST API `PUT` call to `/subscriptions/status/<subscription_id>`. The API call returns events through the AMQP event bus to the subscribed address.
12+
The PTP Operator deploys the `linuxptp-daemon` container and the `cloud-event-proxy` sidecar container in a pod managed by the PTP Operator. The `cloud-event-proxy` container collects the PTP events and publishes the events using the `cloud-event-proxy` publisher API at [x-]`http://localhost:8089/api/cloudNotifications/v1/`.
1313

14-
The PTP fast events notifications REST API is served at `http://localhost:8080/` by default. The following API endpoints are available:
14+
Deploy your DU application container that needs to subscribe to PTP events and a `cloud-event-proxy` sidecar container in a separate DU application pod. The DU application container uses the subscription API provided by the `cloud-event-proxy` container to subscribe to events at [x-]`http://localhost:8089/api/cloudNotifications/v1/`.
15+
16+
[NOTE]
17+
====
18+
The PTP fast events notifications REST API is provided by `cloud-event-proxy`. To access the API, applications must be in the same pod as the `cloud-event-proxy` container.
19+
====
20+
21+
The following API endpoints are available at [x-]`http://localhost:8089/api/cloudNotifications/v1/` on the DU application pod:
1522

1623
* `/api/cloudNotifications/v1/publishers`
1724
- `POST`: Creates a new publisher
@@ -50,20 +57,11 @@ Creates a new publisher. If publisher creation is successful, or if it already e
5057
[source,json]
5158
----
5259
{
53-
"uriLocation": "http://localhost:8080/api/cloudNotifications/v1/publishers",
60+
"uriLocation": "http://localhost:8089/api/cloudNotifications/v1/publishers",
5461
"resource": "/cluster/node/compute-1.example.com/ptp"
5562
}
5663
----
5764

58-
.Example oc exec curl command
59-
[source,terminal]
60-
----
61-
$ oc exec -it linuxptp-daemon-5j265 -n openshift-ptp -c cloud-event-proxy -- curl --location --request POST 'http://localhost:8080/api/cloudNotifications/v1/publishers' --header 'Content-Type: application/json' --insecure --data '{
62-
"uriLocation": "http://localhost:8080/api/cloudNotifications/v1/publishers",
63-
"resource": "/cluster/node/compute-1.example.com/ptp"
64-
}'
65-
----
66-
6765
=== HTTP method
6866

6967
`GET api/cloudNotifications/v1/publishers`
@@ -72,20 +70,14 @@ $ oc exec -it linuxptp-daemon-5j265 -n openshift-ptp -c cloud-event-proxy -- cur
7270

7371
Returns a list of publishers. If publishers exist, a `200 OK` status code is returned along with the list of publishers.
7472

75-
.Example oc exec curl command
76-
[source,terminal]
77-
----
78-
$ oc exec -it linuxptp-daemon-5j265 -n openshift-ptp -c cloud-event-proxy -- curl --location http://localhost:8080/api/cloudNotifications/v1/publishers
79-
----
80-
81-
.Example return
73+
.Example API response
8274
[source,json]
8375
----
8476
[
8577
{
8678
"id": "56e8a064-dc4b-4428-8085-91c18ea07930",
87-
"endpointUri": "http://localhost:8080/api/cloudNotifications/v1/dummy",
88-
"uriLocation": "http://localhost:8080/api/cloudNotifications/v1/publishers/56e8a064-dc4b-4428-8085-91c18ea07930",
79+
"endpointUri": "http://localhost:8089/api/cloudNotifications/v1/dummy",
80+
"uriLocation": "http://localhost:8089/api/cloudNotifications/v1/publishers/56e8a064-dc4b-4428-8085-91c18ea07930",
8981
"resource": "/cluster/node/compute-1.example.com/ptp"
9082
}
9183
]
@@ -109,19 +101,13 @@ Returns the publisher with ID `<publisher_id>`.
109101
| string
110102
|===
111103

112-
.Example oc exec curl command
113-
[source,terminal]
114-
----
115-
$ oc exec -it linuxptp-daemon-5j265 -n openshift-ptp -c cloud-event-proxy -- curl --location http://localhost:8080/api/cloudNotifications/v1/publishers/56e8a064-dc4b-4428-8085-91c18ea07930
116-
----
117-
118-
.Example return
104+
.Example API response
119105
[source,json]
120106
----
121107
{
122108
"id":"56e8a064-dc4b-4428-8085-91c18ea07930",
123-
"endpointUri":"http://localhost:8080/api/cloudNotifications/v1/dummy",
124-
"uriLocation":"http://localhost:8080/api/cloudNotifications/v1/publishers/56e8a064-dc4b-4428-8085-91c18ea07930",
109+
"endpointUri":"http://localhost:8089/api/cloudNotifications/v1/dummy",
110+
"uriLocation":"http://localhost:8089/api/cloudNotifications/v1/publishers/56e8a064-dc4b-4428-8085-91c18ea07930",
125111
"resource":"/cluster/node/compute-1.example.com/ptp"
126112
}
127113
----
@@ -136,20 +122,14 @@ $ oc exec -it linuxptp-daemon-5j265 -n openshift-ptp -c cloud-event-proxy -- cur
136122

137123
Returns a list of subscriptions. If subscriptions exist, a `200 OK` status code is returned along with the list of subscriptions.
138124

139-
.Example oc exec curl command
140-
[source,terminal]
141-
----
142-
$ oc exec -it linuxptp-daemon-5j265 -n openshift-ptp -c cloud-event-proxy -- curl --location http://localhost:8080/api/cloudNotifications/v1/subscriptions
143-
----
144-
145-
.Example return
125+
.Example API response
146126
[source,json]
147127
----
148128
[
149129
{
150130
"id": "75b1ad8f-c807-4c23-acf5-56f4b7ee3826",
151-
"endpointUri": "http://localhost:8080/api/cloudNotifications/v1/dummy",
152-
"uriLocation": "http://localhost:8080/api/cloudNotifications/v1/subscriptions/75b1ad8f-c807-4c23-acf5-56f4b7ee3826",
131+
"endpointUri": "http://localhost:8089/api/cloudNotifications/v1/dummy",
132+
"uriLocation": "http://localhost:8089/api/cloudNotifications/v1/subscriptions/75b1ad8f-c807-4c23-acf5-56f4b7ee3826",
153133
"resource": "/cluster/node/compute-1.example.com/ptp"
154134
}
155135
]
@@ -175,20 +155,11 @@ Creates a new subscription. If a subscription is successfully created, or if it
175155
[source,json]
176156
----
177157
{
178-
"uriLocation": "http://localhost:8080/api/cloudNotifications/v1/subscriptions",
158+
"uriLocation": "http://localhost:8089/api/cloudNotifications/v1/subscriptions",
179159
"resource": "/cluster/node/compute-1.example.com/ptp"
180160
}
181161
----
182162

183-
.Example oc exec curl command
184-
[source,terminal]
185-
----
186-
$ oc exec -it linuxptp-daemon-5j265 -n openshift-ptp -c cloud-event-proxy -- curl --location --request POST 'http://localhost:8080/api/cloudNotifications/v1/subscriptions' --header 'Content-Type: application/json' --insecure --data '{
187-
"uriLocation": "http://localhost:8080/api/cloudNotifications/v1/subscriptions",
188-
"resource": "/cluster/node/compute-1.example.com/ptp"
189-
}'
190-
----
191-
192163
== api/cloudNotifications/v1/subscriptions/<subscription_id>
193164

194165
=== HTTP method
@@ -207,19 +178,13 @@ Returns details for the subscription with ID `<subscription_id>`
207178
| string
208179
|===
209180

210-
.Example oc exec curl command
211-
[source,terminal]
212-
----
213-
$ oc exec -it linuxptp-daemon-5j265 -n openshift-ptp -c cloud-event-proxy -- curl --location http://localhost:8080/api/cloudNotifications/v1/subscriptions/48210fb3-45be-4ce0-aa9b-41a0e58730ab
214-
----
215-
216-
.Example return
181+
.Example API response
217182
[source,terminal]
218183
----
219184
{
220185
"id":"48210fb3-45be-4ce0-aa9b-41a0e58730ab",
221-
"endpointUri":"http://localhost:8080/api/cloudNotifications/v1/dummy",
222-
"uriLocation":"http://localhost:8080/api/cloudNotifications/v1/subscriptions/48210fb3-45be-4ce0-aa9b-41a0e58730ab",
186+
"endpointUri":"http://localhost:8089/api/cloudNotifications/v1/dummy",
187+
"uriLocation":"http://localhost:8089/api/cloudNotifications/v1/subscriptions/48210fb3-45be-4ce0-aa9b-41a0e58730ab",
223188
"resource":"/cluster/node/compute-1.example.com/ptp"
224189
}
225190
----
@@ -242,12 +207,6 @@ Creates a new status ping request for subscription with ID `<subscription_id>`.
242207
| string
243208
|===
244209

245-
.Example oc exec curl command
246-
[source,terminal]
247-
----
248-
$ oc exec -it linuxptp-daemon-5j265 -n openshift-ptp -c cloud-event-proxy -- curl --location --request PUT http://localhost:8080/api/cloudNotifications/v1/subscriptions/status/48210fb3-45be-4ce0-aa9b-41a0e58730ab
249-
----
250-
251210
.Example output
252211
[source,json]
253212
----
@@ -264,13 +223,7 @@ $ oc exec -it linuxptp-daemon-5j265 -n openshift-ptp -c cloud-event-proxy -- cur
264223

265224
Returns the health status for the `cloudNotifications` REST API.
266225

267-
.Example oc exec curl command
268-
[source,terminal]
269-
----
270-
$ oc exec -it linuxptp-daemon-5j265 -n openshift-ptp -c cloud-event-proxy -- curl --location http://localhost:8080/api/cloudNotifications/v1/health
271-
----
272-
273-
.Example return
226+
.Example API response
274227
[source,terminal]
275228
----
276229
OK

0 commit comments

Comments
 (0)