diff --git a/src/api/SwaggerApi.js b/src/api/SwaggerApi.js index fba5d34491f540f3dd0da3c19c611f9293d01da1..c125669388d371c413acac02274ee4b054ac6134 100644 --- a/src/api/SwaggerApi.js +++ b/src/api/SwaggerApi.js @@ -760,7 +760,8 @@ export function unpackTagAndCommitIdList(tagList) { export function useTagsAndCommitIds(onError) { const api = useContext(apiContext); - const method = useCallAndUnpack((gitProjectId, reference) => api.apis.Git.listTagsAndCommitIds({ project_id: gitProjectId, reference: reference }), unpackTagAndCommitIdList) + const method = useCallAndUnpack((gitProjectId, reference, includeAllReference, searchMethod) => + api.apis.Git.listTagsAndCommitIds({ project_id: gitProjectId, reference: reference, include_all_reference: includeAllReference, search_method: searchMethod }), unpackTagAndCommitIdList) return useAsync({ fcn: method, call: false, onError: onError, init: [] }); } @@ -886,10 +887,4 @@ export function useOwnIocsWithAlarms() { const method = useCallAndUnpack(api.apis.IOCs.listOwnIocsWithAlarms) return useAsync({ fcn: method, call: true, init: [] }); -} - -export function useSearchTagsAndCommitsByRef(onError) { - const api = useContext(apiContext); - const method = useCallAndUnpack((gitProjectId, reference) => api.apis.Git.searchTagsAndCommitsByRefName({ project_id: gitProjectId, reference: reference }), unpackTagAndCommitIdList) - return useAsync({ fcn: method, call: false, onError: onError, init: [] }); -} +} \ No newline at end of file diff --git a/src/components/IOC/IOCDeployDialog.js b/src/components/IOC/IOCDeployDialog.js index e4bfb6d05929a1b3568e66a9fd1bd6d61024d6ad..13534f753c3477adf980cd225383fc06faf97411 100644 --- a/src/components/IOC/IOCDeployDialog.js +++ b/src/components/IOC/IOCDeployDialog.js @@ -1,7 +1,7 @@ import React, { useEffect, useState } from "react"; import { Button, TextField, Dialog, DialogActions, DialogContent, DialogTitle, Typography, makeStyles, Tooltip } from "@material-ui/core"; import { Autocomplete, Alert } from "@material-ui/lab"; -import { useCSEntrySearch, useSearchTagsAndCommitsByRef } from "../../api/SwaggerApi"; +import { useCSEntrySearch, useTagsAndCommitIds } from "../../api/SwaggerApi"; import { useTypingTimer } from "../common/SearchBoxFilter/TypingTimer"; import {formatDate, transformHostQuery} from "../common/Helper"; @@ -23,7 +23,7 @@ export function IOCDeployDialog({ open, setOpen, submitCallback, hasActiveDeploy const [hosts, getHosts] = useCSEntrySearch(); const [host, setHost] = useState(init); const [query, onHostKeyUp] = useTypingTimer({interval: 500}); - const [tagOrCommitId, getTagOrCommitId] = useSearchTagsAndCommitsByRef(onError); + const [tagOrCommitId, getTagOrCommitId] = useTagsAndCommitIds(onError); const [gitRepo, setGitRepo] = useState(init.git || ""); const [gitVersion, setGitVersion] = useState(init.version || ""); const [queryGitVersion, onGitVersionKeyUp] = useTypingTimer({interval: 500}); @@ -34,7 +34,7 @@ export function IOCDeployDialog({ open, setOpen, submitCallback, hasActiveDeploy }; useEffect(() => getHosts({ query: transformHostQuery(`${query}`)}), [query, getHosts]); - useEffect(() => getTagOrCommitId(gitProjectId, queryGitVersion), [queryGitVersion, gitProjectId, getTagOrCommitId]); + useEffect(() => {getTagOrCommitId(gitProjectId, queryGitVersion, false, 'CONTAINS');}, [queryGitVersion, gitProjectId, getTagOrCommitId]); const onSubmit = (event) => { event.preventDefault(); @@ -90,7 +90,7 @@ export function IOCDeployDialog({ open, setOpen, submitCallback, hasActiveDeploy "reference": init.version, "shortReference": init.shortVersion ? init.shortVersion : init.version } : null } - onFocus={(event) => {getTagOrCommitId(gitProjectId);}} + getOptionLabel={(option) => { return option.shortReference; }} @@ -105,7 +105,7 @@ export function IOCDeployDialog({ open, setOpen, submitCallback, hasActiveDeploy onChange={(event, value, reason) => { setGitVersion(value?.reference); resetError(); - getTagOrCommitId(gitProjectId, value?.reference); + getTagOrCommitId(gitProjectId, value?.reference, false, 'CONTAINS'); }} onInputChange={(event, value, reason) => { event && onGitVersionKeyUp(event.nativeEvent)}} disabled={(!gitRepo) || (gitRepo.trim() === "")} diff --git a/src/mocks/fixtures/ccce-api.json b/src/mocks/fixtures/ccce-api.json index 0cab30393885577c69832c43cbd1c8ee29239cc4..e6531a8d4df0ed180027f25928767265e9bdbad3 100644 --- a/src/mocks/fixtures/ccce-api.json +++ b/src/mocks/fixtures/ccce-api.json @@ -1,4773 +1,4412 @@ { - "openapi": "3.0.1", - "info": { - "title": "CE deploy & monitor API", - "description": "CE deploy & monitor backend", - "version": "0.0.8" - }, - "servers": [ - { - "url": "http://localhost:8080", - "description": "CE deploy & monitor backend" - } - ], - "tags": [ - { - "name": "Broadcasts" - }, - { - "name": "IOCs" - }, - { - "name": "Naming" - }, - { - "name": "Authentication" - }, - { - "name": "Statistics" - }, - { - "name": "Hosts" - }, - { - "name": "Deployments" - }, - { - "name": "Git" - }, - { - "name": "Monitoring" - } - ], - "paths": { - "/api/v1/iocs/{ioc_id}/undeploy_in_db": { - "put": { - "tags": [ - "IOCs" - ], - "summary": "Undeploy in database", - "description": "Marks an IOC in database as undeployed - will not call AWX", - "operationId": "unDeployInDb", - "parameters": [ - { - "name": "ioc_id", - "in": "path", - "description": "The id of the IOC to undeploy", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "Undeployment created", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Deployment" - } - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "403": { - "description": "Forbidden: user doesn't have the necessary permissions to undeploy", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "409": { - "description": "Ongoing deployment, or undeployment for IOC", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "422": { - "description": "IOC is not deployed", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - } - }, - "security": [ - { - "bearerAuth": [] - } - ] - } - }, - "/api/v1/iocs": { - "get": { - "tags": [ - "IOCs" - ], - "summary": "List IOCs", - "operationId": "listIocs", - "parameters": [ - { - "name": "deployment_status", - "in": "query", - "description": "IOC's current deployment status", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ALL", - "DEPLOYED", - "NOT_DEPLOYED" - ] - } - }, - { - "name": "owner", - "in": "query", - "description": "User name", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "query", - "in": "query", - "description": "Search text (Search for Naming name, Owner)", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "order_by", - "in": "query", - "description": "Order by", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ID", - "OWNER", - "IOC_NAME" - ] - } - }, - { - "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": { - "200": { - "description": "A paged array of IOCs", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedIocResponse" - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - } - } - }, - "post": { - "tags": [ - "IOCs" - ], - "summary": "Create a new IOC", - "operationId": "createIoc", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateIoc" - } - } - }, - "required": true - }, - "responses": { - "201": { - "description": "IOC created", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Ioc" - } - } - } - }, - "400": { - "description": "Incomplete request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "403": { - "description": "Forbidden: User doesn't have the necessary permissions in Gitlab", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "409": { - "description": "IOC already created", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "422": { - "description": "Unprocessable request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "424": { - "description": "Metadata file not found, or not processable", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "503": { - "description": "Remote service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - } - }, - "security": [ - { - "bearerAuth": [] - } - ] - } - }, - "/api/v1/iocs/{ioc_id}/undeployment_job": { - "post": { - "tags": [ - "IOCs" - ], - "summary": "Create undeployment job", - "operationId": "createUndeployment", - "parameters": [ - { - "name": "ioc_id", - "in": "path", - "description": "The id of the IOC to undeploy", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Undeployment" - } - } - }, - "required": true - }, - "responses": { - "201": { - "description": "Undeployment created", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Deployment" - } - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "403": { - "description": "Forbidden: user doesn't have the necessary permissions in Gitlab", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "404": { - "description": "Not found", - "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" - } - } - } - }, - "422": { - "description": "IOC is not deployed correctly", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "503": { - "description": "Remote service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - } - }, - "security": [ - { - "bearerAuth": [] - } - ] - } - }, - "/api/v1/iocs/{ioc_id}/stop_job": { - "post": { - "tags": [ - "IOCs" - ], - "summary": "Create stop job for an existing IOC", - "operationId": "stopIoc", - "parameters": [ - { - "name": "ioc_id", - "in": "path", - "description": "The id of the IOC to stop", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "201": { - "description": "IOC stop initiated", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AdHocCommand" - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "403": { - "description": "Forbidden: User doesn't have the necessary permissions in Gitlab", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "404": { - "description": "IOC not found", - "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" - } - } - } - }, - "422": { - "description": "IOC has no active deployment", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "503": { - "description": "Remote service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - } - }, - "security": [ - { - "bearerAuth": [] - } - ] - } - }, - "/api/v1/iocs/{ioc_id}/start_job": { - "post": { - "tags": [ - "IOCs" - ], - "summary": "Create start job for an existing IOC", - "operationId": "startIoc", - "parameters": [ - { - "name": "ioc_id", - "in": "path", - "description": "The id of the IOC to start", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "201": { - "description": "IOC start initiated", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AdHocCommand" - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "403": { - "description": "Forbidden: User doesn't have the necessary permissions in Gitlab", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "404": { - "description": "IOC not found", - "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" - } - } - } - }, - "422": { - "description": "IOC has no active deployment", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "503": { - "description": "Remote service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - } - }, - "security": [ - { - "bearerAuth": [] - } - ] - } - }, - "/api/v1/iocs/{ioc_id}/deployment_job": { - "post": { - "tags": [ - "IOCs" - ], - "summary": "Create a deployment job for an existing IOC", - "operationId": "updateAndDeployIoc", - "parameters": [ - { - "name": "ioc_id", - "in": "path", - "description": "The id of the IOC to deploy", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateAndDeployIoc" - } - } - }, - "required": true - }, - "responses": { - "201": { - "description": "Deployment created", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Deployment" - } - } - } - }, - "400": { - "description": "Incomplete request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "403": { - "description": "Forbidden: User doesn't have the necessary permissions in Gitlab", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "404": { - "description": "IOC not found", - "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" - } - } - } - }, - "422": { - "description": "CSEntry host not found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "424": { - "description": "Metadata file not found, or not processable", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "503": { - "description": "Remote service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - } - }, - "security": [ - { - "bearerAuth": [] - } - ] - } - }, - "/api/v1/authentication/renew": { - "post": { - "tags": [ - "Authentication" - ], - "summary": "Renewing JWT token", - "description": "Renewing valid, non-expired JWT token", - "operationId": "tokenRenew", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LoginResponse" - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "403": { - "description": "Permission denied", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "503": { - "description": "Login server unavailable", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - } - }, - "security": [ - { - "bearerAuth": [] - } - ] - } - }, - "/api/v1/authentication/login": { - "post": { - "tags": [ - "Authentication" - ], - "summary": "Login user and acquire JWT token", - "description": "Login user with username, and password in order to acquire JWT token", - "operationId": "login", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Login" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LoginResponse" - } - } - } - }, - "401": { - "description": "Bad username, and/or password", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "403": { - "description": "User doesn't have permission to log in", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "503": { - "description": "Login server unavailable", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - } - } - } - }, - "/api/v1/iocs/{ioc_id}": { - "get": { - "tags": [ - "IOCs" - ], - "summary": "Find IOC details by ID", - "operationId": "getIoc", - "parameters": [ - { - "name": "ioc_id", - "in": "path", - "description": "Unique ID of IOC", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "Found IOC", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/IocDetails" - } - } - } - }, - "401": { - "description": "Unauthorized", - "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" - } - } - } - } - } - }, - "delete": { - "tags": [ - "IOCs" - ], - "summary": "Deletes a single IOC based on the ID supplied", - "operationId": "deleteIoc", - "parameters": [ - { - "name": "ioc_id", - "in": "path", - "description": "Id of IOC to delete", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "204": { - "description": "IOC deleted", - "content": { - "application/json": { - "schema": { - "type": "string" - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "403": { - "description": "Forbidden: User doesn't have the necessary permissions", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "404": { - "description": "IOC not found", - "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" - } - } - } - }, - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "503": { - "description": "Remote service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - } - }, - "security": [ - { - "bearerAuth": [] - } - ] - }, - "patch": { - "tags": [ - "IOCs" - ], - "summary": "Updating an IOC by ID", - "operationId": "updateIoc", - "parameters": [ - { - "name": "ioc_id", - "in": "path", - "description": "Unique ID of IOC", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/IOCUpdateRequest" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "IOC updated", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Ioc" - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "403": { - "description": "Forbidden: User doesn't have the necessary permissions", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "404": { - "description": "Ioc not found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "409": { - "description": "IOC already created or concurrent deployment, undeployment, start or stop for IOC is ongoing", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "422": { - "description": "Unprocessable request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "503": { - "description": "Remote service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - } - }, - "security": [ - { - "bearerAuth": [] - } - ] - } - }, - "/api/v1/statistics/my_iocs": { - "get": { - "tags": [ - "Statistics" - ], - "summary": "Own IOCs' statistics", - "operationId": "personalStatistics", - "responses": { - "200": { - "description": "Personal statistics", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PersonalStatisticsResponse" - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - } - }, - "security": [ - { - "bearerAuth": [] - } - ] - } - }, - "/api/v1/statistics/general": { - "get": { - "tags": [ - "Statistics" - ], - "summary": "Set of statistics", - "operationId": "generalStatistics", - "responses": { - "200": { - "description": "Statistics about IOCs, deployments, and hosts", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralStatisticsResponse" - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - } - } - } - }, - "/api/v1/statistics/general/ioc_statistics": { - "get": { - "tags": [ - "Statistics" - ], - "summary": "IOC statistics", - "operationId": "iocStatistics", - "responses": { - "200": { - "description": "Statistics about IOCs deployed to hosts", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DeploymentOnHost" - } - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - } - } - } - }, - "/api/v1/statistics/general/deployment_statistics": { - "get": { - "tags": [ - "Statistics" - ], - "summary": "Deployment statistics", - "operationId": "deploymentStatistics", - "responses": { - "200": { - "description": "Statistics about IOCs, deployments, and hosts", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DeploymentStatisticsResponse" - } - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - } - } - } - }, - "/api/v1/statistics/general/deployed_ioc_history": { - "get": { - "tags": [ - "Statistics" - ], - "summary": "Deployed IOC history from DB for statistics", - "operationId": "iocDeploymentHistory", - "responses": { - "200": { - "description": "History about deployed IOCs from DB for statistics", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ActiveIOCSForHistoryResponse" - } - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - } - } - } - }, - "/api/v1/statistics/general/active_ioc_statistics": { - "get": { - "tags": [ - "Statistics" - ], - "summary": "Currently active IOC statistics", - "operationId": "currentlyActiveIocs", - "responses": { - "200": { - "description": "Statistics about currently active IOCs", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ActiveIocStatisticsResponse" - } - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - } - } - } - }, - "/api/v1/statistics/general/active_ioc_history": { - "get": { - "tags": [ - "Statistics" - ], - "summary": "Active IOC history from Prometheus for statistics", - "operationId": "activeIocHistory", - "responses": { - "200": { - "description": "History about active IOCs for statistics", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ActiveIOCSForHistoryResponse" - } - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - } - } - } - }, - "/api/v1/naming/ioc_names_by_name": { - "get": { - "tags": [ - "Naming" - ], - "summary": "Fetches IOC names by name from CCDB", - "operationId": "fetchIOCByName", - "parameters": [ - { - "name": "ioc_name", - "in": "query", - "description": "IOC name", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Naming names, and IDs from CCDB", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/NameResponse" - } - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "503": { - "description": "Remote service unreachable", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - } - }, - "security": [ - { - "bearerAuth": [] - } - ] - } - }, - "/api/v1/monitoring/syslog/host/{host_name}": { - "get": { - "tags": [ - "Monitoring" - ], - "summary": "Fetches syslog lines for a specific host", - "operationId": "fetchSyslogLines", - "parameters": [ - { - "name": "host_name", - "in": "path", - "description": "Host name (without network part)", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "time_range", - "in": "query", - "description": "Time range (in minutes)", - "required": false, - "schema": { - "type": "integer", - "format": "int32" - } - } - ], - "responses": { - "200": { - "description": "Log lines", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LokiResponse" - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "503": { - "description": "Logging server unavailable", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - } - }, - "security": [ - { - "bearerAuth": [] - } - ] - } - }, - "/api/v1/monitoring/status/{ioc_id}": { - "get": { - "tags": [ - "Monitoring" - ], - "summary": "Fetches the Prometheus status of the IOC", - "operationId": "fetchIocStatus", - "parameters": [ - { - "name": "ioc_id", - "in": "path", - "description": "Unique ID of the IOC", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "Log lines", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/IocStatusResponse" - } - } - } - }, - "401": { - "description": "Unauthorized", - "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" - } - } - } - } - } - } - }, - "/api/v1/monitoring/procserv/host/{host_name}/{ioc_name}": { - "get": { - "tags": [ - "Monitoring" - ], - "summary": "Fetches procServ Log lines for a specific host", - "operationId": "fetchProcServLogLines", - "parameters": [ - { - "name": "host_name", - "in": "path", - "description": "Host name (without network part)", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "ioc_name", - "in": "path", - "description": "Name of the IOC to get procServ logs", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "time_range", - "in": "query", - "description": "Time range (in minutes)", - "required": false, - "schema": { - "type": "integer", - "format": "int32" - } - } - ], - "responses": { - "200": { - "description": "Log lines", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LokiResponse" - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "503": { - "description": "Logging server unavailable", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - } - }, - "security": [ - { - "bearerAuth": [] - } - ] - } - }, - "/api/v1/iocs/my_iocs_with_alarms": { - "get": { - "tags": [ - "IOCs" - ], - "summary": "List own IOCs with alarms", - "operationId": "listOwnIocsWithAlarms", - "responses": { - "200": { - "description": "Array of own IOC with alarms", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/IocWithAlarm" - } - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - } - }, - "security": [ - { - "bearerAuth": [] - } - ] - } - }, - "/api/v1/hosts": { - "get": { - "tags": [ - "Hosts" - ], - "summary": "List CSEntry hosts", - "operationId": "listHosts", - "parameters": [ - { - "name": "query", - "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" - } - }, - { - "name": "filter", - "in": "query", - "description": "Filtering depending on deployments", - "required": false, - "schema": { - "type": "string", - "enum": [ - "ALL", - "IOCS_DEPLOYED", - "NO_IOCS", - "OWN" - ] - } - }, - { - "name": "page", - "in": "query", - "description": "Page offset", - "required": false, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "limit", - "in": "query", - "description": "Page size", - "required": false, - "schema": { - "maximum": 100, - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "A paged array of CSEntry hosts", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedCSEntryHostResponse" - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "503": { - "description": "Remote server exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - } - } - } - }, - "/api/v1/hosts/{host_csentry_id}/with_status": { - "get": { - "tags": [ - "Hosts" - ], - "summary": "Find host by CSEntry ID and get status", - "operationId": "findHostById", - "parameters": [ - { - "name": "host_csentry_id", - "in": "path", - "description": "Unique CSEntry ID of the host", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "Found Host", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CSEntryHostWithStatus" - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "503": { - "description": "Remote server exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - } - } - } - }, - "/api/v1/hosts/{host_csentry_id}/iocs": { - "get": { - "tags": [ - "Hosts" - ], - "summary": "Find associated IOCs for the host", - "operationId": "findAssociatedIocsByHostId", - "parameters": [ - { - "name": "host_csentry_id", - "in": "path", - "description": "Unique CSEntry ID of the host", - "required": true, - "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": { - "maximum": 100, - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Found Host", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedAssociatedIocs" - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - } - } - } - }, - "/api/v1/hosts/{host_csentry_id}/info": { - "get": { - "tags": [ - "Hosts" - ], - "summary": "Find host by CSEntry ID", - "operationId": "findCSentryHostById", - "parameters": [ - { - "name": "host_csentry_id", - "in": "path", - "description": "Unique CSEntry ID of the host", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "Found Host", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TargetHost" - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - } - } - } - }, - "/api/v1/git_helper/{project_id}/tags_and_commits": { - "get": { - "tags": [ - "Git" - ], - "summary": "List Tags and CommitIds", - "operationId": "listTagsAndCommitIds", - "parameters": [ - { - "name": "project_id", - "in": "path", - "description": "Git repo project ID", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "reference", - "in": "query", - "description": "Git reference", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "List of Tags and CommitIds for a specific GitLab repo", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/GitReference" - } - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "503": { - "description": "Git exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - } - } - } - }, - "/api/v1/git_helper/{project_id}/tags_and_commits/search": { - "get": { - "tags": [ - "Git" - ], - "summary": "Searches Tags and Commits by reference", - "operationId": "searchTagsAndCommitsByRefName", - "parameters": [ - { - "name": "project_id", - "in": "path", - "description": "Git repo project ID", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "reference", - "in": "query", - "description": "Git short reference", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "List of Tags and CommitIds for a specific GitLab repo", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/GitReference" - } - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "503": { - "description": "Git exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - } - }, - "security": [ - { - "bearerAuth": [] - } - ] - } - }, - "/api/v1/git_helper/user_info": { - "get": { - "tags": [ - "Git" - ], - "summary": "User information", - "operationId": "infoFromUserName", - "parameters": [ - { - "name": "user_name", - "in": "query", - "description": "The username to retrieve info from - optional. If no userName provided the backend will look up for currently logged in userName", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Information about the current user", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/UserInfoResponse" - } - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "503": { - "description": "Git exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - } - }, - "security": [ - { - "bearerAuth": [] - } - ] - } - }, - "/api/v1/git_helper/projects": { - "get": { - "tags": [ - "Git" - ], - "summary": "List IOC projects", - "operationId": "listProjects", - "responses": { - "200": { - "description": "List of Gitlab projects of allowed groups", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/GitProject" - } - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "503": { - "description": "Git 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", - "PENDING", - "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, IOC version, Host name, Description, 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": { - "200": { - "description": "A paged array of deployments", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedOperationResponse" - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - } - } - } - }, - "/api/v1/deployments/{deployment_id}": { - "get": { - "tags": [ - "Deployments" - ], - "summary": "Get deployment details", - "operationId": "fetchDeployment", - "parameters": [ - { - "name": "deployment_id", - "in": "path", - "description": "Unique ID of deployment", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "A deployment with details", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DeploymentInfoDetails" - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "404": { - "description": "Deployment not found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - } - } - } - }, - "/api/v1/deployments/operations": { - "get": { - "tags": [ - "Deployments" - ], - "summary": "List of deployments and commands", - "operationId": "listOperations", - "parameters": [ - { - "name": "type", - "in": "query", - "description": "Type", - "required": false, - "schema": { - "type": "string", - "enum": [ - "DEPLOYMENT", - "COMMAND" - ] - } - }, - { - "name": "status", - "in": "query", - "description": "Status", - "required": false, - "schema": { - "type": "string", - "enum": [ - "QUEUED", - "PENDING", - "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, Description)", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "order_by", - "in": "query", - "description": "Order by", - "required": false, - "schema": { - "type": "string", - "enum": [ - "USER", - "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": { - "200": { - "description": "A paged array of deployments", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedOperationResponse" - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - } - } - } - }, - "/api/v1/deployments/jobs/{awx_job_id}": { - "get": { - "tags": [ - "Deployments" - ], - "summary": "Get deployment job details", - "operationId": "fetchDeploymentJobDetails", - "parameters": [ - { - "name": "awx_job_id", - "in": "path", - "description": "Unique ID of AWX job", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "AWX job details", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AwxJobDetails" - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "404": { - "description": "Deployment not found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "503": { - "description": "Remote service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - } - } - } - }, - "/api/v1/deployments/jobs/{awx_job_id}/log": { - "get": { - "tags": [ - "Deployments" - ], - "summary": "Get deployment job log", - "operationId": "fetchDeploymentJobLog", - "parameters": [ - { - "name": "awx_job_id", - "in": "path", - "description": "Unique ID of AWX job", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "AWX job log", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AwxJobLog" - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "404": { - "description": "Deployment not found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "503": { - "description": "Remote service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - } - }, - "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": { - "200": { - "description": "A command with details", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedOperationResponse" - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "404": { - "description": "Deployment not found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "503": { - "description": "Remote 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" - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "404": { - "description": "Ad-hoc command not found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "503": { - "description": "Remote 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": { - "200": { - "description": "Ongoing command (if exists)", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AdHocCommand" - } - } - } - }, - "401": { - "description": "Unauthorized", - "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" - } - } - } - }, - "503": { - "description": "Remote service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - } - } - } - }, - "/api/v1/deployments/commands/jobs/{awx_command_id}": { - "get": { - "tags": [ - "Deployments" - ], - "summary": "Get ad-hoc command details", - "operationId": "fetchCommandDetails", - "parameters": [ - { - "name": "awx_command_id", - "in": "path", - "description": "Unique ID of AWX command", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "A command with details", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AwxCommandDetails" - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "404": { - "description": "AWX command not found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "503": { - "description": "Remote service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - } - } - } - }, - "/api/v1/broadcasts/announcements": { - "get": { - "tags": [ - "Broadcasts" - ], - "summary": "Get announcements", - "operationId": "fetchAnnouncements", - "responses": { - "200": { - "description": "Announcements text", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Announcements" - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - } - } - } - }, - "/api/v1/authentication/users": { - "get": { - "tags": [ - "Authentication" - ], - "summary": "Get Deployment Tool users", - "description": "Get Deployment Tool users from authorization service", - "operationId": "getToolUsers", - "parameters": [ - { - "name": "query", - "in": "query", - "description": "User name query", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "404": { - "description": "Role not found by authorization service", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "503": { - "description": "Login server unavailable", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - } - }, - "security": [ - { - "bearerAuth": [] - } - ] - } - }, - "/api/v1/authentication/roles": { - "get": { - "tags": [ - "Authentication" - ], - "summary": "Get user roles", - "description": "Get user roles from authorization service", - "operationId": "getUserRoles", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "403": { - "description": "Permission denied", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "503": { - "description": "Login server unavailable", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - } - }, - "security": [ - { - "bearerAuth": [] - } - ] - } - }, - "/api/v1/authentication/logout": { - "delete": { - "tags": [ - "Authentication" - ], - "summary": "Logout", - "description": "Logging out the user", - "operationId": "logout", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - } - }, - "500": { - "description": "Service exception", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - }, - "503": { - "description": "Login server unavailable or remote error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GeneralException" - } - } - } - } - }, - "security": [ - { - "bearerAuth": [] - } - ] - } - } - }, - "components": { - "schemas": { - "GeneralException": { - "type": "object", - "properties": { - "error": { - "type": "string" - }, - "description": { - "type": "string" - } - } - }, - "Deployment": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "createdBy": { - "type": "string" - }, - "startDate": { - "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" - }, - "status": { - "type": "string", - "enum": [ - "PENDING", - "JOB", - "QUEUED", - "ERROR" - ] - }, - "awxJobId": { - "type": "integer", - "format": "int64" - }, - "sourceUrl": { - "type": "string" - }, - "sourceVersionShort": { - "type": "string" - }, - "jobStatus": { - "type": "string", - "enum": [ - "pending", - "waiting", - "running", - "failed", - "canceled", - "successful" - ] - } - } - }, - "Host": { - "type": "object", - "properties": { - "csEntryId": { - "type": "integer", - "format": "int64" - }, - "csEntryIdValid": { - "type": "boolean" - }, - "fqdn": { - "type": "string" - }, - "hostName": { - "type": "string" - }, - "network": { - "type": "string" - } - } - }, - "CreateIoc": { - "type": "object", - "properties": { - "externalNameId": { - "type": "integer", - "format": "int64" - }, - "gitProjectId": { - "type": "integer", - "format": "int64" - } - }, - "description": "IOC to create" - }, - "Alert": { - "type": "object", - "properties": { - "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" - }, - "externalNameId": { - "type": "integer", - "format": "int64" - }, - "gitProjectId": { - "type": "integer", - "format": "int64" - }, - "sourceUrl": { - "type": "string" - }, - "sourceVersion": { - "type": "string" - }, - "sourceVersionShort": { - "type": "string" - }, - "activeDeployment": { - "$ref": "#/components/schemas/Deployment" - }, - "alerts": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Alert" - } - }, - "active": { - "type": "boolean" - } - } - }, - "Undeployment": { - "type": "object", - "properties": { - "comment": { - "type": "string" - } - }, - "description": "Undeployment parameters" - }, - "AdHocCommand": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "type": { - "type": "string", - "enum": [ - "START", - "STOP" - ] - }, - "createdBy": { - "type": "string" - }, - "startDate": { - "type": "string", - "format": "date-time" - }, - "endDate": { - "type": "string", - "format": "date-time" - }, - "status": { - "type": "string", - "enum": [ - "pending", - "waiting", - "running", - "failed", - "canceled", - "successful" - ] - }, - "iocName": { - "type": "string" - }, - "awxCommandId": { - "type": "integer", - "format": "int64" - } - } - }, - "UpdateAndDeployIoc": { - "type": "object", - "properties": { - "comment": { - "type": "string" - }, - "sourceVersion": { - "type": "string" - }, - "hostCSEntryId": { - "type": "integer", - "format": "int64" - } - }, - "description": "IOC to update" - }, - "LoginResponse": { - "type": "object", - "properties": { - "token": { - "type": "string" - } - } - }, - "Login": { - "type": "object", - "properties": { - "userName": { - "type": "string" - }, - "password": { - "type": "string" - } - } - }, - "IOCUpdateRequest": { - "type": "object", - "properties": { - "owner": { - "type": "string" - }, - "externalNameId": { - "type": "integer", - "format": "int64" - }, - "gitProjectId": { - "type": "integer", - "format": "int64" - } - } - }, - "PersonalStatisticsResponse": { - "type": "object", - "properties": { - "numberOfActiveIocs": { - "type": "integer", - "format": "int64" - } - } - }, - "DbStatistics": { - "type": "object", - "properties": { - "numberOfCreatedIocs": { - "type": "integer", - "format": "int64" - }, - "numberOfActiveDeployments": { - "type": "integer", - "format": "int64" - }, - "numberOfIocHostsWithIocsDeployed": { - "type": "integer", - "format": "int64" - }, - "numberOfDeployments": { - "type": "integer", - "format": "int64" - } - } - }, - "GeneralStatisticsResponse": { - "type": "object", - "properties": { - "dbStatistics": { - "$ref": "#/components/schemas/DbStatistics" - }, - "networkMonitoring": { - "$ref": "#/components/schemas/NetworkMonitoring" - }, - "networkScopesIocCount": { - "type": "object", - "additionalProperties": { - "type": "integer", - "format": "int32" - } - } - } - }, - "NetworkMonitoring": { - "type": "object", - "properties": { - "numberOfActiveIocs": { - "type": "integer", - "format": "int64" - }, - "numberOfActiveHosts": { - "type": "integer", - "format": "int64" - }, - "numberOfIocHostsOnTechnicalNetwork": { - "type": "integer", - "format": "int64" - }, - "numberOfHostsWithIssue": { - "type": "integer", - "format": "int64" - } - } - }, - "DeploymentCount": { - "type": "object", - "properties": { - "iocCount": { - "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" - } - } - }, - "ActiveIOCSForHistoryResponse": { - "type": "object", - "properties": { - "iocCount": { - "type": "integer", - "format": "int64" - }, - "historyDate": { - "type": "string", - "format": "date-time" - } - } - }, - "ActiveIocStatisticsResponse": { - "type": "object", - "properties": { - "network": { - "type": "string" - }, - "iocCount": { - "type": "integer", - "format": "int64" - } - } - }, - "NameResponse": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - } - } - }, - "LokiMessage": { - "type": "object", - "properties": { - "logDate": { - "type": "string", - "format": "date-time" - }, - "logMessage": { - "type": "string" - } - } - }, - "LokiResponse": { - "type": "object", - "properties": { - "lines": { - "type": "array", - "items": { - "$ref": "#/components/schemas/LokiMessage" - } - } - } - }, - "IocStatusResponse": { - "type": "object", - "properties": { - "iocId": { - "type": "integer", - "format": "int64" - }, - "alertSeverity": { - "type": "string", - "enum": [ - "ERROR", - "WARNING", - "INFO" - ] - }, - "alerts": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Alert" - } - }, - "active": { - "type": "boolean" - } - } - }, - "ActiveDeployment": { - "type": "object", - "properties": { - "host": { - "$ref": "#/components/schemas/DeploymentHostInfo" - } - } - }, - "DeploymentHostInfo": { - "type": "object", - "properties": { - "externalHostId": { - "type": "integer", - "format": "int64" - } - } - }, - "IocInfo": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "namingName": { - "type": "string" - }, - "owner": { - "type": "string" - }, - "gitProjectId": { - "type": "integer", - "format": "int64" - }, - "sourceVersion": { - "type": "string" - }, - "activeDeployment": { - "$ref": "#/components/schemas/ActiveDeployment" - } - } - }, - "PagedIocResponse": { - "type": "object", - "properties": { - "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" - } - } - } - }, - "IocDetails": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "description": { - "type": "string" - }, - "owner": { - "type": "string" - }, - "namingName": { - "type": "string" - }, - "externalNameId": { - "type": "integer", - "format": "int64" - }, - "gitProjectId": { - "type": "integer", - "format": "int64" - }, - "sourceUrl": { - "type": "string" - }, - "sourceVersion": { - "type": "string" - }, - "sourceVersionShort": { - "type": "string" - }, - "activeDeployment": { - "$ref": "#/components/schemas/Deployment" - }, - "alerts": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Alert" - } - }, - "operationInProgress": { - "type": "boolean" - }, - "active": { - "type": "boolean" - } - } - }, - "IocWithAlarm": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "description": { - "type": "string" - }, - "owner": { - "type": "string" - }, - "namingName": { - "type": "string" - }, - "externalNameId": { - "type": "integer", - "format": "int64" - }, - "gitProjectId": { - "type": "integer", - "format": "int64" - }, - "sourceUrl": { - "type": "string" - }, - "sourceVersion": { - "type": "string" - }, - "sourceVersionShort": { - "type": "string" - }, - "activeDeployment": { - "$ref": "#/components/schemas/Deployment" - }, - "alerts": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Alert" - } - }, - "alert": { - "type": "string", - "enum": [ - "ERROR", - "WARNING", - "INFO" - ] - }, - "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" - } - } - }, - "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" - } - } - }, - "PagedCSEntryHostResponse": { - "type": "object", - "properties": { - "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" - } - } - } - }, - "CSEntryHost": { - "type": "object", - "properties": { - "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" - } - }, - "is_ioc": { - "type": "boolean" - }, - "device_type": { - "type": "string" - }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "ansible_vars": { - "type": "object", - "additionalProperties": { - "type": "object" - } - }, - "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" - ] - }, - "alerts": { - "type": "array", - "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" - } - } - }, - "PagedAssociatedIocs": { - "type": "object", - "properties": { - "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" - } - } - } - }, - "TargetHost": { - "type": "object", - "properties": { - "externalId": { - "type": "integer", - "format": "int64" - }, - "fqdn": { - "type": "string" - }, - "hostName": { - "type": "string" - }, - "network": { - "type": "string" - } - } - }, - "GitReference": { - "type": "object", - "properties": { - "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" - } - } - }, - "GitProject": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "url": { - "type": "string" - } - } - }, - "Operation": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "createdBy": { - "type": "string" - }, - "time": { - "type": "string", - "format": "date-time" - }, - "type": { - "type": "string", - "enum": [ - "DEPLOY", - "UNDEPLOY", - "START", - "STOP" - ] - }, - "iocName": { - "type": "string" - }, - "iocId": { - "type": "integer", - "format": "int64" - }, - "gitProjectId": { - "type": "integer", - "format": "int64" - }, - "gitReference": { - "type": "string" - }, - "host": { - "$ref": "#/components/schemas/DeploymentHostInfo" - }, - "status": { - "type": "string", - "enum": [ - "PENDING", - "QUEUED", - "ERROR", - "WAITING", - "RUNNING", - "FAILED", - "CANCELED", - "SUCCESSFUL" - ] - } - } - }, - "PagedOperationResponse": { - "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" - } - } - } - }, - "DeploymentInfoDetails": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "createdBy": { - "type": "string" - }, - "startDate": { - "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" - }, - "status": { - "type": "string", - "enum": [ - "PENDING", - "JOB", - "QUEUED", - "ERROR" - ] - }, - "awxJobId": { - "type": "integer", - "format": "int64" - }, - "iocId": { - "type": "integer", - "format": "int64" - }, - "awxJobUrl": { - "type": "string" - }, - "sourceUrl": { - "type": "string" - }, - "sourceVersionShort": { - "type": "string" - } - } - }, - "HostWithFqdn": { - "type": "object", - "properties": { - "csEntryId": { - "type": "integer", - "format": "int64" - }, - "csEntryIdValid": { - "type": "boolean" - }, - "fqdn": { - "type": "string" - } - } - }, - "AwxJobDetails": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "status": { - "type": "string", - "enum": [ - "pending", - "waiting", - "running", - "failed", - "canceled", - "successful" - ] - }, - "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" - } - } - }, - "AwxCommandDetails": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "status": { - "type": "string", - "enum": [ - "pending", - "waiting", - "running", - "failed", - "canceled", - "successful" - ] - }, - "started": { - "type": "string", - "format": "date-time" - }, - "finished": { - "type": "string", - "format": "date-time" - } - } - }, - "Announcements": { - "type": "object", - "properties": { - "announcementsText": { - "type": "string" - } - } - } - }, - "securitySchemes": { - "apiKey": { - "type": "apiKey", - "name": "CCCE-TOKEN", - "in": "header" - }, - "bearerAuth": { - "type": "http", - "scheme": "bearer", - "bearerFormat": "JWT" - } - } - } -} \ No newline at end of file + "openapi": "3.0.1", + "info": { + "title": "CE deploy & monitor API", + "description": "CE deploy & monitor backend", + "version": "0.0.9" + }, + "servers": [{ + "url": "http://localhost:8080", + "description": "CE deploy & monitor backend" + } + ], + "tags": [{ + "name": "Broadcasts" + }, { + "name": "IOCs" + }, { + "name": "Naming" + }, { + "name": "Authentication" + }, { + "name": "Statistics" + }, { + "name": "Hosts" + }, { + "name": "Deployments" + }, { + "name": "Git" + }, { + "name": "Monitoring" + } + ], + "paths": { + "/api/v1/iocs/{ioc_id}/undeploy_in_db": { + "put": { + "tags": ["IOCs"], + "summary": "Undeploy in database", + "description": "Marks an IOC in database as undeployed - will not call AWX", + "operationId": "unDeployInDb", + "parameters": [{ + "name": "ioc_id", + "in": "path", + "description": "The id of the IOC to undeploy", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "409": { + "description": "Ongoing deployment, or undeployment for IOC", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "500": { + "description": "Service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "422": { + "description": "IOC is not deployed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "200": { + "description": "Undeployment created", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Deployment" + } + } + } + } + }, + "403": { + "description": "Forbidden: user doesn't have the necessary permissions to undeploy", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + } + }, + "security": [{ + "bearerAuth": [] + } + ] + } + }, + "/api/v1/iocs": { + "get": { + "tags": ["IOCs"], + "summary": "List IOCs", + "operationId": "listIocs", + "parameters": [{ + "name": "deployment_status", + "in": "query", + "description": "IOC's current deployment status", + "required": false, + "schema": { + "type": "string", + "enum": ["ALL", "DEPLOYED", "NOT_DEPLOYED"] + } + }, { + "name": "owner", + "in": "query", + "description": "User name", + "required": false, + "schema": { + "type": "string" + } + }, { + "name": "query", + "in": "query", + "description": "Search text (Search for Naming name, Owner)", + "required": false, + "schema": { + "type": "string" + } + }, { + "name": "order_by", + "in": "query", + "description": "Order by", + "required": false, + "schema": { + "type": "string", + "enum": ["ID", "OWNER", "IOC_NAME"] + } + }, { + "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 IOCs", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PagedIocResponse" + } + } + } + }, + "500": { + "description": "Service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + } + } + }, + "post": { + "tags": ["IOCs"], + "summary": "Create a new IOC", + "operationId": "createIoc", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateIoc" + } + } + }, + "required": true + }, + "responses": { + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "424": { + "description": "Metadata file not found, or not processable", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "400": { + "description": "Incomplete request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "403": { + "description": "Forbidden: User doesn't have the necessary permissions in Gitlab", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "500": { + "description": "Service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "409": { + "description": "IOC already created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "503": { + "description": "Remote service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "422": { + "description": "Unprocessable request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "201": { + "description": "IOC created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Ioc" + } + } + } + } + }, + "security": [{ + "bearerAuth": [] + } + ] + } + }, + "/api/v1/iocs/{ioc_id}/undeployment_job": { + "post": { + "tags": ["IOCs"], + "summary": "Create undeployment job", + "operationId": "createUndeployment", + "parameters": [{ + "name": "ioc_id", + "in": "path", + "description": "The id of the IOC to undeploy", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Undeployment" + } + } + }, + "required": true + }, + "responses": { + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "422": { + "description": "IOC is not deployed correctly", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "201": { + "description": "Undeployment created", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Deployment" + } + } + } + } + }, + "500": { + "description": "Service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "403": { + "description": "Forbidden: user doesn't have the necessary permissions in Gitlab", + "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" + } + } + } + } + }, + "security": [{ + "bearerAuth": [] + } + ] + } + }, + "/api/v1/iocs/{ioc_id}/stop_job": { + "post": { + "tags": ["IOCs"], + "summary": "Create stop job for an existing IOC", + "operationId": "stopIoc", + "parameters": [{ + "name": "ioc_id", + "in": "path", + "description": "The id of the IOC to stop", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "404": { + "description": "IOC not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "201": { + "description": "IOC stop initiated", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdHocCommand" + } + } + } + }, + "403": { + "description": "Forbidden: User doesn't have the necessary permissions in Gitlab", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "422": { + "description": "IOC has no active deployment", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "500": { + "description": "Service exception", + "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" + } + } + } + } + }, + "security": [{ + "bearerAuth": [] + } + ] + } + }, + "/api/v1/iocs/{ioc_id}/start_job": { + "post": { + "tags": ["IOCs"], + "summary": "Create start job for an existing IOC", + "operationId": "startIoc", + "parameters": [{ + "name": "ioc_id", + "in": "path", + "description": "The id of the IOC to start", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "404": { + "description": "IOC not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "403": { + "description": "Forbidden: User doesn't have the necessary permissions in Gitlab", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "422": { + "description": "IOC has no active deployment", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "500": { + "description": "Service exception", + "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" + } + } + } + }, + "201": { + "description": "IOC start initiated", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdHocCommand" + } + } + } + } + }, + "security": [{ + "bearerAuth": [] + } + ] + } + }, + "/api/v1/iocs/{ioc_id}/deployment_job": { + "post": { + "tags": ["IOCs"], + "summary": "Create a deployment job for an existing IOC", + "operationId": "updateAndDeployIoc", + "parameters": [{ + "name": "ioc_id", + "in": "path", + "description": "The id of the IOC to deploy", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateAndDeployIoc" + } + } + }, + "required": true + }, + "responses": { + "404": { + "description": "IOC not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "424": { + "description": "Metadata file not found, or not processable", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "400": { + "description": "Incomplete request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "403": { + "description": "Forbidden: User doesn't have the necessary permissions in Gitlab", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "422": { + "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" + } + } + } + }, + "503": { + "description": "Remote service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "201": { + "description": "Deployment created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Deployment" + } + } + } + }, + "409": { + "description": "Concurrent deployment, undeployment, start or stop for IOC is ongoing", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + } + }, + "security": [{ + "bearerAuth": [] + } + ] + } + }, + "/api/v1/authentication/renew": { + "post": { + "tags": ["Authentication"], + "summary": "Renewing JWT token", + "description": "Renewing valid, non-expired JWT token", + "operationId": "tokenRenew", + "responses": { + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "500": { + "description": "Service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LoginResponse" + } + } + } + }, + "503": { + "description": "Login server unavailable", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "403": { + "description": "Permission denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + } + }, + "security": [{ + "bearerAuth": [] + } + ] + } + }, + "/api/v1/authentication/login": { + "post": { + "tags": ["Authentication"], + "summary": "Login user and acquire JWT token", + "description": "Login user with username, and password in order to acquire JWT token", + "operationId": "login", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Login" + } + } + }, + "required": true + }, + "responses": { + "403": { + "description": "User doesn't have permission to log in", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "401": { + "description": "Bad username, and/or password", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "500": { + "description": "Service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LoginResponse" + } + } + } + }, + "503": { + "description": "Login server unavailable", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + } + } + } + }, + "/api/v1/iocs/{ioc_id}": { + "get": { + "tags": ["IOCs"], + "summary": "Find IOC details by ID", + "operationId": "getIoc", + "parameters": [{ + "name": "ioc_id", + "in": "path", + "description": "Unique ID of IOC", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "404": { + "description": "Ioc not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "200": { + "description": "Found IOC", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IocDetails" + } + } + } + }, + "500": { + "description": "Service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + } + } + }, + "delete": { + "tags": ["IOCs"], + "summary": "Deletes a single IOC based on the ID supplied", + "operationId": "deleteIoc", + "parameters": [{ + "name": "ioc_id", + "in": "path", + "description": "Id of IOC to delete", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "404": { + "description": "IOC not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "403": { + "description": "Forbidden: User doesn't have the necessary permissions", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "500": { + "description": "Service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "204": { + "description": "IOC deleted", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + }, + "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" + } + } + } + } + }, + "security": [{ + "bearerAuth": [] + } + ] + }, + "patch": { + "tags": ["IOCs"], + "summary": "Updating an IOC by ID", + "operationId": "updateIoc", + "parameters": [{ + "name": "ioc_id", + "in": "path", + "description": "Unique ID of IOC", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IOCUpdateRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "IOC updated", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Ioc" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "404": { + "description": "Ioc not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "403": { + "description": "Forbidden: User doesn't have the necessary permissions", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "409": { + "description": "IOC already created or concurrent deployment, undeployment, start or stop for IOC is ongoing", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "500": { + "description": "Service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "503": { + "description": "Remote service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "422": { + "description": "Unprocessable request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + } + }, + "security": [{ + "bearerAuth": [] + } + ] + } + }, + "/api/v1/statistics/my_iocs": { + "get": { + "tags": ["Statistics"], + "summary": "Own IOCs' statistics", + "operationId": "personalStatistics", + "responses": { + "200": { + "description": "Personal statistics", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PersonalStatisticsResponse" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "500": { + "description": "Service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + } + }, + "security": [{ + "bearerAuth": [] + } + ] + } + }, + "/api/v1/statistics/general": { + "get": { + "tags": ["Statistics"], + "summary": "Set of statistics", + "operationId": "generalStatistics", + "responses": { + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "200": { + "description": "Statistics about IOCs, deployments, and hosts", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralStatisticsResponse" + } + } + } + }, + "500": { + "description": "Service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + } + } + } + }, + "/api/v1/statistics/general/ioc_statistics": { + "get": { + "tags": ["Statistics"], + "summary": "IOC statistics", + "operationId": "iocStatistics", + "responses": { + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "200": { + "description": "Statistics about IOCs deployed to hosts", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DeploymentOnHost" + } + } + } + } + }, + "500": { + "description": "Service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + } + } + } + }, + "/api/v1/statistics/general/deployment_statistics": { + "get": { + "tags": ["Statistics"], + "summary": "Deployment statistics", + "operationId": "deploymentStatistics", + "responses": { + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "500": { + "description": "Service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "200": { + "description": "Statistics about IOCs, deployments, and hosts", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DeploymentStatisticsResponse" + } + } + } + } + } + } + } + }, + "/api/v1/statistics/general/deployed_ioc_history": { + "get": { + "tags": ["Statistics"], + "summary": "Deployed IOC history from DB for statistics", + "operationId": "iocDeploymentHistory", + "responses": { + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "500": { + "description": "Service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "200": { + "description": "History about deployed IOCs from DB for statistics", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ActiveIOCSForHistoryResponse" + } + } + } + } + } + } + } + }, + "/api/v1/statistics/general/active_ioc_statistics": { + "get": { + "tags": ["Statistics"], + "summary": "Currently active IOC statistics", + "operationId": "currentlyActiveIocs", + "responses": { + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "500": { + "description": "Service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "200": { + "description": "Statistics about currently active IOCs", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ActiveIocStatisticsResponse" + } + } + } + } + } + } + } + }, + "/api/v1/statistics/general/active_ioc_history": { + "get": { + "tags": ["Statistics"], + "summary": "Active IOC history from Prometheus for statistics", + "operationId": "activeIocHistory", + "responses": { + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "200": { + "description": "History about active IOCs for statistics", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ActiveIOCSForHistoryResponse" + } + } + } + } + }, + "500": { + "description": "Service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + } + } + } + }, + "/api/v1/naming/ioc_names_by_name": { + "get": { + "tags": ["Naming"], + "summary": "Fetches IOC names by name from CCDB", + "operationId": "fetchIOCByName", + "parameters": [{ + "name": "ioc_name", + "in": "query", + "description": "IOC name", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Naming names, and IDs from CCDB", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NameResponse" + } + } + } + } + }, + "503": { + "description": "Remote service unreachable", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "500": { + "description": "Service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + } + }, + "security": [{ + "bearerAuth": [] + } + ] + } + }, + "/api/v1/monitoring/syslog/host/{host_name}": { + "get": { + "tags": ["Monitoring"], + "summary": "Fetches syslog lines for a specific host", + "operationId": "fetchSyslogLines", + "parameters": [{ + "name": "host_name", + "in": "path", + "description": "Host name (without network part)", + "required": true, + "schema": { + "type": "string" + } + }, { + "name": "time_range", + "in": "query", + "description": "Time range (in minutes)", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Log lines", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LokiResponse" + } + } + } + }, + "503": { + "description": "Logging server unavailable", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "500": { + "description": "Service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + } + }, + "security": [{ + "bearerAuth": [] + } + ] + } + }, + "/api/v1/monitoring/status/{ioc_id}": { + "get": { + "tags": ["Monitoring"], + "summary": "Fetches the Prometheus status of the IOC", + "operationId": "fetchIocStatus", + "parameters": [{ + "name": "ioc_id", + "in": "path", + "description": "Unique ID of the IOC", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "200": { + "description": "Log lines", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IocStatusResponse" + } + } + } + }, + "404": { + "description": "Ioc not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "500": { + "description": "Service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + } + } + } + }, + "/api/v1/monitoring/procserv/host/{host_name}/{ioc_name}": { + "get": { + "tags": ["Monitoring"], + "summary": "Fetches procServ Log lines for a specific host", + "operationId": "fetchProcServLogLines", + "parameters": [{ + "name": "host_name", + "in": "path", + "description": "Host name (without network part)", + "required": true, + "schema": { + "type": "string" + } + }, { + "name": "ioc_name", + "in": "path", + "description": "Name of the IOC to get procServ logs", + "required": true, + "schema": { + "type": "string" + } + }, { + "name": "time_range", + "in": "query", + "description": "Time range (in minutes)", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Log lines", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LokiResponse" + } + } + } + }, + "503": { + "description": "Logging server unavailable", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "500": { + "description": "Service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + } + }, + "security": [{ + "bearerAuth": [] + } + ] + } + }, + "/api/v1/iocs/my_iocs_with_alarms": { + "get": { + "tags": ["IOCs"], + "summary": "List own IOCs with alarms", + "operationId": "listOwnIocsWithAlarms", + "responses": { + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "500": { + "description": "Service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "200": { + "description": "Array of own IOC with alarms", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/IocWithAlarm" + } + } + } + } + } + }, + "security": [{ + "bearerAuth": [] + } + ] + } + }, + "/api/v1/hosts": { + "get": { + "tags": ["Hosts"], + "summary": "List CSEntry hosts", + "operationId": "listHosts", + "parameters": [{ + "name": "query", + "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" + } + }, { + "name": "filter", + "in": "query", + "description": "Filtering depending on deployments", + "required": false, + "schema": { + "type": "string", + "enum": ["ALL", "IOCS_DEPLOYED", "NO_IOCS", "OWN"] + } + }, { + "name": "page", + "in": "query", + "description": "Page offset", + "required": false, + "schema": { + "type": "integer", + "format": "int32" + } + }, { + "name": "limit", + "in": "query", + "description": "Page size", + "required": false, + "schema": { + "maximum": 100, + "type": "string" + } + } + ], + "responses": { + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "200": { + "description": "A paged array of CSEntry hosts", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PagedCSEntryHostResponse" + } + } + } + }, + "500": { + "description": "Service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "503": { + "description": "Remote server exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + } + } + } + }, + "/api/v1/hosts/{host_csentry_id}/with_status": { + "get": { + "tags": ["Hosts"], + "summary": "Find host by CSEntry ID and get status", + "operationId": "findHostById", + "parameters": [{ + "name": "host_csentry_id", + "in": "path", + "description": "Unique CSEntry ID of the host", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "500": { + "description": "Service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "200": { + "description": "Found Host", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CSEntryHostWithStatus" + } + } + } + }, + "503": { + "description": "Remote server exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + } + } + } + }, + "/api/v1/hosts/{host_csentry_id}/iocs": { + "get": { + "tags": ["Hosts"], + "summary": "Find associated IOCs for the host", + "operationId": "findAssociatedIocsByHostId", + "parameters": [{ + "name": "host_csentry_id", + "in": "path", + "description": "Unique CSEntry ID of the host", + "required": true, + "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": { + "maximum": 100, + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Found Host", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PagedAssociatedIocs" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "500": { + "description": "Service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + } + } + } + }, + "/api/v1/hosts/{host_csentry_id}/info": { + "get": { + "tags": ["Hosts"], + "summary": "Find host by CSEntry ID", + "operationId": "findCSentryHostById", + "parameters": [{ + "name": "host_csentry_id", + "in": "path", + "description": "Unique CSEntry ID of the host", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "200": { + "description": "Found Host", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TargetHost" + } + } + } + }, + "500": { + "description": "Service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + } + } + } + }, + "/api/v1/git_helper/{project_id}/tags_and_commits": { + "get": { + "tags": ["Git"], + "summary": "List Tags and CommitIds", + "operationId": "listTagsAndCommitIds", + "parameters": [{ + "name": "project_id", + "in": "path", + "description": "Git repo project ID", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + }, { + "name": "reference", + "in": "query", + "description": "Git reference", + "required": false, + "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" + } + }, { + "name": "search_method", + "in": "query", + "description": "Search method - optional. Default value: filtering ref by EQUALS method", + "required": false, + "schema": { + "type": "string", + "enum": ["EQUALS", "CONTAINS"] + } + } + ], + "responses": { + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "503": { + "description": "Git exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "500": { + "description": "Service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "200": { + "description": "List of Tags and CommitIds for a specific GitLab repo", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GitReference" + } + } + } + } + } + } + } + }, + "/api/v1/git_helper/user_info": { + "get": { + "tags": ["Git"], + "summary": "User information", + "operationId": "infoFromUserName", + "parameters": [{ + "name": "user_name", + "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" + } + } + ], + "responses": { + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "503": { + "description": "Git exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "500": { + "description": "Service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "200": { + "description": "Information about the current user", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserInfoResponse" + } + } + } + } + } + }, + "security": [{ + "bearerAuth": [] + } + ] + } + }, + "/api/v1/git_helper/projects": { + "get": { + "tags": ["Git"], + "summary": "List IOC projects", + "operationId": "listProjects", + "responses": { + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "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" + } + } + } + } + }, + "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", "PENDING", "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, IOC version, Host name, Description, 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" + } + } + } + }, + "500": { + "description": "Service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "200": { + "description": "A paged array of deployments", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PagedOperationResponse" + } + } + } + } + } + } + }, + "/api/v1/deployments/{deployment_id}": { + "get": { + "tags": ["Deployments"], + "summary": "Get deployment details", + "operationId": "fetchDeployment", + "parameters": [{ + "name": "deployment_id", + "in": "path", + "description": "Unique ID of deployment", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "500": { + "description": "Service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "404": { + "description": "Deployment not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "200": { + "description": "A deployment with details", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeploymentInfoDetails" + } + } + } + } + } + } + }, + "/api/v1/deployments/operations": { + "get": { + "tags": ["Deployments"], + "summary": "List of deployments and commands", + "operationId": "listOperations", + "parameters": [{ + "name": "type", + "in": "query", + "description": "Type", + "required": false, + "schema": { + "type": "string", + "enum": ["DEPLOYMENT", "COMMAND"] + } + }, { + "name": "status", + "in": "query", + "description": "Status", + "required": false, + "schema": { + "type": "string", + "enum": ["QUEUED", "PENDING", "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, Description)", + "required": false, + "schema": { + "type": "string" + } + }, { + "name": "order_by", + "in": "query", + "description": "Order by", + "required": false, + "schema": { + "type": "string", + "enum": ["USER", "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" + } + } + } + }, + "500": { + "description": "Service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "200": { + "description": "A paged array of deployments", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PagedOperationResponse" + } + } + } + } + } + } + }, + "/api/v1/deployments/jobs/{awx_job_id}": { + "get": { + "tags": ["Deployments"], + "summary": "Get deployment job details", + "operationId": "fetchDeploymentJobDetails", + "parameters": [{ + "name": "awx_job_id", + "in": "path", + "description": "Unique ID of AWX job", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "500": { + "description": "Service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "200": { + "description": "AWX job details", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AwxJobDetails" + } + } + } + }, + "503": { + "description": "Remote service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "404": { + "description": "Deployment not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + } + } + } + }, + "/api/v1/deployments/jobs/{awx_job_id}/log": { + "get": { + "tags": ["Deployments"], + "summary": "Get deployment job log", + "operationId": "fetchDeploymentJobLog", + "parameters": [{ + "name": "awx_job_id", + "in": "path", + "description": "Unique ID of AWX job", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "500": { + "description": "Service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "200": { + "description": "AWX job log", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AwxJobLog" + } + } + } + }, + "503": { + "description": "Remote service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "404": { + "description": "Deployment not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + } + }, + "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": { + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "200": { + "description": "A command with details", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PagedOperationResponse" + } + } + } + }, + "500": { + "description": "Service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "503": { + "description": "Remote service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "404": { + "description": "Deployment not found", + "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": { + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "500": { + "description": "Service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "404": { + "description": "Ad-hoc command not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "503": { + "description": "Remote service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "200": { + "description": "A command descriptor", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdHocCommand" + } + } + } + } + } + } + }, + "/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": { + "404": { + "description": "IOC not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "200": { + "description": "Ongoing command (if exists)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AdHocCommand" + } + } + } + }, + "500": { + "description": "Service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "503": { + "description": "Remote service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + } + } + } + }, + "/api/v1/deployments/commands/jobs/{awx_command_id}": { + "get": { + "tags": ["Deployments"], + "summary": "Get ad-hoc command details", + "operationId": "fetchCommandDetails", + "parameters": [{ + "name": "awx_command_id", + "in": "path", + "description": "Unique ID of AWX command", + "required": true, + "schema": { + "type": "integer", + "format": "int64" + } + } + ], + "responses": { + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "200": { + "description": "A command with details", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AwxCommandDetails" + } + } + } + }, + "404": { + "description": "AWX command not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "500": { + "description": "Service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "503": { + "description": "Remote service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + } + } + } + }, + "/api/v1/broadcasts/announcements": { + "get": { + "tags": ["Broadcasts"], + "summary": "Get announcements", + "operationId": "fetchAnnouncements", + "responses": { + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "200": { + "description": "Announcements text", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Announcements" + } + } + } + } + } + } + }, + "/api/v1/authentication/users": { + "get": { + "tags": ["Authentication"], + "summary": "Get Deployment Tool users", + "description": "Get Deployment Tool users from authorization service", + "operationId": "getToolUsers", + "parameters": [{ + "name": "query", + "in": "query", + "description": "User name query", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "500": { + "description": "Service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "503": { + "description": "Login server unavailable", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "404": { + "description": "Role not found by authorization service", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + } + }, + "security": [{ + "bearerAuth": [] + } + ] + } + }, + "/api/v1/authentication/roles": { + "get": { + "tags": ["Authentication"], + "summary": "Get user roles", + "description": "Get user roles from authorization service", + "operationId": "getUserRoles", + "responses": { + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "500": { + "description": "Service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "503": { + "description": "Login server unavailable", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "403": { + "description": "Permission denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "security": [{ + "bearerAuth": [] + } + ] + } + }, + "/api/v1/authentication/logout": { + "delete": { + "tags": ["Authentication"], + "summary": "Logout", + "description": "Logging out the user", + "operationId": "logout", + "responses": { + "500": { + "description": "Service exception", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + }, + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "503": { + "description": "Login server unavailable or remote error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GeneralException" + } + } + } + } + }, + "security": [{ + "bearerAuth": [] + } + ] + } + } + }, + "components": { + "schemas": { + "GeneralException": { + "type": "object", + "properties": { + "error": { + "type": "string" + }, + "description": { + "type": "string" + } + } + }, + "Deployment": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "createdBy": { + "type": "string" + }, + "startDate": { + "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" + }, + "status": { + "type": "string", + "enum": ["PENDING", "JOB", "QUEUED", "ERROR"] + }, + "awxJobId": { + "type": "integer", + "format": "int64" + }, + "sourceUrl": { + "type": "string" + }, + "sourceVersionShort": { + "type": "string" + }, + "jobStatus": { + "type": "string", + "enum": ["pending", "waiting", "running", "failed", "canceled", "successful"] + } + } + }, + "Host": { + "type": "object", + "properties": { + "csEntryId": { + "type": "integer", + "format": "int64" + }, + "csEntryIdValid": { + "type": "boolean" + }, + "fqdn": { + "type": "string" + }, + "hostName": { + "type": "string" + }, + "network": { + "type": "string" + } + } + }, + "CreateIoc": { + "type": "object", + "properties": { + "externalNameId": { + "type": "integer", + "format": "int64" + }, + "gitProjectId": { + "type": "integer", + "format": "int64" + } + }, + "description": "IOC to create" + }, + "Alert": { + "type": "object", + "properties": { + "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" + }, + "externalNameId": { + "type": "integer", + "format": "int64" + }, + "gitProjectId": { + "type": "integer", + "format": "int64" + }, + "sourceUrl": { + "type": "string" + }, + "sourceVersion": { + "type": "string" + }, + "sourceVersionShort": { + "type": "string" + }, + "activeDeployment": { + "$ref": "#/components/schemas/Deployment" + }, + "alerts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Alert" + } + }, + "active": { + "type": "boolean" + } + } + }, + "Undeployment": { + "type": "object", + "properties": { + "comment": { + "type": "string" + } + }, + "description": "Undeployment parameters" + }, + "AdHocCommand": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "type": { + "type": "string", + "enum": ["START", "STOP"] + }, + "createdBy": { + "type": "string" + }, + "startDate": { + "type": "string", + "format": "date-time" + }, + "endDate": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string", + "enum": ["pending", "waiting", "running", "failed", "canceled", "successful"] + }, + "iocName": { + "type": "string" + }, + "awxCommandId": { + "type": "integer", + "format": "int64" + } + } + }, + "UpdateAndDeployIoc": { + "type": "object", + "properties": { + "comment": { + "type": "string" + }, + "sourceVersion": { + "type": "string" + }, + "hostCSEntryId": { + "type": "integer", + "format": "int64" + } + }, + "description": "IOC to update" + }, + "LoginResponse": { + "type": "object", + "properties": { + "token": { + "type": "string" + } + } + }, + "Login": { + "type": "object", + "properties": { + "userName": { + "type": "string" + }, + "password": { + "type": "string" + } + } + }, + "IOCUpdateRequest": { + "type": "object", + "properties": { + "owner": { + "type": "string" + }, + "externalNameId": { + "type": "integer", + "format": "int64" + }, + "gitProjectId": { + "type": "integer", + "format": "int64" + } + } + }, + "PersonalStatisticsResponse": { + "type": "object", + "properties": { + "numberOfActiveIocs": { + "type": "integer", + "format": "int64" + } + } + }, + "DbStatistics": { + "type": "object", + "properties": { + "numberOfCreatedIocs": { + "type": "integer", + "format": "int64" + }, + "numberOfActiveDeployments": { + "type": "integer", + "format": "int64" + }, + "numberOfIocHostsWithIocsDeployed": { + "type": "integer", + "format": "int64" + }, + "numberOfDeployments": { + "type": "integer", + "format": "int64" + } + } + }, + "GeneralStatisticsResponse": { + "type": "object", + "properties": { + "dbStatistics": { + "$ref": "#/components/schemas/DbStatistics" + }, + "networkMonitoring": { + "$ref": "#/components/schemas/NetworkMonitoring" + }, + "networkScopesIocCount": { + "type": "object", + "additionalProperties": { + "type": "integer", + "format": "int32" + } + } + } + }, + "NetworkMonitoring": { + "type": "object", + "properties": { + "numberOfActiveIocs": { + "type": "integer", + "format": "int64" + }, + "numberOfActiveHosts": { + "type": "integer", + "format": "int64" + }, + "numberOfIocHostsOnTechnicalNetwork": { + "type": "integer", + "format": "int64" + }, + "numberOfHostsWithIssue": { + "type": "integer", + "format": "int64" + } + } + }, + "DeploymentCount": { + "type": "object", + "properties": { + "iocCount": { + "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" + } + } + }, + "ActiveIOCSForHistoryResponse": { + "type": "object", + "properties": { + "iocCount": { + "type": "integer", + "format": "int64" + }, + "historyDate": { + "type": "string", + "format": "date-time" + } + } + }, + "ActiveIocStatisticsResponse": { + "type": "object", + "properties": { + "network": { + "type": "string" + }, + "iocCount": { + "type": "integer", + "format": "int64" + } + } + }, + "NameResponse": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + } + } + }, + "LokiMessage": { + "type": "object", + "properties": { + "logDate": { + "type": "string", + "format": "date-time" + }, + "logMessage": { + "type": "string" + } + } + }, + "LokiResponse": { + "type": "object", + "properties": { + "lines": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LokiMessage" + } + } + } + }, + "IocStatusResponse": { + "type": "object", + "properties": { + "iocId": { + "type": "integer", + "format": "int64" + }, + "alertSeverity": { + "type": "string", + "enum": ["ERROR", "WARNING", "INFO"] + }, + "alerts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Alert" + } + }, + "active": { + "type": "boolean" + } + } + }, + "ActiveDeployment": { + "type": "object", + "properties": { + "host": { + "$ref": "#/components/schemas/DeploymentHostInfo" + } + } + }, + "DeploymentHostInfo": { + "type": "object", + "properties": { + "externalHostId": { + "type": "integer", + "format": "int64" + } + } + }, + "IocInfo": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "namingName": { + "type": "string" + }, + "owner": { + "type": "string" + }, + "gitProjectId": { + "type": "integer", + "format": "int64" + }, + "sourceVersion": { + "type": "string" + }, + "activeDeployment": { + "$ref": "#/components/schemas/ActiveDeployment" + } + } + }, + "PagedIocResponse": { + "type": "object", + "properties": { + "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" + } + } + } + }, + "IocDetails": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "description": { + "type": "string" + }, + "owner": { + "type": "string" + }, + "namingName": { + "type": "string" + }, + "externalNameId": { + "type": "integer", + "format": "int64" + }, + "gitProjectId": { + "type": "integer", + "format": "int64" + }, + "sourceUrl": { + "type": "string" + }, + "sourceVersion": { + "type": "string" + }, + "sourceVersionShort": { + "type": "string" + }, + "activeDeployment": { + "$ref": "#/components/schemas/Deployment" + }, + "alerts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Alert" + } + }, + "operationInProgress": { + "type": "boolean" + }, + "active": { + "type": "boolean" + } + } + }, + "IocWithAlarm": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "description": { + "type": "string" + }, + "owner": { + "type": "string" + }, + "namingName": { + "type": "string" + }, + "externalNameId": { + "type": "integer", + "format": "int64" + }, + "gitProjectId": { + "type": "integer", + "format": "int64" + }, + "sourceUrl": { + "type": "string" + }, + "sourceVersion": { + "type": "string" + }, + "sourceVersionShort": { + "type": "string" + }, + "activeDeployment": { + "$ref": "#/components/schemas/Deployment" + }, + "alerts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Alert" + } + }, + "alert": { + "type": "string", + "enum": ["ERROR", "WARNING", "INFO"] + }, + "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" + } + } + }, + "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" + } + } + }, + "PagedCSEntryHostResponse": { + "type": "object", + "properties": { + "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" + } + } + } + }, + "CSEntryHost": { + "type": "object", + "properties": { + "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" + } + }, + "is_ioc": { + "type": "boolean" + }, + "device_type": { + "type": "string" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "ansible_vars": { + "type": "object", + "additionalProperties": { + "type": "object" + } + }, + "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"] + }, + "alerts": { + "type": "array", + "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" + } + } + }, + "PagedAssociatedIocs": { + "type": "object", + "properties": { + "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" + } + } + } + }, + "TargetHost": { + "type": "object", + "properties": { + "externalId": { + "type": "integer", + "format": "int64" + }, + "fqdn": { + "type": "string" + }, + "hostName": { + "type": "string" + }, + "network": { + "type": "string" + } + } + }, + "GitReference": { + "type": "object", + "properties": { + "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" + } + } + }, + "GitProject": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "url": { + "type": "string" + } + } + }, + "Operation": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "createdBy": { + "type": "string" + }, + "time": { + "type": "string", + "format": "date-time" + }, + "type": { + "type": "string", + "enum": ["DEPLOY", "UNDEPLOY", "START", "STOP"] + }, + "iocName": { + "type": "string" + }, + "iocId": { + "type": "integer", + "format": "int64" + }, + "gitProjectId": { + "type": "integer", + "format": "int64" + }, + "gitReference": { + "type": "string" + }, + "host": { + "$ref": "#/components/schemas/DeploymentHostInfo" + }, + "status": { + "type": "string", + "enum": ["PENDING", "QUEUED", "ERROR", "WAITING", "RUNNING", "FAILED", "CANCELED", "SUCCESSFUL"] + } + } + }, + "PagedOperationResponse": { + "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" + } + } + } + }, + "DeploymentInfoDetails": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "createdBy": { + "type": "string" + }, + "startDate": { + "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" + }, + "status": { + "type": "string", + "enum": ["PENDING", "JOB", "QUEUED", "ERROR"] + }, + "awxJobId": { + "type": "integer", + "format": "int64" + }, + "iocId": { + "type": "integer", + "format": "int64" + }, + "awxJobUrl": { + "type": "string" + }, + "sourceUrl": { + "type": "string" + }, + "sourceVersionShort": { + "type": "string" + } + } + }, + "HostWithFqdn": { + "type": "object", + "properties": { + "csEntryId": { + "type": "integer", + "format": "int64" + }, + "csEntryIdValid": { + "type": "boolean" + }, + "fqdn": { + "type": "string" + } + } + }, + "AwxJobDetails": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "status": { + "type": "string", + "enum": ["pending", "waiting", "running", "failed", "canceled", "successful"] + }, + "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" + } + } + }, + "AwxCommandDetails": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "status": { + "type": "string", + "enum": ["pending", "waiting", "running", "failed", "canceled", "successful"] + }, + "started": { + "type": "string", + "format": "date-time" + }, + "finished": { + "type": "string", + "format": "date-time" + } + } + }, + "Announcements": { + "type": "object", + "properties": { + "announcementsText": { + "type": "string" + } + } + } + }, + "securitySchemes": { + "apiKey": { + "type": "apiKey", + "name": "CCCE-TOKEN", + "in": "header" + }, + "bearerAuth": { + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT" + } + } + } +}