cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements

Community Helping Community

939
Views
1
Helpful
4
Replies
Highlighted
Beginner

CMX Notification Subscription Conditions documentation?

Hello,

I'm currently trying out the Notification Subscription to track LocationUpdate events:

https://msesandbox.cisco.com:8081/apidocs/configuration-api#Notification-subscription-API-GET-Get-all-notificaiton-subsc…

It seems like the subscription object should look like this:

{
       
"name": "test-cisco",
       
"userId": "learning",
       
"rules": [
           
{
               
"conditions": []
           
}
       
],
       
"subscribers": [
           
{
               
"receivers": [
                   
{
                       
"uri": "http://52.30.255.249:18080/cloud4wi-presence/rest/cisco/locationUpdate",
                       
"messageFormat": "JSON",
                       
"qos": "AT_MOST_ONCE"
                   
}
               
]
           
}
       
],
       
"enabled": true,
       
"enableMacScrambling": false,
       
"notificationType": "LocationUpdate"
   
}

Does anyone know if it is documented exactly what conditions you can set?

Thanks & Regards,

Henrik

Everyone's tags (4)
4 REPLIES 4
Frequent Contributor

Re: CMX Notification Subscription Conditions documentation?

Henrik,

The CMX API document is the https://<MSE IPADDR>/apidocs, and is updated with each release.  10.2.2 should be available soon in an early deployment release, and would expect the API docs to be improved.  Currently, I agree that the documents are not satisfactory.  I will keep pushing for better source of API information and will update this post, and you, when something is available.  If you are stuck on a particular issue, please open a discussion and I'll see it gets escalated.

Thanks,

Matt

Beginner

Re: CMX Notification Subscription Conditions documentation?

Hello - The latest MSE CMX 10.2 API docs have no detailed descriptions on rules and conditions? This question was never answered.

The "Try It" for https://msesandbox.cisco.com:8081/apidocs/configuration-api#Notification-subscription-API-PUT-Add-notification-subscript…  is incomplete as well. I'm finding it hard to test/experiment with the product with such a poor level of documentation. It's not like this is v1.0 - and even so, Cisco should and can do better in this regard. Is there a link to some other info somewhere that would help, other than searching through the forum for previous questions/answers.

Frequent Contributor

Re: CMX Notification Subscription Conditions documentation?

Jeffrey,

I agree, the CMX engineering team is aware of the issue.  I will open a CDETS ticket against the documentation again, and will follow up once the ticket is verified. 

The latest CMX 10.2 REST API Guide is available from the following links:

CMX 10.2 API Reference

https://developer.cisco.com/site/cmx-mobility-services/documents/cmx-10.2-api-reference/index.gsp

CMX REST API Getting Started Guide

https://developer.cisco.com/site/cmx-mobility-services/documents/cmx-rest-api-getting-started-guide/index.gsp

Thanks,

Matt

Frequent Contributor

Re: CMX Notification Subscription Conditions documentation?

Hi,

Here's a way to determine the REST API body for CMX notification subscriptions.  Create the Notification in the CMX graphical user interface, https://msesandbox.cisco.com:8081with learning/learning, then use the CMX REST API GET notifications by name to see how the body was formatted.

In the GUI under Manage click on Notifications, provide the details for the Notification and Save:

Untitled.tiff

This REST API returns the notification you just created by name:

GET https://msesandbox.cisco.com:8081/api/config/v1/notifications/learning_movement

}

  "name": "learning_movement",

  "userId": "learning",

  "rules": [

    {

      "conditions": [

        {

          "condition": "movement.distance > 50"

        },

        {

          "condition": "movement.hierarchy == DevNetCampus>DevNetBuilding>DevNetZone"

        },

        {

          "condition": "movement.macAddressList == 00:00:2a:01:00:1f;"

        },

        {

          "condition": "movement.deviceType == client"

        }

      ]

    }

  ],

  "subscribers": [

    {

      "receivers": [

        {

          "uri": "http://requestb.in:80/y0l3gty0",

          "messageFormat": "JSON",

          "qos": "AT_MOST_ONCE"

        }

      ]

    }

  ],

  "enabled": true,

  "enableMacScrambling": true,

  "notificationType": "Movement"

}

Finally, delete the original notification:

DELETE https://msesandbox.cisco.com:8081/api/config/v1/notifications/learning_movement

and then re-create the REST API notification subscription with the body above:

PUT https://msesandbox.cisco.com:8081/api/config/v1/notification

The name may have a length requirement, the GUI https://msesandbox.cisco.com:8081/manage/#notifications

only allows twenty characters.  Also, be careful of naming convention, using no spaces or special characters, to be safe.

Matt

CreatePlease to create content
Content for Community-Ad
FusionCharts will render here
This widget could not be displayed.