In the documentation, it is shown how to define an array. But if I am not mistaken, in order to define the new status of a new incident I would need to use a map and I don't figure out how to do this.
From the documentation, how to define an array (components):
<span>// JSON</span>
<span>{</span>
<span>"incident"</span><span>:</span> <span>{</span>
<span>"name"</span><span>:</span> <span>"test incident"</span><span>,</span>
<span>"components"</span><span>:</span> <span>[</span><span>"8kbf7d35c070"</span><span>,</span> <span>"vtnh60py4yd7"</span><span>]</span>
<span>}</span>
<span>}</span>
<span>// Form Encoded (using curl as an example):</span>
curl <span>-</span>X POST https<span>:</span><span>/</span><span>/</span>api<span>.</span>statuspage<span>.</span>io<span>/</span>v1<span>/</span>example \
<span>-</span>d <span>"incident[name]=test incident"</span> \
<span>-</span>d <span>"incident[components][]=8kbf7d35c070"</span> \
<span>-</span>d <span>"incident[components][]=vtnh60py4yd7"</span>
To create an incident and set the new status, I should define these (among others; name, etc):
- components: Map of status changes to apply to affected components
- component_id: Map of status changes to apply to affected components ("operational" "under_maintenance" "degraded_performance" "partial_outage" "major_outage" "")
- component_ids: Array of strings. List of component_ids affected by this incident
Belo, my unsuccessful tries below:
-d "incident[component_ids][]=yxrqcr0kc3hx" \
-d "incident[components][component_id][]={'yxrqcr0kc3hx' : 'major_outage'}"
-d "incident[component_ids][]=yxrqcr0kc3hx" \
-d "incident[components][component_id][yxrqcr0kc3hx]=major_outage"
-d "incident[component_ids][]=yxrqcr0kc3hx" \
-d "incident[components][component_id]['yxrqcr0kc3hx']=major_outage"
Please, any help will be welcome.
Thanks