mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
30 lines
624 B
TypeScript
30 lines
624 B
TypeScript
import { KubeObject } from "../kube-object";
|
|
import { KubeJsonApiData } from "../kube-json-api";
|
|
import { autobind } from "../../utils";
|
|
import { KubeApi } from "../kube-api";
|
|
|
|
@autobind()
|
|
export class ConfigMap extends KubeObject {
|
|
static kind = "ConfigMap";
|
|
|
|
constructor(data: KubeJsonApiData) {
|
|
super(data);
|
|
this.data = this.data || {};
|
|
}
|
|
|
|
data: {
|
|
[param: string]: string;
|
|
}
|
|
|
|
getKeys(): string[] {
|
|
return Object.keys(this.data);
|
|
}
|
|
}
|
|
|
|
export const configMapApi = new KubeApi({
|
|
kind: ConfigMap.kind,
|
|
apiBase: "/api/v1/configmaps",
|
|
isNamespaced: true,
|
|
objectConstructor: ConfigMap,
|
|
});
|