Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • andersharrisson/ce-deploy-ui
  • ccce/dev/ce-deploy-ui
2 results
Show changes
Commits on Source (8)
Showing
with 2801 additions and 2198 deletions
......@@ -82,7 +82,7 @@ export function IOCLiveStatus({ ioc }) {
renderNoAccess={() => <></>}
>
<LokiContainer
hostId={liveIOC.activeDeployment?.host.hostId}
hostName={liveIOC.activeDeployment?.host.hostName}
iocName={ioc.namingName}
isDeployed={isIocDeployed(ioc)}
/>
......
......@@ -13,7 +13,7 @@ function IOCLiveStatusContainer() {
const params = useMemo(
() => ({
ioc_id: 4
ioc_id: 15
}),
[]
);
......@@ -28,12 +28,12 @@ function IOCLiveStatusContainer() {
function commonTests() {
// Expect IOC name in badge
cy.contains("CCCE:SC-IOC-004");
cy.contains("CCCE:MOCK2");
// Expected in Info table:
cy.contains("0.0.1"); // git reference
cy.contains("This is a test IOC with mock data and errors"); // description
cy.contains("ccpu-evrtm.tn.esss.lu.se"); // deployed on
cy.contains("correct_ioc"); // git reference
cy.contains("Test IOC for CCCE"); // description
cy.contains("ccce-test-ioc-01.cslab.esss.lu.se"); // deployed on
// Expect alerts to be displayed
cy.get("#ioc-alerts")
......@@ -62,7 +62,7 @@ describe("IOCLiveStatus", () => {
it("displays the logged in view", () => {
commonTests();
// check for procserv logs
cy.wait("@getProcservLogs");
cy.wait("@fetchProcServLogLines");
cy.contains("This is some fake log data");
});
});
......
......@@ -10,7 +10,7 @@ function createRequest(id) {
};
}
export const IOCStatus = ({ id, activeDeployment }) => {
export const IOCStatus = ({ id }) => {
const client = useContext(apiContext);
const params = useMemo(() => createRequest(id), [id]);
......@@ -20,7 +20,7 @@ export const IOCStatus = ({ id, activeDeployment }) => {
loading,
dataReady
} = useAPIMethod({
fcn: client.apis.Monitoring.fetchIocStatus,
fcn: client.apis.IOCs.fetchIocStatus,
params
});
......@@ -38,7 +38,7 @@ export const IOCStatus = ({ id, activeDeployment }) => {
width={20}
/>
) : (
<IOCStatusIcon ioc={{ id, activeDeployment, ...ioc }} />
<IOCStatusIcon ioc={ioc} />
)}
</Grid>
);
......
......@@ -7,7 +7,7 @@ const textColumns = ["IOC name", "Description", "Host", "Network"];
const columns = ["Status"].concat(textColumns);
const firstRowData = [
"Alert 1 warnings1 errors !",
"VacS-RFQ:SC-IOC-130",
"CCCE:MOCK1",
"Some description",
"vacs-accv-vm-ioc",
"ChannelAccess-FEB"
......@@ -21,7 +21,6 @@ describe("IOCTable", () => {
it("Has the correct columns", () => {
cy.findAllByRole("columnheader").each(($el, index) => {
console.debug(index, columns[index]);
cy.wrap($el).contains(columns[index], { matchCase: false });
});
});
......
import React, { useContext, useMemo } from "react";
import React from "react";
import { Box, Typography } from "@mui/material";
import { LokiPanel } from "./LokiPanel";
import { apiContext } from "../../../api/DeployApi";
import { useAPIMethod } from "@ess-ics/ce-ui-common";
export function LokiContainer({ hostId, iocName, isDeployed }) {
const client = useContext(apiContext);
const { value: iocHost } = useAPIMethod({
fcn: client.apis.Hosts.findHostWithStatusById,
params: useMemo(() => ({ host_id: hostId }), [hostId])
});
export function LokiContainer({ hostName, iocName, isDeployed }) {
return (
<>
{iocHost && (
{hostName && (
<Box sx={{ pt: 2 }}>
<Typography
sx={{ my: 2.5 }}
......@@ -23,7 +14,7 @@ export function LokiContainer({ hostId, iocName, isDeployed }) {
IOC log stream
</Typography>
<LokiPanel
host={iocHost}
hostName={hostName}
isSyslog={false}
iocName={iocName}
isDeployed={isDeployed}
......
......@@ -60,14 +60,14 @@ const Root = styled("div")(({ theme }) => ({
}));
/**
* host: the host URL which will be the qery parameter for backend call
* hostName: name of the host (mandatory) which will be the qery parameter for backend call
* iocName: name of ioc (optional). Used when querying procServ log
* isSyslog: boolean, if true -> SysLog will be queried, if false -> procServLog will be queried
* isDeployed: boolean, if true -> periodic update (backend query) will be enabled, if false -> periodic update will be disabled
*/
const LOG_POLL_INTERVAL = 5000;
export function LokiPanel({ host, iocName, isSyslog, isDeployed }) {
export function LokiPanel({ hostName, iocName, isSyslog, isDeployed }) {
const showWarning = useCustomSnackbar();
const client = useContext(apiContext);
......@@ -86,7 +86,6 @@ export function LokiPanel({ host, iocName, isSyslog, isDeployed }) {
[showWarning]
);
const hostName = host.netBoxHost.name;
const [timeRange, setTimeRange] = React.useState(720);
const [timeRangeText, setTimeRangeText] = React.useState("12 hours");
const [periodChange, setPeriodChange] = useState(false);
......@@ -179,7 +178,7 @@ export function LokiPanel({ host, iocName, isSyslog, isDeployed }) {
error: sysLogError,
abort: getSysLogDataAbort
} = useAPIMethod({
fcn: client.apis.Monitoring.fetchSyslogLines,
fcn: client.apis.Hosts.fetchSyslogLines,
call: false,
params
});
......@@ -191,7 +190,7 @@ export function LokiPanel({ host, iocName, isSyslog, isDeployed }) {
error: procServLogError,
abort: getProcServLogAbort
} = useAPIMethod({
fcn: client.apis.Monitoring.fetchProcServLogLines,
fcn: client.apis.IOCs.fetchProcServLogLines,
call: false,
params
});
......
import React from "react";
import { IconBadge } from "@ess-ics/ce-ui-common";
import { HostStatusIcon } from "./HostIcons";
import { HostStatusIcon } from "./HostStatusIcon";
export function HostBadge({ host, ...rest }) {
return (
<IconBadge
icon={<HostStatusIcon host={host} />}
icon={<HostStatusIcon hostStatus={host.status} />}
title={host.netBoxHost?.fqdn}
subtitle={host.netBoxHost?.network || "---"}
{...rest}
......
import React, { useContext, useMemo } from "react";
import { Grid, Skeleton } from "@mui/material";
import { apiContext } from "../../api/DeployApi";
import { useAPIMethod } from "@ess-ics/ce-ui-common";
import { HostStatusIcon } from "./HostStatusIcon";
function createRequest(hostId) {
return {
host_id: hostId
};
}
export const HostStatus = ({ hostId }) => {
const client = useContext(apiContext);
const params = useMemo(() => createRequest(hostId), [hostId]);
const {
value: hostStatus,
loading,
dataReady
} = useAPIMethod({
fcn: client.apis.Hosts.findHostStatus,
params
});
return (
<Grid
container
direction="column"
justifyContent="center"
alignItems="center"
>
{loading || !dataReady ? (
<Skeleton
variant="circular"
height={20}
width={20}
/>
) : (
<HostStatusIcon hostStatus={hostStatus} />
)}
</Grid>
);
};
......@@ -9,10 +9,10 @@ import {
} from "@mui/icons-material";
import { LabeledIcon } from "@ess-ics/ce-ui-common";
export function HostStatusIcon({ host }) {
export function HostStatusIcon({ hostStatus }) {
const theme = useTheme();
let { status, alertSeverity, alerts } = host;
let { status, alertSeverity, alerts } = hostStatus;
const iconConfig = {
available: {
......
import React from "react";
import { Table, InternalLink, EllipsisText } from "@ess-ics/ce-ui-common";
import { HostStatusIcon } from "./HostIcons";
import { HostStatus } from "./HostStatus";
const columns = [
{
field: "bulb",
field: "status",
headerName: "Status",
flex: 0,
headerAlign: "center",
......@@ -16,11 +16,10 @@ const columns = [
{ field: "scope", headerName: "Network scope" }
];
export function createRow(hostContainer) {
const host = hostContainer.netBoxHost;
export function createRow(host) {
return {
id: host.hostId,
bulb: <HostStatusIcon host={hostContainer} />,
status: <HostStatus hostId={host.hostId} />,
hostName: (
<InternalLink
to={`/hosts/${host.hostId}`}
......@@ -33,11 +32,7 @@ export function createRow(hostContainer) {
host: host,
description: <EllipsisText>{host.description}</EllipsisText>,
network: <EllipsisText>{host.network}</EllipsisText>,
scope: <EllipsisText>{host.scope}</EllipsisText>,
discrepancy: hostContainer.alertSeverity === "WARNING",
inconsistentState: hostContainer.alertSeverity === "ERROR",
shortenLongData: true,
iocNotDeployed: !hostContainer.iocDeployed
scope: <EllipsisText>{host.scope}</EllipsisText>
};
}
......
......@@ -2,20 +2,20 @@ import React from "react";
import { composeStories } from "@storybook/react";
import * as stories from "../../stories/components/common/host/HostTable.stories";
const { Populated } = composeStories(stories);
const { AfterAsync } = composeStories(stories);
const textColumns = ["host", "description", "network", "scope"];
const columns = ["status"].concat(textColumns);
const firstRowData = [
"Active",
"mebt-vm-ioc01",
"MEBT RF SSPA (Buncher Amplifier) IOC",
"ChannelAccess-ACC"
"pbi-bcm03-mtca-ioc01",
"",
"BeamDiagLabNetworks"
];
describe("HostTable", () => {
context("Populated Table", () => {
beforeEach(() => {
cy.mount(<Populated />);
cy.mount(<AfterAsync />);
});
it("Has the correct columns", () => {
......
import { HostBadge } from "./HostBadge";
import { HostStatusIcon } from "./HostIcons";
import { HostStatusIcon } from "./HostStatusIcon";
import { HostTable, rowDescription, createRow } from "./HostTable";
export { HostBadge, HostStatusIcon, HostTable, rowDescription, createRow };
[
{
"hostId": "MjE5MV9mYWxzZQ",
"assigned": true,
"status": "AVAILABLE",
"alerts": []
},
{
"hostId": "MjIwNV9mYWxzZQ",
"assigned": true,
"status": "AVAILABLE",
"alerts": [
{
"type": "ERROR",
"message": "The host is under attack by hackers.",
"link": null
},
{
"type": "WARNING",
"message": "Prometheus exporters cannot be found (IOC and host details cannot be acquired)",
"link": null
}
]
},
{
"hostId": "MjE3Nl9mYWxzZQ",
"assigned": false,
"status": "AVAILABLE",
"alerts": [
{
"type": "INFO",
"message": "There are no IOCs deployed to host",
"link": null
}
]
},
{
"hostId": "MzcwNF9mYWxzZQ",
"assigned": true,
"status": "AVAILABLE",
"alerts": [
{
"type": "WARNING",
"message": "Host has exceeded the maximum number of IOCs (20).",
"link": null
},
{
"type": "ERROR",
"message": "The host is under attack by hackers.",
"link": null
}
]
},
{
"hostId": "MzcwM19mYWxzZQ",
"assigned": true,
"status": "AVAILABLE",
"alerts": [
{
"type": "WARNING",
"message": "Host has exceeded the maximum number of IOCs (20).",
"link": null
},
{
"type": "ERROR",
"message": "The host is under attack by hackers.",
"link": null
}
]
},
{
"hostId": "NDkzN190cnVl",
"assigned": true,
"status": "UNREACHABLE",
"alerts": [
{
"type": "INFO",
"message": "Host not reachable",
"link": null
}
]
},
{
"hostId": "MjEwOF9mYWxzZQ",
"assigned": false,
"status": "AVAILABLE",
"alerts": [
{
"type": "INFO",
"message": "There are no IOCs deployed to host",
"link": null
}
]
},
{
"hostId": "NDk5MV90cnVl",
"assigned": true,
"status": "UNREACHABLE",
"alerts": [
{
"type": "INFO",
"message": "Host not reachable",
"link": null
}
]
},
{
"hostId": "MjE5M19mYWxzZQ",
"assigned": true,
"status": "AVAILABLE",
"alerts": [
{
"type": "WARNING",
"message": "Host has exceeded the maximum number of IOCs (20).",
"link": null
},
{
"type": "ERROR",
"message": "The host is under attack by hackers.",
"link": null
}
]
},
{
"hostId": "NTU4MF90cnVl",
"assigned": false,
"status": "UNREACHABLE",
"alerts": [
{
"type": "INFO",
"message": "Host not reachable",
"link": null
}
]
},
{
"hostId": "NDkwMF90cnVl",
"assigned": false,
"status": "UNREACHABLE",
"alerts": [
{
"type": "INFO",
"message": "Host not reachable",
"link": null
}
]
},
{
"hostId": "MjY2NV9mYWxzZQ",
"assigned": true,
"status": "AVAILABLE",
"alerts": [
{
"type": "WARNING",
"message": "Prometheus exporters cannot be found (IOC and host details cannot be acquired)",
"link": null
}
]
},
{
"hostId": "MTM0MV90cnVl",
"assigned": false,
"status": "UNREACHABLE",
"alerts": [
{
"type": "INFO",
"message": "Host not reachable",
"link": null
}
]
},
{
"hostId": "Mjg3X2ZhbHNl",
"assigned": true,
"status": "UNREACHABLE",
"alerts": [
{
"type": "INFO",
"message": "Host not reachable",
"link": null
}
]
},
{
"hostId": "MzU1X2ZhbHNl",
"assigned": true,
"status": "UNREACHABLE",
"alerts": [
{
"type": "INFO",
"message": "Host not reachable",
"link": null
}
]
},
{
"hostId": "MTE5Nl90cnVl",
"assigned": true,
"status": "UNREACHABLE",
"alerts": [
{
"type": "INFO",
"message": "Host not reachable",
"link": null
}
]
},
{
"hostId": "MzQ3N19mYWxzZQ",
"assigned": true,
"status": "AVAILABLE",
"alerts": [
{
"type": "WARNING",
"message": "Host has exceeded the maximum number of IOCs (20).",
"link": null
},
{
"type": "ERROR",
"message": "The host is under attack by hackers.",
"link": null
}
]
},
{
"hostId": "MTE0X3RydWU",
"assigned": true,
"status": "AVAILABLE",
"alerts": [
{
"type": "WARNING",
"message": "Host has exceeded the maximum number of IOCs (20).",
"link": null
},
{
"type": "ERROR",
"message": "The host is under attack by hackers.",
"link": null
}
]
},
{
"hostId": "Mjk4MV90cnVl",
"assigned": true,
"status": "UNREACHABLE",
"alerts": [
{
"type": "INFO",
"message": "Host not reachable",
"link": null
}
]
},
{
"hostId": "MjUwNl9mYWxzZQ",
"assigned": false,
"status": "AVAILABLE",
"alerts": [
{
"type": "INFO",
"message": "There are no IOCs deployed to host",
"link": null
}
]
},
{
"hostId": "NDMzOF90cnVl",
"assigned": true,
"status": "UNREACHABLE",
"alerts": [
{
"type": "INFO",
"message": "Host not reachable",
"link": null
}
]
},
{
"hostId": "MTczNl90cnVl",
"assigned": false,
"status": "UNREACHABLE",
"alerts": [
{
"type": "INFO",
"message": "Host not reachable",
"link": null
}
]
},
{
"hostId": "MTA2MF90cnVl",
"assigned": false,
"status": "UNREACHABLE",
"alerts": [
{
"type": "INFO",
"message": "Host not reachable",
"link": null
}
]
},
{
"hostId": "MjkyMV90cnVl",
"assigned": true,
"status": "UNREACHABLE",
"alerts": [
{
"type": "INFO",
"message": "Host not reachable",
"link": null
}
]
},
{
"hostId": "MjYzN190cnVl",
"assigned": true,
"status": "UNREACHABLE",
"alerts": [
{
"type": "INFO",
"message": "Host not reachable",
"link": null
}
]
},
{
"hostId": "MjYzOF90cnVl",
"assigned": false,
"status": "UNREACHABLE",
"alerts": [
{
"type": "INFO",
"message": "Host not reachable",
"link": null
}
]
},
{
"hostId": "MjYzOV90cnVl",
"assigned": false,
"status": "UNREACHABLE",
"alerts": [
{
"type": "INFO",
"message": "Host not reachable",
"link": null
}
]
},
{
"hostId": "NTQ0M190cnVl",
"assigned": false,
"status": "UNREACHABLE",
"alerts": [
{
"type": "INFO",
"message": "Host not reachable",
"link": null
}
]
},
{
"hostId": "MzkxOV9mYWxzZQ",
"assigned": true,
"status": "AVAILABLE",
"alerts": [
{
"type": "WARNING",
"message": "Prometheus exporters cannot be found (IOC and host details cannot be acquired)",
"link": null
}
]
},
{
"hostId": "NjEyX3RydWU",
"assigned": true,
"status": "AVAILABLE",
"alerts": [
{
"type": "WARNING",
"message": "Prometheus exporters cannot be found (IOC and host details cannot be acquired)",
"link": null
}
]
},
{
"hostId": "NDUwMV90cnVl",
"assigned": false,
"status": "UNREACHABLE",
"alerts": [
{
"type": "INFO",
"message": "Host not reachable",
"link": null
}
]
},
{
"hostId": "NTU5NV90cnVl",
"assigned": false,
"status": "UNREACHABLE",
"alerts": [
{
"type": "INFO",
"message": "Host not reachable",
"link": null
}
]
},
{
"hostId": "MTI1M190cnVl",
"assigned": true,
"status": "UNREACHABLE",
"alerts": [
{
"type": "INFO",
"message": "Host not reachable",
"link": null
}
]
},
{
"hostId": "MzUzMF90cnVl",
"assigned": true,
"status": "UNREACHABLE",
"alerts": [
{
"type": "INFO",
"message": "Host not reachable",
"link": null
}
]
},
{
"hostId": "NDA0Ml90cnVl",
"assigned": false,
"status": "UNREACHABLE",
"alerts": [
{
"type": "INFO",
"message": "Host not reachable",
"link": null
}
]
},
{
"hostId": "NDUyMV90cnVl",
"assigned": false,
"status": "UNREACHABLE",
"alerts": [
{
"type": "INFO",
"message": "Host not reachable",
"link": null
}
]
},
{
"hostId": "MTk2NV90cnVl",
"assigned": true,
"status": "UNREACHABLE",
"alerts": [
{
"type": "INFO",
"message": "Host not reachable",
"link": null
}
]
},
{
"hostId": "Mzk4OV90cnVl",
"assigned": true,
"status": "UNREACHABLE",
"alerts": [
{
"type": "INFO",
"message": "Host not reachable",
"link": null
}
]
},
{
"hostId": "ODQzX3RydWU",
"assigned": false,
"status": "AVAILABLE",
"alerts": [
{
"type": "INFO",
"message": "There are no IOCs deployed to host",
"link": null
}
]
},
{
"hostId": "MzE1X3RydWU",
"assigned": false,
"status": "AVAILABLE",
"alerts": [
{
"type": "INFO",
"message": "There are no IOCs deployed to host",
"link": null
}
]
},
{
"hostId": "NDQ1M190cnVl",
"assigned": false,
"status": "UNREACHABLE",
"alerts": [
{
"type": "INFO",
"message": "Host not reachable",
"link": null
}
]
},
{
"hostId": "NDYwMV90cnVl",
"assigned": false,
"status": "UNREACHABLE",
"alerts": [
{
"type": "INFO",
"message": "Host not reachable",
"link": null
}
]
},
{
"hostId": "NDkwM190cnVl",
"assigned": true,
"status": "UNREACHABLE",
"alerts": [
{
"type": "INFO",
"message": "Host not reachable",
"link": null
}
]
},
{
"hostId": "NDk1NV90cnVl",
"assigned": true,
"status": "UNREACHABLE",
"alerts": [
{
"type": "INFO",
"message": "Host not reachable",
"link": null
}
]
},
{
"hostId": "NzQ4X3RydWU=",
"assigned": false,
"status": "AVAILABLE",
"alerts": [
{
"type": "INFO",
"message": "There are no IOCs deployed to host",
"link": null
}
]
},
{
"hostId": "Mjc0NV90cnVl",
"assigned": false,
"status": "UNREACHABLE",
"alerts": [
{
"type": "INFO",
"message": "Host not reachable",
"link": null
}
]
},
{
"hostId": "NDQwNV90cnVl",
"assigned": true,
"status": "UNREACHABLE",
"alerts": [
{
"type": "INFO",
"message": "Host not reachable",
"link": null
}
]
},
{
"hostId": "MzMyOV90cnVl",
"assigned": true,
"status": "UNREACHABLE",
"alerts": [
{
"type": "INFO",
"message": "Host not reachable",
"link": null
}
]
},
{
"hostId": "MzgwNl90cnVl",
"assigned": true,
"status": "UNREACHABLE",
"alerts": [
{
"type": "INFO",
"message": "Host not reachable",
"link": null
}
]
},
{
"hostId": "NDkwNl90cnVl",
"assigned": false,
"status": "UNREACHABLE",
"alerts": [
{
"type": "INFO",
"message": "Host not reachable",
"link": null
}
]
},
{
"hostId": "NDk3N190cnVl",
"assigned": true,
"status": "UNREACHABLE",
"alerts": [
{
"type": "INFO",
"message": "Host not reachable",
"link": null
}
]
},
{
"hostId": "NTExN190cnVl",
"assigned": false,
"status": "UNREACHABLE",
"alerts": [
{
"type": "INFO",
"message": "Host not reachable",
"link": null
}
]
},
{
"hostId": "NDMxX2ZhbHNl",
"assigned": false,
"status": "UNREACHABLE",
"alerts": [
{
"type": "INFO",
"message": "Host not reachable",
"link": null
}
]
},
{
"hostId": "MjcxN190cnVl",
"assigned": false,
"status": "UNREACHABLE",
"alerts": [
{
"type": "INFO",
"message": "Host not reachable",
"link": null
}
]
},
{
"hostId": "NDc5X2ZhbHNl",
"assigned": true,
"status": "UNREACHABLE",
"alerts": [
{
"type": "INFO",
"message": "Host not reachable",
"link": null
}
]
},
{
"hostId": "MTA0NF9mYWxzZQ",
"assigned": false,
"status": "AVAILABLE",
"alerts": [
{
"type": "INFO",
"message": "There are no IOCs deployed to host",
"link": null
}
]
},
{
"hostId": "MTI5NF90cnVl",
"assigned": false,
"status": "UNREACHABLE",
"alerts": [
{
"type": "INFO",
"message": "Host not reachable",
"link": null
}
]
},
{
"hostId": "MzQ3Ml90cnVl",
"assigned": true,
"status": "UNREACHABLE",
"alerts": [
{
"type": "INFO",
"message": "Host not reachable",
"link": null
}
]
},
{
"hostId": "NTA3X2ZhbHNl",
"assigned": true,
"status": "UNREACHABLE",
"alerts": [
{
"type": "INFO",
"message": "Host not reachable",
"link": null
}
]
},
{
"hostId": "MjY5Ml90cnVl",
"assigned": true,
"status": "UNREACHABLE",
"alerts": [
{
"type": "INFO",
"message": "Host not reachable",
"link": null
}
]
},
{
"hostId": "NDgyOV90cnVl",
"assigned": true,
"status": "UNREACHABLE",
"alerts": [
{
"type": "INFO",
"message": "Host not reachable",
"link": null
}
]
},
{
"hostId": "NDgxNF9mYWxzZQ",
"assigned": true,
"status": "AVAILABLE",
"alerts": [
{
"type": "WARNING",
"message": "Host has exceeded the maximum number of IOCs (20).",
"link": null
},
{
"type": "ERROR",
"message": "The host is under attack by hackers.",
"link": null
}
]
},
{
"hostId": "MzUyN190cnVl",
"assigned": true,
"status": "UNREACHABLE",
"alerts": [
{
"type": "INFO",
"message": "Host not reachable",
"link": null
}
]
}
]
This diff is collapsed.
[
{
"id": 1,
"description": "This is a test IOC for demonstrating the deployment tool"
"id": 14,
"description": ""
},
{
"id": 2,
"id": 15,
"description": "Test IOC for CCCE"
},
{
"id": 346,
"id": 18,
"description": "Some description"
},
{
"id": 39,
"description": ""
},
{
"id": 21
},
{
"id": 49,
"description": "some fun description"
},
{
"id": 40
},
{
"id": 41
},
{
"id": 42,
"description": "some description"
},
{
"id": 43,
"description": "some description"
}
]
[
{
"id": 1,
"description": "This is a test IOC for demonstrating the deployment tool",
"createdBy": "johnsparger",
"namingName": "CCCE:SC-IOC-001",
"namingUuid": "77325d6f-6d85-443f-b448-3d99a941e23e",
"gitProjectId": 5215,
"sourceUrl": "https://gitlab.esss.lu.se/ccce/dev/iocs/e3-ioc-test_49.git",
"sourceVersion": "0.0.1",
"sourceVersionShort": "0.0.1",
"id": 14,
"description": "Some description",
"createdBy": "mock user 1",
"namingName": "CCCE:MOCK1",
"namingUuid": "82a01351-2892-491e-932b-6fe438216cfd",
"gitProjectId": 5959,
"sourceUrl": "https://gitlab.esss.lu.se/ccce/dev/iocs/instances/e3-ioc-test-01.git",
"activeDeployment": null,
"alerts": [],
"deployedWithOldPlaybook": true,
"alerts": [
{
"type": "INFO",
"message": "IOC is not deployed",
"link": null
}
],
"operationInProgress": false,
"active": null
},
{
"id": 2,
"description": "Test instance used by the CCCE team, with mock data",
"createdBy": "christinajenks",
"namingName": "CCCE:SC-IOC-002",
"id": 15,
"description": "Test IOC for CCCE",
"namingName": "CCCE:MOCK2",
"createdBy": "mock user 2",
"namingUuid": "0a7fdee4-cfa6-447f-ab85-ae9335507fd3",
"gitProjectId": 5970,
"sourceUrl": "https://gitlab.esss.lu.se/ccce/dev/iocs/instances/e3-ioc-test-02.git",
"activeDeployment": {
"id": 410,
"createdBy": "johannaszepanski",
"startDate": "2024-06-05T09:37:56.994+0200",
"createdAt": "2024-06-05T09:37:24.577+0200",
"undeployment": false,
"namingName": "CCCE:SC-IOC-020",
"gitProjectId": 5970,
"sourceVersion": "correct_ioc",
"operationId": 560,
"endDate": "2024-06-05T09:39:06.763+0200",
"iocName": "CCCE:SC-IOC-020",
"host": {
"hostId": "MTUxX3RydWU=",
"externalIdValid": true,
"fqdn": "ccce-test-ioc-01.cslab.esss.lu.se",
"hostName": "ccce-test-ioc-01",
"network": "CSLab-GeneralLab"
},
"awxJobId": 6588,
"sourceUrl": "https://gitlab.esss.lu.se/ccce/dev/iocs/instances/e3-ioc-test-02.git",
"sourceVersionShort": "d4df546c",
"operationStatus": "FAILED"
},
"deployedWithOldPlaybook": false,
"alerts": [
{
"type": "ERROR",
"message": "Example alert without link",
"link": null
},
{
"type": "ERROR",
"message": "Example alert with link",
"link": "https://google.com"
}
],
"operationInProgress": false,
"active": null
},
{
"id": 18,
"description": "Some description",
"namingName": "CCCE:MOCK3",
"createdBy": "mock user 3",
"namingUuid": "7bb52b4b-80d8-4cd9-b09a-88a9d1216df9",
"gitProjectId": 5971,
"sourceUrl": "https://gitlab.esss.lu.se/ccce/dev/iocs/instances/e3-ioc-test-03.git",
......@@ -35,91 +88,194 @@
"active": null
},
{
"id": 3,
"description": "This is a test IOC with mock data",
"createdBy": "gabrielfedel",
"namingName": "CCCE:SC-IOC-003",
"namingUuid": "40e4561e-6688-4324-b03a-dc6e4c44b06b",
"gitProjectId": 9332,
"sourceUrl": "https://gitlab.esss.lu.se/iocs/manual/e3-ioc-rastermagnets-evr-1.git",
"id": 39,
"description": "",
"namingName": "CCCE:MOCK4",
"createdBy": "mock user 4",
"namingUuid": "b4589713-b42a-4131-a086-4307ca381d81",
"gitProjectId": 5972,
"sourceUrl": "https://gitlab.esss.lu.se/ccce/dev/iocs/instances/e3-ioc-test-04.git",
"activeDeployment": {
"id": 10440,
"createdBy": "gabrielfedel",
"startDate": "2024-05-08T09:28:47.068+0200",
"createdAt": "2024-05-08T09:28:34.497+0200",
"id": 408,
"createdBy": "johannaszepanski",
"startDate": "2024-06-05T09:25:40.892+0200",
"createdAt": "2024-06-05T09:25:08.891+0200",
"undeployment": false,
"namingName": "A2T-010Row:SC-IOC-002",
"gitProjectId": 9332,
"sourceVersion": "0.0.1",
"operationId": 13860,
"endDate": "2024-05-08T09:31:31.378+0200",
"iocName": "A2T-010Row:SC-IOC-002",
"namingName": "CCCE:SC-IOC-040",
"gitProjectId": 5972,
"sourceVersion": "alias",
"operationId": 558,
"endDate": "2024-06-05T09:26:59.372+0200",
"iocName": "CCCE:SC-IOC-040",
"host": {
"hostId": "NDE5NV90cnVl",
"hostId": "MTUyX3RydWU=",
"externalIdValid": true,
"fqdn": "ccpu-evrtm.tn.esss.lu.se",
"hostName": "ccpu-evrtm",
"network": "Controls-Linac"
"fqdn": "ccce-test-ioc-02.cslab.esss.lu.se",
"hostName": "ccce-test-ioc-02",
"network": "CSLab-GeneralLab"
},
"awxJobId": 495642,
"sourceUrl": "https://gitlab.esss.lu.se/iocs/manual/e3-ioc-rastermagnets-evr-1.git",
"sourceVersionShort": "fd7e5c70",
"operationStatus": "SUCCESSFUL"
"awxJobId": 6580,
"sourceUrl": "https://gitlab.esss.lu.se/ccce/dev/iocs/instances/e3-ioc-test-04.git",
"sourceVersionShort": "8fd94089",
"operationStatus": "FAILED"
},
"alerts": [],
"deployedWithOldPlaybook": false,
"alerts": [],
"operationInProgress": false,
"active": true
"active": null
},
{
"id": 4,
"description": "This is a test IOC with mock data and errors",
"createdBy": "gabrielfedel",
"namingName": "CCCE:SC-IOC-004",
"namingUuid": "40e4561e-6688-4324-b03a-dc6e4c44b06b",
"gitProjectId": 9332,
"sourceUrl": "https://gitlab.esss.lu.se/iocs/manual/e3-ioc-rastermagnets-evr-1.git",
"id": 21,
"namingName": "CCCE:MOCK5",
"createdBy": "mock user 5",
"namingUuid": "094b4411-447b-43f1-966b-6a37faf46366",
"gitProjectId": 8094,
"sourceUrl": "https://gitlab.esss.lu.se/ccce/dev/iocs/instances/e3-ioc-test-05.git",
"activeDeployment": {
"id": 10440,
"createdBy": "gabrielfedel",
"startDate": "2024-05-08T09:28:47.068+0200",
"createdAt": "2024-05-08T09:28:34.497+0200",
"id": 397,
"createdBy": "simonrose",
"startDate": "2024-04-11T09:30:18.786+0200",
"createdAt": "2024-04-11T09:29:48.620+0200",
"undeployment": false,
"namingName": "A2T-010Row:SC-IOC-002",
"gitProjectId": 9332,
"sourceVersion": "0.0.1",
"operationId": 13860,
"endDate": "2024-05-08T09:31:31.378+0200",
"iocName": "A2T-010Row:SC-IOC-002",
"namingName": "CCCE:SC-IOC-050",
"gitProjectId": 8094,
"sourceVersion": "1.0.0",
"operationId": 546,
"endDate": "2024-04-11T09:31:53.395+0200",
"iocName": "CCCE:SC-IOC-050",
"host": {
"hostId": "NDE5NV90cnVl",
"hostId": "MTUyX3RydWU=",
"externalIdValid": true,
"fqdn": "ccpu-evrtm.tn.esss.lu.se",
"hostName": "ccpu-evrtm",
"network": "Controls-Linac"
"fqdn": "ccce-test-ioc-02.cslab.esss.lu.se",
"hostName": "ccce-test-ioc-02",
"network": "CSLab-GeneralLab"
},
"awxJobId": 495642,
"sourceUrl": "https://gitlab.esss.lu.se/iocs/manual/e3-ioc-rastermagnets-evr-1.git",
"sourceVersionShort": "fd7e5c70",
"awxJobId": 6479,
"sourceUrl": "https://gitlab.esss.lu.se/ccce/dev/iocs/instances/e3-ioc-test-05.git",
"sourceVersionShort": "da21c190",
"operationStatus": "SUCCESSFUL"
},
"deployedWithOldPlaybook": false,
"alerts": [],
"operationInProgress": false,
"active": null
},
{
"id": 49,
"description": "some fun description",
"namingName": "CCCE:MOCK6",
"createdBy": "mock user 6",
"namingUuid": "36a9cb87-66dc-4ba6-aff8-290389b083d1",
"gitProjectId": 12972,
"sourceUrl": "https://gitlab.esss.lu.se/ccce/dev/iocs/instances/e3-ioc-jsztest-3.git",
"activeDeployment": null,
"deployedWithOldPlaybook": true,
"alerts": [
{
"type": "INFO",
"message": "IOC is not deployed",
"link": null
}
],
"operationInProgress": false,
"active": null
},
{
"id": 40,
"namingName": "CCCE:MOCK-TEST",
"createdBy": "mock user",
"namingUuid": "0eb277a2-0984-4f94-a8de-9c31f0c4948b",
"gitProjectId": null,
"sourceUrl": null,
"activeDeployment": null,
"deployedWithOldPlaybook": true,
"alerts": [
{
"type": "ERROR",
"message": "Example alert without link"
"message": "Cannot find the repository in Gitlab",
"link": null
},
{
"type": "INFO",
"message": "IOC is not deployed",
"link": null
}
],
"operationInProgress": false,
"active": null
},
{
"id": 41,
"namingName": "CCCE:MOCK7",
"createdBy": "mock user 7",
"namingUuid": "aa819884-2422-4227-91fb-60245db3d453",
"gitProjectId": null,
"sourceUrl": null,
"activeDeployment": null,
"deployedWithOldPlaybook": true,
"alerts": [
{
"type": "ERROR",
"message": "Example alert with link",
"link": "https://google.com"
"message": "Cannot find the repository in Gitlab",
"link": null
},
{
"type": "INFO",
"message": "IOC is not deployed",
"link": null
}
],
"deployedWithOldPlaybook": false,
"operationInProgress": false,
"active": true
"active": null
},
{
"id": 346,
"description": "Some description"
"id": 42,
"description": "some description",
"namingName": "CCCE:MOCK8",
"createdBy": "mock user 8",
"namingUuid": "9f7f3ca9-f088-4c93-9663-6051dc06df68",
"gitProjectId": null,
"sourceUrl": null,
"activeDeployment": null,
"deployedWithOldPlaybook": true,
"alerts": [
{
"type": "ERROR",
"message": "Cannot find the repository in Gitlab",
"link": null
},
{
"type": "INFO",
"message": "IOC is not deployed",
"link": null
}
],
"operationInProgress": false,
"active": null
},
{
"id": 43,
"description": "some description",
"namingName": "CCCE:MOCK9",
"createdBy": "mock user 9",
"namingUuid": "da6be15b-1366-41be-af74-a8c84175cbc1",
"gitProjectId": null,
"sourceUrl": null,
"activeDeployment": null,
"deployedWithOldPlaybook": true,
"alerts": [
{
"type": "ERROR",
"message": "Cannot find the repository in Gitlab",
"link": null
},
{
"type": "INFO",
"message": "IOC is not deployed",
"link": null
}
],
"operationInProgress": false,
"active": null
}
]
[
{
"id": 346,
"active": true,
"iocId": 14,
"alertSeverity": "ERROR",
"alerts": [
{
"type": "WARNING",
"message": "A temporary gravity anomaly has been detected in the cafeteria. Please secure your trays and beverages. We suspect a rogue black hole passing by, or maybe someone just dropped a super-dense bagel again. Proceed with caution, and remember, what goes up might not come down for a while. Thank you for floating with us today."
"type": "ERROR",
"message": "IOC's latest deployment failed, IOC may be in inconsistent state",
"link": null
},
{
"type": "ERROR",
"message": "The area is currently experiencing an unexpected entropy reversal. As a precaution, ice cream in the freezer may spontaneously melt, then refreeze. We recommend eating it now, just to be safe. Also, be on the lookout for random acts of orderliness. Your messy desk might just organize itself, but don't get your hopes up."
"type": "WARNING",
"message": "This is a warning message",
"link": null
}
],
"alertSeverity": "ERROR"
"active": true
},
{
"id": 345,
"iocId": 15,
"alertSeverity": "WARNING",
"alerts": [
{
"type": "WARNING",
"message": "Example alert without link"
"message": "This is warning 1",
"link": null
},
{
"type": "ERROR",
"message": "Example alert with link",
"link": "https://google.com"
"type": "WARNING",
"message": "This is warning 2",
"link": null
}
],
"alertSeverity": "ERROR",
"active": true
"active": null
},
{
"id": 344,
"iocId": 18,
"alertSeverity": "INFO",
"alerts": [
{
"type": "WARNING",
"message": "Example alert warning for VacS-RFQ:SC-IOC-110"
"type": "INFO",
"message": "IOC is not deployed",
"link": null
}
],
"alertSeverity": "WARNING",
"active": true
},
{
"id": 328
"active": null
},
{
"id": 251
"iocId": 39,
"alertSeverity": null,
"alerts": [],
"active": null
},
{
"id": 249,
"active": true
"iocId": 21,
"alertSeverity": null,
"alerts": [],
"active": null
},
{
"id": 166,
"iocId": 49,
"alertSeverity": "INFO",
"alerts": [
{
"type": "ERROR",
"message": "Example alert error for RFQ-010:SC-IOC-001"
"type": "INFO",
"message": "IOC is not deployed",
"link": null
}
],
"alertSeverity": "ERROR"
"active": null
},
{
"id": 148,
"alerts": [
{
"type": "WARNING",
"message": "Example alert warning for RFQ-010:SC-IOC-977"
}
],
"alertSeverity": "WARNING",
"iocId": 40,
"alertSeverity": null,
"alerts": [],
"active": true
},
{
"id": 116,
"iocId": 41,
"alertSeverity": null,
"alerts": [],
"active": true
},
{
"id": 76,
"iocId": 42,
"alertSeverity": null,
"alerts": [],
"active": true
},
{
"id": 13,
"iocId": 43,
"alertSeverity": "ERROR",
"alerts": [
{
"type": "WARNING",
"message": "Example alert warning for RFQ-010:SC-IOC-056"
}
],
"alertSeverity": "WARNING",
"active": true
},
{
"id": 10
},
{
"id": 9,
"active": true
},
{
"id": 8
},
{
"id": 6
},
{
"id": 4,
"active": true
},
{
"id": 3,
"alerts": [
"type": "ERROR",
"message": "Cannot find the repository in Gitlab",
"link": null
},
{
"type": "WARNING",
"message": "Example alert warning RFQ-010:SC-IOC-006"
"type": "INFO",
"message": "IOC is not deployed",
"link": null
}
],
"alertSeverity": "WARNING",
"active": true
"active": null
}
]
{
"totalCount": 17,
"listSize": 17,
"totalCount": 10,
"listSize": 10,
"pageNumber": 0,
"limit": 150,
"limit": 20,
"iocList": [
{
"id": 346,
"namingName": "VacS-RFQ:SC-IOC-130",
"createdBy": "krisztianloki",
"gitProjectId": 5336,
"id": 14,
"namingName": "CCCE:MOCK1",
"createdBy": "mock user 1",
"gitProjectId": 5959,
"deployedWithOldPlaybook": true,
"activeDeployment": {
"host": {
"hostId": 3354,
"fqdn": "vacs-accv-vm-ioc.tn.esss.lu.se",
"hostId": "MTUxX3RydWU=",
"hostName": "vacs-accv-vm-ioc",
"network": "ChannelAccess-FEB"
"network": "ChannelAccess-FEB",
"netBoxHostFromCache": true
},
"sourceVersion": "1.0.0",
"sourceVersionShort": "1.0.0"
"sourceVersion": "correct_ioc",
"sourceVersionShort": null
}
},
{
"id": 345,
"namingName": "VacS-RFQ:SC-IOC-119",
"createdBy": "krisztianloki",
"gitProjectId": 5335,
"id": 15,
"namingName": "CCCE:MOCK2",
"createdBy": "mock user 2",
"gitProjectId": 5970,
"deployedWithOldPlaybook": false,
"activeDeployment": {
"host": {
"hostId": 3354,
"fqdn": "vacs-accv-vm-ioc.tn.esss.lu.se",
"hostName": "vacs-accv-vm-ioc",
"network": "ChannelAccess-FEB"
"hostId": "MTUxX3RydWU=",
"hostName": "ccce-test-ioc-01",
"network": "CSLab-GeneralLab",
"netBoxHostFromCache": true
},
"sourceVersion": "cc95ff21a09977fd2396ec1999259ec0a5e63147",
"sourceVersionShort": "cc95ff21"
"sourceVersion": "correct_ioc",
"sourceVersionShort": null
}
},
{
"id": 344,
"description": "some description",
"namingName": "VacS-RFQ:SC-IOC-110",
"createdBy": "krisztianloki",
"gitProjectId": 5334,
"activeDeployment": {
"host": {
"hostId": 3354,
"fqdn": "vacs-accv-vm-ioc.tn.esss.lu.se",
"hostName": "vacs-accv-vm-ioc",
"network": "ChannelAccess-FEB"
},
"sourceVersion": "9a3585a5bea4372f7d964b7e18b83aa3b1afc61f",
"sourceVersionShort": "9a3585a5"
}
"id": 18,
"namingName": "CCCE:MOCK3",
"createdBy": "mock user 3",
"gitProjectId": 5971,
"deployedWithOldPlaybook": false,
"activeDeployment": null
},
{
"id": 328,
"namingName": "RFQ-010:SC-IOC-117",
"createdBy": "gabrielfedel",
"gitProjectId": 5953,
"sourceVersion": null,
"activeDeployment": {}
},
{
"id": 251,
"description": "some description",
"namingName": "RFQ-010:SC-IOC-015",
"createdBy": "lucianocarneiro",
"gitProjectId": 5952,
"sourceVersion": null,
"activeDeployment": {}
},
{
"id": 249,
"description": "some description",
"namingName": "RFQ-010:SC-IOC-016",
"createdBy": "gabrielfedel",
"gitProjectId": 5954,
"id": 39,
"namingName": "CCCE:MOCK4",
"createdBy": "mock user 4",
"gitProjectId": 5972,
"deployedWithOldPlaybook": false,
"activeDeployment": {
"host": {
"hostId": 4205,
"fqdn": "rfq-rf-vm-ioc.tn.esss.lu.se",
"hostName": "rfq-rf-vm-ioc",
"network": "ChannelAccess-ACC"
"hostId": "MTUyX3RydWU=",
"hostName": "ccce-test-ioc-02",
"network": "CSLab-GeneralLab",
"netBoxHostFromCache": true
},
"sourceVersion": "1.0.1",
"sourceVersionShort": "1.0.1"
"sourceVersion": "alias",
"sourceVersionShort": null
}
},
{
"id": 166,
"namingName": "RFQ-010:SC-IOC-001",
"createdBy": "gabrielfedel",
"gitProjectId": 4314,
"id": 21,
"namingName": "CCCE:MOCK5",
"createdBy": "mock user 5",
"gitProjectId": 8094,
"deployedWithOldPlaybook": false,
"activeDeployment": {
"host": {
"hostId": 2245,
"fqdn": "rfq-llrf1-mtca-ioc.tn.esss.lu.se",
"hostName": "rfq-llrf1-mtca-ioc",
"network": "ChannelAccess-ACC"
},
"sourceVersion": "3.0.3",
"sourceVersionShort": "3.0.3"
}
},
{
"id": 148,
"description": "some description",
"namingName": "RFQ-010:SC-IOC-977",
"createdBy": "krisztianloki",
"gitProjectId": 5429,
"activeDeployment": {
"host": {
"hostId": 4178,
"fqdn": "rfq-ipc-01.tn.esss.lu.se",
"hostName": "rfq-ipc-01",
"network": "ChannelAccess-FEB"
},
"sourceVersion": "0.0.2-usb",
"sourceVersionShort": "0.0.2-usb"
}
},
{
"id": 116,
"description": "some description",
"namingName": "RFQ-010:SC-IOC-005",
"createdBy": "joaopaulomartins",
"gitProjectId": 1697,
"activeDeployment": {
"host": {
"hostId": 4696,
"fqdn": "rfq-rflps-vm-ioc01.tn.esss.lu.se",
"hostName": "rfq-rflps-vm-ioc01",
"network": "ChannelAccess-ACC"
"hostId": "MTUyX3RydWU=",
"hostName": "ccce-test-ioc-02",
"network": "CSLab-GeneralLab",
"netBoxHostFromCache": true
},
"sourceVersion": "1.0.0",
"sourceVersionShort": "1.0.0"
}
},
{
"id": 76,
"description": "some description",
"namingName": "RFQ-010:SC-IOC-004",
"createdBy": "joaopaulomartins",
"gitProjectId": 5257,
"activeDeployment": {
"host": {
"hostId": 4205,
"fqdn": "rfq-rf-vm-ioc.tn.esss.lu.se",
"hostName": "rfq-rf-vm-ioc",
"network": "ChannelAccess-ACC"
},
"sourceVersion": "1.1.0",
"sourceVersionShort": "1.1.0"
"sourceVersionShort": null
}
},
{
"id": 13,
"description": "some description",
"namingName": "RFQ-010:SC-IOC-056",
"createdBy": "krisztianloki",
"gitProjectId": 5056,
"activeDeployment": {
"host": {
"hostId": 4408,
"fqdn": "rfq-lob-vm-ioc.tn.esss.lu.se",
"hostName": "rfq-lob-vm-ioc",
"network": "ChannelAccess-FEB"
},
"sourceVersion": "2b8a031d7b698a6944e28408cb17241a7df9ec99",
"sourceVersionShort": "2b8a031d"
}
"id": 49,
"namingName": "CCCE:MOCK6",
"createdBy": "mock user 6",
"gitProjectId": 12972,
"deployedWithOldPlaybook": true,
"activeDeployment": null
},
{
"id": 10,
"description": "some description",
"namingName": "RFQ-010:SC-IOC-011",
"createdBy": "anderslindh",
"gitProjectId": 4929,
"sourceVersion": "961ebd48020add0282688437ae34dd0974b6fa15",
"activeDeployment": {},
"sourceVersionShort": "961ebd48"
"id": 40,
"namingName": "CCCE:MOCK-TEST",
"createdBy": "mock user",
"gitProjectId": 12733,
"deployedWithOldPlaybook": true,
"activeDeployment": null
},
{
"id": 9,
"description": "some description",
"namingName": "RFQ-010:SC-IOC-010",
"createdBy": "anderslindh",
"gitProjectId": 4875,
"activeDeployment": {
"host": {
"hostId": 4521,
"fqdn": "lab-rf-vm-ioc-02.cslab.esss.lu.se",
"hostName": "lab-rf-vm-ioc-02",
"network": "CSLab-GeneralLab"
},
"sourceVersion": "0527d4cfa1c64276634961fefa8f480d00faee26",
"sourceVersionShort": "0527d4cf"
}
"id": 41,
"namingName": "CCCE:MOCK7",
"createdBy": "mock user 7",
"gitProjectId": 12734,
"deployedWithOldPlaybook": true,
"activeDeployment": null
},
{
"id": 8,
"description": "some description",
"namingName": "RFQ-010:SC-IOC-009",
"createdBy": "anderslindh",
"gitProjectId": 4947,
"sourceVersion": null,
"activeDeployment": {}
"id": 42,
"namingName": "CCCE:MOCK8",
"createdBy": "mock user 8",
"gitProjectId": 12735,
"deployedWithOldPlaybook": true,
"activeDeployment": null
},
{
"id": 6,
"description": "some description",
"namingName": "RFQ-010:SC-IOC-008",
"createdBy": "anderslindh",
"gitProjectId": 2582,
"sourceVersion": null,
"activeDeployment": {}
},
{
"id": 4,
"description": "some description",
"namingName": "RFQ-010:SC-IOC-007",
"createdBy": "anderslindh",
"gitProjectId": 4877,
"activeDeployment": {
"host": {
"hostId": 4521,
"fqdn": "lab-rf-vm-ioc-02.cslab.esss.lu.se",
"hostName": "lab-rf-vm-ioc-02",
"network": "CSLab-GeneralLab"
},
"sourceVersion": "cb065da1b6e5dcde6da091a93799ac8488e1e818",
"sourceVersionShort": "cb065da1"
}
},
{
"id": 3,
"description": "some description",
"namingName": "RFQ-010:SC-IOC-006",
"createdBy": "anderslindh",
"gitProjectId": 4335,
"activeDeployment": {
"host": {
"hostId": 4205,
"fqdn": "rfq-rf-vm-ioc.tn.esss.lu.se",
"hostName": "rfq-rf-vm-ioc",
"network": "ChannelAccess-ACC"
},
"sourceVersion": "1.0.0",
"sourceVersionShort": "1.0.0"
}
"id": 43,
"namingName": "CCCE:MOCK9",
"createdBy": "mock user 9",
"gitProjectId": 12736,
"deployedWithOldPlaybook": true,
"activeDeployment": null
}
]
}
This diff is collapsed.
......@@ -206,24 +206,24 @@ function listHosts(req) {
return { body };
}
function getProcservLogs(req) {
function fetchHostStatus(req) {
const params = getParameters(req, "/hosts/:host_id/status");
const data = require("./fixtures/HostStatusResponse.json");
const body = data.find((x) => x.hostId === params.host_id);
const status = body ? 200 : 404;
return { body, status };
}
function fetchProcServLogLines(req) {
const body = require("./fixtures/LokiResponse.json");
return { body };
}
function fetchIocStatus(req) {
const params = getParameters(req, "/monitoring/status/:id");
const params = getParameters(req, "/iocs/:ioc_id/status");
const data = require("./fixtures/IOCStatus.json");
const { id, alertSeverity, alerts, active } = data.find(
(x) => `${x.id}` === params.id
);
const body = data.find((x) => `${x.iocId}` === params.ioc_id);
const body = {
iocId: id,
alertSeverity,
alerts,
active
};
console.debug("fetchIocStatus", data, params, body);
const status = body ? 200 : 404;
......@@ -289,7 +289,9 @@ const mockAPI = {
getIOC,
createIoc,
deleteIOC,
getIocDescription
getIocDescription,
fetchIocStatus,
fetchProcServLogLines
},
deployments: {
getDeployment,
......@@ -301,17 +303,14 @@ const mockAPI = {
},
hosts: {
findHostWithStatusById,
listHosts
listHosts,
fetchHostStatus
},
git_helper: {
infoFromUserName,
listProjects,
listTagsAndCommitIds
},
monitoring: {
getProcservLogs,
fetchIocStatus
},
statistics: {
currentlyActiveIocs,
activeIocHistory,
......@@ -373,6 +372,18 @@ export const apiHandlers = [
mockAPI.iocs.getIocDescription
),
makeHandler(
"GET",
qRegExp(".*/iocs/[0-9]+/status"),
mockAPI.iocs.fetchIocStatus
),
makeHandler(
"GET",
qRegExp(".*/iocs/.*/.*/log"),
mockAPI.iocs.fetchProcServLogLines,
auth
),
// records
makeHandler("GET", qRegExp(".*/records"), mockAPI.records.findAllRecords),
......@@ -434,21 +445,13 @@ export const apiHandlers = [
makeHandler("GET", qRegExp(".*/hosts"), mockAPI.hosts.listHosts),
makeHandler(
"GET",
qRegExp(".*/hosts/[A-Za-z0-9+/]+/with_status"),
mockAPI.hosts.findHostWithStatusById
),
// monitoring
makeHandler(
"GET",
qRegExp(".*/monitoring/procserv/host/.+"),
mockAPI.monitoring.getProcservLogs,
auth
qRegExp(".*/hosts/[A-Za-z0-9+/]+/status"),
mockAPI.hosts.fetchHostStatus
),
makeHandler(
"GET",
qRegExp(".*/monitoring/status/.+"),
mockAPI.monitoring.fetchIocStatus
qRegExp(".*/hosts/[A-Za-z0-9+/]+/with_status"),
mockAPI.hosts.findHostWithStatusById
),
// statistics
......