feat: add provider profile removal
This commit is contained in:
@@ -42,6 +42,7 @@ async function dispatch(args: ParsedArgs): Promise<JsonValue> {
|
||||
if (group === "provider-profiles" && command === "list") return client(args).get("/api/v1/provider-profiles");
|
||||
if (group === "provider-profiles" && command === "show" && id) return client(args).get(`/api/v1/provider-profiles/${encodeURIComponent(normalizeProfile(id))}`);
|
||||
if (group === "provider-profiles" && command === "config" && id) return client(args).get(`/api/v1/provider-profiles/${encodeURIComponent(normalizeProfile(id))}/config`);
|
||||
if (group === "provider-profiles" && (command === "remove" || command === "delete" || command === "rm") && id) return removeProviderProfileCli(id, args);
|
||||
if (group === "provider-profiles" && command === "set-key" && id) return setProviderProfileKey(args, id);
|
||||
if (group === "provider-profiles" && command === "set-config" && id) return setProviderProfileConfig(args, id);
|
||||
if (group === "provider-profiles" && command === "validate" && id) return validateProviderProfileCli(args, id);
|
||||
@@ -438,6 +439,11 @@ async function setProviderProfileConfig(args: ParsedArgs, profileValue: string):
|
||||
}) as JsonRecord;
|
||||
}
|
||||
|
||||
async function removeProviderProfileCli(profileValue: string, args: ParsedArgs): Promise<JsonRecord> {
|
||||
const profile = normalizeProfile(profileValue);
|
||||
return await client(args).delete(`/api/v1/provider-profiles/${encodeURIComponent(profile)}`) as JsonRecord;
|
||||
}
|
||||
|
||||
async function validateProviderProfileCli(args: ParsedArgs, profileValue: string): Promise<JsonRecord> {
|
||||
const profile = normalizeProfile(profileValue);
|
||||
const started = await client(args).post(`/api/v1/provider-profiles/${encodeURIComponent(profile)}/validate`, {}) as JsonRecord;
|
||||
@@ -790,6 +796,7 @@ function help(): JsonRecord {
|
||||
"provider-profiles list",
|
||||
"provider-profiles show <profile>",
|
||||
"provider-profiles config <profile>",
|
||||
"provider-profiles remove <profile>",
|
||||
"provider-profiles set-key <profile> --key-stdin [--model <model>] [--base-url <url>]",
|
||||
"provider-profiles set-config <profile> --config-stdin",
|
||||
"provider-profiles validate <profile> [--wait] [--timeout-ms <ms>]",
|
||||
|
||||
@@ -367,7 +367,7 @@ metadata:
|
||||
rules:
|
||||
- apiGroups: [""]
|
||||
resources: ["secrets"]
|
||||
verbs: ["create", "get", "list", "patch", "update"]
|
||||
verbs: ["create", "delete", "get", "list", "patch", "update"]
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
|
||||
Reference in New Issue
Block a user