Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions scaleway-async/scaleway_async/cockpit/v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
from .types import Token
from .types import Usage
from .types import AlertManager
from .types import CockpitMetrics
from .types import GetConfigResponse
from .types import GlobalApiCreateGrafanaUserRequest
from .types import GlobalApiDeleteGrafanaUserRequest
Expand Down Expand Up @@ -54,7 +53,6 @@
from .types import RegionalApiEnableAlertManagerRequest
from .types import RegionalApiEnableManagedAlertsRequest
from .types import RegionalApiGetAlertManagerRequest
from .types import RegionalApiGetCockpitMetricsRequest
from .types import RegionalApiGetConfigRequest
from .types import RegionalApiGetDataSourceRequest
from .types import RegionalApiGetTokenRequest
Expand Down Expand Up @@ -92,7 +90,6 @@
"Token",
"Usage",
"AlertManager",
"CockpitMetrics",
"GetConfigResponse",
"GlobalApiCreateGrafanaUserRequest",
"GlobalApiDeleteGrafanaUserRequest",
Expand Down Expand Up @@ -124,7 +121,6 @@
"RegionalApiEnableAlertManagerRequest",
"RegionalApiEnableManagedAlertsRequest",
"RegionalApiGetAlertManagerRequest",
"RegionalApiGetCockpitMetricsRequest",
"RegionalApiGetConfigRequest",
"RegionalApiGetDataSourceRequest",
"RegionalApiGetTokenRequest",
Expand Down
40 changes: 0 additions & 40 deletions scaleway-async/scaleway_async/cockpit/v1/api.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# This file was automatically generated. DO NOT EDIT.
# If you have any remark or suggestion do not hesitate to open an issue.

from datetime import datetime
from typing import List, Optional

from scaleway_core.api import API
Expand All @@ -25,7 +24,6 @@
TokenScope,
Alert,
AlertManager,
CockpitMetrics,
ContactPoint,
ContactPointEmail,
DataSource,
Expand Down Expand Up @@ -66,7 +64,6 @@
unmarshal_Plan,
unmarshal_Token,
unmarshal_AlertManager,
unmarshal_CockpitMetrics,
unmarshal_GetConfigResponse,
unmarshal_Grafana,
unmarshal_ListContactPointsResponse,
Expand Down Expand Up @@ -1578,40 +1575,3 @@ async def trigger_test_alert(
)

self._throw_on_error(res)

async def get_cockpit_metrics(
self,
*,
query: str,
project_id: Optional[str] = None,
start_date: Optional[datetime] = None,
end_date: Optional[datetime] = None,
) -> CockpitMetrics:
"""
:param query:
:param project_id:
:param start_date:
:param end_date:
:return: :class:`CockpitMetrics <CockpitMetrics>`
Usage:
::
result = await api.get_cockpit_metrics(
query="example",
)
"""

res = self._request(
"GET",
"/cockpit/v1beta1/cockpit/metrics",
params={
"end_date": end_date,
"project_id": project_id or self.client.default_project_id,
"query": query,
"start_date": start_date,
},
)

self._throw_on_error(res)
return unmarshal_CockpitMetrics(res.json())
21 changes: 0 additions & 21 deletions scaleway-async/scaleway_async/cockpit/v1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
from dateutil import parser

