Catalyst / admin/Synapse-Cortex 14.8 GB / 57.8 GB 40.0 GB free
Help Sign in

admin / Synapse-Cortex

public

Self Hosted ITSM Tool with RBAC/Tenanting and MFA

Code Issues Pull requests Pipelines Packages Security Insights Wiki Settings
Synapse-Cortex / Synapse-Cortexv2 / frontend / src / api / remediation.ts 1230 B · main
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
import { api } from './client'
import type { RemediationRunOut } from './types'

export const remediationApi = {
  listRuns: (ticketId: string) => api.get<RemediationRunOut[]>(`/api/v1/tickets/${ticketId}/remediation/runs`),
  investigate: (ticketId: string) => api.post<RemediationRunOut>(`/api/v1/tickets/${ticketId}/remediation/investigate`),
  // `command` is only used for a command-runner run - the (possibly edited)
  // free-form command to execute. Omitted for a normal playbook run.
  approve: (ticketId: string, runId: string, command?: string) =>
    api.post<RemediationRunOut>(`/api/v1/tickets/${ticketId}/remediation/runs/${runId}/approve`, { command }),
  // Simulated rehearsal: runs every step through the simulated executor and
  // keeps the run pending, so the operator can review before approving a real
  // execution. `command` is the (possibly edited) free-form command, as approve.
  dryRun: (ticketId: string, runId: string, command?: string) =>
    api.post<RemediationRunOut>(`/api/v1/tickets/${ticketId}/remediation/runs/${runId}/dry-run`, { command }),
  reject: (ticketId: string, runId: string) =>
    api.post<RemediationRunOut>(`/api/v1/tickets/${ticketId}/remediation/runs/${runId}/reject`),
}