@oneuptime/common 11.0.1 → 11.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Models/DatabaseModels/Alert.ts +110 -0
- package/Models/DatabaseModels/CephCluster.ts +964 -0
- package/Models/DatabaseModels/CephClusterLabelRule.ts +514 -0
- package/Models/DatabaseModels/CephClusterOwnerRule.ts +596 -0
- package/Models/DatabaseModels/CephClusterOwnerTeam.ts +487 -0
- package/Models/DatabaseModels/CephClusterOwnerUser.ts +486 -0
- package/Models/DatabaseModels/CephResource.ts +809 -0
- package/Models/DatabaseModels/Host.ts +64 -0
- package/Models/DatabaseModels/Incident.ts +110 -0
- package/Models/DatabaseModels/Index.ts +24 -0
- package/Models/DatabaseModels/ProxmoxCluster.ts +943 -0
- package/Models/DatabaseModels/ProxmoxClusterLabelRule.ts +514 -0
- package/Models/DatabaseModels/ProxmoxClusterOwnerRule.ts +596 -0
- package/Models/DatabaseModels/ProxmoxClusterOwnerTeam.ts +487 -0
- package/Models/DatabaseModels/ProxmoxClusterOwnerUser.ts +486 -0
- package/Models/DatabaseModels/ProxmoxResource.ts +726 -0
- package/Models/DatabaseModels/ScheduledMaintenance.ts +110 -0
- package/Server/API/BillingInvoiceAPI.ts +47 -7
- package/Server/API/CephResourceAPI.ts +134 -0
- package/Server/API/DashboardAPI.ts +46 -0
- package/Server/API/ProjectAPI.ts +15 -0
- package/Server/API/ProxmoxResourceAPI.ts +132 -0
- package/Server/API/ResellerPlanAPI.ts +17 -0
- package/Server/Infrastructure/GlobalCache.ts +8 -2
- package/Server/Infrastructure/Postgres/SchemaMigrations/1781500000000-AddProxmoxAndCephClusterTables.ts +163 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1781600000000-AddProxmoxCephV2Columns.ts +211 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1781600000001-AddProxmoxCephActivityAndRules.ts +590 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1781700000000-AddProxmoxCephV3Columns.ts +64 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +8 -0
- package/Server/Infrastructure/Redis.ts +40 -12
- package/Server/Services/AnalyticsDatabaseService.ts +1 -1
- package/Server/Services/BillingService.ts +109 -21
- package/Server/Services/CephClusterLabelRuleEngineService.ts +200 -0
- package/Server/Services/CephClusterLabelRuleService.ts +14 -0
- package/Server/Services/CephClusterOwnerRuleEngineService.ts +218 -0
- package/Server/Services/CephClusterOwnerRuleService.ts +14 -0
- package/Server/Services/CephClusterOwnerTeamService.ts +10 -0
- package/Server/Services/CephClusterOwnerUserService.ts +10 -0
- package/Server/Services/CephClusterService.ts +401 -0
- package/Server/Services/CephResourceService.ts +383 -0
- package/Server/Services/CloudResourceService.ts +11 -3
- package/Server/Services/DockerHostService.ts +11 -3
- package/Server/Services/ExceptionAggregationService.ts +2 -0
- package/Server/Services/HostService.ts +11 -3
- package/Server/Services/Index.ts +24 -0
- package/Server/Services/KubernetesClusterService.ts +11 -3
- package/Server/Services/LogAggregationService.ts +2 -0
- package/Server/Services/MetricAggregationService.ts +2 -0
- package/Server/Services/OpenTelemetryIngestService.ts +36 -0
- package/Server/Services/ProxmoxClusterLabelRuleEngineService.ts +204 -0
- package/Server/Services/ProxmoxClusterLabelRuleService.ts +14 -0
- package/Server/Services/ProxmoxClusterOwnerRuleEngineService.ts +222 -0
- package/Server/Services/ProxmoxClusterOwnerRuleService.ts +14 -0
- package/Server/Services/ProxmoxClusterOwnerTeamService.ts +10 -0
- package/Server/Services/ProxmoxClusterOwnerUserService.ts +10 -0
- package/Server/Services/ProxmoxClusterService.ts +382 -0
- package/Server/Services/ProxmoxResourceService.ts +404 -0
- package/Server/Services/RumApplicationService.ts +11 -3
- package/Server/Services/ServerlessFunctionService.ts +11 -3
- package/Server/Services/TelemetryUsageBillingService.ts +41 -3
- package/Server/Services/TraceAggregationService.ts +2 -0
- package/Server/Types/AnalyticsDatabase/AggregateBy.ts +8 -23
- package/Server/Utils/Monitor/MonitorAlert.ts +45 -0
- package/Server/Utils/Monitor/MonitorClusterContext.ts +129 -0
- package/Server/Utils/Monitor/MonitorCriteriaEvaluator.ts +344 -4
- package/Server/Utils/Monitor/MonitorIncident.ts +130 -7
- package/Server/Utils/Monitor/MonitorMaintenanceSuppression.ts +39 -6
- package/Server/Utils/Monitor/MonitorTemplateUtil.ts +3 -1
- package/Server/Utils/Monitor/SeriesResourceLabels.ts +33 -0
- package/Server/Utils/Profiling.ts +37 -2
- package/Server/Utils/Telemetry/EntityRegistry.ts +4 -0
- package/Server/Utils/Telemetry/ProxmoxCephSnapshotScan.ts +1096 -0
- package/Server/Utils/Telemetry/TelemetryEntity.ts +85 -0
- package/Server/Utils/Telemetry.ts +8 -19
- package/Tests/Server/API/BillingInvoiceAPI.test.ts +194 -0
- package/Tests/Server/API/ProjectAPI.test.ts +91 -0
- package/Tests/Server/API/ResellerPlanAPI.test.ts +207 -0
- package/Tests/Server/Infrastructure/GlobalCache.test.ts +100 -0
- package/Tests/Server/Services/BillingService.test.ts +323 -0
- package/Tests/Server/Services/CephResourceService.test.ts +264 -0
- package/Tests/Server/Services/ProxmoxResourceService.test.ts +326 -0
- package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluator.test.ts +322 -0
- package/Tests/Server/Utils/Monitor/MonitorMaintenanceSuppression.test.ts +13 -0
- package/Tests/Server/Utils/Telemetry/ProxmoxCephSnapshotScan.test.ts +879 -0
- package/Tests/Server/Utils/Telemetry/TelemetryEntity.test.ts +196 -0
- package/Tests/Types/Monitor/CephAlertTemplates.test.ts +1231 -0
- package/Tests/Types/Monitor/ProxmoxAlertTemplates.test.ts +732 -0
- package/Tests/Utils/Telemetry/EntityRelationship.test.ts +49 -0
- package/Tests/Utils/Telemetry/HeartbeatAvailability.test.ts +423 -0
- package/Types/BaseDatabase/AggregationIntervalUtil.ts +74 -0
- package/Types/Dashboard/DashboardComponentType.ts +4 -0
- package/Types/Dashboard/DashboardComponents/ComponentArgument.ts +2 -0
- package/Types/Dashboard/DashboardComponents/DashboardCephOsdListComponent.ts +15 -0
- package/Types/Dashboard/DashboardComponents/DashboardCephPoolListComponent.ts +14 -0
- package/Types/Dashboard/DashboardComponents/DashboardProxmoxGuestListComponent.ts +17 -0
- package/Types/Dashboard/DashboardComponents/DashboardProxmoxNodeListComponent.ts +16 -0
- package/Types/Dashboard/DashboardTemplates.ts +446 -0
- package/Types/Icon/IconProp.ts +2 -0
- package/Types/Monitor/CephAlertTemplates.ts +1647 -0
- package/Types/Monitor/CephMetricCatalog.ts +409 -0
- package/Types/Monitor/MetricMonitor/MetricMonitorResponse.ts +44 -0
- package/Types/Monitor/MonitorStep.ts +64 -0
- package/Types/Monitor/MonitorStepCephMonitor.ts +57 -0
- package/Types/Monitor/MonitorStepProxmoxMonitor.ts +81 -0
- package/Types/Monitor/MonitorType.ts +29 -1
- package/Types/Monitor/ProxmoxAlertTemplates.ts +899 -0
- package/Types/Monitor/ProxmoxMetricCatalog.ts +382 -0
- package/Types/Permission.ts +464 -0
- package/Types/Telemetry/EntityType.ts +11 -0
- package/Types/Telemetry/ServiceType.ts +2 -0
- package/UI/Components/Icon/Icon.tsx +84 -0
- package/UI/Components/MonitorTemplateVariables/TemplateVariablesCatalog.ts +9 -5
- package/UI/Utils/Telemetry/Telemetry.ts +16 -21
- package/UI/Utils/TelemetryService.ts +7 -3
- package/Utils/Dashboard/Components/DashboardCephOsdListComponent.ts +63 -0
- package/Utils/Dashboard/Components/DashboardCephPoolListComponent.ts +32 -0
- package/Utils/Dashboard/Components/DashboardCephResourceListShared.ts +61 -0
- package/Utils/Dashboard/Components/DashboardProxmoxGuestListComponent.ts +69 -0
- package/Utils/Dashboard/Components/DashboardProxmoxNodeListComponent.ts +55 -0
- package/Utils/Dashboard/Components/DashboardProxmoxResourceListShared.ts +61 -0
- package/Utils/Dashboard/Components/Index.ts +28 -0
- package/Utils/Telemetry/EntityKey.ts +35 -0
- package/Utils/Telemetry/EntityRelationship.ts +6 -0
- package/Utils/Telemetry/HeartbeatAvailability.ts +262 -0
- package/build/dist/Models/DatabaseModels/Alert.js +108 -0
- package/build/dist/Models/DatabaseModels/Alert.js.map +1 -1
- package/build/dist/Models/DatabaseModels/CephCluster.js +992 -0
- package/build/dist/Models/DatabaseModels/CephCluster.js.map +1 -0
- package/build/dist/Models/DatabaseModels/CephClusterLabelRule.js +522 -0
- package/build/dist/Models/DatabaseModels/CephClusterLabelRule.js.map +1 -0
- package/build/dist/Models/DatabaseModels/CephClusterOwnerRule.js +603 -0
- package/build/dist/Models/DatabaseModels/CephClusterOwnerRule.js.map +1 -0
- package/build/dist/Models/DatabaseModels/CephClusterOwnerTeam.js +503 -0
- package/build/dist/Models/DatabaseModels/CephClusterOwnerTeam.js.map +1 -0
- package/build/dist/Models/DatabaseModels/CephClusterOwnerUser.js +502 -0
- package/build/dist/Models/DatabaseModels/CephClusterOwnerUser.js.map +1 -0
- package/build/dist/Models/DatabaseModels/CephResource.js +846 -0
- package/build/dist/Models/DatabaseModels/CephResource.js.map +1 -0
- package/build/dist/Models/DatabaseModels/Host.js +63 -0
- package/build/dist/Models/DatabaseModels/Host.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Incident.js +108 -0
- package/build/dist/Models/DatabaseModels/Incident.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Index.js +24 -0
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/ProxmoxCluster.js +967 -0
- package/build/dist/Models/DatabaseModels/ProxmoxCluster.js.map +1 -0
- package/build/dist/Models/DatabaseModels/ProxmoxClusterLabelRule.js +522 -0
- package/build/dist/Models/DatabaseModels/ProxmoxClusterLabelRule.js.map +1 -0
- package/build/dist/Models/DatabaseModels/ProxmoxClusterOwnerRule.js +603 -0
- package/build/dist/Models/DatabaseModels/ProxmoxClusterOwnerRule.js.map +1 -0
- package/build/dist/Models/DatabaseModels/ProxmoxClusterOwnerTeam.js +503 -0
- package/build/dist/Models/DatabaseModels/ProxmoxClusterOwnerTeam.js.map +1 -0
- package/build/dist/Models/DatabaseModels/ProxmoxClusterOwnerUser.js +502 -0
- package/build/dist/Models/DatabaseModels/ProxmoxClusterOwnerUser.js.map +1 -0
- package/build/dist/Models/DatabaseModels/ProxmoxResource.js +761 -0
- package/build/dist/Models/DatabaseModels/ProxmoxResource.js.map +1 -0
- package/build/dist/Models/DatabaseModels/ScheduledMaintenance.js +108 -0
- package/build/dist/Models/DatabaseModels/ScheduledMaintenance.js.map +1 -1
- package/build/dist/Server/API/BillingInvoiceAPI.js +35 -5
- package/build/dist/Server/API/BillingInvoiceAPI.js.map +1 -1
- package/build/dist/Server/API/CephResourceAPI.js +98 -0
- package/build/dist/Server/API/CephResourceAPI.js.map +1 -0
- package/build/dist/Server/API/DashboardAPI.js +46 -0
- package/build/dist/Server/API/DashboardAPI.js.map +1 -1
- package/build/dist/Server/API/ProjectAPI.js +11 -0
- package/build/dist/Server/API/ProjectAPI.js.map +1 -1
- package/build/dist/Server/API/ProxmoxResourceAPI.js +95 -0
- package/build/dist/Server/API/ProxmoxResourceAPI.js.map +1 -0
- package/build/dist/Server/API/ResellerPlanAPI.js +17 -3
- package/build/dist/Server/API/ResellerPlanAPI.js.map +1 -1
- package/build/dist/Server/Infrastructure/GlobalCache.js +7 -2
- package/build/dist/Server/Infrastructure/GlobalCache.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1781500000000-AddProxmoxAndCephClusterTables.js +76 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1781500000000-AddProxmoxAndCephClusterTables.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1781600000000-AddProxmoxCephV2Columns.js +108 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1781600000000-AddProxmoxCephV2Columns.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1781600000001-AddProxmoxCephActivityAndRules.js +253 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1781600000001-AddProxmoxCephActivityAndRules.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1781700000000-AddProxmoxCephV3Columns.js +43 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1781700000000-AddProxmoxCephV3Columns.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +8 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Infrastructure/Redis.js +31 -8
- package/build/dist/Server/Infrastructure/Redis.js.map +1 -1
- package/build/dist/Server/Services/AnalyticsDatabaseService.js +1 -1
- package/build/dist/Server/Services/AnalyticsDatabaseService.js.map +1 -1
- package/build/dist/Server/Services/BillingService.js +85 -23
- package/build/dist/Server/Services/BillingService.js.map +1 -1
- package/build/dist/Server/Services/CephClusterLabelRuleEngineService.js +166 -0
- package/build/dist/Server/Services/CephClusterLabelRuleEngineService.js.map +1 -0
- package/build/dist/Server/Services/CephClusterLabelRuleService.js +13 -0
- package/build/dist/Server/Services/CephClusterLabelRuleService.js.map +1 -0
- package/build/dist/Server/Services/CephClusterOwnerRuleEngineService.js +186 -0
- package/build/dist/Server/Services/CephClusterOwnerRuleEngineService.js.map +1 -0
- package/build/dist/Server/Services/CephClusterOwnerRuleService.js +13 -0
- package/build/dist/Server/Services/CephClusterOwnerRuleService.js.map +1 -0
- package/build/dist/Server/Services/CephClusterOwnerTeamService.js +9 -0
- package/build/dist/Server/Services/CephClusterOwnerTeamService.js.map +1 -0
- package/build/dist/Server/Services/CephClusterOwnerUserService.js +9 -0
- package/build/dist/Server/Services/CephClusterOwnerUserService.js.map +1 -0
- package/build/dist/Server/Services/CephClusterService.js +353 -0
- package/build/dist/Server/Services/CephClusterService.js.map +1 -0
- package/build/dist/Server/Services/CephResourceService.js +257 -0
- package/build/dist/Server/Services/CephResourceService.js.map +1 -0
- package/build/dist/Server/Services/CloudResourceService.js +10 -2
- package/build/dist/Server/Services/CloudResourceService.js.map +1 -1
- package/build/dist/Server/Services/DockerHostService.js +10 -2
- package/build/dist/Server/Services/DockerHostService.js.map +1 -1
- package/build/dist/Server/Services/ExceptionAggregationService.js +2 -0
- package/build/dist/Server/Services/ExceptionAggregationService.js.map +1 -1
- package/build/dist/Server/Services/HostService.js +10 -2
- package/build/dist/Server/Services/HostService.js.map +1 -1
- package/build/dist/Server/Services/Index.js +24 -0
- package/build/dist/Server/Services/Index.js.map +1 -1
- package/build/dist/Server/Services/KubernetesClusterService.js +10 -2
- package/build/dist/Server/Services/KubernetesClusterService.js.map +1 -1
- package/build/dist/Server/Services/LogAggregationService.js +2 -0
- package/build/dist/Server/Services/LogAggregationService.js.map +1 -1
- package/build/dist/Server/Services/MetricAggregationService.js +2 -0
- package/build/dist/Server/Services/MetricAggregationService.js.map +1 -1
- package/build/dist/Server/Services/OpenTelemetryIngestService.js +37 -7
- package/build/dist/Server/Services/OpenTelemetryIngestService.js.map +1 -1
- package/build/dist/Server/Services/ProxmoxClusterLabelRuleEngineService.js +166 -0
- package/build/dist/Server/Services/ProxmoxClusterLabelRuleEngineService.js.map +1 -0
- package/build/dist/Server/Services/ProxmoxClusterLabelRuleService.js +13 -0
- package/build/dist/Server/Services/ProxmoxClusterLabelRuleService.js.map +1 -0
- package/build/dist/Server/Services/ProxmoxClusterOwnerRuleEngineService.js +186 -0
- package/build/dist/Server/Services/ProxmoxClusterOwnerRuleEngineService.js.map +1 -0
- package/build/dist/Server/Services/ProxmoxClusterOwnerRuleService.js +13 -0
- package/build/dist/Server/Services/ProxmoxClusterOwnerRuleService.js.map +1 -0
- package/build/dist/Server/Services/ProxmoxClusterOwnerTeamService.js +9 -0
- package/build/dist/Server/Services/ProxmoxClusterOwnerTeamService.js.map +1 -0
- package/build/dist/Server/Services/ProxmoxClusterOwnerUserService.js +9 -0
- package/build/dist/Server/Services/ProxmoxClusterOwnerUserService.js.map +1 -0
- package/build/dist/Server/Services/ProxmoxClusterService.js +337 -0
- package/build/dist/Server/Services/ProxmoxClusterService.js.map +1 -0
- package/build/dist/Server/Services/ProxmoxResourceService.js +285 -0
- package/build/dist/Server/Services/ProxmoxResourceService.js.map +1 -0
- package/build/dist/Server/Services/RumApplicationService.js +10 -2
- package/build/dist/Server/Services/RumApplicationService.js.map +1 -1
- package/build/dist/Server/Services/ServerlessFunctionService.js +10 -2
- package/build/dist/Server/Services/ServerlessFunctionService.js.map +1 -1
- package/build/dist/Server/Services/TelemetryUsageBillingService.js +30 -3
- package/build/dist/Server/Services/TelemetryUsageBillingService.js.map +1 -1
- package/build/dist/Server/Services/TraceAggregationService.js +2 -0
- package/build/dist/Server/Services/TraceAggregationService.js.map +1 -1
- package/build/dist/Server/Types/AnalyticsDatabase/AggregateBy.js +8 -25
- package/build/dist/Server/Types/AnalyticsDatabase/AggregateBy.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorAlert.js +36 -0
- package/build/dist/Server/Utils/Monitor/MonitorAlert.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorClusterContext.js +90 -0
- package/build/dist/Server/Utils/Monitor/MonitorClusterContext.js.map +1 -0
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js +228 -4
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorIncident.js +103 -8
- package/build/dist/Server/Utils/Monitor/MonitorIncident.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorMaintenanceSuppression.js +23 -6
- package/build/dist/Server/Utils/Monitor/MonitorMaintenanceSuppression.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorTemplateUtil.js +3 -1
- package/build/dist/Server/Utils/Monitor/MonitorTemplateUtil.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/SeriesResourceLabels.js +23 -0
- package/build/dist/Server/Utils/Monitor/SeriesResourceLabels.js.map +1 -1
- package/build/dist/Server/Utils/Profiling.js +24 -3
- package/build/dist/Server/Utils/Profiling.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/EntityRegistry.js +4 -0
- package/build/dist/Server/Utils/Telemetry/EntityRegistry.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/ProxmoxCephSnapshotScan.js +854 -0
- package/build/dist/Server/Utils/Telemetry/ProxmoxCephSnapshotScan.js.map +1 -0
- package/build/dist/Server/Utils/Telemetry/TelemetryEntity.js +62 -0
- package/build/dist/Server/Utils/Telemetry/TelemetryEntity.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry.js +8 -10
- package/build/dist/Server/Utils/Telemetry.js.map +1 -1
- package/build/dist/Types/BaseDatabase/AggregationIntervalUtil.js +69 -0
- package/build/dist/Types/BaseDatabase/AggregationIntervalUtil.js.map +1 -0
- package/build/dist/Types/Dashboard/DashboardComponentType.js +4 -0
- package/build/dist/Types/Dashboard/DashboardComponentType.js.map +1 -1
- package/build/dist/Types/Dashboard/DashboardComponents/ComponentArgument.js +2 -0
- package/build/dist/Types/Dashboard/DashboardComponents/ComponentArgument.js.map +1 -1
- package/build/dist/Types/Dashboard/DashboardComponents/DashboardCephOsdListComponent.js +2 -0
- package/build/dist/Types/Dashboard/DashboardComponents/DashboardCephOsdListComponent.js.map +1 -0
- package/build/dist/Types/Dashboard/DashboardComponents/DashboardCephPoolListComponent.js +2 -0
- package/build/dist/Types/Dashboard/DashboardComponents/DashboardCephPoolListComponent.js.map +1 -0
- package/build/dist/Types/Dashboard/DashboardComponents/DashboardProxmoxGuestListComponent.js +2 -0
- package/build/dist/Types/Dashboard/DashboardComponents/DashboardProxmoxGuestListComponent.js.map +1 -0
- package/build/dist/Types/Dashboard/DashboardComponents/DashboardProxmoxNodeListComponent.js +2 -0
- package/build/dist/Types/Dashboard/DashboardComponents/DashboardProxmoxNodeListComponent.js.map +1 -0
- package/build/dist/Types/Dashboard/DashboardTemplates.js +394 -0
- package/build/dist/Types/Dashboard/DashboardTemplates.js.map +1 -1
- package/build/dist/Types/Icon/IconProp.js +2 -0
- package/build/dist/Types/Icon/IconProp.js.map +1 -1
- package/build/dist/Types/Monitor/CephAlertTemplates.js +1379 -0
- package/build/dist/Types/Monitor/CephAlertTemplates.js.map +1 -0
- package/build/dist/Types/Monitor/CephMetricCatalog.js +353 -0
- package/build/dist/Types/Monitor/CephMetricCatalog.js.map +1 -0
- package/build/dist/Types/Monitor/MonitorStep.js +46 -0
- package/build/dist/Types/Monitor/MonitorStep.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorStepCephMonitor.js +34 -0
- package/build/dist/Types/Monitor/MonitorStepCephMonitor.js.map +1 -0
- package/build/dist/Types/Monitor/MonitorStepProxmoxMonitor.js +36 -0
- package/build/dist/Types/Monitor/MonitorStepProxmoxMonitor.js.map +1 -0
- package/build/dist/Types/Monitor/MonitorType.js +27 -1
- package/build/dist/Types/Monitor/MonitorType.js.map +1 -1
- package/build/dist/Types/Monitor/ProxmoxAlertTemplates.js +743 -0
- package/build/dist/Types/Monitor/ProxmoxAlertTemplates.js.map +1 -0
- package/build/dist/Types/Monitor/ProxmoxMetricCatalog.js +320 -0
- package/build/dist/Types/Monitor/ProxmoxMetricCatalog.js.map +1 -0
- package/build/dist/Types/Permission.js +408 -0
- package/build/dist/Types/Permission.js.map +1 -1
- package/build/dist/Types/Telemetry/EntityType.js +11 -0
- package/build/dist/Types/Telemetry/EntityType.js.map +1 -1
- package/build/dist/Types/Telemetry/ServiceType.js +2 -0
- package/build/dist/Types/Telemetry/ServiceType.js.map +1 -1
- package/build/dist/UI/Components/Icon/Icon.js +33 -0
- package/build/dist/UI/Components/Icon/Icon.js.map +1 -1
- package/build/dist/UI/Components/MonitorTemplateVariables/TemplateVariablesCatalog.js +5 -1
- package/build/dist/UI/Components/MonitorTemplateVariables/TemplateVariablesCatalog.js.map +1 -1
- package/build/dist/UI/Utils/Telemetry/Telemetry.js +11 -10
- package/build/dist/UI/Utils/Telemetry/Telemetry.js.map +1 -1
- package/build/dist/UI/Utils/TelemetryService.js +5 -2
- package/build/dist/UI/Utils/TelemetryService.js.map +1 -1
- package/build/dist/Utils/Dashboard/Components/DashboardCephOsdListComponent.js +50 -0
- package/build/dist/Utils/Dashboard/Components/DashboardCephOsdListComponent.js.map +1 -0
- package/build/dist/Utils/Dashboard/Components/DashboardCephPoolListComponent.js +27 -0
- package/build/dist/Utils/Dashboard/Components/DashboardCephPoolListComponent.js.map +1 -0
- package/build/dist/Utils/Dashboard/Components/DashboardCephResourceListShared.js +46 -0
- package/build/dist/Utils/Dashboard/Components/DashboardCephResourceListShared.js.map +1 -0
- package/build/dist/Utils/Dashboard/Components/DashboardProxmoxGuestListComponent.js +55 -0
- package/build/dist/Utils/Dashboard/Components/DashboardProxmoxGuestListComponent.js.map +1 -0
- package/build/dist/Utils/Dashboard/Components/DashboardProxmoxNodeListComponent.js +42 -0
- package/build/dist/Utils/Dashboard/Components/DashboardProxmoxNodeListComponent.js.map +1 -0
- package/build/dist/Utils/Dashboard/Components/DashboardProxmoxResourceListShared.js +46 -0
- package/build/dist/Utils/Dashboard/Components/DashboardProxmoxResourceListShared.js.map +1 -0
- package/build/dist/Utils/Dashboard/Components/Index.js +16 -0
- package/build/dist/Utils/Dashboard/Components/Index.js.map +1 -1
- package/build/dist/Utils/Telemetry/EntityKey.js +27 -0
- package/build/dist/Utils/Telemetry/EntityKey.js.map +1 -1
- package/build/dist/Utils/Telemetry/EntityRelationship.js +3 -0
- package/build/dist/Utils/Telemetry/EntityRelationship.js.map +1 -1
- package/build/dist/Utils/Telemetry/HeartbeatAvailability.js +174 -0
- package/build/dist/Utils/Telemetry/HeartbeatAvailability.js.map +1 -0
- package/package.json +29 -21
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from "typeorm";
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Proxmox + Ceph monitoring products (Internal/Roadmap/ProxmoxCephProducts.md):
|
|
5
|
+
* one table per product, cloned from the DockerHost shape. A row per
|
|
6
|
+
* monitored cluster, auto-discovered at OTel ingest from the
|
|
7
|
+
* `proxmox.cluster.name` / `ceph.cluster.name` resource attributes (the
|
|
8
|
+
* `name` column is the join key — unlike DockerHost there is no separate
|
|
9
|
+
* identifier column) or manually registered. Columns/indexes/FKs are derived
|
|
10
|
+
* from the model decorators in Common/Models/DatabaseModels/ProxmoxCluster.ts
|
|
11
|
+
* and CephCluster.ts.
|
|
12
|
+
*/
|
|
13
|
+
export class AddProxmoxAndCephClusterTables1781500000000
|
|
14
|
+
implements MigrationInterface
|
|
15
|
+
{
|
|
16
|
+
public name = "AddProxmoxAndCephClusterTables1781500000000";
|
|
17
|
+
|
|
18
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
19
|
+
// Proxmox cluster table.
|
|
20
|
+
await queryRunner.query(
|
|
21
|
+
`CREATE TABLE "ProxmoxCluster" ("_id" uuid NOT NULL DEFAULT uuid_generate_v4(), "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP WITH TIME ZONE, "version" integer NOT NULL, "projectId" uuid NOT NULL, "name" character varying(100) NOT NULL, "slug" character varying(100) NOT NULL, "description" character varying(500), "otelCollectorStatus" character varying(100) DEFAULT 'disconnected', "agentVersion" character varying(100), "pveVersion" character varying(500), "lastSeenAt" TIMESTAMP WITH TIME ZONE, "nodeCount" integer DEFAULT '0', "guestCount" integer DEFAULT '0', "storageCount" integer DEFAULT '0', "retainTelemetryDataForDays" integer, "telemetryRetentionConfig" jsonb, "createdByUserId" uuid, "deletedByUserId" uuid, CONSTRAINT "PK_proxmox_cluster_id" PRIMARY KEY ("_id"))`,
|
|
22
|
+
);
|
|
23
|
+
await queryRunner.query(
|
|
24
|
+
`CREATE INDEX "IDX_proxmox_cluster_projectId" ON "ProxmoxCluster" ("projectId")`,
|
|
25
|
+
);
|
|
26
|
+
await queryRunner.query(
|
|
27
|
+
`CREATE INDEX "IDX_proxmox_cluster_name" ON "ProxmoxCluster" ("name")`,
|
|
28
|
+
);
|
|
29
|
+
await queryRunner.query(
|
|
30
|
+
`CREATE UNIQUE INDEX "IDX_proxmox_cluster_slug" ON "ProxmoxCluster" ("slug")`,
|
|
31
|
+
);
|
|
32
|
+
await queryRunner.query(
|
|
33
|
+
`ALTER TABLE "ProxmoxCluster" ADD CONSTRAINT "FK_proxmox_cluster_projectId" FOREIGN KEY ("projectId") REFERENCES "Project"("_id") ON DELETE CASCADE ON UPDATE NO ACTION`,
|
|
34
|
+
);
|
|
35
|
+
await queryRunner.query(
|
|
36
|
+
`ALTER TABLE "ProxmoxCluster" ADD CONSTRAINT "FK_proxmox_cluster_createdByUserId" FOREIGN KEY ("createdByUserId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`,
|
|
37
|
+
);
|
|
38
|
+
await queryRunner.query(
|
|
39
|
+
`ALTER TABLE "ProxmoxCluster" ADD CONSTRAINT "FK_proxmox_cluster_deletedByUserId" FOREIGN KEY ("deletedByUserId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`,
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
// Proxmox cluster label join table.
|
|
43
|
+
await queryRunner.query(
|
|
44
|
+
`CREATE TABLE "ProxmoxClusterLabel" ("proxmoxClusterId" uuid NOT NULL, "labelId" uuid NOT NULL, CONSTRAINT "PK_proxmox_cluster_label" PRIMARY KEY ("proxmoxClusterId", "labelId"))`,
|
|
45
|
+
);
|
|
46
|
+
await queryRunner.query(
|
|
47
|
+
`CREATE INDEX "IDX_proxmox_cluster_label_proxmoxClusterId" ON "ProxmoxClusterLabel" ("proxmoxClusterId")`,
|
|
48
|
+
);
|
|
49
|
+
await queryRunner.query(
|
|
50
|
+
`CREATE INDEX "IDX_proxmox_cluster_label_labelId" ON "ProxmoxClusterLabel" ("labelId")`,
|
|
51
|
+
);
|
|
52
|
+
await queryRunner.query(
|
|
53
|
+
`ALTER TABLE "ProxmoxClusterLabel" ADD CONSTRAINT "FK_proxmox_cluster_label_proxmoxClusterId" FOREIGN KEY ("proxmoxClusterId") REFERENCES "ProxmoxCluster"("_id") ON DELETE CASCADE ON UPDATE CASCADE`,
|
|
54
|
+
);
|
|
55
|
+
await queryRunner.query(
|
|
56
|
+
`ALTER TABLE "ProxmoxClusterLabel" ADD CONSTRAINT "FK_proxmox_cluster_label_labelId" FOREIGN KEY ("labelId") REFERENCES "Label"("_id") ON DELETE CASCADE ON UPDATE CASCADE`,
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
// Ceph cluster table.
|
|
60
|
+
await queryRunner.query(
|
|
61
|
+
`CREATE TABLE "CephCluster" ("_id" uuid NOT NULL DEFAULT uuid_generate_v4(), "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP WITH TIME ZONE, "version" integer NOT NULL, "projectId" uuid NOT NULL, "name" character varying(100) NOT NULL, "slug" character varying(100) NOT NULL, "description" character varying(500), "fsid" character varying(100), "otelCollectorStatus" character varying(100) DEFAULT 'disconnected', "agentVersion" character varying(100), "cephVersion" character varying(500), "lastSeenAt" TIMESTAMP WITH TIME ZONE, "monCount" integer DEFAULT '0', "osdCount" integer DEFAULT '0', "poolCount" integer DEFAULT '0', "retainTelemetryDataForDays" integer, "telemetryRetentionConfig" jsonb, "createdByUserId" uuid, "deletedByUserId" uuid, CONSTRAINT "PK_ceph_cluster_id" PRIMARY KEY ("_id"))`,
|
|
62
|
+
);
|
|
63
|
+
await queryRunner.query(
|
|
64
|
+
`CREATE INDEX "IDX_ceph_cluster_projectId" ON "CephCluster" ("projectId")`,
|
|
65
|
+
);
|
|
66
|
+
await queryRunner.query(
|
|
67
|
+
`CREATE INDEX "IDX_ceph_cluster_name" ON "CephCluster" ("name")`,
|
|
68
|
+
);
|
|
69
|
+
await queryRunner.query(
|
|
70
|
+
`CREATE UNIQUE INDEX "IDX_ceph_cluster_slug" ON "CephCluster" ("slug")`,
|
|
71
|
+
);
|
|
72
|
+
await queryRunner.query(
|
|
73
|
+
`ALTER TABLE "CephCluster" ADD CONSTRAINT "FK_ceph_cluster_projectId" FOREIGN KEY ("projectId") REFERENCES "Project"("_id") ON DELETE CASCADE ON UPDATE NO ACTION`,
|
|
74
|
+
);
|
|
75
|
+
await queryRunner.query(
|
|
76
|
+
`ALTER TABLE "CephCluster" ADD CONSTRAINT "FK_ceph_cluster_createdByUserId" FOREIGN KEY ("createdByUserId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`,
|
|
77
|
+
);
|
|
78
|
+
await queryRunner.query(
|
|
79
|
+
`ALTER TABLE "CephCluster" ADD CONSTRAINT "FK_ceph_cluster_deletedByUserId" FOREIGN KEY ("deletedByUserId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`,
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
// Ceph cluster label join table.
|
|
83
|
+
await queryRunner.query(
|
|
84
|
+
`CREATE TABLE "CephClusterLabel" ("cephClusterId" uuid NOT NULL, "labelId" uuid NOT NULL, CONSTRAINT "PK_ceph_cluster_label" PRIMARY KEY ("cephClusterId", "labelId"))`,
|
|
85
|
+
);
|
|
86
|
+
await queryRunner.query(
|
|
87
|
+
`CREATE INDEX "IDX_ceph_cluster_label_cephClusterId" ON "CephClusterLabel" ("cephClusterId")`,
|
|
88
|
+
);
|
|
89
|
+
await queryRunner.query(
|
|
90
|
+
`CREATE INDEX "IDX_ceph_cluster_label_labelId" ON "CephClusterLabel" ("labelId")`,
|
|
91
|
+
);
|
|
92
|
+
await queryRunner.query(
|
|
93
|
+
`ALTER TABLE "CephClusterLabel" ADD CONSTRAINT "FK_ceph_cluster_label_cephClusterId" FOREIGN KEY ("cephClusterId") REFERENCES "CephCluster"("_id") ON DELETE CASCADE ON UPDATE CASCADE`,
|
|
94
|
+
);
|
|
95
|
+
await queryRunner.query(
|
|
96
|
+
`ALTER TABLE "CephClusterLabel" ADD CONSTRAINT "FK_ceph_cluster_label_labelId" FOREIGN KEY ("labelId") REFERENCES "Label"("_id") ON DELETE CASCADE ON UPDATE CASCADE`,
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
101
|
+
// Ceph cluster label join table.
|
|
102
|
+
await queryRunner.query(
|
|
103
|
+
`ALTER TABLE "CephClusterLabel" DROP CONSTRAINT "FK_ceph_cluster_label_labelId"`,
|
|
104
|
+
);
|
|
105
|
+
await queryRunner.query(
|
|
106
|
+
`ALTER TABLE "CephClusterLabel" DROP CONSTRAINT "FK_ceph_cluster_label_cephClusterId"`,
|
|
107
|
+
);
|
|
108
|
+
await queryRunner.query(
|
|
109
|
+
`DROP INDEX "public"."IDX_ceph_cluster_label_labelId"`,
|
|
110
|
+
);
|
|
111
|
+
await queryRunner.query(
|
|
112
|
+
`DROP INDEX "public"."IDX_ceph_cluster_label_cephClusterId"`,
|
|
113
|
+
);
|
|
114
|
+
await queryRunner.query(`DROP TABLE "CephClusterLabel"`);
|
|
115
|
+
|
|
116
|
+
// Ceph cluster table.
|
|
117
|
+
await queryRunner.query(
|
|
118
|
+
`ALTER TABLE "CephCluster" DROP CONSTRAINT "FK_ceph_cluster_deletedByUserId"`,
|
|
119
|
+
);
|
|
120
|
+
await queryRunner.query(
|
|
121
|
+
`ALTER TABLE "CephCluster" DROP CONSTRAINT "FK_ceph_cluster_createdByUserId"`,
|
|
122
|
+
);
|
|
123
|
+
await queryRunner.query(
|
|
124
|
+
`ALTER TABLE "CephCluster" DROP CONSTRAINT "FK_ceph_cluster_projectId"`,
|
|
125
|
+
);
|
|
126
|
+
await queryRunner.query(`DROP INDEX "public"."IDX_ceph_cluster_slug"`);
|
|
127
|
+
await queryRunner.query(`DROP INDEX "public"."IDX_ceph_cluster_name"`);
|
|
128
|
+
await queryRunner.query(`DROP INDEX "public"."IDX_ceph_cluster_projectId"`);
|
|
129
|
+
await queryRunner.query(`DROP TABLE "CephCluster"`);
|
|
130
|
+
|
|
131
|
+
// Proxmox cluster label join table.
|
|
132
|
+
await queryRunner.query(
|
|
133
|
+
`ALTER TABLE "ProxmoxClusterLabel" DROP CONSTRAINT "FK_proxmox_cluster_label_labelId"`,
|
|
134
|
+
);
|
|
135
|
+
await queryRunner.query(
|
|
136
|
+
`ALTER TABLE "ProxmoxClusterLabel" DROP CONSTRAINT "FK_proxmox_cluster_label_proxmoxClusterId"`,
|
|
137
|
+
);
|
|
138
|
+
await queryRunner.query(
|
|
139
|
+
`DROP INDEX "public"."IDX_proxmox_cluster_label_labelId"`,
|
|
140
|
+
);
|
|
141
|
+
await queryRunner.query(
|
|
142
|
+
`DROP INDEX "public"."IDX_proxmox_cluster_label_proxmoxClusterId"`,
|
|
143
|
+
);
|
|
144
|
+
await queryRunner.query(`DROP TABLE "ProxmoxClusterLabel"`);
|
|
145
|
+
|
|
146
|
+
// Proxmox cluster table.
|
|
147
|
+
await queryRunner.query(
|
|
148
|
+
`ALTER TABLE "ProxmoxCluster" DROP CONSTRAINT "FK_proxmox_cluster_deletedByUserId"`,
|
|
149
|
+
);
|
|
150
|
+
await queryRunner.query(
|
|
151
|
+
`ALTER TABLE "ProxmoxCluster" DROP CONSTRAINT "FK_proxmox_cluster_createdByUserId"`,
|
|
152
|
+
);
|
|
153
|
+
await queryRunner.query(
|
|
154
|
+
`ALTER TABLE "ProxmoxCluster" DROP CONSTRAINT "FK_proxmox_cluster_projectId"`,
|
|
155
|
+
);
|
|
156
|
+
await queryRunner.query(`DROP INDEX "public"."IDX_proxmox_cluster_slug"`);
|
|
157
|
+
await queryRunner.query(`DROP INDEX "public"."IDX_proxmox_cluster_name"`);
|
|
158
|
+
await queryRunner.query(
|
|
159
|
+
`DROP INDEX "public"."IDX_proxmox_cluster_projectId"`,
|
|
160
|
+
);
|
|
161
|
+
await queryRunner.query(`DROP TABLE "ProxmoxCluster"`);
|
|
162
|
+
}
|
|
163
|
+
}
|
package/Server/Infrastructure/Postgres/SchemaMigrations/1781600000000-AddProxmoxCephV2Columns.ts
ADDED
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from "typeorm";
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Proxmox + Ceph V2 (Internal/Roadmap/ProxmoxCephProductsV2.md):
|
|
5
|
+
*
|
|
6
|
+
* 1. WI-3 snapshot columns — ProxmoxCluster.onlineNodeCount and
|
|
7
|
+
* CephCluster.healthStatus (0 = OK / 1 = WARN / 2 = ERR), osdUpCount,
|
|
8
|
+
* osdInCount, capacityUsedPercent. Written by the metrics-ingest
|
|
9
|
+
* snapshot scan via updateLastSeen extras so list pages never hit
|
|
10
|
+
* ClickHouse.
|
|
11
|
+
*
|
|
12
|
+
* 2. WI-2 race defense — DB-level unique indexes on (projectId, name)
|
|
13
|
+
* for both cluster tables. The v1 migration (1781500000000) only
|
|
14
|
+
* created the app-level @UniqueColumnBy check plus a non-unique name
|
|
15
|
+
* index; without the DB index, concurrent find-or-create at ingest
|
|
16
|
+
* (multiple agent pods) can insert duplicate rows — the exact bug the
|
|
17
|
+
* KubernetesCluster dedupe migration (1776881254913) had to clean up.
|
|
18
|
+
* Both migrations ship in the same release and the v1 tables cannot
|
|
19
|
+
* have accumulated duplicates between them, so no dedupe step is
|
|
20
|
+
* needed here.
|
|
21
|
+
*
|
|
22
|
+
* 3. WI-6 child-resource inventory tables — ProxmoxResource and
|
|
23
|
+
* CephResource, cloned from the KubernetesResource shape (unique
|
|
24
|
+
* identity index, denormalized latest-metric columns, not
|
|
25
|
+
* user-writable). externalId is the pve `id` label (node/pve1,
|
|
26
|
+
* qemu/100, storage/local) or the ceph_daemon / pool_id label.
|
|
27
|
+
*
|
|
28
|
+
* 4. WI-17 — nullable Host.proxmoxClusterId FK (SET NULL), the
|
|
29
|
+
* guest-VM → Host cross-link, cloned from Host.kubernetesClusterId.
|
|
30
|
+
*
|
|
31
|
+
* Columns/indexes/FKs are derived from the model decorators in
|
|
32
|
+
* Common/Models/DatabaseModels/{ProxmoxCluster,CephCluster,
|
|
33
|
+
* ProxmoxResource,CephResource,Host}.ts.
|
|
34
|
+
*/
|
|
35
|
+
export class AddProxmoxCephV2Columns1781600000000
|
|
36
|
+
implements MigrationInterface
|
|
37
|
+
{
|
|
38
|
+
public name = "AddProxmoxCephV2Columns1781600000000";
|
|
39
|
+
|
|
40
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
41
|
+
// WI-3: snapshot columns on the cluster tables.
|
|
42
|
+
await queryRunner.query(
|
|
43
|
+
`ALTER TABLE "ProxmoxCluster" ADD "onlineNodeCount" integer DEFAULT '0'`,
|
|
44
|
+
);
|
|
45
|
+
await queryRunner.query(
|
|
46
|
+
`ALTER TABLE "CephCluster" ADD "osdUpCount" integer DEFAULT '0'`,
|
|
47
|
+
);
|
|
48
|
+
await queryRunner.query(
|
|
49
|
+
`ALTER TABLE "CephCluster" ADD "osdInCount" integer DEFAULT '0'`,
|
|
50
|
+
);
|
|
51
|
+
await queryRunner.query(
|
|
52
|
+
`ALTER TABLE "CephCluster" ADD "healthStatus" integer`,
|
|
53
|
+
);
|
|
54
|
+
await queryRunner.query(
|
|
55
|
+
`ALTER TABLE "CephCluster" ADD "capacityUsedPercent" numeric`,
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
/*
|
|
59
|
+
* WI-2: DB-level unique indexes (the concurrent find-or-create race
|
|
60
|
+
* defense — see file comment).
|
|
61
|
+
*/
|
|
62
|
+
await queryRunner.query(
|
|
63
|
+
`CREATE UNIQUE INDEX "IDX_proxmox_cluster_projectId_name" ON "ProxmoxCluster" ("projectId", "name")`,
|
|
64
|
+
);
|
|
65
|
+
await queryRunner.query(
|
|
66
|
+
`CREATE UNIQUE INDEX "IDX_ceph_cluster_projectId_name" ON "CephCluster" ("projectId", "name")`,
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
// WI-6: Proxmox resource inventory table.
|
|
70
|
+
await queryRunner.query(
|
|
71
|
+
`CREATE TABLE "ProxmoxResource" ("_id" uuid NOT NULL DEFAULT uuid_generate_v4(), "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP WITH TIME ZONE, "version" integer NOT NULL, "projectId" uuid NOT NULL, "proxmoxClusterId" uuid NOT NULL, "kind" character varying(100) NOT NULL, "externalId" character varying(100) NOT NULL, "name" character varying(100), "vmid" integer, "guestType" character varying(100), "parentNodeName" character varying(100), "isUp" boolean, "haState" character varying(100), "onboot" boolean, "uptimeSeconds" integer, "latestCpuPercent" numeric, "latestMemoryBytes" bigint, "maxMemoryBytes" bigint, "latestMemoryPercent" numeric, "latestDiskBytes" bigint, "maxDiskBytes" bigint, "metricsUpdatedAt" TIMESTAMP WITH TIME ZONE, "lastSeenAt" TIMESTAMP WITH TIME ZONE NOT NULL, "createdByUserId" uuid, "deletedByUserId" uuid, CONSTRAINT "PK_proxmox_resource_id" PRIMARY KEY ("_id"))`,
|
|
72
|
+
);
|
|
73
|
+
await queryRunner.query(
|
|
74
|
+
`CREATE INDEX "IDX_proxmox_resource_projectId" ON "ProxmoxResource" ("projectId")`,
|
|
75
|
+
);
|
|
76
|
+
await queryRunner.query(
|
|
77
|
+
`CREATE INDEX "IDX_proxmox_resource_proxmoxClusterId" ON "ProxmoxResource" ("proxmoxClusterId")`,
|
|
78
|
+
);
|
|
79
|
+
await queryRunner.query(
|
|
80
|
+
`CREATE UNIQUE INDEX "IDX_proxmox_resource_identity" ON "ProxmoxResource" ("projectId", "proxmoxClusterId", "kind", "externalId")`,
|
|
81
|
+
);
|
|
82
|
+
await queryRunner.query(
|
|
83
|
+
`ALTER TABLE "ProxmoxResource" ADD CONSTRAINT "FK_proxmox_resource_projectId" FOREIGN KEY ("projectId") REFERENCES "Project"("_id") ON DELETE CASCADE ON UPDATE NO ACTION`,
|
|
84
|
+
);
|
|
85
|
+
await queryRunner.query(
|
|
86
|
+
`ALTER TABLE "ProxmoxResource" ADD CONSTRAINT "FK_proxmox_resource_proxmoxClusterId" FOREIGN KEY ("proxmoxClusterId") REFERENCES "ProxmoxCluster"("_id") ON DELETE CASCADE ON UPDATE NO ACTION`,
|
|
87
|
+
);
|
|
88
|
+
await queryRunner.query(
|
|
89
|
+
`ALTER TABLE "ProxmoxResource" ADD CONSTRAINT "FK_proxmox_resource_createdByUserId" FOREIGN KEY ("createdByUserId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`,
|
|
90
|
+
);
|
|
91
|
+
await queryRunner.query(
|
|
92
|
+
`ALTER TABLE "ProxmoxResource" ADD CONSTRAINT "FK_proxmox_resource_deletedByUserId" FOREIGN KEY ("deletedByUserId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`,
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
// WI-6: Ceph resource inventory table.
|
|
96
|
+
await queryRunner.query(
|
|
97
|
+
`CREATE TABLE "CephResource" ("_id" uuid NOT NULL DEFAULT uuid_generate_v4(), "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP WITH TIME ZONE, "version" integer NOT NULL, "projectId" uuid NOT NULL, "cephClusterId" uuid NOT NULL, "kind" character varying(100) NOT NULL, "externalId" character varying(100) NOT NULL, "name" character varying(100), "hostname" character varying(100), "daemonVersion" character varying(100), "deviceClass" character varying(100), "isUp" boolean, "isIn" boolean, "inQuorum" boolean, "statBytes" bigint, "statBytesUsed" bigint, "applyLatencyMs" numeric, "commitLatencyMs" numeric, "pgCount" integer, "storedBytes" bigint, "maxAvailBytes" bigint, "objects" bigint, "readOpsCounter" bigint, "writeOpsCounter" bigint, "metricsUpdatedAt" TIMESTAMP WITH TIME ZONE, "lastSeenAt" TIMESTAMP WITH TIME ZONE NOT NULL, "createdByUserId" uuid, "deletedByUserId" uuid, CONSTRAINT "PK_ceph_resource_id" PRIMARY KEY ("_id"))`,
|
|
98
|
+
);
|
|
99
|
+
await queryRunner.query(
|
|
100
|
+
`CREATE INDEX "IDX_ceph_resource_projectId" ON "CephResource" ("projectId")`,
|
|
101
|
+
);
|
|
102
|
+
await queryRunner.query(
|
|
103
|
+
`CREATE INDEX "IDX_ceph_resource_cephClusterId" ON "CephResource" ("cephClusterId")`,
|
|
104
|
+
);
|
|
105
|
+
await queryRunner.query(
|
|
106
|
+
`CREATE UNIQUE INDEX "IDX_ceph_resource_identity" ON "CephResource" ("projectId", "cephClusterId", "kind", "externalId")`,
|
|
107
|
+
);
|
|
108
|
+
await queryRunner.query(
|
|
109
|
+
`ALTER TABLE "CephResource" ADD CONSTRAINT "FK_ceph_resource_projectId" FOREIGN KEY ("projectId") REFERENCES "Project"("_id") ON DELETE CASCADE ON UPDATE NO ACTION`,
|
|
110
|
+
);
|
|
111
|
+
await queryRunner.query(
|
|
112
|
+
`ALTER TABLE "CephResource" ADD CONSTRAINT "FK_ceph_resource_cephClusterId" FOREIGN KEY ("cephClusterId") REFERENCES "CephCluster"("_id") ON DELETE CASCADE ON UPDATE NO ACTION`,
|
|
113
|
+
);
|
|
114
|
+
await queryRunner.query(
|
|
115
|
+
`ALTER TABLE "CephResource" ADD CONSTRAINT "FK_ceph_resource_createdByUserId" FOREIGN KEY ("createdByUserId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`,
|
|
116
|
+
);
|
|
117
|
+
await queryRunner.query(
|
|
118
|
+
`ALTER TABLE "CephResource" ADD CONSTRAINT "FK_ceph_resource_deletedByUserId" FOREIGN KEY ("deletedByUserId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`,
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
/*
|
|
122
|
+
* WI-17: optional Host -> ProxmoxCluster cross-link (guest VMs running
|
|
123
|
+
* the host agent). Mirrors Host.kubernetesClusterId: SET NULL, no index.
|
|
124
|
+
*/
|
|
125
|
+
await queryRunner.query(`ALTER TABLE "Host" ADD "proxmoxClusterId" uuid`);
|
|
126
|
+
await queryRunner.query(
|
|
127
|
+
`ALTER TABLE "Host" ADD CONSTRAINT "FK_host_proxmoxClusterId" FOREIGN KEY ("proxmoxClusterId") REFERENCES "ProxmoxCluster"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`,
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
132
|
+
// WI-17: Host cross-link.
|
|
133
|
+
await queryRunner.query(
|
|
134
|
+
`ALTER TABLE "Host" DROP CONSTRAINT "FK_host_proxmoxClusterId"`,
|
|
135
|
+
);
|
|
136
|
+
await queryRunner.query(
|
|
137
|
+
`ALTER TABLE "Host" DROP COLUMN "proxmoxClusterId"`,
|
|
138
|
+
);
|
|
139
|
+
|
|
140
|
+
// WI-6: Ceph resource inventory table.
|
|
141
|
+
await queryRunner.query(
|
|
142
|
+
`ALTER TABLE "CephResource" DROP CONSTRAINT "FK_ceph_resource_deletedByUserId"`,
|
|
143
|
+
);
|
|
144
|
+
await queryRunner.query(
|
|
145
|
+
`ALTER TABLE "CephResource" DROP CONSTRAINT "FK_ceph_resource_createdByUserId"`,
|
|
146
|
+
);
|
|
147
|
+
await queryRunner.query(
|
|
148
|
+
`ALTER TABLE "CephResource" DROP CONSTRAINT "FK_ceph_resource_cephClusterId"`,
|
|
149
|
+
);
|
|
150
|
+
await queryRunner.query(
|
|
151
|
+
`ALTER TABLE "CephResource" DROP CONSTRAINT "FK_ceph_resource_projectId"`,
|
|
152
|
+
);
|
|
153
|
+
await queryRunner.query(`DROP INDEX "public"."IDX_ceph_resource_identity"`);
|
|
154
|
+
await queryRunner.query(
|
|
155
|
+
`DROP INDEX "public"."IDX_ceph_resource_cephClusterId"`,
|
|
156
|
+
);
|
|
157
|
+
await queryRunner.query(
|
|
158
|
+
`DROP INDEX "public"."IDX_ceph_resource_projectId"`,
|
|
159
|
+
);
|
|
160
|
+
await queryRunner.query(`DROP TABLE "CephResource"`);
|
|
161
|
+
|
|
162
|
+
// WI-6: Proxmox resource inventory table.
|
|
163
|
+
await queryRunner.query(
|
|
164
|
+
`ALTER TABLE "ProxmoxResource" DROP CONSTRAINT "FK_proxmox_resource_deletedByUserId"`,
|
|
165
|
+
);
|
|
166
|
+
await queryRunner.query(
|
|
167
|
+
`ALTER TABLE "ProxmoxResource" DROP CONSTRAINT "FK_proxmox_resource_createdByUserId"`,
|
|
168
|
+
);
|
|
169
|
+
await queryRunner.query(
|
|
170
|
+
`ALTER TABLE "ProxmoxResource" DROP CONSTRAINT "FK_proxmox_resource_proxmoxClusterId"`,
|
|
171
|
+
);
|
|
172
|
+
await queryRunner.query(
|
|
173
|
+
`ALTER TABLE "ProxmoxResource" DROP CONSTRAINT "FK_proxmox_resource_projectId"`,
|
|
174
|
+
);
|
|
175
|
+
await queryRunner.query(
|
|
176
|
+
`DROP INDEX "public"."IDX_proxmox_resource_identity"`,
|
|
177
|
+
);
|
|
178
|
+
await queryRunner.query(
|
|
179
|
+
`DROP INDEX "public"."IDX_proxmox_resource_proxmoxClusterId"`,
|
|
180
|
+
);
|
|
181
|
+
await queryRunner.query(
|
|
182
|
+
`DROP INDEX "public"."IDX_proxmox_resource_projectId"`,
|
|
183
|
+
);
|
|
184
|
+
await queryRunner.query(`DROP TABLE "ProxmoxResource"`);
|
|
185
|
+
|
|
186
|
+
// WI-2: unique indexes.
|
|
187
|
+
await queryRunner.query(
|
|
188
|
+
`DROP INDEX "public"."IDX_ceph_cluster_projectId_name"`,
|
|
189
|
+
);
|
|
190
|
+
await queryRunner.query(
|
|
191
|
+
`DROP INDEX "public"."IDX_proxmox_cluster_projectId_name"`,
|
|
192
|
+
);
|
|
193
|
+
|
|
194
|
+
// WI-3: snapshot columns.
|
|
195
|
+
await queryRunner.query(
|
|
196
|
+
`ALTER TABLE "CephCluster" DROP COLUMN "capacityUsedPercent"`,
|
|
197
|
+
);
|
|
198
|
+
await queryRunner.query(
|
|
199
|
+
`ALTER TABLE "CephCluster" DROP COLUMN "healthStatus"`,
|
|
200
|
+
);
|
|
201
|
+
await queryRunner.query(
|
|
202
|
+
`ALTER TABLE "CephCluster" DROP COLUMN "osdInCount"`,
|
|
203
|
+
);
|
|
204
|
+
await queryRunner.query(
|
|
205
|
+
`ALTER TABLE "CephCluster" DROP COLUMN "osdUpCount"`,
|
|
206
|
+
);
|
|
207
|
+
await queryRunner.query(
|
|
208
|
+
`ALTER TABLE "ProxmoxCluster" DROP COLUMN "onlineNodeCount"`,
|
|
209
|
+
);
|
|
210
|
+
}
|
|
211
|
+
}
|