I'm trying to create an alert with Cloud Functions. I have the following test alert json directly inserted into my code:
alert_policy = {"conditions":[{"condition_absent":{"duration":900s,"filter":"metric.label.state=\"blocked\" AND metric.type=\"agent.googleapis.com/processes/count_by_state\" AND resource.type=\"gce_instance\""},"displayName":"Test_two"}],"displayName":"test","combiner":"OR"}
I'm not able to make my function work because of the duration value. I've tried to pass as a string, an interger, a string with s and I always have an error:
TypeError: Parameter to MergeFrom() must be instance of same class: expected google.protobuf.Duration got str. or TypeError: Parameter to MergeFrom() must be instance of same class: expected google.protobuf.Duration got int.
How should I pass this value?