17.8.6. DU アプリケーションを PTP イベントにサブスクライブする RESTAPI リファレンス
PTP イベント通知 REST API を使用して、分散ユニット (DU) アプリケーションを親ノードで生成される PTP イベントにサブスクライブします。
リソースアドレス/cluster/node/<node_name>/ptp を使用して、アプリケーションを PTP イベントにサブスクライブします。ここで、<node_name> は、DU アプリケーションを実行しているクラスターノードです。
cloud-event-consumer DU アプリケーションコンテナーと cloud-event-proxy サイドカーコンテナーを別々の DU アプリケーション Pod にデプロイします。cloud-event-consumer DU アプリケーションは、アプリケーション Pod のcloud-event-proxyコンテナーにサブスクライブします。
次の API エンドポイントを使用して、DU アプリケーション Pod の http://localhost:8089/api/ocloudNotifications/v1/ にある cloud-event-proxy コンテナーによってポストされた PTP イベントに cloud-event-consumer DU アプリケーションをサブスクライブします。
/api/ocloudNotifications/v1/subscriptions-
POST: 新しいサブスクリプションを作成します。 -
GET: サブスクリプションの一覧を取得します。 -
DELETE: すべてのサブスクリプションを削除します
-
/api/ocloudNotifications/v1/subscriptions/<subscription_id>-
GET: 指定されたサブスクリプション ID の詳細を返します。 -
DELETE: 指定されたサブスクリプション ID に関連付けられたサブスクリプションを削除します
-
/api/ocloudNotifications/v1/health-
GET:ocloudNotificationsAPI の正常性ステータスを返します
-
api/ocloudNotifications/v1/publishers-
GET: クラスターノードのos-clock-sync-state、ptp-clock-class-change、およびlock-stateメッセージの配列を返します
-
/api/ocloudnotifications/v1/{resource_address}/CurrentState-
GET: 次のいずれかのイベントタイプの現在の状態を返します:os-clock-sync-state、ptp-clock-class-change、またはlock-stateイベント
-
9089 は、アプリケーション Pod にデプロイされた cloud-event-consumer コンテナーのデフォルトポートです。必要に応じて、DU アプリケーションに別のポートを設定できます。
17.8.6.1. api/ocloudNotifications/v1/subscriptions リンクのコピーリンクがクリップボードにコピーされました!
HTTP メソッド
GET api/ocloudNotifications/v1/subscriptions
説明
サブスクリプションのリストを返します。サブスクリプションが存在する場合は、サブスクリプションの一覧とともに 200 OK のステータスコードが返されます。
API 応答の例
[
{
"id": "75b1ad8f-c807-4c23-acf5-56f4b7ee3826",
"endpointUri": "http://localhost:9089/event",
"uriLocation": "http://localhost:8089/api/ocloudNotifications/v1/subscriptions/75b1ad8f-c807-4c23-acf5-56f4b7ee3826",
"resource": "/cluster/node/compute-1.example.com/ptp"
}
]
HTTP メソッド
POST api/ocloudNotifications/v1/subscriptions
説明
新しいサブスクリプションを作成します。サブスクリプションが正常に作成されるか、すでに存在する場合は、201 Created ステータスコードが返されます。
| パラメーター | 型 |
|---|---|
| subscription | data |
ペイロードの例
{
"uriLocation": "http://localhost:8089/api/ocloudNotifications/v1/subscriptions",
"resource": "/cluster/node/compute-1.example.com/ptp"
}
HTTP メソッド
DELETE api/ocloudNotifications/v1/subscriptions
説明
すべてのサブスクリプションを削除します。
API 応答の例
{
"status": "deleted all subscriptions"
}