diff --git a/src/mocks/fixtures/ccce-api.json b/src/mocks/fixtures/ccce-api.json index 80b60d5b5e2af9a100813dc8d365b14d8b84bd5f..2580b721c51c35382caca4bfd6ab42fd2698b296 100644 --- a/src/mocks/fixtures/ccce-api.json +++ b/src/mocks/fixtures/ccce-api.json @@ -41,9 +41,6 @@ }, { "name": "Git" - }, - { - "name": "Monitoring" } ], "paths": { @@ -479,7 +476,7 @@ } }, "400": { - "description": "Incomplete request", + "description": "Incomplete, or bad request", "content": { "application/json": { "schema": { @@ -1509,6 +1506,81 @@ } } }, + "/api/v1/{host_name}/log": { + "get": { + "tags": ["Hosts"], + "summary": "Fetches syslog lines for a specific host", + "operationId": "fetchSyslogLines", + "parameters": [ + { + "name": "host_name", + "in": "path", + "description": "Host name (without network part)", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "time_range", + "in": "query", + "description": "Time range (in minutes)", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Log lines", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LokiResponse" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "500": { + "description": "Service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "503": { + "description": "Logging server unavailable", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + } + }, + "security": [ + { + "bearerAuth": [] + } + ] + } + }, "/api/v1/statistics/general/{statistics_type}": { "get": { "tags": ["Statistics"], @@ -1958,29 +2030,20 @@ } } }, - "/api/v1/monitoring/syslog/host/{host_name}": { + "/api/v1/iocs/{ioc_id}/status": { "get": { - "tags": ["Monitoring"], - "summary": "Fetches syslog lines for a specific host", - "operationId": "fetchSyslogLines", + "tags": ["IOCs"], + "summary": "Fetches the Prometheus status of the IOC", + "operationId": "fetchIocStatus", "parameters": [ { - "name": "host_name", + "name": "ioc_id", "in": "path", - "description": "Host name (without network part)", + "description": "Unique ID of the IOC", "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "time_range", - "in": "query", - "description": "Time range (in minutes)", - "required": false, "schema": { "type": "integer", - "format": "int32" + "format": "int64" } } ], @@ -1990,7 +2053,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LokiResponse" + "$ref": "#/components/schemas/IocStatusResponse" } } } @@ -2005,8 +2068,8 @@ } } }, - "500": { - "description": "Service exception", + "404": { + "description": "Ioc not found", "content": { "application/json": { "schema": { @@ -2015,8 +2078,8 @@ } } }, - "503": { - "description": "Logging server unavailable", + "500": { + "description": "Service exception", "content": { "application/json": { "schema": { @@ -2025,24 +2088,19 @@ } } } - }, - "security": [ - { - "bearerAuth": [] - } - ] + } } }, - "/api/v1/monitoring/status/{ioc_id}": { + "/api/v1/iocs/{ioc_id}/description": { "get": { - "tags": ["Monitoring"], - "summary": "Fetches the Prometheus status of the IOC", - "operationId": "fetchIocStatus", + "tags": ["IOCs"], + "summary": "Find IOC description by ID", + "operationId": "getIocDescription", "parameters": [ { "name": "ioc_id", "in": "path", - "description": "Unique ID of the IOC", + "description": "Unique ID of IOC", "required": true, "schema": { "type": "integer", @@ -2052,21 +2110,11 @@ ], "responses": { "200": { - "description": "Log lines", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/IocStatusResponse" - } - } - } - }, - "401": { - "description": "Unauthorized", + "description": "Found IOC description", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GeneralException" + "$ref": "#/components/schemas/IocDescriptionResponse" } } } @@ -2094,9 +2142,9 @@ } } }, - "/api/v1/monitoring/procserv/host/{host_name}/{ioc_name}": { + "/api/v1/iocs/{host_name}/{ioc_name}/log": { "get": { - "tags": ["Monitoring"], + "tags": ["IOCs"], "summary": "Fetches procServ Log lines for a specific host", "operationId": "fetchProcServLogLines", "parameters": [ @@ -2178,57 +2226,6 @@ ] } }, - "/api/v1/iocs/{ioc_id}/description": { - "get": { - "tags": ["IOCs"], - "summary": "Find IOC description by ID", - "operationId": "getIocDescription", - "parameters": [ - { - "name": "ioc_id", - "in": "path", - "description": "Unique ID of IOC", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "Found IOC description", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/IocDescriptionResponse" - } - } - } - }, - "404": { - "description": "Ioc not found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - } - } - } - }, "/api/v1/iocs/check_git_repo_id/{repo_id}": { "get": { "tags": ["IOCs"], @@ -3926,6 +3923,9 @@ "gitProjectId": { "type": "integer", "format": "int64" + }, + "repository_name": { + "type": "string" } }, "description": "IOC to create" @@ -4077,6 +4077,32 @@ } } }, + "LokiMessage": { + "type": "object", + "properties": { + "logDate": { + "type": "string", + "format": "date-time" + }, + "logMessage": { + "type": "string" + } + } + }, + "LokiResponse": { + "type": "object", + "properties": { + "lines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LokiMessage" + } + }, + "warning": { + "type": "string" + } + } + }, "StatisticResponse": { "type": "object", "properties": { @@ -4281,54 +4307,6 @@ } } }, - "LokiMessage": { - "type": "object", - "properties": { - "logDate": { - "type": "string", - "format": "date-time" - }, - "logMessage": { - "type": "string" - } - } - }, - "LokiResponse": { - "type": "object", - "properties": { - "lines": { - "type": "array", - "items": { - "$ref": "#/components/schemas/LokiMessage" - } - }, - "warning": { - "type": "string" - } - } - }, - "IocStatusResponse": { - "type": "object", - "properties": { - "iocId": { - "type": "integer", - "format": "int64" - }, - "alertSeverity": { - "type": "string", - "enum": ["ERROR", "WARNING", "INFO"] - }, - "alerts": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Alert" - } - }, - "active": { - "type": "boolean" - } - } - }, "ActiveDeployment": { "type": "object", "properties": { @@ -4441,6 +4419,28 @@ } } }, + "IocStatusResponse": { + "type": "object", + "properties": { + "iocId": { + "type": "integer", + "format": "int64" + }, + "alertSeverity": { + "type": "string", + "enum": ["ERROR", "WARNING", "INFO"] + }, + "alerts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Alert" + } + }, + "active": { + "type": "boolean" + } + } + }, "IocDescriptionResponse": { "type": "object", "properties": {