Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
review changes
  • Loading branch information
ashokaditya committed Oct 18, 2021
1 parent ba8b5b4 commit 4fea956
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,4 @@ export const UNISOLATE_HOST_ROUTE = `${BASE_ENDPOINT_ROUTE}/unisolate`;
export const ENDPOINT_ACTION_LOG_ROUTE = `/api/endpoint/action_log/{agent_id}`;
export const ACTION_STATUS_ROUTE = `/api/endpoint/action_status`;

// From https://github.com/for-GET/know-your-http-well/blob/master/json/status-codes.json
// similar to x-pack/plugins/apm/public/components/shared/Summary/HttpStatusBadge/statusCodes.ts
export const statusCodes: { [key: string]: { code: string; meaning: string } } = {
'424': {
code: '424',
meaning: 'Failed Dependency',
},
};
export const failedFleetActionErrorCode = '424';
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
ENDPOINT_ACTION_RESPONSES_DS,
ISOLATE_HOST_ROUTE,
UNISOLATE_HOST_ROUTE,
statusCodes,
failedFleetActionErrorCode,
} from '../../../../common/endpoint/constants';
import { AGENT_ACTIONS_INDEX } from '../../../../../fleet/common';
import {
Expand Down Expand Up @@ -80,7 +80,7 @@ const createFailedActionResponseEntry = async ({
body: {
...doc,
error: {
code: statusCodes['424'].code,
failedFleetActionErrorCode,
message: 'Failed to deliver action request to fleet',
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { AGENT_ACTIONS_INDEX, AGENT_ACTIONS_RESULTS_INDEX } from '../../../../fl
import {
ENDPOINT_ACTIONS_INDEX,
ENDPOINT_ACTION_RESPONSES_INDEX,
statusCodes,
failedFleetActionErrorCode,
} from '../../../common/endpoint/constants';
import { SecuritySolutionRequestHandlerContext } from '../../types';
import {
Expand Down Expand Up @@ -57,7 +57,7 @@ export const getUniqueLogData = (activityLogEntries: ActivityLogEntry[]): Activi
.filter(
(e) =>
e.type === ActivityLogItemTypes.RESPONSE &&
e.item.data.error?.code === statusCodes['424'].code
e.item.data.error?.code === failedFleetActionErrorCode
)
.map(
(e: ActivityLogEntry) => (e.item.data as LogsEndpointActionResponse).EndpointActions.action_id
Expand Down

0 comments on commit 4fea956

Please sign in to comment.