Alerts

Alerts

List alerts

Sample request 

List all alerts:

GET /sdn/v2.0/alerts

There is no request body for this API.

Sample response 

{
    "alerts": [
        {
            "desc": "NEW_LEADER, ID: Id[value=c8f698b9-bfce-4c17-9e9c-3180033b1ad7]", 
            "org": "TeamingManager", 
            "sev": "INFO", 
            "state": true, 
            "system_uid": "669aa151-2790-4cb0-9656-75e9651893ee", 
            "topic": "teaming", 
            "ts": "2013-10-16T21:14:29.704Z", 
            "uid": "2237dab8-c5e0-4a43-83ba-60b318741450"
        }, 
        {
            "desc": "BECOME_MEMBER, ID: Id[value=669aa151-2790-4cb0-9656-75e9651893ee]", 
            "org": "TeamingManager", 
            "sev": "INFO", 
            "state": true, 
            "system_uid": "669aa151-2790-4cb0-9656-75e9651893ee", 
            "topic": "teaming", 
            "ts": "2013-10-16T21:14:29.717Z", 
            "uid": "d5704bb5-3415-484c-94d3-d57d1d334b2a"
        }
     ]
} 

Response codes 

  • Normal: OK (200)

  • Error: Unauthorized (401), Not Found (404), Service Unavailable (503)

Alerts/topics

List alert topics

Sample request 

List all alert topics:

GET /sdn/v2.0/alerts/topics

List all alert topics filtered by the given origin:

GET /sdn/v2.0/alerts/topics?org="sentinel"

There is no request body for this API.

Sample response 

{
    "alert_topics": [
        {
            "desc": "Alerts associated with license compliance", 
            "org": "compliance-manager", 
            "topic": "licensing"
        }, 
        {
            "desc": "Alerts from the Controller", 
            "org": "OF-Controller", 
            "topic": "of_controller"
        }, 
        {
            "desc": "Alerts associated with links", 
            "org": "OF-Controller", 
            "topic": "of_controller_link"
        }, 
        {
            "desc": "Alerts associated with path diagnostic", 
            "org": "OF-Controller", 
            "topic": "of_controller_pathdiag"
        }, 
        {
            "desc": "Alerts associated with controller teaming", 
            "org": "Controller-teaming", 
            "topic": "teaming"
        }
    ]
} 

Response codes 

  • Normal: OK (200)

  • Error: Unauthorized (401), Not Found (404), Service Unavailable (503)

Alerts/listeners

List alert listeners

Sample request 

List all alert listeners:

GET /sdn/v2.0/alerts/listeners

There is no request body for this API.

Sample response 

{
   "alert_topic_listeners":[
      {
         "uid":"cb0f4bf2-a8f5-4b06-8937-abfc79d33423",
         "app_id":"imc",
         "name":"IMC OpenFLow Listener",
         "callbacks":[
            {
               "topics":[
                  "of_controller",
                  "of_controller_link"
               ],
               "uri":"http://imc.h3c.com/sdn"
            }
         ]
      }
   ]
}

Response codes 

  • Normal: OK (200)

  • Error: Unauthorized (401), Not Found (404), Service Unavailable (503)

Create an alert listener

Sample request 

Create an alert listener (including topic subscription):

POST /sdn/v2.0/alerts/listeners
{
   "alert_topic_listener":{
      "app_id":"imc",
      "name":"IMC OpenFLow Listener",
      "callbacks":[
         {
            "topics":[
               "of_controller",
               "of_controller_link"
            ],
            "uri":"http://imc.h3c.com/sdn"
         }
      ]
   }
}

Sample response 

 {
   "alert_topic_listener":{
      "uid":"cb0f4bf2-a8f5-4b06-8937-abfc79d33423",
      "app_id":"imc",
      "name":"IMC OpenFLow Listener",
      "callbacks":[
         {
            "topics":[
               "of_controller",
               "of_controller_link"
            ],
            "uri":"http://imc.h3c.com/sdn"
         }
      ]
   }
}

Location header: http://<controller>/sdn/v2.0/alerts/listeners/{listener_uid}

Response codes 

  • Normal: Created (201)

  • Error: Unauthorized (401), Not Found (404), Service Unavailable (503)

Alerts/listeners/{listener uid}

Get info on an alert listener

Sample request 

Get details on an alert listener:

GET /sdn/v2.0/alerts/listeners/{listener_uid}

There is no request body for this API.

Sample response 

 {
   "alert_topic_listener":{
      "uid":"cb0f4bf2-a8f5-4b06-8937-abfc79d33423",
      "app_id":"imc",
      "name":"IMC OpenFLow Listener",
      "callbacks":[
         {
            "topics":[
               "of_controller ",
               "of_controller_link"
            ],
            "uri":"http://imc.h3c.com/sdn"
         }
      ]
   }
}

Response codes 

  • Normal: OK (200)

  • Error: Unauthorized (401), Not Found (404), Service Unavailable (503)

Update an alert listener

Sample request 

Update an alert listener (including changing topic subscription):

PUT /sdn/v2.0/alerts/listeners/{listener_uid}
{
   "alert_topic_listener":{
      "uid":"cb0f4bf2-a8f5-4b06-8937-abfc79d33423",
      "app_id":"imc",
      "name":"IMC OpenFLow Listener",
      "callbacks":[
         {
            "topics":[
               "of_controller ",
               "of_controller_link"
            ],
            "uri":"http://imc.h3c.com/sdn"
         }
      ]
   }
}

Sample response 

{
   "alert_topic_listener":{
      "uid":"cb0f4bf2-a8f5-4b06-8937-abfc79d33423",
      "app_id":"imc",
      "name":"IMC OpenFLow Listener",
      "callbacks":[
         {
            "topics":[
               "of_controller",
               "of_controller_link"
            ],
            "uri":"http://imc.h3c.com/sdn"
         }
      ]
   }
}

Response codes 

  • Normal: OK (200)

  • Error: Unauthorized (401), Not Found (404), Service Unavailable (503)

Delete an alert listener

Sample request 

Delete an alert listener:

DELETE /sdn/v2.0/alerts/listeners/{listener_uid}

There is no request body for this API.

Sample response 

There is no response data for this API.

Response codes 

  • Normal: No Content (204)

  • Error: Unauthorized (401), Not Found (404), Service Unavailable (503)