import axios from "axios";

export class EnvVar
{
    constructor (
        public key: string,
        public value: string
    ) {}

    static get(namespace: string, name: string, onSuccess: (envVars: EnvVar[]) => void)
    {
        const url = StringUtils.format('%s/pods/%s/%s/env', useRuntimeConfig().public.apiBase, namespace, name);
        axios.get<EnvVar[]>(url)
        .then((response) => {
            onSuccess(response.data);
        })
    }
}