mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
133 lines
3.7 KiB
Plaintext
133 lines
3.7 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// * scalability_and_performance/using-rfhe.adoc
|
|
|
|
:_mod-docs-content-type: REFERENCE
|
|
[id="cnf-rfhe-notifications-api-refererence_{context}"]
|
|
= Subscribing applications to bare-metal events REST API reference
|
|
|
|
Use the bare-metal events REST API to subscribe an application to the bare-metal events that are generated on the parent node.
|
|
|
|
Subscribe applications to Redfish events by using the resource address `/cluster/node/<node_name>/redfish/event`, where `<node_name>` is the cluster node running the application.
|
|
|
|
Deploy your `cloud-event-consumer` application container and `cloud-event-proxy` sidecar container in a separate application pod. The `cloud-event-consumer` application subscribes to the `cloud-event-proxy` container in the application pod.
|
|
|
|
Use the following API endpoints to subscribe the `cloud-event-consumer` application to Redfish events posted by the `cloud-event-proxy` container at [x-]`http://localhost:8089/api/ocloudNotifications/v1/` in the application pod:
|
|
|
|
* `/api/ocloudNotifications/v1/subscriptions`
|
|
- `POST`: Creates a new subscription
|
|
- `GET`: Retrieves a list of subscriptions
|
|
* `/api/ocloudNotifications/v1/subscriptions/<subscription_id>`
|
|
- `PUT`: Creates a new status ping request for the specified subscription ID
|
|
* `/api/ocloudNotifications/v1/health`
|
|
- `GET`: Returns the health status of `ocloudNotifications` API
|
|
|
|
[NOTE]
|
|
====
|
|
`9089` is the default port for the `cloud-event-consumer` container deployed in the application pod. You can configure a different port for your application as required.
|
|
====
|
|
|
|
[discrete]
|
|
== api/ocloudNotifications/v1/subscriptions
|
|
|
|
[discrete]
|
|
=== HTTP method
|
|
|
|
`GET api/ocloudNotifications/v1/subscriptions`
|
|
|
|
[discrete]
|
|
==== Description
|
|
|
|
Returns a list of subscriptions. If subscriptions exist, a `200 OK` status code is returned along with the list of subscriptions.
|
|
|
|
.Example API response
|
|
[source,json]
|
|
----
|
|
[
|
|
{
|
|
"id": "ca11ab76-86f9-428c-8d3a-666c24e34d32",
|
|
"endpointUri": "http://localhost:9089/api/ocloudNotifications/v1/dummy",
|
|
"uriLocation": "http://localhost:8089/api/ocloudNotifications/v1/subscriptions/ca11ab76-86f9-428c-8d3a-666c24e34d32",
|
|
"resource": "/cluster/node/openshift-worker-0.openshift.example.com/redfish/event"
|
|
}
|
|
]
|
|
----
|
|
|
|
[discrete]
|
|
=== HTTP method
|
|
|
|
`POST api/ocloudNotifications/v1/subscriptions`
|
|
|
|
[discrete]
|
|
==== Description
|
|
|
|
Creates a new subscription. If a subscription is successfully created, or if it already exists, a `201 Created` status code is returned.
|
|
|
|
.Query parameters
|
|
|===
|
|
| Parameter | Type
|
|
|
|
| subscription
|
|
| data
|
|
|===
|
|
|
|
.Example payload
|
|
[source,json]
|
|
----
|
|
{
|
|
"uriLocation": "http://localhost:8089/api/ocloudNotifications/v1/subscriptions",
|
|
"resource": "/cluster/node/openshift-worker-0.openshift.example.com/redfish/event"
|
|
}
|
|
----
|
|
|
|
[discrete]
|
|
== api/ocloudNotifications/v1/subscriptions/<subscription_id>
|
|
|
|
[discrete]
|
|
=== HTTP method
|
|
|
|
`GET api/ocloudNotifications/v1/subscriptions/<subscription_id>`
|
|
|
|
[discrete]
|
|
==== Description
|
|
|
|
Returns details for the subscription with ID `<subscription_id>`
|
|
|
|
.Query parameters
|
|
|===
|
|
| Parameter | Type
|
|
|
|
| `<subscription_id>`
|
|
| string
|
|
|===
|
|
|
|
.Example API response
|
|
[source,json]
|
|
----
|
|
{
|
|
"id":"ca11ab76-86f9-428c-8d3a-666c24e34d32",
|
|
"endpointUri":"http://localhost:9089/api/ocloudNotifications/v1/dummy",
|
|
"uriLocation":"http://localhost:8089/api/ocloudNotifications/v1/subscriptions/ca11ab76-86f9-428c-8d3a-666c24e34d32",
|
|
"resource":"/cluster/node/openshift-worker-0.openshift.example.com/redfish/event"
|
|
}
|
|
----
|
|
|
|
[discrete]
|
|
== api/ocloudNotifications/v1/health/
|
|
|
|
[discrete]
|
|
=== HTTP method
|
|
|
|
`GET api/ocloudNotifications/v1/health/`
|
|
|
|
[discrete]
|
|
==== Description
|
|
|
|
Returns the health status for the `ocloudNotifications` REST API.
|
|
|
|
.Example API response
|
|
[source,terminal]
|
|
----
|
|
OK
|
|
----
|