From d5e215d5ef575365ae3d23c40c73d98c91f2b5eb Mon Sep 17 00:00:00 2001 From: Imre Toth <imre.toth@ess.eu> Date: Mon, 24 Oct 2022 11:16:24 +0000 Subject: [PATCH] Icshwi 10343 modifying ad hoc log list --- src/api/SwaggerApi.js | 8 +- src/components/IOC/IOCLiveStatus.js | 2 +- src/components/Job/JobAsyncList.js | 6 +- src/components/Job/JobTable.js | 14 +- src/components/common/table/CustomTable.css | 8 + src/components/common/table/CustomTable.js | 5 + src/mocks/fixtures/PagedCommandResponse.json | 2 +- src/mocks/fixtures/ccce-api.json | 1348 +++++++++++------- src/views/IOC/IOCDetailsView.js | 3 +- 9 files changed, 858 insertions(+), 538 deletions(-) diff --git a/src/api/SwaggerApi.js b/src/api/SwaggerApi.js index c1256693..95b642a1 100644 --- a/src/api/SwaggerApi.js +++ b/src/api/SwaggerApi.js @@ -328,10 +328,16 @@ export function unpackCommandList(commandList) { return unpackedCommandList; } +export function unpackAllCommandList(input) { + const {commands: operationsList, ...rest} = input; + const output = {...rest, operationsList}; + return output; +} + export function useCommandList() { const api = useContext(apiContext); const method = useCallAndUnpack( - (deploymentId, page, limit) => api.apis.Deployments.listCommands({ deployment_id: deploymentId, page: page, limit: limit }), unpackOperationsList) + (iocId, deploymentId, page, limit) => api.apis.Deployments.listCommands({ioc_id: iocId, deployment_id: deploymentId, page: page, limit: limit }), unpackAllCommandList) return useAsync({ fcn: method, call: false, init: emptyOperationsListResponse }); } diff --git a/src/components/IOC/IOCLiveStatus.js b/src/components/IOC/IOCLiveStatus.js index e23efbe2..107d874f 100644 --- a/src/components/IOC/IOCLiveStatus.js +++ b/src/components/IOC/IOCLiveStatus.js @@ -94,7 +94,7 @@ export function IOCLiveStatus({ ioc, currentCommand, commands, getCommands, comm <JobAsyncList jobs={asyncCommands} rowType="iocServiceControl" setJobs={setAsyncCommands} loading={commandsLoading} totalCount={commands.totalCount} lazyParams={commandLazyParams} setLazyParams={setCommandLazyParams} columnSort={commandColumnSort} setColumnSort={setCommandColumnSort} - rowsPerPage={rowsPerPage} /> + rowsPerPage={rowsPerPage} deploymentId={ioc?.activeDeployment?.id}/> </SimpleAccordion> {(liveIOC.activeDeployment?.host?.csEntryIdValid) && <AccessControl allowedRoles={["DeploymentToolAdmin", "DeploymentToolIntegrator"]} diff --git a/src/components/Job/JobAsyncList.js b/src/components/Job/JobAsyncList.js index 91aa57cd..b9d0f97e 100644 --- a/src/components/Job/JobAsyncList.js +++ b/src/components/Job/JobAsyncList.js @@ -2,16 +2,16 @@ import React, { useEffect } from 'react'; import { useTagsAndCommitIds, useCSentryHost } from "../../api/SwaggerApi"; import { JobTable } from './JobTable'; -export function JobAsyncList({ jobs, setJobs, rowType, totalCount, lazyParams, setLazyParams, columnSort, setColumnSort, rowsPerPage, loading, paginator }) { +export function JobAsyncList({ jobs, setJobs, rowType, totalCount, lazyParams, setLazyParams, columnSort, setColumnSort, rowsPerPage, loading, paginator, deploymentId }) { const jobDetailFetchers = - jobs.map((job, index) => <JobDetailFetcher + jobs?.map((job, index) => <JobDetailFetcher key={`${job.type}-fetcher-${job.id}`} deployment={job} index={index} setDeployments={setJobs} />); return ( <> <JobTable jobs={jobs} rowType={rowType} loading={loading} totalCount={totalCount} lazyParams={lazyParams} setLazyParams={setLazyParams} columnSort={columnSort} setColumnSort={setColumnSort} - rowsPerPage={rowsPerPage} + rowsPerPage={rowsPerPage} deploymentId={deploymentId} /> {jobDetailFetchers} </> diff --git a/src/components/Job/JobTable.js b/src/components/Job/JobTable.js index 6e1d8742..287bb1d8 100644 --- a/src/components/Job/JobTable.js +++ b/src/components/Job/JobTable.js @@ -37,7 +37,7 @@ function createGitVersionField(version, shortVersion) { ) } -function createTableRow(job, colorStyle) { +function createTableRow(job, deploymentId, colorStyle) { return { id: job.id, type: @@ -57,15 +57,17 @@ function createTableRow(job, colorStyle) { deploymentFailed: job.status === 'FAILED' || job.status === 'ERROR', jobType: job.type, iocId : job.iocId, - csentryIdInvalid: job.host?.hostInfoFromCache + csentryIdInvalid: job.host?.hostInfoFromCache, + notCurrentDeployment: deploymentId && (deploymentId !== job.deploymentId) }; } -function createTableRowJobLog(job) { - return createTableRow(job, "black") +function createTableRowJobLog(job, deploymentId) { + return createTableRow(job, deploymentId, "black") } -export function JobTable({ jobs, rowType = "jobLog", totalCount, lazyParams, setLazyParams, columnSort, setColumnSort, rowsPerPage, loading }) { +export function JobTable({ jobs, rowType = "jobLog", totalCount, lazyParams, setLazyParams, columnSort, setColumnSort, rowsPerPage, loading, deploymentId}) { + const tableTypeSpecifics = { "jobLog": [jobLogColumns, createTableRowJobLog], "iocServiceControl": [iocServiceControlColumns, createTableRow] @@ -87,7 +89,7 @@ export function JobTable({ jobs, rowType = "jobLog", totalCount, lazyParams, set }, [itemLink, redirect]); return ( - <CustomTable columns={columns} rows={jobs.map(job => createRow(job))} handleRowClick={onRowClicked} itemLink={itemLink} + <CustomTable columns={columns} rows={jobs?.map(job => createRow(job, deploymentId))} handleRowClick={onRowClicked} itemLink={itemLink} totalCount={totalCount} lazyParams={lazyParams} setLazyParams={setLazyParams} columnSort={columnSort} setColumnSort={setColumnSort} rowsPerPage={rowsPerPage} loading={loading} /> ); diff --git a/src/components/common/table/CustomTable.css b/src/components/common/table/CustomTable.css index 2d6d44a0..c36558f5 100644 --- a/src/components/common/table/CustomTable.css +++ b/src/components/common/table/CustomTable.css @@ -91,3 +91,11 @@ .ccce-custom-table .p-ccce-custom-table .p-datatable-tbody > tr.csentryIdInvalid:hover { color: #8E8E8E; } + +.ccce-custom-table .p-ccce-custom-table .p-datatable-tbody > tr.notCurrentDeployment { + color: #9E9E9E; +} + +.ccce-custom-table .p-ccce-custom-table .p-datatable-tbody > tr.notCurrentDeployment:hover { + color: #8E8E8E; +} diff --git a/src/components/common/table/CustomTable.js b/src/components/common/table/CustomTable.js index a3c4330f..730c7737 100644 --- a/src/components/common/table/CustomTable.js +++ b/src/components/common/table/CustomTable.js @@ -54,6 +54,11 @@ export function CustomTable(props) { resultObject.csentryIdInvalid = true; } + //for commands that are not run for current deployment should be grayed out + if (rowData.notCurrentDeployment) { + resultObject.notCurrentDeployment = true; + } + if (rowData.inconsistentState) { resultObject.inconsistentState = true; return resultObject; diff --git a/src/mocks/fixtures/PagedCommandResponse.json b/src/mocks/fixtures/PagedCommandResponse.json index 94f5182b..dbd88eff 100644 --- a/src/mocks/fixtures/PagedCommandResponse.json +++ b/src/mocks/fixtures/PagedCommandResponse.json @@ -3,7 +3,7 @@ "listSize": 150, "pageNumber": 0, "limit": 150, - "operations": [ + "commands": [ { "id": 230, "createdBy": "kristoferrosquist", diff --git a/src/mocks/fixtures/ccce-api.json b/src/mocks/fixtures/ccce-api.json index e6531a8d..5213b3e3 100644 --- a/src/mocks/fixtures/ccce-api.json +++ b/src/mocks/fixtures/ccce-api.json @@ -3,7 +3,7 @@ "info": { "title": "CE deploy & monitor API", "description": "CE deploy & monitor backend", - "version": "0.0.9" + "version": "0.0.10" }, "servers": [{ "url": "http://localhost:8080", @@ -33,7 +33,9 @@ "paths": { "/api/v1/iocs/{ioc_id}/undeploy_in_db": { "put": { - "tags": ["IOCs"], + "tags": [ + "IOCs" + ], "summary": "Undeploy in database", "description": "Marks an IOC in database as undeployed - will not call AWX", "operationId": "unDeployInDb", @@ -49,12 +51,15 @@ } ], "responses": { - "404": { - "description": "Not found", + "200": { + "description": "Undeployment created", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GeneralException" + "type": "array", + "items": { + "$ref": "#/components/schemas/Deployment" + } } } } @@ -69,8 +74,8 @@ } } }, - "409": { - "description": "Ongoing deployment, or undeployment for IOC", + "403": { + "description": "Forbidden: user doesn't have the necessary permissions to undeploy", "content": { "application/json": { "schema": { @@ -79,8 +84,8 @@ } } }, - "500": { - "description": "Service exception", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { @@ -89,8 +94,8 @@ } } }, - "422": { - "description": "IOC is not deployed", + "409": { + "description": "Ongoing deployment, or undeployment for IOC", "content": { "application/json": { "schema": { @@ -99,21 +104,18 @@ } } }, - "200": { - "description": "Undeployment created", + "422": { + "description": "IOC is not deployed", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Deployment" - } + "$ref": "#/components/schemas/GeneralException" } } } }, - "403": { - "description": "Forbidden: user doesn't have the necessary permissions to undeploy", + "500": { + "description": "Service exception", "content": { "application/json": { "schema": { @@ -131,7 +133,9 @@ }, "/api/v1/iocs": { "get": { - "tags": ["IOCs"], + "tags": [ + "IOCs" + ], "summary": "List IOCs", "operationId": "listIocs", "parameters": [{ @@ -141,7 +145,11 @@ "required": false, "schema": { "type": "string", - "enum": ["ALL", "DEPLOYED", "NOT_DEPLOYED"] + "enum": [ + "ALL", + "DEPLOYED", + "NOT_DEPLOYED" + ] } }, { "name": "owner", @@ -166,7 +174,11 @@ "required": false, "schema": { "type": "string", - "enum": ["ID", "OWNER", "IOC_NAME"] + "enum": [ + "ID", + "OWNER", + "IOC_NAME" + ] } }, { "name": "order_asc", @@ -197,22 +209,22 @@ } ], "responses": { - "401": { - "description": "Unauthorized", + "200": { + "description": "A paged array of IOCs", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GeneralException" + "$ref": "#/components/schemas/PagedIocResponse" } } } }, - "200": { - "description": "A paged array of IOCs", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedIocResponse" + "$ref": "#/components/schemas/GeneralException" } } } @@ -230,7 +242,9 @@ } }, "post": { - "tags": ["IOCs"], + "tags": [ + "IOCs" + ], "summary": "Create a new IOC", "operationId": "createIoc", "requestBody": { @@ -244,18 +258,18 @@ "required": true }, "responses": { - "401": { - "description": "Unauthorized", + "201": { + "description": "IOC created", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GeneralException" + "$ref": "#/components/schemas/Ioc" } } } }, - "424": { - "description": "Metadata file not found, or not processable", + "400": { + "description": "Incomplete request", "content": { "application/json": { "schema": { @@ -264,8 +278,8 @@ } } }, - "400": { - "description": "Incomplete request", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { @@ -284,8 +298,8 @@ } } }, - "500": { - "description": "Service exception", + "409": { + "description": "IOC already created", "content": { "application/json": { "schema": { @@ -294,8 +308,8 @@ } } }, - "409": { - "description": "IOC already created", + "422": { + "description": "Unprocessable request", "content": { "application/json": { "schema": { @@ -304,8 +318,8 @@ } } }, - "503": { - "description": "Remote service exception", + "424": { + "description": "Metadata file not found, or not processable", "content": { "application/json": { "schema": { @@ -314,8 +328,8 @@ } } }, - "422": { - "description": "Unprocessable request", + "500": { + "description": "Service exception", "content": { "application/json": { "schema": { @@ -324,12 +338,12 @@ } } }, - "201": { - "description": "IOC created", + "503": { + "description": "Remote service exception", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Ioc" + "$ref": "#/components/schemas/GeneralException" } } } @@ -343,7 +357,9 @@ }, "/api/v1/iocs/{ioc_id}/undeployment_job": { "post": { - "tags": ["IOCs"], + "tags": [ + "IOCs" + ], "summary": "Create undeployment job", "operationId": "createUndeployment", "parameters": [{ @@ -368,18 +384,21 @@ "required": true }, "responses": { - "404": { - "description": "Not found", + "201": { + "description": "Undeployment created", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GeneralException" + "type": "array", + "items": { + "$ref": "#/components/schemas/Deployment" + } } } } }, - "422": { - "description": "IOC is not deployed correctly", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { @@ -388,8 +407,8 @@ } } }, - "401": { - "description": "Unauthorized", + "403": { + "description": "Forbidden: user doesn't have the necessary permissions in Gitlab", "content": { "application/json": { "schema": { @@ -398,21 +417,18 @@ } } }, - "201": { - "description": "Undeployment created", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Deployment" - } + "$ref": "#/components/schemas/GeneralException" } } } }, - "500": { - "description": "Service exception", + "409": { + "description": "Concurrent deployment, undeployment, start or stop for IOC is ongoing", "content": { "application/json": { "schema": { @@ -421,8 +437,8 @@ } } }, - "403": { - "description": "Forbidden: user doesn't have the necessary permissions in Gitlab", + "422": { + "description": "IOC is not deployed correctly", "content": { "application/json": { "schema": { @@ -431,8 +447,8 @@ } } }, - "503": { - "description": "Remote service exception", + "500": { + "description": "Service exception", "content": { "application/json": { "schema": { @@ -441,8 +457,8 @@ } } }, - "409": { - "description": "Concurrent deployment, undeployment, start or stop for IOC is ongoing", + "503": { + "description": "Remote service exception", "content": { "application/json": { "schema": { @@ -460,7 +476,9 @@ }, "/api/v1/iocs/{ioc_id}/stop_job": { "post": { - "tags": ["IOCs"], + "tags": [ + "IOCs" + ], "summary": "Create stop job for an existing IOC", "operationId": "stopIoc", "parameters": [{ @@ -475,12 +493,12 @@ } ], "responses": { - "404": { - "description": "IOC not found", + "201": { + "description": "IOC stop initiated", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GeneralException" + "$ref": "#/components/schemas/AdHocCommand" } } } @@ -495,18 +513,18 @@ } } }, - "201": { - "description": "IOC stop initiated", + "403": { + "description": "Forbidden: User doesn't have the necessary permissions in Gitlab", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AdHocCommand" + "$ref": "#/components/schemas/GeneralException" } } } }, - "403": { - "description": "Forbidden: User doesn't have the necessary permissions in Gitlab", + "404": { + "description": "IOC not found", "content": { "application/json": { "schema": { @@ -515,8 +533,8 @@ } } }, - "422": { - "description": "IOC has no active deployment", + "409": { + "description": "Concurrent deployment, undeployment, start or stop for IOC is ongoing", "content": { "application/json": { "schema": { @@ -525,8 +543,8 @@ } } }, - "500": { - "description": "Service exception", + "422": { + "description": "IOC has no active deployment", "content": { "application/json": { "schema": { @@ -535,8 +553,8 @@ } } }, - "503": { - "description": "Remote service exception", + "500": { + "description": "Service exception", "content": { "application/json": { "schema": { @@ -545,8 +563,8 @@ } } }, - "409": { - "description": "Concurrent deployment, undeployment, start or stop for IOC is ongoing", + "503": { + "description": "Remote service exception", "content": { "application/json": { "schema": { @@ -564,7 +582,9 @@ }, "/api/v1/iocs/{ioc_id}/start_job": { "post": { - "tags": ["IOCs"], + "tags": [ + "IOCs" + ], "summary": "Create start job for an existing IOC", "operationId": "startIoc", "parameters": [{ @@ -579,12 +599,12 @@ } ], "responses": { - "404": { - "description": "IOC not found", + "201": { + "description": "IOC start initiated", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GeneralException" + "$ref": "#/components/schemas/AdHocCommand" } } } @@ -609,8 +629,8 @@ } } }, - "422": { - "description": "IOC has no active deployment", + "404": { + "description": "IOC not found", "content": { "application/json": { "schema": { @@ -619,8 +639,8 @@ } } }, - "500": { - "description": "Service exception", + "409": { + "description": "Concurrent deployment, undeployment, start or stop for IOC is ongoing", "content": { "application/json": { "schema": { @@ -629,8 +649,8 @@ } } }, - "503": { - "description": "Remote service exception", + "422": { + "description": "IOC has no active deployment", "content": { "application/json": { "schema": { @@ -639,8 +659,8 @@ } } }, - "409": { - "description": "Concurrent deployment, undeployment, start or stop for IOC is ongoing", + "500": { + "description": "Service exception", "content": { "application/json": { "schema": { @@ -649,12 +669,12 @@ } } }, - "201": { - "description": "IOC start initiated", + "503": { + "description": "Remote service exception", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AdHocCommand" + "$ref": "#/components/schemas/GeneralException" } } } @@ -668,7 +688,9 @@ }, "/api/v1/iocs/{ioc_id}/deployment_job": { "post": { - "tags": ["IOCs"], + "tags": [ + "IOCs" + ], "summary": "Create a deployment job for an existing IOC", "operationId": "updateAndDeployIoc", "parameters": [{ @@ -693,18 +715,18 @@ "required": true }, "responses": { - "404": { - "description": "IOC not found", + "201": { + "description": "Deployment created", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GeneralException" + "$ref": "#/components/schemas/Deployment" } } } }, - "401": { - "description": "Unauthorized", + "400": { + "description": "Incomplete request", "content": { "application/json": { "schema": { @@ -713,8 +735,8 @@ } } }, - "424": { - "description": "Metadata file not found, or not processable", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { @@ -723,8 +745,8 @@ } } }, - "400": { - "description": "Incomplete request", + "403": { + "description": "Forbidden: User doesn't have the necessary permissions in Gitlab", "content": { "application/json": { "schema": { @@ -733,8 +755,8 @@ } } }, - "403": { - "description": "Forbidden: User doesn't have the necessary permissions in Gitlab", + "404": { + "description": "IOC not found", "content": { "application/json": { "schema": { @@ -743,8 +765,8 @@ } } }, - "422": { - "description": "CSEntry host not found", + "409": { + "description": "Concurrent deployment, undeployment, start or stop for IOC is ongoing", "content": { "application/json": { "schema": { @@ -753,8 +775,8 @@ } } }, - "500": { - "description": "Service exception", + "422": { + "description": "CSEntry host not found", "content": { "application/json": { "schema": { @@ -763,8 +785,8 @@ } } }, - "503": { - "description": "Remote service exception", + "424": { + "description": "Metadata file not found, or not processable", "content": { "application/json": { "schema": { @@ -773,18 +795,18 @@ } } }, - "201": { - "description": "Deployment created", + "500": { + "description": "Service exception", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Deployment" + "$ref": "#/components/schemas/GeneralException" } } } }, - "409": { - "description": "Concurrent deployment, undeployment, start or stop for IOC is ongoing", + "503": { + "description": "Remote service exception", "content": { "application/json": { "schema": { @@ -802,23 +824,25 @@ }, "/api/v1/authentication/renew": { "post": { - "tags": ["Authentication"], + "tags": [ + "Authentication" + ], "summary": "Renewing JWT token", "description": "Renewing valid, non-expired JWT token", "operationId": "tokenRenew", "responses": { - "401": { - "description": "Unauthorized", + "200": { + "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GeneralException" + "$ref": "#/components/schemas/LoginResponse" } } } }, - "500": { - "description": "Service exception", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { @@ -827,18 +851,18 @@ } } }, - "200": { - "description": "Ok", + "403": { + "description": "Permission denied", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LoginResponse" + "$ref": "#/components/schemas/GeneralException" } } } }, - "503": { - "description": "Login server unavailable", + "500": { + "description": "Service exception", "content": { "application/json": { "schema": { @@ -847,8 +871,8 @@ } } }, - "403": { - "description": "Permission denied", + "503": { + "description": "Login server unavailable", "content": { "application/json": { "schema": { @@ -866,7 +890,9 @@ }, "/api/v1/authentication/login": { "post": { - "tags": ["Authentication"], + "tags": [ + "Authentication" + ], "summary": "Login user and acquire JWT token", "description": "Login user with username, and password in order to acquire JWT token", "operationId": "login", @@ -881,12 +907,12 @@ "required": true }, "responses": { - "403": { - "description": "User doesn't have permission to log in", + "200": { + "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GeneralException" + "$ref": "#/components/schemas/LoginResponse" } } } @@ -901,8 +927,8 @@ } } }, - "500": { - "description": "Service exception", + "403": { + "description": "User doesn't have permission to log in", "content": { "application/json": { "schema": { @@ -911,12 +937,12 @@ } } }, - "200": { - "description": "Ok", + "500": { + "description": "Service exception", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LoginResponse" + "$ref": "#/components/schemas/GeneralException" } } } @@ -936,7 +962,9 @@ }, "/api/v1/iocs/{ioc_id}": { "get": { - "tags": ["IOCs"], + "tags": [ + "IOCs" + ], "summary": "Find IOC details by ID", "operationId": "getIoc", "parameters": [{ @@ -951,18 +979,18 @@ } ], "responses": { - "401": { - "description": "Unauthorized", + "200": { + "description": "Found IOC", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GeneralException" + "$ref": "#/components/schemas/IocDetails" } } } }, - "404": { - "description": "Ioc not found", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { @@ -971,12 +999,12 @@ } } }, - "200": { - "description": "Found IOC", + "404": { + "description": "Ioc not found", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/IocDetails" + "$ref": "#/components/schemas/GeneralException" } } } @@ -994,7 +1022,9 @@ } }, "delete": { - "tags": ["IOCs"], + "tags": [ + "IOCs" + ], "summary": "Deletes a single IOC based on the ID supplied", "operationId": "deleteIoc", "parameters": [{ @@ -1009,12 +1039,12 @@ } ], "responses": { - "404": { - "description": "IOC not found", + "204": { + "description": "IOC deleted", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GeneralException" + "type": "string" } } } @@ -1039,8 +1069,8 @@ } } }, - "500": { - "description": "Service exception", + "404": { + "description": "IOC not found", "content": { "application/json": { "schema": { @@ -1049,18 +1079,18 @@ } } }, - "204": { - "description": "IOC deleted", + "409": { + "description": "Concurrent deployment, undeployment, start or stop for IOC is ongoing", "content": { "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/GeneralException" } } } }, - "503": { - "description": "Remote service exception", + "500": { + "description": "Service exception", "content": { "application/json": { "schema": { @@ -1069,8 +1099,8 @@ } } }, - "409": { - "description": "Concurrent deployment, undeployment, start or stop for IOC is ongoing", + "503": { + "description": "Remote service exception", "content": { "application/json": { "schema": { @@ -1086,7 +1116,9 @@ ] }, "patch": { - "tags": ["IOCs"], + "tags": [ + "IOCs" + ], "summary": "Updating an IOC by ID", "operationId": "updateIoc", "parameters": [{ @@ -1131,8 +1163,8 @@ } } }, - "404": { - "description": "Ioc not found", + "403": { + "description": "Forbidden: User doesn't have the necessary permissions", "content": { "application/json": { "schema": { @@ -1141,8 +1173,8 @@ } } }, - "403": { - "description": "Forbidden: User doesn't have the necessary permissions", + "404": { + "description": "Ioc not found", "content": { "application/json": { "schema": { @@ -1161,8 +1193,8 @@ } } }, - "500": { - "description": "Service exception", + "422": { + "description": "Unprocessable request", "content": { "application/json": { "schema": { @@ -1171,8 +1203,8 @@ } } }, - "503": { - "description": "Remote service exception", + "500": { + "description": "Service exception", "content": { "application/json": { "schema": { @@ -1181,8 +1213,8 @@ } } }, - "422": { - "description": "Unprocessable request", + "503": { + "description": "Remote service exception", "content": { "application/json": { "schema": { @@ -1200,7 +1232,9 @@ }, "/api/v1/statistics/my_iocs": { "get": { - "tags": ["Statistics"], + "tags": [ + "Statistics" + ], "summary": "Own IOCs' statistics", "operationId": "personalStatistics", "responses": { @@ -1243,26 +1277,28 @@ }, "/api/v1/statistics/general": { "get": { - "tags": ["Statistics"], + "tags": [ + "Statistics" + ], "summary": "Set of statistics", "operationId": "generalStatistics", "responses": { - "401": { - "description": "Unauthorized", + "200": { + "description": "Statistics about IOCs, deployments, and hosts", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GeneralException" + "$ref": "#/components/schemas/GeneralStatisticsResponse" } } } }, - "200": { - "description": "Statistics about IOCs, deployments, and hosts", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GeneralStatisticsResponse" + "$ref": "#/components/schemas/GeneralException" } } } @@ -1282,29 +1318,31 @@ }, "/api/v1/statistics/general/ioc_statistics": { "get": { - "tags": ["Statistics"], + "tags": [ + "Statistics" + ], "summary": "IOC statistics", "operationId": "iocStatistics", "responses": { - "401": { - "description": "Unauthorized", + "200": { + "description": "Statistics about IOCs deployed to hosts", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GeneralException" + "type": "array", + "items": { + "$ref": "#/components/schemas/DeploymentOnHost" + } } } } }, - "200": { - "description": "Statistics about IOCs deployed to hosts", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DeploymentOnHost" - } + "$ref": "#/components/schemas/GeneralException" } } } @@ -1324,22 +1362,27 @@ }, "/api/v1/statistics/general/deployment_statistics": { "get": { - "tags": ["Statistics"], + "tags": [ + "Statistics" + ], "summary": "Deployment statistics", "operationId": "deploymentStatistics", "responses": { - "401": { - "description": "Unauthorized", + "200": { + "description": "Statistics about IOCs, deployments, and hosts", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GeneralException" + "type": "array", + "items": { + "$ref": "#/components/schemas/DeploymentStatisticsResponse" + } } } } }, - "500": { - "description": "Service exception", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { @@ -1348,15 +1391,12 @@ } } }, - "200": { - "description": "Statistics about IOCs, deployments, and hosts", + "500": { + "description": "Service exception", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DeploymentStatisticsResponse" - } + "$ref": "#/components/schemas/GeneralException" } } } @@ -1366,22 +1406,27 @@ }, "/api/v1/statistics/general/deployed_ioc_history": { "get": { - "tags": ["Statistics"], + "tags": [ + "Statistics" + ], "summary": "Deployed IOC history from DB for statistics", "operationId": "iocDeploymentHistory", "responses": { - "401": { - "description": "Unauthorized", + "200": { + "description": "History about deployed IOCs from DB for statistics", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GeneralException" + "type": "array", + "items": { + "$ref": "#/components/schemas/ActiveIOCSForHistoryResponse" + } } } } }, - "500": { - "description": "Service exception", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { @@ -1390,15 +1435,12 @@ } } }, - "200": { - "description": "History about deployed IOCs from DB for statistics", + "500": { + "description": "Service exception", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ActiveIOCSForHistoryResponse" - } + "$ref": "#/components/schemas/GeneralException" } } } @@ -1408,22 +1450,27 @@ }, "/api/v1/statistics/general/active_ioc_statistics": { "get": { - "tags": ["Statistics"], + "tags": [ + "Statistics" + ], "summary": "Currently active IOC statistics", "operationId": "currentlyActiveIocs", "responses": { - "401": { - "description": "Unauthorized", + "200": { + "description": "Statistics about currently active IOCs", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GeneralException" + "type": "array", + "items": { + "$ref": "#/components/schemas/ActiveIocStatisticsResponse" + } } } } }, - "500": { - "description": "Service exception", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { @@ -1432,15 +1479,12 @@ } } }, - "200": { - "description": "Statistics about currently active IOCs", + "500": { + "description": "Service exception", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ActiveIocStatisticsResponse" - } + "$ref": "#/components/schemas/GeneralException" } } } @@ -1450,29 +1494,31 @@ }, "/api/v1/statistics/general/active_ioc_history": { "get": { - "tags": ["Statistics"], + "tags": [ + "Statistics" + ], "summary": "Active IOC history from Prometheus for statistics", "operationId": "activeIocHistory", "responses": { - "401": { - "description": "Unauthorized", + "200": { + "description": "History about active IOCs for statistics", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GeneralException" + "type": "array", + "items": { + "$ref": "#/components/schemas/ActiveIOCSForHistoryResponse" + } } } } }, - "200": { - "description": "History about active IOCs for statistics", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ActiveIOCSForHistoryResponse" - } + "$ref": "#/components/schemas/GeneralException" } } } @@ -1492,7 +1538,9 @@ }, "/api/v1/naming/ioc_names_by_name": { "get": { - "tags": ["Naming"], + "tags": [ + "Naming" + ], "summary": "Fetches IOC names by name from CCDB", "operationId": "fetchIOCByName", "parameters": [{ @@ -1519,8 +1567,8 @@ } } }, - "503": { - "description": "Remote service unreachable", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { @@ -1529,8 +1577,8 @@ } } }, - "401": { - "description": "Unauthorized", + "500": { + "description": "Service exception", "content": { "application/json": { "schema": { @@ -1539,8 +1587,8 @@ } } }, - "500": { - "description": "Service exception", + "503": { + "description": "Remote service unreachable", "content": { "application/json": { "schema": { @@ -1558,7 +1606,9 @@ }, "/api/v1/monitoring/syslog/host/{host_name}": { "get": { - "tags": ["Monitoring"], + "tags": [ + "Monitoring" + ], "summary": "Fetches syslog lines for a specific host", "operationId": "fetchSyslogLines", "parameters": [{ @@ -1591,8 +1641,8 @@ } } }, - "503": { - "description": "Logging server unavailable", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { @@ -1601,8 +1651,8 @@ } } }, - "401": { - "description": "Unauthorized", + "500": { + "description": "Service exception", "content": { "application/json": { "schema": { @@ -1611,8 +1661,8 @@ } } }, - "500": { - "description": "Service exception", + "503": { + "description": "Logging server unavailable", "content": { "application/json": { "schema": { @@ -1630,7 +1680,9 @@ }, "/api/v1/monitoring/status/{ioc_id}": { "get": { - "tags": ["Monitoring"], + "tags": [ + "Monitoring" + ], "summary": "Fetches the Prometheus status of the IOC", "operationId": "fetchIocStatus", "parameters": [{ @@ -1655,8 +1707,8 @@ } } }, - "404": { - "description": "Ioc not found", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { @@ -1665,8 +1717,8 @@ } } }, - "401": { - "description": "Unauthorized", + "404": { + "description": "Ioc not found", "content": { "application/json": { "schema": { @@ -1690,7 +1742,9 @@ }, "/api/v1/monitoring/procserv/host/{host_name}/{ioc_name}": { "get": { - "tags": ["Monitoring"], + "tags": [ + "Monitoring" + ], "summary": "Fetches procServ Log lines for a specific host", "operationId": "fetchProcServLogLines", "parameters": [{ @@ -1731,8 +1785,8 @@ } } }, - "503": { - "description": "Logging server unavailable", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { @@ -1741,8 +1795,8 @@ } } }, - "401": { - "description": "Unauthorized", + "500": { + "description": "Service exception", "content": { "application/json": { "schema": { @@ -1751,8 +1805,8 @@ } } }, - "500": { - "description": "Service exception", + "503": { + "description": "Logging server unavailable", "content": { "application/json": { "schema": { @@ -1770,22 +1824,27 @@ }, "/api/v1/iocs/my_iocs_with_alarms": { "get": { - "tags": ["IOCs"], + "tags": [ + "IOCs" + ], "summary": "List own IOCs with alarms", "operationId": "listOwnIocsWithAlarms", "responses": { - "401": { - "description": "Unauthorized", + "200": { + "description": "Array of own IOC with alarms", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GeneralException" + "type": "array", + "items": { + "$ref": "#/components/schemas/IocWithAlarm" + } } } } }, - "500": { - "description": "Service exception", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { @@ -1794,15 +1853,12 @@ } } }, - "200": { - "description": "Array of own IOC with alarms", + "500": { + "description": "Service exception", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/IocWithAlarm" - } + "$ref": "#/components/schemas/GeneralException" } } } @@ -1816,7 +1872,9 @@ }, "/api/v1/hosts": { "get": { - "tags": ["Hosts"], + "tags": [ + "Hosts" + ], "summary": "List CSEntry hosts", "operationId": "listHosts", "parameters": [{ @@ -1834,7 +1892,12 @@ "required": false, "schema": { "type": "string", - "enum": ["ALL", "IOCS_DEPLOYED", "NO_IOCS", "OWN"] + "enum": [ + "ALL", + "IOCS_DEPLOYED", + "NO_IOCS", + "OWN" + ] } }, { "name": "page", @@ -1857,22 +1920,22 @@ } ], "responses": { - "401": { - "description": "Unauthorized", + "200": { + "description": "A paged array of CSEntry hosts", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GeneralException" + "$ref": "#/components/schemas/PagedCSEntryHostResponse" } } } }, - "200": { - "description": "A paged array of CSEntry hosts", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedCSEntryHostResponse" + "$ref": "#/components/schemas/GeneralException" } } } @@ -1902,7 +1965,9 @@ }, "/api/v1/hosts/{host_csentry_id}/with_status": { "get": { - "tags": ["Hosts"], + "tags": [ + "Hosts" + ], "summary": "Find host by CSEntry ID and get status", "operationId": "findHostById", "parameters": [{ @@ -1917,12 +1982,12 @@ } ], "responses": { - "404": { - "description": "Not found", + "200": { + "description": "Found Host", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GeneralException" + "$ref": "#/components/schemas/CSEntryHostWithStatus" } } } @@ -1937,8 +2002,8 @@ } } }, - "500": { - "description": "Service exception", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { @@ -1947,12 +2012,12 @@ } } }, - "200": { - "description": "Found Host", + "500": { + "description": "Service exception", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CSEntryHostWithStatus" + "$ref": "#/components/schemas/GeneralException" } } } @@ -1972,7 +2037,9 @@ }, "/api/v1/hosts/{host_csentry_id}/iocs": { "get": { - "tags": ["Hosts"], + "tags": [ + "Hosts" + ], "summary": "Find associated IOCs for the host", "operationId": "findAssociatedIocsByHostId", "parameters": [{ @@ -2040,7 +2107,9 @@ }, "/api/v1/hosts/{host_csentry_id}/info": { "get": { - "tags": ["Hosts"], + "tags": [ + "Hosts" + ], "summary": "Find host by CSEntry ID", "operationId": "findCSentryHostById", "parameters": [{ @@ -2055,12 +2124,12 @@ } ], "responses": { - "404": { - "description": "Not found", + "200": { + "description": "Found Host", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GeneralException" + "$ref": "#/components/schemas/TargetHost" } } } @@ -2075,12 +2144,12 @@ } } }, - "200": { - "description": "Found Host", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TargetHost" + "$ref": "#/components/schemas/GeneralException" } } } @@ -2100,7 +2169,9 @@ }, "/api/v1/git_helper/{project_id}/tags_and_commits": { "get": { - "tags": ["Git"], + "tags": [ + "Git" + ], "summary": "List Tags and CommitIds", "operationId": "listTagsAndCommitIds", "parameters": [{ @@ -2135,23 +2206,29 @@ "required": false, "schema": { "type": "string", - "enum": ["EQUALS", "CONTAINS"] + "enum": [ + "EQUALS", + "CONTAINS" + ] } } ], "responses": { - "401": { - "description": "Unauthorized", + "200": { + "description": "List of Tags and CommitIds for a specific GitLab repo", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GeneralException" + "type": "array", + "items": { + "$ref": "#/components/schemas/GitReference" + } } } } }, - "503": { - "description": "Git exception", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { @@ -2170,15 +2247,12 @@ } } }, - "200": { - "description": "List of Tags and CommitIds for a specific GitLab repo", + "503": { + "description": "Git exception", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/GitReference" - } + "$ref": "#/components/schemas/GeneralException" } } } @@ -2188,7 +2262,9 @@ }, "/api/v1/git_helper/user_info": { "get": { - "tags": ["Git"], + "tags": [ + "Git" + ], "summary": "User information", "operationId": "infoFromUserName", "parameters": [{ @@ -2202,12 +2278,15 @@ } ], "responses": { - "404": { - "description": "Not found", + "200": { + "description": "Information about the current user", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GeneralException" + "type": "array", + "items": { + "$ref": "#/components/schemas/UserInfoResponse" + } } } } @@ -2222,8 +2301,8 @@ } } }, - "503": { - "description": "Git exception", + "404": { + "description": "Not found", "content": { "application/json": { "schema": { @@ -2242,15 +2321,12 @@ } } }, - "200": { - "description": "Information about the current user", + "503": { + "description": "Git exception", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/UserInfoResponse" - } + "$ref": "#/components/schemas/GeneralException" } } } @@ -2264,22 +2340,27 @@ }, "/api/v1/git_helper/projects": { "get": { - "tags": ["Git"], + "tags": [ + "Git" + ], "summary": "List IOC projects", "operationId": "listProjects", "responses": { - "401": { - "description": "Unauthorized", + "200": { + "description": "List of Gitlab projects of allowed groups", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GeneralException" + "type": "array", + "items": { + "$ref": "#/components/schemas/GitProject" + } } } } }, - "503": { - "description": "Git exception", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { @@ -2288,21 +2369,18 @@ } } }, - "200": { - "description": "List of Gitlab projects of allowed groups", + "500": { + "description": "Service exception", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/GitProject" - } + "$ref": "#/components/schemas/GeneralException" } } } }, - "500": { - "description": "Service exception", + "503": { + "description": "Git exception", "content": { "application/json": { "schema": { @@ -2320,7 +2398,9 @@ }, "/api/v1/deployments": { "get": { - "tags": ["Deployments"], + "tags": [ + "Deployments" + ], "summary": "List deployments", "operationId": "listDeployments", "parameters": [{ @@ -2348,7 +2428,14 @@ "required": false, "schema": { "type": "string", - "enum": ["QUEUED", "PENDING", "RUNNING", "SUCCESSFUL", "FAILED", "FINISHED"] + "enum": [ + "QUEUED", + "PENDING", + "RUNNING", + "SUCCESSFUL", + "FAILED", + "FINISHED" + ] } }, { "name": "user", @@ -2361,7 +2448,7 @@ }, { "name": "query", "in": "query", - "description": "Search text (Search for IOC name, IOC version, Host name, Description, Created by)", + "description": "Search text (Search for IOC name, Git reference, Created by)", "required": false, "schema": { "type": "string" @@ -2373,7 +2460,13 @@ "required": false, "schema": { "type": "string", - "enum": ["ID", "CREATED_BY", "TIME", "IOC_NAME", "GIT_REFERENCE"] + "enum": [ + "ID", + "CREATED_BY", + "TIME", + "IOC_NAME", + "GIT_REFERENCE" + ] } }, { "name": "order_asc", @@ -2404,18 +2497,18 @@ } ], "responses": { - "401": { - "description": "Unauthorized", + "200": { + "description": "A paged array of deployments", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GeneralException" + "$ref": "#/components/schemas/PagedOperationResponse" } } } }, - "500": { - "description": "Service exception", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { @@ -2424,12 +2517,12 @@ } } }, - "200": { - "description": "A paged array of deployments", + "500": { + "description": "Service exception", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedOperationResponse" + "$ref": "#/components/schemas/GeneralException" } } } @@ -2439,7 +2532,9 @@ }, "/api/v1/deployments/{deployment_id}": { "get": { - "tags": ["Deployments"], + "tags": [ + "Deployments" + ], "summary": "Get deployment details", "operationId": "fetchDeployment", "parameters": [{ @@ -2454,18 +2549,18 @@ } ], "responses": { - "401": { - "description": "Unauthorized", + "200": { + "description": "A deployment with details", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GeneralException" + "$ref": "#/components/schemas/DeploymentInfoDetails" } } } }, - "500": { - "description": "Service exception", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { @@ -2484,12 +2579,12 @@ } } }, - "200": { - "description": "A deployment with details", + "500": { + "description": "Service exception", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DeploymentInfoDetails" + "$ref": "#/components/schemas/GeneralException" } } } @@ -2499,7 +2594,9 @@ }, "/api/v1/deployments/operations": { "get": { - "tags": ["Deployments"], + "tags": [ + "Deployments" + ], "summary": "List of deployments and commands", "operationId": "listOperations", "parameters": [{ @@ -2509,7 +2606,10 @@ "required": false, "schema": { "type": "string", - "enum": ["DEPLOYMENT", "COMMAND"] + "enum": [ + "DEPLOYMENT", + "COMMAND" + ] } }, { "name": "status", @@ -2518,7 +2618,14 @@ "required": false, "schema": { "type": "string", - "enum": ["QUEUED", "PENDING", "RUNNING", "SUCCESSFUL", "FAILED", "FINISHED"] + "enum": [ + "QUEUED", + "PENDING", + "RUNNING", + "SUCCESSFUL", + "FAILED", + "FINISHED" + ] } }, { "name": "user", @@ -2531,7 +2638,7 @@ }, { "name": "query", "in": "query", - "description": "Search text (Search for IOC name, Git reference, Created by, Description)", + "description": "Search text (Search for IOC name, Git reference, Created by)", "required": false, "schema": { "type": "string" @@ -2543,7 +2650,12 @@ "required": false, "schema": { "type": "string", - "enum": ["USER", "TIME", "IOC_NAME", "GIT_REFERENCE"] + "enum": [ + "USER", + "TIME", + "IOC_NAME", + "GIT_REFERENCE" + ] } }, { "name": "order_asc", @@ -2574,18 +2686,18 @@ } ], "responses": { - "401": { - "description": "Unauthorized", + "200": { + "description": "A paged array of deployments", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GeneralException" + "$ref": "#/components/schemas/PagedOperationResponse" } } } }, - "500": { - "description": "Service exception", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { @@ -2594,12 +2706,12 @@ } } }, - "200": { - "description": "A paged array of deployments", + "500": { + "description": "Service exception", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedOperationResponse" + "$ref": "#/components/schemas/GeneralException" } } } @@ -2609,7 +2721,9 @@ }, "/api/v1/deployments/jobs/{awx_job_id}": { "get": { - "tags": ["Deployments"], + "tags": [ + "Deployments" + ], "summary": "Get deployment job details", "operationId": "fetchDeploymentJobDetails", "parameters": [{ @@ -2624,18 +2738,18 @@ } ], "responses": { - "401": { - "description": "Unauthorized", + "200": { + "description": "AWX job details", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GeneralException" + "$ref": "#/components/schemas/AwxJobDetails" } } } }, - "500": { - "description": "Service exception", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { @@ -2644,18 +2758,18 @@ } } }, - "200": { - "description": "AWX job details", + "404": { + "description": "Deployment not found", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AwxJobDetails" + "$ref": "#/components/schemas/GeneralException" } } } }, - "503": { - "description": "Remote service exception", + "500": { + "description": "Service exception", "content": { "application/json": { "schema": { @@ -2664,8 +2778,8 @@ } } }, - "404": { - "description": "Deployment not found", + "503": { + "description": "Remote service exception", "content": { "application/json": { "schema": { @@ -2679,7 +2793,9 @@ }, "/api/v1/deployments/jobs/{awx_job_id}/log": { "get": { - "tags": ["Deployments"], + "tags": [ + "Deployments" + ], "summary": "Get deployment job log", "operationId": "fetchDeploymentJobLog", "parameters": [{ @@ -2694,18 +2810,18 @@ } ], "responses": { - "401": { - "description": "Unauthorized", + "200": { + "description": "AWX job log", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GeneralException" + "$ref": "#/components/schemas/AwxJobLog" } } } }, - "500": { - "description": "Service exception", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { @@ -2714,18 +2830,18 @@ } } }, - "200": { - "description": "AWX job log", + "404": { + "description": "Deployment not found", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AwxJobLog" + "$ref": "#/components/schemas/GeneralException" } } } }, - "503": { - "description": "Remote service exception", + "500": { + "description": "Service exception", "content": { "application/json": { "schema": { @@ -2734,8 +2850,8 @@ } } }, - "404": { - "description": "Deployment not found", + "503": { + "description": "Remote service exception", "content": { "application/json": { "schema": { @@ -2753,7 +2869,9 @@ }, "/api/v1/deployments/commands": { "get": { - "tags": ["Deployments"], + "tags": [ + "Deployments" + ], "summary": "Get ad-hoc command list for a specific deployment", "operationId": "listCommands", "parameters": [{ @@ -2795,28 +2913,28 @@ } ], "responses": { - "401": { - "description": "Unauthorized", + "200": { + "description": "A command with details", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GeneralException" + "$ref": "#/components/schemas/PagedCommandResponse" } } } }, - "200": { - "description": "A command with details", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedOperationResponse" + "$ref": "#/components/schemas/GeneralException" } } } }, - "500": { - "description": "Service exception", + "404": { + "description": "Deployment not found", "content": { "application/json": { "schema": { @@ -2825,8 +2943,8 @@ } } }, - "503": { - "description": "Remote service exception", + "500": { + "description": "Service exception", "content": { "application/json": { "schema": { @@ -2835,8 +2953,8 @@ } } }, - "404": { - "description": "Deployment not found", + "503": { + "description": "Remote service exception", "content": { "application/json": { "schema": { @@ -2850,7 +2968,9 @@ }, "/api/v1/deployments/commands/{command_id}": { "get": { - "tags": ["Deployments"], + "tags": [ + "Deployments" + ], "summary": "Get ad-hoc command", "operationId": "fetchCommand", "parameters": [{ @@ -2865,18 +2985,18 @@ } ], "responses": { - "401": { - "description": "Unauthorized", + "200": { + "description": "A command descriptor", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GeneralException" + "$ref": "#/components/schemas/AdHocCommand" } } } }, - "500": { - "description": "Service exception", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { @@ -2895,8 +3015,8 @@ } } }, - "503": { - "description": "Remote service exception", + "500": { + "description": "Service exception", "content": { "application/json": { "schema": { @@ -2905,12 +3025,12 @@ } } }, - "200": { - "description": "A command descriptor", + "503": { + "description": "Remote service exception", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AdHocCommand" + "$ref": "#/components/schemas/GeneralException" } } } @@ -2920,7 +3040,9 @@ }, "/api/v1/deployments/commands/ongoing/{ioc_id}": { "get": { - "tags": ["Deployments"], + "tags": [ + "Deployments" + ], "summary": "Get list of ongoing ad-hoc commands for a specific IOC", "operationId": "ongoingCommandByIoc", "parameters": [{ @@ -2935,12 +3057,12 @@ } ], "responses": { - "404": { - "description": "IOC not found", + "200": { + "description": "Ongoing command (if exists)", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GeneralException" + "$ref": "#/components/schemas/AdHocCommand" } } } @@ -2955,12 +3077,12 @@ } } }, - "200": { - "description": "Ongoing command (if exists)", + "404": { + "description": "IOC not found", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AdHocCommand" + "$ref": "#/components/schemas/GeneralException" } } } @@ -2990,7 +3112,9 @@ }, "/api/v1/deployments/commands/jobs/{awx_command_id}": { "get": { - "tags": ["Deployments"], + "tags": [ + "Deployments" + ], "summary": "Get ad-hoc command details", "operationId": "fetchCommandDetails", "parameters": [{ @@ -3005,22 +3129,22 @@ } ], "responses": { - "401": { - "description": "Unauthorized", + "200": { + "description": "A command with details", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GeneralException" + "$ref": "#/components/schemas/AwxCommandDetails" } } } }, - "200": { - "description": "A command with details", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/AwxCommandDetails" + "$ref": "#/components/schemas/GeneralException" } } } @@ -3060,26 +3184,28 @@ }, "/api/v1/broadcasts/announcements": { "get": { - "tags": ["Broadcasts"], + "tags": [ + "Broadcasts" + ], "summary": "Get announcements", "operationId": "fetchAnnouncements", "responses": { - "401": { - "description": "Unauthorized", + "200": { + "description": "Announcements text", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GeneralException" + "$ref": "#/components/schemas/Announcements" } } } }, - "200": { - "description": "Announcements text", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Announcements" + "$ref": "#/components/schemas/GeneralException" } } } @@ -3089,7 +3215,9 @@ }, "/api/v1/authentication/users": { "get": { - "tags": ["Authentication"], + "tags": [ + "Authentication" + ], "summary": "Get Deployment Tool users", "description": "Get Deployment Tool users from authorization service", "operationId": "getToolUsers", @@ -3104,18 +3232,21 @@ } ], "responses": { - "401": { - "description": "Unauthorized", + "200": { + "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GeneralException" + "type": "array", + "items": { + "type": "string" + } } } } }, - "500": { - "description": "Service exception", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { @@ -3124,8 +3255,8 @@ } } }, - "503": { - "description": "Login server unavailable", + "404": { + "description": "Role not found by authorization service", "content": { "application/json": { "schema": { @@ -3134,21 +3265,18 @@ } } }, - "200": { - "description": "Ok", + "500": { + "description": "Service exception", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "type": "string" - } + "$ref": "#/components/schemas/GeneralException" } } } }, - "404": { - "description": "Role not found by authorization service", + "503": { + "description": "Login server unavailable", "content": { "application/json": { "schema": { @@ -3166,23 +3294,28 @@ }, "/api/v1/authentication/roles": { "get": { - "tags": ["Authentication"], + "tags": [ + "Authentication" + ], "summary": "Get user roles", "description": "Get user roles from authorization service", "operationId": "getUserRoles", "responses": { - "401": { - "description": "Unauthorized", + "200": { + "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GeneralException" + "type": "array", + "items": { + "type": "string" + } } } } }, - "500": { - "description": "Service exception", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { @@ -3191,8 +3324,8 @@ } } }, - "503": { - "description": "Login server unavailable", + "403": { + "description": "Permission denied", "content": { "application/json": { "schema": { @@ -3201,8 +3334,8 @@ } } }, - "403": { - "description": "Permission denied", + "500": { + "description": "Service exception", "content": { "application/json": { "schema": { @@ -3211,15 +3344,12 @@ } } }, - "200": { - "description": "Ok", + "503": { + "description": "Login server unavailable", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "type": "string" - } + "$ref": "#/components/schemas/GeneralException" } } } @@ -3233,27 +3363,29 @@ }, "/api/v1/authentication/logout": { "delete": { - "tags": ["Authentication"], + "tags": [ + "Authentication" + ], "summary": "Logout", "description": "Logging out the user", "operationId": "logout", "responses": { - "500": { - "description": "Service exception", + "200": { + "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GeneralException" + "type": "object" } } } }, - "200": { - "description": "Ok", + "500": { + "description": "Service exception", "content": { "application/json": { "schema": { - "type": "object" + "$ref": "#/components/schemas/GeneralException" } } } @@ -3331,7 +3463,12 @@ }, "status": { "type": "string", - "enum": ["PENDING", "JOB", "QUEUED", "ERROR"] + "enum": [ + "PENDING", + "JOB", + "QUEUED", + "ERROR" + ] }, "awxJobId": { "type": "integer", @@ -3345,7 +3482,17 @@ }, "jobStatus": { "type": "string", - "enum": ["pending", "waiting", "running", "failed", "canceled", "successful"] + "enum": [ + "pending", + "waiting", + "running", + "failed", + "canceled", + "successful" + ] + }, + "iocOwner": { + "type": "string" } } }, @@ -3389,7 +3536,11 @@ "properties": { "type": { "type": "string", - "enum": ["ERROR", "WARNING", "INFO"] + "enum": [ + "ERROR", + "WARNING", + "INFO" + ] }, "message": { "type": "string" @@ -3426,12 +3577,6 @@ "sourceUrl": { "type": "string" }, - "sourceVersion": { - "type": "string" - }, - "sourceVersionShort": { - "type": "string" - }, "activeDeployment": { "$ref": "#/components/schemas/Deployment" }, @@ -3464,7 +3609,10 @@ }, "type": { "type": "string", - "enum": ["START", "STOP"] + "enum": [ + "START", + "STOP" + ] }, "createdBy": { "type": "string" @@ -3479,7 +3627,14 @@ }, "status": { "type": "string", - "enum": ["pending", "waiting", "running", "failed", "canceled", "successful"] + "enum": [ + "pending", + "waiting", + "running", + "failed", + "canceled", + "successful" + ] }, "iocName": { "type": "string" @@ -3726,7 +3881,11 @@ }, "alertSeverity": { "type": "string", - "enum": ["ERROR", "WARNING", "INFO"] + "enum": [ + "ERROR", + "WARNING", + "INFO" + ] }, "alerts": { "type": "array", @@ -3744,6 +3903,12 @@ "properties": { "host": { "$ref": "#/components/schemas/DeploymentHostInfo" + }, + "sourceVersion": { + "type": "string" + }, + "sourceVersionShort": { + "type": "string" } } }, @@ -3753,6 +3918,15 @@ "externalHostId": { "type": "integer", "format": "int64" + }, + "hostName": { + "type": "string" + }, + "network": { + "type": "string" + }, + "hostInfoFromCache": { + "type": "boolean" } } }, @@ -3773,9 +3947,6 @@ "type": "integer", "format": "int64" }, - "sourceVersion": { - "type": "string" - }, "activeDeployment": { "$ref": "#/components/schemas/ActiveDeployment" } @@ -3835,12 +4006,6 @@ "sourceUrl": { "type": "string" }, - "sourceVersion": { - "type": "string" - }, - "sourceVersionShort": { - "type": "string" - }, "activeDeployment": { "$ref": "#/components/schemas/Deployment" }, @@ -3885,12 +4050,6 @@ "sourceUrl": { "type": "string" }, - "sourceVersion": { - "type": "string" - }, - "sourceVersionShort": { - "type": "string" - }, "activeDeployment": { "$ref": "#/components/schemas/Deployment" }, @@ -3902,7 +4061,11 @@ }, "alert": { "type": "string", - "enum": ["ERROR", "WARNING", "INFO"] + "enum": [ + "ERROR", + "WARNING", + "INFO" + ] }, "active": { "type": "boolean" @@ -3944,11 +4107,18 @@ }, "status": { "type": "string", - "enum": ["AVAILABLE", "UNREACHABLE"] + "enum": [ + "AVAILABLE", + "UNREACHABLE" + ] }, "alert": { "type": "string", - "enum": ["ERROR", "WARNING", "INFO"] + "enum": [ + "ERROR", + "WARNING", + "INFO" + ] }, "iocDeployed": { "type": "boolean" @@ -4045,7 +4215,10 @@ }, "status": { "type": "string", - "enum": ["AVAILABLE", "UNREACHABLE"] + "enum": [ + "AVAILABLE", + "UNREACHABLE" + ] }, "alerts": { "type": "array", @@ -4202,7 +4375,12 @@ }, "type": { "type": "string", - "enum": ["DEPLOY", "UNDEPLOY", "START", "STOP"] + "enum": [ + "DEPLOY", + "UNDEPLOY", + "START", + "STOP" + ] }, "iocName": { "type": "string" @@ -4223,7 +4401,16 @@ }, "status": { "type": "string", - "enum": ["PENDING", "QUEUED", "ERROR", "WAITING", "RUNNING", "FAILED", "CANCELED", "SUCCESSFUL"] + "enum": [ + "PENDING", + "QUEUED", + "ERROR", + "WAITING", + "RUNNING", + "FAILED", + "CANCELED", + "SUCCESSFUL" + ] } } }, @@ -4293,7 +4480,12 @@ }, "status": { "type": "string", - "enum": ["PENDING", "JOB", "QUEUED", "ERROR"] + "enum": [ + "PENDING", + "JOB", + "QUEUED", + "ERROR" + ] }, "awxJobId": { "type": "integer", @@ -4311,6 +4503,12 @@ }, "sourceVersionShort": { "type": "string" + }, + "alerts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Alert" + } } } }, @@ -4338,7 +4536,14 @@ }, "status": { "type": "string", - "enum": ["pending", "waiting", "running", "failed", "canceled", "successful"] + "enum": [ + "pending", + "waiting", + "running", + "failed", + "canceled", + "successful" + ] }, "started": { "type": "string", @@ -4366,6 +4571,92 @@ } } }, + "Command": { + "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" + ] + }, + "deploymentId": { + "type": "integer", + "format": "int64" + } + } + }, + "PagedCommandResponse": { + "type": "object", + "properties": { + "totalCount": { + "type": "integer", + "format": "int64" + }, + "listSize": { + "type": "integer", + "format": "int32" + }, + "pageNumber": { + "type": "integer", + "format": "int32" + }, + "limit": { + "type": "integer", + "format": "int32" + }, + "commands": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Command" + } + } + } + }, "AwxCommandDetails": { "type": "object", "properties": { @@ -4375,7 +4666,14 @@ }, "status": { "type": "string", - "enum": ["pending", "waiting", "running", "failed", "canceled", "successful"] + "enum": [ + "pending", + "waiting", + "running", + "failed", + "canceled", + "successful" + ] }, "started": { "type": "string", diff --git a/src/views/IOC/IOCDetailsView.js b/src/views/IOC/IOCDetailsView.js index 813d7931..70cf1c8a 100644 --- a/src/views/IOC/IOCDetailsView.js +++ b/src/views/IOC/IOCDetailsView.js @@ -55,7 +55,8 @@ export function IOCDetailsView({ ioc, getIOC, loading }) { useEffect(() => { if(ioc.activeDeployment) { let requestParams = initRequestParams(commandLazyParams, null, commandColumnSort); - requestParams.deployment_id = ioc.activeDeployment.id; + requestParams.ioc_id = ioc.id; + //requestParams.deployment_id = ioc.activeDeployment.id; getCommands(requestParams); } }, [getCommands, commandLazyParams, commandColumnSort, ioc]) -- GitLab