@backstage-community/plugin-gitops-profiles
Version:
A Backstage plugin that helps you manage GitOps profiles
123 lines (119 loc) • 3.97 kB
TypeScript
import * as react_jsx_runtime from 'react/jsx-runtime';
import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
/** @public */
declare const gitopsProfilesPlugin: _backstage_core_plugin_api.BackstagePlugin<{
listPage: _backstage_core_plugin_api.RouteRef<undefined>;
detailsPage: _backstage_core_plugin_api.RouteRef<{
owner: string;
repo: string;
}>;
createPage: _backstage_core_plugin_api.RouteRef<undefined>;
}, {}, {}>;
/** @public */
declare const GitopsProfilesClusterListPage: () => react_jsx_runtime.JSX.Element;
/** @public */
declare const GitopsProfilesClusterPage: () => react_jsx_runtime.JSX.Element;
/** @public */
declare const GitopsProfilesCreatePage: () => react_jsx_runtime.JSX.Element;
/** @public */
interface CloneFromTemplateRequest {
templateRepository: string;
secrets: {
awsAccessKeyId: string;
awsSecretAccessKey: string;
};
targetOrg: string;
targetRepo: string;
gitHubUser: string;
gitHubToken: string;
}
/** @public */
interface ApplyProfileRequest {
targetOrg: string;
targetRepo: string;
gitHubUser: string;
gitHubToken: string;
profiles: string[];
}
/** @public */
interface ChangeClusterStateRequest {
targetOrg: string;
targetRepo: string;
gitHubUser: string;
gitHubToken: string;
clusterState: 'present' | 'absent';
}
/** @public */
interface PollLogRequest {
targetOrg: string;
targetRepo: string;
gitHubUser: string;
gitHubToken: string;
}
/** @public */
interface Status {
status: string;
message: string;
conclusion: string;
}
/** @public */
interface StatusResponse {
result: Status[];
link: string;
status: string;
}
/** @public */
interface ClusterStatus {
name: string;
link: string;
status: string;
conclusion: string;
runStatus: Status[];
}
/** @public */
interface ListClusterStatusesResponse {
result: ClusterStatus[];
}
/** @public */
interface ListClusterRequest {
gitHubUser: string;
gitHubToken: string;
}
/** @public */
interface GithubUserInfoRequest {
accessToken: string;
}
/** @public */
interface GithubUserInfoResponse {
login: string;
}
/** @public */
declare class FetchError extends Error {
get name(): string;
static forResponse(resp: Response): Promise<FetchError>;
}
/** @public */
type GitOpsApi = {
url: string;
fetchLog(req: PollLogRequest): Promise<StatusResponse>;
changeClusterState(req: ChangeClusterStateRequest): Promise<any>;
cloneClusterFromTemplate(req: CloneFromTemplateRequest): Promise<any>;
applyProfiles(req: ApplyProfileRequest): Promise<any>;
listClusters(req: ListClusterRequest): Promise<ListClusterStatusesResponse>;
fetchUserInfo(req: GithubUserInfoRequest): Promise<GithubUserInfoResponse>;
};
/** @public */
declare const gitOpsApiRef: _backstage_core_plugin_api.ApiRef<GitOpsApi>;
/** @public */
declare class GitOpsRestApi implements GitOpsApi {
url: string;
constructor(url?: string);
private fetch;
fetchUserInfo(req: GithubUserInfoRequest): Promise<GithubUserInfoResponse>;
fetchLog(req: PollLogRequest): Promise<StatusResponse>;
changeClusterState(req: ChangeClusterStateRequest): Promise<any>;
cloneClusterFromTemplate(req: CloneFromTemplateRequest): Promise<any>;
applyProfiles(req: ApplyProfileRequest): Promise<any>;
listClusters(req: ListClusterRequest): Promise<ListClusterStatusesResponse>;
}
export { type ApplyProfileRequest, type ChangeClusterStateRequest, type CloneFromTemplateRequest, type ClusterStatus, FetchError, type GitOpsApi, GitOpsRestApi, type GithubUserInfoRequest, type GithubUserInfoResponse, GitopsProfilesClusterListPage, GitopsProfilesClusterPage, GitopsProfilesCreatePage, type ListClusterRequest, type ListClusterStatusesResponse, type PollLogRequest, type Status, type StatusResponse, gitOpsApiRef, gitopsProfilesPlugin, gitopsProfilesPlugin as plugin };