|
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 List, Optional |
5 | 6 |
|
6 | 7 | from scaleway_core.api import API |
|
24 | 25 | TokenScope, |
25 | 26 | Alert, |
26 | 27 | AlertManager, |
| 28 | + CockpitMetrics, |
27 | 29 | ContactPoint, |
28 | 30 | ContactPointEmail, |
29 | 31 | DataSource, |
|
64 | 66 | unmarshal_Plan, |
65 | 67 | unmarshal_Token, |
66 | 68 | unmarshal_AlertManager, |
| 69 | + unmarshal_CockpitMetrics, |
67 | 70 | unmarshal_GetConfigResponse, |
68 | 71 | unmarshal_Grafana, |
69 | 72 | unmarshal_ListContactPointsResponse, |
@@ -1575,3 +1578,40 @@ async def trigger_test_alert( |
1575 | 1578 | ) |
1576 | 1579 |
|
1577 | 1580 | self._throw_on_error(res) |
| 1581 | + |
| 1582 | + async def get_cockpit_metrics( |
| 1583 | + self, |
| 1584 | + *, |
| 1585 | + query: str, |
| 1586 | + project_id: Optional[str] = None, |
| 1587 | + start_date: Optional[datetime] = None, |
| 1588 | + end_date: Optional[datetime] = None, |
| 1589 | + ) -> CockpitMetrics: |
| 1590 | + """ |
| 1591 | + :param query: |
| 1592 | + :param project_id: |
| 1593 | + :param start_date: |
| 1594 | + :param end_date: |
| 1595 | + :return: :class:`CockpitMetrics <CockpitMetrics>` |
| 1596 | +
|
| 1597 | + Usage: |
| 1598 | + :: |
| 1599 | +
|
| 1600 | + result = await api.get_cockpit_metrics( |
| 1601 | + query="example", |
| 1602 | + ) |
| 1603 | + """ |
| 1604 | + |
| 1605 | + res = self._request( |
| 1606 | + "GET", |
| 1607 | + "/cockpit/v1beta1/cockpit/metrics", |
| 1608 | + params={ |
| 1609 | + "end_date": end_date, |
| 1610 | + "project_id": project_id or self.client.default_project_id, |
| 1611 | + "query": query, |
| 1612 | + "start_date": start_date, |
| 1613 | + }, |
| 1614 | + ) |
| 1615 | + |
| 1616 | + self._throw_on_error(res) |
| 1617 | + return unmarshal_CockpitMetrics(res.json()) |
0 commit comments