From 9af095d730e37205b007ba783ab5570d596bc68c Mon Sep 17 00:00:00 2001 From: Matheus Macabu Date: Mon, 7 Oct 2024 12:52:31 +0200 Subject: [PATCH] CloudMigrations: Add data types for alerts resources (#94251) --- pkg/services/cloudmigration/api/dtos.go | 13 +++++++++---- pkg/services/cloudmigration/model.go | 13 +++++++++---- public/api-merged.json | 7 ++++++- .../features/migrate-to-cloud/api/endpoints.gen.ts | 11 ++++++++++- .../features/migrate-to-cloud/onprem/NameCell.tsx | 10 ++++++++++ public/openapi3.json | 7 ++++++- 6 files changed, 50 insertions(+), 11 deletions(-) diff --git a/pkg/services/cloudmigration/api/dtos.go b/pkg/services/cloudmigration/api/dtos.go index 594acf41c54..0e49d253c57 100644 --- a/pkg/services/cloudmigration/api/dtos.go +++ b/pkg/services/cloudmigration/api/dtos.go @@ -121,10 +121,15 @@ type MigrateDataResponseItemDTO struct { type MigrateDataType string const ( - DashboardDataType MigrateDataType = "DASHBOARD" - DatasourceDataType MigrateDataType = "DATASOURCE" - FolderDataType MigrateDataType = "FOLDER" - LibraryElementDataType MigrateDataType = "LIBRARY_ELEMENT" + DashboardDataType MigrateDataType = "DASHBOARD" + DatasourceDataType MigrateDataType = "DATASOURCE" + FolderDataType MigrateDataType = "FOLDER" + LibraryElementDataType MigrateDataType = "LIBRARY_ELEMENT" + AlertRuleType MigrateDataType = "ALERT_RULE" + ContactPointType MigrateDataType = "CONTACT_POINT" + NotificationPolicyType MigrateDataType = "NOTIFICATION_POLICY" + NotificationTemplateType MigrateDataType = "NOTIFICATION_TEMPLATE" + MuteTimingType MigrateDataType = "MUTE_TIMING" ) // swagger:enum ItemStatus diff --git a/pkg/services/cloudmigration/model.go b/pkg/services/cloudmigration/model.go index 01697e9f80c..d097c777826 100644 --- a/pkg/services/cloudmigration/model.go +++ b/pkg/services/cloudmigration/model.go @@ -81,10 +81,15 @@ type CloudMigrationResource struct { type MigrateDataType string const ( - DashboardDataType MigrateDataType = "DASHBOARD" - DatasourceDataType MigrateDataType = "DATASOURCE" - FolderDataType MigrateDataType = "FOLDER" - LibraryElementDataType MigrateDataType = "LIBRARY_ELEMENT" + DashboardDataType MigrateDataType = "DASHBOARD" + DatasourceDataType MigrateDataType = "DATASOURCE" + FolderDataType MigrateDataType = "FOLDER" + LibraryElementDataType MigrateDataType = "LIBRARY_ELEMENT" + AlertRuleType MigrateDataType = "ALERT_RULE" + ContactPointType MigrateDataType = "CONTACT_POINT" + NotificationPolicyType MigrateDataType = "NOTIFICATION_POLICY" + NotificationTemplateType MigrateDataType = "NOTIFICATION_TEMPLATE" + MuteTimingType MigrateDataType = "MUTE_TIMING" ) type ItemStatus string diff --git a/public/api-merged.json b/public/api-merged.json index b57bd02ce3d..5f0131a9753 100644 --- a/public/api-merged.json +++ b/public/api-merged.json @@ -16931,7 +16931,12 @@ "DASHBOARD", "DATASOURCE", "FOLDER", - "LIBRARY_ELEMENT" + "LIBRARY_ELEMENT", + "ALERT_RULE", + "CONTACT_POINT", + "NOTIFICATION_POLICY", + "NOTIFICATION_TEMPLATE", + "MUTE_TIMING" ] } } diff --git a/public/app/features/migrate-to-cloud/api/endpoints.gen.ts b/public/app/features/migrate-to-cloud/api/endpoints.gen.ts index 5494d76674b..f5a589293e5 100644 --- a/public/app/features/migrate-to-cloud/api/endpoints.gen.ts +++ b/public/app/features/migrate-to-cloud/api/endpoints.gen.ts @@ -169,7 +169,16 @@ export type MigrateDataResponseItemDto = { parentName?: string; refId: string; status: 'OK' | 'WARNING' | 'ERROR' | 'PENDING' | 'UNKNOWN'; - type: 'DASHBOARD' | 'DATASOURCE' | 'FOLDER' | 'LIBRARY_ELEMENT'; + type: + | 'DASHBOARD' + | 'DATASOURCE' + | 'FOLDER' + | 'LIBRARY_ELEMENT' + | 'ALERT_RULE' + | 'CONTACT_POINT' + | 'NOTIFICATION_POLICY' + | 'NOTIFICATION_TEMPLATE' + | 'MUTE_TIMING'; }; export type SnapshotResourceStats = { statuses?: { diff --git a/public/app/features/migrate-to-cloud/onprem/NameCell.tsx b/public/app/features/migrate-to-cloud/onprem/NameCell.tsx index a796ebd917c..3b22052cf67 100644 --- a/public/app/features/migrate-to-cloud/onprem/NameCell.tsx +++ b/public/app/features/migrate-to-cloud/onprem/NameCell.tsx @@ -37,6 +37,16 @@ function ResourceInfo({ data }: { data: ResourceTableItem }) { return ; case 'LIBRARY_ELEMENT': return ; + case 'ALERT_RULE': + return null; + case 'CONTACT_POINT': + return null; + case 'NOTIFICATION_POLICY': + return null; + case 'NOTIFICATION_TEMPLATE': + return null; + case 'MUTE_TIMING': + return null; } } diff --git a/public/openapi3.json b/public/openapi3.json index 365f64a5b80..c39e38d30ef 100644 --- a/public/openapi3.json +++ b/public/openapi3.json @@ -7151,7 +7151,12 @@ "DASHBOARD", "DATASOURCE", "FOLDER", - "LIBRARY_ELEMENT" + "LIBRARY_ELEMENT", + "ALERT_RULE", + "CONTACT_POINT", + "NOTIFICATION_POLICY", + "NOTIFICATION_TEMPLATE", + "MUTE_TIMING" ], "type": "string" }