{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"paths":{"/v1/events/anomalies/{rule_instance_uuid}/dataset":{"get":{"summary":"Get","operationId":"get_v1_events_anomalies__rule_instance_uuid__dataset_get","parameters":[{"name":"rule_instance_uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"starting_at","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"ending_at","in":"query","required":false,"schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Aggregation"},"title":"Response Get V1 Events Anomalies  Rule Instance Uuid  Dataset Get"}}}},"404":{"description":"Rule not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/events/stats":{"post":{"summary":"Stats","operationId":"stats_v1_events_stats_post","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AggregationQuery"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/events/topk":{"post":{"summary":"Topk","operationId":"topk_v1_events_topk_post","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AggregationTopKQuery"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TopKResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/events/kpi":{"post":{"summary":"Kpi","operationId":"kpi_v1_events_kpi_post","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AggregationQuery"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Aggregation":{"properties":{"datetime":{"type":"string"},"value":{"type":"number"},"anomaly":{"$ref":"#/components/schemas/Anomaly"},"prediction":{"$ref":"#/components/schemas/Prediction"}},"type":"object","required":["datetime"],"title":"Aggregation"},"AggregationOperator":{"type":"string","enum":["avg","cardinality","max","min","sum","count"],"title":"AggregationOperator"},"AggregationQuery":{"properties":{"aggregation":{"$ref":"#/components/schemas/AggregationOperator"},"field":{"type":"string"},"term":{"type":"string"},"filters":{"items":{"$ref":"#/components/schemas/ESFilter"},"type":"array"},"range":{"prefixItems":[{"type":"string","format":"date-time"},{"type":"string","format":"date-time"}],"type":"array","maxItems":2,"minItems":2},"minutes_per_bucket":{"type":"integer"},"community_uuids":{"items":{"type":"string","format":"uuid"},"type":"array","default":[]},"alerts_only":{"type":"boolean","default":false}},"type":"object","required":["aggregation","term","range","minutes_per_bucket"],"title":"AggregationQuery"},"AggregationTopKQuery":{"properties":{"field":{"type":"string"},"term":{"type":"string"},"k":{"type":"integer","exclusiveMinimum":0.0,"default":5},"filters":{"items":{"$ref":"#/components/schemas/ESFilter"},"type":"array"},"range":{"prefixItems":[{"type":"string","format":"date-time"},{"type":"string","format":"date-time"}],"type":"array","maxItems":2,"minItems":2},"community_uuids":{"items":{"type":"string","format":"uuid"},"type":"array","default":[]},"alerts_only":{"type":"boolean","default":false}},"type":"object","required":["field","term","range"],"title":"AggregationTopKQuery"},"Anomaly":{"properties":{"type":{"$ref":"#/components/schemas/AnomalyType"},"score":{"type":"integer"}},"type":"object","required":["type","score"],"title":"Anomaly"},"AnomalyType":{"type":"string","enum":["low","high","both"],"title":"AnomalyType"},"ESFilter":{"properties":{"field":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"},{"type":"null"}]},"operator":{"$ref":"#/components/schemas/ESFilterOperator"},"excluded":{"type":"boolean","default":false},"disabled":{"type":"boolean","default":false}},"type":"object","required":["field","operator"],"title":"ESFilter"},"ESFilterOperator":{"type":"string","enum":["=","startswith","endswith","contains",">",">=","<","<=","exists"],"title":"ESFilterOperator"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array"}},"type":"object","title":"HTTPValidationError"},"Prediction":{"properties":{"low":{"type":"number"},"high":{"type":"number"},"average":{"type":"number"},"medium_lower":{"type":"number"},"medium_upper":{"type":"number"},"high_lower":{"type":"number"},"high_upper":{"type":"number"}},"type":"object","required":["low","high","average"],"title":"Prediction"},"TopKResult":{"properties":{"others":{"type":"integer"},"topk":{"items":{"$ref":"#/components/schemas/TopKResultItem"},"type":"array"}},"type":"object","required":["topk"],"title":"TopKResult"},"TopKResultItem":{"properties":{"key":{"type":"string"},"count":{"type":"integer"}},"type":"object","required":["key","count"],"title":"TopKResultItem"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array"},"msg":{"type":"string"},"type":{"type":"string"},"input":{},"ctx":{"type":"object"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"servers":[{"url":"https://api.sekoia.io","description":"Sekoia.io API"}]}