{ "info": { "title": "Eyer swagger", "version": "1.0.0" }, "components": { "responses": { "UnauthorizedError": { "description": "Authentication information is missing or invalid" } }, "parameters": { "from-required": { "name": "from", "in": "query", "required": true, "description": "", "schema": { "type": "string", "format": "date-time" } }, "to-required": { "name": "to", "in": "query", "required": true, "description": "", "schema": { "type": "string", "format": "date-time" } }, "to-optional": { "name": "to", "in": "query", "required": false, "description": "", "schema": { "type": "string", "format": "date-time" } }, "with-metrics": { "name": "with-metrics", "in": "query", "required": false, "description": "Defines if alerts should contain corridors and stats", "schema": { "type": "boolean" } } }, "schemas": { "event_type": { "type": "string", "enum": [ "created", "updated", "ended" ] }, "event_occured": { "type": "string", "format": "date-time" }, "severity": { "type": "string", "description": "Anomaly severity", "enum": [ "low", "medium", "severe" ] }, "anomaly": { "type": "object", "description": "Group of anomalies on a single node", "properties": { "severity": { "$ref": "#/components/schemas/severity" }, "event_occured": { "$ref": "#/components/schemas/event_occured" }, "event_type": { "$ref": "#/components/schemas/event_type" }, "id": { "type": "string", "format": "uuid", "description": "Anomaly ID" }, "items": { "type": "array", "description": "Individual anomalies that consistute the group", "items": { "allOf": [ { "$ref": "#/components/schemas/anomaly_item" } ] } } } }, "anomaly_item": { "type": "object", "description": "Mapping between a node and associated anomalies", "properties": { "node": { "description": "A node that anomalies are associated with", "allOf": [ { "$ref": "#/components/schemas/node" } ] }, "metrics": { "type": "array", "description": "Anomalies on individual metrics included", "items": { "allOf": [ { "$ref": "#/components/schemas/anomaly_item_metric" } ] } } } }, "anomaly_item_metric": { "type": "object", "description": "An anomaly on a single metric", "properties": { "id": { "type": "string", "description": "Unique metric id" }, "name": { "type": "string", "description": "Metric description" }, "metric_type": { "type": "string", "description": "Metric type. One of: integer, double, boolean" }, "aggregation": { "type": "string", "description": "Metric aggregation. One of: avg, max, sum" }, "severity": { "$ref": "#/components/schemas/severity" }, "started": { "type": "string", "format": "date-time", "description": "Anomaly start timestamp" }, "updated": { "type": "string", "format": "date-time", "description": "Anomaly last updated timestamp" } } }, "metered_anomalies_grouped": { "type": "object", "description": "List of anomaly groups on nodes across the system, including per-metric data", "properties": { "new": { "type": "array", "description": "Anomalies that were discovered during the time period", "items": { "allOf": [ { "$ref": "#/components/schemas/metered_anomaly" } ] } }, "updated": { "type": "array", "description": "Anomalies that were updated during the time period. Note that if anomaly is existing, but was not updated, it won't be returned.", "items": { "allOf": [ { "$ref": "#/components/schemas/metered_anomaly" } ] } }, "closed": { "type": "array", "description": "Anomalies that were closed during the time period", "items": { "allOf": [ { "$ref": "#/components/schemas/metered_anomaly" } ] } } } }, "metered_anomaly": { "type": "object", "description": "Group of anomalies on a single node, including per-metric data", "properties": { "severity": { "$ref": "#/components/schemas/severity" }, "event_occured": { "$ref": "#/components/schemas/event_occured" }, "event_type": { "$ref": "#/components/schemas/event_type" }, "id": { "type": "string", "format": "uuid", "description": "Anomaly ID" }, "items": { "type": "array", "description": "Individual anomalies that consistute the group", "items": { "allOf": [ { "$ref": "#/components/schemas/metered_anomaly_item" } ] } } } }, "metered_anomaly_item": { "type": "object", "description": "Mapping between a node and associated anomalies, including per-metric data", "properties": { "node": { "description": "A node that anomalies are associated with", "allOf": [ { "$ref": "#/components/schemas/node" } ] }, "metrics": { "type": "array", "description": "Anomalies on individual metrics included", "items": { "allOf": [ { "$ref": "#/components/schemas/metered_anomaly_item_detection_data" } ] } } } }, "metered_anomaly_item_detection_data": { "type": "object", "description": "An anomaly on a single metric, including per-metric data", "properties": { "id": { "type": "string", "description": "Unique metric id" }, "name": { "type": "string", "description": "Metric description" }, "metric_type": { "type": "string", "description": "Metric type. One of: integer, double, boolean" }, "aggregation": { "type": "string", "description": "Metric aggregation. One of: avg, max, sum" }, "severity": { "type": "string", "description": "Anomaly severity", "enum": [ "low", "medium", "severe" ] }, "started": { "type": "string", "format": "date-time", "description": "Anomaly start timestamp" }, "updated": { "type": "string", "format": "date-time", "description": "Anomaly last updated timestamp" }, "data": { "type": "array", "description": "Data received by the system in the selection time range, sorted by timestamp", "items": { "allOf": [ { "$ref": "#/components/schemas/metric_detection_data" } ] } } } }, "metric_detection_data": { "type": "object", "description": "A single data point and normal behaviour range for comparison", "properties": { "timestamp": { "type": "string", "format": "date-time", "description": "Data point timestamp" }, "smoothened": { "type": "number", "description": "Smoothen view used in ML" }, "corridors": { "allOf": [ { "$ref": "#/components/schemas/metric_corridor_set" } ], "description": "Normal primary and secondary behaviour range" } } }, "metric_corridor_set": { "type": "object", "description": "Normal primary and secondary behaviour range", "properties": { "main": { "description": "Main corridor, most frequent behaviour", "allOf": [ { "$ref": "#/components/schemas/metric_corridor" } ] }, "sup": { "description": "Superior secondary corridor, frequent deviations with value higher than the main behaviour", "allOf": [ { "$ref": "#/components/schemas/metric_corridor" } ] }, "inf": { "description": "Inferior secondary corridor, frequent deviations with value lower than from the main behaviour", "allOf": [ { "$ref": "#/components/schemas/metric_corridor" } ] } } }, "metric_corridor": { "type": "object", "description": "Expected range generated by ML", "properties": { "up": { "type": "number", "description": "Upper limit" }, "down": { "type": "number", "description": "Lower limit" } } }, "node": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64", "description": "Node ID" }, "name": { "type": "string", "description": "Node name" }, "system": { "allOf": [ { "$ref": "#/components/schemas/system" } ], "description": "System that nodes belongs to" } } }, "system": { "type": "object", "description": "A group of nodes that consistutes a physical system", "properties": { "id": { "type": "integer", "format": "int64", "description": "System ID" }, "name": { "type": "string", "description": "System name" } } } } }, "openapi": "3.0.3", "paths": { "/v2/anomalies": { "get": { "parameters": [ { "$ref": "#/components/parameters/to" }, { "$ref": "#/components/parameters/from" }, { "$ref": "#/components/parameters/with-metrics" } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "array", "items": { "allOf": [ { "$ref": "#/components/schemas/metered_anomaly" } ] } } } } }, "400": { "description": "Wrong or missing parameter" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "403": { "$ref": "#/components/responses/UnauthorizedError" } } } }, "/v2/anomalies/current": { "get": { "parameters": [ { "$ref": "#/components/parameters/to-optional" } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "array", "items": { "allOf": [ { "$ref": "#/components/schemas/anomaly" } ] } } } } }, "400": { "description": "Wrong or missing parameter" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "403": { "$ref": "#/components/responses/UnauthorizedError" } } } }, "/v2/anomalies/{anomaly-id}": { "get": { "parameters": [ { "$ref": "#/components/parameters/with-metrics" }, { "name": "anomaly-id", "in": "path", "required": true, "description": "The ID of the anomaly", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "allOf": [ { "$ref": "#/components/schemas/metered_anomaly" } ] } } } }, "400": { "description": "Wrong or missing parameter" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "403": { "$ref": "#/components/responses/UnauthorizedError" } } } }, "/v2/anomalies/unread": { "get": { "parameters": [ { "$ref": "#/components/parameters/to-optional" }, { "$ref": "#/components/parameters/with-metrics" } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "allOf": [ { "$ref": "#/components/schemas/metered_anomalies_grouped" } ] } } } }, "400": { "description": "Wrong or missing parameter" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "403": { "$ref": "#/components/responses/UnauthorizedError" } } } } } }