1
import {models} from 'argo-ui';
3
interface ItemsList<T> {
5
* APIVersion defines the versioned schema of this representation of an object.
6
* Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values.
11
* Kind is a string value representing the REST resource this object represents.
12
* Servers may infer this from the endpoint the client submits requests to.
15
metadata: models.ListMeta;
18
export interface ApplicationList extends ItemsList<Application> {}
20
export interface SyncOperationResource {
26
export interface SyncStrategy {
27
apply?: {force?: boolean};
28
hook?: {force?: boolean};
31
export interface SyncOperation {
35
resources?: SyncOperationResource[];
38
export interface RetryBackoff {
44
export interface RetryStrategy {
46
backoff: RetryBackoff;
49
export interface RollbackOperation {
55
export interface OperationInitiator {
60
export interface Operation {
62
initiatedBy: OperationInitiator;
65
export type OperationPhase = 'Running' | 'Error' | 'Failed' | 'Succeeded' | 'Terminating';
67
export const OperationPhases = {
68
Running: 'Running' as OperationPhase,
69
Failed: 'Failed' as OperationPhase,
70
Error: 'Error' as OperationPhase,
71
Succeeded: 'Succeeded' as OperationPhase,
72
Terminating: 'Terminating' as OperationPhase
76
* OperationState contains information about state of currently performing operation on application.
78
export interface OperationState {
80
phase: OperationPhase;
82
syncResult: SyncOperationResult;
83
startedAt: models.Time;
84
finishedAt: models.Time;
87
export type HookType = 'PreSync' | 'Sync' | 'PostSync' | 'SyncFail' | 'Skip';
89
export interface RevisionMetadata {
94
signatureInfo?: string;
97
export interface ChartDetails {
99
maintainers?: string[];
103
export interface SyncOperationResult {
104
resources: ResourceResult[];
108
export type ResultCode = 'Synced' | 'SyncFailed' | 'Pruned' | 'PruneSkipped';
110
export const ResultCodes = {
112
SyncFailed: 'SyncFailed',
114
PruneSkipped: 'PruneSkipped'
117
export interface ResourceResult {
126
hookPhase: OperationPhase;
129
export const AnnotationRefreshKey = 'argocd.argoproj.io/refresh';
130
export const AnnotationHookKey = 'argocd.argoproj.io/hook';
131
export const AnnotationSyncWaveKey = 'argocd.argoproj.io/sync-wave';
132
export const AnnotationDefaultView = 'pref.argocd.argoproj.io/default-view';
133
export const AnnotationDefaultPodSort = 'pref.argocd.argoproj.io/default-pod-sort';
135
export interface Application {
138
metadata: models.ObjectMeta;
139
spec: ApplicationSpec;
140
status: ApplicationStatus;
141
operation?: Operation;
142
isAppOfAppsPattern?: boolean;
145
export type WatchType = 'ADDED' | 'MODIFIED' | 'DELETED' | 'ERROR';
147
export interface ApplicationWatchEvent {
149
application: Application;
152
export interface ComponentParameter {
158
export interface ApplicationDestination {
160
* Server address of the destination cluster
164
* Namespace of the destination cluster
168
* Name of the destination cluster which can be used instead of server (url) field
173
export interface OrphanedResource {
179
export interface ApplicationSource {
180
targetRevision: string;
182
* RepoURL is repository URL which contains application project.
187
* Path is a directory path within repository which
193
helm?: ApplicationSourceHelm;
195
kustomize?: ApplicationSourceKustomize;
197
plugin?: ApplicationSourcePlugin;
199
directory?: ApplicationSourceDirectory;
202
export interface ApplicationSourceHelm {
203
valueFiles: string[];
206
parameters: HelmParameter[];
207
fileParameters: HelmFileParameter[];
210
export interface ApplicationSourceKustomize {
217
export interface EnvEntry {
222
export interface ApplicationSourcePlugin {
225
parameters?: Parameter[];
228
export interface Parameter {
232
map?: Map<string, string>;
235
export interface JsonnetVar {
241
interface ApplicationSourceJsonnet {
242
extVars: JsonnetVar[];
246
export interface ApplicationSourceDirectory {
248
jsonnet?: ApplicationSourceJsonnet;
253
export interface Automated {
258
export interface SyncPolicy {
259
automated?: Automated;
260
syncOptions?: string[];
261
retry?: RetryStrategy;
264
export interface Info {
269
export interface ApplicationSpec {
271
source: ApplicationSource;
272
sources: ApplicationSource[];
273
destination: ApplicationDestination;
274
syncPolicy?: SyncPolicy;
275
ignoreDifferences?: ResourceIgnoreDifferences[];
277
revisionHistoryLimit?: number;
280
export interface ResourceIgnoreDifferences {
285
jsonPointers: string[];
286
jqPathExpressions: string[];
290
* RevisionHistory contains information relevant to an application deployment
292
export interface RevisionHistory {
295
source: ApplicationSource;
297
sources: ApplicationSource[];
298
deployStartedAt: models.Time;
299
deployedAt: models.Time;
300
initiatedBy: OperationInitiator;
303
export type SyncStatusCode = 'Unknown' | 'Synced' | 'OutOfSync';
305
export const SyncStatuses: {[key: string]: SyncStatusCode} = {
308
OutOfSync: 'OutOfSync'
311
export type HealthStatusCode = 'Unknown' | 'Progressing' | 'Healthy' | 'Suspended' | 'Degraded' | 'Missing';
313
export const HealthStatuses: {[key: string]: HealthStatusCode} = {
315
Progressing: 'Progressing',
316
Suspended: 'Suspended',
318
Degraded: 'Degraded',
322
export interface HealthStatus {
323
status: HealthStatusCode;
327
export type State = models.TypeMeta & {metadata: models.ObjectMeta} & {status: any; spec: any};
329
export type ReadinessGate = {
330
conditionType: string;
333
export interface ResourceStatus {
339
status: SyncStatusCode;
340
health: HealthStatus;
341
createdAt?: models.Time;
343
requiresPruning?: boolean;
348
export interface ResourceRef {
357
export interface ResourceNetworkingInfo {
358
targetLabels: {[name: string]: string};
359
targetRefs: ResourceRef[];
360
labels: {[name: string]: string};
361
ingress: LoadBalancerIngress[];
362
externalURLs: string[];
365
export interface LoadBalancerIngress {
370
export interface InfoItem {
375
export interface ResourceNode extends ResourceRef {
376
parentRefs: ResourceRef[];
378
networkingInfo?: ResourceNetworkingInfo;
380
resourceVersion: string;
381
createdAt?: models.Time;
384
export interface ApplicationTree {
385
nodes: ResourceNode[];
386
orphanedNodes: ResourceNode[];
390
export interface ResourceID {
397
export interface ResourceDiff extends ResourceID {
400
predictedLiveState: State;
401
normalizedLiveState: State;
405
export interface SyncStatus {
406
comparedTo: ApplicationSource;
407
status: SyncStatusCode;
412
export interface ApplicationCondition {
415
lastTransitionTime: string;
418
export interface ApplicationSummary {
419
externalURLs?: string[];
423
export interface ApplicationStatus {
424
observedAt: models.Time;
425
resources: ResourceStatus[];
427
conditions?: ApplicationCondition[];
428
history: RevisionHistory[];
429
health: HealthStatus;
430
operationState?: OperationState;
431
summary?: ApplicationSummary;
434
export interface JwtTokens {
437
export interface AppProjectStatus {
438
jwtTokensByRole: {[name: string]: JwtTokens};
441
export interface LogEntry {
443
timeStamp: models.Time;
444
// first field is inferred on the fly and indicats first log line received from backend
447
timeStampStr: string;
451
// describes plugin settings
452
export interface Plugin {
456
export interface AuthSettings {
458
statusBadgeEnabled: boolean;
459
statusBadgeRootUrl: string;
462
anonymizeUsers: boolean;
475
enablePKCEAuthentication: boolean;
480
binaryUrls: Record<string, string>;
482
userLoginsDisabled: boolean;
483
kustomizeVersions: string[];
485
uiBannerContent: string;
487
uiBannerPermanent: boolean;
488
uiBannerPosition: string;
489
execEnabled: boolean;
490
appsInAnyNamespaceEnabled: boolean;
493
export interface UserInfo {
500
export type ConnectionStatus = 'Unknown' | 'Successful' | 'Failed';
502
export const ConnectionStatuses = {
505
Successful: 'Successful'
508
export interface ConnectionState {
509
status: ConnectionStatus;
511
attemptedAt: models.Time;
514
export interface RepoCert {
522
export interface RepoCertList extends ItemsList<RepoCert> {}
524
export interface Repository {
528
connectionState: ConnectionState;
532
tlsClientCertData?: string;
533
tlsClientCertKey?: string;
537
githubAppId?: string;
538
forceHttpBasicAuth?: boolean;
542
export interface RepositoryList extends ItemsList<Repository> {}
544
export interface RepoCreds {
549
export interface RepoCredsList extends ItemsList<RepoCreds> {}
551
export interface Cluster {
555
refreshRequestedAt?: models.Time;
560
execProviderConfig?: {
565
applicationsCount: number;
566
serverVersion: string;
567
connectionState: ConnectionState;
568
cacheInfo: ClusterCacheInfo;
570
annotations?: {[name: string]: string};
571
labels?: {[name: string]: string};
574
export interface ClusterCacheInfo {
575
resourcesCount: number;
577
lastCacheSyncTime: models.Time;
580
export interface ClusterList extends ItemsList<Cluster> {}
582
export interface HelmChart {
587
export type AppSourceType = 'Helm' | 'Kustomize' | 'Directory' | 'Plugin';
589
export interface RepoAppDetails {
593
kustomize?: KustomizeAppSpec;
594
plugin?: PluginAppSpec;
598
export interface RefsInfo {
603
export interface AppInfo {
608
export interface HelmParameter {
613
export interface HelmFileParameter {
618
export interface HelmAppSpec {
621
valueFiles: string[];
623
parameters: HelmParameter[];
624
fileParameters: HelmFileParameter[];
627
export interface KustomizeAppSpec {
633
export interface PluginAppSpec {
636
parametersAnnouncement?: ParameterAnnouncement[];
639
export interface ParameterAnnouncement {
645
collectionType?: string;
648
map?: Map<string, string>;
651
export interface ObjectReference {
657
resourceVersion: string;
661
export interface EventSource {
666
export interface EventSeries {
668
lastObservedTime: models.Time;
672
export interface Event {
675
metadata: models.ObjectMeta;
676
involvedObject: ObjectReference;
680
firstTimestamp: models.Time;
681
lastTimestamp: models.Time;
684
eventTime: models.Time;
687
related: ObjectReference;
688
reportingController: string;
689
reportingInstance: string;
692
export interface EventList extends ItemsList<Event> {}
694
export interface ProjectRole {
701
export interface JwtToken {
707
export interface GroupKind {
712
export interface ProjectSignatureKey {
716
export interface ProjectSpec {
717
sourceRepos: string[];
718
sourceNamespaces: string[];
719
destinations: ApplicationDestination[];
721
roles: ProjectRole[];
722
clusterResourceWhitelist: GroupKind[];
723
clusterResourceBlacklist: GroupKind[];
724
namespaceResourceBlacklist: GroupKind[];
725
namespaceResourceWhitelist: GroupKind[];
726
signatureKeys: ProjectSignatureKey[];
727
orphanedResources?: {warn?: boolean; ignore: OrphanedResource[]};
728
syncWindows?: SyncWindows;
731
export type SyncWindows = SyncWindow[];
733
export interface SyncWindow {
737
applications: string[];
738
namespaces: string[];
744
export interface Project {
747
metadata: models.ObjectMeta;
749
status: AppProjectStatus;
752
export interface DetailedProjectsResponse {
754
globalProjects: Project[];
755
repositories: Repository[];
759
export type ProjectList = ItemsList<Project>;
761
export const DEFAULT_PROJECT_NAME = 'default';
763
export interface ManifestResponse {
770
export interface ResourceActionParam {
777
export interface ResourceAction {
779
params: ResourceActionParam[];
785
export interface SyncWindowsState {
786
windows: SyncWindow[];
789
export interface ApplicationSyncWindowState {
790
activeWindows: SyncWindow[];
791
assignedWindows: SyncWindow[];
795
export interface VersionMessage {
801
KustomizeVersion: string;
803
KubectlVersion: string;
804
JsonnetVersion: string;
807
export interface Token {
813
export interface Account {
816
capabilities: string[];
820
export interface GnuPGPublicKey {
822
fingerprint?: string;
828
export interface GnuPGPublicKeyList extends ItemsList<GnuPGPublicKey> {}
830
// https://kubernetes.io/docs/reference/kubectl/overview/#resource-types
832
export const ResourceKinds = [
841
'PersistentVolumeClaim',
845
'ReplicationController',
850
'MutatingWebhookConfiguration',
851
'ValidatingWebhookConfiguration',
852
'CustomResourceDefinition',
854
'ControllerRevision',
860
'LocalSubjectAccessReview',
861
'SelfSubjectAccessReview',
862
'SelfSubjectRulesReview',
863
'SubjectAccessReview',
864
'HorizontalPodAutoscaler',
867
'CertificateSigningRequest',
872
'PodDisruptionBudget',
873
'ClusterRoleBinding',
884
export const Groups = [
885
'admissionregistration.k8s.io',
886
'apiextensions.k8s.io',
887
'apiregistration.k8s.io',
889
'authentication.k8s.io',
890
'authorization.k8s.io',
893
'certificates.k8s.io',
894
'coordination.k8s.io',
900
'rbac.authorization.k8s.io',
902
'stable.example.com',
906
export interface HostResourceInfo {
907
resourceName: ResourceName;
908
requestedByApp: number;
909
requestedByNeighbors: number;
913
export interface Node {
915
systemInfo: NodeSystemInfo;
916
resourcesInfo: HostResourceInfo[];
919
export interface NodeSystemInfo {
920
architecture: string;
921
operatingSystem: string;
922
kernelVersion: string;
925
export enum ResourceName {
927
ResourceMemory = 'memory',
928
ResourceStorage = 'storage'
931
export interface Pod extends ResourceNode {
933
metadata: models.ObjectMeta;
935
health: HealthStatusCode;
938
export interface PodSpec {
942
export enum PodPhase {
943
PodPending = 'Pending',
944
PodRunning = 'Running',
945
PodSucceeded = 'Succeeded',
946
PodFailed = 'Failed',
947
PodUnknown = 'Unknown'
950
export interface NotificationChunk {
954
export interface LinkInfo {
957
description?: string;
961
export interface LinksResponse {
965
export interface UserMessages {
969
condition?: HealthStatusCode;