I'm trying to create an incident using the the StatusPage API. I'm getting the error:
{"error":"incident[components] is invalid"}
I'm attaching my script below but the crucial part is the payload which looks like this:
data = {
"incident[name]": "test",
"incident[impact_override]": "critical",
"incident[status]": "investigating",
"incident[body]": "test",
"incident[component_ids]": ["xxx"],
"incident[components]": {"xxx": "degraded_performance"}
}
No matter what I do or what I try, it won't work.
Found the answer here.
To change a component status the payload should look like this:
data = {
"incident[name]": "test",
"incident[impact_override]": "critical",
"incident[status]": "investigating",
"incident[body]": "test",
"incident[component_ids]": ["xxxx"],
# list your components here one by one with their status
"incident[components][xxxx]": "degraded_performance",
"incident[components][xxxx]": "degraded_performance"
}
Thanks so much for sharing your solution with the community, Nivi! 🎉
Your willingness to post what worked not only helps others find answers faster, but also makes our community stronger. We appreciate you taking the time to give back and keep the momentum going.
Regards,
Aditya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.