Menu Close

10.10.5.3.2. HTTP 方法

POST api/cloudNotifications/v1/subscriptions

10.10.5.3.2.1. 描述

创建新订阅。如果订阅成功创建,或者已存在,则返回 201 Created 状态代码。

表 10.3. 查询参数

参数类型

subscription

data

有效负载示例

{
  "id": "56e8a064-dc4b-4428-8085-91c18ea07930",
  "endpointUri": "http://localhost:8080/api/cloudNotifications/v1/dummy",
  "uriLocation": "http://localhost:8080/api/cloudNotifications/v1/subscriptions/56e8a064-dc4b-4428-8085-91c18ea07930",
  "resource": "/cluster/node/compute-1.example.com/ptp"
 }

oc exec curl 命令示例

$ 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 ' {
"id": "56e8a064-dc4b-4428-8085-91c18ea07930",
"endpointUri": "http://localhost:8080/api/cloudNotifications/v1/dummy",
"uriLocation": "http://localhost:8080/api/cloudNotifications/v1/subscriptions/75b1ad8f-dc4b-4428-8085-91c18ea07930",
"resource": "/cluster/node/compute-1.example.com/ptp"
}'