diff --git a/src/mocks/fixtures/DeployedIOCsHistory.json b/src/mocks/fixtures/DeployedIOCsHistory.json deleted file mode 100644 index 079a154073648d241273e3d569789c07d3a8dc67..0000000000000000000000000000000000000000 --- a/src/mocks/fixtures/DeployedIOCsHistory.json +++ /dev/null @@ -1,58 +0,0 @@ -[ - { - "iocCount": 852, - "historyDate": "2022-05-11T00:00:00.000+00:00" - }, - { - "iocCount": 859, - "historyDate": "2022-05-12T00:00:00.000+00:00" - }, - { - "iocCount": 890, - "historyDate": "2022-05-13T00:00:00.000+00:00" - }, - { - "iocCount": 890, - "historyDate": "2022-05-14T00:00:00.000+00:00" - }, - { - "iocCount": 890, - "historyDate": "2022-05-15T00:00:00.000+00:00" - }, - { - "iocCount": 897, - "historyDate": "2022-05-16T00:00:00.000+00:00" - }, - { - "iocCount": 920, - "historyDate": "2022-05-17T00:00:00.000+00:00" - }, - { - "iocCount": 960, - "historyDate": "2022-05-18T00:00:00.000+00:00" - }, - { - "iocCount": 985, - "historyDate": "2022-05-19T00:00:00.000+00:00" - }, - { - "iocCount": 1039, - "historyDate": "2022-05-20T00:00:00.000+00:00" - }, - { - "iocCount": 1039, - "historyDate": "2022-05-21T00:00:00.000+00:00" - }, - { - "iocCount": 1039, - "historyDate": "2022-05-22T00:00:00.000+00:00" - }, - { - "iocCount": 1058, - "historyDate": "2022-05-23T00:00:00.000+00:00" - }, - { - "iocCount": 1059, - "historyDate": "2022-05-24T00:00:00.000+00:00" - } -] diff --git a/src/mocks/fixtures/GeneralStatisticsResponse.json b/src/mocks/fixtures/GeneralStatisticsResponse.json deleted file mode 100644 index 96d332c198b26dc2cc5f35d9341ba4fe1e788097..0000000000000000000000000000000000000000 --- a/src/mocks/fixtures/GeneralStatisticsResponse.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "numberOfActiveHosts": 300, - "numberOfCreatedIocs": 278, - "numberOfActiveIocs": 397, - "numberOfDeployments": 646, - "numberOfActiveDeployments": 260, - "numberOfHostsWithIssue": 336, - "numberOfIocHostsOnTechnicalNetwork": 243, - "numberOfIocHostsWithIocsDeployed": 102, - "networkScopesIocCount": { - "NIN": 2, - "TechnicalNetwork": 233, - "LabNetworks": 20 - } -} diff --git a/src/mocks/fixtures/ccce-api.json b/src/mocks/fixtures/ccce-api.json index 0977c107fac21e5a951d9528106cb374b3a7824a..59362e72009c19b04e162aad835eb4066353af3a 100644 --- a/src/mocks/fixtures/ccce-api.json +++ b/src/mocks/fixtures/ccce-api.json @@ -1427,45 +1427,6 @@ ] } }, - "/api/v1/statistics/general": { - "get": { - "tags": ["Statistics"], - "summary": "Set of statistics", - "operationId": "generalStatistics", - "responses": { - "200": { - "description": "Statistics about IOCs, deployments, and hosts", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralStatisticsResponse" - } - } - } - }, - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - } - } - } - }, "/api/v1/statistics/general/{statistics_type}": { "get": { "tags": ["Statistics"], @@ -1657,48 +1618,6 @@ } } }, - "/api/v1/statistics/general/deployed_ioc_history": { - "get": { - "tags": ["Statistics"], - "summary": "Deployed IOC history from DB for statistics", - "operationId": "iocDeploymentHistory", - "responses": { - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "200": { - "description": "History about deployed IOCs from DB for statistics", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ActiveIOCSForHistoryResponse" - } - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - } - } - } - }, "/api/v1/statistics/general/active_ioc_statistics": { "get": { "tags": ["Statistics"], @@ -4066,66 +3985,6 @@ } } }, - "DbStatistics": { - "type": "object", - "properties": { - "numberOfCreatedIocs": { - "type": "integer", - "format": "int64" - }, - "numberOfActiveDeployments": { - "type": "integer", - "format": "int64" - }, - "numberOfIocHostsWithIocsDeployed": { - "type": "integer", - "format": "int64" - }, - "numberOfDeployments": { - "type": "integer", - "format": "int64" - } - } - }, - "GeneralStatisticsResponse": { - "type": "object", - "properties": { - "dbStatistics": { - "$ref": "#/components/schemas/DbStatistics" - }, - "networkMonitoring": { - "$ref": "#/components/schemas/NetworkMonitoring" - }, - "networkScopesIocCount": { - "type": "object", - "additionalProperties": { - "type": "integer", - "format": "int32" - } - } - } - }, - "NetworkMonitoring": { - "type": "object", - "properties": { - "numberOfActiveIocs": { - "type": "integer", - "format": "int64" - }, - "numberOfActiveHosts": { - "type": "integer", - "format": "int64" - }, - "numberOfIocHostsOnTechnicalNetwork": { - "type": "integer", - "format": "int64" - }, - "numberOfHostsWithIssue": { - "type": "integer", - "format": "int64" - } - } - }, "StatisticResponse": { "type": "object", "properties": { @@ -4209,10 +4068,6 @@ "type": "string", "format": "date-time" }, - "numberOfDeployments": { - "type": "integer", - "format": "int64" - }, "successfulDeployments": { "type": "integer", "format": "int64" diff --git a/src/mocks/mockAPI.js b/src/mocks/mockAPI.js index 4663285f68ce9e35b40feac0492824e17551266b..ea2a13085b935d93d6cb5df70edffc09de42411a 100644 --- a/src/mocks/mockAPI.js +++ b/src/mocks/mockAPI.js @@ -230,21 +230,11 @@ function fetchIocStatus(req) { return { body, status }; } -function getStatistics(req) { - const body = require("./fixtures/GeneralStatisticsResponse.json"); - return { body }; -} - function currentlyActiveIocs(req) { const body = require("./fixtures/ActiveIocStatisticsResponse.json"); return { body }; } -function iocDeploymentHistory(req) { - const body = require("./fixtures/DeployedIOCsHistory.json"); - return { body }; -} - function activeIocHistory(req) { const body = require("./fixtures/ActiveIOCsForHistoryResponse.json"); return { body }; @@ -323,9 +313,7 @@ const mockAPI = { fetchIocStatus }, statistics: { - getStatistics, currentlyActiveIocs, - iocDeploymentHistory, activeIocHistory, calculateStatistics, operationHistory @@ -464,21 +452,11 @@ export const apiHandlers = [ ), // statistics - makeHandler( - "GET", - qRegExp(".*/statistics/general"), - mockAPI.statistics.getStatistics - ), makeHandler( "GET", qRegExp(".*/statistics/general/active_ioc_statistics"), mockAPI.statistics.currentlyActiveIocs ), - makeHandler( - "GET", - qRegExp(".*/statistics/general/deployed_ioc_history"), - mockAPI.statistics.iocDeploymentHistory - ), makeHandler( "GET", qRegExp(".*/statistics/general/active_ioc_history"),