Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question]: How to export AlertNotificationPolicy using Grafana foundation sdk? #541

Open
sondrekip opened this issue Dec 18, 2024 · 2 comments · May be fixed by #566
Open

[Question]: How to export AlertNotificationPolicy using Grafana foundation sdk? #541

sondrekip opened this issue Dec 18, 2024 · 2 comments · May be fixed by #566

Comments

@sondrekip
Copy link

I use grafana foundation sdk with typescript and I want to use grizzly to export to yaml via json. However, when calling grr export -k AlertNotificationPolicy policy.json, grizzly returns the error GetSpecUID not implemented for notification policies. The same error is returned when calling grr apply.

The function is defined here:

func (h *AlertNotificationPolicyHandler) GetSpecUID(resource grizzly.Resource) (string, error) {
return "", fmt.Errorf("GetSpecUID not implemented for notification policies")
}

It seems GetSpecUID() returns the uid field for AlertContactPoint and the name field for AlertRuleGroup resources. How can I export/deploy an AlertNotificationPolicy resource without triggering the GetSpecUID error?

@malcolmholmes
Copy link
Collaborator

IIUC, we can only have one AlertNotificationPolicy. Perhaps, therefoer, the GetSpecUID function was not implemented. Simply returning a fixed spec UID - the same thing every time, would, I believe, work around this scenario.

@sondrekip sondrekip linked a pull request Jan 17, 2025 that will close this issue
@sondrekip
Copy link
Author

IIUC, we can only have one AlertNotificationPolicy. Perhaps, therefoer, the GetSpecUID function was not implemented. Simply returning a fixed spec UID - the same thing every time, would, I believe, work around this scenario.

I have created a pull request based on your suggestion: #566
I hope this is close to what you had in mind.

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 a pull request may close this issue.

2 participants