feat: adding background jobs ui page and apis - requires user is_admin to be set to true

This commit is contained in:
allanice001
2025-11-04 23:52:37 +00:00
parent 91686c1ea4
commit c41af60b26
97 changed files with 11135 additions and 138 deletions

View File

@@ -3,6 +3,7 @@ import { Route, Routes } from "react-router-dom"
import { ProtectedRoute } from "@/components/protected-route.tsx"
import { Login } from "@/pages/auth/login.tsx"
import { JobsPage } from "@/pages/jobs/jobs-page.tsx"
import { LabelsPage } from "@/pages/labels/labels-page.tsx"
import { MePage } from "@/pages/me/me-page.tsx"
import { OrgApiKeys } from "@/pages/org/api-keys.tsx"
@@ -28,6 +29,8 @@ export default function App() {
<Route path="/servers" element={<ServerPage />} />
<Route path="/taints" element={<TaintsPage />} />
<Route path="/labels" element={<LabelsPage />} />
<Route path="/admin/jobs" element={<JobsPage />} />
</Route>
</Route>
<Route path="*" element={<Login />} />

View File

@@ -0,0 +1,40 @@
import { withRefresh } from "@/api/with-refresh.ts"
import { makeArcherAdminApi } from "@/sdkClient.ts"
const archerAdmin = makeArcherAdminApi()
type ListParams = {
status?: "queued" | "running" | "succeeded" | "failed" | "canceled" | "retrying" | "scheduled"
queue?: string
q?: string
page?: number
pageSize?: number
}
export const archerAdminApi = {
listJobs: (params: ListParams = {}) => {
return withRefresh(async () => {
return await archerAdmin.adminListArcherJobs(params)
})
},
enqueue: (body: { queue: string; type: string; payload?: unknown; run_at?: string }) => {
return withRefresh(async () => {
return await archerAdmin.adminEnqueueArcherJob({ body })
})
},
retryJob: (id: string) => {
return withRefresh(async () => {
return await archerAdmin.adminRetryArcherJob({ id })
})
},
cancelJob: (id: string) => {
return withRefresh(async () => {
return await archerAdmin.adminCancelArcherJob({ id })
})
},
listQueues: () => {
return withRefresh(async () => {
return await archerAdmin.adminListArcherQueues()
})
},
}

21
ui/src/auth/logout.ts Normal file
View File

@@ -0,0 +1,21 @@
import { authStore } from "@/auth/store.ts"
import type { DtoLogoutRequest } from "@/sdk"
import { makeAuthApi } from "@/sdkClient.ts"
export async function logoutEverywhere(): Promise<void> {
const tokens = authStore.get()
if (!tokens?.refresh_token) {
authStore.logout()
return
}
try {
const body: DtoLogoutRequest = { refresh_token: tokens.refresh_token } as DtoLogoutRequest
await makeAuthApi().logout({ body })
} catch (err) {
console.warn("Logout API failed; clearing local state anyway", err)
} finally {
authStore.logout()
}
}

View File

@@ -1,6 +1,7 @@
import { useAuth } from "@/auth/use-auth.ts"
import { Navigate, Outlet, useLocation } from "react-router-dom"
import { useAuth } from "@/hooks/use-auth.ts"
export const ProtectedRoute = () => {
const { authed } = useAuth()
const loc = useLocation()

View File

@@ -0,0 +1,10 @@
import { useCallback } from "react"
import { logoutEverywhere } from "@/auth/logout.ts"
export function useAuthActions() {
const logout = useCallback(() => {
return logoutEverywhere()
}, [])
return { logout }
}

View File

@@ -2,12 +2,13 @@ import { useEffect, useState } from "react"
import { meApi } from "@/api/me.ts"
import { orgStore } from "@/auth/org.ts"
import { authStore } from "@/auth/store.ts"
import { mainNav, orgNav, userNav } from "@/layouts/nav-config.ts"
import { adminNav, mainNav, orgNav, userNav } from "@/layouts/nav-config.ts"
import { OrgSwitcher } from "@/layouts/org-switcher.tsx"
import { Topbar } from "@/layouts/topbar.tsx"
import { NavLink, Outlet } from "react-router-dom"
import { cn } from "@/lib/utils.ts"
import { useAuthActions } from "@/hooks/use-auth-actions.ts"
import { Button } from "@/components/ui/button.tsx"
import {
Sidebar,
@@ -31,6 +32,7 @@ type Org = {
export const AppShell = () => {
const [orgs, setOrgs] = useState<Org[]>([])
const { logout } = useAuthActions()
useEffect(() => {
let alive = true
@@ -135,11 +137,34 @@ export const AppShell = () => {
</SidebarMenu>
</SidebarGroupContent>
</SidebarGroup>
<SidebarGroup>
<SidebarGroupLabel>Admin</SidebarGroupLabel>
<SidebarGroupContent>
<SidebarMenu>
{adminNav.map((n) => (
<SidebarMenuItem key={n.to}>
<SidebarMenuButton asChild tooltip={n.label}>
<NavLink
to={n.to}
className={({ isActive }) =>
cn("flex items-center gap-2", isActive && "text-primary")
}
>
<n.icon className="h-4 w-4" />
<span>{n.label}</span>
</NavLink>
</SidebarMenuButton>
</SidebarMenuItem>
))}
</SidebarMenu>
</SidebarGroupContent>
</SidebarGroup>
</SidebarContent>
<SidebarFooter>
<div className="px-2 py-2">
<Button variant="ghost" size="sm" className="w-full" onClick={() => authStore.logout()}>
<Button variant="ghost" size="sm" className="w-full" onClick={() => void logout()}>
Sign out
</Button>
</div>

View File

@@ -28,7 +28,6 @@ export const mainNav: NavItem[] = [
{ to: "/taints", label: "Taints", icon: SprayCanIcon },
{ to: "/servers", label: "Servers", icon: ServerIcon },
{ to: "/ssh", label: "SSH Keys", icon: FileKey2Icon },
{ to: "/jobs", label: "Jobs", icon: GrUserWorker },
]
export const orgNav: NavItem[] = [
@@ -38,3 +37,8 @@ export const orgNav: NavItem[] = [
]
export const userNav: NavItem[] = [{ to: "/me", label: "Profile", icon: User2 }]
export const adminNav: NavItem[] = [
{ to: "/admin/users", label: "Users Admin", icon: Users },
{ to: "/admin/jobs", label: "Jobs Admin", icon: GrUserWorker },
]

View File

@@ -0,0 +1,540 @@
import { useEffect, useState, type FC } from "react"
import { archerAdminApi } from "@/api/archer_admin"
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"
import { Loader2, Plus, RefreshCw, Search, X } from "lucide-react"
import { cn } from "@/lib/utils"
import { Badge } from "@/components/ui/badge"
import { Button } from "@/components/ui/button"
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
import {
Dialog,
DialogClose,
DialogContent,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
} from "@/components/ui/dialog"
import { Input } from "@/components/ui/input"
import { Label } from "@/components/ui/label"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
import {
Table,
TableBody,
TableCell,
TableHead,
TableHeader,
TableRow,
} from "@/components/ui/table"
import { Textarea } from "@/components/ui/textarea"
// Types (align with generated client camelCase)
type JobStatus =
| "queued"
| "running"
| "succeeded"
| "failed"
| "canceled"
| "retrying"
| "scheduled"
type DtoJob = {
id: string
type: string
queue: string
status: JobStatus
attempts: number
maxAttempts?: number
createdAt: string
updatedAt?: string
lastError?: string | null
runAt?: string | null
payload?: unknown
}
type DtoPageJob = {
items: DtoJob[]
total: number
page: number
pageSize: number
}
type QueueInfo = {
name: string
pending: number
running: number
failed: number
scheduled: number
}
const STATUS: JobStatus[] = [
"queued",
"running",
"succeeded",
"failed",
"canceled",
"retrying",
"scheduled",
]
const statusClass: Record<JobStatus, string> = {
queued: "bg-amber-100 text-amber-800",
running: "bg-sky-100 text-sky-800",
succeeded: "bg-emerald-100 text-emerald-800",
failed: "bg-red-100 text-red-800",
canceled: "bg-zinc-200 text-zinc-700",
retrying: "bg-orange-100 text-orange-800",
scheduled: "bg-violet-100 text-violet-800",
}
function fmt(dt?: string | null) {
if (!dt) return "—"
const d = new Date(dt)
return new Intl.DateTimeFormat(undefined, { dateStyle: "medium", timeStyle: "short" }).format(d)
}
// Small debounce hook for search input
function useDebounced<T>(value: T, ms = 300) {
const [v, setV] = useState(value)
useEffect(() => {
const t = setTimeout(() => setV(value), ms)
return () => clearTimeout(t)
}, [value, ms])
return v
}
export const JobsPage: FC = () => {
const qc = useQueryClient()
// Filters
const [status, setStatus] = useState<string>("")
const [queue, setQueue] = useState<string>("")
const [q, setQ] = useState<string>("")
const debouncedQ = useDebounced(q, 300)
const [page, setPage] = useState(1)
const [pageSize, setPageSize] = useState(25)
const key = ["archer", "jobs", { status, queue, q: debouncedQ, page, pageSize }]
// Jobs query
const jobsQ = useQuery({
queryKey: key,
queryFn: () =>
archerAdminApi.listJobs({
status: status || undefined,
queue: queue || undefined,
q: debouncedQ || undefined,
page,
pageSize,
}) as Promise<DtoPageJob>,
keepPreviousData: true,
staleTime: 10_000,
})
// Queues summary (optional header)
const queuesQ = useQuery({
queryKey: ["archer", "queues"],
queryFn: () => archerAdminApi.listQueues() as Promise<QueueInfo[]>,
staleTime: 30_000,
})
// Mutations
const enqueueM = useMutation({
mutationFn: (body: { queue: string; type: string; payload?: unknown; run_at?: string }) =>
archerAdminApi.enqueue(body),
onSuccess: () => qc.invalidateQueries({ queryKey: ["archer", "jobs"] }),
})
const retryM = useMutation({
mutationFn: (id: string) => archerAdminApi.retryJob(id),
onSuccess: () => qc.invalidateQueries({ queryKey: ["archer", "jobs"] }),
})
const cancelM = useMutation({
mutationFn: (id: string) => archerAdminApi.cancelJob(id),
onSuccess: () => qc.invalidateQueries({ queryKey: ["archer", "jobs"] }),
})
const busy = jobsQ.isFetching
const data = jobsQ.data
const totalPages = data ? Math.max(1, Math.ceil(data.total / data.pageSize)) : 1
return (
<div className="container mx-auto space-y-6 p-6">
<div className="flex items-start justify-between gap-4">
<div>
<h1 className="text-2xl font-semibold">Archer Jobs</h1>
<p className="text-muted-foreground text-sm">
Inspect, enqueue, retry and cancel background jobs.
</p>
</div>
<div className="flex gap-2">
<EnqueueDialog
onSubmit={(payload) => enqueueM.mutateAsync(payload)}
submitting={enqueueM.isPending}
/>
<Button
variant="secondary"
onClick={() => qc.invalidateQueries({ queryKey: ["archer", "jobs"] })}
disabled={busy}
>
{busy ? (
<Loader2 className="mr-2 h-4 w-4 animate-spin" />
) : (
<RefreshCw className="mr-2 h-4 w-4" />
)}
Refresh
</Button>
</div>
</div>
{/* Queue metrics (optional) */}
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-4">
{queuesQ.data?.map((q) => (
<Card key={q.name}>
<CardHeader>
<CardTitle className="text-base">{q.name}</CardTitle>
</CardHeader>
<CardContent className="grid grid-cols-2 gap-2 text-sm">
<Metric label="Pending" value={q.pending} />
<Metric label="Running" value={q.running} />
<Metric label="Failed" value={q.failed} />
<Metric label="Scheduled" value={q.scheduled} />
</CardContent>
</Card>
))}
</div>
{/* Filters */}
<Card>
<CardHeader>
<CardTitle>Filters</CardTitle>
</CardHeader>
<CardContent className="grid gap-3 md:grid-cols-4">
<div className="col-span-2 flex items-center gap-2">
<Input
placeholder="Search id, queue, error, payload…"
value={q}
onChange={(e) => {
setQ(e.target.value)
setPage(1)
}}
onKeyDown={(e) =>
e.key === "Enter" && qc.invalidateQueries({ queryKey: ["archer", "jobs"] })
}
/>
{q && (
<Button variant="ghost" size="icon" onClick={() => setQ("")}>
<X className="h-4 w-4" />
</Button>
)}
<Button onClick={() => qc.invalidateQueries({ queryKey: ["archer", "jobs"] })}>
<Search className="mr-2 h-4 w-4" /> Search
</Button>
</div>
<Select
value={status || "all"}
onValueChange={(v) => {
setStatus(v === "all" ? "" : v)
setPage(1)
}}
>
<SelectTrigger>
<SelectValue placeholder="All statuses" />
</SelectTrigger>
<SelectContent>
<SelectItem value="all">All statuses</SelectItem>
{STATUS.map((s) => (
<SelectItem key={s} value={s}>
{s}
</SelectItem>
))}
</SelectContent>
</Select>
<Input
placeholder="Queue (optional)"
value={queue}
onChange={(e) => {
setQueue(e.target.value)
setPage(1)
}}
/>
<div className="flex items-center gap-2">
<Label className="whitespace-nowrap">Page size</Label>
<Select
value={String(pageSize)}
onValueChange={(v) => {
setPageSize(Number(v))
setPage(1)
}}
>
<SelectTrigger className="w-[120px]">
<SelectValue />
</SelectTrigger>
<SelectContent>
{[10, 25, 50, 100].map((n) => (
<SelectItem key={n} value={String(n)}>
{n}
</SelectItem>
))}
</SelectContent>
</Select>
</div>
</CardContent>
</Card>
{/* Table */}
<Card>
<CardContent className="p-0">
<Table>
<TableHeader>
<TableRow>
<TableHead>ID</TableHead>
<TableHead>Queue</TableHead>
<TableHead>Status</TableHead>
<TableHead>Attempts</TableHead>
<TableHead>Run At</TableHead>
<TableHead>Updated</TableHead>
<TableHead className="pr-4 text-right">Actions</TableHead>
</TableRow>
</TableHeader>
<TableBody>
{jobsQ.isLoading && (
<TableRow>
<TableCell colSpan={7} className="text-muted-foreground py-8 text-center">
Loading
</TableCell>
</TableRow>
)}
{jobsQ.isError && (
<TableRow>
<TableCell colSpan={7} className="py-8 text-center text-red-600">
Failed to load jobs
</TableCell>
</TableRow>
)}
{!jobsQ.isLoading && data && data.items.length === 0 && (
<TableRow>
<TableCell colSpan={7} className="text-muted-foreground py-8 text-center">
No jobs match your filters.
</TableCell>
</TableRow>
)}
{data?.items.map((j) => (
<TableRow key={j.id}>
<TableCell>
<code className="text-xs">{j.id}</code>
</TableCell>
<TableCell>
<Badge variant="secondary">{j.queue}</Badge>
</TableCell>
<TableCell>
<span className={cn("rounded-md px-2 py-0.5 text-xs", statusClass[j.status])}>
{j.status}
</span>
</TableCell>
<TableCell>
{j.maxAttempts ? `${j.attempts}/${j.maxAttempts}` : j.attempts}
</TableCell>
<TableCell>{fmt(j.runAt)}</TableCell>
<TableCell>{fmt(j.updatedAt ?? j.createdAt)}</TableCell>
<TableCell className="text-right">
<div className="flex justify-end gap-2">
{(j.status === "failed" || j.status === "canceled") && (
<Button
size="sm"
variant="outline"
disabled={retryM.isPending}
onClick={() => retryM.mutate(j.id)}
>
Retry
</Button>
)}
{(j.status === "queued" ||
j.status === "running" ||
j.status === "scheduled") && (
<Button
size="sm"
variant="outline"
disabled={cancelM.isPending}
onClick={() => cancelM.mutate(j.id)}
>
Cancel
</Button>
)}
<DetailsButton job={j} />
</div>
</TableCell>
</TableRow>
))}
</TableBody>
</Table>
{/* Pagination */}
<div className="flex items-center justify-between border-t p-3 text-sm">
<div>
Page {page} of {totalPages} {data?.total ?? 0} total
</div>
<div className="flex gap-2">
<Button
variant="outline"
disabled={page <= 1 || jobsQ.isFetching}
onClick={() => setPage((p) => Math.max(1, p - 1))}
>
Prev
</Button>
<Button
variant="outline"
disabled={page >= totalPages || jobsQ.isFetching}
onClick={() => setPage((p) => p + 1)}
>
Next
</Button>
</div>
</div>
</CardContent>
</Card>
</div>
)
}
function Metric({ label, value }: { label: string; value: number }) {
return (
<div className="bg-muted/30 rounded-lg border p-3">
<div className="text-muted-foreground text-xs">{label}</div>
<div className="text-lg font-semibold">{value}</div>
</div>
)
}
function DetailsButton({ job }: { job: DtoJob }) {
return (
<Dialog>
<DialogTrigger asChild>
<Button size="sm" variant="ghost">
Details
</Button>
</DialogTrigger>
<DialogContent className="max-w-2xl">
<DialogHeader>
<DialogTitle>Job {job.id}</DialogTitle>
</DialogHeader>
<div className="grid gap-3">
{job.lastError && (
<Card>
<CardHeader>
<CardTitle className="text-sm">Last error</CardTitle>
</CardHeader>
<CardContent>
<pre className="overflow-auto text-xs whitespace-pre-wrap">{job.lastError}</pre>
</CardContent>
</Card>
)}
<Card>
<CardHeader>
<CardTitle className="text-sm">Payload</CardTitle>
</CardHeader>
<CardContent>
<pre className="overflow-auto text-xs whitespace-pre-wrap">
{JSON.stringify(job.payload, null, 2)}
</pre>
</CardContent>
</Card>
</div>
<DialogFooter>
<DialogClose asChild>
<Button variant="secondary">Close</Button>
</DialogClose>
</DialogFooter>
</DialogContent>
</Dialog>
)
}
function EnqueueDialog({
onSubmit,
submitting,
}: {
onSubmit: (body: {
queue: string
type: string
payload?: unknown
run_at?: string
}) => Promise<unknown>
submitting?: boolean
}) {
const [open, setOpen] = useState(false)
const [queue, setQueue] = useState("")
const [type, setType] = useState("")
const [payload, setPayload] = useState("{}")
const [runAt, setRunAt] = useState("")
const canSubmit = queue && type && !submitting
async function handleSubmit() {
const parsed = payload ? JSON.parse(payload) : undefined
await onSubmit({ queue, type, payload: parsed, run_at: runAt || undefined })
setOpen(false)
setQueue("")
setType("")
setPayload("{}")
setRunAt("")
}
return (
<Dialog open={open} onOpenChange={setOpen}>
<DialogTrigger asChild>
<Button>
<Plus className="mr-2 h-4 w-4" /> Enqueue
</Button>
</DialogTrigger>
<DialogContent>
<DialogHeader>
<DialogTitle>Enqueue Job</DialogTitle>
</DialogHeader>
<div className="grid gap-3">
<div className="grid gap-2">
<Label>Queue</Label>
<Input
value={queue}
onChange={(e) => setQueue(e.target.value)}
placeholder="e.g. bootstrap_bastion"
/>
</div>
<div className="grid gap-2">
<Label>Type</Label>
<Input
value={type}
onChange={(e) => setType(e.target.value)}
placeholder="e.g. bootstrap_bastion"
/>
</div>
<div className="grid gap-2">
<Label>Payload (JSON)</Label>
<Textarea
value={payload}
onChange={(e) => setPayload(e.target.value)}
className="min-h-[120px] font-mono text-xs"
/>
</div>
<div className="grid gap-2">
<Label>Run at (optional)</Label>
<Input type="datetime-local" value={runAt} onChange={(e) => setRunAt(e.target.value)} />
</div>
</div>
<DialogFooter>
<DialogClose asChild>
<Button variant="secondary">Cancel</Button>
</DialogClose>
<Button onClick={handleSubmit} disabled={!canSubmit}>
{submitting ? <Loader2 className="mr-2 h-4 w-4 animate-spin" /> : null}
Enqueue
</Button>
</DialogFooter>
</DialogContent>
</Dialog>
)
}

View File

@@ -1,7 +1,6 @@
import { useMemo, useState } from "react"
import { labelsApi } from "@/api/labels.ts"
import { taintsApi } from "@/api/taints.ts"
import type { DtoLabelResponse, DtoTaintResponse } from "@/sdk"
import type { DtoLabelResponse } from "@/sdk"
import { zodResolver } from "@hookform/resolvers/zod"
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"
import { CircleSlash2, Pencil, Plus, Search, Tags } from "lucide-react"
@@ -29,13 +28,6 @@ import {
FormMessage,
} from "@/components/ui/form.tsx"
import { Input } from "@/components/ui/input.tsx"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select.tsx"
import {
Table,
TableBody,

View File

@@ -500,6 +500,7 @@ export const MePage = () => {
</div>
</DialogContent>
</Dialog>
<pre>{JSON.stringify(meQ.data, null, 2)}</pre>
</div>
)
}

View File

@@ -3,23 +3,30 @@
.openapi-generator-ignore
README.md
docs/AnnotationsApi.md
docs/ArcherAdminApi.md
docs/AuthApi.md
docs/DtoAnnotationResponse.md
docs/DtoAuthStartResponse.md
docs/DtoCreateAnnotationRequest.md
docs/DtoCreateLabelRequest.md
docs/DtoCreateSSHRequest.md
docs/DtoCreateServerRequest.md
docs/DtoCreateTaintRequest.md
docs/DtoJWK.md
docs/DtoJWKS.md
docs/DtoJob.md
docs/DtoJobStatus.md
docs/DtoLabelResponse.md
docs/DtoLogoutRequest.md
docs/DtoPageJob.md
docs/DtoQueueInfo.md
docs/DtoRefreshRequest.md
docs/DtoServerResponse.md
docs/DtoSshResponse.md
docs/DtoSshRevealResponse.md
docs/DtoTaintResponse.md
docs/DtoTokenPair.md
docs/DtoUpdateAnnotationRequest.md
docs/DtoUpdateLabelRequest.md
docs/DtoUpdateServerRequest.md
docs/DtoUpdateTaintRequest.md
@@ -49,6 +56,7 @@ docs/TaintsApi.md
docs/UtilsErrorResponse.md
package.json
src/apis/AnnotationsApi.ts
src/apis/ArcherAdminApi.ts
src/apis/AuthApi.ts
src/apis/HealthApi.ts
src/apis/LabelsApi.ts
@@ -62,20 +70,26 @@ src/apis/index.ts
src/index.ts
src/models/DtoAnnotationResponse.ts
src/models/DtoAuthStartResponse.ts
src/models/DtoCreateAnnotationRequest.ts
src/models/DtoCreateLabelRequest.ts
src/models/DtoCreateSSHRequest.ts
src/models/DtoCreateServerRequest.ts
src/models/DtoCreateTaintRequest.ts
src/models/DtoJWK.ts
src/models/DtoJWKS.ts
src/models/DtoJob.ts
src/models/DtoJobStatus.ts
src/models/DtoLabelResponse.ts
src/models/DtoLogoutRequest.ts
src/models/DtoPageJob.ts
src/models/DtoQueueInfo.ts
src/models/DtoRefreshRequest.ts
src/models/DtoServerResponse.ts
src/models/DtoSshResponse.ts
src/models/DtoSshRevealResponse.ts
src/models/DtoTaintResponse.ts
src/models/DtoTokenPair.ts
src/models/DtoUpdateAnnotationRequest.ts
src/models/DtoUpdateLabelRequest.ts
src/models/DtoUpdateServerRequest.ts
src/models/DtoUpdateTaintRequest.ts

View File

@@ -16,16 +16,31 @@
import * as runtime from '../runtime';
import type {
DtoAnnotationResponse,
DtoCreateAnnotationRequest,
DtoUpdateAnnotationRequest,
} from '../models/index';
import {
DtoAnnotationResponseFromJSON,
DtoAnnotationResponseToJSON,
DtoCreateAnnotationRequestFromJSON,
DtoCreateAnnotationRequestToJSON,
DtoUpdateAnnotationRequestFromJSON,
DtoUpdateAnnotationRequestToJSON,
} from '../models/index';
export interface CreateAnnotationRequest {
body: DtoCreateAnnotationRequest;
xOrgID?: string;
}
export interface DeleteAnnotationRequest {
id: string;
xOrgID?: string;
}
export interface GetAnnotationRequest {
id: string;
xOrgID?: string;
include?: string;
}
export interface ListAnnotationsRequest {
@@ -35,11 +50,133 @@ export interface ListAnnotationsRequest {
q?: string;
}
export interface UpdateAnnotationRequest {
id: string;
body: DtoUpdateAnnotationRequest;
xOrgID?: string;
}
/**
*
*/
export class AnnotationsApi extends runtime.BaseAPI {
/**
* Creates an annotation.
* Create annotation (org scoped)
*/
async createAnnotationRaw(requestParameters: CreateAnnotationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DtoAnnotationResponse>> {
if (requestParameters['body'] == null) {
throw new runtime.RequiredError(
'body',
'Required parameter "body" was null or undefined when calling createAnnotation().'
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/json';
if (requestParameters['xOrgID'] != null) {
headerParameters['X-Org-ID'] = String(requestParameters['xOrgID']);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] = await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] = await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/annotations`;
const response = await this.request({
path: urlPath,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: DtoCreateAnnotationRequestToJSON(requestParameters['body']),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => DtoAnnotationResponseFromJSON(jsonValue));
}
/**
* Creates an annotation.
* Create annotation (org scoped)
*/
async createAnnotation(requestParameters: CreateAnnotationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DtoAnnotationResponse> {
const response = await this.createAnnotationRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Permanently deletes the annotation.
* Delete annotation (org scoped)
*/
async deleteAnnotationRaw(requestParameters: DeleteAnnotationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>> {
if (requestParameters['id'] == null) {
throw new runtime.RequiredError(
'id',
'Required parameter "id" was null or undefined when calling deleteAnnotation().'
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (requestParameters['xOrgID'] != null) {
headerParameters['X-Org-ID'] = String(requestParameters['xOrgID']);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] = await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] = await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/annotations/{id}`;
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
const response = await this.request({
path: urlPath,
method: 'DELETE',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
if (this.isJsonMime(response.headers.get('content-type'))) {
return new runtime.JSONApiResponse<string>(response);
} else {
return new runtime.TextApiResponse(response) as any;
}
}
/**
* Permanently deletes the annotation.
* Delete annotation (org scoped)
*/
async deleteAnnotation(requestParameters: DeleteAnnotationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string> {
const response = await this.deleteAnnotationRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Returns one annotation. Add `include=node_pools` to include node pools.
* Get annotation by ID (org scoped)
@@ -54,10 +191,6 @@ export class AnnotationsApi extends runtime.BaseAPI {
const queryParameters: any = {};
if (requestParameters['include'] != null) {
queryParameters['include'] = requestParameters['include'];
}
const headerParameters: runtime.HTTPHeaders = {};
if (requestParameters['xOrgID'] != null) {
@@ -158,4 +291,69 @@ export class AnnotationsApi extends runtime.BaseAPI {
return await response.value();
}
/**
* Partially update annotation fields.
* Update annotation (org scoped)
*/
async updateAnnotationRaw(requestParameters: UpdateAnnotationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DtoAnnotationResponse>> {
if (requestParameters['id'] == null) {
throw new runtime.RequiredError(
'id',
'Required parameter "id" was null or undefined when calling updateAnnotation().'
);
}
if (requestParameters['body'] == null) {
throw new runtime.RequiredError(
'body',
'Required parameter "body" was null or undefined when calling updateAnnotation().'
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/json';
if (requestParameters['xOrgID'] != null) {
headerParameters['X-Org-ID'] = String(requestParameters['xOrgID']);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] = await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] = await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/annotations/{id}`;
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
const response = await this.request({
path: urlPath,
method: 'PATCH',
headers: headerParameters,
query: queryParameters,
body: DtoUpdateAnnotationRequestToJSON(requestParameters['body']),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => DtoAnnotationResponseFromJSON(jsonValue));
}
/**
* Partially update annotation fields.
* Update annotation (org scoped)
*/
async updateAnnotation(requestParameters: UpdateAnnotationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DtoAnnotationResponse> {
const response = await this.updateAnnotationRaw(requestParameters, initOverrides);
return await response.value();
}
}

View File

@@ -0,0 +1,291 @@
/* tslint:disable */
/* eslint-disable */
/**
* AutoGlue API
* API for managing K3s clusters across cloud providers
*
* The version of the OpenAPI document: 1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from '../runtime';
import type {
DtoJob,
DtoPageJob,
DtoQueueInfo,
} from '../models/index';
import {
DtoJobFromJSON,
DtoJobToJSON,
DtoPageJobFromJSON,
DtoPageJobToJSON,
DtoQueueInfoFromJSON,
DtoQueueInfoToJSON,
} from '../models/index';
export interface AdminCancelArcherJobRequest {
id: string;
}
export interface AdminEnqueueArcherJobRequest {
body: object;
}
export interface AdminListArcherJobsRequest {
status?: AdminListArcherJobsStatusEnum;
queue?: string;
q?: string;
page?: number;
pageSize?: number;
}
export interface AdminRetryArcherJobRequest {
id: string;
}
/**
*
*/
export class ArcherAdminApi extends runtime.BaseAPI {
/**
* Set job status to canceled if cancellable. For running jobs, this only affects future picks; wire to Archer if you need active kill.
* Cancel an Archer job (admin)
*/
async adminCancelArcherJobRaw(requestParameters: AdminCancelArcherJobRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DtoJob>> {
if (requestParameters['id'] == null) {
throw new runtime.RequiredError(
'id',
'Required parameter "id" was null or undefined when calling adminCancelArcherJob().'
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/admin/archer/jobs/{id}/cancel`;
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
const response = await this.request({
path: urlPath,
method: 'POST',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => DtoJobFromJSON(jsonValue));
}
/**
* Set job status to canceled if cancellable. For running jobs, this only affects future picks; wire to Archer if you need active kill.
* Cancel an Archer job (admin)
*/
async adminCancelArcherJob(requestParameters: AdminCancelArcherJobRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DtoJob> {
const response = await this.adminCancelArcherJobRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Create a job immediately or schedule it for the future via `run_at`.
* Enqueue a new Archer job (admin)
*/
async adminEnqueueArcherJobRaw(requestParameters: AdminEnqueueArcherJobRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DtoJob>> {
if (requestParameters['body'] == null) {
throw new runtime.RequiredError(
'body',
'Required parameter "body" was null or undefined when calling adminEnqueueArcherJob().'
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/admin/archer/jobs`;
const response = await this.request({
path: urlPath,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: requestParameters['body'] as any,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => DtoJobFromJSON(jsonValue));
}
/**
* Create a job immediately or schedule it for the future via `run_at`.
* Enqueue a new Archer job (admin)
*/
async adminEnqueueArcherJob(requestParameters: AdminEnqueueArcherJobRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DtoJob> {
const response = await this.adminEnqueueArcherJobRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Paginated background jobs with optional filters. Search `q` may match id, type, error, payload (implementation-dependent).
* List Archer jobs (admin)
*/
async adminListArcherJobsRaw(requestParameters: AdminListArcherJobsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DtoPageJob>> {
const queryParameters: any = {};
if (requestParameters['status'] != null) {
queryParameters['status'] = requestParameters['status'];
}
if (requestParameters['queue'] != null) {
queryParameters['queue'] = requestParameters['queue'];
}
if (requestParameters['q'] != null) {
queryParameters['q'] = requestParameters['q'];
}
if (requestParameters['page'] != null) {
queryParameters['page'] = requestParameters['page'];
}
if (requestParameters['pageSize'] != null) {
queryParameters['page_size'] = requestParameters['pageSize'];
}
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/admin/archer/jobs`;
const response = await this.request({
path: urlPath,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => DtoPageJobFromJSON(jsonValue));
}
/**
* Paginated background jobs with optional filters. Search `q` may match id, type, error, payload (implementation-dependent).
* List Archer jobs (admin)
*/
async adminListArcherJobs(requestParameters: AdminListArcherJobsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DtoPageJob> {
const response = await this.adminListArcherJobsRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Summary metrics per queue (pending, running, failed, scheduled).
* List Archer queues (admin)
*/
async adminListArcherQueuesRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<DtoQueueInfo>>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/admin/archer/queues`;
const response = await this.request({
path: urlPath,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(DtoQueueInfoFromJSON));
}
/**
* Summary metrics per queue (pending, running, failed, scheduled).
* List Archer queues (admin)
*/
async adminListArcherQueues(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<DtoQueueInfo>> {
const response = await this.adminListArcherQueuesRaw(initOverrides);
return await response.value();
}
/**
* Marks the job retriable (DB flip). Swap this for an Archer admin call if you expose one.
* Retry a failed/canceled Archer job (admin)
*/
async adminRetryArcherJobRaw(requestParameters: AdminRetryArcherJobRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DtoJob>> {
if (requestParameters['id'] == null) {
throw new runtime.RequiredError(
'id',
'Required parameter "id" was null or undefined when calling adminRetryArcherJob().'
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/admin/archer/jobs/{id}/retry`;
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
const response = await this.request({
path: urlPath,
method: 'POST',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => DtoJobFromJSON(jsonValue));
}
/**
* Marks the job retriable (DB flip). Swap this for an Archer admin call if you expose one.
* Retry a failed/canceled Archer job (admin)
*/
async adminRetryArcherJob(requestParameters: AdminRetryArcherJobRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DtoJob> {
const response = await this.adminRetryArcherJobRaw(requestParameters, initOverrides);
return await response.value();
}
}
/**
* @export
*/
export const AdminListArcherJobsStatusEnum = {
queued: 'queued',
running: 'running',
succeeded: 'succeeded',
failed: 'failed',
canceled: 'canceled',
retrying: 'retrying',
scheduled: 'scheduled'
} as const;
export type AdminListArcherJobsStatusEnum = typeof AdminListArcherJobsStatusEnum[keyof typeof AdminListArcherJobsStatusEnum];

View File

@@ -1,6 +1,7 @@
/* tslint:disable */
/* eslint-disable */
export * from './AnnotationsApi';
export * from './ArcherAdminApi';
export * from './AuthApi';
export * from './HealthApi';
export * from './LabelsApi';

View File

@@ -4,14 +4,181 @@ All URIs are relative to *http://localhost:8080/api/v1*
| Method | HTTP request | Description |
|------------- | ------------- | -------------|
| [**createAnnotation**](AnnotationsApi.md#createannotation) | **POST** /annotations | Create annotation (org scoped) |
| [**deleteAnnotation**](AnnotationsApi.md#deleteannotation) | **DELETE** /annotations/{id} | Delete annotation (org scoped) |
| [**getAnnotation**](AnnotationsApi.md#getannotation) | **GET** /annotations/{id} | Get annotation by ID (org scoped) |
| [**listAnnotations**](AnnotationsApi.md#listannotations) | **GET** /annotations | List annotations (org scoped) |
| [**updateAnnotation**](AnnotationsApi.md#updateannotation) | **PATCH** /annotations/{id} | Update annotation (org scoped) |
## createAnnotation
> DtoAnnotationResponse createAnnotation(body, xOrgID)
Create annotation (org scoped)
Creates an annotation.
### Example
```ts
import {
Configuration,
AnnotationsApi,
} from '@glueops/autoglue-sdk-go';
import type { CreateAnnotationRequest } from '@glueops/autoglue-sdk-go';
async function example() {
console.log("🚀 Testing @glueops/autoglue-sdk-go SDK...");
const config = new Configuration({
// To configure API key authorization: OrgKeyAuth
apiKey: "YOUR API KEY",
// To configure API key authorization: OrgSecretAuth
apiKey: "YOUR API KEY",
// To configure API key authorization: BearerAuth
apiKey: "YOUR API KEY",
});
const api = new AnnotationsApi(config);
const body = {
// DtoCreateAnnotationRequest | Annotation payload
body: ...,
// string | Organization UUID (optional)
xOrgID: xOrgID_example,
} satisfies CreateAnnotationRequest;
try {
const data = await api.createAnnotation(body);
console.log(data);
} catch (error) {
console.error(error);
}
}
// Run the test
example().catch(console.error);
```
### Parameters
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **body** | [DtoCreateAnnotationRequest](DtoCreateAnnotationRequest.md) | Annotation payload | |
| **xOrgID** | `string` | Organization UUID | [Optional] [Defaults to `undefined`] |
### Return type
[**DtoAnnotationResponse**](DtoAnnotationResponse.md)
### Authorization
[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth)
### HTTP request headers
- **Content-Type**: `application/json`
- **Accept**: `application/json`
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **201** | Created | - |
| **400** | invalid json / missing fields | - |
| **401** | Unauthorized | - |
| **403** | organization required | - |
| **500** | create failed | - |
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
## deleteAnnotation
> string deleteAnnotation(id, xOrgID)
Delete annotation (org scoped)
Permanently deletes the annotation.
### Example
```ts
import {
Configuration,
AnnotationsApi,
} from '@glueops/autoglue-sdk-go';
import type { DeleteAnnotationRequest } from '@glueops/autoglue-sdk-go';
async function example() {
console.log("🚀 Testing @glueops/autoglue-sdk-go SDK...");
const config = new Configuration({
// To configure API key authorization: OrgKeyAuth
apiKey: "YOUR API KEY",
// To configure API key authorization: OrgSecretAuth
apiKey: "YOUR API KEY",
// To configure API key authorization: BearerAuth
apiKey: "YOUR API KEY",
});
const api = new AnnotationsApi(config);
const body = {
// string | Annotation ID (UUID)
id: id_example,
// string | Organization UUID (optional)
xOrgID: xOrgID_example,
} satisfies DeleteAnnotationRequest;
try {
const data = await api.deleteAnnotation(body);
console.log(data);
} catch (error) {
console.error(error);
}
}
// Run the test
example().catch(console.error);
```
### Parameters
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **id** | `string` | Annotation ID (UUID) | [Defaults to `undefined`] |
| **xOrgID** | `string` | Organization UUID | [Optional] [Defaults to `undefined`] |
### Return type
**string**
### Authorization
[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: `application/json`
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **204** | No Content | - |
| **400** | invalid id | - |
| **401** | Unauthorized | - |
| **403** | organization required | - |
| **500** | delete failed | - |
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
## getAnnotation
> DtoAnnotationResponse getAnnotation(id, xOrgID, include)
> DtoAnnotationResponse getAnnotation(id, xOrgID)
Get annotation by ID (org scoped)
@@ -43,8 +210,6 @@ async function example() {
id: id_example,
// string | Organization UUID (optional)
xOrgID: xOrgID_example,
// string | Optional: node_pools (optional)
include: include_example,
} satisfies GetAnnotationRequest;
try {
@@ -66,7 +231,6 @@ example().catch(console.error);
|------------- | ------------- | ------------- | -------------|
| **id** | `string` | Annotation ID (UUID) | [Defaults to `undefined`] |
| **xOrgID** | `string` | Organization UUID | [Optional] [Defaults to `undefined`] |
| **include** | `string` | Optional: node_pools | [Optional] [Defaults to `undefined`] |
### Return type
@@ -181,3 +345,89 @@ example().catch(console.error);
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
## updateAnnotation
> DtoAnnotationResponse updateAnnotation(id, body, xOrgID)
Update annotation (org scoped)
Partially update annotation fields.
### Example
```ts
import {
Configuration,
AnnotationsApi,
} from '@glueops/autoglue-sdk-go';
import type { UpdateAnnotationRequest } from '@glueops/autoglue-sdk-go';
async function example() {
console.log("🚀 Testing @glueops/autoglue-sdk-go SDK...");
const config = new Configuration({
// To configure API key authorization: OrgKeyAuth
apiKey: "YOUR API KEY",
// To configure API key authorization: OrgSecretAuth
apiKey: "YOUR API KEY",
// To configure API key authorization: BearerAuth
apiKey: "YOUR API KEY",
});
const api = new AnnotationsApi(config);
const body = {
// string | Annotation ID (UUID)
id: id_example,
// DtoUpdateAnnotationRequest | Fields to update
body: ...,
// string | Organization UUID (optional)
xOrgID: xOrgID_example,
} satisfies UpdateAnnotationRequest;
try {
const data = await api.updateAnnotation(body);
console.log(data);
} catch (error) {
console.error(error);
}
}
// Run the test
example().catch(console.error);
```
### Parameters
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **id** | `string` | Annotation ID (UUID) | [Defaults to `undefined`] |
| **body** | [DtoUpdateAnnotationRequest](DtoUpdateAnnotationRequest.md) | Fields to update | |
| **xOrgID** | `string` | Organization UUID | [Optional] [Defaults to `undefined`] |
### Return type
[**DtoAnnotationResponse**](DtoAnnotationResponse.md)
### Authorization
[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth)
### HTTP request headers
- **Content-Type**: `application/json`
- **Accept**: `application/json`
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | OK | - |
| **400** | invalid id / invalid json | - |
| **401** | Unauthorized | - |
| **403** | organization required | - |
| **404** | not found | - |
| **500** | update failed | - |
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)

View File

@@ -0,0 +1,390 @@
# ArcherAdminApi
All URIs are relative to *http://localhost:8080/api/v1*
| Method | HTTP request | Description |
|------------- | ------------- | -------------|
| [**adminCancelArcherJob**](ArcherAdminApi.md#admincancelarcherjob) | **POST** /admin/archer/jobs/{id}/cancel | Cancel an Archer job (admin) |
| [**adminEnqueueArcherJob**](ArcherAdminApi.md#adminenqueuearcherjob) | **POST** /admin/archer/jobs | Enqueue a new Archer job (admin) |
| [**adminListArcherJobs**](ArcherAdminApi.md#adminlistarcherjobs) | **GET** /admin/archer/jobs | List Archer jobs (admin) |
| [**adminListArcherQueues**](ArcherAdminApi.md#adminlistarcherqueues) | **GET** /admin/archer/queues | List Archer queues (admin) |
| [**adminRetryArcherJob**](ArcherAdminApi.md#adminretryarcherjob) | **POST** /admin/archer/jobs/{id}/retry | Retry a failed/canceled Archer job (admin) |
## adminCancelArcherJob
> DtoJob adminCancelArcherJob(id)
Cancel an Archer job (admin)
Set job status to canceled if cancellable. For running jobs, this only affects future picks; wire to Archer if you need active kill.
### Example
```ts
import {
Configuration,
ArcherAdminApi,
} from '@glueops/autoglue-sdk-go';
import type { AdminCancelArcherJobRequest } from '@glueops/autoglue-sdk-go';
async function example() {
console.log("🚀 Testing @glueops/autoglue-sdk-go SDK...");
const config = new Configuration({
// To configure API key authorization: BearerAuth
apiKey: "YOUR API KEY",
});
const api = new ArcherAdminApi(config);
const body = {
// string | Job ID
id: id_example,
} satisfies AdminCancelArcherJobRequest;
try {
const data = await api.adminCancelArcherJob(body);
console.log(data);
} catch (error) {
console.error(error);
}
}
// Run the test
example().catch(console.error);
```
### Parameters
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **id** | `string` | Job ID | [Defaults to `undefined`] |
### Return type
[**DtoJob**](DtoJob.md)
### Authorization
[BearerAuth](../README.md#BearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: `application/json`
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | OK | - |
| **400** | invalid job or not cancellable | - |
| **401** | Unauthorized | - |
| **403** | forbidden | - |
| **404** | not found | - |
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
## adminEnqueueArcherJob
> DtoJob adminEnqueueArcherJob(body)
Enqueue a new Archer job (admin)
Create a job immediately or schedule it for the future via &#x60;run_at&#x60;.
### Example
```ts
import {
Configuration,
ArcherAdminApi,
} from '@glueops/autoglue-sdk-go';
import type { AdminEnqueueArcherJobRequest } from '@glueops/autoglue-sdk-go';
async function example() {
console.log("🚀 Testing @glueops/autoglue-sdk-go SDK...");
const config = new Configuration({
// To configure API key authorization: BearerAuth
apiKey: "YOUR API KEY",
});
const api = new ArcherAdminApi(config);
const body = {
// object | Job parameters
body: Object,
} satisfies AdminEnqueueArcherJobRequest;
try {
const data = await api.adminEnqueueArcherJob(body);
console.log(data);
} catch (error) {
console.error(error);
}
}
// Run the test
example().catch(console.error);
```
### Parameters
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **body** | `object` | Job parameters | |
### Return type
[**DtoJob**](DtoJob.md)
### Authorization
[BearerAuth](../README.md#BearerAuth)
### HTTP request headers
- **Content-Type**: `application/json`
- **Accept**: `application/json`
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | OK | - |
| **400** | invalid json or missing fields | - |
| **401** | Unauthorized | - |
| **403** | forbidden | - |
| **500** | internal error | - |
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
## adminListArcherJobs
> DtoPageJob adminListArcherJobs(status, queue, q, page, pageSize)
List Archer jobs (admin)
Paginated background jobs with optional filters. Search &#x60;q&#x60; may match id, type, error, payload (implementation-dependent).
### Example
```ts
import {
Configuration,
ArcherAdminApi,
} from '@glueops/autoglue-sdk-go';
import type { AdminListArcherJobsRequest } from '@glueops/autoglue-sdk-go';
async function example() {
console.log("🚀 Testing @glueops/autoglue-sdk-go SDK...");
const config = new Configuration({
// To configure API key authorization: BearerAuth
apiKey: "YOUR API KEY",
});
const api = new ArcherAdminApi(config);
const body = {
// 'queued' | 'running' | 'succeeded' | 'failed' | 'canceled' | 'retrying' | 'scheduled' | Filter by status (optional)
status: status_example,
// string | Filter by queue name / worker name (optional)
queue: queue_example,
// string | Free-text search (optional)
q: q_example,
// number | Page number (optional)
page: 56,
// number | Items per page (optional)
pageSize: 56,
} satisfies AdminListArcherJobsRequest;
try {
const data = await api.adminListArcherJobs(body);
console.log(data);
} catch (error) {
console.error(error);
}
}
// Run the test
example().catch(console.error);
```
### Parameters
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **status** | `queued`, `running`, `succeeded`, `failed`, `canceled`, `retrying`, `scheduled` | Filter by status | [Optional] [Defaults to `undefined`] [Enum: queued, running, succeeded, failed, canceled, retrying, scheduled] |
| **queue** | `string` | Filter by queue name / worker name | [Optional] [Defaults to `undefined`] |
| **q** | `string` | Free-text search | [Optional] [Defaults to `undefined`] |
| **page** | `number` | Page number | [Optional] [Defaults to `1`] |
| **pageSize** | `number` | Items per page | [Optional] [Defaults to `25`] |
### Return type
[**DtoPageJob**](DtoPageJob.md)
### Authorization
[BearerAuth](../README.md#BearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: `application/json`
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | OK | - |
| **401** | Unauthorized | - |
| **403** | forbidden | - |
| **500** | internal error | - |
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
## adminListArcherQueues
> Array&lt;DtoQueueInfo&gt; adminListArcherQueues()
List Archer queues (admin)
Summary metrics per queue (pending, running, failed, scheduled).
### Example
```ts
import {
Configuration,
ArcherAdminApi,
} from '@glueops/autoglue-sdk-go';
import type { AdminListArcherQueuesRequest } from '@glueops/autoglue-sdk-go';
async function example() {
console.log("🚀 Testing @glueops/autoglue-sdk-go SDK...");
const config = new Configuration({
// To configure API key authorization: BearerAuth
apiKey: "YOUR API KEY",
});
const api = new ArcherAdminApi(config);
try {
const data = await api.adminListArcherQueues();
console.log(data);
} catch (error) {
console.error(error);
}
}
// Run the test
example().catch(console.error);
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**Array&lt;DtoQueueInfo&gt;**](DtoQueueInfo.md)
### Authorization
[BearerAuth](../README.md#BearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: `application/json`
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | OK | - |
| **401** | Unauthorized | - |
| **403** | forbidden | - |
| **500** | internal error | - |
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
## adminRetryArcherJob
> DtoJob adminRetryArcherJob(id)
Retry a failed/canceled Archer job (admin)
Marks the job retriable (DB flip). Swap this for an Archer admin call if you expose one.
### Example
```ts
import {
Configuration,
ArcherAdminApi,
} from '@glueops/autoglue-sdk-go';
import type { AdminRetryArcherJobRequest } from '@glueops/autoglue-sdk-go';
async function example() {
console.log("🚀 Testing @glueops/autoglue-sdk-go SDK...");
const config = new Configuration({
// To configure API key authorization: BearerAuth
apiKey: "YOUR API KEY",
});
const api = new ArcherAdminApi(config);
const body = {
// string | Job ID
id: id_example,
} satisfies AdminRetryArcherJobRequest;
try {
const data = await api.adminRetryArcherJob(body);
console.log(data);
} catch (error) {
console.error(error);
}
}
// Run the test
example().catch(console.error);
```
### Parameters
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **id** | `string` | Job ID | [Defaults to `undefined`] |
### Return type
[**DtoJob**](DtoJob.md)
### Authorization
[BearerAuth](../README.md#BearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: `application/json`
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | OK | - |
| **400** | invalid job or not eligible | - |
| **401** | Unauthorized | - |
| **403** | forbidden | - |
| **404** | not found | - |
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)

View File

@@ -0,0 +1,36 @@
# DtoCreateAnnotationRequest
## Properties
Name | Type
------------ | -------------
`key` | string
`value` | string
## Example
```typescript
import type { DtoCreateAnnotationRequest } from '@glueops/autoglue-sdk-go'
// TODO: Update the object below with actual values
const example = {
"key": null,
"value": null,
} satisfies DtoCreateAnnotationRequest
console.log(example)
// Convert the instance to a JSON string
const exampleJSON: string = JSON.stringify(example)
console.log(exampleJSON)
// Parse the JSON string back to an object
const exampleParsed = JSON.parse(exampleJSON) as DtoCreateAnnotationRequest
console.log(exampleParsed)
```
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)

54
ui/src/sdk/docs/DtoJob.md Normal file
View File

@@ -0,0 +1,54 @@
# DtoJob
## Properties
Name | Type
------------ | -------------
`attempts` | number
`created_at` | string
`id` | string
`last_error` | string
`max_attempts` | number
`payload` | object
`queue` | string
`run_at` | string
`status` | [DtoJobStatus](DtoJobStatus.md)
`type` | string
`updated_at` | string
## Example
```typescript
import type { DtoJob } from '@glueops/autoglue-sdk-go'
// TODO: Update the object below with actual values
const example = {
"attempts": null,
"created_at": null,
"id": null,
"last_error": null,
"max_attempts": null,
"payload": null,
"queue": null,
"run_at": null,
"status": null,
"type": null,
"updated_at": null,
} satisfies DtoJob
console.log(example)
// Convert the instance to a JSON string
const exampleJSON: string = JSON.stringify(example)
console.log(exampleJSON)
// Parse the JSON string back to an object
const exampleParsed = JSON.parse(exampleJSON) as DtoJob
console.log(exampleParsed)
```
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)

View File

@@ -0,0 +1,32 @@
# DtoJobStatus
## Properties
Name | Type
------------ | -------------
## Example
```typescript
import type { DtoJobStatus } from '@glueops/autoglue-sdk-go'
// TODO: Update the object below with actual values
const example = {
} satisfies DtoJobStatus
console.log(example)
// Convert the instance to a JSON string
const exampleJSON: string = JSON.stringify(example)
console.log(exampleJSON)
// Parse the JSON string back to an object
const exampleParsed = JSON.parse(exampleJSON) as DtoJobStatus
console.log(exampleParsed)
```
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)

View File

@@ -0,0 +1,40 @@
# DtoPageJob
## Properties
Name | Type
------------ | -------------
`items` | [Array&lt;DtoJob&gt;](DtoJob.md)
`page` | number
`page_size` | number
`total` | number
## Example
```typescript
import type { DtoPageJob } from '@glueops/autoglue-sdk-go'
// TODO: Update the object below with actual values
const example = {
"items": null,
"page": null,
"page_size": null,
"total": null,
} satisfies DtoPageJob
console.log(example)
// Convert the instance to a JSON string
const exampleJSON: string = JSON.stringify(example)
console.log(exampleJSON)
// Parse the JSON string back to an object
const exampleParsed = JSON.parse(exampleJSON) as DtoPageJob
console.log(exampleParsed)
```
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)

View File

@@ -0,0 +1,42 @@
# DtoQueueInfo
## Properties
Name | Type
------------ | -------------
`failed` | number
`name` | string
`pending` | number
`running` | number
`scheduled` | number
## Example
```typescript
import type { DtoQueueInfo } from '@glueops/autoglue-sdk-go'
// TODO: Update the object below with actual values
const example = {
"failed": null,
"name": null,
"pending": null,
"running": null,
"scheduled": null,
} satisfies DtoQueueInfo
console.log(example)
// Convert the instance to a JSON string
const exampleJSON: string = JSON.stringify(example)
console.log(exampleJSON)
// Parse the JSON string back to an object
const exampleParsed = JSON.parse(exampleJSON) as DtoQueueInfo
console.log(exampleParsed)
```
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)

View File

@@ -0,0 +1,36 @@
# DtoUpdateAnnotationRequest
## Properties
Name | Type
------------ | -------------
`key` | string
`value` | string
## Example
```typescript
import type { DtoUpdateAnnotationRequest } from '@glueops/autoglue-sdk-go'
// TODO: Update the object below with actual values
const example = {
"key": null,
"value": null,
} satisfies DtoUpdateAnnotationRequest
console.log(example)
// Convert the instance to a JSON string
const exampleJSON: string = JSON.stringify(example)
console.log(exampleJSON)
// Parse the JSON string back to an object
const exampleParsed = JSON.parse(exampleJSON) as DtoUpdateAnnotationRequest
console.log(exampleParsed)
```
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)

View File

@@ -11,6 +11,7 @@ Name | Type
`display_name` | string
`emails` | [Array&lt;ModelsUserEmail&gt;](ModelsUserEmail.md)
`id` | string
`is_admin` | boolean
`is_disabled` | boolean
`organizations` | [Array&lt;ModelsOrganization&gt;](ModelsOrganization.md)
`primary_email` | string
@@ -28,6 +29,7 @@ const example = {
"display_name": null,
"emails": null,
"id": null,
"is_admin": null,
"is_disabled": null,
"organizations": null,
"primary_email": null,

View File

@@ -10,6 +10,7 @@ Name | Type
`created_at` | Date
`display_name` | string
`id` | string
`is_admin` | boolean
`is_disabled` | boolean
`primary_email` | string
`updated_at` | Date
@@ -25,6 +26,7 @@ const example = {
"created_at": null,
"display_name": null,
"id": null,
"is_admin": null,
"is_disabled": null,
"primary_email": null,
"updated_at": null,

View File

@@ -0,0 +1,73 @@
/* tslint:disable */
/* eslint-disable */
/**
* AutoGlue API
* API for managing K3s clusters across cloud providers
*
* The version of the OpenAPI document: 1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { mapValues } from '../runtime';
/**
*
* @export
* @interface DtoCreateAnnotationRequest
*/
export interface DtoCreateAnnotationRequest {
/**
*
* @type {string}
* @memberof DtoCreateAnnotationRequest
*/
key?: string;
/**
*
* @type {string}
* @memberof DtoCreateAnnotationRequest
*/
value?: string;
}
/**
* Check if a given object implements the DtoCreateAnnotationRequest interface.
*/
export function instanceOfDtoCreateAnnotationRequest(value: object): value is DtoCreateAnnotationRequest {
return true;
}
export function DtoCreateAnnotationRequestFromJSON(json: any): DtoCreateAnnotationRequest {
return DtoCreateAnnotationRequestFromJSONTyped(json, false);
}
export function DtoCreateAnnotationRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DtoCreateAnnotationRequest {
if (json == null) {
return json;
}
return {
'key': json['key'] == null ? undefined : json['key'],
'value': json['value'] == null ? undefined : json['value'],
};
}
export function DtoCreateAnnotationRequestToJSON(json: any): DtoCreateAnnotationRequest {
return DtoCreateAnnotationRequestToJSONTyped(json, false);
}
export function DtoCreateAnnotationRequestToJSONTyped(value?: DtoCreateAnnotationRequest | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'key': value['key'],
'value': value['value'],
};
}

156
ui/src/sdk/models/DtoJob.ts Normal file
View File

@@ -0,0 +1,156 @@
/* tslint:disable */
/* eslint-disable */
/**
* AutoGlue API
* API for managing K3s clusters across cloud providers
*
* The version of the OpenAPI document: 1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { mapValues } from '../runtime';
import type { DtoJobStatus } from './DtoJobStatus';
import {
DtoJobStatusFromJSON,
DtoJobStatusFromJSONTyped,
DtoJobStatusToJSON,
DtoJobStatusToJSONTyped,
} from './DtoJobStatus';
/**
*
* @export
* @interface DtoJob
*/
export interface DtoJob {
/**
* example: 0
* @type {number}
* @memberof DtoJob
*/
attempts?: number;
/**
* example: 2025-11-04T09:30:00Z
* @type {string}
* @memberof DtoJob
*/
created_at?: string;
/**
* example: 01HF7SZK8Z8WG1M3J7S2Z8M2N6
* @type {string}
* @memberof DtoJob
*/
id?: string;
/**
* example: dial tcp: i/o timeout
* @type {string}
* @memberof DtoJob
*/
last_error?: string;
/**
* example: 3
* @type {number}
* @memberof DtoJob
*/
max_attempts?: number;
/**
* arbitrary JSON payload
* @type {object}
* @memberof DtoJob
*/
payload?: object;
/**
* example: default
* @type {string}
* @memberof DtoJob
*/
queue?: string;
/**
* example: 2025-11-05T08:00:00Z
* @type {string}
* @memberof DtoJob
*/
run_at?: string;
/**
* enum: queued,running,succeeded,failed,canceled,retrying,scheduled
* example: queued
* @type {DtoJobStatus}
* @memberof DtoJob
*/
status?: DtoJobStatus;
/**
* example: email.send
* @type {string}
* @memberof DtoJob
*/
type?: string;
/**
* example: 2025-11-04T09:31:00Z
* @type {string}
* @memberof DtoJob
*/
updated_at?: string;
}
/**
* Check if a given object implements the DtoJob interface.
*/
export function instanceOfDtoJob(value: object): value is DtoJob {
return true;
}
export function DtoJobFromJSON(json: any): DtoJob {
return DtoJobFromJSONTyped(json, false);
}
export function DtoJobFromJSONTyped(json: any, ignoreDiscriminator: boolean): DtoJob {
if (json == null) {
return json;
}
return {
'attempts': json['attempts'] == null ? undefined : json['attempts'],
'created_at': json['created_at'] == null ? undefined : json['created_at'],
'id': json['id'] == null ? undefined : json['id'],
'last_error': json['last_error'] == null ? undefined : json['last_error'],
'max_attempts': json['max_attempts'] == null ? undefined : json['max_attempts'],
'payload': json['payload'] == null ? undefined : json['payload'],
'queue': json['queue'] == null ? undefined : json['queue'],
'run_at': json['run_at'] == null ? undefined : json['run_at'],
'status': json['status'] == null ? undefined : DtoJobStatusFromJSON(json['status']),
'type': json['type'] == null ? undefined : json['type'],
'updated_at': json['updated_at'] == null ? undefined : json['updated_at'],
};
}
export function DtoJobToJSON(json: any): DtoJob {
return DtoJobToJSONTyped(json, false);
}
export function DtoJobToJSONTyped(value?: DtoJob | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'attempts': value['attempts'],
'created_at': value['created_at'],
'id': value['id'],
'last_error': value['last_error'],
'max_attempts': value['max_attempts'],
'payload': value['payload'],
'queue': value['queue'],
'run_at': value['run_at'],
'status': DtoJobStatusToJSON(value['status']),
'type': value['type'],
'updated_at': value['updated_at'],
};
}

View File

@@ -0,0 +1,58 @@
/* tslint:disable */
/* eslint-disable */
/**
* AutoGlue API
* API for managing K3s clusters across cloud providers
*
* The version of the OpenAPI document: 1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
*/
export const DtoJobStatus = {
StatusQueued: 'queued',
StatusRunning: 'running',
StatusSucceeded: 'succeeded',
StatusFailed: 'failed',
StatusCanceled: 'canceled',
StatusRetrying: 'retrying',
StatusScheduled: 'scheduled'
} as const;
export type DtoJobStatus = typeof DtoJobStatus[keyof typeof DtoJobStatus];
export function instanceOfDtoJobStatus(value: any): boolean {
for (const key in DtoJobStatus) {
if (Object.prototype.hasOwnProperty.call(DtoJobStatus, key)) {
if (DtoJobStatus[key as keyof typeof DtoJobStatus] === value) {
return true;
}
}
}
return false;
}
export function DtoJobStatusFromJSON(json: any): DtoJobStatus {
return DtoJobStatusFromJSONTyped(json, false);
}
export function DtoJobStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): DtoJobStatus {
return json as DtoJobStatus;
}
export function DtoJobStatusToJSON(value?: DtoJobStatus | null): any {
return value as any;
}
export function DtoJobStatusToJSONTyped(value: any, ignoreDiscriminator: boolean): DtoJobStatus {
return value as DtoJobStatus;
}

View File

@@ -0,0 +1,97 @@
/* tslint:disable */
/* eslint-disable */
/**
* AutoGlue API
* API for managing K3s clusters across cloud providers
*
* The version of the OpenAPI document: 1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { mapValues } from '../runtime';
import type { DtoJob } from './DtoJob';
import {
DtoJobFromJSON,
DtoJobFromJSONTyped,
DtoJobToJSON,
DtoJobToJSONTyped,
} from './DtoJob';
/**
*
* @export
* @interface DtoPageJob
*/
export interface DtoPageJob {
/**
*
* @type {Array<DtoJob>}
* @memberof DtoPageJob
*/
items?: Array<DtoJob>;
/**
* example: 1
* @type {number}
* @memberof DtoPageJob
*/
page?: number;
/**
* example: 25
* @type {number}
* @memberof DtoPageJob
*/
page_size?: number;
/**
* example: 120
* @type {number}
* @memberof DtoPageJob
*/
total?: number;
}
/**
* Check if a given object implements the DtoPageJob interface.
*/
export function instanceOfDtoPageJob(value: object): value is DtoPageJob {
return true;
}
export function DtoPageJobFromJSON(json: any): DtoPageJob {
return DtoPageJobFromJSONTyped(json, false);
}
export function DtoPageJobFromJSONTyped(json: any, ignoreDiscriminator: boolean): DtoPageJob {
if (json == null) {
return json;
}
return {
'items': json['items'] == null ? undefined : ((json['items'] as Array<any>).map(DtoJobFromJSON)),
'page': json['page'] == null ? undefined : json['page'],
'page_size': json['page_size'] == null ? undefined : json['page_size'],
'total': json['total'] == null ? undefined : json['total'],
};
}
export function DtoPageJobToJSON(json: any): DtoPageJob {
return DtoPageJobToJSONTyped(json, false);
}
export function DtoPageJobToJSONTyped(value?: DtoPageJob | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'items': value['items'] == null ? undefined : ((value['items'] as Array<any>).map(DtoJobToJSON)),
'page': value['page'],
'page_size': value['page_size'],
'total': value['total'],
};
}

View File

@@ -0,0 +1,97 @@
/* tslint:disable */
/* eslint-disable */
/**
* AutoGlue API
* API for managing K3s clusters across cloud providers
*
* The version of the OpenAPI document: 1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { mapValues } from '../runtime';
/**
*
* @export
* @interface DtoQueueInfo
*/
export interface DtoQueueInfo {
/**
* example: 5
* @type {number}
* @memberof DtoQueueInfo
*/
failed?: number;
/**
* example: default
* @type {string}
* @memberof DtoQueueInfo
*/
name?: string;
/**
* example: 42
* @type {number}
* @memberof DtoQueueInfo
*/
pending?: number;
/**
* example: 3
* @type {number}
* @memberof DtoQueueInfo
*/
running?: number;
/**
* example: 7
* @type {number}
* @memberof DtoQueueInfo
*/
scheduled?: number;
}
/**
* Check if a given object implements the DtoQueueInfo interface.
*/
export function instanceOfDtoQueueInfo(value: object): value is DtoQueueInfo {
return true;
}
export function DtoQueueInfoFromJSON(json: any): DtoQueueInfo {
return DtoQueueInfoFromJSONTyped(json, false);
}
export function DtoQueueInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): DtoQueueInfo {
if (json == null) {
return json;
}
return {
'failed': json['failed'] == null ? undefined : json['failed'],
'name': json['name'] == null ? undefined : json['name'],
'pending': json['pending'] == null ? undefined : json['pending'],
'running': json['running'] == null ? undefined : json['running'],
'scheduled': json['scheduled'] == null ? undefined : json['scheduled'],
};
}
export function DtoQueueInfoToJSON(json: any): DtoQueueInfo {
return DtoQueueInfoToJSONTyped(json, false);
}
export function DtoQueueInfoToJSONTyped(value?: DtoQueueInfo | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'failed': value['failed'],
'name': value['name'],
'pending': value['pending'],
'running': value['running'],
'scheduled': value['scheduled'],
};
}

View File

@@ -0,0 +1,73 @@
/* tslint:disable */
/* eslint-disable */
/**
* AutoGlue API
* API for managing K3s clusters across cloud providers
*
* The version of the OpenAPI document: 1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { mapValues } from '../runtime';
/**
*
* @export
* @interface DtoUpdateAnnotationRequest
*/
export interface DtoUpdateAnnotationRequest {
/**
*
* @type {string}
* @memberof DtoUpdateAnnotationRequest
*/
key?: string;
/**
*
* @type {string}
* @memberof DtoUpdateAnnotationRequest
*/
value?: string;
}
/**
* Check if a given object implements the DtoUpdateAnnotationRequest interface.
*/
export function instanceOfDtoUpdateAnnotationRequest(value: object): value is DtoUpdateAnnotationRequest {
return true;
}
export function DtoUpdateAnnotationRequestFromJSON(json: any): DtoUpdateAnnotationRequest {
return DtoUpdateAnnotationRequestFromJSONTyped(json, false);
}
export function DtoUpdateAnnotationRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DtoUpdateAnnotationRequest {
if (json == null) {
return json;
}
return {
'key': json['key'] == null ? undefined : json['key'],
'value': json['value'] == null ? undefined : json['value'],
};
}
export function DtoUpdateAnnotationRequestToJSON(json: any): DtoUpdateAnnotationRequest {
return DtoUpdateAnnotationRequestToJSONTyped(json, false);
}
export function DtoUpdateAnnotationRequestToJSONTyped(value?: DtoUpdateAnnotationRequest | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'key': value['key'],
'value': value['value'],
};
}

View File

@@ -64,6 +64,12 @@ export interface HandlersMeResponse {
* @memberof HandlersMeResponse
*/
id?: string;
/**
*
* @type {boolean}
* @memberof HandlersMeResponse
*/
is_admin?: boolean;
/**
*
* @type {boolean}
@@ -112,6 +118,7 @@ export function HandlersMeResponseFromJSONTyped(json: any, ignoreDiscriminator:
'display_name': json['display_name'] == null ? undefined : json['display_name'],
'emails': json['emails'] == null ? undefined : ((json['emails'] as Array<any>).map(ModelsUserEmailFromJSON)),
'id': json['id'] == null ? undefined : json['id'],
'is_admin': json['is_admin'] == null ? undefined : json['is_admin'],
'is_disabled': json['is_disabled'] == null ? undefined : json['is_disabled'],
'organizations': json['organizations'] == null ? undefined : ((json['organizations'] as Array<any>).map(ModelsOrganizationFromJSON)),
'primary_email': json['primary_email'] == null ? undefined : json['primary_email'],
@@ -135,6 +142,7 @@ export function HandlersMeResponseToJSONTyped(value?: HandlersMeResponse | null,
'display_name': value['display_name'],
'emails': value['emails'] == null ? undefined : ((value['emails'] as Array<any>).map(ModelsUserEmailToJSON)),
'id': value['id'],
'is_admin': value['is_admin'],
'is_disabled': value['is_disabled'],
'organizations': value['organizations'] == null ? undefined : ((value['organizations'] as Array<any>).map(ModelsOrganizationToJSON)),
'primary_email': value['primary_email'],

View File

@@ -43,6 +43,12 @@ export interface ModelsUser {
* @memberof ModelsUser
*/
id?: string;
/**
*
* @type {boolean}
* @memberof ModelsUser
*/
is_admin?: boolean;
/**
*
* @type {boolean}
@@ -84,6 +90,7 @@ export function ModelsUserFromJSONTyped(json: any, ignoreDiscriminator: boolean)
'created_at': json['created_at'] == null ? undefined : (new Date(json['created_at'])),
'display_name': json['display_name'] == null ? undefined : json['display_name'],
'id': json['id'] == null ? undefined : json['id'],
'is_admin': json['is_admin'] == null ? undefined : json['is_admin'],
'is_disabled': json['is_disabled'] == null ? undefined : json['is_disabled'],
'primary_email': json['primary_email'] == null ? undefined : json['primary_email'],
'updated_at': json['updated_at'] == null ? undefined : (new Date(json['updated_at'])),
@@ -105,6 +112,7 @@ export function ModelsUserToJSONTyped(value?: ModelsUser | null, ignoreDiscrimin
'created_at': value['created_at'] == null ? value['created_at'] : value['created_at'].toISOString(),
'display_name': value['display_name'],
'id': value['id'],
'is_admin': value['is_admin'],
'is_disabled': value['is_disabled'],
'primary_email': value['primary_email'],
'updated_at': value['updated_at'] == null ? value['updated_at'] : value['updated_at'].toISOString(),

View File

@@ -2,20 +2,26 @@
/* eslint-disable */
export * from './DtoAnnotationResponse';
export * from './DtoAuthStartResponse';
export * from './DtoCreateAnnotationRequest';
export * from './DtoCreateLabelRequest';
export * from './DtoCreateSSHRequest';
export * from './DtoCreateServerRequest';
export * from './DtoCreateTaintRequest';
export * from './DtoJWK';
export * from './DtoJWKS';
export * from './DtoJob';
export * from './DtoJobStatus';
export * from './DtoLabelResponse';
export * from './DtoLogoutRequest';
export * from './DtoPageJob';
export * from './DtoQueueInfo';
export * from './DtoRefreshRequest';
export * from './DtoServerResponse';
export * from './DtoSshResponse';
export * from './DtoSshRevealResponse';
export * from './DtoTaintResponse';
export * from './DtoTokenPair';
export * from './DtoUpdateAnnotationRequest';
export * from './DtoUpdateLabelRequest';
export * from './DtoUpdateServerRequest';
export * from './DtoUpdateTaintRequest';

View File

@@ -1,6 +1,8 @@
import { orgStore } from "@/auth/org.ts"
import { authStore } from "@/auth/store.ts"
import {
ArcherAdminApi,
AuthApi,
Configuration,
LabelsApi,
MeApi,
@@ -61,6 +63,10 @@ function makeApiClient<T>(Ctor: new (cfg: Configuration) => T): T {
return new Ctor(makeConfig())
}
export function makeAuthApi() {
return makeApiClient(AuthApi)
}
export function makeMeApi() {
return makeApiClient(MeApi)
}
@@ -88,3 +94,7 @@ export function makeTaintsApi() {
export function makeLabelsApi() {
return makeApiClient(LabelsApi)
}
export function makeArcherAdminApi() {
return makeApiClient(ArcherAdminApi)
}