Connectionless Subscription
Supported notification types:
- Inventory notifications
- Alarm notifications
The following is the workflow in the case of "connectionless" notifications:
- The user is expected to use a REST webservice that is capable of accepting XML and/ or JSON payloads as a POST request. This REST service is the endpoint to which the Cisco EPN Manager restconf notifications framework publishes notifications to.
- User subscribes to notifications by providing the REST service endpoint along with the topic to subscribe to.
URL: https://{server:30603}/crosswork/notification/restconf/data/v2/notifications:subscription
Method: POST
Authentication: JWT
Example Payload:
{ "ietf-restconf:notification.client-url": "http://10.78.102.218:7080/notifications", "ietf-restconf:notification.topic": "alarm", "ietf-restconf:notification.format": "json" }
{ "ietf-restconf:notification.client-url": "http://10.78.102.218:7080/notifications", "ietf-restconf:notification.topic": "inventory", "ietf-restconf:notification.format": "xml" }
- where,
- "client-url" is a REST service capable of accepting XML or JSON payloads as a POST request deployed in {server} at {port} using {context}. The notifications are then sent as POST payload to this endpoint-url. The REST service can then handle the notifications from the incoming POST message in any way that is desired.
- "topic" can be either "inventory" or "alarm"
- There can be any number of subscriptions to the same type of notification.
A sample client can be downloaded here.
Run the Connectionless Notification Client
Before you begin, be sure you know:
- The IP address of the host machine where client is going to run.
- The port number of the http client where you want to receive the notification. The default port is 7080.
- Any filters you want to apply to the subscribed notifications. The sample payload below includes a sample filter.
Run the command:
java -jar nbi-notifications-connection-less-client.jar <HostMachineIPAddress> <PortNumber>
, where<HostMachineIPAddress>
is the IP address of the host machine where client is going to run, and<PortNumber>
is the number of the port being used to receive notification.For example, in the command
java -jar nbi-notifications-connection-less-client.jar 10.155.124.44 7080
, 10.155.124.44 is the IP address of the client host machine and 7080 is the port on which http client receive notification.Using Postman or a similar client, POST the following payload to
https://<server_ip>:30603/crosswork/notification/restconf/data/v2/notifications:subscription
:
{
"ietf-restconf:notification.topic":"alarm",
"ietf-restconf:notification.format": "xml",
"ietf-restconf:notification.client-url":"<HOST_MACHINE_IP_ADDRESS>:<CLIENT_PORT>/notifications"
}
If you want to include a filter, use a payload like this one instead:
{
"ietf-restconf:notification.topic":"alarm",
"ietf-restconf:notification.format": "json",
"ietf-restconf:notification.client-url":"http://172.20.127.117:7080/notifications",
"ietf-restconf:notification.filters": [
{
"ietf-restconf:notification.key": "productType",
"ietf-restconf:notification.value": "Cisco ASR 4000,Cisco 9800"
},
{
"ietf-restconf:notification.key": "productFamily",
"ietf-restconf:notification.value": "Routers,Switch"
},
{
"ietf-restconf:notification.key": "severity",
"ietf-restconf:notification.value": "major"
},
{
"ietf-restconf:notification.key": "deviceUUId",
"ietf-restconf:notification.value": "ae61b292-ab6f-4b09-8e3e-46affbf61709"
}
]
}
{
"ietf-restconf:notification.topic":"inventory",
"ietf-restconf:notification.format": "json",
"ietf-restconf:notification.client-url":"http://172.20.127.117:7080/notifications",
"ietf-restconf:notification.filters": [
{
"ietf-restconf:notification.key": "productType",
"ietf-restconf:notification.value": "Cisco ASR 4000,Cisco 9800"
},
{
"ietf-restconf:notification.key": "productFamily",
"ietf-restconf:notification.value": "Routers,Switch"
}
]
}
- If the subscription is successful, the client will record the notifications in a log file named “restconf-notifications” in the same directory where the JAR file is stored and prints it to the same CMD/terminal window they made the initial JAR call.