What are you passing under "id"?
You only pass id when editing existing silence (it must be an id of a valid 
active silence), not when creating a new one.

On Monday, 11 May 2020 14:46:47 UTC+1, TechJunkie wrote:
>
> Hie all ,
> I am struck trying to POST a python dictionary as json for creating 
> silence . The following is my data that i am posting to alertmanager 
> silences endpoint:
> data ={
>               "id": id,
>               "matchers": [
>                 {
>                   "name": matcherName,
>                   "value": matcherValue,
>                   "isRegex": matcherIsRegx
>                 }
>               ],
>               "startsAt": startsAt,
>               "endsAt": endsAt,
>               "createdBy": createdBy,
>               "comment": comment
>             }
> all the values are variables with datatypes as string except the isRegx 
> which is boolean .
> While posting it after creating a json using python requests library as :
> payload = json.dumps(data)
> I was getting error message as :
>
> "parsing silence body from \"\" failed, because json: cannot unmarshal string 
> into Go value of type struct { ID string \"json:\\\"id,omitempty\\\"\" }
>
> Please help. 
> Regards
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/4f889121-4695-4f77-ad0c-8432cd483bf2%40googlegroups.com.

Reply via email to