diff --git a/monitoring/google/cloud/monitoring/query.py b/monitoring/google/cloud/monitoring/query.py index 1653383b5000..a273a73a5f2e 100644 --- a/monitoring/google/cloud/monitoring/query.py +++ b/monitoring/google/cloud/monitoring/query.py @@ -163,7 +163,9 @@ def filter(self): def select_interval(self, end_time, start_time=None): """Copy the query and set the query time interval. - Example:: + Example: + + .. code-block:: python import datetime @@ -196,7 +198,9 @@ def select_interval(self, end_time, start_time=None): def select_group(self, group_id): """Copy the query and add filtering by group. - Example:: + Example: + + .. code-block:: python query = query.select_group('1234567') @@ -216,7 +220,9 @@ def select_projects(self, *args): This is only useful if the target project represents a Stackdriver account containing the specified monitored projects. - Examples:: + Examples: + + .. code-block:: python query = query.select_projects('project-1') query = query.select_projects('project-1', 'project-2') @@ -235,31 +241,43 @@ def select_projects(self, *args): def select_resources(self, *args, **kwargs): """Copy the query and add filtering by resource labels. - Examples:: + Examples: + + .. code-block:: python query = query.select_resources(zone='us-central1-a') query = query.select_resources(zone_prefix='europe-') query = query.select_resources(resource_type='gce_instance') A keyword argument ``