@jfvilas/plugin-kwirth-log
Version:
Frontend plugin for viewing real-time Kubernetes logs in Backstage
53 lines (47 loc) • 2.07 kB
TypeScript
import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
import { DiscoveryApi, FetchApi } from '@backstage/core-plugin-api';
import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
import { Entity } from '@backstage/catalog-model';
import { InstanceConfigScopeEnum } from '@jfvilas/kwirth-common';
import { ClusterValidPods, IBackendInfo } from '@jfvilas/plugin-kwirth-common';
interface IEntityKwirthLogProps {
enableRestart: boolean;
fromStart?: boolean;
showTimestamp?: boolean;
showNames?: boolean;
followLog?: boolean;
wrapLines?: boolean;
hideVersion?: boolean;
excludeContainers?: string[];
}
declare const kwirthLogPlugin: _backstage_core_plugin_api.BackstagePlugin<{
root: _backstage_core_plugin_api.RouteRef<undefined>;
}, {}, {}>;
declare const EntityKwirthLogContent: (props: IEntityKwirthLogProps) => JSX.Element;
interface KwirthLogApi {
getResources(entity: Entity): Promise<any>;
requestAccess(entity: Entity, channel: string, scopes: InstanceConfigScopeEnum[]): Promise<ClusterValidPods[]>;
getVersion(): Promise<any>;
getInfo(): any;
}
declare const kwirthLogApiRef: _backstage_frontend_plugin_api.ApiRef<KwirthLogApi>;
interface KwirthLogClientOptions {
discoveryApi: DiscoveryApi;
fetchApi: FetchApi;
}
declare class KwirthLogClient implements KwirthLogApi {
private readonly discoveryApi;
private readonly fetchApi;
constructor(options: KwirthLogClientOptions);
/**
*
* @param entity
* @returns an array of clusters (with their correpsonding info) and a pod list for each, where the entity has been dicovered
*/
getVersion(): Promise<string>;
getInfo(): Promise<IBackendInfo>;
getResources(entity: Entity): Promise<ClusterValidPods>;
requestAccess(entity: Entity, channel: string, scopes: InstanceConfigScopeEnum[]): Promise<ClusterValidPods[]>;
}
export { EntityKwirthLogContent, KwirthLogClient, kwirthLogApiRef, kwirthLogPlugin };
export type { KwirthLogApi, KwirthLogClientOptions };