1010
1111class MonitorGroup (Group ):
1212 """
13- Encapsulates Monitor-related methods of the :any:`LinodeClient`.
13+ Encapsulates Monitor-related methods of the :any:`LinodeClient`.
1414
1515 This group contains all features beneath the `/monitor` group in the API v4.
1616 """
@@ -36,12 +36,14 @@ def list_monitor_dashboards(self, *filters) -> list[MonitorDashboard]:
3636
3737 return self .client ._get_and_filter (MonitorDashboard , * filters )
3838
39- def list_dashboards_by_service (self , service_type : str , * filters ) -> list [MonitorDashboard ]:
39+ def list_dashboards_by_service (
40+ self , service_type : str , * filters
41+ ) -> list [MonitorDashboard ]:
4042 """
4143 Returns a list of dashboards for a particular service.
42-
44+
4345 dashboard_by_service = client.monitor_service.list_dashboards_by_service(service_type="dbaas")
44-
46+
4547 .. note:: This endpoint is in beta. This will only function if base_url is set to `https://api.linode.com/v4beta`.
4648
4749 API Documentation: https://techdocs.akamai.com/linode-api/reference/get-dashboards
@@ -67,7 +69,7 @@ def list_supported_services(self, *filters) -> list[MonitorService]:
6769 Returns a list of services supported by ACLP.
6870
6971 supported_services = client.monitor_service.list_supported_services()
70-
72+
7173 .. note:: This endpoint is in beta. This will only function if base_url is set to `https://api.linode.com/v4beta`.
7274
7375 API Documentation: https://techdocs.akamai.com/linode-api/reference/get-monitor-services
@@ -82,22 +84,24 @@ def list_supported_services(self, *filters) -> list[MonitorService]:
8284
8385 return self .client ._get_and_filter (MonitorService , * filters )
8486
85- def list_service_by_type (self , service_type : str , * filters ) -> list [MonitorService ]:
87+ def list_service_by_type (
88+ self , service_type : str , * filters
89+ ) -> list [MonitorService ]:
8690 """
8791 Lists monitor services by a given service_type
8892
8993 service_details = client.monitor_service.list_service_by_type(service_type="dbaas")
90-
94+
9195 .. note:: This endpoint is in beta. This will only function if base_url is set to `https://api.linode.com/v4beta`.
92-
96+
9397 API Documentation: https://techdocs.akamai.com/linode-api/reference/get-monitor-services-for-service-type
94-
98+
9599 :param service_type: The service type to get details for.
96100 :type service_type: str
97101 :param filters: Any number of filters to apply to this query.
98102 See :doc:`Filtering Collections</linode_api4/objects/filtering>`
99103 for more details on filtering.
100-
104+
101105 :returns: Lists monitor services by a given service_type
102106 :rtype: PaginatedList of the Services
103107 """
@@ -107,8 +111,9 @@ def list_service_by_type(self, service_type: str, *filters) -> list[MonitorServi
107111 endpoint = f"/monitor/services/{ service_type } " ,
108112 )
109113
110-
111- def list_metric_definitions (self , service_type : str , * filters ) -> list [MonitorMetricsDefinition ]:
114+ def list_metric_definitions (
115+ self , service_type : str , * filters
116+ ) -> list [MonitorMetricsDefinition ]:
112117 """
113118 Returns metrics for a specific service type.
114119
@@ -132,15 +137,17 @@ def list_metric_definitions(self, service_type: str, *filters) -> list[MonitorMe
132137 endpoint = f"/monitor/services/{ service_type } /metric-definitions" ,
133138 )
134139
135- def create_token (self , service_type : str , entity_ids : list ) -> MonitorServiceToken :
140+ def create_token (
141+ self , service_type : str , entity_ids : list
142+ ) -> MonitorServiceToken :
136143 """
137144 Returns a JWE Token for a specific service type.
138145 token = client.monitor_service.create_token(service_type="dbaas", entity_ids=[1234])
139146
140147 .. note:: This endpoint is in beta. This will only function if base_url is set to `https://api.linode.com/v4beta`.
141148
142149 API Documentation: https://techdocs.akamai.com/linode-api/reference/post-get-token
143-
150+
144151 :param service_type: The service type to create token for.
145152 :type service_type: str
146153 :param entity_ids: The list of entity IDs for which the token is valid.
@@ -161,4 +168,3 @@ def create_token(self, service_type: str, entity_ids: list) -> MonitorServiceTok
161168 "Unexpected response when creating token!" , json = result
162169 )
163170 return MonitorServiceToken (token = result ["token" ])
164-
0 commit comments