CloudMigrations: Add data types for alerts resources (#94251)

This commit is contained in:
Matheus Macabu 2024-10-07 12:52:31 +02:00 committed by GitHub
parent d88be2819d
commit 9af095d730
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 50 additions and 11 deletions

View File

@ -121,10 +121,15 @@ type MigrateDataResponseItemDTO struct {
type MigrateDataType string type MigrateDataType string
const ( const (
DashboardDataType MigrateDataType = "DASHBOARD" DashboardDataType MigrateDataType = "DASHBOARD"
DatasourceDataType MigrateDataType = "DATASOURCE" DatasourceDataType MigrateDataType = "DATASOURCE"
FolderDataType MigrateDataType = "FOLDER" FolderDataType MigrateDataType = "FOLDER"
LibraryElementDataType MigrateDataType = "LIBRARY_ELEMENT" 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 // swagger:enum ItemStatus

View File

@ -81,10 +81,15 @@ type CloudMigrationResource struct {
type MigrateDataType string type MigrateDataType string
const ( const (
DashboardDataType MigrateDataType = "DASHBOARD" DashboardDataType MigrateDataType = "DASHBOARD"
DatasourceDataType MigrateDataType = "DATASOURCE" DatasourceDataType MigrateDataType = "DATASOURCE"
FolderDataType MigrateDataType = "FOLDER" FolderDataType MigrateDataType = "FOLDER"
LibraryElementDataType MigrateDataType = "LIBRARY_ELEMENT" 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 type ItemStatus string

View File

@ -16931,7 +16931,12 @@
"DASHBOARD", "DASHBOARD",
"DATASOURCE", "DATASOURCE",
"FOLDER", "FOLDER",
"LIBRARY_ELEMENT" "LIBRARY_ELEMENT",
"ALERT_RULE",
"CONTACT_POINT",
"NOTIFICATION_POLICY",
"NOTIFICATION_TEMPLATE",
"MUTE_TIMING"
] ]
} }
} }

View File

@ -169,7 +169,16 @@ export type MigrateDataResponseItemDto = {
parentName?: string; parentName?: string;
refId: string; refId: string;
status: 'OK' | 'WARNING' | 'ERROR' | 'PENDING' | 'UNKNOWN'; 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 = { export type SnapshotResourceStats = {
statuses?: { statuses?: {

View File

@ -37,6 +37,16 @@ function ResourceInfo({ data }: { data: ResourceTableItem }) {
return <FolderInfo data={data} />; return <FolderInfo data={data} />;
case 'LIBRARY_ELEMENT': case 'LIBRARY_ELEMENT':
return <LibraryElementInfo data={data} />; return <LibraryElementInfo data={data} />;
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;
} }
} }

View File

@ -7151,7 +7151,12 @@
"DASHBOARD", "DASHBOARD",
"DATASOURCE", "DATASOURCE",
"FOLDER", "FOLDER",
"LIBRARY_ELEMENT" "LIBRARY_ELEMENT",
"ALERT_RULE",
"CONTACT_POINT",
"NOTIFICATION_POLICY",
"NOTIFICATION_TEMPLATE",
"MUTE_TIMING"
], ],
"type": "string" "type": "string"
} }