1 year ago

#364868

test-img

Marc Carr

Stackdriver API to update a policy

I would like to update a stackdriver alert policy using the monitor api with gcloud. I'm getting an error for the condition. I'm basically trying to add a filter to get rid of /dev/loop.* devices. Any help would be very appreciated.

gcloud alpha monitoring policies update projects/projectnameID/alertPolicies/policynumberxxx/conditions/conditionnumberxxx \ --condition-filter='metric.type="agent.googleapis.com/disk/percent_used" AND resource.type="gce_instance"' metric.label."device"!=monitoring.regex.full_match "/dev/loop.*"

I can do this via the GUI but some legacy policies will only update via API calls.

google-cloud-stackdriver

0 Answers

Your Answer

Accepted video resources