Skip to content

Conversation

@disha-148
Copy link
Collaborator

Export command for smart alerts

if (jsonFiles.length > 0) {
logger.error(`Cannot export: folder contains existing JSON files.`);
logger.info(`The export directory must not contain any JSON files in dashboards/, events/, or entities/ folders.`);
logger.info(`The export directory must not contain any JSON files in dashboards/, events/, or entities/ or smart-alerts/ folders.`);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it's better to reuse and expand the foldersToCheck here, so that you don't have to add these literally.

// Dashboard export
if (parsedIncludes.some(inc => inc.type === "dashboard" || inc.type === "all")) {
const allDashboards = await getDashboardList(server, token, axiosInstance);
const allDashboards = await fetchDashboard(server, token, axiosInstance);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better to name it as fetchDashboards? Same applies to fetchEvent, fetchEntity, and fetchSmartAlert.

Copy link
Collaborator

@morningspace morningspace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants