UNPKG

@jfvilas/plugin-kubelog-common

Version:

Common features for the Backstage Kubelog plugin frontend and backend

45 lines (41 loc) 1.45 kB
import { Entity } from '@backstage/catalog-model'; import { AccessKey } from '@jfvilas/kwirth-common'; /** * @interface PodData contains data related on oaccessing one pod for doing someting * @field name, the name of the pod (including nothing extra) * @field namespace, the namespace of the pod * @field accessKey, for compatibility, the accessKey to view pod logs * @field viewAccessKey, the accessKey to view pod logs * @field restartAccessKey, the accessKey to restart pods */ interface PodData { name: string; namespace: string; containers: string[]; accessKey: AccessKey; viewAccessKey: AccessKey; restartAccessKey: AccessKey; } /** * @interface ClusterValidPods contains data about a cluster and all the pods found in the cluster that match required access * @field name is the name of the cluster * @field url is the kwirth url (we will use it for asking for access keys) * @field title is a short description of the cluster * @field data is an array of 'PodAccess' */ interface ClusterValidPods { name: string; url: string; title?: string; data: PodData[]; } /** * Kubelog annotation. */ declare const ANNOTATION_KUBELOG_LOCATION = "backstage.io/kubernetes-id"; /** * Function to know if an entity has Kubelog. */ declare const isKubelogAvailable: (entity: Entity) => boolean; export { ANNOTATION_KUBELOG_LOCATION, isKubelogAvailable }; export type { ClusterValidPods, PodData };