Files
orion-visor/orion-ops-ui/src/api/exec/exec-command.ts

51 lines
1.1 KiB
TypeScript
Raw Normal View History

2024-04-11 00:06:43 +08:00
import type { ExecCommandLogQueryResponse } from './exec-command-log';
2024-04-10 19:24:59 +08:00
import axios from 'axios';
/**
*
*/
export interface ExecCommandRequest {
logId?: number;
description?: string;
timeout?: number;
command?: string;
parameterSchema?: string;
hostIdList?: Array<number>;
}
/**
*
*/
export interface ExecCommandInterruptRequest {
logId?: number;
hostLogId?: number;
}
/**
*
*/
export function batchExecCommand(request: ExecCommandRequest) {
2024-04-11 00:06:43 +08:00
return axios.post<ExecCommandLogQueryResponse>('/asset/exec-command/exec', request);
2024-04-10 19:24:59 +08:00
}
/**
*
*/
export function reExecCommand(request: ExecCommandRequest) {
2024-04-11 00:06:43 +08:00
return axios.post<ExecCommandLogQueryResponse>('/asset/exec-command/re-exec', request);
2024-04-10 19:24:59 +08:00
}
/**
*
*/
export function interruptExecCommand(request: ExecCommandInterruptRequest) {
return axios.put('/asset/exec-command/interrupt', request);
}
/**
*
*/
export function interruptHostExecCommand(request: ExecCommandInterruptRequest) {
return axios.put('/asset/exec-command/interrupt-host', request);
}