From 41f2a26a617632d5563853df0b2bb31b7cc5b989 Mon Sep 17 00:00:00 2001 From: Shi Zhang Date: Thu, 21 May 2020 14:44:40 -0400 Subject: [PATCH] Give option to create a POST check. In the create call demo -- allow uncommenting of POST check code. This is a new feature and will help drive adoption. --- monitoring/api/v3/uptime-check-client/snippets.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/monitoring/api/v3/uptime-check-client/snippets.py b/monitoring/api/v3/uptime-check-client/snippets.py index 8298636ed7b..8ce12d8ed1d 100644 --- a/monitoring/api/v3/uptime-check-client/snippets.py +++ b/monitoring/api/v3/uptime-check-client/snippets.py @@ -31,6 +31,10 @@ def create_uptime_check_config(project_name, host_name=None, config.monitored_resource.labels.update( {'host': host_name or 'example.com'}) config.http_check.request_method = monitoring_v3.enums.UptimeCheckConfig.HttpCheck.RequestMethod.GET + # Uncomment if you want a POST check + # config.http_check.request_method = monitoring_v3.enums.UptimeCheckConfig.HttpCheck.RequestMethod.POST + # config.http_check.content_type = monitoring_v3.enums.UptimeCheckConfig.HttpCheck.ContentType.URL_ENCODED + # config.http_check.body = 'foo=bar' config.http_check.path = '/' config.http_check.port = 80 config.timeout.seconds = 10