mirror of
https://github.com/ansible-collections/hetzner.hcloud.git
synced 2026-02-04 08:01:49 +00:00
refactor: mark module_utils modules as private (#782)
##### SUMMARY All `module_utils` are now marked as **private**. None of the modules were intended for public use. Similar to https://togithub.com/ansible-collections/community.general/issues/11312
This commit is contained in:
parent
0f23e6c58c
commit
cfa0d181f7
152 changed files with 283 additions and 239 deletions
51
plugins/module_utils/_vendor/hcloud/metrics/domain.py
Normal file
51
plugins/module_utils/_vendor/hcloud/metrics/domain.py
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from datetime import datetime
|
||||
from typing import Literal
|
||||
|
||||
from ..core import BaseDomain
|
||||
|
||||
__all__ = [
|
||||
"TimeSeries",
|
||||
"Metrics",
|
||||
]
|
||||
|
||||
|
||||
TimeSeries = dict[str, dict[Literal["values"], list[tuple[float, str]]]]
|
||||
|
||||
|
||||
class Metrics(BaseDomain):
|
||||
"""Metrics Domain
|
||||
|
||||
:param start: Start of period of metrics reported.
|
||||
:param end: End of period of metrics reported.
|
||||
:param step: Resolution of results in seconds.
|
||||
:param time_series: Dict with time series data, using the name of the time series as
|
||||
key. The metrics timestamps and values are stored in a list of tuples
|
||||
``[(timestamp, value), ...]``.
|
||||
"""
|
||||
|
||||
start: datetime
|
||||
end: datetime
|
||||
step: float
|
||||
time_series: TimeSeries
|
||||
|
||||
__api_properties__ = (
|
||||
"start",
|
||||
"end",
|
||||
"step",
|
||||
"time_series",
|
||||
)
|
||||
__slots__ = __api_properties__
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
start: str,
|
||||
end: str,
|
||||
step: float,
|
||||
time_series: TimeSeries,
|
||||
):
|
||||
self.start = self._parse_datetime(start)
|
||||
self.end = self._parse_datetime(end)
|
||||
self.step = step
|
||||
self.time_series = time_series
|
||||
Loading…
Add table
Add a link
Reference in a new issue