.. _notification_format:

Notification Format
-------------------

The Northbound Notifications are sent to a destination as HTTP or HTTPS
POST requests. The message body is a JSON map that contains the
notification data. The JSON map is in this format:

+---------------+----------+---------------+
| Key           | Datatype | Operation     |
+===============+==========+===============+
| model_type    | String   | All           |
+---------------+----------+---------------+
| operation     | String   | All           |
+---------------+----------+---------------+
| pkid          | String   | All           |
+---------------+----------+---------------+
| hierarchy     | String   | All           |
+---------------+----------+---------------+
| new_data      | Map      | Create/Update |
+---------------+----------+---------------+
| previous_data | Map      | Update/Delete |
+---------------+----------+---------------+

The keys in the new_data and old_data maps are the attribute names for the
given model type.

Example
.......

See this example of a notification's message body triggered by updating a
user:


::

  {
     'model_type': 'data/NormalizedUser',
     'operation': 'update',
     'pkid': '5445310900698a11d83164e3',
     'hierarchy': '543c57ea00698a11d8305815',
     'new_data': {
        'username': 'jdoe',
        'mail': ['jdoe@provider.com'],
        'givenName': ['Jane'],
        'sn': ['Doe'],
        'l': ['RTP']
     },
     'previous_data': {
        'username': 'jdoe',
        'mail': ['jdoe@provider.com'],
        'givenName': ['Jane'],
        'sn': ['Doe'],
        'l': ['New York']
     }
  }