|
1 | 1 | # This file was automatically generated. DO NOT EDIT. |
2 | 2 | # If you have any remark or suggestion do not hesitate to open an issue. |
3 | 3 |
|
| 4 | +from datetime import datetime |
4 | 5 | from typing import Awaitable, List, Optional, Union |
5 | 6 |
|
6 | 7 | from scaleway_core.api import API |
|
16 | 17 | ListGrafanaUsersRequestOrderBy, |
17 | 18 | ListTokensRequestOrderBy, |
18 | 19 | Cockpit, |
| 20 | + CockpitMetrics, |
19 | 21 | ContactPoint, |
20 | 22 | GrafanaUser, |
21 | 23 | ListContactPointsResponse, |
|
56 | 58 | unmarshal_GrafanaUser, |
57 | 59 | unmarshal_Token, |
58 | 60 | unmarshal_Cockpit, |
| 61 | + unmarshal_CockpitMetrics, |
59 | 62 | unmarshal_ListContactPointsResponse, |
60 | 63 | unmarshal_ListGrafanaUsersResponse, |
61 | 64 | unmarshal_ListTokensResponse, |
@@ -161,6 +164,43 @@ async def wait_for_cockpit( |
161 | 164 | }, |
162 | 165 | ) |
163 | 166 |
|
| 167 | + async def get_cockpit_metrics( |
| 168 | + self, |
| 169 | + *, |
| 170 | + project_id: Optional[str] = None, |
| 171 | + start_date: Optional[datetime] = None, |
| 172 | + end_date: Optional[datetime] = None, |
| 173 | + metric_name: Optional[str] = None, |
| 174 | + ) -> CockpitMetrics: |
| 175 | + """ |
| 176 | + Get cockpit metrics. |
| 177 | + Get the cockpit metrics with the given project ID. |
| 178 | + :param project_id: Project ID. |
| 179 | + :param start_date: Start date. |
| 180 | + :param end_date: End date. |
| 181 | + :param metric_name: Metric name. |
| 182 | + :return: :class:`CockpitMetrics <CockpitMetrics>` |
| 183 | +
|
| 184 | + Usage: |
| 185 | + :: |
| 186 | +
|
| 187 | + result = await api.get_cockpit_metrics() |
| 188 | + """ |
| 189 | + |
| 190 | + res = self._request( |
| 191 | + "GET", |
| 192 | + f"/cockpit/v1beta1/cockpit/metrics", |
| 193 | + params={ |
| 194 | + "end_date": end_date, |
| 195 | + "metric_name": metric_name, |
| 196 | + "project_id": project_id or self.client.default_project_id, |
| 197 | + "start_date": start_date, |
| 198 | + }, |
| 199 | + ) |
| 200 | + |
| 201 | + self._throw_on_error(res) |
| 202 | + return unmarshal_CockpitMetrics(res.json()) |
| 203 | + |
164 | 204 | async def deactivate_cockpit( |
165 | 205 | self, |
166 | 206 | *, |
|
0 commit comments