feat: add credentials management

Signed-off-by: allanice001 <allanice001@gmail.com>
This commit is contained in:
allanice001
2025-11-09 21:46:31 +00:00
parent 56ea963b47
commit bc72df3c9a
43 changed files with 4671 additions and 15 deletions

View File

@@ -4,6 +4,7 @@ import { Route, Routes } from "react-router-dom"
import { ProtectedRoute } from "@/components/protected-route.tsx"
import { AnnotationPage } from "@/pages/annotations/annotation-page.tsx"
import { Login } from "@/pages/auth/login.tsx"
import { CredentialPage } from "@/pages/credentials/credential-page.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"
@@ -33,6 +34,7 @@ export default function App() {
<Route path="/labels" element={<LabelsPage />} />
<Route path="/annotations" element={<AnnotationPage />} />
<Route path="/node-pools" element={<NodePoolsPage />} />
<Route path="/credentials" element={<CredentialPage />} />
<Route path="/admin/jobs" element={<JobsPage />} />
</Route>

32
ui/src/api/credentials.ts Normal file
View File

@@ -0,0 +1,32 @@
import { withRefresh } from "@/api/with-refresh.ts"
import type { DtoCreateCredentialRequest, DtoUpdateCredentialRequest } from "@/sdk"
import { makeCredentialsApi } from "@/sdkClient.ts"
const credentials = makeCredentialsApi()
export const credentialsApi = {
listCredentials: () =>
withRefresh(async () => {
return await credentials.listCredentials()
}),
createCredential: async (body: DtoCreateCredentialRequest) =>
withRefresh(async () => {
return await credentials.createCredential({ body })
}),
getCredential: async (id: string) =>
withRefresh(async () => {
return await credentials.getCredential({ id })
}),
deleteCredential: async (id: string) =>
withRefresh(async () => {
await credentials.deleteCredential({ id })
}),
updateCredential: async (id: string, body: DtoUpdateCredentialRequest) =>
withRefresh(async () => {
return await credentials.updateCredential({ id, body })
}),
revealCredential: async (id: string) =>
withRefresh(async () => {
return await credentials.revealCredential({ id })
}),
}

View File

@@ -5,6 +5,7 @@ import {
ComponentIcon,
FileKey2Icon,
KeyRound,
LockKeyholeIcon,
ServerIcon,
SprayCanIcon,
TagsIcon,
@@ -28,6 +29,7 @@ export const mainNav: NavItem[] = [
{ to: "/taints", label: "Taints", icon: SprayCanIcon },
{ to: "/servers", label: "Servers", icon: ServerIcon },
{ to: "/ssh", label: "SSH Keys", icon: FileKey2Icon },
{ to: "/credentials", label: "Credentials", icon: LockKeyholeIcon },
]
export const orgNav: NavItem[] = [

View File

@@ -0,0 +1,790 @@
import { useMemo, useState } from "react"
import { credentialsApi } from "@/api/credentials"
import { zodResolver } from "@hookform/resolvers/zod"
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"
import { Eye, Loader2, MoreHorizontal, Pencil, Plus, Search, Trash2 } from "lucide-react"
import { useForm } from "react-hook-form"
import { toast } from "sonner"
import { z } from "zod"
import {
AlertDialog,
AlertDialogAction,
AlertDialogCancel,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
AlertDialogTrigger,
} from "@/components/ui/alert-dialog"
import { Button } from "@/components/ui/button"
import {
Dialog,
DialogContent,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
} from "@/components/ui/dialog"
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu"
import {
Form,
FormControl,
FormField,
FormItem,
FormLabel,
FormMessage,
} from "@/components/ui/form"
import { Input } from "@/components/ui/input"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
import { Textarea } from "@/components/ui/textarea"
// ---------- Schemas ----------
const jsonTransform = z
.string()
.min(2, "JSON required")
.refine((v) => {
try {
JSON.parse(v)
return true
} catch {
return false
}
}, "Invalid JSON")
.transform((v) => JSON.parse(v))
const createCredentialSchema = z.object({
provider: z.enum(["aws", "cloudflare", "hetzner", "digitalocean", "generic"]),
kind: z.enum(["aws_access_key", "api_token", "basic_auth", "oauth2"]),
schema_version: z.number().default(1),
name: z.string().min(1, "Name is required").max(100),
scope_kind: z.enum(["provider", "service", "resource"]),
scope_version: z.number().default(1),
scope: jsonTransform,
account_id: z
.string()
.optional()
.or(z.literal(""))
.transform((v) => (v ? v : undefined)),
region: z
.string()
.optional()
.or(z.literal(""))
.transform((v) => (v ? v : undefined)),
// Secrets are always JSON — makes rotate easy on update form too
secret: jsonTransform,
})
type CreateCredentialInput = z.input<typeof createCredentialSchema>
type CreateCredentialValues = z.infer<typeof createCredentialSchema>
const updateCredentialSchema = createCredentialSchema.partial().extend({
// allow rotating secret independently
secret: jsonTransform.optional(),
name: z.string().min(1, "Name is required").max(100).optional(),
})
// ---------- Helpers ----------
function pretty(obj: unknown) {
try {
return JSON.stringify(obj, null, 2)
} catch {
return ""
}
}
function toFormDefaults<T extends Record<string, any>>(initial: Partial<T>) {
return {
schema_version: 1,
scope_version: 1,
...initial,
} as any
}
// ---------- Page ----------
export const CredentialPage = () => {
const [filter, setFilter] = useState<string>("")
const [createOpen, setCreateOpen] = useState<boolean>(false)
const [editOpen, setEditOpen] = useState<boolean>(false)
const [revealOpen, setRevealOpen] = useState<boolean>(false)
const [revealJson, setRevealJson] = useState<object | null>(null)
const [editingId, setEditingId] = useState<string | null>(null)
const qc = useQueryClient()
// List
const credentialQ = useQuery({
queryKey: ["credentials"],
queryFn: () => credentialsApi.listCredentials(),
})
// Create
const createMutation = useMutation({
mutationFn: (body: CreateCredentialValues) =>
credentialsApi.createCredential({
provider: body.provider,
kind: body.kind,
schema_version: body.schema_version ?? 1,
name: body.name,
scope_kind: body.scope_kind,
scope_version: body.scope_version ?? 1,
scope: body.scope,
account_id: body.account_id,
region: body.region,
secret: body.secret,
}),
onSuccess: async () => {
await qc.invalidateQueries({ queryKey: ["credentials"] })
toast.success("Credential created")
setCreateOpen(false)
createForm.reset(createDefaults) // clear JSON textareas etc
},
onError: (err: any) => {
toast.error("Failed to create credential", {
description: err?.message ?? "Unknown error",
})
},
})
// Update
const updateMutation = useMutation({
mutationFn: (payload: { id: string; body: z.infer<typeof updateCredentialSchema> }) =>
credentialsApi.updateCredential(payload.id, payload.body),
onSuccess: async () => {
await qc.invalidateQueries({ queryKey: ["credentials"] })
toast.success("Credential updated")
setEditOpen(false)
setEditingId(null)
},
onError: (err: any) => {
toast.error("Failed to update credential", {
description: err?.message ?? "Unknown error",
})
},
})
// Delete
const deleteMutation = useMutation({
mutationFn: (id: string) => credentialsApi.deleteCredential(id),
onSuccess: async () => {
await qc.invalidateQueries({ queryKey: ["credentials"] })
toast.success("Credential deleted")
},
onError: (err: any) => {
toast.error("Failed to delete credential", {
description: err?.message ?? "Unknown error",
})
},
})
// Reveal (one-time read)
const revealMutation = useMutation({
mutationFn: (id: string) => credentialsApi.revealCredential(id),
onSuccess: (data) => {
setRevealJson(data)
setRevealOpen(true)
},
onError: (err: any) => {
toast.error("Failed to reveal secret", {
description: err?.message ?? "Unknown error",
})
},
})
// ---------- Forms ----------
const createDefaults: CreateCredentialInput = toFormDefaults<CreateCredentialInput>({
provider: "aws",
kind: "aws_access_key",
schema_version: 1,
scope_kind: "provider",
scope_version: 1,
name: "",
// IMPORTANT: default valid JSON strings so zod.transform succeeds
scope: "{}" as any,
secret: "{}" as any,
account_id: "",
region: "",
})
const createForm = useForm<CreateCredentialInput>({
resolver: zodResolver(createCredentialSchema),
defaultValues: createDefaults,
mode: "onBlur",
})
const editForm = useForm<z.input<typeof updateCredentialSchema>>({
resolver: zodResolver(updateCredentialSchema),
defaultValues: {
// populated on open
},
mode: "onBlur",
})
function openEdit(row: any) {
setEditingId(row.id)
editForm.reset({
provider: row.provider,
kind: row.kind,
schema_version: row.schema_version ?? 1,
name: row.name,
scope_kind: row.scope_kind,
scope_version: row.scope_version ?? 1,
account_id: row.account_id ?? "",
region: row.region ?? "",
// show JSON in textareas
scope: pretty(row.scope ?? {}),
// secret is optional on update; leave empty to avoid rotate
secret: undefined,
} as any)
setEditOpen(true)
}
const filtered = useMemo(() => {
const items = credentialQ.data ?? []
if (!filter.trim()) return items
const f = filter.toLowerCase()
return items.filter((c: any) =>
[
c.name,
c.provider,
c.kind,
c.scope_kind,
c.account_id,
c.region,
JSON.stringify(c.scope ?? {}),
]
.filter(Boolean)
.map((x: any) => String(x).toLowerCase())
.some((s: string) => s.includes(f))
)
}, [credentialQ.data, filter])
// ---------- UI ----------
if (credentialQ.isLoading)
return (
<div className="flex items-center gap-2 p-6">
<Loader2 className="h-4 w-4 animate-spin" /> Loading credentials
</div>
)
if (credentialQ.error)
return (
<div className="p-6 text-red-500">
Error loading credentials.
<pre className="mt-2 text-xs opacity-80">{JSON.stringify(credentialQ.error, null, 2)}</pre>
</div>
)
return (
<div className="space-y-4 p-6">
<div className="flex flex-col gap-3 md:flex-row md:items-center md:justify-between">
<h1 className="mb-1 text-2xl font-bold">Credentials</h1>
<div className="flex flex-wrap items-center gap-2">
<div className="relative">
<Search className="absolute top-2.5 left-2 h-4 w-4 opacity-60" />
<Input
value={filter}
onChange={(e) => setFilter(e.target.value)}
placeholder="Search by name, provider, kind, scope…"
className="w-64 pl-8"
/>
</div>
<Dialog open={createOpen} onOpenChange={setCreateOpen}>
<DialogTrigger asChild>
<Button onClick={() => setCreateOpen(true)}>
<Plus className="mr-2 h-4 w-4" />
Create Credential
</Button>
</DialogTrigger>
<DialogContent className="sm:max-w-xl">
<DialogHeader>
<DialogTitle>Create Credential</DialogTitle>
</DialogHeader>
<Form {...createForm}>
<form
onSubmit={createForm.handleSubmit((values) =>
createMutation.mutate(values as CreateCredentialValues)
)}
className="space-y-4 pt-2"
>
<div className="grid grid-cols-1 gap-4 md:grid-cols-2">
<FormField
control={createForm.control}
name="provider"
render={({ field }) => (
<FormItem>
<FormLabel>Provider</FormLabel>
<Select onValueChange={field.onChange} defaultValue={field.value}>
<FormControl>
<SelectTrigger>
<SelectValue />
</SelectTrigger>
</FormControl>
<SelectContent>
<SelectItem value="aws">AWS</SelectItem>
<SelectItem value="cloudflare">Cloudflare</SelectItem>
<SelectItem value="hetzner">Hetzner</SelectItem>
<SelectItem value="digitalocean">DigitalOcean</SelectItem>
<SelectItem value="generic">Generic</SelectItem>
</SelectContent>
</Select>
<FormMessage />
</FormItem>
)}
/>
<FormField
control={createForm.control}
name="kind"
render={({ field }) => (
<FormItem>
<FormLabel>Kind</FormLabel>
<Select onValueChange={field.onChange} defaultValue={field.value}>
<FormControl>
<SelectTrigger>
<SelectValue />
</SelectTrigger>
</FormControl>
<SelectContent>
<SelectItem value="aws_access_key">AWS Access Key</SelectItem>
<SelectItem value="api_token">API Token</SelectItem>
<SelectItem value="basic_auth">Basic Auth</SelectItem>
<SelectItem value="oauth2">OAuth2</SelectItem>
</SelectContent>
</Select>
<FormMessage />
</FormItem>
)}
/>
<FormField
control={createForm.control}
name="scope_kind"
render={({ field }) => (
<FormItem>
<FormLabel>Scope Kind</FormLabel>
<Select onValueChange={field.onChange} defaultValue={field.value}>
<FormControl>
<SelectTrigger>
<SelectValue />
</SelectTrigger>
</FormControl>
<SelectContent>
<SelectItem value="provider">Provider</SelectItem>
<SelectItem value="service">Service</SelectItem>
<SelectItem value="resource">Resource</SelectItem>
</SelectContent>
</Select>
<FormMessage />
</FormItem>
)}
/>
<FormField
control={createForm.control}
name="name"
render={({ field }) => (
<FormItem>
<FormLabel>Name</FormLabel>
<Input {...field} placeholder="My AWS Key" />
<FormMessage />
</FormItem>
)}
/>
<FormField
control={createForm.control}
name="account_id"
render={({ field }) => (
<FormItem>
<FormLabel>Account ID (optional)</FormLabel>
<Input {...field} placeholder="e.g. 123456789012" />
<FormMessage />
</FormItem>
)}
/>
<FormField
control={createForm.control}
name="region"
render={({ field }) => (
<FormItem>
<FormLabel>Region (optional)</FormLabel>
<Input {...field} placeholder="e.g. us-east-1" />
<FormMessage />
</FormItem>
)}
/>
</div>
<FormField
control={createForm.control}
name="scope"
render={({ field }) => (
<FormItem>
<FormLabel>Scope (JSON)</FormLabel>
<Textarea
{...field}
rows={3}
placeholder='e.g. {"service":"s3"} or {"arn":"..."}'
className="font-mono"
/>
<FormMessage />
</FormItem>
)}
/>
<FormField
control={createForm.control}
name="secret"
render={({ field }) => (
<FormItem>
<FormLabel>Secret (JSON)</FormLabel>
<Textarea
{...field}
rows={6}
placeholder='{"access_key_id":"...","secret_access_key":"..."}'
className="font-mono"
/>
<FormMessage />
</FormItem>
)}
/>
<DialogFooter className="gap-2">
<Button variant="outline" type="button" onClick={() => setCreateOpen(false)}>
Cancel
</Button>
<Button type="submit" disabled={createMutation.isPending}>
{createMutation.isPending && (
<Loader2 className="mr-2 h-4 w-4 animate-spin" />
)}
Create
</Button>
</DialogFooter>
</form>
</Form>
</DialogContent>
</Dialog>
</div>
</div>
{/* Table */}
<div className="overflow-x-auto rounded-xl border">
<table className="min-w-full text-sm">
<thead className="bg-muted/40 text-xs tracking-wide uppercase">
<tr>
<th className="w-[28%] px-4 py-2 text-left">Name</th>
<th className="px-4 py-2 text-left">Provider</th>
<th className="px-4 py-2 text-left">Kind</th>
<th className="px-4 py-2 text-left">Scope Kind</th>
<th className="px-4 py-2 text-left">Account</th>
<th className="px-4 py-2 text-left">Region</th>
<th className="px-4 py-2 text-right">Actions</th>
</tr>
</thead>
<tbody>
{filtered.map((row: any) => (
<tr key={row.id} className="border-t">
<td className="px-4 py-2 font-medium">{row.name}</td>
<td className="px-4 py-2">{row.provider}</td>
<td className="px-4 py-2">{row.kind}</td>
<td className="px-4 py-2">{row.scope_kind}</td>
<td className="px-4 py-2">{row.account_id ?? "—"}</td>
<td className="px-4 py-2">{row.region ?? "—"}</td>
<td className="px-4 py-2">
<div className="flex items-center justify-end gap-2">
<Button
size="icon"
variant="ghost"
title="Reveal secret (one-time read)"
onClick={() => revealMutation.mutate(row.id)}
>
<Eye className="h-4 w-4" />
</Button>
<Button size="icon" variant="ghost" title="Edit" onClick={() => openEdit(row)}>
<Pencil className="h-4 w-4" />
</Button>
<AlertDialog>
<AlertDialogTrigger asChild>
<Button size="icon" variant="ghost" title="Delete">
<Trash2 className="h-4 w-4" />
</Button>
</AlertDialogTrigger>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>Delete {row.name}?</AlertDialogTitle>
<AlertDialogDescription>
This will permanently remove the credential metadata. Secrets are not
recoverable from the service.
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>Cancel</AlertDialogCancel>
<AlertDialogAction
className="bg-destructive text-destructive-foreground hover:bg-destructive/90"
onClick={() => deleteMutation.mutate(row.id)}
>
Delete
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button size="icon" variant="ghost">
<MoreHorizontal className="h-4 w-4" />
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuItem onClick={() => openEdit(row)}>Edit</DropdownMenuItem>
<DropdownMenuItem onClick={() => revealMutation.mutate(row.id)}>
Reveal secret
</DropdownMenuItem>
<DropdownMenuItem
className="text-destructive"
onClick={() => deleteMutation.mutate(row.id)}
>
Delete
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
</div>
</td>
</tr>
))}
{filtered.length === 0 && (
<tr>
<td colSpan={7} className="text-muted-foreground px-4 py-10 text-center">
No credentials match your search.
</td>
</tr>
)}
</tbody>
</table>
</div>
{/* Edit dialog */}
<Dialog open={editOpen} onOpenChange={setEditOpen}>
<DialogContent className="sm:max-w-xl">
<DialogHeader>
<DialogTitle>Edit Credential</DialogTitle>
</DialogHeader>
<Form {...editForm}>
<form
onSubmit={editForm.handleSubmit((values) => {
if (!editingId) return
// Convert stringified JSON fields to objects via schema
const parsed = updateCredentialSchema.safeParse(values)
if (!parsed.success) {
toast.error("Please fix validation errors")
return
}
updateMutation.mutate({ id: editingId, body: parsed.data })
})}
className="space-y-4 pt-2"
>
<div className="grid grid-cols-1 gap-4 md:grid-cols-2">
<FormField
control={editForm.control}
name="provider"
render={({ field }) => (
<FormItem>
<FormLabel>Provider</FormLabel>
<Select onValueChange={field.onChange} value={field.value}>
<FormControl>
<SelectTrigger>
<SelectValue />
</SelectTrigger>
</FormControl>
<SelectContent>
<SelectItem value="aws">AWS</SelectItem>
<SelectItem value="cloudflare">Cloudflare</SelectItem>
<SelectItem value="hetzner">Hetzner</SelectItem>
<SelectItem value="digitalocean">DigitalOcean</SelectItem>
<SelectItem value="generic">Generic</SelectItem>
</SelectContent>
</Select>
<FormMessage />
</FormItem>
)}
/>
<FormField
control={editForm.control}
name="kind"
render={({ field }) => (
<FormItem>
<FormLabel>Kind</FormLabel>
<Select onValueChange={field.onChange} value={field.value}>
<FormControl>
<SelectTrigger>
<SelectValue />
</SelectTrigger>
</FormControl>
<SelectContent>
<SelectItem value="aws_access_key">AWS Access Key</SelectItem>
<SelectItem value="api_token">API Token</SelectItem>
<SelectItem value="basic_auth">Basic Auth</SelectItem>
<SelectItem value="oauth2">OAuth2</SelectItem>
</SelectContent>
</Select>
<FormMessage />
</FormItem>
)}
/>
<FormField
control={editForm.control}
name="scope_kind"
render={({ field }) => (
<FormItem>
<FormLabel>Scope Kind</FormLabel>
<Select onValueChange={field.onChange} value={field.value}>
<FormControl>
<SelectTrigger>
<SelectValue />
</SelectTrigger>
</FormControl>
<SelectContent>
<SelectItem value="provider">Provider</SelectItem>
<SelectItem value="service">Service</SelectItem>
<SelectItem value="resource">Resource</SelectItem>
</SelectContent>
</Select>
<FormMessage />
</FormItem>
)}
/>
<FormField
control={editForm.control}
name="name"
render={({ field }) => (
<FormItem>
<FormLabel>Name</FormLabel>
<Input {...field} />
<FormMessage />
</FormItem>
)}
/>
<FormField
control={editForm.control}
name="account_id"
render={({ field }) => (
<FormItem>
<FormLabel>Account ID</FormLabel>
<Input {...field} placeholder="optional" />
<FormMessage />
</FormItem>
)}
/>
<FormField
control={editForm.control}
name="region"
render={({ field }) => (
<FormItem>
<FormLabel>Region</FormLabel>
<Input {...field} placeholder="optional" />
<FormMessage />
</FormItem>
)}
/>
</div>
<FormField
control={editForm.control}
name="scope"
render={({ field }) => (
<FormItem>
<FormLabel>Scope (JSON)</FormLabel>
<Textarea {...field} rows={3} className="font-mono" />
<FormMessage />
</FormItem>
)}
/>
<FormField
control={editForm.control}
name="secret"
render={({ field }) => (
<FormItem>
<FormLabel>Rotate Secret (JSON, optional)</FormLabel>
<Textarea
{...field}
rows={6}
className="font-mono"
placeholder="Leave empty to keep existing secret"
/>
<FormMessage />
</FormItem>
)}
/>
<DialogFooter className="gap-2">
<Button variant="outline" type="button" onClick={() => setEditOpen(false)}>
Cancel
</Button>
<Button type="submit" disabled={updateMutation.isPending}>
{updateMutation.isPending && <Loader2 className="mr-2 h-4 w-4 animate-spin" />}
Save changes
</Button>
</DialogFooter>
</form>
</Form>
</DialogContent>
</Dialog>
{/* Reveal modal */}
<Dialog open={revealOpen} onOpenChange={setRevealOpen}>
<DialogContent className="sm:max-w-xl">
<DialogHeader>
<DialogTitle>Decrypted Secret</DialogTitle>
</DialogHeader>
<div className="bg-muted/40 rounded-lg border p-3">
<pre className="max-h-[50vh] overflow-auto text-xs leading-relaxed">
{pretty(revealJson ?? {})}
</pre>
</div>
<DialogFooter>
<Button
variant="outline"
onClick={() => {
navigator.clipboard.writeText(pretty(revealJson ?? {}))
toast.success("Copied to clipboard")
}}
>
Copy
</Button>
<Button onClick={() => setRevealOpen(false)}>Close</Button>
</DialogFooter>
</DialogContent>
</Dialog>
</div>
)
}

View File

@@ -5,18 +5,25 @@ README.md
docs/AnnotationsApi.md
docs/ArcherAdminApi.md
docs/AuthApi.md
docs/ClustersApi.md
docs/CredentialsApi.md
docs/DtoAnnotationResponse.md
docs/DtoAttachAnnotationsRequest.md
docs/DtoAttachLabelsRequest.md
docs/DtoAttachServersRequest.md
docs/DtoAttachTaintsRequest.md
docs/DtoAuthStartResponse.md
docs/DtoClusterResponse.md
docs/DtoCreateAnnotationRequest.md
docs/DtoCreateClusterRequest.md
docs/DtoCreateCredentialRequest.md
docs/DtoCreateLabelRequest.md
docs/DtoCreateNodePoolRequest.md
docs/DtoCreateSSHRequest.md
docs/DtoCreateServerRequest.md
docs/DtoCreateTaintRequest.md
docs/DtoCredentialOut.md
docs/DtoEnqueueRequest.md
docs/DtoJWK.md
docs/DtoJWKS.md
docs/DtoJob.md
@@ -33,6 +40,7 @@ docs/DtoSshRevealResponse.md
docs/DtoTaintResponse.md
docs/DtoTokenPair.md
docs/DtoUpdateAnnotationRequest.md
docs/DtoUpdateCredentialRequest.md
docs/DtoUpdateLabelRequest.md
docs/DtoUpdateNodePoolRequest.md
docs/DtoUpdateServerRequest.md
@@ -68,6 +76,8 @@ package.json
src/apis/AnnotationsApi.ts
src/apis/ArcherAdminApi.ts
src/apis/AuthApi.ts
src/apis/ClustersApi.ts
src/apis/CredentialsApi.ts
src/apis/HealthApi.ts
src/apis/LabelsApi.ts
src/apis/MeAPIKeysApi.ts
@@ -86,12 +96,17 @@ src/models/DtoAttachLabelsRequest.ts
src/models/DtoAttachServersRequest.ts
src/models/DtoAttachTaintsRequest.ts
src/models/DtoAuthStartResponse.ts
src/models/DtoClusterResponse.ts
src/models/DtoCreateAnnotationRequest.ts
src/models/DtoCreateClusterRequest.ts
src/models/DtoCreateCredentialRequest.ts
src/models/DtoCreateLabelRequest.ts
src/models/DtoCreateNodePoolRequest.ts
src/models/DtoCreateSSHRequest.ts
src/models/DtoCreateServerRequest.ts
src/models/DtoCreateTaintRequest.ts
src/models/DtoCredentialOut.ts
src/models/DtoEnqueueRequest.ts
src/models/DtoJWK.ts
src/models/DtoJWKS.ts
src/models/DtoJob.ts
@@ -108,6 +123,7 @@ src/models/DtoSshRevealResponse.ts
src/models/DtoTaintResponse.ts
src/models/DtoTokenPair.ts
src/models/DtoUpdateAnnotationRequest.ts
src/models/DtoUpdateCredentialRequest.ts
src/models/DtoUpdateLabelRequest.ts
src/models/DtoUpdateNodePoolRequest.ts
src/models/DtoUpdateServerRequest.ts

View File

@@ -14,15 +14,15 @@
import * as runtime from "../runtime"
import type { DtoJob, DtoPageJob, DtoQueueInfo, } from "../models/index"
import { DtoJobFromJSON, DtoPageJobFromJSON, DtoQueueInfoFromJSON, } from "../models/index"
import type { DtoEnqueueRequest, DtoJob, DtoPageJob, DtoQueueInfo, } from "../models/index"
import { DtoEnqueueRequestToJSON, DtoJobFromJSON, DtoPageJobFromJSON, DtoQueueInfoFromJSON, } from "../models/index"
export interface AdminCancelArcherJobRequest {
id: string;
}
export interface AdminEnqueueArcherJobRequest {
body: object;
body: DtoEnqueueRequest;
}
export interface AdminListArcherJobsRequest {
@@ -115,7 +115,7 @@ export class ArcherAdminApi extends runtime.BaseAPI {
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: requestParameters['body'] as any,
body: DtoEnqueueRequestToJSON(requestParameters['body']),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => DtoJobFromJSON(jsonValue));

View File

@@ -0,0 +1,143 @@
/* 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 { DtoClusterResponse, DtoCreateClusterRequest, } from "../models/index"
import { DtoClusterResponseFromJSON, DtoCreateClusterRequestToJSON, } from "../models/index"
export interface CreateClusterRequest {
body: DtoCreateClusterRequest;
xOrgID?: string;
}
export interface ListClustersRequest {
xOrgID?: string;
q?: string;
}
/**
*
*/
export class ClustersApi extends runtime.BaseAPI {
/**
* Creates a cluster. If `kubeconfig` is provided, it will be encrypted per-organization and stored securely (never returned).
* Create cluster (org scoped)
*/
async createClusterRaw(requestParameters: CreateClusterRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DtoClusterResponse>> {
if (requestParameters['body'] == null) {
throw new runtime.RequiredError(
'body',
'Required parameter "body" was null or undefined when calling createCluster().'
);
}
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 = `/clusters`;
const response = await this.request({
path: urlPath,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: DtoCreateClusterRequestToJSON(requestParameters['body']),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => DtoClusterResponseFromJSON(jsonValue));
}
/**
* Creates a cluster. If `kubeconfig` is provided, it will be encrypted per-organization and stored securely (never returned).
* Create cluster (org scoped)
*/
async createCluster(requestParameters: CreateClusterRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DtoClusterResponse> {
const response = await this.createClusterRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Returns clusters for the organization in X-Org-ID. Filter by `q` (name contains).
* List clusters (org scoped)
*/
async listClustersRaw(requestParameters: ListClustersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<DtoClusterResponse>>> {
const queryParameters: any = {};
if (requestParameters['q'] != null) {
queryParameters['q'] = requestParameters['q'];
}
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 = `/clusters`;
const response = await this.request({
path: urlPath,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(DtoClusterResponseFromJSON));
}
/**
* Returns clusters for the organization in X-Org-ID. Filter by `q` (name contains).
* List clusters (org scoped)
*/
async listClusters(requestParameters: ListClustersRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<DtoClusterResponse>> {
const response = await this.listClustersRaw(requestParameters, initOverrides);
return await response.value();
}
}

View File

@@ -0,0 +1,397 @@
/* 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 { DtoCreateCredentialRequest, DtoCredentialOut, DtoUpdateCredentialRequest, } from "../models/index"
import {
DtoCreateCredentialRequestToJSON,
DtoCredentialOutFromJSON,
DtoUpdateCredentialRequestToJSON,
} from "../models/index"
export interface CreateCredentialRequest {
body: DtoCreateCredentialRequest;
xOrgID?: string;
}
export interface DeleteCredentialRequest {
id: string;
xOrgID?: string;
}
export interface GetCredentialRequest {
id: string;
xOrgID?: string;
}
export interface ListCredentialsRequest {
xOrgID?: string;
provider?: string;
kind?: string;
scopeKind?: string;
}
export interface RevealCredentialRequest {
id: string;
xOrgID?: string;
}
export interface UpdateCredentialRequest {
id: string;
body: DtoUpdateCredentialRequest;
xOrgID?: string;
}
/**
*
*/
export class CredentialsApi extends runtime.BaseAPI {
/**
* Create a credential (encrypts secret)
*/
async createCredentialRaw(requestParameters: CreateCredentialRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DtoCredentialOut>> {
if (requestParameters['body'] == null) {
throw new runtime.RequiredError(
'body',
'Required parameter "body" was null or undefined when calling createCredential().'
);
}
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 = `/credentials`;
const response = await this.request({
path: urlPath,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: DtoCreateCredentialRequestToJSON(requestParameters['body']),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => DtoCredentialOutFromJSON(jsonValue));
}
/**
* Create a credential (encrypts secret)
*/
async createCredential(requestParameters: CreateCredentialRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DtoCredentialOut> {
const response = await this.createCredentialRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Delete credential
*/
async deleteCredentialRaw(requestParameters: DeleteCredentialRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
if (requestParameters['id'] == null) {
throw new runtime.RequiredError(
'id',
'Required parameter "id" was null or undefined when calling deleteCredential().'
);
}
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 = `/credentials/{id}`;
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
const response = await this.request({
path: urlPath,
method: 'DELETE',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
* Delete credential
*/
async deleteCredential(requestParameters: DeleteCredentialRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.deleteCredentialRaw(requestParameters, initOverrides);
}
/**
* Get credential by ID (metadata only)
*/
async getCredentialRaw(requestParameters: GetCredentialRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DtoCredentialOut>> {
if (requestParameters['id'] == null) {
throw new runtime.RequiredError(
'id',
'Required parameter "id" was null or undefined when calling getCredential().'
);
}
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 = `/credentials/{id}`;
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
const response = await this.request({
path: urlPath,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => DtoCredentialOutFromJSON(jsonValue));
}
/**
* Get credential by ID (metadata only)
*/
async getCredential(requestParameters: GetCredentialRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DtoCredentialOut> {
const response = await this.getCredentialRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Returns credential metadata for the current org. Secrets are never returned.
* List credentials (metadata only)
*/
async listCredentialsRaw(requestParameters: ListCredentialsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<DtoCredentialOut>>> {
const queryParameters: any = {};
if (requestParameters['provider'] != null) {
queryParameters['provider'] = requestParameters['provider'];
}
if (requestParameters['kind'] != null) {
queryParameters['kind'] = requestParameters['kind'];
}
if (requestParameters['scopeKind'] != null) {
queryParameters['scope_kind'] = requestParameters['scopeKind'];
}
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 = `/credentials`;
const response = await this.request({
path: urlPath,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(DtoCredentialOutFromJSON));
}
/**
* Returns credential metadata for the current org. Secrets are never returned.
* List credentials (metadata only)
*/
async listCredentials(requestParameters: ListCredentialsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<DtoCredentialOut>> {
const response = await this.listCredentialsRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Reveal decrypted secret (one-time read)
*/
async revealCredentialRaw(requestParameters: RevealCredentialRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<{ [key: string]: any; }>> {
if (requestParameters['id'] == null) {
throw new runtime.RequiredError(
'id',
'Required parameter "id" was null or undefined when calling revealCredential().'
);
}
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 = `/credentials/{id}/reveal`;
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<any>(response);
}
/**
* Reveal decrypted secret (one-time read)
*/
async revealCredential(requestParameters: RevealCredentialRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: any; }> {
const response = await this.revealCredentialRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Update credential metadata and/or rotate secret
*/
async updateCredentialRaw(requestParameters: UpdateCredentialRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DtoCredentialOut>> {
if (requestParameters['id'] == null) {
throw new runtime.RequiredError(
'id',
'Required parameter "id" was null or undefined when calling updateCredential().'
);
}
if (requestParameters['body'] == null) {
throw new runtime.RequiredError(
'body',
'Required parameter "body" was null or undefined when calling updateCredential().'
);
}
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 = `/credentials/{id}`;
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
const response = await this.request({
path: urlPath,
method: 'PATCH',
headers: headerParameters,
query: queryParameters,
body: DtoUpdateCredentialRequestToJSON(requestParameters['body']),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => DtoCredentialOutFromJSON(jsonValue));
}
/**
* Update credential metadata and/or rotate secret
*/
async updateCredential(requestParameters: UpdateCredentialRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DtoCredentialOut> {
const response = await this.updateCredentialRaw(requestParameters, initOverrides);
return await response.value();
}
}

View File

@@ -3,6 +3,8 @@
export * from './AnnotationsApi';
export * from './ArcherAdminApi';
export * from './AuthApi';
export * from './ClustersApi';
export * from './CredentialsApi';
export * from './HealthApi';
export * from './LabelsApi';
export * from './MeApi';

View File

@@ -113,8 +113,8 @@ async function example() {
const api = new ArcherAdminApi(config);
const body = {
// object | Job parameters
body: Object,
// DtoEnqueueRequest | Job parameters
body: ...,
} satisfies AdminEnqueueArcherJobRequest;
try {
@@ -134,7 +134,7 @@ example().catch(console.error);
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **body** | `object` | Job parameters | |
| **body** | [DtoEnqueueRequest](DtoEnqueueRequest.md) | Job parameters | |
### Return type

View File

@@ -0,0 +1,173 @@
# ClustersApi
All URIs are relative to */api/v1*
| Method | HTTP request | Description |
|------------- | ------------- | -------------|
| [**createCluster**](ClustersApi.md#createcluster) | **POST** /clusters | Create cluster (org scoped) |
| [**listClusters**](ClustersApi.md#listclusters) | **GET** /clusters | List clusters (org scoped) |
## createCluster
> DtoClusterResponse createCluster(body, xOrgID)
Create cluster (org scoped)
Creates a cluster. If &#x60;kubeconfig&#x60; is provided, it will be encrypted per-organization and stored securely (never returned).
### Example
```ts
import {
Configuration,
ClustersApi,
} from '@glueops/autoglue-sdk-go';
import type { CreateClusterRequest } 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 ClustersApi(config);
const body = {
// DtoCreateClusterRequest | payload
body: ...,
// string | Organization UUID (optional)
xOrgID: xOrgID_example,
} satisfies CreateClusterRequest;
try {
const data = await api.createCluster(body);
console.log(data);
} catch (error) {
console.error(error);
}
}
// Run the test
example().catch(console.error);
```
### Parameters
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **body** | [DtoCreateClusterRequest](DtoCreateClusterRequest.md) | payload | |
| **xOrgID** | `string` | Organization UUID | [Optional] [Defaults to `undefined`] |
### Return type
[**DtoClusterResponse**](DtoClusterResponse.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 | - |
| **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)
## listClusters
> Array&lt;DtoClusterResponse&gt; listClusters(xOrgID, q)
List clusters (org scoped)
Returns clusters for the organization in X-Org-ID. Filter by &#x60;q&#x60; (name contains).
### Example
```ts
import {
Configuration,
ClustersApi,
} from '@glueops/autoglue-sdk-go';
import type { ListClustersRequest } 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 ClustersApi(config);
const body = {
// string | Organization UUID (optional)
xOrgID: xOrgID_example,
// string | Name contains (case-insensitive) (optional)
q: q_example,
} satisfies ListClustersRequest;
try {
const data = await api.listClusters(body);
console.log(data);
} catch (error) {
console.error(error);
}
}
// Run the test
example().catch(console.error);
```
### Parameters
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **xOrgID** | `string` | Organization UUID | [Optional] [Defaults to `undefined`] |
| **q** | `string` | Name contains (case-insensitive) | [Optional] [Defaults to `undefined`] |
### Return type
[**Array&lt;DtoClusterResponse&gt;**](DtoClusterResponse.md)
### 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 |
|-------------|-------------|------------------|
| **200** | OK | - |
| **401** | Unauthorized | - |
| **403** | organization required | - |
| **500** | failed to list clusters | - |
[[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,495 @@
# CredentialsApi
All URIs are relative to */api/v1*
| Method | HTTP request | Description |
|------------- | ------------- | -------------|
| [**createCredential**](CredentialsApi.md#createcredential) | **POST** /credentials | Create a credential (encrypts secret) |
| [**deleteCredential**](CredentialsApi.md#deletecredential) | **DELETE** /credentials/{id} | Delete credential |
| [**getCredential**](CredentialsApi.md#getcredential) | **GET** /credentials/{id} | Get credential by ID (metadata only) |
| [**listCredentials**](CredentialsApi.md#listcredentials) | **GET** /credentials | List credentials (metadata only) |
| [**revealCredential**](CredentialsApi.md#revealcredential) | **POST** /credentials/{id}/reveal | Reveal decrypted secret (one-time read) |
| [**updateCredential**](CredentialsApi.md#updatecredential) | **PATCH** /credentials/{id} | Update credential metadata and/or rotate secret |
## createCredential
> DtoCredentialOut createCredential(body, xOrgID)
Create a credential (encrypts secret)
### Example
```ts
import {
Configuration,
CredentialsApi,
} from '@glueops/autoglue-sdk-go';
import type { CreateCredentialRequest } 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 CredentialsApi(config);
const body = {
// DtoCreateCredentialRequest | Credential payload
body: ...,
// string | Organization ID (UUID) (optional)
xOrgID: xOrgID_example,
} satisfies CreateCredentialRequest;
try {
const data = await api.createCredential(body);
console.log(data);
} catch (error) {
console.error(error);
}
}
// Run the test
example().catch(console.error);
```
### Parameters
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **body** | [DtoCreateCredentialRequest](DtoCreateCredentialRequest.md) | Credential payload | |
| **xOrgID** | `string` | Organization ID (UUID) | [Optional] [Defaults to `undefined`] |
### Return type
[**DtoCredentialOut**](DtoCredentialOut.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 | - |
| **401** | Unauthorized | - |
| **403** | organization required | - |
| **500** | internal server error | - |
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
## deleteCredential
> deleteCredential(id, xOrgID)
Delete credential
### Example
```ts
import {
Configuration,
CredentialsApi,
} from '@glueops/autoglue-sdk-go';
import type { DeleteCredentialRequest } 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 CredentialsApi(config);
const body = {
// string | Credential ID (UUID)
id: id_example,
// string | Organization ID (UUID) (optional)
xOrgID: xOrgID_example,
} satisfies DeleteCredentialRequest;
try {
const data = await api.deleteCredential(body);
console.log(data);
} catch (error) {
console.error(error);
}
}
// Run the test
example().catch(console.error);
```
### Parameters
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **id** | `string` | Credential ID (UUID) | [Defaults to `undefined`] |
| **xOrgID** | `string` | Organization ID (UUID) | [Optional] [Defaults to `undefined`] |
### Return type
`void` (Empty response body)
### 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 | - |
| **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)
## getCredential
> DtoCredentialOut getCredential(id, xOrgID)
Get credential by ID (metadata only)
### Example
```ts
import {
Configuration,
CredentialsApi,
} from '@glueops/autoglue-sdk-go';
import type { GetCredentialRequest } 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 CredentialsApi(config);
const body = {
// string | Credential ID (UUID)
id: id_example,
// string | Organization ID (UUID) (optional)
xOrgID: xOrgID_example,
} satisfies GetCredentialRequest;
try {
const data = await api.getCredential(body);
console.log(data);
} catch (error) {
console.error(error);
}
}
// Run the test
example().catch(console.error);
```
### Parameters
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **id** | `string` | Credential ID (UUID) | [Defaults to `undefined`] |
| **xOrgID** | `string` | Organization ID (UUID) | [Optional] [Defaults to `undefined`] |
### Return type
[**DtoCredentialOut**](DtoCredentialOut.md)
### 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 |
|-------------|-------------|------------------|
| **200** | OK | - |
| **401** | Unauthorized | - |
| **403** | organization required | - |
| **500** | internal server error | - |
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
## listCredentials
> Array&lt;DtoCredentialOut&gt; listCredentials(xOrgID, provider, kind, scopeKind)
List credentials (metadata only)
Returns credential metadata for the current org. Secrets are never returned.
### Example
```ts
import {
Configuration,
CredentialsApi,
} from '@glueops/autoglue-sdk-go';
import type { ListCredentialsRequest } 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 CredentialsApi(config);
const body = {
// string | Organization ID (UUID) (optional)
xOrgID: xOrgID_example,
// string | Filter by provider (e.g., aws) (optional)
provider: provider_example,
// string | Filter by kind (e.g., aws_access_key) (optional)
kind: kind_example,
// string | Filter by scope kind (provider/service/resource) (optional)
scopeKind: scopeKind_example,
} satisfies ListCredentialsRequest;
try {
const data = await api.listCredentials(body);
console.log(data);
} catch (error) {
console.error(error);
}
}
// Run the test
example().catch(console.error);
```
### Parameters
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **xOrgID** | `string` | Organization ID (UUID) | [Optional] [Defaults to `undefined`] |
| **provider** | `string` | Filter by provider (e.g., aws) | [Optional] [Defaults to `undefined`] |
| **kind** | `string` | Filter by kind (e.g., aws_access_key) | [Optional] [Defaults to `undefined`] |
| **scopeKind** | `string` | Filter by scope kind (provider/service/resource) | [Optional] [Defaults to `undefined`] |
### Return type
[**Array&lt;DtoCredentialOut&gt;**](DtoCredentialOut.md)
### 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 |
|-------------|-------------|------------------|
| **200** | OK | - |
| **401** | Unauthorized | - |
| **403** | organization required | - |
| **500** | internal server error | - |
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
## revealCredential
> { [key: string]: any; } revealCredential(id, xOrgID)
Reveal decrypted secret (one-time read)
### Example
```ts
import {
Configuration,
CredentialsApi,
} from '@glueops/autoglue-sdk-go';
import type { RevealCredentialRequest } 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 CredentialsApi(config);
const body = {
// string | Credential ID (UUID)
id: id_example,
// string | Organization ID (UUID) (optional)
xOrgID: xOrgID_example,
} satisfies RevealCredentialRequest;
try {
const data = await api.revealCredential(body);
console.log(data);
} catch (error) {
console.error(error);
}
}
// Run the test
example().catch(console.error);
```
### Parameters
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **id** | `string` | Credential ID (UUID) | [Defaults to `undefined`] |
| **xOrgID** | `string` | Organization ID (UUID) | [Optional] [Defaults to `undefined`] |
### Return type
**{ [key: string]: any; }**
### 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 |
|-------------|-------------|------------------|
| **200** | OK | - |
| **403** | organization required | - |
| **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)
## updateCredential
> DtoCredentialOut updateCredential(id, body, xOrgID)
Update credential metadata and/or rotate secret
### Example
```ts
import {
Configuration,
CredentialsApi,
} from '@glueops/autoglue-sdk-go';
import type { UpdateCredentialRequest } 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 CredentialsApi(config);
const body = {
// string | Credential ID (UUID)
id: id_example,
// DtoUpdateCredentialRequest | Fields to update
body: ...,
// string | Organization ID (UUID) (optional)
xOrgID: xOrgID_example,
} satisfies UpdateCredentialRequest;
try {
const data = await api.updateCredential(body);
console.log(data);
} catch (error) {
console.error(error);
}
}
// Run the test
example().catch(console.error);
```
### Parameters
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **id** | `string` | Credential ID (UUID) | [Defaults to `undefined`] |
| **body** | [DtoUpdateCredentialRequest](DtoUpdateCredentialRequest.md) | Fields to update | |
| **xOrgID** | `string` | Organization ID (UUID) | [Optional] [Defaults to `undefined`] |
### Return type
[**DtoCredentialOut**](DtoCredentialOut.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 | - |
| **403** | X-Org-ID required | - |
| **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,60 @@
# DtoClusterResponse
## Properties
Name | Type
------------ | -------------
`bastion_server` | [DtoServerResponse](DtoServerResponse.md)
`captain_domain` | string
`certificate_key` | string
`cluster_load_balancer` | string
`control_load_balancer` | string
`created_at` | string
`id` | string
`name` | string
`node_pools` | [Array&lt;DtoNodePoolResponse&gt;](DtoNodePoolResponse.md)
`provider` | string
`random_token` | string
`region` | string
`status` | string
`updated_at` | string
## Example
```typescript
import type { DtoClusterResponse } from '@glueops/autoglue-sdk-go'
// TODO: Update the object below with actual values
const example = {
"bastion_server": null,
"captain_domain": null,
"certificate_key": null,
"cluster_load_balancer": null,
"control_load_balancer": null,
"created_at": null,
"id": null,
"name": null,
"node_pools": null,
"provider": null,
"random_token": null,
"region": null,
"status": null,
"updated_at": null,
} satisfies DtoClusterResponse
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 DtoClusterResponse
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,46 @@
# DtoCreateClusterRequest
## Properties
Name | Type
------------ | -------------
`captain_domain` | string
`cluster_load_balancer` | string
`control_load_balancer` | string
`name` | string
`provider` | string
`region` | string
`status` | string
## Example
```typescript
import type { DtoCreateClusterRequest } from '@glueops/autoglue-sdk-go'
// TODO: Update the object below with actual values
const example = {
"captain_domain": null,
"cluster_load_balancer": null,
"control_load_balancer": null,
"name": null,
"provider": null,
"region": null,
"status": null,
} satisfies DtoCreateClusterRequest
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 DtoCreateClusterRequest
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,52 @@
# DtoCreateCredentialRequest
## Properties
Name | Type
------------ | -------------
`account_id` | string
`kind` | string
`name` | string
`provider` | string
`region` | string
`schema_version` | number
`scope` | object
`scope_kind` | string
`scope_version` | number
`secret` | object
## Example
```typescript
import type { DtoCreateCredentialRequest } from '@glueops/autoglue-sdk-go'
// TODO: Update the object below with actual values
const example = {
"account_id": null,
"kind": null,
"name": null,
"provider": null,
"region": null,
"schema_version": null,
"scope": null,
"scope_kind": null,
"scope_version": null,
"secret": null,
} satisfies DtoCreateCredentialRequest
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 DtoCreateCredentialRequest
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,56 @@
# DtoCredentialOut
## Properties
Name | Type
------------ | -------------
`account_id` | string
`created_at` | string
`id` | string
`kind` | string
`name` | string
`provider` | string
`region` | string
`schema_version` | number
`scope` | object
`scope_kind` | string
`scope_version` | number
`updated_at` | string
## Example
```typescript
import type { DtoCredentialOut } from '@glueops/autoglue-sdk-go'
// TODO: Update the object below with actual values
const example = {
"account_id": null,
"created_at": null,
"id": null,
"kind": null,
"name": null,
"provider": null,
"region": null,
"schema_version": null,
"scope": null,
"scope_kind": null,
"scope_version": null,
"updated_at": null,
} satisfies DtoCredentialOut
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 DtoCredentialOut
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 @@
# DtoEnqueueRequest
## Properties
Name | Type
------------ | -------------
`payload` | object
`queue` | string
`run_at` | string
`type` | string
## Example
```typescript
import type { DtoEnqueueRequest } from '@glueops/autoglue-sdk-go'
// TODO: Update the object below with actual values
const example = {
"payload": null,
"queue": default,
"run_at": 2025-11-05T08:00:00Z,
"type": email.send,
} satisfies DtoEnqueueRequest
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 DtoEnqueueRequest
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,46 @@
# DtoUpdateCredentialRequest
## Properties
Name | Type
------------ | -------------
`account_id` | string
`name` | string
`region` | string
`scope` | object
`scope_kind` | string
`scope_version` | number
`secret` | object
## Example
```typescript
import type { DtoUpdateCredentialRequest } from '@glueops/autoglue-sdk-go'
// TODO: Update the object below with actual values
const example = {
"account_id": null,
"name": null,
"region": null,
"scope": null,
"scope_kind": null,
"scope_version": null,
"secret": null,
} satisfies DtoUpdateCredentialRequest
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 DtoUpdateCredentialRequest
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,173 @@
/* 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 type { DtoNodePoolResponse } from "./DtoNodePoolResponse"
import { DtoNodePoolResponseFromJSON, DtoNodePoolResponseToJSON, } from "./DtoNodePoolResponse"
import type { DtoServerResponse } from "./DtoServerResponse"
import { DtoServerResponseFromJSON, DtoServerResponseToJSON, } from "./DtoServerResponse"
/**
*
* @export
* @interface DtoClusterResponse
*/
export interface DtoClusterResponse {
/**
*
* @type {DtoServerResponse}
* @memberof DtoClusterResponse
*/
bastion_server?: DtoServerResponse;
/**
*
* @type {string}
* @memberof DtoClusterResponse
*/
captain_domain?: string;
/**
*
* @type {string}
* @memberof DtoClusterResponse
*/
certificate_key?: string;
/**
*
* @type {string}
* @memberof DtoClusterResponse
*/
cluster_load_balancer?: string;
/**
*
* @type {string}
* @memberof DtoClusterResponse
*/
control_load_balancer?: string;
/**
*
* @type {string}
* @memberof DtoClusterResponse
*/
created_at?: string;
/**
*
* @type {string}
* @memberof DtoClusterResponse
*/
id?: string;
/**
*
* @type {string}
* @memberof DtoClusterResponse
*/
name?: string;
/**
*
* @type {Array<DtoNodePoolResponse>}
* @memberof DtoClusterResponse
*/
node_pools?: Array<DtoNodePoolResponse>;
/**
*
* @type {string}
* @memberof DtoClusterResponse
*/
provider?: string;
/**
*
* @type {string}
* @memberof DtoClusterResponse
*/
random_token?: string;
/**
*
* @type {string}
* @memberof DtoClusterResponse
*/
region?: string;
/**
*
* @type {string}
* @memberof DtoClusterResponse
*/
status?: string;
/**
*
* @type {string}
* @memberof DtoClusterResponse
*/
updated_at?: string;
}
/**
* Check if a given object implements the DtoClusterResponse interface.
*/
export function instanceOfDtoClusterResponse(value: object): value is DtoClusterResponse {
return true;
}
export function DtoClusterResponseFromJSON(json: any): DtoClusterResponse {
return DtoClusterResponseFromJSONTyped(json, false);
}
export function DtoClusterResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): DtoClusterResponse {
if (json == null) {
return json;
}
return {
'bastion_server': json['bastion_server'] == null ? undefined : DtoServerResponseFromJSON(json['bastion_server']),
'captain_domain': json['captain_domain'] == null ? undefined : json['captain_domain'],
'certificate_key': json['certificate_key'] == null ? undefined : json['certificate_key'],
'cluster_load_balancer': json['cluster_load_balancer'] == null ? undefined : json['cluster_load_balancer'],
'control_load_balancer': json['control_load_balancer'] == null ? undefined : json['control_load_balancer'],
'created_at': json['created_at'] == null ? undefined : json['created_at'],
'id': json['id'] == null ? undefined : json['id'],
'name': json['name'] == null ? undefined : json['name'],
'node_pools': json['node_pools'] == null ? undefined : ((json['node_pools'] as Array<any>).map(DtoNodePoolResponseFromJSON)),
'provider': json['provider'] == null ? undefined : json['provider'],
'random_token': json['random_token'] == null ? undefined : json['random_token'],
'region': json['region'] == null ? undefined : json['region'],
'status': json['status'] == null ? undefined : json['status'],
'updated_at': json['updated_at'] == null ? undefined : json['updated_at'],
};
}
export function DtoClusterResponseToJSON(json: any): DtoClusterResponse {
return DtoClusterResponseToJSONTyped(json, false);
}
export function DtoClusterResponseToJSONTyped(value?: DtoClusterResponse | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'bastion_server': DtoServerResponseToJSON(value['bastion_server']),
'captain_domain': value['captain_domain'],
'certificate_key': value['certificate_key'],
'cluster_load_balancer': value['cluster_load_balancer'],
'control_load_balancer': value['control_load_balancer'],
'created_at': value['created_at'],
'id': value['id'],
'name': value['name'],
'node_pools': value['node_pools'] == null ? undefined : ((value['node_pools'] as Array<any>).map(DtoNodePoolResponseToJSON)),
'provider': value['provider'],
'random_token': value['random_token'],
'region': value['region'],
'status': value['status'],
'updated_at': value['updated_at'],
};
}

View File

@@ -0,0 +1,112 @@
/* 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
* @interface DtoCreateClusterRequest
*/
export interface DtoCreateClusterRequest {
/**
*
* @type {string}
* @memberof DtoCreateClusterRequest
*/
captain_domain?: string;
/**
*
* @type {string}
* @memberof DtoCreateClusterRequest
*/
cluster_load_balancer?: string;
/**
*
* @type {string}
* @memberof DtoCreateClusterRequest
*/
control_load_balancer?: string;
/**
*
* @type {string}
* @memberof DtoCreateClusterRequest
*/
name?: string;
/**
*
* @type {string}
* @memberof DtoCreateClusterRequest
*/
provider?: string;
/**
*
* @type {string}
* @memberof DtoCreateClusterRequest
*/
region?: string;
/**
*
* @type {string}
* @memberof DtoCreateClusterRequest
*/
status?: string;
}
/**
* Check if a given object implements the DtoCreateClusterRequest interface.
*/
export function instanceOfDtoCreateClusterRequest(value: object): value is DtoCreateClusterRequest {
return true;
}
export function DtoCreateClusterRequestFromJSON(json: any): DtoCreateClusterRequest {
return DtoCreateClusterRequestFromJSONTyped(json, false);
}
export function DtoCreateClusterRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DtoCreateClusterRequest {
if (json == null) {
return json;
}
return {
'captain_domain': json['captain_domain'] == null ? undefined : json['captain_domain'],
'cluster_load_balancer': json['cluster_load_balancer'] == null ? undefined : json['cluster_load_balancer'],
'control_load_balancer': json['control_load_balancer'] == null ? undefined : json['control_load_balancer'],
'name': json['name'] == null ? undefined : json['name'],
'provider': json['provider'] == null ? undefined : json['provider'],
'region': json['region'] == null ? undefined : json['region'],
'status': json['status'] == null ? undefined : json['status'],
};
}
export function DtoCreateClusterRequestToJSON(json: any): DtoCreateClusterRequest {
return DtoCreateClusterRequestToJSONTyped(json, false);
}
export function DtoCreateClusterRequestToJSONTyped(value?: DtoCreateClusterRequest | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'captain_domain': value['captain_domain'],
'cluster_load_balancer': value['cluster_load_balancer'],
'control_load_balancer': value['control_load_balancer'],
'name': value['name'],
'provider': value['provider'],
'region': value['region'],
'status': value['status'],
};
}

View File

@@ -0,0 +1,167 @@
/* 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
* @interface DtoCreateCredentialRequest
*/
export interface DtoCreateCredentialRequest {
/**
*
* @type {string}
* @memberof DtoCreateCredentialRequest
*/
account_id?: string;
/**
* aws_access_key, api_token, basic_auth, oauth2
* @type {string}
* @memberof DtoCreateCredentialRequest
*/
kind: string;
/**
* human label
* @type {string}
* @memberof DtoCreateCredentialRequest
*/
name?: string;
/**
*
* @type {string}
* @memberof DtoCreateCredentialRequest
*/
provider: DtoCreateCredentialRequestProviderEnum;
/**
*
* @type {string}
* @memberof DtoCreateCredentialRequest
*/
region?: string;
/**
* secret schema version
* @type {number}
* @memberof DtoCreateCredentialRequest
*/
schema_version: number;
/**
* {"service":"route53"} or {"arn":"..."}
* @type {object}
* @memberof DtoCreateCredentialRequest
*/
scope: object;
/**
*
* @type {string}
* @memberof DtoCreateCredentialRequest
*/
scope_kind: DtoCreateCredentialRequestScopeKindEnum;
/**
* scope schema version
* @type {number}
* @memberof DtoCreateCredentialRequest
*/
scope_version: number;
/**
* encrypted later
* @type {object}
* @memberof DtoCreateCredentialRequest
*/
secret: object;
}
/**
* @export
*/
export const DtoCreateCredentialRequestProviderEnum = {
aws: 'aws',
cloudflare: 'cloudflare',
hetzner: 'hetzner',
digitalocean: 'digitalocean',
generic: 'generic'
} as const;
export type DtoCreateCredentialRequestProviderEnum = typeof DtoCreateCredentialRequestProviderEnum[keyof typeof DtoCreateCredentialRequestProviderEnum];
/**
* @export
*/
export const DtoCreateCredentialRequestScopeKindEnum = {
provider: 'provider',
service: 'service',
resource: 'resource'
} as const;
export type DtoCreateCredentialRequestScopeKindEnum = typeof DtoCreateCredentialRequestScopeKindEnum[keyof typeof DtoCreateCredentialRequestScopeKindEnum];
/**
* Check if a given object implements the DtoCreateCredentialRequest interface.
*/
export function instanceOfDtoCreateCredentialRequest(value: object): value is DtoCreateCredentialRequest {
if (!('kind' in value) || value['kind'] === undefined) return false;
if (!('provider' in value) || value['provider'] === undefined) return false;
if (!('schema_version' in value) || value['schema_version'] === undefined) return false;
if (!('scope' in value) || value['scope'] === undefined) return false;
if (!('scope_kind' in value) || value['scope_kind'] === undefined) return false;
if (!('scope_version' in value) || value['scope_version'] === undefined) return false;
if (!('secret' in value) || value['secret'] === undefined) return false;
return true;
}
export function DtoCreateCredentialRequestFromJSON(json: any): DtoCreateCredentialRequest {
return DtoCreateCredentialRequestFromJSONTyped(json, false);
}
export function DtoCreateCredentialRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DtoCreateCredentialRequest {
if (json == null) {
return json;
}
return {
'account_id': json['account_id'] == null ? undefined : json['account_id'],
'kind': json['kind'],
'name': json['name'] == null ? undefined : json['name'],
'provider': json['provider'],
'region': json['region'] == null ? undefined : json['region'],
'schema_version': json['schema_version'],
'scope': json['scope'],
'scope_kind': json['scope_kind'],
'scope_version': json['scope_version'],
'secret': json['secret'],
};
}
export function DtoCreateCredentialRequestToJSON(json: any): DtoCreateCredentialRequest {
return DtoCreateCredentialRequestToJSONTyped(json, false);
}
export function DtoCreateCredentialRequestToJSONTyped(value?: DtoCreateCredentialRequest | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'account_id': value['account_id'],
'kind': value['kind'],
'name': value['name'],
'provider': value['provider'],
'region': value['region'],
'schema_version': value['schema_version'],
'scope': value['scope'],
'scope_kind': value['scope_kind'],
'scope_version': value['scope_version'],
'secret': value['secret'],
};
}

View File

@@ -0,0 +1,152 @@
/* 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
* @interface DtoCredentialOut
*/
export interface DtoCredentialOut {
/**
*
* @type {string}
* @memberof DtoCredentialOut
*/
account_id?: string;
/**
*
* @type {string}
* @memberof DtoCredentialOut
*/
created_at?: string;
/**
*
* @type {string}
* @memberof DtoCredentialOut
*/
id?: string;
/**
*
* @type {string}
* @memberof DtoCredentialOut
*/
kind?: string;
/**
*
* @type {string}
* @memberof DtoCredentialOut
*/
name?: string;
/**
*
* @type {string}
* @memberof DtoCredentialOut
*/
provider?: string;
/**
*
* @type {string}
* @memberof DtoCredentialOut
*/
region?: string;
/**
*
* @type {number}
* @memberof DtoCredentialOut
*/
schema_version?: number;
/**
*
* @type {object}
* @memberof DtoCredentialOut
*/
scope?: object;
/**
*
* @type {string}
* @memberof DtoCredentialOut
*/
scope_kind?: string;
/**
*
* @type {number}
* @memberof DtoCredentialOut
*/
scope_version?: number;
/**
*
* @type {string}
* @memberof DtoCredentialOut
*/
updated_at?: string;
}
/**
* Check if a given object implements the DtoCredentialOut interface.
*/
export function instanceOfDtoCredentialOut(value: object): value is DtoCredentialOut {
return true;
}
export function DtoCredentialOutFromJSON(json: any): DtoCredentialOut {
return DtoCredentialOutFromJSONTyped(json, false);
}
export function DtoCredentialOutFromJSONTyped(json: any, ignoreDiscriminator: boolean): DtoCredentialOut {
if (json == null) {
return json;
}
return {
'account_id': json['account_id'] == null ? undefined : json['account_id'],
'created_at': json['created_at'] == null ? undefined : json['created_at'],
'id': json['id'] == null ? undefined : json['id'],
'kind': json['kind'] == null ? undefined : json['kind'],
'name': json['name'] == null ? undefined : json['name'],
'provider': json['provider'] == null ? undefined : json['provider'],
'region': json['region'] == null ? undefined : json['region'],
'schema_version': json['schema_version'] == null ? undefined : json['schema_version'],
'scope': json['scope'] == null ? undefined : json['scope'],
'scope_kind': json['scope_kind'] == null ? undefined : json['scope_kind'],
'scope_version': json['scope_version'] == null ? undefined : json['scope_version'],
'updated_at': json['updated_at'] == null ? undefined : json['updated_at'],
};
}
export function DtoCredentialOutToJSON(json: any): DtoCredentialOut {
return DtoCredentialOutToJSONTyped(json, false);
}
export function DtoCredentialOutToJSONTyped(value?: DtoCredentialOut | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'account_id': value['account_id'],
'created_at': value['created_at'],
'id': value['id'],
'kind': value['kind'],
'name': value['name'],
'provider': value['provider'],
'region': value['region'],
'schema_version': value['schema_version'],
'scope': value['scope'],
'scope_kind': value['scope_kind'],
'scope_version': value['scope_version'],
'updated_at': value['updated_at'],
};
}

View File

@@ -0,0 +1,88 @@
/* 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
* @interface DtoEnqueueRequest
*/
export interface DtoEnqueueRequest {
/**
*
* @type {object}
* @memberof DtoEnqueueRequest
*/
payload?: object;
/**
*
* @type {string}
* @memberof DtoEnqueueRequest
*/
queue?: string;
/**
*
* @type {string}
* @memberof DtoEnqueueRequest
*/
run_at?: string;
/**
*
* @type {string}
* @memberof DtoEnqueueRequest
*/
type?: string;
}
/**
* Check if a given object implements the DtoEnqueueRequest interface.
*/
export function instanceOfDtoEnqueueRequest(value: object): value is DtoEnqueueRequest {
return true;
}
export function DtoEnqueueRequestFromJSON(json: any): DtoEnqueueRequest {
return DtoEnqueueRequestFromJSONTyped(json, false);
}
export function DtoEnqueueRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DtoEnqueueRequest {
if (json == null) {
return json;
}
return {
'payload': json['payload'] == null ? undefined : json['payload'],
'queue': json['queue'] == null ? undefined : json['queue'],
'run_at': json['run_at'] == null ? undefined : json['run_at'],
'type': json['type'] == null ? undefined : json['type'],
};
}
export function DtoEnqueueRequestToJSON(json: any): DtoEnqueueRequest {
return DtoEnqueueRequestToJSONTyped(json, false);
}
export function DtoEnqueueRequestToJSONTyped(value?: DtoEnqueueRequest | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'payload': value['payload'],
'queue': value['queue'],
'run_at': value['run_at'],
'type': value['type'],
};
}

View File

@@ -0,0 +1,112 @@
/* 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
* @interface DtoUpdateCredentialRequest
*/
export interface DtoUpdateCredentialRequest {
/**
*
* @type {string}
* @memberof DtoUpdateCredentialRequest
*/
account_id?: string;
/**
*
* @type {string}
* @memberof DtoUpdateCredentialRequest
*/
name?: string;
/**
*
* @type {string}
* @memberof DtoUpdateCredentialRequest
*/
region?: string;
/**
*
* @type {object}
* @memberof DtoUpdateCredentialRequest
*/
scope?: object;
/**
*
* @type {string}
* @memberof DtoUpdateCredentialRequest
*/
scope_kind?: string;
/**
*
* @type {number}
* @memberof DtoUpdateCredentialRequest
*/
scope_version?: number;
/**
* set if rotating
* @type {object}
* @memberof DtoUpdateCredentialRequest
*/
secret?: object;
}
/**
* Check if a given object implements the DtoUpdateCredentialRequest interface.
*/
export function instanceOfDtoUpdateCredentialRequest(value: object): value is DtoUpdateCredentialRequest {
return true;
}
export function DtoUpdateCredentialRequestFromJSON(json: any): DtoUpdateCredentialRequest {
return DtoUpdateCredentialRequestFromJSONTyped(json, false);
}
export function DtoUpdateCredentialRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DtoUpdateCredentialRequest {
if (json == null) {
return json;
}
return {
'account_id': json['account_id'] == null ? undefined : json['account_id'],
'name': json['name'] == null ? undefined : json['name'],
'region': json['region'] == null ? undefined : json['region'],
'scope': json['scope'] == null ? undefined : json['scope'],
'scope_kind': json['scope_kind'] == null ? undefined : json['scope_kind'],
'scope_version': json['scope_version'] == null ? undefined : json['scope_version'],
'secret': json['secret'] == null ? undefined : json['secret'],
};
}
export function DtoUpdateCredentialRequestToJSON(json: any): DtoUpdateCredentialRequest {
return DtoUpdateCredentialRequestToJSONTyped(json, false);
}
export function DtoUpdateCredentialRequestToJSONTyped(value?: DtoUpdateCredentialRequest | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'account_id': value['account_id'],
'name': value['name'],
'region': value['region'],
'scope': value['scope'],
'scope_kind': value['scope_kind'],
'scope_version': value['scope_version'],
'secret': value['secret'],
};
}

View File

@@ -6,12 +6,17 @@ export * from './DtoAttachLabelsRequest';
export * from './DtoAttachServersRequest';
export * from './DtoAttachTaintsRequest';
export * from './DtoAuthStartResponse';
export * from './DtoClusterResponse';
export * from './DtoCreateAnnotationRequest';
export * from './DtoCreateClusterRequest';
export * from './DtoCreateCredentialRequest';
export * from './DtoCreateLabelRequest';
export * from './DtoCreateNodePoolRequest';
export * from './DtoCreateSSHRequest';
export * from './DtoCreateServerRequest';
export * from './DtoCreateTaintRequest';
export * from './DtoCredentialOut';
export * from './DtoEnqueueRequest';
export * from './DtoJWK';
export * from './DtoJWKS';
export * from './DtoJob';
@@ -28,6 +33,7 @@ export * from './DtoSshRevealResponse';
export * from './DtoTaintResponse';
export * from './DtoTokenPair';
export * from './DtoUpdateAnnotationRequest';
export * from './DtoUpdateCredentialRequest';
export * from './DtoUpdateLabelRequest';
export * from './DtoUpdateNodePoolRequest';
export * from './DtoUpdateServerRequest';

View File

@@ -5,6 +5,7 @@ import {
ArcherAdminApi,
AuthApi,
Configuration,
CredentialsApi,
LabelsApi,
MeApi,
MeAPIKeysApi,
@@ -113,3 +114,7 @@ export function makeNodePoolApi() {
export function makeMetaApi() {
return makeApiClient(MetaApi)
}
export function makeCredentialsApi() {
return makeApiClient(CredentialsApi)
}