"Fossies" - the Fresh Open Source Software Archive

Member "masakari-9.0.0/api-ref/source/notifications.inc" (13 May 2020, 5425 Bytes) of package /linux/misc/openstack/masakari-9.0.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) fasm source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. For more information about "notifications.inc" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 8.0.0_vs_9.0.0.

    1 .. -*- rst -*-
    2 
    3 ==============================
    4  Notifications (notifications)
    5 ==============================
    6 
    7 **Notifications**
    8 
    9 A notification is a kind of alert provided by monitoring services
   10 (masakari-monitors) for failure of either host, process or instance.
   11 
   12 Lists, creates and shows details for notifications.
   13 
   14 List Notifications
   15 ==================
   16 
   17 .. rest_method:: GET /notifications
   18 
   19 Lists IDs, notification types, host_name, generated_time, payload and status
   20 for all notifications.
   21 
   22 Notifications contain a `status` attribute that indicates the current
   23 notification state. You can filter on the notification `status` when you
   24 complete a list notifications request. The notification `status` is returned
   25 in the response body. The possible notification `status` values are:
   26 
   27 - ``NEW``. The notification is in new state and yet to be processed.
   28 - ``RUNNING``. The notification is in progress.
   29 - ``FINISHED``. The notification is completed successfully.
   30 - ``ERROR``. The notification is ended up in error.
   31 - ``FAILED``. The notification is not processed successfully after failed once.
   32 - ``IGNORED``. The notification is ignored by masakari engine.
   33 
   34 You can also filter on the basis of `source_host_uuid`, `generated_since` and
   35 `type` when you complete a list notifications request.
   36 
   37 Response Codes
   38 --------------
   39 
   40 .. rest_status_code:: success status.yaml
   41 
   42    - 200
   43 
   44 .. rest_status_code:: error status.yaml
   45 
   46    - 400
   47    - 401
   48    - 403
   49    - 404
   50 
   51 Request
   52 -------
   53 
   54 .. rest_parameters:: parameters.yaml
   55 
   56   - generated_since: generated_since_query_notifications
   57   - limit: limit
   58   - marker: marker
   59   - sort_dir: sort_dir
   60   - sort_key: sort_key_notification
   61   - source_host_uuid: source_host_uuid_query_notifications
   62   - type: type_query_notifications
   63 
   64 Response
   65 --------
   66 
   67 .. rest_parameters:: parameters.yaml
   68 
   69   - notifications: notifications
   70   - notification_uuid: notification_uuid
   71   - deleted: deleted
   72   - created_at: created
   73   - updated_at: updated
   74   - status: notification_status
   75   - uuid: notification_uuid
   76   - source_host_uuid: source_host_uuid
   77   - generated_time: generated_time
   78   - type: notification_type
   79   - payload: notification_payload
   80   - id: notification_id
   81 
   82 
   83 **Example List Notifications**
   84 
   85 .. literalinclude:: ../../doc/api_samples/notifications/notifcations-list-resp.json
   86    :language: javascript
   87 
   88 
   89 Create Notification
   90 ===================
   91 
   92 .. rest_method:: POST /notifications
   93 
   94 Creates a notification.
   95 
   96 Response Codes
   97 --------------
   98 
   99 .. rest_status_code:: success status.yaml
  100 
  101    - 202
  102 
  103 .. rest_status_code:: error status.yaml
  104 
  105    - 400
  106    - 401
  107    - 403
  108    - 409
  109 
  110 ..
  111 
  112   A conflict(409) is returned if notification with same payload is exists or
  113   host for which notification is generated is under maintenance.
  114 
  115   BadRequest (400) is returned if notification payload is incorrect.
  116 
  117 Request
  118 -------
  119 
  120 .. rest_parameters:: parameters.yaml
  121 
  122   - notification: notification
  123   - type: notification_type
  124   - generated_time: generated_time
  125   - payload: notification_payload
  126   - host_name: notification_host_name
  127 
  128 **Example create Process failure notification**
  129 
  130 .. literalinclude:: ../../doc/api_samples/notifications/process-notification-create-req.json
  131    :language: javascript
  132 
  133 **Example create VM failure notification**
  134 
  135 .. literalinclude:: ../../doc/api_samples/notifications/vm-notification-create-req.json
  136    :language: javascript
  137 
  138 **Example create COMPUTE_HOST failure notification**
  139 
  140 .. literalinclude:: ../../doc/api_samples/notifications/host-notification-create-req.json
  141    :language: javascript
  142 
  143 Response
  144 --------
  145 
  146 .. rest_parameters:: parameters.yaml
  147 
  148   - notification: notification
  149   - type: notification_type
  150   - generated_time: generated_time
  151   - payload: notification_payload
  152   - source_host_uuid: source_host_uuid
  153   - uuid: notification_uuid
  154   - deleted: deleted
  155   - created_at: created
  156   - status: notification_status
  157   - updated_at: updated
  158   - id: notification_id
  159 
  160 **Example create Process failure notification**
  161 
  162 .. literalinclude:: ../../doc/api_samples/notifications/process-notification-create-resp.json
  163    :language: javascript
  164 
  165 **Example create VM failure notification**
  166 
  167 .. literalinclude:: ../../doc/api_samples/notifications/vm-notification-create-resp.json
  168    :language: javascript
  169 
  170 **Example create COMPUTE_HOST failure notification**
  171 
  172 .. literalinclude:: ../../doc/api_samples/notifications/host-notification-create-resp.json
  173    :language: javascript
  174 
  175 
  176 Show Notification Details
  177 =========================
  178 
  179 .. rest_method:: GET /notifications/{notification_id}
  180 
  181 Shows details for a notification.
  182 
  183 **Preconditions**
  184 
  185 The notification must exist.
  186 
  187 Response Codes
  188 --------------
  189 
  190 .. rest_status_code:: success status.yaml
  191 
  192    - 200
  193 
  194 .. rest_status_code:: error status.yaml
  195 
  196    - 401
  197    - 403
  198    - 404
  199 
  200 Request
  201 -------
  202 
  203 .. rest_parameters:: parameters.yaml
  204 
  205   - notification_id: notification_id_path
  206 
  207 Response
  208 --------
  209 
  210 .. rest_parameters:: parameters.yaml
  211 
  212   - notification: notification
  213   - type: notification_type
  214   - generated_time: generated_time
  215   - payload: notification_payload
  216   - source_host_uuid: source_host_uuid
  217   - uuid: notification_uuid
  218   - deleted: deleted
  219   - created_at: created
  220   - status: notification_status
  221   - updated_at: updated
  222   - recovery_workflow_details: recovery_workflow_details
  223   - id: notification_id
  224 
  225 **Example Show Notification Details**
  226 
  227 .. literalinclude:: ../../doc/api_samples/notifications/notification-get-resp.json
  228    :language: javascript