// Kubernetes Namespace API // Logan.Li import { http } from '@/utils/request'; export const namespaceApi = { getNamespaces: async (clusterCode: string) => http.get(`/kubernetes/${clusterCode}/namespaces`), getNamespacesDetail: async (clusterCode: string) => http.get(`/kubernetes/${clusterCode}/namespaces/detail`), getNamespaceDetail: async (clusterCode: string, namespace: string) => http.get(`/kubernetes/${clusterCode}/namespace/${namespace}/detail`), createNamespace: async (clusterCode: string, name: string, labels?: Record) => http.post(`/kubernetes/${clusterCode}/namespaces`, { name, labels: labels || {} }), deleteNamespace: async (clusterCode: string, namespace: string) => http.delete(`/kubernetes/${clusterCode}/namespaces/${namespace}`), /** 导出命名空间资源 tar.gz(Deployment/Service/Ingress/ConfigMap/Secret)// Logan.Li */ exportNamespaceResources: async (clusterCode: string, namespace: string) => http.download(`/kubernetes/${clusterCode}/namespace/${namespace}/export`, `${namespace}-resources.tar.gz`), };