import { DialogService } from '@alauda/ui'; import { K8sApiService, PersistentVolumeClaim, Workspace, StringMap, CacheStore, AcpCommonApiService, Pod } from '@alauda-fe/common'; import { HttpClient } from '@angular/common/http'; import { Observable } from 'rxjs'; import { DeletePvcDialogComponent } from '../components/pvc-delete-dialog/component'; import { PvcExpandCapacityDialogComponent } from '../components/pvc-expand-capacity-dialog/component'; import { StorageCommonUtilService } from '../services/common-util.service'; import { StorageclassFeature, StorageProvisioner } from '../types/commons'; import { StorageClass, VolumeSnapshotClass, VolumeSnapshot } from '../types/k8s'; import * as i0 from "@angular/core"; export declare const PVC_SNAPSHOT_FEATURE_GATE = "volume-snapshot"; export declare function pvcUpdateEnabled(resource: PersistentVolumeClaim): boolean; export declare function getPvcDeletingDisabledState(pvc: PersistentVolumeClaim): { tooltip: string; disabled: boolean; }; export declare function getPvcRebuildingDisabledState(pvc: PersistentVolumeClaim): { tooltip: string; disabled: boolean; }; export declare const STORAGECLASS_FEATURE_FEATURE_GATE_MAP: Partial>>>; export declare enum PVCExpandDisabledReason { PVC_STATUS_FORBID = "expand_pvc_status_forbid", WITHOUT_STORAGE_CLASS = "expand_without_storage_class", STORAGE_CLASS_FORBID = "expand_storage_class_forbid", STORAGE_CLASS_NOTFOUND = "pvc_storage_class_not_found", PVC_REBUILDING = "pvc_rebuilding", PVC_DELETING = "pvc_deleting", TOPOLVM_PVC_EXISTED_SNAPSHOT = "pvc_existed_snapshot" } export declare enum PVCSnapshotDisabledReason { PVC_STATUS_FORBID = "snapshot_pvc_status_forbid", WITHOUT_STORAGE_CLASS = "snapshot_without_storage_class", STORAGE_CLASS_FORBID = "snapshot_storage_class_forbid", SNAPSHOT_PLUGIN_NOT_INSTALLED = "snapshot_plugin_not_installed", STORAGE_CLASS_NOTFOUND = "pvc_storage_class_not_found", SNAPSHOT_UNSUPPORTED = "snapshot_unsupported", PVC_REBUILDING = "pvc_rebuilding", PVC_DELETING = "pvc_deleting", PVC_EXPANDING = "pvc_expanding" } export type PVCActionStateFn = (pvc: PersistentVolumeClaim, mapper?: PVCActionTooltipMapper) => PVCActionState; export interface PVCActionState { disabled: boolean; reason?: PVCExpandDisabledReason | PVCSnapshotDisabledReason; tooltip?: string; } export type PVCActionTooltipMapper = (reason: PVCExpandDisabledReason | PVCSnapshotDisabledReason) => string; export declare function defaultPVCExpandTooltipMapper(reason: PVCExpandDisabledReason): "" | "pvc_deleting_can_not_operate" | "pvc_rebuilding_can_not_operate" | "pvc_storage_class_not_found" | "pvc_status_forbid_expansion" | "pvc_static_forbid_expansion" | "pvc_storageclass_forbid_expansion" | "pvc_existed_snapshot_forbid_expansion"; export declare function defaultPVCSnapshotTooltipMapper(reason: PVCSnapshotDisabledReason): "" | "pvc_deleting_can_not_operate" | "pvc_storage_class_not_found" | "pvc_status_forbid_snapshot" | "unsupported_volume_snapshot" | "snapshot_disabled_tip" | "snapshot_plugin_disabled_tip" | "pvc_expansion_forbid_snapshot"; export declare class PVCUtilService { private readonly dialog; private readonly k8sApi; private readonly acpApi; private readonly storageCommonUtil; private readonly http; constructor(dialog: DialogService, k8sApi: K8sApiService, acpApi: AcpCommonApiService, storageCommonUtil: StorageCommonUtilService, http: HttpClient); getRelatedPods(cluster: string, namespace: string, pvcName: string): Observable; storageClassListCache: CacheStore, StorageClass[]>; volumeSnapshotListCatch: CacheStore, VolumeSnapshot[]>; volumeSnapshotClassListCache: CacheStore, VolumeSnapshotClass[]>; snapshotPluginCache: CacheStore, boolean>; getSource$(pod: Pod, cluster: string, namespace: string): Observable<{ name: string; kind: string; }>; private getSourceInfo$; private sameOwnerReference; delete(pvc: PersistentVolumeClaim, cluster: string, namespace: string): import("@alauda/ui").DialogRef; rebuild(pvc: PersistentVolumeClaim, cluster: string, namespace: string): void; extendCapacity(resource: PersistentVolumeClaim, cluster: string, namespace: string, isVM?: boolean): import("@alauda/ui").DialogRef; getVolumeSnapshotEnabled$({ namespace, cluster }: Workspace): Observable; private getStorageClassList$; private getVolumeSnapshotList$; private getVolumeSnapshotClassList$; getPvcExpandStateFn$(workspace: Workspace): Observable; getPvcSnapshotStateFn$(workspace: Workspace): Observable; getPvcExpandState({ pvc, scList, vsList, mapper, }: { pvc: PersistentVolumeClaim; scList: StorageClass[]; vsList: VolumeSnapshot[]; mapper?: PVCActionTooltipMapper; }): { disabled: boolean; reason: PVCExpandDisabledReason; tooltip: string; }; private getPvcExpandDisabledReason; getPvcSnapshotState({ pvc, scList, vscList, pluginEnabled, storageDescriptionList, mapper, }: { pvc: PersistentVolumeClaim; scList: StorageClass[]; vscList: VolumeSnapshotClass[]; pluginEnabled: boolean; storageDescriptionList: StringMap[]; mapper?: PVCActionTooltipMapper; }): { disabled: boolean; reason: PVCSnapshotDisabledReason; tooltip: string; }; getPvcUpdateDisabledState(pvc: PersistentVolumeClaim): { disabled: boolean; tooltip?: string; }; getPvcRebuildDisabledState$(pvc: PersistentVolumeClaim, cluster: string, namespace: string): Observable<{ disabled: boolean; tooltip?: string; }>; getPvcDeleteDisabledState(pvc: PersistentVolumeClaim): { disabled: boolean; tooltip?: string; }; private getPvcSnapshotDisabledReason; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; }