From 7d8f71ef6f16df57d37d16124cebe660a73c68f8 Mon Sep 17 00:00:00 2001 From: nuonbot Date: Thu, 30 Jul 2026 17:02:01 +0000 Subject: [PATCH] ci: generate from api 0.19.1093 --- .../get_install_component_health_checks.py | 212 +++++++++++++++ .../get_install_component_health_incident.py | 215 +++++++++++++++ .../get_install_component_health_timeline.py | 232 ++++++++++++++++ .../installs/get_install_health_timeline.py | 222 ++++++++++++++++ nuon/api/installs/get_installs_health.py | 225 ++++++++++++++++ .../put_install_component_health_check.py | 250 ++++++++++++++++++ .../installs/reset_install_health_baseline.py | 197 ++++++++++++++ nuon/models/__init__.py | 30 +++ .../models/app_component_config_connection.py | 73 +++++ nuon/models/app_component_health_probe.py | 90 +++++++ nuon/models/app_install.py | 39 +++ nuon/models/app_install_component.py | 37 ++- .../app_install_component_health_statuses.py | 47 ++++ .../app_install_component_resource_state.py | 26 +- ...ervice_component_health_incident_bundle.py | 124 +++++++++ ...ce_create_helm_component_config_request.py | 72 +++++ ...netes_manifest_component_config_request.py | 72 +++++ nuon/models/service_daily_health_bucket.py | 106 ++++++++ nuon/models/service_health_probe_request.py | 99 +++++++ .../service_health_transition_response.py | 133 ++++++++++ ...ervice_install_component_health_summary.py | 98 +++++++ ...tall_component_health_timeline_response.py | 147 ++++++++++ nuon/models/service_install_health_summary.py | 115 ++++++++ ...ervice_install_health_timeline_response.py | 147 ++++++++++ .../service_installs_health_response.py | 142 ++++++++++ ..._install_component_health_check_request.py | 108 ++++++++ ..._component_health_check_request_details.py | 47 ++++ ..._reset_install_health_baseline_response.py | 61 +++++ pyproject.toml | 2 +- version.txt | 2 +- 30 files changed, 3362 insertions(+), 8 deletions(-) create mode 100644 nuon/api/installs/get_install_component_health_checks.py create mode 100644 nuon/api/installs/get_install_component_health_incident.py create mode 100644 nuon/api/installs/get_install_component_health_timeline.py create mode 100644 nuon/api/installs/get_install_health_timeline.py create mode 100644 nuon/api/installs/get_installs_health.py create mode 100644 nuon/api/installs/put_install_component_health_check.py create mode 100644 nuon/api/installs/reset_install_health_baseline.py create mode 100644 nuon/models/app_component_health_probe.py create mode 100644 nuon/models/app_install_component_health_statuses.py create mode 100644 nuon/models/service_component_health_incident_bundle.py create mode 100644 nuon/models/service_daily_health_bucket.py create mode 100644 nuon/models/service_health_probe_request.py create mode 100644 nuon/models/service_health_transition_response.py create mode 100644 nuon/models/service_install_component_health_summary.py create mode 100644 nuon/models/service_install_component_health_timeline_response.py create mode 100644 nuon/models/service_install_health_summary.py create mode 100644 nuon/models/service_install_health_timeline_response.py create mode 100644 nuon/models/service_installs_health_response.py create mode 100644 nuon/models/service_put_install_component_health_check_request.py create mode 100644 nuon/models/service_put_install_component_health_check_request_details.py create mode 100644 nuon/models/service_reset_install_health_baseline_response.py diff --git a/nuon/api/installs/get_install_component_health_checks.py b/nuon/api/installs/get_install_component_health_checks.py new file mode 100644 index 00000000..c47c1b43 --- /dev/null +++ b/nuon/api/installs/get_install_component_health_checks.py @@ -0,0 +1,212 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.app_install_component_resource_state import AppInstallComponentResourceState +from ...models.stderr_err_response import StderrErrResponse +from ...types import Response + + +def _get_kwargs( + install_id: str, + component_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/installs/{install_id}/components/{component_id}/health/checks".format( + install_id=quote(str(install_id), safe=""), + component_id=quote(str(component_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> StderrErrResponse | list[AppInstallComponentResourceState] | None: + if response.status_code == 200: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = AppInstallComponentResourceState.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + + if response.status_code == 400: + response_400 = StderrErrResponse.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = StderrErrResponse.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = StderrErrResponse.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = StderrErrResponse.from_dict(response.json()) + + return response_404 + + if response.status_code == 500: + response_500 = StderrErrResponse.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[StderrErrResponse | list[AppInstallComponentResourceState]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + install_id: str, + component_id: str, + *, + client: AuthenticatedClient, +) -> Response[StderrErrResponse | list[AppInstallComponentResourceState]]: + r"""list custom component health checks + + Returns the latest reported state of every custom health check for the component (provider + \"custom\"), keyed by check name. Requires the component-health feature. + + Args: + install_id (str): + component_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[StderrErrResponse | list[AppInstallComponentResourceState]] + """ + + kwargs = _get_kwargs( + install_id=install_id, + component_id=component_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + install_id: str, + component_id: str, + *, + client: AuthenticatedClient, +) -> StderrErrResponse | list[AppInstallComponentResourceState] | None: + r"""list custom component health checks + + Returns the latest reported state of every custom health check for the component (provider + \"custom\"), keyed by check name. Requires the component-health feature. + + Args: + install_id (str): + component_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + StderrErrResponse | list[AppInstallComponentResourceState] + """ + + return sync_detailed( + install_id=install_id, + component_id=component_id, + client=client, + ).parsed + + +async def asyncio_detailed( + install_id: str, + component_id: str, + *, + client: AuthenticatedClient, +) -> Response[StderrErrResponse | list[AppInstallComponentResourceState]]: + r"""list custom component health checks + + Returns the latest reported state of every custom health check for the component (provider + \"custom\"), keyed by check name. Requires the component-health feature. + + Args: + install_id (str): + component_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[StderrErrResponse | list[AppInstallComponentResourceState]] + """ + + kwargs = _get_kwargs( + install_id=install_id, + component_id=component_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + install_id: str, + component_id: str, + *, + client: AuthenticatedClient, +) -> StderrErrResponse | list[AppInstallComponentResourceState] | None: + r"""list custom component health checks + + Returns the latest reported state of every custom health check for the component (provider + \"custom\"), keyed by check name. Requires the component-health feature. + + Args: + install_id (str): + component_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + StderrErrResponse | list[AppInstallComponentResourceState] + """ + + return ( + await asyncio_detailed( + install_id=install_id, + component_id=component_id, + client=client, + ) + ).parsed diff --git a/nuon/api/installs/get_install_component_health_incident.py b/nuon/api/installs/get_install_component_health_incident.py new file mode 100644 index 00000000..7736f15b --- /dev/null +++ b/nuon/api/installs/get_install_component_health_incident.py @@ -0,0 +1,215 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.service_component_health_incident_bundle import ServiceComponentHealthIncidentBundle +from ...models.stderr_err_response import StderrErrResponse +from ...types import Response + + +def _get_kwargs( + install_id: str, + component_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/installs/{install_id}/components/{component_id}/health/incident".format( + install_id=quote(str(install_id), safe=""), + component_id=quote(str(component_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ServiceComponentHealthIncidentBundle | StderrErrResponse | None: + if response.status_code == 200: + response_200 = ServiceComponentHealthIncidentBundle.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = StderrErrResponse.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = StderrErrResponse.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = StderrErrResponse.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = StderrErrResponse.from_dict(response.json()) + + return response_404 + + if response.status_code == 500: + response_500 = StderrErrResponse.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ServiceComponentHealthIncidentBundle | StderrErrResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + install_id: str, + component_id: str, + *, + client: AuthenticatedClient, +) -> Response[ServiceComponentHealthIncidentBundle | StderrErrResponse]: + """component health incident bundle + + Returns the most recent degraded/unhealthy transition for the component (whether or not it has since + recovered) along with its diagnosis, correlated deploy, and the component's currently non-healthy + resources. Returns a null body when there's no incident in the retained history. Requires the + component-health feature. + + Args: + install_id (str): + component_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ServiceComponentHealthIncidentBundle | StderrErrResponse] + """ + + kwargs = _get_kwargs( + install_id=install_id, + component_id=component_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + install_id: str, + component_id: str, + *, + client: AuthenticatedClient, +) -> ServiceComponentHealthIncidentBundle | StderrErrResponse | None: + """component health incident bundle + + Returns the most recent degraded/unhealthy transition for the component (whether or not it has since + recovered) along with its diagnosis, correlated deploy, and the component's currently non-healthy + resources. Returns a null body when there's no incident in the retained history. Requires the + component-health feature. + + Args: + install_id (str): + component_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ServiceComponentHealthIncidentBundle | StderrErrResponse + """ + + return sync_detailed( + install_id=install_id, + component_id=component_id, + client=client, + ).parsed + + +async def asyncio_detailed( + install_id: str, + component_id: str, + *, + client: AuthenticatedClient, +) -> Response[ServiceComponentHealthIncidentBundle | StderrErrResponse]: + """component health incident bundle + + Returns the most recent degraded/unhealthy transition for the component (whether or not it has since + recovered) along with its diagnosis, correlated deploy, and the component's currently non-healthy + resources. Returns a null body when there's no incident in the retained history. Requires the + component-health feature. + + Args: + install_id (str): + component_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ServiceComponentHealthIncidentBundle | StderrErrResponse] + """ + + kwargs = _get_kwargs( + install_id=install_id, + component_id=component_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + install_id: str, + component_id: str, + *, + client: AuthenticatedClient, +) -> ServiceComponentHealthIncidentBundle | StderrErrResponse | None: + """component health incident bundle + + Returns the most recent degraded/unhealthy transition for the component (whether or not it has since + recovered) along with its diagnosis, correlated deploy, and the component's currently non-healthy + resources. Returns a null body when there's no incident in the retained history. Requires the + component-health feature. + + Args: + install_id (str): + component_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ServiceComponentHealthIncidentBundle | StderrErrResponse + """ + + return ( + await asyncio_detailed( + install_id=install_id, + component_id=component_id, + client=client, + ) + ).parsed diff --git a/nuon/api/installs/get_install_component_health_timeline.py b/nuon/api/installs/get_install_component_health_timeline.py new file mode 100644 index 00000000..cea495ef --- /dev/null +++ b/nuon/api/installs/get_install_component_health_timeline.py @@ -0,0 +1,232 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.service_install_component_health_timeline_response import ServiceInstallComponentHealthTimelineResponse +from ...models.stderr_err_response import StderrErrResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + install_id: str, + component_id: str, + *, + days: int | Unset = 90, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + params["days"] = days + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/installs/{install_id}/components/{component_id}/health/timeline".format( + install_id=quote(str(install_id), safe=""), + component_id=quote(str(component_id), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ServiceInstallComponentHealthTimelineResponse | StderrErrResponse | None: + if response.status_code == 200: + response_200 = ServiceInstallComponentHealthTimelineResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = StderrErrResponse.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = StderrErrResponse.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = StderrErrResponse.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = StderrErrResponse.from_dict(response.json()) + + return response_404 + + if response.status_code == 500: + response_500 = StderrErrResponse.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ServiceInstallComponentHealthTimelineResponse | StderrErrResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + install_id: str, + component_id: str, + *, + client: AuthenticatedClient, + days: int | Unset = 90, +) -> Response[ServiceInstallComponentHealthTimelineResponse | StderrErrResponse]: + """component health timeline + + Returns a component's health history over a window: recorded verdict transitions (newest first), + daily worst-verdict buckets covering every day in the window, and an uptime percentage that excludes + unknown time from both the numerator and denominator. Requires the component-health feature. + + Args: + install_id (str): + component_id (str): + days (int | Unset): Default: 90. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ServiceInstallComponentHealthTimelineResponse | StderrErrResponse] + """ + + kwargs = _get_kwargs( + install_id=install_id, + component_id=component_id, + days=days, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + install_id: str, + component_id: str, + *, + client: AuthenticatedClient, + days: int | Unset = 90, +) -> ServiceInstallComponentHealthTimelineResponse | StderrErrResponse | None: + """component health timeline + + Returns a component's health history over a window: recorded verdict transitions (newest first), + daily worst-verdict buckets covering every day in the window, and an uptime percentage that excludes + unknown time from both the numerator and denominator. Requires the component-health feature. + + Args: + install_id (str): + component_id (str): + days (int | Unset): Default: 90. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ServiceInstallComponentHealthTimelineResponse | StderrErrResponse + """ + + return sync_detailed( + install_id=install_id, + component_id=component_id, + client=client, + days=days, + ).parsed + + +async def asyncio_detailed( + install_id: str, + component_id: str, + *, + client: AuthenticatedClient, + days: int | Unset = 90, +) -> Response[ServiceInstallComponentHealthTimelineResponse | StderrErrResponse]: + """component health timeline + + Returns a component's health history over a window: recorded verdict transitions (newest first), + daily worst-verdict buckets covering every day in the window, and an uptime percentage that excludes + unknown time from both the numerator and denominator. Requires the component-health feature. + + Args: + install_id (str): + component_id (str): + days (int | Unset): Default: 90. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ServiceInstallComponentHealthTimelineResponse | StderrErrResponse] + """ + + kwargs = _get_kwargs( + install_id=install_id, + component_id=component_id, + days=days, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + install_id: str, + component_id: str, + *, + client: AuthenticatedClient, + days: int | Unset = 90, +) -> ServiceInstallComponentHealthTimelineResponse | StderrErrResponse | None: + """component health timeline + + Returns a component's health history over a window: recorded verdict transitions (newest first), + daily worst-verdict buckets covering every day in the window, and an uptime percentage that excludes + unknown time from both the numerator and denominator. Requires the component-health feature. + + Args: + install_id (str): + component_id (str): + days (int | Unset): Default: 90. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ServiceInstallComponentHealthTimelineResponse | StderrErrResponse + """ + + return ( + await asyncio_detailed( + install_id=install_id, + component_id=component_id, + client=client, + days=days, + ) + ).parsed diff --git a/nuon/api/installs/get_install_health_timeline.py b/nuon/api/installs/get_install_health_timeline.py new file mode 100644 index 00000000..2ffa39bb --- /dev/null +++ b/nuon/api/installs/get_install_health_timeline.py @@ -0,0 +1,222 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.service_install_health_timeline_response import ServiceInstallHealthTimelineResponse +from ...models.stderr_err_response import StderrErrResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + install_id: str, + *, + days: int | Unset = 90, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + params["days"] = days + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/installs/{install_id}/health/timeline".format( + install_id=quote(str(install_id), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ServiceInstallHealthTimelineResponse | StderrErrResponse | None: + if response.status_code == 200: + response_200 = ServiceInstallHealthTimelineResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = StderrErrResponse.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = StderrErrResponse.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = StderrErrResponse.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = StderrErrResponse.from_dict(response.json()) + + return response_404 + + if response.status_code == 500: + response_500 = StderrErrResponse.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ServiceInstallHealthTimelineResponse | StderrErrResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + install_id: str, + *, + client: AuthenticatedClient, + days: int | Unset = 90, +) -> Response[ServiceInstallHealthTimelineResponse | StderrErrResponse]: + """install health timeline + + Returns the install's health history aggregated across its components: uptime_percent and + observed_seconds are the worst component's, daily[].health is the worst verdict across components + for that day, and components lists each component's own current health and uptime. Requires the + component-health feature. + + Args: + install_id (str): + days (int | Unset): Default: 90. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ServiceInstallHealthTimelineResponse | StderrErrResponse] + """ + + kwargs = _get_kwargs( + install_id=install_id, + days=days, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + install_id: str, + *, + client: AuthenticatedClient, + days: int | Unset = 90, +) -> ServiceInstallHealthTimelineResponse | StderrErrResponse | None: + """install health timeline + + Returns the install's health history aggregated across its components: uptime_percent and + observed_seconds are the worst component's, daily[].health is the worst verdict across components + for that day, and components lists each component's own current health and uptime. Requires the + component-health feature. + + Args: + install_id (str): + days (int | Unset): Default: 90. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ServiceInstallHealthTimelineResponse | StderrErrResponse + """ + + return sync_detailed( + install_id=install_id, + client=client, + days=days, + ).parsed + + +async def asyncio_detailed( + install_id: str, + *, + client: AuthenticatedClient, + days: int | Unset = 90, +) -> Response[ServiceInstallHealthTimelineResponse | StderrErrResponse]: + """install health timeline + + Returns the install's health history aggregated across its components: uptime_percent and + observed_seconds are the worst component's, daily[].health is the worst verdict across components + for that day, and components lists each component's own current health and uptime. Requires the + component-health feature. + + Args: + install_id (str): + days (int | Unset): Default: 90. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ServiceInstallHealthTimelineResponse | StderrErrResponse] + """ + + kwargs = _get_kwargs( + install_id=install_id, + days=days, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + install_id: str, + *, + client: AuthenticatedClient, + days: int | Unset = 90, +) -> ServiceInstallHealthTimelineResponse | StderrErrResponse | None: + """install health timeline + + Returns the install's health history aggregated across its components: uptime_percent and + observed_seconds are the worst component's, daily[].health is the worst verdict across components + for that day, and components lists each component's own current health and uptime. Requires the + component-health feature. + + Args: + install_id (str): + days (int | Unset): Default: 90. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ServiceInstallHealthTimelineResponse | StderrErrResponse + """ + + return ( + await asyncio_detailed( + install_id=install_id, + client=client, + days=days, + ) + ).parsed diff --git a/nuon/api/installs/get_installs_health.py b/nuon/api/installs/get_installs_health.py new file mode 100644 index 00000000..8aab982b --- /dev/null +++ b/nuon/api/installs/get_installs_health.py @@ -0,0 +1,225 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.service_installs_health_response import ServiceInstallsHealthResponse +from ...models.stderr_err_response import StderrErrResponse +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + app_id: str | Unset = UNSET, + labels: str | Unset = UNSET, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + params["app_id"] = app_id + + params["labels"] = labels + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/installs/health", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ServiceInstallsHealthResponse | StderrErrResponse | None: + if response.status_code == 200: + response_200 = ServiceInstallsHealthResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = StderrErrResponse.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = StderrErrResponse.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = StderrErrResponse.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = StderrErrResponse.from_dict(response.json()) + + return response_404 + + if response.status_code == 500: + response_500 = StderrErrResponse.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ServiceInstallsHealthResponse | StderrErrResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + app_id: str | Unset = UNSET, + labels: str | Unset = UNSET, +) -> Response[ServiceInstallsHealthResponse | StderrErrResponse]: + """fleet health summary + + Returns the health rollup for every install the caller can see, optionally narrowed by app and by an + install label selector. This is the primitive a canary or bake-period rollout polls to decide + whether to continue: all_healthy is only true when every counted install is healthy, and installs + whose health has never been evaluated are counted separately in unset rather than treated as a pass. + Requires the component-health feature. + + Args: + app_id (str | Unset): + labels (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ServiceInstallsHealthResponse | StderrErrResponse] + """ + + kwargs = _get_kwargs( + app_id=app_id, + labels=labels, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + app_id: str | Unset = UNSET, + labels: str | Unset = UNSET, +) -> ServiceInstallsHealthResponse | StderrErrResponse | None: + """fleet health summary + + Returns the health rollup for every install the caller can see, optionally narrowed by app and by an + install label selector. This is the primitive a canary or bake-period rollout polls to decide + whether to continue: all_healthy is only true when every counted install is healthy, and installs + whose health has never been evaluated are counted separately in unset rather than treated as a pass. + Requires the component-health feature. + + Args: + app_id (str | Unset): + labels (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ServiceInstallsHealthResponse | StderrErrResponse + """ + + return sync_detailed( + client=client, + app_id=app_id, + labels=labels, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + app_id: str | Unset = UNSET, + labels: str | Unset = UNSET, +) -> Response[ServiceInstallsHealthResponse | StderrErrResponse]: + """fleet health summary + + Returns the health rollup for every install the caller can see, optionally narrowed by app and by an + install label selector. This is the primitive a canary or bake-period rollout polls to decide + whether to continue: all_healthy is only true when every counted install is healthy, and installs + whose health has never been evaluated are counted separately in unset rather than treated as a pass. + Requires the component-health feature. + + Args: + app_id (str | Unset): + labels (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ServiceInstallsHealthResponse | StderrErrResponse] + """ + + kwargs = _get_kwargs( + app_id=app_id, + labels=labels, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + app_id: str | Unset = UNSET, + labels: str | Unset = UNSET, +) -> ServiceInstallsHealthResponse | StderrErrResponse | None: + """fleet health summary + + Returns the health rollup for every install the caller can see, optionally narrowed by app and by an + install label selector. This is the primitive a canary or bake-period rollout polls to decide + whether to continue: all_healthy is only true when every counted install is healthy, and installs + whose health has never been evaluated are counted separately in unset rather than treated as a pass. + Requires the component-health feature. + + Args: + app_id (str | Unset): + labels (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ServiceInstallsHealthResponse | StderrErrResponse + """ + + return ( + await asyncio_detailed( + client=client, + app_id=app_id, + labels=labels, + ) + ).parsed diff --git a/nuon/api/installs/put_install_component_health_check.py b/nuon/api/installs/put_install_component_health_check.py new file mode 100644 index 00000000..81554b64 --- /dev/null +++ b/nuon/api/installs/put_install_component_health_check.py @@ -0,0 +1,250 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.app_install_component_resource_state import AppInstallComponentResourceState +from ...models.service_put_install_component_health_check_request import ServicePutInstallComponentHealthCheckRequest +from ...models.stderr_err_response import StderrErrResponse +from ...types import Response + + +def _get_kwargs( + install_id: str, + component_id: str, + check_name: str, + *, + body: ServicePutInstallComponentHealthCheckRequest, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/v1/installs/{install_id}/components/{component_id}/health/checks/{check_name}".format( + install_id=quote(str(install_id), safe=""), + component_id=quote(str(component_id), safe=""), + check_name=quote(str(check_name), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AppInstallComponentResourceState | StderrErrResponse | None: + if response.status_code == 200: + response_200 = AppInstallComponentResourceState.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = StderrErrResponse.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = StderrErrResponse.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = StderrErrResponse.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = StderrErrResponse.from_dict(response.json()) + + return response_404 + + if response.status_code == 500: + response_500 = StderrErrResponse.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AppInstallComponentResourceState | StderrErrResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + install_id: str, + component_id: str, + check_name: str, + *, + client: AuthenticatedClient, + body: ServicePutInstallComponentHealthCheckRequest, +) -> Response[AppInstallComponentResourceState | StderrErrResponse]: + r"""report a custom component health check + + Lets an external system (a vendor's CI, a Datadog monitor webhook, a custom action) report a named + health signal for a component. The report is written as a resource observation with provider + \"custom\", so it flows through the same live explorer, evaluator, alerting, and timeline as runner- + reported resources. Requires the component-health feature. + + Args: + install_id (str): + component_id (str): + check_name (str): + body (ServicePutInstallComponentHealthCheckRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AppInstallComponentResourceState | StderrErrResponse] + """ + + kwargs = _get_kwargs( + install_id=install_id, + component_id=component_id, + check_name=check_name, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + install_id: str, + component_id: str, + check_name: str, + *, + client: AuthenticatedClient, + body: ServicePutInstallComponentHealthCheckRequest, +) -> AppInstallComponentResourceState | StderrErrResponse | None: + r"""report a custom component health check + + Lets an external system (a vendor's CI, a Datadog monitor webhook, a custom action) report a named + health signal for a component. The report is written as a resource observation with provider + \"custom\", so it flows through the same live explorer, evaluator, alerting, and timeline as runner- + reported resources. Requires the component-health feature. + + Args: + install_id (str): + component_id (str): + check_name (str): + body (ServicePutInstallComponentHealthCheckRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AppInstallComponentResourceState | StderrErrResponse + """ + + return sync_detailed( + install_id=install_id, + component_id=component_id, + check_name=check_name, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + install_id: str, + component_id: str, + check_name: str, + *, + client: AuthenticatedClient, + body: ServicePutInstallComponentHealthCheckRequest, +) -> Response[AppInstallComponentResourceState | StderrErrResponse]: + r"""report a custom component health check + + Lets an external system (a vendor's CI, a Datadog monitor webhook, a custom action) report a named + health signal for a component. The report is written as a resource observation with provider + \"custom\", so it flows through the same live explorer, evaluator, alerting, and timeline as runner- + reported resources. Requires the component-health feature. + + Args: + install_id (str): + component_id (str): + check_name (str): + body (ServicePutInstallComponentHealthCheckRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AppInstallComponentResourceState | StderrErrResponse] + """ + + kwargs = _get_kwargs( + install_id=install_id, + component_id=component_id, + check_name=check_name, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + install_id: str, + component_id: str, + check_name: str, + *, + client: AuthenticatedClient, + body: ServicePutInstallComponentHealthCheckRequest, +) -> AppInstallComponentResourceState | StderrErrResponse | None: + r"""report a custom component health check + + Lets an external system (a vendor's CI, a Datadog monitor webhook, a custom action) report a named + health signal for a component. The report is written as a resource observation with provider + \"custom\", so it flows through the same live explorer, evaluator, alerting, and timeline as runner- + reported resources. Requires the component-health feature. + + Args: + install_id (str): + component_id (str): + check_name (str): + body (ServicePutInstallComponentHealthCheckRequest): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AppInstallComponentResourceState | StderrErrResponse + """ + + return ( + await asyncio_detailed( + install_id=install_id, + component_id=component_id, + check_name=check_name, + client=client, + body=body, + ) + ).parsed diff --git a/nuon/api/installs/reset_install_health_baseline.py b/nuon/api/installs/reset_install_health_baseline.py new file mode 100644 index 00000000..7c874c7b --- /dev/null +++ b/nuon/api/installs/reset_install_health_baseline.py @@ -0,0 +1,197 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.service_reset_install_health_baseline_response import ServiceResetInstallHealthBaselineResponse +from ...models.stderr_err_response import StderrErrResponse +from ...types import Response + + +def _get_kwargs( + install_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/installs/{install_id}/health/baseline".format( + install_id=quote(str(install_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ServiceResetInstallHealthBaselineResponse | StderrErrResponse | None: + if response.status_code == 200: + response_200 = ServiceResetInstallHealthBaselineResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = StderrErrResponse.from_dict(response.json()) + + return response_400 + + if response.status_code == 401: + response_401 = StderrErrResponse.from_dict(response.json()) + + return response_401 + + if response.status_code == 403: + response_403 = StderrErrResponse.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = StderrErrResponse.from_dict(response.json()) + + return response_404 + + if response.status_code == 500: + response_500 = StderrErrResponse.from_dict(response.json()) + + return response_500 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ServiceResetInstallHealthBaselineResponse | StderrErrResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + install_id: str, + *, + client: AuthenticatedClient, +) -> Response[ServiceResetInstallHealthBaselineResponse | StderrErrResponse]: + """reset the install's health window + + Sets the install's health baseline to now: uptime and the health timeline start counting from this + moment. Past observations stay recorded but no longer count toward uptime. Requires the component- + health feature. + + Args: + install_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ServiceResetInstallHealthBaselineResponse | StderrErrResponse] + """ + + kwargs = _get_kwargs( + install_id=install_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + install_id: str, + *, + client: AuthenticatedClient, +) -> ServiceResetInstallHealthBaselineResponse | StderrErrResponse | None: + """reset the install's health window + + Sets the install's health baseline to now: uptime and the health timeline start counting from this + moment. Past observations stay recorded but no longer count toward uptime. Requires the component- + health feature. + + Args: + install_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ServiceResetInstallHealthBaselineResponse | StderrErrResponse + """ + + return sync_detailed( + install_id=install_id, + client=client, + ).parsed + + +async def asyncio_detailed( + install_id: str, + *, + client: AuthenticatedClient, +) -> Response[ServiceResetInstallHealthBaselineResponse | StderrErrResponse]: + """reset the install's health window + + Sets the install's health baseline to now: uptime and the health timeline start counting from this + moment. Past observations stay recorded but no longer count toward uptime. Requires the component- + health feature. + + Args: + install_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ServiceResetInstallHealthBaselineResponse | StderrErrResponse] + """ + + kwargs = _get_kwargs( + install_id=install_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + install_id: str, + *, + client: AuthenticatedClient, +) -> ServiceResetInstallHealthBaselineResponse | StderrErrResponse | None: + """reset the install's health window + + Sets the install's health baseline to now: uptime and the health timeline start counting from this + moment. Past observations stay recorded but no longer count toward uptime. Requires the component- + health feature. + + Args: + install_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ServiceResetInstallHealthBaselineResponse | StderrErrResponse + """ + + return ( + await asyncio_detailed( + install_id=install_id, + client=client, + ) + ).parsed diff --git a/nuon/models/__init__.py b/nuon/models/__init__.py index f1405b0d..93674ac7 100644 --- a/nuon/models/__init__.py +++ b/nuon/models/__init__.py @@ -70,6 +70,7 @@ from .app_component_config_connection import AppComponentConfigConnection from .app_component_config_connection_operation_roles import AppComponentConfigConnectionOperationRoles from .app_component_diff_entry import AppComponentDiffEntry +from .app_component_health_probe import AppComponentHealthProbe from .app_component_links import AppComponentLinks from .app_component_release import AppComponentRelease from .app_component_release_step import AppComponentReleaseStep @@ -111,6 +112,7 @@ from .app_install_audit_log import AppInstallAuditLog from .app_install_cloud_platform_metadata import AppInstallCloudPlatformMetadata from .app_install_component import AppInstallComponent +from .app_install_component_health_statuses import AppInstallComponentHealthStatuses from .app_install_component_links import AppInstallComponentLinks from .app_install_component_resource_state import AppInstallComponentResourceState from .app_install_component_statuses import AppInstallComponentStatuses @@ -477,6 +479,7 @@ from .service_complete_your_stack_step_request import ServiceCompleteYourStackStepRequest from .service_complete_your_stack_step_request_app_type import ServiceCompleteYourStackStepRequestAppType from .service_component_children import ServiceComponentChildren +from .service_component_health_incident_bundle import ServiceComponentHealthIncidentBundle from .service_connected_github_vcs_action_workflow_config_request import ( ServiceConnectedGithubVCSActionWorkflowConfigRequest, ) @@ -617,6 +620,7 @@ from .service_current_org_webhook_response import ServiceCurrentOrgWebhookResponse from .service_current_org_webhook_response_interests import ServiceCurrentOrgWebhookResponseInterests from .service_current_org_webhook_response_match import ServiceCurrentOrgWebhookResponseMatch +from .service_daily_health_bucket import ServiceDailyHealthBucket from .service_deploy_install_components_request import ServiceDeployInstallComponentsRequest from .service_deprovision_install_request import ServiceDeprovisionInstallRequest from .service_deprovision_install_sandbox_request import ServiceDeprovisionInstallSandboxRequest @@ -627,11 +631,18 @@ from .service_gcp_gar_image_config_request import ServiceGcpGARImageConfigRequest from .service_get_install_url_response import ServiceGetInstallURLResponse from .service_graceful_shutdown_request import ServiceGracefulShutdownRequest +from .service_health_probe_request import ServiceHealthProbeRequest +from .service_health_transition_response import ServiceHealthTransitionResponse from .service_helm_repo_config_request import ServiceHelmRepoConfigRequest from .service_install_app_permissions_config_response import ServiceInstallAppPermissionsConfigResponse +from .service_install_component_health_summary import ServiceInstallComponentHealthSummary +from .service_install_component_health_timeline_response import ServiceInstallComponentHealthTimelineResponse from .service_install_group_request import ServiceInstallGroupRequest +from .service_install_health_summary import ServiceInstallHealthSummary +from .service_install_health_timeline_response import ServiceInstallHealthTimelineResponse from .service_install_permissions_role_status import ServiceInstallPermissionsRoleStatus from .service_install_phone_home_request import ServiceInstallPhoneHomeRequest +from .service_installs_health_response import ServiceInstallsHealthResponse from .service_kubernetes_sync_target import ServiceKubernetesSyncTarget from .service_kustomize_config_request import ServiceKustomizeConfigRequest from .service_latest_runner_heart_beats import ServiceLatestRunnerHeartBeats @@ -653,6 +664,10 @@ from .service_prune_tokens_response import ServicePruneTokensResponse from .service_public_git_vcs_action_workflow_config_request import ServicePublicGitVCSActionWorkflowConfigRequest from .service_public_git_vcs_config_request import ServicePublicGitVCSConfigRequest +from .service_put_install_component_health_check_request import ServicePutInstallComponentHealthCheckRequest +from .service_put_install_component_health_check_request_details import ( + ServicePutInstallComponentHealthCheckRequestDetails, +) from .service_readme import ServiceReadme from .service_remove_action_labels_request import ServiceRemoveActionLabelsRequest from .service_remove_component_labels_request import ServiceRemoveComponentLabelsRequest @@ -661,6 +676,7 @@ from .service_reorder_cells_request import ServiceReorderCellsRequest from .service_reprovision_install_request import ServiceReprovisionInstallRequest from .service_reprovision_install_sandbox_request import ServiceReprovisionInstallSandboxRequest +from .service_reset_install_health_baseline_response import ServiceResetInstallHealthBaselineResponse from .service_retry_workflow_request import ServiceRetryWorkflowRequest from .service_retry_workflow_response import ServiceRetryWorkflowResponse from .service_retry_workflow_step_response import ServiceRetryWorkflowStepResponse @@ -837,6 +853,7 @@ "AppComponentConfigConnection", "AppComponentConfigConnectionOperationRoles", "AppComponentDiffEntry", + "AppComponentHealthProbe", "AppComponentLinks", "AppComponentRelease", "AppComponentReleaseStep", @@ -878,6 +895,7 @@ "AppInstallAuditLog", "AppInstallCloudPlatformMetadata", "AppInstallComponent", + "AppInstallComponentHealthStatuses", "AppInstallComponentLinks", "AppInstallComponentResourceState", "AppInstallComponentStatuses", @@ -1238,6 +1256,7 @@ "ServiceCompleteYourStackStepRequest", "ServiceCompleteYourStackStepRequestAppType", "ServiceComponentChildren", + "ServiceComponentHealthIncidentBundle", "ServiceConnectedGithubVCSActionWorkflowConfigRequest", "ServiceConnectedGithubVCSConfigRequest", "ServiceCreateActionWorkflowConfigRequest", @@ -1348,6 +1367,7 @@ "ServiceCurrentOrgWebhookResponse", "ServiceCurrentOrgWebhookResponseInterests", "ServiceCurrentOrgWebhookResponseMatch", + "ServiceDailyHealthBucket", "ServiceDeployInstallComponentsRequest", "ServiceDeprovisionInstallRequest", "ServiceDeprovisionInstallSandboxRequest", @@ -1358,11 +1378,18 @@ "ServiceGcpGARImageConfigRequest", "ServiceGetInstallURLResponse", "ServiceGracefulShutdownRequest", + "ServiceHealthProbeRequest", + "ServiceHealthTransitionResponse", "ServiceHelmRepoConfigRequest", "ServiceInstallAppPermissionsConfigResponse", + "ServiceInstallComponentHealthSummary", + "ServiceInstallComponentHealthTimelineResponse", "ServiceInstallGroupRequest", + "ServiceInstallHealthSummary", + "ServiceInstallHealthTimelineResponse", "ServiceInstallPermissionsRoleStatus", "ServiceInstallPhoneHomeRequest", + "ServiceInstallsHealthResponse", "ServiceKubernetesSyncTarget", "ServiceKustomizeConfigRequest", "ServiceLatestRunnerHeartBeats", @@ -1384,6 +1411,8 @@ "ServicePruneTokensResponse", "ServicePublicGitVCSActionWorkflowConfigRequest", "ServicePublicGitVCSConfigRequest", + "ServicePutInstallComponentHealthCheckRequest", + "ServicePutInstallComponentHealthCheckRequestDetails", "ServiceReadme", "ServiceRemoveActionLabelsRequest", "ServiceRemoveComponentLabelsRequest", @@ -1392,6 +1421,7 @@ "ServiceReorderCellsRequest", "ServiceReprovisionInstallRequest", "ServiceReprovisionInstallSandboxRequest", + "ServiceResetInstallHealthBaselineResponse", "ServiceRetryWorkflowRequest", "ServiceRetryWorkflowResponse", "ServiceRetryWorkflowStepResponse", diff --git a/nuon/models/app_component_config_connection.py b/nuon/models/app_component_config_connection.py index 96388b44..19a8b673 100644 --- a/nuon/models/app_component_config_connection.py +++ b/nuon/models/app_component_config_connection.py @@ -11,6 +11,7 @@ if TYPE_CHECKING: from ..models.app_component_config_connection_operation_roles import AppComponentConfigConnectionOperationRoles + from ..models.app_component_health_probe import AppComponentHealthProbe from ..models.app_docker_build_component_config import AppDockerBuildComponentConfig from ..models.app_external_image_component_config import AppExternalImageComponentConfig from ..models.app_helm_component_config import AppHelmComponentConfig @@ -43,6 +44,11 @@ class AppComponentConfigConnection: docker_build (AppDockerBuildComponentConfig | Unset): drift_schedule (str | Unset): external_image (AppExternalImageComponentConfig | Unset): + health_block_deploy (bool | None | Unset): + health_enabled (bool | None | Unset): + health_probes (list[AppComponentHealthProbe] | Unset): + health_stabilization_window (str | Unset): Duration string for how long health must hold after a deploy applies + (e.g., "3m"). Max 1h. helm (AppHelmComponentConfig | Unset): id (str | Unset): job (AppJobComponentConfig | Unset): @@ -81,6 +87,10 @@ class AppComponentConfigConnection: docker_build: AppDockerBuildComponentConfig | Unset = UNSET drift_schedule: str | Unset = UNSET external_image: AppExternalImageComponentConfig | Unset = UNSET + health_block_deploy: bool | None | Unset = UNSET + health_enabled: bool | None | Unset = UNSET + health_probes: list[AppComponentHealthProbe] | Unset = UNSET + health_stabilization_window: str | Unset = UNSET helm: AppHelmComponentConfig | Unset = UNSET id: str | Unset = UNSET job: AppJobComponentConfig | Unset = UNSET @@ -137,6 +147,27 @@ def to_dict(self) -> dict[str, Any]: if not isinstance(self.external_image, Unset): external_image = self.external_image.to_dict() + health_block_deploy: bool | None | Unset + if isinstance(self.health_block_deploy, Unset): + health_block_deploy = UNSET + else: + health_block_deploy = self.health_block_deploy + + health_enabled: bool | None | Unset + if isinstance(self.health_enabled, Unset): + health_enabled = UNSET + else: + health_enabled = self.health_enabled + + health_probes: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.health_probes, Unset): + health_probes = [] + for health_probes_item_data in self.health_probes: + health_probes_item = health_probes_item_data.to_dict() + health_probes.append(health_probes_item) + + health_stabilization_window = self.health_stabilization_window + helm: dict[str, Any] | Unset = UNSET if not isinstance(self.helm, Unset): helm = self.helm.to_dict() @@ -225,6 +256,14 @@ def to_dict(self) -> dict[str, Any]: field_dict["drift_schedule"] = drift_schedule if external_image is not UNSET: field_dict["external_image"] = external_image + if health_block_deploy is not UNSET: + field_dict["health_block_deploy"] = health_block_deploy + if health_enabled is not UNSET: + field_dict["health_enabled"] = health_enabled + if health_probes is not UNSET: + field_dict["health_probes"] = health_probes + if health_stabilization_window is not UNSET: + field_dict["health_stabilization_window"] = health_stabilization_window if helm is not UNSET: field_dict["helm"] = helm if id is not UNSET: @@ -265,6 +304,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.app_component_config_connection_operation_roles import AppComponentConfigConnectionOperationRoles + from ..models.app_component_health_probe import AppComponentHealthProbe from ..models.app_docker_build_component_config import AppDockerBuildComponentConfig from ..models.app_external_image_component_config import AppExternalImageComponentConfig from ..models.app_helm_component_config import AppHelmComponentConfig @@ -315,6 +355,35 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: else: external_image = AppExternalImageComponentConfig.from_dict(_external_image) + def _parse_health_block_deploy(data: object) -> bool | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(bool | None | Unset, data) + + health_block_deploy = _parse_health_block_deploy(d.pop("health_block_deploy", UNSET)) + + def _parse_health_enabled(data: object) -> bool | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(bool | None | Unset, data) + + health_enabled = _parse_health_enabled(d.pop("health_enabled", UNSET)) + + _health_probes = d.pop("health_probes", UNSET) + health_probes: list[AppComponentHealthProbe] | Unset = UNSET + if _health_probes is not UNSET: + health_probes = [] + for health_probes_item_data in _health_probes: + health_probes_item = AppComponentHealthProbe.from_dict(health_probes_item_data) + + health_probes.append(health_probes_item) + + health_stabilization_window = d.pop("health_stabilization_window", UNSET) + _helm = d.pop("helm", UNSET) helm: AppHelmComponentConfig | Unset if isinstance(_helm, Unset): @@ -407,6 +476,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: docker_build=docker_build, drift_schedule=drift_schedule, external_image=external_image, + health_block_deploy=health_block_deploy, + health_enabled=health_enabled, + health_probes=health_probes, + health_stabilization_window=health_stabilization_window, helm=helm, id=id, job=job, diff --git a/nuon/models/app_component_health_probe.py b/nuon/models/app_component_health_probe.py new file mode 100644 index 00000000..2ca6a88a --- /dev/null +++ b/nuon/models/app_component_health_probe.py @@ -0,0 +1,90 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="AppComponentHealthProbe") + + +@_attrs_define +class AppComponentHealthProbe: + """ + Attributes: + command (list[str] | Unset): + name (str | Unset): + type_ (str | Unset): + url (str | Unset): + """ + + command: list[str] | Unset = UNSET + name: str | Unset = UNSET + type_: str | Unset = UNSET + url: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + command: list[str] | Unset = UNSET + if not isinstance(self.command, Unset): + command = self.command + + name = self.name + + type_ = self.type_ + + url = self.url + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if command is not UNSET: + field_dict["command"] = command + if name is not UNSET: + field_dict["name"] = name + if type_ is not UNSET: + field_dict["type"] = type_ + if url is not UNSET: + field_dict["url"] = url + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + command = cast(list[str], d.pop("command", UNSET)) + + name = d.pop("name", UNSET) + + type_ = d.pop("type", UNSET) + + url = d.pop("url", UNSET) + + app_component_health_probe = cls( + command=command, + name=name, + type_=type_, + url=url, + ) + + app_component_health_probe.additional_properties = d + return app_component_health_probe + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/nuon/models/app_install.py b/nuon/models/app_install.py index 2dd04d89..eacb6511 100644 --- a/nuon/models/app_install.py +++ b/nuon/models/app_install.py @@ -20,6 +20,7 @@ from ..models.app_install_app_branch_connection import AppInstallAppBranchConnection from ..models.app_install_cloud_platform_metadata import AppInstallCloudPlatformMetadata from ..models.app_install_component import AppInstallComponent + from ..models.app_install_component_health_statuses import AppInstallComponentHealthStatuses from ..models.app_install_component_statuses import AppInstallComponentStatuses from ..models.app_install_config import AppInstallConfig from ..models.app_install_event import AppInstallEvent @@ -58,9 +59,15 @@ class AppInstall: cloud_platform_metadata (AppInstallCloudPlatformMetadata | Unset): CloudPlatformMetadata records the cloud account this install is expected to run in, and what it was observed running in. See the type for the trust model. + component_health_statuses (AppInstallComponentHealthStatuses | Unset): component_statuses (AppInstallComponentStatuses | Unset): composite_component_status (str | Unset): composite_component_status_description (str | Unset): + composite_health_status (str | Unset): CompositeHealthStatus is the live-health rollup of the install's + components — a parallel axis to CompositeComponentStatus (deploy + lifecycle), never merged with it. Empty until the component-health + evaluator has produced verdicts. + composite_health_status_description (str | Unset): created_at (str | Unset): created_by_id (str | Unset): drifted_objects (list[AppDriftedObject] | Unset): @@ -118,9 +125,12 @@ class AppInstall: azure_account: AppAzureAccount | Unset = UNSET cloud_platform: str | Unset = UNSET cloud_platform_metadata: AppInstallCloudPlatformMetadata | Unset = UNSET + component_health_statuses: AppInstallComponentHealthStatuses | Unset = UNSET component_statuses: AppInstallComponentStatuses | Unset = UNSET composite_component_status: str | Unset = UNSET composite_component_status_description: str | Unset = UNSET + composite_health_status: str | Unset = UNSET + composite_health_status_description: str | Unset = UNSET created_at: str | Unset = UNSET created_by_id: str | Unset = UNSET drifted_objects: list[AppDriftedObject] | Unset = UNSET @@ -200,6 +210,10 @@ def to_dict(self) -> dict[str, Any]: if not isinstance(self.cloud_platform_metadata, Unset): cloud_platform_metadata = self.cloud_platform_metadata.to_dict() + component_health_statuses: dict[str, Any] | Unset = UNSET + if not isinstance(self.component_health_statuses, Unset): + component_health_statuses = self.component_health_statuses.to_dict() + component_statuses: dict[str, Any] | Unset = UNSET if not isinstance(self.component_statuses, Unset): component_statuses = self.component_statuses.to_dict() @@ -208,6 +222,10 @@ def to_dict(self) -> dict[str, Any]: composite_component_status_description = self.composite_component_status_description + composite_health_status = self.composite_health_status + + composite_health_status_description = self.composite_health_status_description + created_at = self.created_at created_by_id = self.created_by_id @@ -375,12 +393,18 @@ def to_dict(self) -> dict[str, Any]: field_dict["cloud_platform"] = cloud_platform if cloud_platform_metadata is not UNSET: field_dict["cloud_platform_metadata"] = cloud_platform_metadata + if component_health_statuses is not UNSET: + field_dict["component_health_statuses"] = component_health_statuses if component_statuses is not UNSET: field_dict["component_statuses"] = component_statuses if composite_component_status is not UNSET: field_dict["composite_component_status"] = composite_component_status if composite_component_status_description is not UNSET: field_dict["composite_component_status_description"] = composite_component_status_description + if composite_health_status is not UNSET: + field_dict["composite_health_status"] = composite_health_status + if composite_health_status_description is not UNSET: + field_dict["composite_health_status_description"] = composite_health_status_description if created_at is not UNSET: field_dict["created_at"] = created_at if created_by_id is not UNSET: @@ -471,6 +495,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.app_install_app_branch_connection import AppInstallAppBranchConnection from ..models.app_install_cloud_platform_metadata import AppInstallCloudPlatformMetadata from ..models.app_install_component import AppInstallComponent + from ..models.app_install_component_health_statuses import AppInstallComponentHealthStatuses from ..models.app_install_component_statuses import AppInstallComponentStatuses from ..models.app_install_config import AppInstallConfig from ..models.app_install_event import AppInstallEvent @@ -548,6 +573,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: else: cloud_platform_metadata = AppInstallCloudPlatformMetadata.from_dict(_cloud_platform_metadata) + _component_health_statuses = d.pop("component_health_statuses", UNSET) + component_health_statuses: AppInstallComponentHealthStatuses | Unset + if isinstance(_component_health_statuses, Unset): + component_health_statuses = UNSET + else: + component_health_statuses = AppInstallComponentHealthStatuses.from_dict(_component_health_statuses) + _component_statuses = d.pop("component_statuses", UNSET) component_statuses: AppInstallComponentStatuses | Unset if isinstance(_component_statuses, Unset): @@ -559,6 +591,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: composite_component_status_description = d.pop("composite_component_status_description", UNSET) + composite_health_status = d.pop("composite_health_status", UNSET) + + composite_health_status_description = d.pop("composite_health_status_description", UNSET) + created_at = d.pop("created_at", UNSET) created_by_id = d.pop("created_by_id", UNSET) @@ -760,9 +796,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: azure_account=azure_account, cloud_platform=cloud_platform, cloud_platform_metadata=cloud_platform_metadata, + component_health_statuses=component_health_statuses, component_statuses=component_statuses, composite_component_status=composite_component_status, composite_component_status_description=composite_component_status_description, + composite_health_status=composite_health_status, + composite_health_status_description=composite_health_status_description, created_at=created_at, created_by_id=created_by_id, drifted_objects=drifted_objects, diff --git a/nuon/models/app_install_component.py b/nuon/models/app_install_component.py index 513c2d97..df216d64 100644 --- a/nuon/models/app_install_component.py +++ b/nuon/models/app_install_component.py @@ -31,8 +31,10 @@ class AppInstallComponent: created_by_id (str | Unset): drifted_object (AppDriftedObject | Unset): enabled (bool | None | Unset): Enabled is the resolved enabled/disabled state for a toggleable component - on this install (from the synthetic enabled install input, falling back to - the component's default_enabled). It is nil for non-toggleable components. + (from the synthetic enabled input, falling back to default_enabled); nil otherwise. + health_status (str | Unset): + health_status_description (str | Unset): + health_status_v2 (AppCompositeStatus | Unset): helm_chart (AppHelmChart | Unset): id (str | Unset): install_deploys (list[AppInstallDeploy] | Unset): @@ -51,6 +53,9 @@ class AppInstallComponent: created_by_id: str | Unset = UNSET drifted_object: AppDriftedObject | Unset = UNSET enabled: bool | None | Unset = UNSET + health_status: str | Unset = UNSET + health_status_description: str | Unset = UNSET + health_status_v2: AppCompositeStatus | Unset = UNSET helm_chart: AppHelmChart | Unset = UNSET id: str | Unset = UNSET install_deploys: list[AppInstallDeploy] | Unset = UNSET @@ -84,6 +89,14 @@ def to_dict(self) -> dict[str, Any]: else: enabled = self.enabled + health_status = self.health_status + + health_status_description = self.health_status_description + + health_status_v2: dict[str, Any] | Unset = UNSET + if not isinstance(self.health_status_v2, Unset): + health_status_v2 = self.health_status_v2.to_dict() + helm_chart: dict[str, Any] | Unset = UNSET if not isinstance(self.helm_chart, Unset): helm_chart = self.helm_chart.to_dict() @@ -132,6 +145,12 @@ def to_dict(self) -> dict[str, Any]: field_dict["drifted_object"] = drifted_object if enabled is not UNSET: field_dict["enabled"] = enabled + if health_status is not UNSET: + field_dict["health_status"] = health_status + if health_status_description is not UNSET: + field_dict["health_status_description"] = health_status_description + if health_status_v2 is not UNSET: + field_dict["health_status_v2"] = health_status_v2 if helm_chart is not UNSET: field_dict["helm_chart"] = helm_chart if id is not UNSET: @@ -195,6 +214,17 @@ def _parse_enabled(data: object) -> bool | None | Unset: enabled = _parse_enabled(d.pop("enabled", UNSET)) + health_status = d.pop("health_status", UNSET) + + health_status_description = d.pop("health_status_description", UNSET) + + _health_status_v2 = d.pop("health_status_v2", UNSET) + health_status_v2: AppCompositeStatus | Unset + if isinstance(_health_status_v2, Unset): + health_status_v2 = UNSET + else: + health_status_v2 = AppCompositeStatus.from_dict(_health_status_v2) + _helm_chart = d.pop("helm_chart", UNSET) helm_chart: AppHelmChart | Unset if isinstance(_helm_chart, Unset): @@ -249,6 +279,9 @@ def _parse_enabled(data: object) -> bool | None | Unset: created_by_id=created_by_id, drifted_object=drifted_object, enabled=enabled, + health_status=health_status, + health_status_description=health_status_description, + health_status_v2=health_status_v2, helm_chart=helm_chart, id=id, install_deploys=install_deploys, diff --git a/nuon/models/app_install_component_health_statuses.py b/nuon/models/app_install_component_health_statuses.py new file mode 100644 index 00000000..a0212f0a --- /dev/null +++ b/nuon/models/app_install_component_health_statuses.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="AppInstallComponentHealthStatuses") + + +@_attrs_define +class AppInstallComponentHealthStatuses: + """ """ + + additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + app_install_component_health_statuses = cls() + + app_install_component_health_statuses.additional_properties = d + return app_install_component_health_statuses + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: str) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/nuon/models/app_install_component_resource_state.py b/nuon/models/app_install_component_resource_state.py index 70bac5f7..e66c1ca9 100644 --- a/nuon/models/app_install_component_resource_state.py +++ b/nuon/models/app_install_component_resource_state.py @@ -30,11 +30,13 @@ class AppInstallComponentResourceState: org_id (str | Unset): owner_name (str | Unset): provider (str | Unset): + removed_from_config (bool | Unset): RemovedFromConfig is set at read time when a probe's name is no longer in + the component's config — still shown, but labelled so it can't pass as live. runner_id (str | Unset): - source (str | Unset): Source classifies the resource owner: "component" (an app component, - keyed by install_component_id) or "sandbox" (install base infra, keyed by - owner_name = helm release name). OwnerName is the display group for - sandbox resources. + source (str | Unset): Source classifies the resource owner: "component" (keyed by + install_component_id) or "sandbox" (keyed by owner_name = helm release name). + stale_after_seconds (int | Unset): StaleAfterSeconds is how long this observation stays trustworthy (0 = + default); a pushed check sets its own, since it knows its cadence best. """ api_group: str | Unset = UNSET @@ -52,8 +54,10 @@ class AppInstallComponentResourceState: org_id: str | Unset = UNSET owner_name: str | Unset = UNSET provider: str | Unset = UNSET + removed_from_config: bool | Unset = UNSET runner_id: str | Unset = UNSET source: str | Unset = UNSET + stale_after_seconds: int | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -87,10 +91,14 @@ def to_dict(self) -> dict[str, Any]: provider = self.provider + removed_from_config = self.removed_from_config + runner_id = self.runner_id source = self.source + stale_after_seconds = self.stale_after_seconds + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) @@ -124,10 +132,14 @@ def to_dict(self) -> dict[str, Any]: field_dict["owner_name"] = owner_name if provider is not UNSET: field_dict["provider"] = provider + if removed_from_config is not UNSET: + field_dict["removed_from_config"] = removed_from_config if runner_id is not UNSET: field_dict["runner_id"] = runner_id if source is not UNSET: field_dict["source"] = source + if stale_after_seconds is not UNSET: + field_dict["stale_after_seconds"] = stale_after_seconds return field_dict @@ -164,10 +176,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: provider = d.pop("provider", UNSET) + removed_from_config = d.pop("removed_from_config", UNSET) + runner_id = d.pop("runner_id", UNSET) source = d.pop("source", UNSET) + stale_after_seconds = d.pop("stale_after_seconds", UNSET) + app_install_component_resource_state = cls( api_group=api_group, component_id=component_id, @@ -184,8 +200,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: org_id=org_id, owner_name=owner_name, provider=provider, + removed_from_config=removed_from_config, runner_id=runner_id, source=source, + stale_after_seconds=stale_after_seconds, ) app_install_component_resource_state.additional_properties = d diff --git a/nuon/models/service_component_health_incident_bundle.py b/nuon/models/service_component_health_incident_bundle.py new file mode 100644 index 00000000..b3fa9f89 --- /dev/null +++ b/nuon/models/service_component_health_incident_bundle.py @@ -0,0 +1,124 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.app_install_component_resource_state import AppInstallComponentResourceState + from ..models.service_health_transition_response import ServiceHealthTransitionResponse + + +T = TypeVar("T", bound="ServiceComponentHealthIncidentBundle") + + +@_attrs_define +class ServiceComponentHealthIncidentBundle: + """ + Attributes: + current_health (str | Unset): + install_component_id (str | Unset): + resolved (bool | Unset): + resources (list[AppInstallComponentResourceState] | Unset): + transition (ServiceHealthTransitionResponse | Unset): + """ + + current_health: str | Unset = UNSET + install_component_id: str | Unset = UNSET + resolved: bool | Unset = UNSET + resources: list[AppInstallComponentResourceState] | Unset = UNSET + transition: ServiceHealthTransitionResponse | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + current_health = self.current_health + + install_component_id = self.install_component_id + + resolved = self.resolved + + resources: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.resources, Unset): + resources = [] + for resources_item_data in self.resources: + resources_item = resources_item_data.to_dict() + resources.append(resources_item) + + transition: dict[str, Any] | Unset = UNSET + if not isinstance(self.transition, Unset): + transition = self.transition.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if current_health is not UNSET: + field_dict["current_health"] = current_health + if install_component_id is not UNSET: + field_dict["install_component_id"] = install_component_id + if resolved is not UNSET: + field_dict["resolved"] = resolved + if resources is not UNSET: + field_dict["resources"] = resources + if transition is not UNSET: + field_dict["transition"] = transition + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.app_install_component_resource_state import AppInstallComponentResourceState + from ..models.service_health_transition_response import ServiceHealthTransitionResponse + + d = dict(src_dict) + current_health = d.pop("current_health", UNSET) + + install_component_id = d.pop("install_component_id", UNSET) + + resolved = d.pop("resolved", UNSET) + + _resources = d.pop("resources", UNSET) + resources: list[AppInstallComponentResourceState] | Unset = UNSET + if _resources is not UNSET: + resources = [] + for resources_item_data in _resources: + resources_item = AppInstallComponentResourceState.from_dict(resources_item_data) + + resources.append(resources_item) + + _transition = d.pop("transition", UNSET) + transition: ServiceHealthTransitionResponse | Unset + if isinstance(_transition, Unset): + transition = UNSET + else: + transition = ServiceHealthTransitionResponse.from_dict(_transition) + + service_component_health_incident_bundle = cls( + current_health=current_health, + install_component_id=install_component_id, + resolved=resolved, + resources=resources, + transition=transition, + ) + + service_component_health_incident_bundle.additional_properties = d + return service_component_health_incident_bundle + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/nuon/models/service_create_helm_component_config_request.py b/nuon/models/service_create_helm_component_config_request.py index d46f118a..349f97e0 100644 --- a/nuon/models/service_create_helm_component_config_request.py +++ b/nuon/models/service_create_helm_component_config_request.py @@ -16,6 +16,7 @@ from ..models.service_create_helm_component_config_request_values import ( ServiceCreateHelmComponentConfigRequestValues, ) + from ..models.service_health_probe_request import ServiceHealthProbeRequest from ..models.service_helm_repo_config_request import ServiceHelmRepoConfigRequest from ..models.service_public_git_vcs_config_request import ServicePublicGitVCSConfigRequest @@ -38,6 +39,10 @@ class ServiceCreateHelmComponentConfigRequest: dependencies (list[str] | Unset): deploy_timeout (str | Unset): Duration string for deploy operations (e.g., "30m", "1h") drift_schedule (str | Unset): + health_block_deploy (bool | None | Unset): + health_enabled (bool | None | Unset): + health_probes (list[ServiceHealthProbeRequest] | Unset): + health_stabilization_window (str | Unset): Duration string for the health stabilization window (e.g., "3m") helm_repo_config (ServiceHelmRepoConfigRequest | Unset): kubernetes_context (str | Unset): max_auto_retries (int | Unset): @@ -64,6 +69,10 @@ class ServiceCreateHelmComponentConfigRequest: dependencies: list[str] | Unset = UNSET deploy_timeout: str | Unset = UNSET drift_schedule: str | Unset = UNSET + health_block_deploy: bool | None | Unset = UNSET + health_enabled: bool | None | Unset = UNSET + health_probes: list[ServiceHealthProbeRequest] | Unset = UNSET + health_stabilization_window: str | Unset = UNSET helm_repo_config: ServiceHelmRepoConfigRequest | Unset = UNSET kubernetes_context: str | Unset = UNSET max_auto_retries: int | Unset = UNSET @@ -106,6 +115,27 @@ def to_dict(self) -> dict[str, Any]: drift_schedule = self.drift_schedule + health_block_deploy: bool | None | Unset + if isinstance(self.health_block_deploy, Unset): + health_block_deploy = UNSET + else: + health_block_deploy = self.health_block_deploy + + health_enabled: bool | None | Unset + if isinstance(self.health_enabled, Unset): + health_enabled = UNSET + else: + health_enabled = self.health_enabled + + health_probes: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.health_probes, Unset): + health_probes = [] + for health_probes_item_data in self.health_probes: + health_probes_item = health_probes_item_data.to_dict() + health_probes.append(health_probes_item) + + health_stabilization_window = self.health_stabilization_window + helm_repo_config: dict[str, Any] | Unset = UNSET if not isinstance(self.helm_repo_config, Unset): helm_repo_config = self.helm_repo_config.to_dict() @@ -168,6 +198,14 @@ def to_dict(self) -> dict[str, Any]: field_dict["deploy_timeout"] = deploy_timeout if drift_schedule is not UNSET: field_dict["drift_schedule"] = drift_schedule + if health_block_deploy is not UNSET: + field_dict["health_block_deploy"] = health_block_deploy + if health_enabled is not UNSET: + field_dict["health_enabled"] = health_enabled + if health_probes is not UNSET: + field_dict["health_probes"] = health_probes + if health_stabilization_window is not UNSET: + field_dict["health_stabilization_window"] = health_stabilization_window if helm_repo_config is not UNSET: field_dict["helm_repo_config"] = helm_repo_config if kubernetes_context is not UNSET: @@ -206,6 +244,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.service_create_helm_component_config_request_values import ( ServiceCreateHelmComponentConfigRequestValues, ) + from ..models.service_health_probe_request import ServiceHealthProbeRequest from ..models.service_helm_repo_config_request import ServiceHelmRepoConfigRequest from ..models.service_public_git_vcs_config_request import ServicePublicGitVCSConfigRequest @@ -237,6 +276,35 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: drift_schedule = d.pop("drift_schedule", UNSET) + def _parse_health_block_deploy(data: object) -> bool | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(bool | None | Unset, data) + + health_block_deploy = _parse_health_block_deploy(d.pop("health_block_deploy", UNSET)) + + def _parse_health_enabled(data: object) -> bool | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(bool | None | Unset, data) + + health_enabled = _parse_health_enabled(d.pop("health_enabled", UNSET)) + + _health_probes = d.pop("health_probes", UNSET) + health_probes: list[ServiceHealthProbeRequest] | Unset = UNSET + if _health_probes is not UNSET: + health_probes = [] + for health_probes_item_data in _health_probes: + health_probes_item = ServiceHealthProbeRequest.from_dict(health_probes_item_data) + + health_probes.append(health_probes_item) + + health_stabilization_window = d.pop("health_stabilization_window", UNSET) + _helm_repo_config = d.pop("helm_repo_config", UNSET) helm_repo_config: ServiceHelmRepoConfigRequest | Unset if isinstance(_helm_repo_config, Unset): @@ -290,6 +358,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: dependencies=dependencies, deploy_timeout=deploy_timeout, drift_schedule=drift_schedule, + health_block_deploy=health_block_deploy, + health_enabled=health_enabled, + health_probes=health_probes, + health_stabilization_window=health_stabilization_window, helm_repo_config=helm_repo_config, kubernetes_context=kubernetes_context, max_auto_retries=max_auto_retries, diff --git a/nuon/models/service_create_kubernetes_manifest_component_config_request.py b/nuon/models/service_create_kubernetes_manifest_component_config_request.py index c456c969..860087f7 100644 --- a/nuon/models/service_create_kubernetes_manifest_component_config_request.py +++ b/nuon/models/service_create_kubernetes_manifest_component_config_request.py @@ -13,6 +13,7 @@ from ..models.service_create_kubernetes_manifest_component_config_request_operation_roles import ( ServiceCreateKubernetesManifestComponentConfigRequestOperationRoles, ) + from ..models.service_health_probe_request import ServiceHealthProbeRequest from ..models.service_kustomize_config_request import ServiceKustomizeConfigRequest from ..models.service_public_git_vcs_config_request import ServicePublicGitVCSConfigRequest @@ -33,6 +34,10 @@ class ServiceCreateKubernetesManifestComponentConfigRequest: dependencies (list[str] | Unset): deploy_timeout (str | Unset): Duration string for deploy operations (e.g., "30m", "1h") drift_schedule (str | Unset): + health_block_deploy (bool | None | Unset): + health_enabled (bool | None | Unset): + health_probes (list[ServiceHealthProbeRequest] | Unset): + health_stabilization_window (str | Unset): Duration string for the health stabilization window (e.g., "3m") kubernetes_context (str | Unset): kustomize (ServiceKustomizeConfigRequest | Unset): manifest (str | Unset): Inline manifest (mutually exclusive with Kustomize) @@ -54,6 +59,10 @@ class ServiceCreateKubernetesManifestComponentConfigRequest: dependencies: list[str] | Unset = UNSET deploy_timeout: str | Unset = UNSET drift_schedule: str | Unset = UNSET + health_block_deploy: bool | None | Unset = UNSET + health_enabled: bool | None | Unset = UNSET + health_probes: list[ServiceHealthProbeRequest] | Unset = UNSET + health_stabilization_window: str | Unset = UNSET kubernetes_context: str | Unset = UNSET kustomize: ServiceKustomizeConfigRequest | Unset = UNSET manifest: str | Unset = UNSET @@ -89,6 +98,27 @@ def to_dict(self) -> dict[str, Any]: drift_schedule = self.drift_schedule + health_block_deploy: bool | None | Unset + if isinstance(self.health_block_deploy, Unset): + health_block_deploy = UNSET + else: + health_block_deploy = self.health_block_deploy + + health_enabled: bool | None | Unset + if isinstance(self.health_enabled, Unset): + health_enabled = UNSET + else: + health_enabled = self.health_enabled + + health_probes: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.health_probes, Unset): + health_probes = [] + for health_probes_item_data in self.health_probes: + health_probes_item = health_probes_item_data.to_dict() + health_probes.append(health_probes_item) + + health_stabilization_window = self.health_stabilization_window + kubernetes_context = self.kubernetes_context kustomize: dict[str, Any] | Unset = UNSET @@ -138,6 +168,14 @@ def to_dict(self) -> dict[str, Any]: field_dict["deploy_timeout"] = deploy_timeout if drift_schedule is not UNSET: field_dict["drift_schedule"] = drift_schedule + if health_block_deploy is not UNSET: + field_dict["health_block_deploy"] = health_block_deploy + if health_enabled is not UNSET: + field_dict["health_enabled"] = health_enabled + if health_probes is not UNSET: + field_dict["health_probes"] = health_probes + if health_stabilization_window is not UNSET: + field_dict["health_stabilization_window"] = health_stabilization_window if kubernetes_context is not UNSET: field_dict["kubernetes_context"] = kubernetes_context if kustomize is not UNSET: @@ -167,6 +205,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.service_create_kubernetes_manifest_component_config_request_operation_roles import ( ServiceCreateKubernetesManifestComponentConfigRequestOperationRoles, ) + from ..models.service_health_probe_request import ServiceHealthProbeRequest from ..models.service_kustomize_config_request import ServiceKustomizeConfigRequest from ..models.service_public_git_vcs_config_request import ServicePublicGitVCSConfigRequest @@ -194,6 +233,35 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: drift_schedule = d.pop("drift_schedule", UNSET) + def _parse_health_block_deploy(data: object) -> bool | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(bool | None | Unset, data) + + health_block_deploy = _parse_health_block_deploy(d.pop("health_block_deploy", UNSET)) + + def _parse_health_enabled(data: object) -> bool | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(bool | None | Unset, data) + + health_enabled = _parse_health_enabled(d.pop("health_enabled", UNSET)) + + _health_probes = d.pop("health_probes", UNSET) + health_probes: list[ServiceHealthProbeRequest] | Unset = UNSET + if _health_probes is not UNSET: + health_probes = [] + for health_probes_item_data in _health_probes: + health_probes_item = ServiceHealthProbeRequest.from_dict(health_probes_item_data) + + health_probes.append(health_probes_item) + + health_stabilization_window = d.pop("health_stabilization_window", UNSET) + kubernetes_context = d.pop("kubernetes_context", UNSET) _kustomize = d.pop("kustomize", UNSET) @@ -241,6 +309,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: dependencies=dependencies, deploy_timeout=deploy_timeout, drift_schedule=drift_schedule, + health_block_deploy=health_block_deploy, + health_enabled=health_enabled, + health_probes=health_probes, + health_stabilization_window=health_stabilization_window, kubernetes_context=kubernetes_context, kustomize=kustomize, manifest=manifest, diff --git a/nuon/models/service_daily_health_bucket.py b/nuon/models/service_daily_health_bucket.py new file mode 100644 index 00000000..93d8a86f --- /dev/null +++ b/nuon/models/service_daily_health_bucket.py @@ -0,0 +1,106 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ServiceDailyHealthBucket") + + +@_attrs_define +class ServiceDailyHealthBucket: + """ + Attributes: + date (str | Unset): + degraded_seconds (int | Unset): + health (str | Unset): + observed_seconds (int | Unset): + unhealthy_seconds (int | Unset): + unknown_seconds (int | Unset): + """ + + date: str | Unset = UNSET + degraded_seconds: int | Unset = UNSET + health: str | Unset = UNSET + observed_seconds: int | Unset = UNSET + unhealthy_seconds: int | Unset = UNSET + unknown_seconds: int | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + date = self.date + + degraded_seconds = self.degraded_seconds + + health = self.health + + observed_seconds = self.observed_seconds + + unhealthy_seconds = self.unhealthy_seconds + + unknown_seconds = self.unknown_seconds + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if date is not UNSET: + field_dict["date"] = date + if degraded_seconds is not UNSET: + field_dict["degraded_seconds"] = degraded_seconds + if health is not UNSET: + field_dict["health"] = health + if observed_seconds is not UNSET: + field_dict["observed_seconds"] = observed_seconds + if unhealthy_seconds is not UNSET: + field_dict["unhealthy_seconds"] = unhealthy_seconds + if unknown_seconds is not UNSET: + field_dict["unknown_seconds"] = unknown_seconds + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + date = d.pop("date", UNSET) + + degraded_seconds = d.pop("degraded_seconds", UNSET) + + health = d.pop("health", UNSET) + + observed_seconds = d.pop("observed_seconds", UNSET) + + unhealthy_seconds = d.pop("unhealthy_seconds", UNSET) + + unknown_seconds = d.pop("unknown_seconds", UNSET) + + service_daily_health_bucket = cls( + date=date, + degraded_seconds=degraded_seconds, + health=health, + observed_seconds=observed_seconds, + unhealthy_seconds=unhealthy_seconds, + unknown_seconds=unknown_seconds, + ) + + service_daily_health_bucket.additional_properties = d + return service_daily_health_bucket + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/nuon/models/service_health_probe_request.py b/nuon/models/service_health_probe_request.py new file mode 100644 index 00000000..a3d86019 --- /dev/null +++ b/nuon/models/service_health_probe_request.py @@ -0,0 +1,99 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ServiceHealthProbeRequest") + + +@_attrs_define +class ServiceHealthProbeRequest: + """ + Attributes: + command (list[str] | Unset): + interval (str | Unset): + name (str | Unset): + type_ (str | Unset): + url (str | Unset): + """ + + command: list[str] | Unset = UNSET + interval: str | Unset = UNSET + name: str | Unset = UNSET + type_: str | Unset = UNSET + url: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + command: list[str] | Unset = UNSET + if not isinstance(self.command, Unset): + command = self.command + + interval = self.interval + + name = self.name + + type_ = self.type_ + + url = self.url + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if command is not UNSET: + field_dict["command"] = command + if interval is not UNSET: + field_dict["interval"] = interval + if name is not UNSET: + field_dict["name"] = name + if type_ is not UNSET: + field_dict["type"] = type_ + if url is not UNSET: + field_dict["url"] = url + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + command = cast(list[str], d.pop("command", UNSET)) + + interval = d.pop("interval", UNSET) + + name = d.pop("name", UNSET) + + type_ = d.pop("type", UNSET) + + url = d.pop("url", UNSET) + + service_health_probe_request = cls( + command=command, + interval=interval, + name=name, + type_=type_, + url=url, + ) + + service_health_probe_request.additional_properties = d + return service_health_probe_request + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/nuon/models/service_health_transition_response.py b/nuon/models/service_health_transition_response.py new file mode 100644 index 00000000..58f98e40 --- /dev/null +++ b/nuon/models/service_health_transition_response.py @@ -0,0 +1,133 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ServiceHealthTransitionResponse") + + +@_attrs_define +class ServiceHealthTransitionResponse: + """ + Attributes: + correlated_deploy_id (str | Unset): + diagnosis (str | Unset): + from_health (str | Unset): + message (str | Unset): + observed_at (str | Unset): + root_resource_kind (str | Unset): + root_resource_name (str | Unset): + root_resource_namespace (str | Unset): + to_health (str | Unset): + """ + + correlated_deploy_id: str | Unset = UNSET + diagnosis: str | Unset = UNSET + from_health: str | Unset = UNSET + message: str | Unset = UNSET + observed_at: str | Unset = UNSET + root_resource_kind: str | Unset = UNSET + root_resource_name: str | Unset = UNSET + root_resource_namespace: str | Unset = UNSET + to_health: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + correlated_deploy_id = self.correlated_deploy_id + + diagnosis = self.diagnosis + + from_health = self.from_health + + message = self.message + + observed_at = self.observed_at + + root_resource_kind = self.root_resource_kind + + root_resource_name = self.root_resource_name + + root_resource_namespace = self.root_resource_namespace + + to_health = self.to_health + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if correlated_deploy_id is not UNSET: + field_dict["correlated_deploy_id"] = correlated_deploy_id + if diagnosis is not UNSET: + field_dict["diagnosis"] = diagnosis + if from_health is not UNSET: + field_dict["from_health"] = from_health + if message is not UNSET: + field_dict["message"] = message + if observed_at is not UNSET: + field_dict["observed_at"] = observed_at + if root_resource_kind is not UNSET: + field_dict["root_resource_kind"] = root_resource_kind + if root_resource_name is not UNSET: + field_dict["root_resource_name"] = root_resource_name + if root_resource_namespace is not UNSET: + field_dict["root_resource_namespace"] = root_resource_namespace + if to_health is not UNSET: + field_dict["to_health"] = to_health + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + correlated_deploy_id = d.pop("correlated_deploy_id", UNSET) + + diagnosis = d.pop("diagnosis", UNSET) + + from_health = d.pop("from_health", UNSET) + + message = d.pop("message", UNSET) + + observed_at = d.pop("observed_at", UNSET) + + root_resource_kind = d.pop("root_resource_kind", UNSET) + + root_resource_name = d.pop("root_resource_name", UNSET) + + root_resource_namespace = d.pop("root_resource_namespace", UNSET) + + to_health = d.pop("to_health", UNSET) + + service_health_transition_response = cls( + correlated_deploy_id=correlated_deploy_id, + diagnosis=diagnosis, + from_health=from_health, + message=message, + observed_at=observed_at, + root_resource_kind=root_resource_kind, + root_resource_name=root_resource_name, + root_resource_namespace=root_resource_namespace, + to_health=to_health, + ) + + service_health_transition_response.additional_properties = d + return service_health_transition_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/nuon/models/service_install_component_health_summary.py b/nuon/models/service_install_component_health_summary.py new file mode 100644 index 00000000..726ed8e7 --- /dev/null +++ b/nuon/models/service_install_component_health_summary.py @@ -0,0 +1,98 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ServiceInstallComponentHealthSummary") + + +@_attrs_define +class ServiceInstallComponentHealthSummary: + """ + Attributes: + component_id (str | Unset): ComponentID is what dashboard component routes are keyed by — a link + built from the install-component id instead dead-ends on an empty page. + component_name (str | Unset): + current_health (str | Unset): + install_component_id (str | Unset): + uptime_percent (float | Unset): + """ + + component_id: str | Unset = UNSET + component_name: str | Unset = UNSET + current_health: str | Unset = UNSET + install_component_id: str | Unset = UNSET + uptime_percent: float | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + component_id = self.component_id + + component_name = self.component_name + + current_health = self.current_health + + install_component_id = self.install_component_id + + uptime_percent = self.uptime_percent + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if component_id is not UNSET: + field_dict["component_id"] = component_id + if component_name is not UNSET: + field_dict["component_name"] = component_name + if current_health is not UNSET: + field_dict["current_health"] = current_health + if install_component_id is not UNSET: + field_dict["install_component_id"] = install_component_id + if uptime_percent is not UNSET: + field_dict["uptime_percent"] = uptime_percent + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + component_id = d.pop("component_id", UNSET) + + component_name = d.pop("component_name", UNSET) + + current_health = d.pop("current_health", UNSET) + + install_component_id = d.pop("install_component_id", UNSET) + + uptime_percent = d.pop("uptime_percent", UNSET) + + service_install_component_health_summary = cls( + component_id=component_id, + component_name=component_name, + current_health=current_health, + install_component_id=install_component_id, + uptime_percent=uptime_percent, + ) + + service_install_component_health_summary.additional_properties = d + return service_install_component_health_summary + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/nuon/models/service_install_component_health_timeline_response.py b/nuon/models/service_install_component_health_timeline_response.py new file mode 100644 index 00000000..a98b1b9c --- /dev/null +++ b/nuon/models/service_install_component_health_timeline_response.py @@ -0,0 +1,147 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.service_daily_health_bucket import ServiceDailyHealthBucket + from ..models.service_health_transition_response import ServiceHealthTransitionResponse + + +T = TypeVar("T", bound="ServiceInstallComponentHealthTimelineResponse") + + +@_attrs_define +class ServiceInstallComponentHealthTimelineResponse: + """ + Attributes: + current_health (str | Unset): + daily (list[ServiceDailyHealthBucket] | Unset): + days (int | Unset): + install_component_id (str | Unset): + observed_seconds (int | Unset): + transitions (list[ServiceHealthTransitionResponse] | Unset): + uptime_percent (float | Unset): + """ + + current_health: str | Unset = UNSET + daily: list[ServiceDailyHealthBucket] | Unset = UNSET + days: int | Unset = UNSET + install_component_id: str | Unset = UNSET + observed_seconds: int | Unset = UNSET + transitions: list[ServiceHealthTransitionResponse] | Unset = UNSET + uptime_percent: float | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + current_health = self.current_health + + daily: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.daily, Unset): + daily = [] + for daily_item_data in self.daily: + daily_item = daily_item_data.to_dict() + daily.append(daily_item) + + days = self.days + + install_component_id = self.install_component_id + + observed_seconds = self.observed_seconds + + transitions: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.transitions, Unset): + transitions = [] + for transitions_item_data in self.transitions: + transitions_item = transitions_item_data.to_dict() + transitions.append(transitions_item) + + uptime_percent = self.uptime_percent + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if current_health is not UNSET: + field_dict["current_health"] = current_health + if daily is not UNSET: + field_dict["daily"] = daily + if days is not UNSET: + field_dict["days"] = days + if install_component_id is not UNSET: + field_dict["install_component_id"] = install_component_id + if observed_seconds is not UNSET: + field_dict["observed_seconds"] = observed_seconds + if transitions is not UNSET: + field_dict["transitions"] = transitions + if uptime_percent is not UNSET: + field_dict["uptime_percent"] = uptime_percent + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.service_daily_health_bucket import ServiceDailyHealthBucket + from ..models.service_health_transition_response import ServiceHealthTransitionResponse + + d = dict(src_dict) + current_health = d.pop("current_health", UNSET) + + _daily = d.pop("daily", UNSET) + daily: list[ServiceDailyHealthBucket] | Unset = UNSET + if _daily is not UNSET: + daily = [] + for daily_item_data in _daily: + daily_item = ServiceDailyHealthBucket.from_dict(daily_item_data) + + daily.append(daily_item) + + days = d.pop("days", UNSET) + + install_component_id = d.pop("install_component_id", UNSET) + + observed_seconds = d.pop("observed_seconds", UNSET) + + _transitions = d.pop("transitions", UNSET) + transitions: list[ServiceHealthTransitionResponse] | Unset = UNSET + if _transitions is not UNSET: + transitions = [] + for transitions_item_data in _transitions: + transitions_item = ServiceHealthTransitionResponse.from_dict(transitions_item_data) + + transitions.append(transitions_item) + + uptime_percent = d.pop("uptime_percent", UNSET) + + service_install_component_health_timeline_response = cls( + current_health=current_health, + daily=daily, + days=days, + install_component_id=install_component_id, + observed_seconds=observed_seconds, + transitions=transitions, + uptime_percent=uptime_percent, + ) + + service_install_component_health_timeline_response.additional_properties = d + return service_install_component_health_timeline_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/nuon/models/service_install_health_summary.py b/nuon/models/service_install_health_summary.py new file mode 100644 index 00000000..0c99cd0f --- /dev/null +++ b/nuon/models/service_install_health_summary.py @@ -0,0 +1,115 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ServiceInstallHealthSummary") + + +@_attrs_define +class ServiceInstallHealthSummary: + """ + Attributes: + app_id (str | Unset): + degraded_components (int | Unset): + health (str | Unset): + health_description (str | Unset): + install_id (str | Unset): + install_name (str | Unset): + unhealthy_components (int | Unset): + """ + + app_id: str | Unset = UNSET + degraded_components: int | Unset = UNSET + health: str | Unset = UNSET + health_description: str | Unset = UNSET + install_id: str | Unset = UNSET + install_name: str | Unset = UNSET + unhealthy_components: int | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + app_id = self.app_id + + degraded_components = self.degraded_components + + health = self.health + + health_description = self.health_description + + install_id = self.install_id + + install_name = self.install_name + + unhealthy_components = self.unhealthy_components + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if app_id is not UNSET: + field_dict["app_id"] = app_id + if degraded_components is not UNSET: + field_dict["degraded_components"] = degraded_components + if health is not UNSET: + field_dict["health"] = health + if health_description is not UNSET: + field_dict["health_description"] = health_description + if install_id is not UNSET: + field_dict["install_id"] = install_id + if install_name is not UNSET: + field_dict["install_name"] = install_name + if unhealthy_components is not UNSET: + field_dict["unhealthy_components"] = unhealthy_components + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + app_id = d.pop("app_id", UNSET) + + degraded_components = d.pop("degraded_components", UNSET) + + health = d.pop("health", UNSET) + + health_description = d.pop("health_description", UNSET) + + install_id = d.pop("install_id", UNSET) + + install_name = d.pop("install_name", UNSET) + + unhealthy_components = d.pop("unhealthy_components", UNSET) + + service_install_health_summary = cls( + app_id=app_id, + degraded_components=degraded_components, + health=health, + health_description=health_description, + install_id=install_id, + install_name=install_name, + unhealthy_components=unhealthy_components, + ) + + service_install_health_summary.additional_properties = d + return service_install_health_summary + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/nuon/models/service_install_health_timeline_response.py b/nuon/models/service_install_health_timeline_response.py new file mode 100644 index 00000000..32628a8e --- /dev/null +++ b/nuon/models/service_install_health_timeline_response.py @@ -0,0 +1,147 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.service_daily_health_bucket import ServiceDailyHealthBucket + from ..models.service_install_component_health_summary import ServiceInstallComponentHealthSummary + + +T = TypeVar("T", bound="ServiceInstallHealthTimelineResponse") + + +@_attrs_define +class ServiceInstallHealthTimelineResponse: + """ + Attributes: + components (list[ServiceInstallComponentHealthSummary] | Unset): + current_health (str | Unset): + daily (list[ServiceDailyHealthBucket] | Unset): + days (int | Unset): + install_id (str | Unset): + observed_seconds (int | Unset): + uptime_percent (float | Unset): + """ + + components: list[ServiceInstallComponentHealthSummary] | Unset = UNSET + current_health: str | Unset = UNSET + daily: list[ServiceDailyHealthBucket] | Unset = UNSET + days: int | Unset = UNSET + install_id: str | Unset = UNSET + observed_seconds: int | Unset = UNSET + uptime_percent: float | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + components: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.components, Unset): + components = [] + for components_item_data in self.components: + components_item = components_item_data.to_dict() + components.append(components_item) + + current_health = self.current_health + + daily: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.daily, Unset): + daily = [] + for daily_item_data in self.daily: + daily_item = daily_item_data.to_dict() + daily.append(daily_item) + + days = self.days + + install_id = self.install_id + + observed_seconds = self.observed_seconds + + uptime_percent = self.uptime_percent + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if components is not UNSET: + field_dict["components"] = components + if current_health is not UNSET: + field_dict["current_health"] = current_health + if daily is not UNSET: + field_dict["daily"] = daily + if days is not UNSET: + field_dict["days"] = days + if install_id is not UNSET: + field_dict["install_id"] = install_id + if observed_seconds is not UNSET: + field_dict["observed_seconds"] = observed_seconds + if uptime_percent is not UNSET: + field_dict["uptime_percent"] = uptime_percent + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.service_daily_health_bucket import ServiceDailyHealthBucket + from ..models.service_install_component_health_summary import ServiceInstallComponentHealthSummary + + d = dict(src_dict) + _components = d.pop("components", UNSET) + components: list[ServiceInstallComponentHealthSummary] | Unset = UNSET + if _components is not UNSET: + components = [] + for components_item_data in _components: + components_item = ServiceInstallComponentHealthSummary.from_dict(components_item_data) + + components.append(components_item) + + current_health = d.pop("current_health", UNSET) + + _daily = d.pop("daily", UNSET) + daily: list[ServiceDailyHealthBucket] | Unset = UNSET + if _daily is not UNSET: + daily = [] + for daily_item_data in _daily: + daily_item = ServiceDailyHealthBucket.from_dict(daily_item_data) + + daily.append(daily_item) + + days = d.pop("days", UNSET) + + install_id = d.pop("install_id", UNSET) + + observed_seconds = d.pop("observed_seconds", UNSET) + + uptime_percent = d.pop("uptime_percent", UNSET) + + service_install_health_timeline_response = cls( + components=components, + current_health=current_health, + daily=daily, + days=days, + install_id=install_id, + observed_seconds=observed_seconds, + uptime_percent=uptime_percent, + ) + + service_install_health_timeline_response.additional_properties = d + return service_install_health_timeline_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/nuon/models/service_installs_health_response.py b/nuon/models/service_installs_health_response.py new file mode 100644 index 00000000..424f837f --- /dev/null +++ b/nuon/models/service_installs_health_response.py @@ -0,0 +1,142 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.service_install_health_summary import ServiceInstallHealthSummary + + +T = TypeVar("T", bound="ServiceInstallsHealthResponse") + + +@_attrs_define +class ServiceInstallsHealthResponse: + """ + Attributes: + all_healthy (bool | Unset): + degraded (int | Unset): + healthy (int | Unset): + installs (list[ServiceInstallHealthSummary] | Unset): + total (int | Unset): + unhealthy (int | Unset): + unknown (int | Unset): + unset (int | Unset): + """ + + all_healthy: bool | Unset = UNSET + degraded: int | Unset = UNSET + healthy: int | Unset = UNSET + installs: list[ServiceInstallHealthSummary] | Unset = UNSET + total: int | Unset = UNSET + unhealthy: int | Unset = UNSET + unknown: int | Unset = UNSET + unset: int | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + all_healthy = self.all_healthy + + degraded = self.degraded + + healthy = self.healthy + + installs: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.installs, Unset): + installs = [] + for installs_item_data in self.installs: + installs_item = installs_item_data.to_dict() + installs.append(installs_item) + + total = self.total + + unhealthy = self.unhealthy + + unknown = self.unknown + + unset = self.unset + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if all_healthy is not UNSET: + field_dict["all_healthy"] = all_healthy + if degraded is not UNSET: + field_dict["degraded"] = degraded + if healthy is not UNSET: + field_dict["healthy"] = healthy + if installs is not UNSET: + field_dict["installs"] = installs + if total is not UNSET: + field_dict["total"] = total + if unhealthy is not UNSET: + field_dict["unhealthy"] = unhealthy + if unknown is not UNSET: + field_dict["unknown"] = unknown + if unset is not UNSET: + field_dict["unset"] = unset + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.service_install_health_summary import ServiceInstallHealthSummary + + d = dict(src_dict) + all_healthy = d.pop("all_healthy", UNSET) + + degraded = d.pop("degraded", UNSET) + + healthy = d.pop("healthy", UNSET) + + _installs = d.pop("installs", UNSET) + installs: list[ServiceInstallHealthSummary] | Unset = UNSET + if _installs is not UNSET: + installs = [] + for installs_item_data in _installs: + installs_item = ServiceInstallHealthSummary.from_dict(installs_item_data) + + installs.append(installs_item) + + total = d.pop("total", UNSET) + + unhealthy = d.pop("unhealthy", UNSET) + + unknown = d.pop("unknown", UNSET) + + unset = d.pop("unset", UNSET) + + service_installs_health_response = cls( + all_healthy=all_healthy, + degraded=degraded, + healthy=healthy, + installs=installs, + total=total, + unhealthy=unhealthy, + unknown=unknown, + unset=unset, + ) + + service_installs_health_response.additional_properties = d + return service_installs_health_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/nuon/models/service_put_install_component_health_check_request.py b/nuon/models/service_put_install_component_health_check_request.py new file mode 100644 index 00000000..f70ed36b --- /dev/null +++ b/nuon/models/service_put_install_component_health_check_request.py @@ -0,0 +1,108 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.service_put_install_component_health_check_request_details import ( + ServicePutInstallComponentHealthCheckRequestDetails, + ) + + +T = TypeVar("T", bound="ServicePutInstallComponentHealthCheckRequest") + + +@_attrs_define +class ServicePutInstallComponentHealthCheckRequest: + """ + Attributes: + status (str): + details (ServicePutInstallComponentHealthCheckRequestDetails | Unset): + message (str | Unset): + stale_after (str | Unset): StaleAfter is how long this report stays trustworthy, e.g. "30m"; past + it the check reads as unknown. Defaults to 5m — set higher for slower pushers. + """ + + status: str + details: ServicePutInstallComponentHealthCheckRequestDetails | Unset = UNSET + message: str | Unset = UNSET + stale_after: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + status = self.status + + details: dict[str, Any] | Unset = UNSET + if not isinstance(self.details, Unset): + details = self.details.to_dict() + + message = self.message + + stale_after = self.stale_after + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "status": status, + } + ) + if details is not UNSET: + field_dict["details"] = details + if message is not UNSET: + field_dict["message"] = message + if stale_after is not UNSET: + field_dict["stale_after"] = stale_after + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.service_put_install_component_health_check_request_details import ( + ServicePutInstallComponentHealthCheckRequestDetails, + ) + + d = dict(src_dict) + status = d.pop("status") + + _details = d.pop("details", UNSET) + details: ServicePutInstallComponentHealthCheckRequestDetails | Unset + if isinstance(_details, Unset): + details = UNSET + else: + details = ServicePutInstallComponentHealthCheckRequestDetails.from_dict(_details) + + message = d.pop("message", UNSET) + + stale_after = d.pop("stale_after", UNSET) + + service_put_install_component_health_check_request = cls( + status=status, + details=details, + message=message, + stale_after=stale_after, + ) + + service_put_install_component_health_check_request.additional_properties = d + return service_put_install_component_health_check_request + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/nuon/models/service_put_install_component_health_check_request_details.py b/nuon/models/service_put_install_component_health_check_request_details.py new file mode 100644 index 00000000..f7189eb9 --- /dev/null +++ b/nuon/models/service_put_install_component_health_check_request_details.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ServicePutInstallComponentHealthCheckRequestDetails") + + +@_attrs_define +class ServicePutInstallComponentHealthCheckRequestDetails: + """ """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + service_put_install_component_health_check_request_details = cls() + + service_put_install_component_health_check_request_details.additional_properties = d + return service_put_install_component_health_check_request_details + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/nuon/models/service_reset_install_health_baseline_response.py b/nuon/models/service_reset_install_health_baseline_response.py new file mode 100644 index 00000000..75dbe3e4 --- /dev/null +++ b/nuon/models/service_reset_install_health_baseline_response.py @@ -0,0 +1,61 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ServiceResetInstallHealthBaselineResponse") + + +@_attrs_define +class ServiceResetInstallHealthBaselineResponse: + """ + Attributes: + baseline_at (str | Unset): + """ + + baseline_at: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + baseline_at = self.baseline_at + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if baseline_at is not UNSET: + field_dict["baseline_at"] = baseline_at + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + baseline_at = d.pop("baseline_at", UNSET) + + service_reset_install_health_baseline_response = cls( + baseline_at=baseline_at, + ) + + service_reset_install_health_baseline_response.additional_properties = d + return service_reset_install_health_baseline_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/pyproject.toml b/pyproject.toml index f35393db..797a7940 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "nuon" -version = "0.19.1092" +version = "0.19.1093" description = "A client library for accessing Nuon" authors = [] requires-python = ">=3.11" diff --git a/version.txt b/version.txt index a00a995c..3a81a4a3 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.19.1092 +0.19.1093