from scaleway_core.profile import ProfileDefaults
from scaleway_core.bridge import (
unmarshal_TimeSeries,
)
from scaleway_core.utils import (
OneOfPossibility,
resolve_one_of,
Expand All @@ -22,7 +19,6 @@
Plan,
Token,
AlertManager,
CockpitMetrics,
GetConfigResponseRetention,
GetConfigResponse,
Grafana,
Expand Down Expand Up @@ -335,23 +331,6 @@ def unmarshal_AlertManager(data: Any) -> AlertManager:
return AlertManager(**args)


def unmarshal_CockpitMetrics(data: Any) -> CockpitMetrics:
if not isinstance(data, dict):
raise TypeError(
"Unmarshalling the type 'CockpitMetrics' failed as data isn't a dictionary."
)

args: Dict[str, Any] = {}

field = data.get("timeseries", None)
if field is not None:
args["timeseries"] = (
[unmarshal_TimeSeries(v) for v in field] if field is not None else None
)

return CockpitMetrics(**args)


def unmarshal_GetConfigResponseRetention(data: Any) -> GetConfigResponseRetention:
if not isinstance(data, dict):
raise TypeError(
Expand Down
18 changes: 1 addition & 17 deletions scaleway-async/scaleway_async/cockpit/v1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

from scaleway_core.bridge import (
Region,
TimeSeries,
)
from scaleway_core.utils import (
StrEnumMeta,
Expand All @@ -19,6 +18,7 @@
class DataSourceOrigin(str, Enum, metaclass=StrEnumMeta):
UNKNOWN_ORIGIN = "unknown_origin"
SCALEWAY = "scaleway"
EXTERNAL = "external"
CUSTOM = "custom"

def __str__(self) -> str:
Expand Down Expand Up @@ -459,11 +459,6 @@ class AlertManager:
"""


@dataclass
class CockpitMetrics:
timeseries: List[TimeSeries]


@dataclass
class GetConfigResponse:
"""
Expand Down Expand Up @@ -1052,17 +1047,6 @@ class RegionalApiGetAlertManagerRequest:
"""


@dataclass
class RegionalApiGetCockpitMetricsRequest:
query: str

project_id: Optional[str]

start_date: Optional[datetime]

end_date: Optional[datetime]


@dataclass
class RegionalApiGetConfigRequest:
"""
Expand Down
4 changes: 0 additions & 4 deletions scaleway/scaleway/cockpit/v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
from .types import Token
from .types import Usage
from .types import AlertManager
from .types import CockpitMetrics
from .types import GetConfigResponse
from .types import GlobalApiCreateGrafanaUserRequest
from .types import GlobalApiDeleteGrafanaUserRequest
Expand Down Expand Up @@ -54,7 +53,6 @@
from .types import RegionalApiEnableAlertManagerRequest
from .types import RegionalApiEnableManagedAlertsRequest
from .types import RegionalApiGetAlertManagerRequest
from .types import RegionalApiGetCockpitMetricsRequest
from .types import RegionalApiGetConfigRequest
from .types import RegionalApiGetDataSourceRequest
from .types import RegionalApiGetTokenRequest
Expand Down Expand Up @@ -92,7 +90,6 @@
"Token",
"Usage",
"AlertManager",
"CockpitMetrics",
"GetConfigResponse",
"GlobalApiCreateGrafanaUserRequest",
"GlobalApiDeleteGrafanaUserRequest",
Expand Down Expand Up @@ -124,7 +121,6 @@
"RegionalApiEnableAlertManagerRequest",
"RegionalApiEnableManagedAlertsRequest",
"RegionalApiGetAlertManagerRequest",
"RegionalApiGetCockpitMetricsRequest",
"RegionalApiGetConfigRequest",
"RegionalApiGetDataSourceRequest",
"RegionalApiGetTokenRequest",
Expand Down
40 changes: 0 additions & 40 deletions scaleway/scaleway/cockpit/v1/api.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# This file was automatically generated. DO NOT EDIT.
# If you have any remark or suggestion do not hesitate to open an issue.

from datetime import datetime
from typing import List, Optional

from scaleway_core.api import API
Expand All @@ -25,7 +24,6 @@
TokenScope,
Alert,
AlertManager,
CockpitMetrics,
ContactPoint,
ContactPointEmail,
DataSource,
Expand Down Expand Up @@ -66,7 +64,6 @@
unmarshal_Plan,
unmarshal_Token,
unmarshal_AlertManager,
unmarshal_CockpitMetrics,
unmarshal_GetConfigResponse,
unmarshal_Grafana,
unmarshal_ListContactPointsResponse,
Expand Down Expand Up @@ -1578,40 +1575,3 @@ def trigger_test_alert(
)

self._throw_on_error(res)

def get_cockpit_metrics(
self,
*,
query: str,
project_id: Optional[str] = None,
start_date: Optional[datetime] = None,
end_date: Optional[datetime] = None,
) -> CockpitMetrics:
"""
:param query:
:param project_id:
:param start_date:
:param end_date:
:return: :class:`CockpitMetrics <CockpitMetrics>`

Usage:
::

result = api.get_cockpit_metrics(
query="example",
)
"""

res = self._request(
"GET",
"/cockpit/v1beta1/cockpit/metrics",
params={
"end_date": end_date,
"project_id": project_id or self.client.default_project_id,
"query": query,
"start_date": start_date,
},
)

self._throw_on_error(res)
return unmarshal_CockpitMetrics(res.json())
21 changes: 0 additions & 21 deletions scaleway/scaleway/cockpit/v1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
from dateutil import parser

from scaleway_core.profile import ProfileDefaults
from scaleway_core.bridge import (
unmarshal_TimeSeries,
)
from scaleway_core.utils import (
OneOfPossibility,
resolve_one_of,
Expand All @@ -22,7 +19,6 @@
Plan,
Token,
AlertManager,
CockpitMetrics,
GetConfigResponseRetention,
GetConfigResponse,
Grafana,
Expand Down Expand Up @@ -335,23 +331,6 @@ def unmarshal_AlertManager(data: Any) -> AlertManager:
return AlertManager(**args)


def unmarshal_CockpitMetrics(data: Any) -> CockpitMetrics:
if not isinstance(data, dict):
raise TypeError(
"Unmarshalling the type 'CockpitMetrics' failed as data isn't a dictionary."
)

args: Dict[str, Any] = {}

field = data.get("timeseries", None)
if field is not None:
args["timeseries"] = (
[unmarshal_TimeSeries(v) for v in field] if field is not None else None
)

return CockpitMetrics(**args)


def unmarshal_GetConfigResponseRetention(data: Any) -> GetConfigResponseRetention:
if not isinstance(data, dict):
raise TypeError(
Expand Down
18 changes: 1 addition & 17 deletions scaleway/scaleway/cockpit/v1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

from scaleway_core.bridge import (
Region,
TimeSeries,
)
from scaleway_core.utils import (
StrEnumMeta,
Expand All @@ -19,6 +18,7 @@
class DataSourceOrigin(str, Enum, metaclass=StrEnumMeta):
UNKNOWN_ORIGIN = "unknown_origin"
SCALEWAY = "scaleway"
EXTERNAL = "external"
CUSTOM = "custom"

def __str__(self) -> str:
Expand Down Expand Up @@ -459,11 +459,6 @@ class AlertManager:
"""


@dataclass
class CockpitMetrics:
timeseries: List[TimeSeries]


@dataclass
class GetConfigResponse:
"""
Expand Down Expand Up @@ -1052,17 +1047,6 @@ class RegionalApiGetAlertManagerRequest:
"""


@dataclass
class RegionalApiGetCockpitMetricsRequest:
query: str

project_id: Optional[str]

start_date: Optional[datetime]

end_date: Optional[datetime]


@dataclass
class RegionalApiGetConfigRequest:
"""
Expand Down