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/e7f14f9b-b1ce-4c13-b27c-f16b3f8d638b%40googlegroups.com.