Hi there,
I'm trying to manage the alertmanager via api.
With a few tests, I can get the list of alerts but can't post a new silence back.
Below is the format of an active silence.
{'data': [{'comment': 'under maintenance.',
'createdBy': 'ops',
'endsAt': '2018-02-07T00:26:58.889Z',
'id': '6c1a7f99-f914-47f6-bcf7-dea31d212aa2',
'matchers': [{'isRegex': False, 'name': 'job', 'value': 'snmp-apac'}],
'startsAt': '2018-01-24T00:27:44.298491798Z',
'status': {'state': 'active'},
'updatedAt': '2018-01-24T00:27:44.298498851Z'}],
'status': 'success'}I followed the above format and post one back but the HTTP response.ok = false.
Below is the format of the silence I post back.
{'data': [{'comment': 'test to silence by api',
'createdBy': 'ops',
'endsAt': '2018-01-25T23:59:59',
'matchers': [{'isRegex': 'False',
'name': 'job',
'value': 'snmp-singapore'}],
'startsAt': '2018-01-25T00:00:00',
'status': {'state': 'active'}}],
'status': 'success'}The API documentation isn't available and the API is subject to change since last year but there isn't any update yet.
Is there anyone able to set silence by api? Can you please comment how you set it?
Thanks,
Steven