delete agent flow
This commit is contained in:
1 parent
3053009a7e
commit
28dda76ee8
13 files changed
+295
-20
No files matched your search
@@ -57,6 +57,11 @@ export type RevokeEnrollTokenResponse = {
|
||||
revoked: boolean;
|
||||
};
|
||||
|
||||
export type RevokeAgentResponse = {
|
||||
agent_id: string;
|
||||
revoked: boolean;
|
||||
};
|
||||
|
||||
async function request<T>(path: string, init?: RequestInit): Promise<T> {
|
||||
const res = await fetch(path, {
|
||||
...init,
|
||||
@@ -123,6 +128,13 @@ export function revokeEnrollToken(
|
||||
);
|
||||
}
|
||||
|
||||
export function revokeAgent(agentId: string): Promise<RevokeAgentResponse> {
|
||||
return request<RevokeAgentResponse>(
|
||||
`/api/v1/control/agents/${encodeURIComponent(agentId)}`,
|
||||
{ method: "DELETE" },
|
||||
);
|
||||
}
|
||||
|
||||
export function runCommand(
|
||||
agentId: string,
|
||||
kind: CommandKind,
|
||||
|
||||
Reference in new issue
Block a user