mirror of
https://github.com/grafana/grafana.git
synced 2025-07-30 14:52:46 +08:00
14 lines
449 B
TypeScript
14 lines
449 B
TypeScript
import { config } from '@grafana/runtime';
|
|
|
|
export const getAPINamespace = () => config.namespace;
|
|
|
|
/**
|
|
* Get a base URL for a k8s API endpoint with parameterised namespace given it's group and version
|
|
* @param group the k8s group, e.g. dashboard.grafana.app
|
|
* @param version e.g. v0alpha1
|
|
* @returns
|
|
*/
|
|
export const getAPIBaseURL = (group: string, version: string) => {
|
|
return `/apis/${group}/${version}/namespaces/${getAPINamespace()}`;
|
|
};
|