feat: background remote agent updates survive SAC navigation (0.20.19)
This commit is contained in:
+36
-6
@@ -517,8 +517,33 @@ export function testHostSsh(hostId: number): Promise<HostSshActionResult> {
|
||||
});
|
||||
}
|
||||
|
||||
export function updateHostAgentViaSsh(hostId: number): Promise<HostSshActionResult> {
|
||||
return apiFetch<HostSshActionResult>(`/api/v1/hosts/${hostId}/actions/agent-update`, {
|
||||
export interface HostRemoteActionStartResult {
|
||||
status: string;
|
||||
host_id: number;
|
||||
title: string;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface HostRemoteActionJobStatus {
|
||||
active: boolean;
|
||||
host_id: number;
|
||||
hostname?: string | null;
|
||||
status?: string | null;
|
||||
title?: string;
|
||||
message?: string;
|
||||
stdout?: string | null;
|
||||
stderr?: string | null;
|
||||
output?: string | null;
|
||||
ok?: boolean | null;
|
||||
exit_code?: number | null;
|
||||
product_version?: string | null;
|
||||
agent_update_state?: string | null;
|
||||
started_at?: string | null;
|
||||
finished_at?: string | null;
|
||||
}
|
||||
|
||||
export function updateHostAgentViaSsh(hostId: number): Promise<HostRemoteActionStartResult> {
|
||||
return apiFetch<HostRemoteActionStartResult>(`/api/v1/hosts/${hostId}/actions/agent-update`, {
|
||||
method: "POST",
|
||||
});
|
||||
}
|
||||
@@ -537,10 +562,15 @@ export function requestHostAgentUpdate(hostId: number): Promise<HostAgentUpdateR
|
||||
);
|
||||
}
|
||||
|
||||
export function runHostAgentUpdateFallback(hostId: number): Promise<HostSshActionResult> {
|
||||
return apiFetch<HostSshActionResult>(`/api/v1/hosts/${hostId}/actions/agent-update-fallback`, {
|
||||
method: "POST",
|
||||
});
|
||||
export function runHostAgentUpdateFallback(hostId: number): Promise<HostRemoteActionStartResult> {
|
||||
return apiFetch<HostRemoteActionStartResult>(
|
||||
`/api/v1/hosts/${hostId}/actions/agent-update-fallback`,
|
||||
{ method: "POST" },
|
||||
);
|
||||
}
|
||||
|
||||
export function fetchHostRemoteJob(hostId: number): Promise<HostRemoteActionJobStatus> {
|
||||
return apiFetch<HostRemoteActionJobStatus>(`/api/v1/hosts/${hostId}/actions/remote-job`);
|
||||
}
|
||||
|
||||
export interface HostAgentConfigResponse {
|
||||
|
||||
Reference in New Issue
Block a user