{"swagger":"2.0","info":{"description":"The API used to report and manage alerts.","version":"8.0.0","title":"Alert Management API"},"host":"0.0.0.0","basePath":"/rest","schemes":["http","https"],"paths":{"/alerts/{id}/workflow":{"put":{"summary":"Perform Workflow Action","operationId":"PUT /alerts/{id}/workflow","consumes":["application/json","application/xml","text/xml"],"parameters":[{"name":"id","in":"path","description":"ID of the alert to perform the action on.","required":true},{"in":"body","name":"body","description":"The action to perform.","required":true}],"responses":{"default":{"description":" "}}}},"/alerts/{id}":{"delete":{"summary":"Delete Alert","operationId":"DELETE /alerts/{id}","parameters":[{"name":"id","in":"path","description":"ID of the alert to delete.","required":true}],"responses":{"default":{"description":" "}}}},"/alerts":{"get":{"summary":"Get Alerts","description":"<p>Retrieves the alerts meeting the given criteria. The following usage example illustrates a query for all UNOBSERVED alerts reported against service with the\nkey uddi:f996a248-f061-11e4-924f-f8246128b60a with a severity of MAJOR or CRITICAL that were generated between 2015-05-01T16:21:17 and now. It also illustrates\npaging by asking for records starting from position 50 and to only return 50 records.</p>\n<h4>Request:</h4>\n<pre><code>GET /rest/alerts?state=UNOBSERVED&amp;source=uddi:f996a248-f061-11e4-924f-f8246128b60a&amp;severity=1&amp;severity=2&amp;from=2015-05-01T16:21:17&amp;start=50&amp;count=50 HTTP/1.1\n</code></pre>\n<h4>Response:</h4>\n<pre><code>HTTP/1.1 200 OK\n{\n    \"totalCount\" : \"50\",\n    \"records\" : [\n        {\n            \"id\" : \"1010\",\n            \"alertType\" : \"1\",\n            \"alertCode\" : \"1000000\",\n            \"alertCodeInfo\" : {\n                \"severity\" : \"2\",\n                \"description\" : \"Policy enforcement failure\",\n                \"componentName\" : \"Policy Handler Framework\",\n                \"subsystemName\" : \"General\",\n                \"sendEmailEnabled\" : \"true\",\n                \"snmpTrapEnabled\" : \"false\"\n            }\n            \"description\" : \"Problem executing custom policy.\",\n            \"generatedAt\" : \"2015-05-01T16:21:18\"\n            \"source\" : {\n                \"sourceType\" : \"1\",\n                \"source\" : \"uddi:f996a248-f061-11e4-924f-f8246128b60a\",\n                \"sourceName\" : \"General\\\n            }\n            \"transaction\" : {\n                \"OperationInvocation\" : {\n                    \"operationName\" : \"op1\",\n                    \"operationKey\" : \"uddi:f996a248-f061-11e4-924f-f8246128b61b\",\n                    \"serviceName\" : \"Service1\",\n                    \"serviceKey\"uddi:f996a248-f061-11e4-924f-f8246128b60a\",\n                    \"contractName\" : \"Anonymous Access\",\n                    \"contractKey\" : \"uddi:f996a248-f061-11e4-924f-f8246128b53c\",\n                    \"organizationKey\" : \"uddi:f996a248-f061-11e4-924f-f8246127d45a\n                }\n           }\n           \"workflow\" : {\n               \"state\" : \"UNOBSERVED\n               \"receivedAt\" : \"2015-05-01T16:21:18\",\n           }\n           \"alertDispatchStatus\" : {\n               \"dispatched\" : \"false\"\n           }\n       },\n       ... not shown for brevity ...\n    ],  \n    \"listIncomplete\" : \"true\"\n}\n</code></pre>\n<p>The <em>listIncomplete</em> field in the response indicates there are more records beyond the 50 that match the given criteria.</p>","operationId":"GET /alerts","produces":["application/json","application/xml","text/xml"],"parameters":[{"name":"code","in":"query","description":"Alert code to filter on.","required":false},{"name":"source","in":"query","description":"Source of the alerts to filter on.","required":false},{"name":"org","in":"query","description":"Organization key to filter on.","required":false},{"name":"from","in":"query","description":"Date at which only alerts generated after will be returned. ISO-8601 format","required":false},{"name":"to","in":"query","description":"Date at which only alerts generated before will be returned. ISO-8601 format","required":false},{"name":"severity","in":"query","description":"Severities of the alerts to filter on.","required":false},{"name":"state","in":"query","description":"States of the alerts to filter on.","required":false},{"name":"actor","in":"query","description":"Indicates only alerts that the user with the given username performed a workflow action on should be returned.","required":false},{"name":"start","in":"query","description":"To page the results this integer indicates the first alert from the full result set to return as the first item of the page.","required":false},{"name":"count","in":"query","description":"To page the results this integer indicates the number of items thatshould be returned in the page.","required":false}],"responses":{"default":{"description":" "}}},"post":{"summary":"Add Alert","description":"<p>Adds/reports an alert. An alert is defined by its type, a code, and a source. The alert's type is a numeric value, 0 is for a basic alert, 1 is\nfor a service alert, and 3 is for an SLA alert. The alert code identifies a particular event or condition that has been detected. The source of\nthe alert is the entity the alert is about. There are several types of alert sources which are identified with a numeric value.</p>\n<ul>\n<li>unknown</li>\n<li>service</li>\n<li>operation</li>\n<li>contract</li>\n<li>organization</li>\n<li>endpoint</li>\n<li>container</li>\n</ul>\n<p>Each type of source may have a different type of identifier or key used in the <em>source</em> property. The\n<em>sourceName</em> property provides a functional area that can be used to group or categorize the alerts. An\nalert may also be tied to a transaction, or action performed in the system. The most common transaction\nto be associated with alerts is an operation invocation.</p>\n<p>The following example illustrates adding a service alert:</p>\n<h4>Request:</h4>\n<pre><code>POST /rest/alerts HTTP/1.1\nContent-Type: application/json\n\n{\n    \"alertType\" : \"1\",\n    \"alertCode\" : \"1000000\",\n    \"description\" : \"Problem executing custom policy.\",\n    \"generatedAt\" : \"2015-05-01T16:21:18\",\n    \"source\" : {\n        \"sourceType\" : \"1\",\n        \"source\" : \"uddi:f996a248-f061-11e4-924f-f8246128b60a\",\n        \"sourceName\" : \"General\"\n    }\n    \"transaction\" : {\n        \"OperationInvocation\" : {\n            \"operationName\" : \"op1\",\n            \"operationKey\" : \"uddi:f996a248-f061-11e4-924f-f8246128b61b\",\n            \"serviceName\" : \"Service1\",\n            \"serviceKey\"uddi:f996a248-f061-11e4-924f-f8246128b60a\",\n            \"contractName\" : \"Anonymous Access\",\n            \"contractKey\" : \"uddi:f996a248-f061-11e4-924f-f8246128b53c\",\n            \"organizationKey\" : \"uddi:f996a248-f061-11e4-924f-f8246127d45a\n        }\n    }\n}\n</code></pre>\n<h4>Response:</h4>\n<pre><code>HTTP/1.1 200 OK\n{\n    \"id\" : \"1010\",\n    \"alertType\" : \"1\",\n    \"alertCode\" : \"1000000\",\n    \"alertCodeInfo\" : {\n        \"severity\" : \"2\",\n        \"description\" : \"Policy enforcement failure\",\n        \"componentName\" : \"Policy Handler Framework\",\n        \"subsystemName\" : \"General\",\n        \"sendEmailEnabled\" : \"true\",\n        \"snmpTrapEnabled\" : \"false\"\n    }\n    \"description\" : \"Problem executing custom policy.\",\n    \"generatedAt\" : \"2015-05-01T16:21:18\"\n    \"source\" : {\n        \"sourceType\" : \"1\",\n        \"source\" : \"uddi:f996a248-f061-11e4-924f-f8246128b60a\",\n        \"sourceName\" : \"General\\\n    }\n    \"transaction\" : {\n        \"OperationInvocation\" : {\n            \"operationName\" : \"op1\",\n            \"operationKey\" : \"uddi:f996a248-f061-11e4-924f-f8246128b61b\",\n            \"serviceName\" : \"Service1\",\n            \"serviceKey\"uddi:f996a248-f061-11e4-924f-f8246128b60a\",\n            \"contractName\" : \"Anonymous Access\",\n            \"contractKey\" : \"uddi:f996a248-f061-11e4-924f-f8246128b53c\",\n            \"organizationKey\" : \"uddi:f996a248-f061-11e4-924f-f8246127d45a\n        }\n    }\n    \"workflow\" : {\n      \"state\" : \"UNOBSERVED\n      \"receivedAt\" : \"2015-05-01T16:21:18\",\n    }\n    \"alertDispatchStatus\" : {\n        \"dispatched\" : \"false\"\n    }\n}\n</code></pre>\n<p>Note the <em>id</em> property is not provided in the request but is provided in the response message. The <em>id</em> can then be used when performing workflow actions.\nAdditional information about the alert derived from the alert code specified is added by the system. Of note the severity of the alert is\ndictated by the alert code. The severity is a numeric value and may be one of the following:</p>\n<ul>\n<li>CRITICAL</li>\n<li>MAJOR</li>\n<li>MINOR</li>\n<li>NORMAL</li>\n<li>CLEAR</li>\n</ul>\n<p>The workflow is also auto-generated and provided in the response where it indicates the initial state and when the system received the record. And finally\na dispatch status may be added if the alert code requires any sort of dispatch.</p>","operationId":"POST /alerts","consumes":["application/json","application/xml","text/xml"],"produces":["application/json","application/xml","text/xml"],"parameters":[{"in":"body","name":"body","description":"The alert to add.","required":true}],"responses":{"default":{"description":" "}}}},"/alerts/{id}/comments":{"post":{"summary":"Add Comment","operationId":"POST /alerts/{id}/comments","consumes":["application/json","application/xml","text/xml"],"produces":["application/json","application/xml","text/xml"],"parameters":[{"name":"id","in":"path","description":"ID of the alert to comment on.","required":true},{"in":"body","name":"body","description":"Comment being made. Includes the text of the commentas well as the user who made the comment and when it was made.","required":true}],"responses":{"default":{"description":" "}}}},"/alertcodes/{code}":{"get":{"summary":"Get Alert Code Details","operationId":"GET /alertcodes/{code}","produces":["application/json","application/xml","text/xml"],"parameters":[{"name":"code","in":"path","description":"Alert code.","required":true}],"responses":{"default":{"description":" "}}}}}}