From e131ad8185399e65491146fb53d1a5814008e5d7 Mon Sep 17 00:00:00 2001 From: Imre Toth <imre.toth@ess.eu> Date: Wed, 16 Aug 2023 05:32:52 +0000 Subject: [PATCH] CE-1961: Remove owner field --- src/api/SwaggerApi.js | 4 +- src/components/IOC/IOCDelete/IOCDelete.js | 8 +- .../IOC/IOCDetailAdmin/IOCDetailAdmin.js | 75 +- .../IOC/IOCLiveStatus/IOCLiveStatus.js | 2 +- .../IOC/IOCLiveStatus/IOCLiveStatus.spec.js | 2 +- src/components/IOC/IOCTable/IOCTable.js | 7 +- src/components/IOC/IOCTable/IOCTable.spec.js | 9 +- src/components/common/User/UserIOCList.js | 2 +- src/mocks/fixtures/AsyncCombinedIOCs.json | 34 +- src/mocks/fixtures/IOCDetails.json | 4 +- src/mocks/fixtures/PagedIOCResponse.json | 34 +- src/mocks/fixtures/ccce-api.json | 3632 +++++++++++------ src/views/IOC/IOCListView.js | 49 +- src/views/host/HostListView.js | 54 +- 14 files changed, 2387 insertions(+), 1529 deletions(-) diff --git a/src/api/SwaggerApi.js b/src/api/SwaggerApi.js index 6cfee3e1..fc121c5e 100644 --- a/src/api/SwaggerApi.js +++ b/src/api/SwaggerApi.js @@ -168,7 +168,7 @@ export function unpackIOC(ioc) { const { id, description, - owner, + createdBy, active, activeDeployment, namingName, @@ -184,7 +184,7 @@ export function unpackIOC(ioc) { let unpackedIOC = { id: id, description: description, - owner: owner, + createdBy: createdBy, activeDeployment: activeDeployment, active: active, gitProjectId: gitProjectId, diff --git a/src/components/IOC/IOCDelete/IOCDelete.js b/src/components/IOC/IOCDelete/IOCDelete.js index ec15dd0c..b70e36ff 100644 --- a/src/components/IOC/IOCDelete/IOCDelete.js +++ b/src/components/IOC/IOCDelete/IOCDelete.js @@ -85,9 +85,6 @@ export default function IOCDelete({ ioc, buttonDisabled }) { "There is an ongoing operation, you can not delete the IOC right now"; } - let differentOwnerButtonTitle = - "Only mainainer of the IOC can delete the IOC"; - return ( <Root> <SimpleModal @@ -127,11 +124,8 @@ export default function IOCDelete({ ioc, buttonDisabled }) { > <AccessControl allowedRoles={["DeploymentToolAdmin"]} - allowedUsersWithRoles={[ - { user: ioc.owner, role: "DeploymentToolIntegrator" } - ]} renderNoAccess={() => ( - <Tooltip title={differentOwnerButtonTitle}> + <Tooltip title={"Only admins can delete the IOC"}> <span> <Button className={classes.deleteButton} diff --git a/src/components/IOC/IOCDetailAdmin/IOCDetailAdmin.js b/src/components/IOC/IOCDetailAdmin/IOCDetailAdmin.js index c149f97e..90f8a3ac 100644 --- a/src/components/IOC/IOCDetailAdmin/IOCDetailAdmin.js +++ b/src/components/IOC/IOCDetailAdmin/IOCDetailAdmin.js @@ -13,8 +13,7 @@ import { import { useAllowedGitProjects, useNamingNames, - useUpdateIoc, - useUserNames + useUpdateIoc } from "../../../api/SwaggerApi"; import { useTypingTimer } from "../../common/SearchBoxFilter/TypingTimer"; import { ConfirmationDialog } from "../../dialog/ConfirmationDialog"; @@ -54,9 +53,6 @@ export default function IOCDetailAdmin({ description: ioc.description, name: ioc.namingName }); - const [owner, setOwner] = useState(ioc.owner); - const [ownerQuery] = useState(); - const [users, getUsers, , loadingUsers] = useUserNames(); // for the dialog const [adHocDialogOpen, setAdHocDialogOpen] = useState(false); @@ -69,19 +65,15 @@ export default function IOCDetailAdmin({ setError(message); } - const requiredDataMissing = useCallback( - () => !gitId || !owner || !name, - [gitId, name, owner] - ); + const requiredDataMissing = useCallback(() => !gitId || !name, [gitId, name]); const noModification = useCallback( () => gitId === ioc.gitProjectId && name?.uuid === ioc.namingUuid && name?.description === ioc.description && - name?.name === ioc.namingName && - owner === ioc.owner, - [gitId, name, owner, ioc] + name?.name === ioc.namingName, + [gitId, name, ioc] ); const [uioc, actionUpdateIoc] = useUpdateIoc(ioc.id, onError); @@ -92,8 +84,6 @@ export default function IOCDetailAdmin({ useEffect(() => getNames(nameQuery), [nameQuery, getNames]); - useEffect(() => getUsers(ownerQuery), [ownerQuery, getUsers]); - // when user clicks Submit button a dialog should open const onSubmit = (event) => { event.preventDefault(); @@ -124,7 +114,6 @@ export default function IOCDetailAdmin({ // what to do when modifying IOC const modifyIoc = () => { actionUpdateIoc({ - owner: owner, gitProjectId: gitId, namingUuid: name ? name.uuid : null }); @@ -248,53 +237,6 @@ export default function IOCDetailAdmin({ ); } - function ownerAutocomplete(disabled) { - const loading = loadingUsers && !disabled; - return ( - <Autocomplete - className={classes.textField} - autoHighlight - id="maintainer" - options={users} - loading={loading} - clearOnBlur={false} - getOptionLabel={(option) => { - return option; - }} - defaultValue={owner} - renderInput={(params) => ( - <TextField - {...params} - label="Maintainer" - variant="outlined" - fullWidth - required - InputProps={{ - ...params.InputProps, - endAdornment: ( - <React.Fragment> - {loading ? ( - <CircularProgress - color="inherit" - size={20} - /> - ) : null} - {params.InputProps.endAdornment} - </React.Fragment> - ) - }} - /> - )} - onChange={(event, value, reason) => { - setOwner(value); - setError(null); - }} - disabled={disabled} - autoSelect - /> - ); - } - let disabledButtonTitle = ""; if (buttonDisabled || ioc.operationInProgress) { disabledButtonTitle = @@ -339,20 +281,13 @@ export default function IOCDetailAdmin({ <AccessControl allowedRoles={["DeploymentToolAdmin"]} allowedUsersWithRoles={[ - { user: ioc.owner, role: "DeploymentToolIntegrator" } + { user: ioc.createdBy, role: "DeploymentToolIntegrator" } ]} renderNoAccess={() => gitRepoAutocomplete(true)} > {gitRepoAutocomplete(false)} </AccessControl> - <AccessControl - allowedRoles={["DeploymentToolAdmin"]} - renderNoAccess={() => ownerAutocomplete(true)} - > - {ownerAutocomplete(false)} - </AccessControl> - {error ? <Alert severity="error">{error}</Alert> : <></>} <br /> diff --git a/src/components/IOC/IOCLiveStatus/IOCLiveStatus.js b/src/components/IOC/IOCLiveStatus/IOCLiveStatus.js index 6733a0fe..dc978685 100644 --- a/src/components/IOC/IOCLiveStatus/IOCLiveStatus.js +++ b/src/components/IOC/IOCLiveStatus/IOCLiveStatus.js @@ -78,7 +78,7 @@ export function IOCLiveStatus({ ioc }) { ) : ( grayOutNoText ), - Maintainer: ioc.owner + "Created by": ioc.createdBy }; // show comment only for deployments and where comment field is filled diff --git a/src/components/IOC/IOCLiveStatus/IOCLiveStatus.spec.js b/src/components/IOC/IOCLiveStatus/IOCLiveStatus.spec.js index 06892a2a..bf6fce40 100644 --- a/src/components/IOC/IOCLiveStatus/IOCLiveStatus.spec.js +++ b/src/components/IOC/IOCLiveStatus/IOCLiveStatus.spec.js @@ -20,7 +20,7 @@ function commonTests() { // Expected in Info table: cy.contains("ee3ae2a8"); // git reference cy.contains("Test IOC for CCCE"); // description - cy.contains("johnsparger"); // owner + cy.contains("johnsparger"); // created by cy.contains("ccce-w40.cslab.esss.lu.se"); // deployed on // Expect alerts to be displayed diff --git a/src/components/IOC/IOCTable/IOCTable.js b/src/components/IOC/IOCTable/IOCTable.js index a4ed7fa7..ac74543b 100644 --- a/src/components/IOC/IOCTable/IOCTable.js +++ b/src/components/IOC/IOCTable/IOCTable.js @@ -18,8 +18,7 @@ const exploreIocsColumns = [ { id: "namingName", label: "IOC name", width: "15ch", sortable: false }, { id: "description", label: "Description", width: "20ch", sortable: false }, { id: "host", label: "Host", width: "10ch", sortable: false }, - { id: "network", label: "Network", width: "10ch", sortable: false }, - { id: "owner", label: "Maintainer", width: "13ch", sortable: false } + { id: "network", label: "Network", width: "10ch", sortable: false } ]; const hostDetailsColumns = [ @@ -102,7 +101,7 @@ function createTableRowForOwnIocs(ioc) { } function createTableRowForExploreIocs(ioc) { - const { id, namingName, owner, alertSeverity, host, description } = ioc; + const { id, namingName, createdBy, alertSeverity, host, description } = ioc; return { id: id, @@ -119,7 +118,7 @@ function createTableRowForExploreIocs(ioc) { namingName: noWrapText(namingName ?? "---"), host: noWrapText(host?.hostName || "---"), network: noWrapText(host?.network || "---"), - owner: noWrapText(owner || "---"), + createdBy: noWrapText(createdBy || "---"), discrepancy: alertSeverity === "WARNING", inconsistentState: alertSeverity === "ERROR", iocNotDeployed: !ioc.activeDeployment, diff --git a/src/components/IOC/IOCTable/IOCTable.spec.js b/src/components/IOC/IOCTable/IOCTable.spec.js index 7b0c1a0f..d2cecc1d 100644 --- a/src/components/IOC/IOCTable/IOCTable.spec.js +++ b/src/components/IOC/IOCTable/IOCTable.spec.js @@ -3,13 +3,7 @@ import { composeStories } from "@storybook/testing-react"; import * as stories from "../../../stories/components/common/IOC/IOCTable.stories"; const { AfterAsync } = composeStories(stories); -const textColumns = [ - "IOC name", - "Description", - "Host", - "Network", - "Maintainer" -]; +const textColumns = ["IOC name", "Description", "Host", "Network"]; const columns = ["Status"].concat(textColumns); const firstRowData = [ "Active", @@ -17,7 +11,6 @@ const firstRowData = [ "Some description", "vacs-accv-vm-ioc", "ChannelAccess-FEB", - "krisztianloki", "1.0.0" ]; diff --git a/src/components/common/User/UserIOCList.js b/src/components/common/User/UserIOCList.js index 3c67ddb2..3edce254 100644 --- a/src/components/common/User/UserIOCList.js +++ b/src/components/common/User/UserIOCList.js @@ -23,7 +23,7 @@ export function UserIocList({ userName }) { useEffect(() => { let requestParams = initRequestParams(lazyParams); - requestParams.owner = userName; + requestParams.created_by = userName; getIocs(requestParams); }, [getIocs, lazyParams, userName]); diff --git a/src/mocks/fixtures/AsyncCombinedIOCs.json b/src/mocks/fixtures/AsyncCombinedIOCs.json index 5ff377b1..6c52463f 100644 --- a/src/mocks/fixtures/AsyncCombinedIOCs.json +++ b/src/mocks/fixtures/AsyncCombinedIOCs.json @@ -3,7 +3,7 @@ "id": 346, "description": "some description", "namingName": "VacS-RFQ:SC-IOC-130", - "owner": "krisztianloki", + "createdBy": "krisztianloki", "gitProjectId": 5336, "activeDeployment": { "host": { @@ -23,7 +23,7 @@ { "id": 345, "namingName": "VacS-RFQ:SC-IOC-119", - "owner": "krisztianloki", + "createdBy": "krisztianloki", "gitProjectId": 5335, "activeDeployment": { "host": { @@ -56,7 +56,7 @@ "id": 344, "description": "some description", "namingName": "VacS-RFQ:SC-IOC-110", - "owner": "krisztianloki", + "createdBy": "krisztianloki", "gitProjectId": 5334, "activeDeployment": { "host": { @@ -83,7 +83,7 @@ { "id": 328, "namingName": "RFQ-010:SC-IOC-117", - "owner": "gabrielfedel", + "createdBy": "gabrielfedel", "gitProjectId": 5953, "sourceVersion": null, "activeDeployment": null @@ -92,7 +92,7 @@ "id": 251, "description": "some description", "namingName": "RFQ-010:SC-IOC-015", - "owner": "lucianocarneiro", + "createdBy": "lucianocarneiro", "gitProjectId": 5952, "sourceVersion": null, "activeDeployment": null @@ -101,7 +101,7 @@ "id": 249, "description": "some description", "namingName": "RFQ-010:SC-IOC-016", - "owner": "gabrielfedel", + "createdBy": "gabrielfedel", "gitProjectId": 5954, "activeDeployment": { "host": { @@ -121,7 +121,7 @@ { "id": 166, "namingName": "RFQ-010:SC-IOC-001", - "owner": "gabrielfedel", + "createdBy": "gabrielfedel", "gitProjectId": 4314, "activeDeployment": { "host": { @@ -148,7 +148,7 @@ "id": 148, "description": "some description", "namingName": "RFQ-010:SC-IOC-977", - "owner": "krisztianloki", + "createdBy": "krisztianloki", "gitProjectId": 5429, "activeDeployment": { "host": { @@ -176,7 +176,7 @@ "id": 116, "description": "some description", "namingName": "RFQ-010:SC-IOC-005", - "owner": "joaopaulomartins", + "createdBy": "joaopaulomartins", "gitProjectId": 1697, "activeDeployment": { "host": { @@ -197,7 +197,7 @@ "id": 76, "description": "some description", "namingName": "RFQ-010:SC-IOC-004", - "owner": "joaopaulomartins", + "createdBy": "joaopaulomartins", "gitProjectId": 5257, "activeDeployment": { "host": { @@ -218,7 +218,7 @@ "id": 13, "description": "some description", "namingName": "RFQ-010:SC-IOC-056", - "owner": "krisztianloki", + "createdBy": "krisztianloki", "gitProjectId": 5056, "activeDeployment": { "host": { @@ -246,7 +246,7 @@ "id": 10, "description": "some description", "namingName": "RFQ-010:SC-IOC-011", - "owner": "anderslindh", + "createdBy": "anderslindh", "gitProjectId": 4929, "sourceVersion": "961ebd48020add0282688437ae34dd0974b6fa15", "activeDeployment": null, @@ -256,7 +256,7 @@ "id": 9, "description": "some description", "namingName": "RFQ-010:SC-IOC-010", - "owner": "anderslindh", + "createdBy": "anderslindh", "gitProjectId": 4875, "activeDeployment": { "host": { @@ -277,7 +277,7 @@ "id": 8, "description": "some description", "namingName": "RFQ-010:SC-IOC-009", - "owner": "anderslindh", + "createdBy": "anderslindh", "gitProjectId": 4947, "sourceVersion": null, "activeDeployment": null @@ -286,7 +286,7 @@ "id": 6, "description": "some description", "namingName": "RFQ-010:SC-IOC-008", - "owner": "anderslindh", + "createdBy": "anderslindh", "gitProjectId": 2582, "sourceVersion": null, "activeDeployment": null @@ -295,7 +295,7 @@ "id": 4, "description": "some description", "namingName": "RFQ-010:SC-IOC-007", - "owner": "anderslindh", + "createdBy": "anderslindh", "gitProjectId": 4877, "activeDeployment": { "host": { @@ -316,7 +316,7 @@ "id": 3, "description": "some description", "namingName": "RFQ-010:SC-IOC-006", - "owner": "anderslindh", + "createdBy": "anderslindh", "gitProjectId": 4335, "activeDeployment": { "host": { diff --git a/src/mocks/fixtures/IOCDetails.json b/src/mocks/fixtures/IOCDetails.json index 8a22c326..6655d631 100644 --- a/src/mocks/fixtures/IOCDetails.json +++ b/src/mocks/fixtures/IOCDetails.json @@ -2,7 +2,7 @@ { "id": 1, "description": "This is a test IOC for demonstrating the deployment tool", - "owner": "johnsparger", + "createdBy": "johnsparger", "namingName": "CCCE:SC-IOC-003", "namingUuid": "77325d6f-6d85-443f-b448-3d99a941e23e", "gitProjectId": 5215, @@ -17,7 +17,7 @@ { "id": 2, "description": "Test IOC for CCCE", - "owner": "johnsparger", + "createdBy": "johnsparger", "namingName": "CCCE:SC-IOC-001", "namingUuid": "d8d674c6-6f1a-467e-abd7-ead80dc82152", "gitProjectId": 4801, diff --git a/src/mocks/fixtures/PagedIOCResponse.json b/src/mocks/fixtures/PagedIOCResponse.json index a3129729..3c715af0 100644 --- a/src/mocks/fixtures/PagedIOCResponse.json +++ b/src/mocks/fixtures/PagedIOCResponse.json @@ -7,7 +7,7 @@ { "id": 346, "namingName": "VacS-RFQ:SC-IOC-130", - "owner": "krisztianloki", + "createdBy": "krisztianloki", "gitProjectId": 5336, "activeDeployment": { "host": { @@ -19,7 +19,7 @@ { "id": 345, "namingName": "VacS-RFQ:SC-IOC-119", - "owner": "krisztianloki", + "createdBy": "krisztianloki", "gitProjectId": 5335, "activeDeployment": { "host": { @@ -31,7 +31,7 @@ { "id": 344, "namingName": "VacS-RFQ:SC-IOC-110", - "owner": "krisztianloki", + "createdBy": "krisztianloki", "gitProjectId": 5334, "activeDeployment": { "host": { @@ -43,7 +43,7 @@ { "id": 328, "namingName": "RFQ-010:SC-IOC-117", - "owner": "gabrielfedel", + "createdBy": "gabrielfedel", "gitProjectId": 5953, "sourceVersion": null, "activeDeployment": null @@ -51,7 +51,7 @@ { "id": 251, "namingName": "RFQ-010:SC-IOC-015", - "owner": "lucianocarneiro", + "createdBy": "lucianocarneiro", "gitProjectId": 5952, "sourceVersion": null, "activeDeployment": null @@ -59,7 +59,7 @@ { "id": 249, "namingName": "RFQ-010:SC-IOC-016", - "owner": "gabrielfedel", + "createdBy": "gabrielfedel", "gitProjectId": 5954, "sourceVersion": "1.0.1", "activeDeployment": { @@ -71,7 +71,7 @@ { "id": 166, "namingName": "RFQ-010:SC-IOC-001", - "owner": "gabrielfedel", + "createdBy": "gabrielfedel", "gitProjectId": 4314, "activeDeployment": { "host": { @@ -83,7 +83,7 @@ { "id": 148, "namingName": "RFQ-010:SC-IOC-977", - "owner": "krisztianloki", + "createdBy": "krisztianloki", "gitProjectId": 5429, "activeDeployment": { "host": { @@ -95,7 +95,7 @@ { "id": 116, "namingName": "RFQ-010:SC-IOC-005", - "owner": "joaopaulomartins", + "createdBy": "joaopaulomartins", "gitProjectId": 1697, "activeDeployment": { "host": { @@ -107,7 +107,7 @@ { "id": 76, "namingName": "RFQ-010:SC-IOC-004", - "owner": "joaopaulomartins", + "createdBy": "joaopaulomartins", "gitProjectId": 5257, "activeDeployment": { "host": { @@ -119,7 +119,7 @@ { "id": 13, "namingName": "RFQ-010:SC-IOC-056", - "owner": "krisztianloki", + "createdBy": "krisztianloki", "gitProjectId": 5056, "activeDeployment": { "host": { @@ -131,7 +131,7 @@ { "id": 10, "namingName": "RFQ-010:SC-IOC-011", - "owner": "anderslindh", + "createdBy": "anderslindh", "gitProjectId": 4929, "sourceVersion": "961ebd48020add0282688437ae34dd0974b6fa15", "activeDeployment": null @@ -139,7 +139,7 @@ { "id": 9, "namingName": "RFQ-010:SC-IOC-010", - "owner": "anderslindh", + "createdBy": "anderslindh", "gitProjectId": 4875, "activeDeployment": { "host": { @@ -151,7 +151,7 @@ { "id": 8, "namingName": "RFQ-010:SC-IOC-009", - "owner": "anderslindh", + "createdBy": "anderslindh", "gitProjectId": 4947, "sourceVersion": null, "activeDeployment": null @@ -159,7 +159,7 @@ { "id": 6, "namingName": "RFQ-010:SC-IOC-008", - "owner": "anderslindh", + "createdBy": "anderslindh", "gitProjectId": 2582, "sourceVersion": null, "activeDeployment": null @@ -167,7 +167,7 @@ { "id": 4, "namingName": "RFQ-010:SC-IOC-007", - "owner": "anderslindh", + "createdBy": "anderslindh", "gitProjectId": 4877, "activeDeployment": { "host": { @@ -179,7 +179,7 @@ { "id": 3, "namingName": "RFQ-010:SC-IOC-006", - "owner": "anderslindh", + "createdBy": "anderslindh", "gitProjectId": 4335, "sourceVersion": "1.0.0", "activeDeployment": { diff --git a/src/mocks/fixtures/ccce-api.json b/src/mocks/fixtures/ccce-api.json index 42f00f62..21fe6ab8 100644 --- a/src/mocks/fixtures/ccce-api.json +++ b/src/mocks/fixtures/ccce-api.json @@ -3,7 +3,7 @@ "info": { "title": "CE deploy & monitor API", "description": "CE deploy & monitor backend", - "version": "0.0.12" + "version": "1.0.0" }, "servers": [ { @@ -12,18 +12,39 @@ } ], "tags": [ - { "name": "Broadcasts" }, - { "name": "IOCs" }, - { "name": "Naming" }, - { "name": "Authentication" }, - { "name": "AWX" }, - { "name": "Helper" }, - { "name": "Records" }, - { "name": "Statistics" }, - { "name": "Hosts" }, - { "name": "Deployments" }, - { "name": "Git" }, - { "name": "Monitoring" } + { + "name": "Broadcasts" + }, + { + "name": "IOCs" + }, + { + "name": "Naming" + }, + { + "name": "Authentication" + }, + { + "name": "Helper" + }, + { + "name": "Records" + }, + { + "name": "Statistics" + }, + { + "name": "Hosts" + }, + { + "name": "Deployments" + }, + { + "name": "Git" + }, + { + "name": "Monitoring" + } ], "paths": { "/api/v1/iocs/{ioc_id}/undeploy_in_db": { @@ -38,50 +59,53 @@ "in": "path", "description": "The id of the IOC to undeploy", "required": true, - "schema": { "type": "integer", "format": "int64" } + "schema": { + "type": "integer", + "format": "int64" + } } ], "responses": { - "403": { - "description": "Forbidden: user doesn't have the necessary permissions to undeploy", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } - } - } - }, "200": { "description": "Undeployment created", "content": { "application/json": { "schema": { "type": "array", - "items": { "$ref": "#/components/schemas/Deployment" } + "items": { + "$ref": "#/components/schemas/Deployment" + } } } } }, - "404": { - "description": "Not found", + "401": { + "description": "Unauthorized", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "422": { - "description": "IOC is not deployed", + "403": { + "description": "Forbidden: user doesn't have the necessary permissions to undeploy", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "401": { - "description": "Unauthorized", + "404": { + "description": "Not found", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, @@ -89,7 +113,19 @@ "description": "Ongoing deployment, or undeployment for IOC", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "422": { + "description": "IOC is not deployed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, @@ -97,12 +133,18 @@ "description": "Service exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } }, - "security": [{ "bearerAuth": [] }] + "security": [ + { + "bearerAuth": [] + } + ] } }, "/api/v1/iocs/{ioc_id}/active_deployment/host": { @@ -117,50 +159,63 @@ "in": "path", "description": "The ID of the IOC", "required": true, - "schema": { "type": "integer", "format": "int64" } + "schema": { + "type": "integer", + "format": "int64" + } } ], "requestBody": { "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/UpdateHostRequest" } + "schema": { + "$ref": "#/components/schemas/UpdateHostRequest" + } } }, "required": true }, "responses": { - "404": { - "description": "Not found", + "200": { + "description": "Successful host update", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Ioc" + } + } } } }, - "200": { - "description": "Successful host update", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { - "type": "array", - "items": { "$ref": "#/components/schemas/Ioc" } + "$ref": "#/components/schemas/GeneralException" } } } }, - "422": { - "description": "IOC is not deployed", + "403": { + "description": "Forbidden: user doesn't have the necessary permissions to modify", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "401": { - "description": "Unauthorized", + "404": { + "description": "Not found", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, @@ -168,15 +223,19 @@ "description": "Ongoing operation for IOC", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "403": { - "description": "Forbidden: user doesn't have the necessary permissions to modify", + "422": { + "description": "IOC is not deployed", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, @@ -184,12 +243,18 @@ "description": "Service exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } }, - "security": [{ "bearerAuth": [] }] + "security": [ + { + "bearerAuth": [] + } + ] } }, "/api/v1/iocs": { @@ -209,46 +274,88 @@ } }, { - "name": "owner", + "name": "created_by", "in": "query", - "description": "User name", + "description": "Search by user-name who created the ioc", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "network", + "in": "query", + "description": "Network", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "network_scope", + "in": "query", + "description": "Network scope", "required": false, - "schema": { "type": "string" } + "schema": { + "type": "string" + } + }, + { + "name": "host_type", + "in": "query", + "description": "Host type", + "required": false, + "schema": { + "type": "string" + } }, { "name": "query", "in": "query", - "description": "Search text (Search for Naming name, Owner)", + "description": "Search text (Search for Naming name)", "required": false, - "schema": { "type": "string" } + "schema": { + "type": "string" + } }, { "name": "order_by", "in": "query", "description": "Order by", "required": false, - "schema": { "type": "string", "enum": ["ID", "OWNER", "IOC_NAME"] } + "schema": { + "type": "string", + "enum": ["ID", "CREATED_BY", "IOC_NAME"] + } }, { "name": "order_asc", "in": "query", "description": "Order Ascending", "required": false, - "schema": { "type": "boolean" } + "schema": { + "type": "boolean" + } }, { "name": "page", "in": "query", "description": "Page offset", "required": false, - "schema": { "type": "integer", "format": "int32" } + "schema": { + "type": "integer", + "format": "int32" + } }, { "name": "limit", "in": "query", "description": "Page size", "required": false, - "schema": { "type": "integer", "format": "int32" } + "schema": { + "type": "integer", + "format": "int32" + } } ], "responses": { @@ -256,7 +363,9 @@ "description": "A paged array of IOCs", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/PagedIocResponse" } + "schema": { + "$ref": "#/components/schemas/PagedIocResponse" + } } } }, @@ -264,7 +373,9 @@ "description": "Unauthorized", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, @@ -272,7 +383,9 @@ "description": "Service exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } @@ -285,86 +398,110 @@ "requestBody": { "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/CreateIoc" } + "schema": { + "$ref": "#/components/schemas/CreateIoc" + } } }, "required": true }, "responses": { - "400": { - "description": "Incomplete request", + "201": { + "description": "IOC created", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/Ioc" + } } } }, - "424": { - "description": "Metadata file not found, or not processable", + "400": { + "description": "Incomplete request", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "201": { - "description": "IOC created", + "401": { + "description": "Unauthorized", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/Ioc" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "422": { - "description": "Unprocessable request", + "403": { + "description": "Forbidden: User doesn't have the necessary permissions in Gitlab", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "401": { - "description": "Unauthorized", + "409": { + "description": "IOC already created", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "409": { - "description": "IOC already created", + "422": { + "description": "Unprocessable request", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "503": { - "description": "Remote service exception", + "424": { + "description": "Metadata file not found, or not processable", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "403": { - "description": "Forbidden: User doesn't have the necessary permissions in Gitlab", + "500": { + "description": "Service exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "500": { - "description": "Service exception", + "503": { + "description": "Remote service exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } }, - "security": [{ "bearerAuth": [] }] + "security": [ + { + "bearerAuth": [] + } + ] } }, "/api/v1/iocs/{ioc_id}/undeployment_job": { @@ -378,13 +515,18 @@ "in": "path", "description": "The id of the IOC to undeploy", "required": true, - "schema": { "type": "integer", "format": "int64" } + "schema": { + "type": "integer", + "format": "int64" + } } ], "requestBody": { "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/Undeployment" } + "schema": { + "$ref": "#/components/schemas/Undeployment" + } } }, "required": true @@ -396,40 +538,40 @@ "application/json": { "schema": { "type": "array", - "items": { "$ref": "#/components/schemas/Deployment" } + "items": { + "$ref": "#/components/schemas/Deployment" + } } } } }, - "403": { - "description": "Forbidden: user doesn't have the necessary permissions in Gitlab", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } - } - } - }, - "404": { - "description": "Not found", + "401": { + "description": "Unauthorized", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden: user doesn't have the necessary permissions in Gitlab", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "503": { - "description": "Remote service exception", + "404": { + "description": "Not found", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, @@ -437,7 +579,9 @@ "description": "Concurrent deployment, undeployment, start or stop for IOC is ongoing", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, @@ -445,7 +589,9 @@ "description": "IOC is not deployed correctly", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, @@ -453,12 +599,28 @@ "description": "Service exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "503": { + "description": "Remote service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } }, - "security": [{ "bearerAuth": [] }] + "security": [ + { + "bearerAuth": [] + } + ] } }, "/api/v1/iocs/{ioc_id}/stop_job": { @@ -472,7 +634,10 @@ "in": "path", "description": "The id of the IOC to stop", "required": true, - "schema": { "type": "integer", "format": "int64" } + "schema": { + "type": "integer", + "format": "int64" + } } ], "responses": { @@ -480,7 +645,9 @@ "description": "IOC stop initiated", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/AdHocCommand" } + "schema": { + "$ref": "#/components/schemas/Operation" + } } } }, @@ -488,23 +655,19 @@ "description": "Unauthorized", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "503": { - "description": "Remote service exception", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } - } - } - }, - "409": { - "description": "Concurrent deployment, undeployment, start or stop for IOC is ongoing", + "403": { + "description": "Forbidden: User doesn't have the necessary permissions in Gitlab", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, @@ -512,15 +675,19 @@ "description": "IOC not found", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "403": { - "description": "Forbidden: User doesn't have the necessary permissions in Gitlab", + "409": { + "description": "Concurrent deployment, undeployment, start or stop for IOC is ongoing", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, @@ -528,7 +695,9 @@ "description": "IOC has no active deployment", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, @@ -536,12 +705,28 @@ "description": "Service exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "503": { + "description": "Remote service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } }, - "security": [{ "bearerAuth": [] }] + "security": [ + { + "bearerAuth": [] + } + ] } }, "/api/v1/iocs/{ioc_id}/start_job": { @@ -555,7 +740,10 @@ "in": "path", "description": "The id of the IOC to start", "required": true, - "schema": { "type": "integer", "format": "int64" } + "schema": { + "type": "integer", + "format": "int64" + } } ], "responses": { @@ -563,7 +751,9 @@ "description": "IOC start initiated", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/AdHocCommand" } + "schema": { + "$ref": "#/components/schemas/Operation" + } } } }, @@ -571,23 +761,19 @@ "description": "Unauthorized", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } - } - } - }, - "503": { - "description": "Remote service exception", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "409": { - "description": "Concurrent deployment, undeployment, start or stop for IOC is ongoing", + "403": { + "description": "Forbidden: User doesn't have the necessary permissions in Gitlab", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, @@ -595,15 +781,19 @@ "description": "IOC not found", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "403": { - "description": "Forbidden: User doesn't have the necessary permissions in Gitlab", + "409": { + "description": "Concurrent deployment, undeployment, start or stop for IOC is ongoing", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, @@ -611,7 +801,9 @@ "description": "IOC has no active deployment", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, @@ -619,12 +811,28 @@ "description": "Service exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "503": { + "description": "Remote service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } }, - "security": [{ "bearerAuth": [] }] + "security": [ + { + "bearerAuth": [] + } + ] } }, "/api/v1/iocs/{ioc_id}/deployment_job": { @@ -638,31 +846,40 @@ "in": "path", "description": "The id of the IOC to deploy", "required": true, - "schema": { "type": "integer", "format": "int64" } + "schema": { + "type": "integer", + "format": "int64" + } } ], "requestBody": { "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/UpdateAndDeployIoc" } + "schema": { + "$ref": "#/components/schemas/UpdateAndDeployIoc" + } } }, "required": true }, "responses": { - "400": { - "description": "Incomplete request", + "201": { + "description": "Deployment created", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/Deployment" + } } } }, - "424": { - "description": "Metadata file not found, or not processable", + "400": { + "description": "Incomplete request", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, @@ -670,31 +887,19 @@ "description": "Unauthorized", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } - } - } - }, - "503": { - "description": "Remote service exception", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } - } - } - }, - "409": { - "description": "Concurrent deployment, undeployment, start or stop for IOC is ongoing", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "201": { - "description": "Deployment created", + "403": { + "description": "Forbidden: User doesn't have the necessary permissions in Gitlab", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/Deployment" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, @@ -702,15 +907,19 @@ "description": "IOC not found", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "403": { - "description": "Forbidden: User doesn't have the necessary permissions in Gitlab", + "409": { + "description": "Concurrent deployment, undeployment, start or stop for IOC is ongoing", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, @@ -718,70 +927,48 @@ "description": "CSEntry host not found", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } - } - } - }, - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } - } - } - } - }, - "security": [{ "bearerAuth": [] }] - } - }, - "/api/v1/awx/jobs": { - "post": { - "tags": ["AWX"], - "summary": "Update an AWX job's status", - "operationId": "updateJob", - "requestBody": { - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/AwxJobMeta" } - } - }, - "required": true - }, - "responses": { - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "404": { - "description": "Job not found", + "424": { + "description": "Metadata file not found, or not processable", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "200": { - "description": "Job updated", + "500": { + "description": "Service exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "500": { - "description": "Service exception", + "503": { + "description": "Remote service exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } }, - "security": [{ "apiKey": [] }] + "security": [ + { + "bearerAuth": [] + } + ] } }, "/api/v1/authentication/renew": { @@ -791,48 +978,62 @@ "description": "Renewing valid, non-expired JWT token", "operationId": "tokenRenew", "responses": { - "503": { - "description": "Login server unavailable", + "200": { + "description": "Ok", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/LoginResponse" + } } } }, - "403": { - "description": "Permission denied", + "401": { + "description": "Unauthorized", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Permission denied", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "200": { - "description": "Ok", + "500": { + "description": "Service exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/LoginResponse" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "500": { - "description": "Service exception", + "503": { + "description": "Login server unavailable", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } }, - "security": [{ "bearerAuth": [] }] + "security": [ + { + "bearerAuth": [] + } + ] } }, "/api/v1/authentication/login": { @@ -844,25 +1045,31 @@ "requestBody": { "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/Login" } + "schema": { + "$ref": "#/components/schemas/Login" + } } }, "required": true }, "responses": { - "401": { - "description": "Bad username, and/or password", + "200": { + "description": "Ok", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/LoginResponse" + } } } }, - "503": { - "description": "Login server unavailable", + "401": { + "description": "Bad username, and/or password", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, @@ -870,23 +1077,29 @@ "description": "User doesn't have permission to log in", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "200": { - "description": "Ok", + "500": { + "description": "Service exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/LoginResponse" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "500": { - "description": "Service exception", + "503": { + "description": "Login server unavailable", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } @@ -904,31 +1117,40 @@ "in": "path", "description": "Unique ID of IOC", "required": true, - "schema": { "type": "integer", "format": "int64" } + "schema": { + "type": "integer", + "format": "int64" + } } ], "responses": { - "404": { - "description": "Ioc not found", + "200": { + "description": "Found IOC", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/IocDetails" + } } } }, - "200": { - "description": "Found IOC", + "401": { + "description": "Unauthorized", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/IocDetails" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "401": { - "description": "Unauthorized", + "404": { + "description": "Ioc not found", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, @@ -936,7 +1158,9 @@ "description": "Service exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } @@ -944,7 +1168,7 @@ }, "delete": { "tags": ["IOCs"], - "summary": "Deletes a single IOC based on the ID supplied", + "summary": "Deletes a single IOC with its history based on the ID supplied", "operationId": "deleteIoc", "parameters": [ { @@ -952,37 +1176,50 @@ "in": "path", "description": "Id of IOC to delete", "required": true, - "schema": { "type": "integer", "format": "int64" } + "schema": { + "type": "integer", + "format": "int64" + } } ], "responses": { "204": { - "description": "IOC deleted", + "description": "IOC deleted with its history", "content": { - "application/json": { "schema": { "type": "string" } } + "application/json": { + "schema": { + "type": "string" + } + } } }, "401": { "description": "Unauthorized", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } - } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } } }, "403": { "description": "Forbidden: User doesn't have the necessary permissions", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "503": { - "description": "Remote service exception", + "404": { + "description": "IOC not found", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, @@ -990,28 +1227,38 @@ "description": "Concurrent deployment, undeployment, start or stop for IOC is ongoing", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "404": { - "description": "IOC not found", + "500": { + "description": "Service exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "500": { - "description": "Service exception", + "503": { + "description": "Remote service exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } }, - "security": [{ "bearerAuth": [] }] + "security": [ + { + "bearerAuth": [] + } + ] }, "patch": { "tags": ["IOCs"], @@ -1023,39 +1270,30 @@ "in": "path", "description": "Unique ID of IOC", "required": true, - "schema": { "type": "integer", "format": "int64" } + "schema": { + "type": "integer", + "format": "int64" + } } ], "requestBody": { "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/IOCUpdateRequest" } + "schema": { + "$ref": "#/components/schemas/IOCUpdateRequest" + } } }, "required": true }, "responses": { - "404": { - "description": "Ioc not found", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } - } - } - }, - "422": { - "description": "Unprocessable request", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } - } - } - }, "200": { "description": "IOC updated", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/Ioc" } + "schema": { + "$ref": "#/components/schemas/Ioc" + } } } }, @@ -1063,7 +1301,9 @@ "description": "Unauthorized", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, @@ -1071,15 +1311,19 @@ "description": "Forbidden: User doesn't have the necessary permissions", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "503": { - "description": "Remote service exception", + "404": { + "description": "Ioc not found", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, @@ -1087,7 +1331,19 @@ "description": "IOC already created or concurrent deployment, undeployment, start or stop for IOC is ongoing", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "422": { + "description": "Unprocessable request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, @@ -1095,24 +1351,28 @@ "description": "Service exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "503": { + "description": "Remote service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } }, - "security": [{ "bearerAuth": [] }] - } - }, - "/healthcheck": { - "get": { - "tags": ["health-check-controller"], - "operationId": "getHealthCheck", - "responses": { - "200": { - "description": "OK", - "content": { "*/*": { "schema": { "type": "string" } } } + "security": [ + { + "bearerAuth": [] } - } + ] } }, "/api/v1/statistics/my_iocs": { @@ -1135,7 +1395,9 @@ "description": "Unauthorized", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, @@ -1143,12 +1405,18 @@ "description": "Service exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } }, - "security": [{ "bearerAuth": [] }] + "security": [ + { + "bearerAuth": [] + } + ] } }, "/api/v1/statistics/general": { @@ -1171,7 +1439,9 @@ "description": "Unauthorized", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, @@ -1179,34 +1449,67 @@ "description": "Service exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } } } }, - "/api/v1/statistics/general/ioc_statistics": { + "/api/v1/statistics/general/{statistics_type}": { "get": { "tags": ["Statistics"], - "summary": "IOC statistics", - "operationId": "iocStatistics", + "summary": "Calculating statistics", + "operationId": "calculateStatistics", + "parameters": [ + { + "name": "statistics_type", + "in": "path", + "required": true, + "schema": { + "type": "string", + "enum": [ + "HOSTS_REGISTERED", + "HOSTS_WITH_IOCS", + "HOSTS_REACHABLE", + "HOSTS_WITHOUT_ISSUE", + "IOCS_REGISTERED", + "IOCS_DEPLOYED", + "IOCS_RUNNING", + "IOCS_RUNNING_WITHOUT_ISSUE" + ] + } + } + ], "responses": { - "401": { - "description": "Unauthorized", + "200": { + "description": "Calculate statistics", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatisticResponse" + } + } + } + }, + "400": { + "description": "Unsupported statistic type", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "200": { - "description": "Statistics about IOCs deployed to hosts", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { - "type": "array", - "items": { "$ref": "#/components/schemas/DeploymentOnHost" } + "$ref": "#/components/schemas/GeneralException" } } } @@ -1215,25 +1518,27 @@ "description": "Service exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } } } }, - "/api/v1/statistics/general/ioc_number_statistics": { + "/api/v1/statistics/general/operation_history": { "get": { "tags": ["Statistics"], - "summary": "IOC number statistics", - "operationId": "iocNumberStatistics", + "summary": "Operation history from DB for statistics", + "operationId": "operationHistory", "responses": { "200": { - "description": "Statistics about IOCs numbers", + "description": "Operations history from DB for statistics", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/IocStatisticsResponse" + "$ref": "#/components/schemas/OperationStatisticsResponse" } } } @@ -1242,7 +1547,9 @@ "description": "Unauthorized", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, @@ -1250,25 +1557,30 @@ "description": "Service exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } } } }, - "/api/v1/statistics/general/host_number_statistics": { + "/api/v1/statistics/general/ioc_statistics": { "get": { "tags": ["Statistics"], - "summary": "Host number statistics", - "operationId": "hostNumberStatistics", + "summary": "IOC statistics", + "operationId": "iocStatistics", "responses": { "200": { - "description": "Statistics about Host numbers", + "description": "Statistics about IOCs deployed to hosts", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/HostStatisticsResponse" + "type": "array", + "items": { + "$ref": "#/components/schemas/DeploymentOnHost" + } } } } @@ -1277,7 +1589,9 @@ "description": "Unauthorized", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, @@ -1285,7 +1599,9 @@ "description": "Service exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } @@ -1315,7 +1631,9 @@ "description": "Unauthorized", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, @@ -1323,7 +1641,9 @@ "description": "Service exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } @@ -1353,7 +1673,9 @@ "description": "Unauthorized", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, @@ -1361,7 +1683,9 @@ "description": "Service exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } @@ -1391,7 +1715,9 @@ "description": "Unauthorized", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, @@ -1399,7 +1725,9 @@ "description": "Service exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } @@ -1429,7 +1757,9 @@ "description": "Unauthorized", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, @@ -1437,7 +1767,9 @@ "description": "Service exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } @@ -1455,52 +1787,78 @@ "in": "query", "description": "Record name", "required": false, - "schema": { "type": "string" } + "schema": { + "type": "string" + } }, { "name": "ioc_name", "in": "query", "description": "IOC name", "required": false, - "schema": { "type": "string" } + "schema": { + "type": "string" + } + }, + { + "name": "pv_status", + "in": "query", + "description": "PV status", + "required": false, + "schema": { + "type": "string", + "enum": ["ACTIVE", "INACTIVE"] + } }, { "name": "page", "in": "query", "description": "Page offset", "required": false, - "schema": { "type": "integer", "format": "int32" } + "schema": { + "type": "integer", + "format": "int32" + } }, { "name": "limit", "in": "query", "description": "Page size", "required": false, - "schema": { "maximum": 100, "type": "string" } + "schema": { + "maximum": 100, + "type": "string" + } } ], "responses": { - "503": { - "description": "Remote server exception", + "200": { + "description": "A paged array of Channel Finder records", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/PagedRecordResponse" + } } } }, - "200": { - "description": "A paged array of Channel Finder records", + "500": { + "description": "Service exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/PagedRecordResponse" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "500": { - "description": "Service exception", + "503": { + "description": "Remote server exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } @@ -1518,7 +1876,9 @@ "in": "path", "description": "Unique ID of the record", "required": true, - "schema": { "type": "string" } + "schema": { + "type": "string" + } } ], "responses": { @@ -1526,7 +1886,9 @@ "description": "Found record", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/RecordDetails" } + "schema": { + "$ref": "#/components/schemas/RecordDetails" + } } } }, @@ -1534,7 +1896,9 @@ "description": "Record not found", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, @@ -1542,7 +1906,9 @@ "description": "Service exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } @@ -1552,7 +1918,7 @@ "/api/v1/naming/ioc_names_by_name": { "get": { "tags": ["Naming"], - "summary": "Fetches IOC names by name from CCDB", + "summary": "Fetches IOC names by name from the Naming service", "operationId": "fetchIOCByName", "parameters": [ { @@ -1560,47 +1926,61 @@ "in": "query", "description": "IOC name", "required": false, - "schema": { "type": "string" } + "schema": { + "type": "string" + } } ], "responses": { - "401": { - "description": "Unauthorized", + "200": { + "description": "Naming names, and UUIDs from the Naming service", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameResponse" + } + } } } }, - "503": { - "description": "Remote service unreachable", + "401": { + "description": "Unauthorized", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "200": { - "description": "Naming names, and IDs from CCDB", + "500": { + "description": "Service exception", "content": { "application/json": { "schema": { - "type": "array", - "items": { "$ref": "#/components/schemas/NameResponse" } + "$ref": "#/components/schemas/GeneralException" } } } }, - "500": { - "description": "Service exception", + "503": { + "description": "Remote service unreachable", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } }, - "security": [{ "bearerAuth": [] }] + "security": [ + { + "bearerAuth": [] + } + ] } }, "/api/v1/monitoring/syslog/host/{host_name}": { @@ -1614,52 +1994,69 @@ "in": "path", "description": "Host name (without network part)", "required": true, - "schema": { "type": "string" } + "schema": { + "type": "string" + } }, { "name": "time_range", "in": "query", "description": "Time range (in minutes)", "required": false, - "schema": { "type": "integer", "format": "int32" } + "schema": { + "type": "integer", + "format": "int32" + } } ], "responses": { - "401": { - "description": "Unauthorized", + "200": { + "description": "Log lines", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/LokiResponse" + } } } }, - "200": { - "description": "Log lines", + "401": { + "description": "Unauthorized", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/LokiResponse" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "503": { - "description": "Logging server unavailable", + "500": { + "description": "Service exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "500": { - "description": "Service exception", + "503": { + "description": "Logging server unavailable", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } }, - "security": [{ "bearerAuth": [] }] - } + "security": [ + { + "bearerAuth": [] + } + ] + } }, "/api/v1/monitoring/status/{ioc_id}": { "get": { @@ -1672,31 +2069,40 @@ "in": "path", "description": "Unique ID of the IOC", "required": true, - "schema": { "type": "integer", "format": "int64" } + "schema": { + "type": "integer", + "format": "int64" + } } ], "responses": { - "401": { - "description": "Unauthorized", + "200": { + "description": "Log lines", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/IocStatusResponse" + } } } }, - "404": { - "description": "Ioc not found", + "401": { + "description": "Unauthorized", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "200": { - "description": "Log lines", + "404": { + "description": "Ioc not found", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/IocStatusResponse" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, @@ -1704,7 +2110,9 @@ "description": "Service exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } @@ -1722,58 +2130,77 @@ "in": "path", "description": "Host name (without network part)", "required": true, - "schema": { "type": "string" } + "schema": { + "type": "string" + } }, { "name": "ioc_name", "in": "path", "description": "Name of the IOC to get procServ logs", "required": true, - "schema": { "type": "string" } + "schema": { + "type": "string" + } }, { "name": "time_range", "in": "query", "description": "Time range (in minutes)", "required": false, - "schema": { "type": "integer", "format": "int32" } + "schema": { + "type": "integer", + "format": "int32" + } } ], "responses": { - "401": { - "description": "Unauthorized", + "200": { + "description": "Log lines", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/LokiResponse" + } } } }, - "200": { - "description": "Log lines", + "401": { + "description": "Unauthorized", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/LokiResponse" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "503": { - "description": "Logging server unavailable", + "500": { + "description": "Service exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "500": { - "description": "Service exception", + "503": { + "description": "Logging server unavailable", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } }, - "security": [{ "bearerAuth": [] }] + "security": [ + { + "bearerAuth": [] + } + ] } }, "/api/v1/iocs/my_iocs_with_alarms": { @@ -1788,7 +2215,9 @@ "application/json": { "schema": { "type": "array", - "items": { "$ref": "#/components/schemas/IocWithAlarm" } + "items": { + "$ref": "#/components/schemas/IocWithAlarm" + } } } } @@ -1797,7 +2226,9 @@ "description": "Unauthorized", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, @@ -1805,12 +2236,18 @@ "description": "Service exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } }, - "security": [{ "bearerAuth": [] }] + "security": [ + { + "bearerAuth": [] + } + ] } }, "/api/v1/hosts": { @@ -1824,7 +2261,9 @@ "in": "query", "description": "Search text, this query string is passed directly to Elasticsearch. E.g.: To search all hosts where the string \"archiver\" appears in any field, use \"archiver\".To restrict the search to only the name field, use \"name:archiver\".Note that if you pass \"name:arch\", this will not match archiver as elasticsearch uses keywords for string matching. In this case you’d need to use a wildcard: \"name:arch*\".", "required": false, - "schema": { "type": "string" } + "schema": { + "type": "string" + } }, { "name": "filter", @@ -1841,22 +2280,30 @@ "in": "query", "description": "Page offset", "required": false, - "schema": { "type": "integer", "format": "int32" } + "schema": { + "type": "integer", + "format": "int32" + } }, { "name": "limit", "in": "query", "description": "Page size", "required": false, - "schema": { "maximum": 100, "type": "string" } + "schema": { + "maximum": 100, + "type": "string" + } } ], "responses": { - "503": { - "description": "Remote server exception", + "200": { + "description": "A paged array of CSEntry hosts", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/PagedCSEntryHostResponse" + } } } }, @@ -1864,25 +2311,29 @@ "description": "Unauthorized", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "200": { - "description": "A paged array of CSEntry hosts", + "500": { + "description": "Service exception", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedCSEntryHostResponse" + "$ref": "#/components/schemas/GeneralException" } } } }, - "500": { - "description": "Service exception", + "503": { + "description": "Remote server exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } @@ -1900,49 +2351,60 @@ "in": "path", "description": "Unique CSEntry ID of the host", "required": true, - "schema": { "type": "integer", "format": "int64" } + "schema": { + "type": "integer", + "format": "int64" + } } ], "responses": { - "404": { - "description": "Not found", + "200": { + "description": "Found Host", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/CSEntryHostWithStatus" + } } } }, - "503": { - "description": "Remote server exception", + "401": { + "description": "Unauthorized", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "401": { - "description": "Unauthorized", + "404": { + "description": "Not found", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "200": { - "description": "Found Host", + "500": { + "description": "Service exception", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CSEntryHostWithStatus" + "$ref": "#/components/schemas/GeneralException" } } } }, - "500": { - "description": "Service exception", + "503": { + "description": "Remote server exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } @@ -1960,37 +2422,50 @@ "in": "path", "description": "Unique CSEntry ID of the host", "required": true, - "schema": { "type": "integer", "format": "int64" } + "schema": { + "type": "integer", + "format": "int64" + } }, { "name": "page", "in": "query", "description": "Page offset", "required": false, - "schema": { "type": "integer", "format": "int32" } + "schema": { + "type": "integer", + "format": "int32" + } }, { "name": "limit", "in": "query", "description": "Page size", "required": false, - "schema": { "maximum": 100, "type": "string" } + "schema": { + "maximum": 100, + "type": "string" + } } ], "responses": { - "401": { - "description": "Unauthorized", + "200": { + "description": "Found Host", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/PagedAssociatedIocs" + } } } }, - "200": { - "description": "Found Host", + "401": { + "description": "Unauthorized", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/PagedAssociatedIocs" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, @@ -1998,7 +2473,9 @@ "description": "Service exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } @@ -2016,31 +2493,40 @@ "in": "path", "description": "Unique CSEntry ID of the host", "required": true, - "schema": { "type": "integer", "format": "int64" } + "schema": { + "type": "integer", + "format": "int64" + } } ], "responses": { - "404": { - "description": "Not found", + "200": { + "description": "Found Host", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/TargetHost" + } } } }, - "200": { - "description": "Found Host", + "401": { + "description": "Unauthorized", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/TargetHost" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "401": { - "description": "Unauthorized", + "404": { + "description": "Not found", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, @@ -2048,7 +2534,9 @@ "description": "Service exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } @@ -2059,7 +2547,7 @@ "get": { "tags": ["Helper"], "summary": "Checks Naming UUID", - "description": "Checks Naming UUID if it is in use by IOC. \r\nSearching is based on EXACT match! \r\nIf no IOC uses the Naming UUID then the iocId will be NULL", + "description": "Checks Naming UUID if it is in use by IOC. \n\nSearching is based on EXACT match! \n\nIf no IOC uses the Naming UUID then the iocId will be NULL", "operationId": "checkNamingUUId", "parameters": [ { @@ -2067,7 +2555,9 @@ "in": "path", "description": "Naming UUID", "required": true, - "schema": { "type": "string" } + "schema": { + "type": "string" + } } ], "responses": { @@ -2075,7 +2565,9 @@ "description": "Ok", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/IdUsedByIoc" } + "schema": { + "$ref": "#/components/schemas/IdUsedByIoc" + } } } }, @@ -2083,7 +2575,9 @@ "description": "Too many IOCs use the same Naming UUID", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, @@ -2091,7 +2585,9 @@ "description": "Service exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } @@ -2101,8 +2597,8 @@ "/api/v1/helper/check_git_repo_id/{repo_id}": { "get": { "tags": ["Helper"], - "summary": "Checks Git Repository Id", - "description": "Checks Git Repository Id if it is in use by IOC. \r\nIf no IOC uses the Git repo Id then the iocId will be NULL", + "summary": "Checks if Git Repository Id is being used by any of the IOCs", + "description": "Checks Git Repository Id if it is in use by IOC. \n\nFunction is not checking the Git repo ID in the deployment history! \n\nIf no IOC uses the Git repo Id then the iocId will be NULL!", "operationId": "checkGitRepoId", "parameters": [ { @@ -2110,7 +2606,10 @@ "in": "path", "description": "Git repository Id", "required": true, - "schema": { "type": "integer", "format": "int64" } + "schema": { + "type": "integer", + "format": "int64" + } } ], "responses": { @@ -2118,7 +2617,9 @@ "description": "Ok", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/IdUsedByIoc" } + "schema": { + "$ref": "#/components/schemas/IdUsedByIoc" + } } } }, @@ -2126,7 +2627,9 @@ "description": "Service exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } @@ -2144,36 +2647,51 @@ "in": "path", "description": "Git repo project ID", "required": true, - "schema": { "type": "integer", "format": "int64" } + "schema": { + "type": "integer", + "format": "int64" + } }, { "name": "reference", "in": "query", "description": "Git reference", "required": false, - "schema": { "type": "string" } + "schema": { + "type": "string" + } }, { "name": "include_all_reference", "in": "query", "description": "Inculde all reference - optional. Default value: include all refernce (not limiting the response)", "required": false, - "schema": { "type": "boolean" } + "schema": { + "type": "boolean" + } }, { "name": "search_method", "in": "query", "description": "Search method - optional. Default value: filtering ref by EQUALS method", "required": false, - "schema": { "type": "string", "enum": ["EQUALS", "CONTAINS"] } + "schema": { + "type": "string", + "enum": ["EQUALS", "CONTAINS"] + } } ], "responses": { - "503": { - "description": "Git exception", + "200": { + "description": "List of Tags and CommitIds for a specific GitLab repo", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GitReference" + } + } } } }, @@ -2181,26 +2699,29 @@ "description": "Unauthorized", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "200": { - "description": "List of Tags and CommitIds for a specific GitLab repo", + "500": { + "description": "Service exception", "content": { "application/json": { "schema": { - "type": "array", - "items": { "$ref": "#/components/schemas/GitReference" } + "$ref": "#/components/schemas/GeneralException" } } } }, - "500": { - "description": "Service exception", + "503": { + "description": "Git exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } @@ -2218,55 +2739,71 @@ "in": "query", "description": "The username to retrieve info from - optional. If no user name provided the backend will look up for currently logged in user name", "required": false, - "schema": { "type": "string" } + "schema": { + "type": "string" + } } ], "responses": { - "503": { - "description": "Git exception", + "200": { + "description": "Information about the current user", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserInfoResponse" + } + } } } }, - "404": { - "description": "Not found", + "401": { + "description": "Unauthorized", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "401": { - "description": "Unauthorized", + "404": { + "description": "Not found", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "200": { - "description": "Information about the current user", + "500": { + "description": "Service exception", "content": { "application/json": { "schema": { - "type": "array", - "items": { "$ref": "#/components/schemas/UserInfoResponse" } + "$ref": "#/components/schemas/GeneralException" } } } }, - "500": { - "description": "Service exception", + "503": { + "description": "Git exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } }, - "security": [{ "bearerAuth": [] }] + "security": [ + { + "bearerAuth": [] + } + ] } }, "/api/v1/git_helper/projects": { @@ -2275,21 +2812,15 @@ "summary": "List IOC projects", "operationId": "listProjects", "responses": { - "503": { - "description": "Git exception", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } - } - } - }, "200": { "description": "List of Gitlab projects of allowed groups", "content": { "application/json": { "schema": { "type": "array", - "items": { "$ref": "#/components/schemas/GitProject" } + "items": { + "$ref": "#/components/schemas/GitProject" + } } } } @@ -2298,126 +2829,38 @@ "description": "Unauthorized", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } - } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } } }, "500": { "description": "Service exception", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } - } - } - } - }, - "security": [{ "bearerAuth": [] }] - } - }, - "/api/v1/deployments": { - "get": { - "tags": ["Deployments"], - "summary": "List deployments", - "operationId": "listDeployments", - "parameters": [ - { - "name": "ioc_id", - "in": "query", - "description": "IOC ID", - "required": false, - "schema": { "type": "integer", "format": "int64" } - }, - { - "name": "host_csentry_id", - "in": "query", - "description": "Host CSEntry ID", - "required": false, - "schema": { "type": "integer", "format": "int64" } - }, - { - "name": "status", - "in": "query", - "description": "Status", - "required": false, - "schema": { - "type": "string", - "enum": ["QUEUED", "RUNNING", "SUCCESSFUL", "FAILED", "FINISHED"] - } - }, - { - "name": "user", - "in": "query", - "description": "User name", - "required": false, - "schema": { "type": "string" } - }, - { - "name": "query", - "in": "query", - "description": "Search text (Search for IOC name, Git reference, Created by)", - "required": false, - "schema": { "type": "string" } - }, - { - "name": "order_by", - "in": "query", - "description": "Order by", - "required": false, - "schema": { - "type": "string", - "enum": ["ID", "CREATED_BY", "TIME", "IOC_NAME", "GIT_REFERENCE"] - } - }, - { - "name": "order_asc", - "in": "query", - "description": "Order Ascending", - "required": false, - "schema": { "type": "boolean" } - }, - { - "name": "page", - "in": "query", - "description": "Page offset", - "required": false, - "schema": { "type": "integer", "format": "int32" } - }, - { - "name": "limit", - "in": "query", - "description": "Page size", - "required": false, - "schema": { "type": "integer", "format": "int32" } - } - ], - "responses": { - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } - } - } - }, - "200": { - "description": "A paged array of deployments", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedOperationResponse" + "$ref": "#/components/schemas/GeneralException" } } } }, - "500": { - "description": "Service exception", + "503": { + "description": "Git exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } - } + }, + "security": [ + { + "bearerAuth": [] + } + ] } }, "/api/v1/deployments/{deployment_id}": { @@ -2431,18 +2874,13 @@ "in": "path", "description": "Unique ID of deployment", "required": true, - "schema": { "type": "integer", "format": "int64" } + "schema": { + "type": "integer", + "format": "int64" + } } ], "responses": { - "404": { - "description": "Deployment not found", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } - } - } - }, "200": { "description": "A deployment with details", "content": { @@ -2457,7 +2895,19 @@ "description": "Unauthorized", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "404": { + "description": "Deployment not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, @@ -2465,7 +2915,9 @@ "description": "Service exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } @@ -2483,14 +2935,20 @@ "in": "query", "description": "IOC ID", "required": false, - "schema": { "type": "integer", "format": "int64" } + "schema": { + "type": "integer", + "format": "int64" + } }, { "name": "type", "in": "query", "description": "Type", "required": false, - "schema": { "type": "string", "enum": ["DEPLOYMENT", "COMMAND"] } + "schema": { + "type": "string", + "enum": ["DEPLOYMENT", "COMMAND"] + } }, { "name": "status", @@ -2499,7 +2957,14 @@ "required": false, "schema": { "type": "string", - "enum": ["QUEUED", "RUNNING", "SUCCESSFUL", "FAILED", "FINISHED"] + "enum": [ + "QUEUED", + "RUNNING", + "SUCCESSFUL", + "FAILED", + "FINISHED", + "ONGOING" + ] } }, { @@ -2507,14 +2972,56 @@ "in": "query", "description": "User name", "required": false, - "schema": { "type": "string" } + "schema": { + "type": "string" + } }, { "name": "query", "in": "query", "description": "Search text (Search for IOC name, Git reference, Created by)", "required": false, - "schema": { "type": "string" } + "schema": { + "type": "string" + } + }, + { + "name": "start_date", + "in": "query", + "description": "Start date", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "end_date", + "in": "query", + "description": "End date", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "time_zone", + "in": "query", + "description": "Time zone ID", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "host_csentry_id", + "in": "query", + "description": "CSEntry ID for the host", + "required": false, + "schema": { + "type": "string" + } }, { "name": "order_by", @@ -2531,38 +3038,48 @@ "in": "query", "description": "Order Ascending", "required": false, - "schema": { "type": "boolean" } + "schema": { + "type": "boolean" + } }, { "name": "page", "in": "query", "description": "Page offset", "required": false, - "schema": { "type": "integer", "format": "int32" } + "schema": { + "type": "integer", + "format": "int32" + } }, { "name": "limit", "in": "query", "description": "Page size", "required": false, - "schema": { "type": "integer", "format": "int32" } + "schema": { + "type": "integer", + "format": "int32" + } } ], "responses": { - "401": { - "description": "Unauthorized", + "200": { + "description": "A paged array of deployments", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/PagedOperationResponse" + } } } }, - "200": { - "description": "A paged array of deployments", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedOperationResponse" + "$ref": "#/components/schemas/GeneralException" } } } @@ -2571,7 +3088,9 @@ "description": "Service exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } @@ -2589,31 +3108,40 @@ "in": "path", "description": "Unique ID of operation", "required": true, - "schema": { "type": "integer", "format": "int64" } + "schema": { + "type": "integer", + "format": "int64" + } } ], "responses": { - "404": { - "description": "Not found", + "200": { + "description": "Operation details", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/OperationDetails" + } } } }, - "200": { - "description": "Operation details", + "401": { + "description": "Unauthorized", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/OperationDetails" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "401": { - "description": "Unauthorized", + "404": { + "description": "Not found", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, @@ -2621,7 +3149,9 @@ "description": "Service exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } @@ -2639,23 +3169,20 @@ "in": "path", "description": "Unique ID of AWX job", "required": true, - "schema": { "type": "integer", "format": "int64" } + "schema": { + "type": "integer", + "format": "int64" + } } ], "responses": { - "404": { - "description": "AWX job not found", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } - } - } - }, "200": { "description": "AWX job details", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/AwxJobDetails" } + "schema": { + "$ref": "#/components/schemas/AwxJobDetails" + } } } }, @@ -2663,15 +3190,19 @@ "description": "Unauthorized", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "503": { - "description": "Remote service exception", + "404": { + "description": "AWX job not found", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, @@ -2679,7 +3210,19 @@ "description": "Service exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "503": { + "description": "Remote service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } @@ -2697,15 +3240,20 @@ "in": "path", "description": "Unique ID of AWX job", "required": true, - "schema": { "type": "integer", "format": "int64" } + "schema": { + "type": "integer", + "format": "int64" + } } ], "responses": { - "404": { - "description": "Deployment not found", + "200": { + "description": "AWX job log", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/AwxJobLog" + } } } }, @@ -2713,236 +3261,51 @@ "description": "Unauthorized", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "503": { - "description": "Remote service exception", + "404": { + "description": "Deployment not found", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "200": { - "description": "AWX job log", + "500": { + "description": "Service exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/AwxJobLog" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "500": { - "description": "Service exception", + "503": { + "description": "Remote service exception", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } }, - "security": [{ "bearerAuth": [] }] + "security": [ + { + "bearerAuth": [] + } + ] } }, - "/api/v1/deployments/commands": { - "get": { - "tags": ["Deployments"], - "summary": "Get ad-hoc command list for a specific deployment", - "operationId": "listCommands", - "parameters": [ - { - "name": "ioc_id", - "in": "query", - "description": "Unique ID of IOC", - "required": false, - "schema": { "type": "integer", "format": "int64" } - }, - { - "name": "deployment_id", - "in": "query", - "description": "Unique ID of deployment", - "required": false, - "schema": { "type": "integer", "format": "int64" } - }, - { - "name": "page", - "in": "query", - "description": "Page offset", - "required": false, - "schema": { "type": "integer", "format": "int32" } - }, - { - "name": "limit", - "in": "query", - "description": "Page size", - "required": false, - "schema": { "type": "integer", "format": "int32" } - } - ], - "responses": { - "404": { - "description": "Deployment not found", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } - } - } - }, - "200": { - "description": "A command with details", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedCommandResponse" - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } - } - } - }, - "503": { - "description": "Remote service exception", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } - } - } - }, - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } - } - } - } - } - } - }, - "/api/v1/deployments/commands/{command_id}": { - "get": { - "tags": ["Deployments"], - "summary": "Get ad-hoc command", - "operationId": "fetchCommand", - "parameters": [ - { - "name": "command_id", - "in": "path", - "description": "Unique ID of command", - "required": true, - "schema": { "type": "integer", "format": "int64" } - } - ], - "responses": { - "200": { - "description": "A command descriptor", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/AdHocCommand" } - } - } - }, - "404": { - "description": "Ad-hoc command not found", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } - } - } - }, - "503": { - "description": "Remote service exception", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } - } - } - }, - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } - } - } - } - } - } - }, - "/api/v1/deployments/commands/ongoing/{ioc_id}": { - "get": { - "tags": ["Deployments"], - "summary": "Get list of ongoing ad-hoc commands for a specific IOC", - "operationId": "ongoingCommandByIoc", - "parameters": [ - { - "name": "ioc_id", - "in": "path", - "description": "Unique ID of the IOC", - "required": true, - "schema": { "type": "integer", "format": "int64" } - } - ], - "responses": { - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } - } - } - }, - "503": { - "description": "Remote service exception", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } - } - } - }, - "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" } - } - } - }, - "200": { - "description": "Ongoing command (if exists)", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/AdHocCommand" } - } - } - } - } - } - }, - "/api/v1/broadcasts/announcements": { + "/api/v1/broadcasts/announcements": { "get": { "tags": ["Broadcasts"], "summary": "Get announcements", @@ -2952,7 +3315,9 @@ "description": "Announcements text", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/Announcements" } + "schema": { + "$ref": "#/components/schemas/Announcements" + } } } }, @@ -2960,7 +3325,9 @@ "description": "Unauthorized", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } @@ -2979,52 +3346,71 @@ "in": "query", "description": "User name query", "required": false, - "schema": { "type": "string" } + "schema": { + "type": "string" + } } ], "responses": { - "503": { - "description": "Login server unavailable", + "200": { + "description": "Ok", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "type": "array", + "items": { + "type": "string" + } + } } } }, - "404": { - "description": "Role not found by authorization service", + "401": { + "description": "Unauthorized", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "401": { - "description": "Unauthorized", + "404": { + "description": "Role not found by authorization service", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "200": { - "description": "Ok", + "500": { + "description": "Service exception", "content": { "application/json": { - "schema": { "type": "array", "items": { "type": "string" } } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "500": { - "description": "Service exception", + "503": { + "description": "Login server unavailable", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } }, - "security": [{ "bearerAuth": [] }] + "security": [ + { + "bearerAuth": [] + } + ] } }, "/api/v1/authentication/roles": { @@ -3034,48 +3420,65 @@ "description": "Get user roles from authorization service", "operationId": "getUserRoles", "responses": { - "503": { - "description": "Login server unavailable", + "200": { + "description": "Ok", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "type": "array", + "items": { + "type": "string" + } + } } } }, - "403": { - "description": "Permission denied", + "401": { + "description": "Unauthorized", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Permission denied", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "200": { - "description": "Ok", + "500": { + "description": "Service exception", "content": { "application/json": { - "schema": { "type": "array", "items": { "type": "string" } } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } }, - "500": { - "description": "Service exception", + "503": { + "description": "Login server unavailable", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } }, - "security": [{ "bearerAuth": [] }] + "security": [ + { + "bearerAuth": [] + } + ] } }, "/api/v1/authentication/logout": { @@ -3085,30 +3488,42 @@ "description": "Logging out the user", "operationId": "logout", "responses": { - "503": { - "description": "Login server unavailable or remote error", + "200": { + "description": "Ok", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "type": "object" + } } } }, - "200": { - "description": "Ok", + "500": { + "description": "Service exception", "content": { - "application/json": { "schema": { "type": "object" } } + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } } }, - "500": { - "description": "Service exception", + "503": { + "description": "Login server unavailable or remote error", "content": { "application/json": { - "schema": { "$ref": "#/components/schemas/GeneralException" } + "schema": { + "$ref": "#/components/schemas/GeneralException" + } } } } }, - "security": [{ "bearerAuth": [] }] + "security": [ + { + "bearerAuth": [] + } + ] } } }, @@ -3117,28 +3532,72 @@ "GeneralException": { "type": "object", "properties": { - "error": { "type": "string" }, - "description": { "type": "string" } + "error": { + "type": "string" + }, + "description": { + "type": "string" + } } }, "Deployment": { "type": "object", "properties": { - "id": { "type": "integer", "format": "int64" }, - "createdBy": { "type": "string" }, - "startDate": { "type": "string", "format": "date-time" }, - "createdAt": { "type": "string", "format": "date-time" }, - "undeployment": { "type": "boolean" }, - "namingName": { "type": "string" }, - "gitProjectId": { "type": "integer", "format": "int64" }, - "sourceVersion": { "type": "string" }, - "endDate": { "type": "string", "format": "date-time" }, - "comment": { "type": "string" }, - "iocName": { "type": "string" }, - "host": { "$ref": "#/components/schemas/Host" }, - "awxJobId": { "type": "integer", "format": "int64" }, - "sourceUrl": { "type": "string" }, - "sourceVersionShort": { "type": "string" }, + "id": { + "type": "integer", + "format": "int64" + }, + "createdBy": { + "type": "string" + }, + "startDate": { + "type": "string", + "format": "date-time" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "undeployment": { + "type": "boolean" + }, + "namingName": { + "type": "string" + }, + "gitProjectId": { + "type": "integer", + "format": "int64" + }, + "sourceVersion": { + "type": "string" + }, + "operationId": { + "type": "integer", + "format": "int64" + }, + "endDate": { + "type": "string", + "format": "date-time" + }, + "comment": { + "type": "string" + }, + "iocName": { + "type": "string" + }, + "host": { + "$ref": "#/components/schemas/Host" + }, + "awxJobId": { + "type": "integer", + "format": "int64" + }, + "sourceUrl": { + "type": "string" + }, + "sourceVersionShort": { + "type": "string" + }, "operationStatus": { "type": "string", "enum": ["UNKNOWN", "QUEUED", "RUNNING", "FAILED", "SUCCESSFUL"] @@ -3148,290 +3607,523 @@ "Host": { "type": "object", "properties": { - "csEntryId": { "type": "integer", "format": "int64" }, - "csEntryIdValid": { "type": "boolean" }, - "fqdn": { "type": "string" }, - "hostName": { "type": "string" }, - "network": { "type": "string" } + "csEntryId": { + "type": "integer", + "format": "int64" + }, + "csEntryIdValid": { + "type": "boolean" + }, + "fqdn": { + "type": "string" + }, + "hostName": { + "type": "string" + }, + "network": { + "type": "string" + } } }, "UpdateHostRequest": { "type": "object", "properties": { - "hostCSEntryId": { "type": "integer", "format": "int64" }, - "comment": { "type": "string" } + "hostCSEntryId": { + "type": "integer", + "format": "int64" + }, + "comment": { + "type": "string" + } }, "description": "IOC to update" }, "Alert": { "type": "object", "properties": { - "type": { "type": "string", "enum": ["ERROR", "WARNING", "INFO"] }, - "message": { "type": "string" }, - "link": { "type": "string" } + "type": { + "type": "string", + "enum": ["ERROR", "WARNING", "INFO"] + }, + "message": { + "type": "string" + }, + "link": { + "type": "string" + } } }, "Ioc": { "type": "object", "properties": { - "id": { "type": "integer", "format": "int64" }, - "description": { "type": "string" }, - "owner": { "type": "string" }, - "namingName": { "type": "string" }, - "namingUuid": { "type": "string" }, - "gitProjectId": { "type": "integer", "format": "int64" }, - "sourceUrl": { "type": "string" }, - "activeDeployment": { "$ref": "#/components/schemas/Deployment" }, + "id": { + "type": "integer", + "format": "int64" + }, + "description": { + "type": "string" + }, + "createdBy": { + "type": "string" + }, + "namingName": { + "type": "string" + }, + "namingUuid": { + "type": "string" + }, + "gitProjectId": { + "type": "integer", + "format": "int64" + }, + "sourceUrl": { + "type": "string" + }, + "activeDeployment": { + "$ref": "#/components/schemas/Deployment" + }, "alerts": { "type": "array", - "items": { "$ref": "#/components/schemas/Alert" } + "items": { + "$ref": "#/components/schemas/Alert" + } }, - "active": { "type": "boolean" } + "active": { + "type": "boolean" + } } }, "CreateIoc": { "type": "object", "properties": { - "namingUuid": { "type": "string" }, - "gitProjectId": { "type": "integer", "format": "int64" } + "namingUuid": { + "type": "string" + }, + "gitProjectId": { + "type": "integer", + "format": "int64" + } }, "description": "IOC to create" }, "Undeployment": { "type": "object", - "properties": { "comment": { "type": "string" } }, + "properties": { + "comment": { + "type": "string" + } + }, "description": "Undeployment parameters" }, - "AdHocCommand": { + "DeploymentHostInfo": { + "type": "object", + "properties": { + "externalHostId": { + "type": "integer", + "format": "int64" + }, + "hostName": { + "type": "string" + }, + "network": { + "type": "string" + }, + "hostInfoFromCache": { + "type": "boolean" + } + } + }, + "Operation": { "type": "object", "properties": { - "id": { "type": "integer", "format": "int64" }, + "id": { + "type": "integer", + "format": "int64" + }, + "createdBy": { + "type": "string" + }, + "startTime": { + "type": "string", + "format": "date-time" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, "type": { "type": "string", "enum": ["DEPLOY", "UNDEPLOY", "START", "STOP"] }, - "createdBy": { "type": "string" }, - "startDate": { "type": "string", "format": "date-time" }, - "endDate": { "type": "string", "format": "date-time" }, + "iocName": { + "type": "string" + }, + "iocId": { + "type": "integer", + "format": "int64" + }, + "deploymentId": { + "type": "integer", + "format": "int64" + }, + "gitProjectId": { + "type": "integer", + "format": "int64" + }, + "gitReference": { + "type": "string" + }, "status": { "type": "string", "enum": ["UNKNOWN", "QUEUED", "RUNNING", "FAILED", "SUCCESSFUL"] }, - "iocName": { "type": "string" }, - "awxCommandId": { "type": "integer", "format": "int64" } + "host": { + "$ref": "#/components/schemas/DeploymentHostInfo" + } } }, "UpdateAndDeployIoc": { "type": "object", "properties": { - "comment": { "type": "string" }, - "sourceVersion": { "type": "string" }, - "hostCSEntryId": { "type": "integer", "format": "int64" } + "comment": { + "type": "string" + }, + "sourceVersion": { + "type": "string" + }, + "hostCSEntryId": { + "type": "integer", + "format": "int64" + } }, "description": "IOC to update" }, - "AwxJobMeta": { + "LoginResponse": { "type": "object", "properties": { - "id": { "type": "integer", "format": "int64" }, - "started": { "type": "string", "format": "date-time" }, - "finished": { "type": "string", "format": "date-time" }, - "status": { - "type": "string", - "enum": [ - "UNKNOWN", - "CREATED", - "QUEUED_BY_BACKEND", - "new", - "pending", - "waiting", - "running", - "failed", - "canceled", - "error", - "successful" - ] + "token": { + "type": "string" } - }, - "description": "Job to update" - }, - "LoginResponse": { - "type": "object", - "properties": { "token": { "type": "string" } } + } }, "Login": { "type": "object", "properties": { - "userName": { "type": "string" }, - "password": { "type": "string" } + "userName": { + "type": "string" + }, + "password": { + "type": "string" + } } }, "IOCUpdateRequest": { "type": "object", "properties": { - "owner": { "type": "string" }, - "namingUuid": { "type": "string" }, - "gitProjectId": { "type": "integer", "format": "int64" } + "namingUuid": { + "type": "string" + }, + "gitProjectId": { + "type": "integer", + "format": "int64" + } } }, "PersonalStatisticsResponse": { "type": "object", "properties": { - "numberOfActiveIocs": { "type": "integer", "format": "int64" } + "numberOfActiveIocs": { + "type": "integer", + "format": "int64" + } } }, "DbStatistics": { "type": "object", "properties": { - "numberOfCreatedIocs": { "type": "integer", "format": "int64" }, - "numberOfActiveDeployments": { "type": "integer", "format": "int64" }, + "numberOfCreatedIocs": { + "type": "integer", + "format": "int64" + }, + "numberOfActiveDeployments": { + "type": "integer", + "format": "int64" + }, "numberOfIocHostsWithIocsDeployed": { "type": "integer", "format": "int64" }, - "numberOfDeployments": { "type": "integer", "format": "int64" } + "numberOfDeployments": { + "type": "integer", + "format": "int64" + } } }, "GeneralStatisticsResponse": { "type": "object", "properties": { - "dbStatistics": { "$ref": "#/components/schemas/DbStatistics" }, + "dbStatistics": { + "$ref": "#/components/schemas/DbStatistics" + }, "networkMonitoring": { "$ref": "#/components/schemas/NetworkMonitoring" }, "networkScopesIocCount": { "type": "object", - "additionalProperties": { "type": "integer", "format": "int32" } + "additionalProperties": { + "type": "integer", + "format": "int32" + } } } }, "NetworkMonitoring": { "type": "object", "properties": { - "numberOfActiveIocs": { "type": "integer", "format": "int64" }, - "numberOfActiveHosts": { "type": "integer", "format": "int64" }, + "numberOfActiveIocs": { + "type": "integer", + "format": "int64" + }, + "numberOfActiveHosts": { + "type": "integer", + "format": "int64" + }, "numberOfIocHostsOnTechnicalNetwork": { "type": "integer", "format": "int64" }, - "numberOfHostsWithIssue": { "type": "integer", "format": "int64" } + "numberOfHostsWithIssue": { + "type": "integer", + "format": "int64" + } } }, - "DeploymentCount": { + "StatisticResponse": { "type": "object", "properties": { - "iocCount": { "type": "integer", "format": "int64" }, - "countingDate": { "type": "string", "format": "date-time" } + "value": { + "type": "integer", + "format": "int64" + }, + "statisticType": { + "type": "string", + "enum": [ + "HOSTS_REGISTERED", + "HOSTS_WITH_IOCS", + "HOSTS_REACHABLE", + "HOSTS_WITHOUT_ISSUE", + "IOCS_REGISTERED", + "IOCS_DEPLOYED", + "IOCS_RUNNING", + "IOCS_RUNNING_WITHOUT_ISSUE" + ] + } } }, - "DeploymentOnHost": { + "OperationStatistic": { "type": "object", "properties": { - "network": { "type": "string" }, - "deployments": { - "type": "array", - "items": { "$ref": "#/components/schemas/DeploymentCount" } + "deploymentCount": { + "type": "integer", + "format": "int64" + }, + "commandCount": { + "type": "integer", + "format": "int64" + }, + "historyDate": { + "type": "string", + "format": "date-time" } } }, - "IocStatisticsResponse": { + "OperationStatisticsResponse": { "type": "object", "properties": { - "numOfRegisteredIocs": { "type": "integer", "format": "int64" }, - "numOfDeployedIocs": { "type": "integer", "format": "int64" }, - "numOfReachableIocs": { "type": "integer", "format": "int64" }, - "numOfIssueFreeIocs": { "type": "integer", "format": "int64" } + "operationStatistics": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OperationStatistic" + } + } } }, - "HostStatisticsResponse": { + "DeploymentCount": { "type": "object", "properties": { - "numOfIocHosts": { "type": "integer", "format": "int64" }, - "numOfHostsWithIocs": { "type": "integer", "format": "int64" }, - "numOfReachableHostsWithIocs": { + "iocCount": { "type": "integer", "format": "int64" }, - "numOfIssueFreeHostsWithIocs": { - "type": "integer", - "format": "int64" + "countingDate": { + "type": "string", + "format": "date-time" + } + } + }, + "DeploymentOnHost": { + "type": "object", + "properties": { + "network": { + "type": "string" + }, + "deployments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DeploymentCount" + } } } }, "DeploymentStatisticsResponse": { "type": "object", "properties": { - "deploymentDate": { "type": "string", "format": "date-time" }, - "numberOfDeployments": { "type": "integer", "format": "int64" }, - "successfulDeployments": { "type": "integer", "format": "int64" } + "deploymentDate": { + "type": "string", + "format": "date-time" + }, + "numberOfDeployments": { + "type": "integer", + "format": "int64" + }, + "successfulDeployments": { + "type": "integer", + "format": "int64" + } } }, "ActiveIOCSForHistoryResponse": { "type": "object", "properties": { - "iocCount": { "type": "integer", "format": "int64" }, - "historyDate": { "type": "string", "format": "date-time" } + "iocCount": { + "type": "integer", + "format": "int64" + }, + "historyDate": { + "type": "string", + "format": "date-time" + } } }, "ActiveIocStatisticsResponse": { "type": "object", "properties": { - "network": { "type": "string" }, - "iocCount": { "type": "integer", "format": "int64" } + "network": { + "type": "string" + }, + "iocCount": { + "type": "integer", + "format": "int64" + } } }, "PagedRecordResponse": { "type": "object", "properties": { - "totalCount": { "type": "integer", "format": "int64" }, - "listSize": { "type": "integer", "format": "int32" }, - "pageNumber": { "type": "integer", "format": "int32" }, - "limit": { "type": "integer", "format": "int32" }, + "totalCount": { + "type": "integer", + "format": "int64" + }, + "listSize": { + "type": "integer", + "format": "int32" + }, + "pageNumber": { + "type": "integer", + "format": "int32" + }, + "limit": { + "type": "integer", + "format": "int32" + }, "recordList": { "type": "array", - "items": { "$ref": "#/components/schemas/Record" } + "items": { + "$ref": "#/components/schemas/Record" + } } } }, "Record": { "type": "object", "properties": { - "name": { "type": "string" }, - "iocName": { "type": "string" }, - "hostName": { "type": "string" }, - "pvStatus": { "type": "string", "enum": ["ACTIVE", "INACTIVE"] }, - "iocVersion": { "type": "string" } + "name": { + "type": "string" + }, + "iocName": { + "type": "string" + }, + "hostName": { + "type": "string" + }, + "pvStatus": { + "type": "string", + "enum": ["ACTIVE", "INACTIVE"] + }, + "iocVersion": { + "type": "string" + } } }, "RecordDetails": { "type": "object", "properties": { - "name": { "type": "string" }, - "iocName": { "type": "string" }, - "hostName": { "type": "string" }, - "pvStatus": { "type": "string", "enum": ["ACTIVE", "INACTIVE"] }, - "iocVersion": { "type": "string" }, - "iocId": { "type": "integer", "format": "int64" }, - "hostCSentryId": { "type": "integer", "format": "int64" }, + "name": { + "type": "string" + }, + "iocName": { + "type": "string" + }, + "hostName": { + "type": "string" + }, + "pvStatus": { + "type": "string", + "enum": ["ACTIVE", "INACTIVE"] + }, + "iocVersion": { + "type": "string" + }, + "iocId": { + "type": "integer", + "format": "int64" + }, + "hostCSentryId": { + "type": "integer", + "format": "int64" + }, "properties": { "type": "object", - "additionalProperties": { "type": "string" } + "additionalProperties": { + "type": "string" + } } } }, "NameResponse": { "type": "object", "properties": { - "uuid": { "type": "string" }, - "name": { "type": "string" }, - "description": { "type": "string" } + "uuid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + } } }, "LokiMessage": { "type": "object", "properties": { - "logDate": { "type": "string", "format": "date-time" }, - "logMessage": { "type": "string" } + "logDate": { + "type": "string", + "format": "date-time" + }, + "logMessage": { + "type": "string" + } } }, "LokiResponse": { @@ -3439,49 +4131,68 @@ "properties": { "lines": { "type": "array", - "items": { "$ref": "#/components/schemas/LokiMessage" } + "items": { + "$ref": "#/components/schemas/LokiMessage" + } + }, + "warning": { + "type": "string" } } }, "IocStatusResponse": { "type": "object", "properties": { - "iocId": { "type": "integer", "format": "int64" }, + "iocId": { + "type": "integer", + "format": "int64" + }, "alertSeverity": { "type": "string", "enum": ["ERROR", "WARNING", "INFO"] }, "alerts": { "type": "array", - "items": { "$ref": "#/components/schemas/Alert" } + "items": { + "$ref": "#/components/schemas/Alert" + } }, - "active": { "type": "boolean" } + "active": { + "type": "boolean" + } } }, "ActiveDeployment": { "type": "object", "properties": { - "host": { "$ref": "#/components/schemas/DeploymentHostInfo" }, - "sourceVersion": { "type": "string" }, - "sourceVersionShort": { "type": "string" } - } - }, - "DeploymentHostInfo": { - "type": "object", - "properties": { - "externalHostId": { "type": "integer", "format": "int64" }, - "hostName": { "type": "string" }, - "network": { "type": "string" }, - "hostInfoFromCache": { "type": "boolean" } + "host": { + "$ref": "#/components/schemas/DeploymentHostInfo" + }, + "sourceVersion": { + "type": "string" + }, + "sourceVersionShort": { + "type": "string" + } } }, "IocInfo": { "type": "object", "properties": { - "id": { "type": "integer", "format": "int64" }, - "namingName": { "type": "string" }, - "owner": { "type": "string" }, - "gitProjectId": { "type": "integer", "format": "int64" }, + "id": { + "type": "integer", + "format": "int64" + }, + "namingName": { + "type": "string" + }, + "createdBy": { + "type": "string" + }, + "gitProjectId": { + "type": "integer", + "format": "int64" + }, "activeDeployment": { "$ref": "#/components/schemas/ActiveDeployment" } @@ -3490,321 +4201,638 @@ "PagedIocResponse": { "type": "object", "properties": { - "totalCount": { "type": "integer", "format": "int64" }, - "listSize": { "type": "integer", "format": "int32" }, - "pageNumber": { "type": "integer", "format": "int32" }, - "limit": { "type": "integer", "format": "int32" }, + "totalCount": { + "type": "integer", + "format": "int64" + }, + "listSize": { + "type": "integer", + "format": "int32" + }, + "pageNumber": { + "type": "integer", + "format": "int32" + }, + "limit": { + "type": "integer", + "format": "int32" + }, "iocList": { "type": "array", - "items": { "$ref": "#/components/schemas/IocInfo" } + "items": { + "$ref": "#/components/schemas/IocInfo" + } } } }, "IocDetails": { "type": "object", "properties": { - "id": { "type": "integer", "format": "int64" }, - "description": { "type": "string" }, - "owner": { "type": "string" }, - "namingName": { "type": "string" }, - "namingUuid": { "type": "string" }, - "gitProjectId": { "type": "integer", "format": "int64" }, - "sourceUrl": { "type": "string" }, - "activeDeployment": { "$ref": "#/components/schemas/Deployment" }, + "id": { + "type": "integer", + "format": "int64" + }, + "description": { + "type": "string" + }, + "createdBy": { + "type": "string" + }, + "namingName": { + "type": "string" + }, + "namingUuid": { + "type": "string" + }, + "gitProjectId": { + "type": "integer", + "format": "int64" + }, + "sourceUrl": { + "type": "string" + }, + "activeDeployment": { + "$ref": "#/components/schemas/Deployment" + }, "alerts": { "type": "array", - "items": { "$ref": "#/components/schemas/Alert" } + "items": { + "$ref": "#/components/schemas/Alert" + } }, - "operationInProgress": { "type": "boolean" }, - "active": { "type": "boolean" } + "operationInProgress": { + "type": "boolean" + }, + "active": { + "type": "boolean" + } } }, "IocWithAlarm": { "type": "object", "properties": { - "id": { "type": "integer", "format": "int64" }, - "description": { "type": "string" }, - "owner": { "type": "string" }, - "namingName": { "type": "string" }, - "namingUuid": { "type": "string" }, - "gitProjectId": { "type": "integer", "format": "int64" }, - "sourceUrl": { "type": "string" }, - "activeDeployment": { "$ref": "#/components/schemas/Deployment" }, + "id": { + "type": "integer", + "format": "int64" + }, + "description": { + "type": "string" + }, + "createdBy": { + "type": "string" + }, + "namingName": { + "type": "string" + }, + "namingUuid": { + "type": "string" + }, + "gitProjectId": { + "type": "integer", + "format": "int64" + }, + "sourceUrl": { + "type": "string" + }, + "activeDeployment": { + "$ref": "#/components/schemas/Deployment" + }, "alerts": { "type": "array", - "items": { "$ref": "#/components/schemas/Alert" } + "items": { + "$ref": "#/components/schemas/Alert" + } + }, + "alertSeverity": { + "type": "string", + "enum": ["ERROR", "WARNING", "INFO"] }, - "alert": { "type": "string", "enum": ["ERROR", "WARNING", "INFO"] }, - "active": { "type": "boolean" } + "active": { + "type": "boolean" + } } }, "HostInfo": { "type": "object", "properties": { - "id": { "type": "integer", "format": "int64" }, - "fqdn": { "type": "string" }, - "name": { "type": "string" }, - "scope": { "type": "string" }, - "description": { "type": "string" }, - "network": { "type": "string" }, - "deviceType": { "type": "string" } + "id": { + "type": "integer", + "format": "int64" + }, + "fqdn": { + "type": "string" + }, + "name": { + "type": "string" + }, + "scope": { + "type": "string" + }, + "description": { + "type": "string" + }, + "network": { + "type": "string" + }, + "deviceType": { + "type": "string" + } } }, "HostInfoWithStatus": { "type": "object", "properties": { - "csEntryHost": { "$ref": "#/components/schemas/HostInfo" }, - "status": { "type": "string", "enum": ["AVAILABLE", "UNREACHABLE"] }, - "alert": { "type": "string", "enum": ["ERROR", "WARNING", "INFO"] }, - "iocDeployed": { "type": "boolean" } + "csEntryHost": { + "$ref": "#/components/schemas/HostInfo" + }, + "status": { + "type": "string", + "enum": ["AVAILABLE", "UNREACHABLE"] + }, + "alertSeverity": { + "type": "string", + "enum": ["ERROR", "WARNING", "INFO"] + }, + "iocDeployed": { + "type": "boolean" + } } }, "PagedCSEntryHostResponse": { "type": "object", "properties": { - "totalCount": { "type": "integer", "format": "int64" }, - "listSize": { "type": "integer", "format": "int32" }, - "pageNumber": { "type": "integer", "format": "int32" }, - "limit": { "type": "integer", "format": "int32" }, + "totalCount": { + "type": "integer", + "format": "int64" + }, + "listSize": { + "type": "integer", + "format": "int32" + }, + "pageNumber": { + "type": "integer", + "format": "int32" + }, + "limit": { + "type": "integer", + "format": "int32" + }, "csEntryHosts": { "type": "array", - "items": { "$ref": "#/components/schemas/HostInfoWithStatus" } + "items": { + "$ref": "#/components/schemas/HostInfoWithStatus" + } } } }, "CSEntryHost": { "type": "object", "properties": { - "id": { "type": "integer", "format": "int64" }, - "fqdn": { "type": "string" }, - "name": { "type": "string" }, - "scope": { "type": "string" }, - "description": { "type": "string" }, - "user": { "type": "string" }, + "id": { + "type": "integer", + "format": "int64" + }, + "fqdn": { + "type": "string" + }, + "name": { + "type": "string" + }, + "scope": { + "type": "string" + }, + "description": { + "type": "string" + }, + "user": { + "type": "string" + }, "interfaces": { "type": "array", - "items": { "$ref": "#/components/schemas/CSEntryInterface" } + "items": { + "$ref": "#/components/schemas/CSEntryInterface" + } + }, + "is_ioc": { + "type": "boolean" + }, + "device_type": { + "type": "string" + }, + "created_at": { + "type": "string", + "format": "date-time" }, - "is_ioc": { "type": "boolean" }, - "device_type": { "type": "string" }, - "created_at": { "type": "string", "format": "date-time" }, "ansible_vars": { "type": "object", - "additionalProperties": { "type": "object" } + "additionalProperties": { + "type": "object" + } }, - "ansible_groups": { "type": "array", "items": { "type": "string" } } + "ansible_groups": { + "type": "array", + "items": { + "type": "string" + } + } } }, "CSEntryHostWithStatus": { "type": "object", "properties": { - "csEntryHost": { "$ref": "#/components/schemas/CSEntryHost" }, - "assigned": { "type": "boolean" }, - "status": { "type": "string", "enum": ["AVAILABLE", "UNREACHABLE"] }, + "csEntryHost": { + "$ref": "#/components/schemas/CSEntryHost" + }, + "assigned": { + "type": "boolean" + }, + "status": { + "type": "string", + "enum": ["AVAILABLE", "UNREACHABLE"] + }, "alerts": { "type": "array", - "items": { "$ref": "#/components/schemas/Alert" } + "items": { + "$ref": "#/components/schemas/Alert" + } } } }, "CSEntryInterface": { "type": "object", "properties": { - "id": { "type": "integer", "format": "int64" }, - "name": { "type": "string" }, - "network": { "type": "string" }, - "domain": { "type": "string" }, - "ip": { "type": "string" }, - "mac": { "type": "string" }, - "host": { "type": "string" }, - "cnames": { "type": "array", "items": { "type": "string" } }, - "is_main": { "type": "boolean" } + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "network": { + "type": "string" + }, + "domain": { + "type": "string" + }, + "ip": { + "type": "string" + }, + "mac": { + "type": "string" + }, + "host": { + "type": "string" + }, + "cnames": { + "type": "array", + "items": { + "type": "string" + } + }, + "is_main": { + "type": "boolean" + } } }, "PagedAssociatedIocs": { "type": "object", "properties": { - "totalCount": { "type": "integer", "format": "int64" }, - "listSize": { "type": "integer", "format": "int32" }, - "pageNumber": { "type": "integer", "format": "int32" }, - "limit": { "type": "integer", "format": "int32" }, + "totalCount": { + "type": "integer", + "format": "int64" + }, + "listSize": { + "type": "integer", + "format": "int32" + }, + "pageNumber": { + "type": "integer", + "format": "int32" + }, + "limit": { + "type": "integer", + "format": "int32" + }, "deployedIocs": { "type": "array", - "items": { "$ref": "#/components/schemas/IocInfo" } + "items": { + "$ref": "#/components/schemas/IocInfo" + } } } }, "TargetHost": { "type": "object", "properties": { - "externalId": { "type": "integer", "format": "int64" }, - "fqdn": { "type": "string" }, - "hostName": { "type": "string" }, - "network": { "type": "string" } + "externalId": { + "type": "integer", + "format": "int64" + }, + "fqdn": { + "type": "string" + }, + "hostName": { + "type": "string" + }, + "network": { + "type": "string" + } } }, "IdUsedByIoc": { "type": "object", - "properties": { "iocId": { "type": "integer", "format": "int64" } } + "properties": { + "iocId": { + "type": "integer", + "format": "int64" + } + } }, "GitReference": { "type": "object", "properties": { - "reference": { "type": "string" }, - "shortReference": { "type": "string" }, - "description": { "type": "string" }, - "commitDate": { "type": "string", "format": "date-time" } + "reference": { + "type": "string" + }, + "shortReference": { + "type": "string" + }, + "description": { + "type": "string" + }, + "commitDate": { + "type": "string", + "format": "date-time" + } } }, "UserInfoResponse": { "type": "object", "properties": { - "fullName": { "type": "string" }, - "loginName": { "type": "string" }, - "avatar": { "type": "string" }, - "email": { "type": "string" }, - "gitlabUserName": { "type": "string" } + "fullName": { + "type": "string" + }, + "loginName": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "email": { + "type": "string" + }, + "gitlabUserName": { + "type": "string" + } } }, "GitProject": { "type": "object", "properties": { - "id": { "type": "integer", "format": "int64" }, - "url": { "type": "string" } + "id": { + "type": "integer", + "format": "int64" + }, + "url": { + "type": "string" + } } }, - "Operation": { + "DeploymentInfoDetails": { "type": "object", "properties": { - "id": { "type": "integer", "format": "int64" }, - "createdBy": { "type": "string" }, - "startTime": { "type": "string", "format": "date-time" }, - "createdAt": { "type": "string", "format": "date-time" }, - "type": { + "id": { + "type": "integer", + "format": "int64" + }, + "createdBy": { + "type": "string" + }, + "startDate": { "type": "string", - "enum": ["DEPLOY", "UNDEPLOY", "START", "STOP"] + "format": "date-time" }, - "iocName": { "type": "string" }, - "iocId": { "type": "integer", "format": "int64" }, - "deploymentId": { "type": "integer", "format": "int64" }, - "gitProjectId": { "type": "integer", "format": "int64" }, - "gitReference": { "type": "string" }, - "host": { "$ref": "#/components/schemas/DeploymentHostInfo" }, - "status": { + "createdAt": { "type": "string", - "enum": ["UNKNOWN", "QUEUED", "RUNNING", "FAILED", "SUCCESSFUL"] + "format": "date-time" + }, + "undeployment": { + "type": "boolean" + }, + "namingName": { + "type": "string" + }, + "gitProjectId": { + "type": "integer", + "format": "int64" + }, + "sourceVersion": { + "type": "string" + }, + "operationId": { + "type": "integer", + "format": "int64" + }, + "endDate": { + "type": "string", + "format": "date-time" + }, + "comment": { + "type": "string" + }, + "host": { + "$ref": "#/components/schemas/HostWithFqdn" + }, + "awxJobId": { + "type": "integer", + "format": "int64" + }, + "iocId": { + "type": "integer", + "format": "int64" + }, + "awxJobUrl": { + "type": "string" + }, + "sourceUrl": { + "type": "string" + }, + "sourceVersionShort": { + "type": "string" + }, + "alerts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Alert" + } } } }, - "PagedOperationResponse": { + "HostWithFqdn": { "type": "object", "properties": { - "totalCount": { "type": "integer", "format": "int64" }, - "listSize": { "type": "integer", "format": "int32" }, - "pageNumber": { "type": "integer", "format": "int32" }, - "limit": { "type": "integer", "format": "int32" }, - "operations": { - "type": "array", - "items": { "$ref": "#/components/schemas/Operation" } + "csEntryId": { + "type": "integer", + "format": "int64" + }, + "csEntryIdValid": { + "type": "boolean" + }, + "fqdn": { + "type": "string" } } }, - "DeploymentInfoDetails": { + "PagedOperationResponse": { "type": "object", "properties": { - "id": { "type": "integer", "format": "int64" }, - "createdBy": { "type": "string" }, - "startDate": { "type": "string", "format": "date-time" }, - "createdAt": { "type": "string", "format": "date-time" }, - "undeployment": { "type": "boolean" }, - "namingName": { "type": "string" }, - "gitProjectId": { "type": "integer", "format": "int64" }, - "sourceVersion": { "type": "string" }, - "endDate": { "type": "string", "format": "date-time" }, - "comment": { "type": "string" }, - "host": { "$ref": "#/components/schemas/HostWithFqdn" }, - "awxJobId": { "type": "integer", "format": "int64" }, - "iocId": { "type": "integer", "format": "int64" }, - "awxJobUrl": { "type": "string" }, - "sourceUrl": { "type": "string" }, - "sourceVersionShort": { "type": "string" }, - "alerts": { + "totalCount": { + "type": "integer", + "format": "int64" + }, + "listSize": { + "type": "integer", + "format": "int32" + }, + "pageNumber": { + "type": "integer", + "format": "int32" + }, + "limit": { + "type": "integer", + "format": "int32" + }, + "operations": { "type": "array", - "items": { "$ref": "#/components/schemas/Alert" } + "items": { + "$ref": "#/components/schemas/Operation" + } } } }, - "HostWithFqdn": { - "type": "object", - "properties": { - "csEntryId": { "type": "integer", "format": "int64" }, - "csEntryIdValid": { "type": "boolean" }, - "fqdn": { "type": "string" } - } - }, "OperationDetails": { "type": "object", "properties": { - "id": { "type": "integer", "format": "int64" }, - "createdBy": { "type": "string" }, - "startTime": { "type": "string", "format": "date-time" }, - "createdAt": { "type": "string", "format": "date-time" }, + "id": { + "type": "integer", + "format": "int64" + }, + "createdBy": { + "type": "string" + }, + "startTime": { + "type": "string", + "format": "date-time" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, "type": { "type": "string", "enum": ["DEPLOY", "UNDEPLOY", "START", "STOP"] }, - "iocName": { "type": "string" }, - "iocId": { "type": "integer", "format": "int64" }, - "deploymentId": { "type": "integer", "format": "int64" }, - "gitProjectId": { "type": "integer", "format": "int64" }, - "gitReference": { "type": "string" }, - "gitProjectUrl": { "type": "string" }, - "gitShortReference": { "type": "string" }, - "host": { "$ref": "#/components/schemas/HostWithFqdn" }, - "awxJobId": { "type": "integer", "format": "int64" }, - "awxJobUrl": { "type": "string" } + "iocName": { + "type": "string" + }, + "iocId": { + "type": "integer", + "format": "int64" + }, + "deploymentId": { + "type": "integer", + "format": "int64" + }, + "gitProjectId": { + "type": "integer", + "format": "int64" + }, + "gitReference": { + "type": "string" + }, + "status": { + "type": "string", + "enum": ["UNKNOWN", "QUEUED", "RUNNING", "FAILED", "SUCCESSFUL"] + }, + "gitProjectUrl": { + "type": "string" + }, + "gitShortReference": { + "type": "string" + }, + "host": { + "$ref": "#/components/schemas/HostWithFqdn" + }, + "awxJobId": { + "type": "integer", + "format": "int64" + }, + "awxJobUrl": { + "type": "string" + }, + "alerts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Alert" + } + }, + "comment": { + "type": "string" + } } }, "AwxJobDetails": { "type": "object", "properties": { - "id": { "type": "integer", "format": "int64" }, + "id": { + "type": "integer", + "format": "int64" + }, "status": { "type": "string", "enum": ["UNKNOWN", "QUEUED", "RUNNING", "FAILED", "SUCCESSFUL"] }, - "started": { "type": "string", "format": "date-time" }, - "finished": { "type": "string", "format": "date-time" } + "started": { + "type": "string", + "format": "date-time" + }, + "finished": { + "type": "string", + "format": "date-time" + } } }, "AwxJobLog": { "type": "object", "properties": { - "awxJobId": { "type": "integer", "format": "int64" }, - "stdoutHtml": { "type": "string" }, - "elapsed": { "type": "number", "format": "double" } + "awxJobId": { + "type": "integer", + "format": "int64" + }, + "stdoutHtml": { + "type": "string" + }, + "elapsed": { + "type": "number", + "format": "double" + } } }, - "PagedCommandResponse": { + "Announcements": { "type": "object", "properties": { - "totalCount": { "type": "integer", "format": "int64" }, - "listSize": { "type": "integer", "format": "int32" }, - "pageNumber": { "type": "integer", "format": "int32" }, - "limit": { "type": "integer", "format": "int32" }, - "commands": { - "type": "array", - "items": { "$ref": "#/components/schemas/Operation" } + "announcementsText": { + "type": "string" } } - }, - "Announcements": { - "type": "object", - "properties": { "announcementsText": { "type": "string" } } } }, "securitySchemes": { - "apiKey": { "type": "apiKey", "name": "CCCE-TOKEN", "in": "header" }, + "apiKey": { + "type": "apiKey", + "name": "CCCE-TOKEN", + "in": "header" + }, "bearerAuth": { "type": "http", "scheme": "bearer", diff --git a/src/views/IOC/IOCListView.js b/src/views/IOC/IOCListView.js index 7f506a6a..300c4d8f 100644 --- a/src/views/IOC/IOCListView.js +++ b/src/views/IOC/IOCListView.js @@ -1,17 +1,8 @@ -import { - Container, - Grid, - Paper, - FormControlLabel, - Switch, - Typography, - Tabs, - Tab -} from "@mui/material"; +import { Container, Grid, Paper, Typography, Tabs, Tab } from "@mui/material"; import { styled } from "@mui/material/styles"; import { RootContainer } from "../../components/common/Container/RootContainer"; import React, { useState, useEffect, useContext, useCallback } from "react"; -import { GlobalAppBarContext, userContext } from "@ess-ics/ce-ui-common"; +import { GlobalAppBarContext } from "@ess-ics/ce-ui-common"; import { IOCAsyncList } from "../../components/IOC/IOCAsyncList"; import { useIOCSearch } from "../../api/SwaggerApi"; import { @@ -19,7 +10,6 @@ import { initRequestParams } from "../../components/common/Helper"; import { SearchBar } from "../../components/common/SearchBar/SearchBar"; -import AccessControl from "../../components/auth/AccessControl"; import useUrlState from "@ahooksjs/use-url-state"; import { serialize, @@ -45,7 +35,6 @@ export function IOCListView() { const [state, setState] = useUrlState( { tab: "0", - own: "false", rows: "20", page: "0", query: "" @@ -54,7 +43,6 @@ export function IOCListView() { ); const [deploymentStatus, setDeploymentStatus] = useState("ALL"); - const { user } = useContext(userContext); const handleTabChange = useCallback( (tab) => { @@ -96,11 +84,6 @@ export function IOCListView() { [setState] ); - const handleChangeOwn = (event) => { - const own = event.target.checked; - setState({ own: serialize(own), page: "0" }); - }; - const rowsPerPage = [20, 50]; useEffect(() => { @@ -113,14 +96,10 @@ export function IOCListView() { deserialize(state.query) ); - if (deserialize(state.own)) { - requestParams.owner = user?.loginName; - } - requestParams.deployment_status = deploymentStatus; getIocs(requestParams); - }, [getIocs, lazyParams, user, state, deploymentStatus]); + }, [getIocs, lazyParams, state, deploymentStatus]); const { setTitle } = useContext(GlobalAppBarContext); useEffect(() => setTitle(applicationTitle("IOCs")), [setTitle]); @@ -137,7 +116,7 @@ export function IOCListView() { search={setSearch} query={deserialize(state.query)} loading={loading} - placeholder="Search in IOC name or user" + placeholder="Search in IOC name" > <IOCAsyncList iocs={iocList} @@ -183,26 +162,6 @@ export function IOCListView() { /> </Tabs> </Grid> - <Grid item> - <AccessControl - allowedRoles={[ - "DeploymentToolAdmin", - "DeploymentToolIntegrator" - ]} - renderNoAccess={() => <></>} - > - <FormControlLabel - className={classes.formControl} - control={ - <Switch - checked={deserialize(state.own)} - onChange={handleChangeOwn} - /> - } - label={<Typography variant="h5">Only my IOCs</Typography>} - /> - </AccessControl> - </Grid> </Grid> <Grid item diff --git a/src/views/host/HostListView.js b/src/views/host/HostListView.js index 5ee17904..9a1cc77c 100644 --- a/src/views/host/HostListView.js +++ b/src/views/host/HostListView.js @@ -13,8 +13,6 @@ import { Tabs, Tab, Typography, - FormControlLabel, - Switch, useMediaQuery } from "@mui/material"; import { RootContainer } from "../../components/common/Container/RootContainer"; @@ -28,7 +26,6 @@ import { transformHostQuery } from "../../components/common/Helper"; import { SearchBar } from "../../components/common/SearchBar/SearchBar"; -import AccessControl from "../../components/auth/AccessControl"; import useUrlState from "@ahooksjs/use-url-state"; import { serialize, @@ -48,8 +45,6 @@ const StyledRootContainer = styled(RootContainer)(({ theme }) => ({ } })); -const NoAccess = () => <></>; - export function HostListView() { const { setTitle } = useContext(GlobalAppBarContext); useEffect(() => setTitle(applicationTitle("IOC hosts")), [setTitle]); @@ -58,7 +53,6 @@ export function HostListView() { const [urlState, setUrlState] = useUrlState( { tab: "0", - own: "false", rows: "20", page: "0", query: "" @@ -85,8 +79,6 @@ export function HostListView() { [setUrlState] ); - const hideOwnSlider = deserialize(urlState.tab) === 2; - const handleTabChange = useCallback( (event, tab) => { setUrlState((s) => @@ -114,14 +106,6 @@ export function HostListView() { urlState.tab && changeTab(deserialize(urlState.tab)); }, [urlState]); - const handleChangeOwn = useCallback( - (event) => { - const own = event.target.checked; - setUrlState({ own: serialize(own), page: "0" }); - }, - [setUrlState] - ); - const rowsPerPage = [20, 50]; const { pagination, setPagination } = usePagination({ @@ -152,12 +136,9 @@ export function HostListView() { pagination, transformHostQuery(deserialize(urlState.query)) ); - requestParams.filter = - hostFilter !== "NO_IOCS" && deserialize(urlState.own) - ? "OWN" - : hostFilter; + requestParams.filter = hostFilter; getHosts(requestParams); - }, [getHosts, hostFilter, urlState.query, urlState.own, pagination]); + }, [getHosts, hostFilter, urlState.query, pagination]); // Callback for searchbar, called whenever user updates search const setSearch = useCallback( @@ -230,37 +211,6 @@ export function HostListView() { /> </Tabs> </Grid> - <Grid item> - <AccessControl - allowedRoles={[ - "DeploymentToolAdmin", - "DeploymentToolIntegrator" - ]} - renderNoAccess={NoAccess} - > - <> - {!hideOwnSlider && ( - <FormControlLabel - className={classes.formControl} - control={ - <Switch - checked={deserialize(urlState.own)} - onChange={handleChangeOwn} - /> - } - label={ - <Typography - noWrap - variant="h5" - > - Only my IOC hosts - </Typography> - } - /> - )} - </> - </AccessControl> - </Grid> </Grid> <Grid item -- GitLab