stackit-observability 0.0.1a0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- stackit/observability/__init__.py +190 -0
- stackit/observability/api/__init__.py +4 -0
- stackit/observability/api/default_api.py +9455 -0
- stackit/observability/api_client.py +627 -0
- stackit/observability/api_response.py +23 -0
- stackit/observability/configuration.py +112 -0
- stackit/observability/exceptions.py +199 -0
- stackit/observability/models/__init__.py +171 -0
- stackit/observability/models/alert.py +125 -0
- stackit/observability/models/alert_config_receivers_response.py +97 -0
- stackit/observability/models/alert_config_route_response.py +93 -0
- stackit/observability/models/basic_auth.py +83 -0
- stackit/observability/models/create_alert_config_receiver_payload.py +152 -0
- stackit/observability/models/create_alert_config_receiver_payload_email_configs_inner.py +114 -0
- stackit/observability/models/create_alert_config_receiver_payload_opsgenie_configs_inner.py +94 -0
- stackit/observability/models/create_alert_config_receiver_payload_web_hook_configs_inner.py +92 -0
- stackit/observability/models/create_alert_config_route_payload.py +157 -0
- stackit/observability/models/create_alert_config_route_payload_routes_inner.py +119 -0
- stackit/observability/models/create_credentials_response.py +95 -0
- stackit/observability/models/create_instance_payload.py +88 -0
- stackit/observability/models/create_instance_response.py +90 -0
- stackit/observability/models/create_scrape_config_payload.py +267 -0
- stackit/observability/models/create_scrape_config_payload_basic_auth.py +87 -0
- stackit/observability/models/create_scrape_config_payload_http_sd_configs_inner.py +133 -0
- stackit/observability/models/create_scrape_config_payload_http_sd_configs_inner_oauth2.py +115 -0
- stackit/observability/models/create_scrape_config_payload_http_sd_configs_inner_oauth2_tls_config.py +90 -0
- stackit/observability/models/create_scrape_config_payload_metrics_relabel_configs_inner.py +146 -0
- stackit/observability/models/create_scrape_config_payload_static_configs_inner.py +88 -0
- stackit/observability/models/credentials.py +83 -0
- stackit/observability/models/credentials_remote_write_config.py +90 -0
- stackit/observability/models/credentials_remote_write_delete_response.py +83 -0
- stackit/observability/models/delete_scrape_config_response.py +97 -0
- stackit/observability/models/email_config.py +114 -0
- stackit/observability/models/error.py +83 -0
- stackit/observability/models/get_alert_configs_response.py +93 -0
- stackit/observability/models/get_credentials_response.py +92 -0
- stackit/observability/models/get_instance_response.py +164 -0
- stackit/observability/models/get_metrics_storage_retention_response.py +103 -0
- stackit/observability/models/get_scrape_config_response.py +90 -0
- stackit/observability/models/grafana_configs.py +99 -0
- stackit/observability/models/grafana_oauth.py +124 -0
- stackit/observability/models/http_service_sd.py +109 -0
- stackit/observability/models/inhibit_rules.py +120 -0
- stackit/observability/models/instance.py +155 -0
- stackit/observability/models/instance_response.py +82 -0
- stackit/observability/models/instance_sensitive_data.py +159 -0
- stackit/observability/models/job.py +207 -0
- stackit/observability/models/list_acl_response.py +83 -0
- stackit/observability/models/list_credentials_response.py +101 -0
- stackit/observability/models/list_instances_response.py +101 -0
- stackit/observability/models/list_scrape_configs_response.py +97 -0
- stackit/observability/models/message.py +82 -0
- stackit/observability/models/metrics_relabel_config.py +122 -0
- stackit/observability/models/model_global.py +125 -0
- stackit/observability/models/o_auth2.py +101 -0
- stackit/observability/models/opsgenie_config.py +98 -0
- stackit/observability/models/permission_denied.py +82 -0
- stackit/observability/models/plan.py +156 -0
- stackit/observability/models/plan_model.py +147 -0
- stackit/observability/models/plans_response.py +97 -0
- stackit/observability/models/project_instance_full.py +124 -0
- stackit/observability/models/receiver.py +93 -0
- stackit/observability/models/receivers.py +129 -0
- stackit/observability/models/route.py +135 -0
- stackit/observability/models/route_serializer.py +127 -0
- stackit/observability/models/scrape_configs_response.py +97 -0
- stackit/observability/models/service_keys_list.py +86 -0
- stackit/observability/models/static_configs.py +83 -0
- stackit/observability/models/tls_config.py +88 -0
- stackit/observability/models/update_acl_payload.py +82 -0
- stackit/observability/models/update_alert_config_receiver_payload.py +152 -0
- stackit/observability/models/update_alert_config_route_payload.py +157 -0
- stackit/observability/models/update_alert_configs_payload.py +133 -0
- stackit/observability/models/update_alert_configs_payload_global.py +139 -0
- stackit/observability/models/update_alert_configs_payload_inhibit_rules.py +113 -0
- stackit/observability/models/update_alert_configs_payload_receivers_inner.py +152 -0
- stackit/observability/models/update_alert_configs_payload_route.py +157 -0
- stackit/observability/models/update_alert_configs_response.py +93 -0
- stackit/observability/models/update_credentials_remote_write_config_payload.py +86 -0
- stackit/observability/models/update_grafana_configs_payload.py +109 -0
- stackit/observability/models/update_grafana_configs_payload_generic_oauth.py +135 -0
- stackit/observability/models/update_instance_payload.py +88 -0
- stackit/observability/models/update_metrics_storage_retention_payload.py +99 -0
- stackit/observability/models/update_scrape_config_payload.py +225 -0
- stackit/observability/models/update_scrape_config_payload_static_configs_inner.py +88 -0
- stackit/observability/models/web_hook.py +90 -0
- stackit/observability/py.typed +0 -0
- stackit/observability/rest.py +149 -0
- stackit_observability-0.0.1a0.dist-info/METADATA +44 -0
- stackit_observability-0.0.1a0.dist-info/RECORD +91 -0
- stackit_observability-0.0.1a0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT Observability API
|
|
5
|
+
|
|
6
|
+
API endpoints for Observability on STACKIT
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.1.1
|
|
9
|
+
Contact: stackit-argus@mail.schwarz
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501 docstring might be too long
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
17
|
+
import json
|
|
18
|
+
import pprint
|
|
19
|
+
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
22
|
+
from typing_extensions import Annotated, Self
|
|
23
|
+
|
|
24
|
+
from stackit.observability.models.create_alert_config_route_payload_routes_inner import (
|
|
25
|
+
CreateAlertConfigRoutePayloadRoutesInner,
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class UpdateAlertConfigRoutePayload(BaseModel):
|
|
30
|
+
"""
|
|
31
|
+
The root node of the routing tree.
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
group_by: Optional[List[Annotated[str, Field(min_length=1, strict=True, max_length=200)]]] = Field(
|
|
35
|
+
default=None,
|
|
36
|
+
description="The labels by which incoming alerts are grouped together. For example, multiple alerts coming in for cluster=A and alertname=LatencyHigh would be batched into a single group. To aggregate by all possible labels use the special value '...' as the sole label name, for example: group_by: ['...']. This effectively disables aggregation entirely, passing through all alerts as-is. This is unlikely to be what you want, unless you have a very low alert volume or your upstream notification system performs its own grouping.",
|
|
37
|
+
alias="groupBy",
|
|
38
|
+
)
|
|
39
|
+
group_interval: Optional[Annotated[str, Field(min_length=2, strict=True, max_length=8)]] = Field(
|
|
40
|
+
default="5m",
|
|
41
|
+
description="How long to wait before sending a notification about new alerts that are added to a group of alerts for which an initial notification has already been sent. (Usually ~5m or more.) `Additional Validators:` * must be a valid time format",
|
|
42
|
+
alias="groupInterval",
|
|
43
|
+
)
|
|
44
|
+
group_wait: Optional[Annotated[str, Field(min_length=2, strict=True, max_length=8)]] = Field(
|
|
45
|
+
default="30s",
|
|
46
|
+
description="How long to initially wait to send a notification for a group of alerts. Allows to wait for an inhibiting alert to arrive or collect more initial alerts for the same group. (Usually ~0s to few minutes.) `Additional Validators:` * must be a valid time format",
|
|
47
|
+
alias="groupWait",
|
|
48
|
+
)
|
|
49
|
+
match: Optional[Dict[str, Any]] = Field(
|
|
50
|
+
default=None,
|
|
51
|
+
description="map of key:value. A set of equality matchers an alert has to fulfill to match the node. `Additional Validators:` * should not contain more than 5 keys * each key and value should not be longer than 200 characters * key and values should only include the characters: a-zA-Z0-9_./@&?:-",
|
|
52
|
+
)
|
|
53
|
+
match_re: Optional[Dict[str, Any]] = Field(
|
|
54
|
+
default=None,
|
|
55
|
+
description="map of key:value. A set of regex-matchers an alert has to fulfill to match the node. `Additional Validators:` * should not contain more than 5 keys * each key and value should not be longer than 200 characters",
|
|
56
|
+
alias="matchRe",
|
|
57
|
+
)
|
|
58
|
+
matchers: Optional[List[Annotated[str, Field(min_length=1, strict=True, max_length=200)]]] = Field(
|
|
59
|
+
default=None,
|
|
60
|
+
description="A list of matchers that an alert has to fulfill to match the node. A matcher is a string with a syntax inspired by PromQL and OpenMetrics. The syntax of a matcher consists of three tokens: * A valid Prometheus label name. * One of =, !=, =~, or !~. = means equals, != means that the strings are not equal, =~ is used for equality of regex expressions and !~ is used for un-equality of regex expressions. They have the same meaning as known from PromQL selectors. * A UTF-8 string, which may be enclosed in double quotes. Before or after each token, there may be any amount of whitespace. `Additional Validators:` * should not contain more than 5 keys * each key and value should not be longer than 200 characters",
|
|
61
|
+
)
|
|
62
|
+
receiver: Annotated[str, Field(min_length=1, strict=True, max_length=200)] = Field(
|
|
63
|
+
description="Receiver that should be one item of receivers `Additional Validators:` * must be a in name of receivers"
|
|
64
|
+
)
|
|
65
|
+
repeat_interval: Optional[Annotated[str, Field(min_length=2, strict=True, max_length=8)]] = Field(
|
|
66
|
+
default="4h",
|
|
67
|
+
description="How long to wait before sending a notification again if it has already been sent successfully for an alert. (Usually ~3h or more). `Additional Validators:` * must be a valid time format",
|
|
68
|
+
alias="repeatInterval",
|
|
69
|
+
)
|
|
70
|
+
routes: Optional[List[CreateAlertConfigRoutePayloadRoutesInner]] = Field(
|
|
71
|
+
default=None, description="Zero or more child routes."
|
|
72
|
+
)
|
|
73
|
+
__properties: ClassVar[List[str]] = [
|
|
74
|
+
"groupBy",
|
|
75
|
+
"groupInterval",
|
|
76
|
+
"groupWait",
|
|
77
|
+
"match",
|
|
78
|
+
"matchRe",
|
|
79
|
+
"matchers",
|
|
80
|
+
"receiver",
|
|
81
|
+
"repeatInterval",
|
|
82
|
+
"routes",
|
|
83
|
+
]
|
|
84
|
+
|
|
85
|
+
model_config = ConfigDict(
|
|
86
|
+
populate_by_name=True,
|
|
87
|
+
validate_assignment=True,
|
|
88
|
+
protected_namespaces=(),
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
def to_str(self) -> str:
|
|
92
|
+
"""Returns the string representation of the model using alias"""
|
|
93
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
94
|
+
|
|
95
|
+
def to_json(self) -> str:
|
|
96
|
+
"""Returns the JSON representation of the model using alias"""
|
|
97
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
98
|
+
return json.dumps(self.to_dict())
|
|
99
|
+
|
|
100
|
+
@classmethod
|
|
101
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
102
|
+
"""Create an instance of UpdateAlertConfigRoutePayload from a JSON string"""
|
|
103
|
+
return cls.from_dict(json.loads(json_str))
|
|
104
|
+
|
|
105
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
106
|
+
"""Return the dictionary representation of the model using alias.
|
|
107
|
+
|
|
108
|
+
This has the following differences from calling pydantic's
|
|
109
|
+
`self.model_dump(by_alias=True)`:
|
|
110
|
+
|
|
111
|
+
* `None` is only added to the output dict for nullable fields that
|
|
112
|
+
were set at model initialization. Other fields with value `None`
|
|
113
|
+
are ignored.
|
|
114
|
+
"""
|
|
115
|
+
excluded_fields: Set[str] = set([])
|
|
116
|
+
|
|
117
|
+
_dict = self.model_dump(
|
|
118
|
+
by_alias=True,
|
|
119
|
+
exclude=excluded_fields,
|
|
120
|
+
exclude_none=True,
|
|
121
|
+
)
|
|
122
|
+
# override the default output from pydantic by calling `to_dict()` of each item in routes (list)
|
|
123
|
+
_items = []
|
|
124
|
+
if self.routes:
|
|
125
|
+
for _item in self.routes:
|
|
126
|
+
if _item:
|
|
127
|
+
_items.append(_item.to_dict())
|
|
128
|
+
_dict["routes"] = _items
|
|
129
|
+
return _dict
|
|
130
|
+
|
|
131
|
+
@classmethod
|
|
132
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
133
|
+
"""Create an instance of UpdateAlertConfigRoutePayload from a dict"""
|
|
134
|
+
if obj is None:
|
|
135
|
+
return None
|
|
136
|
+
|
|
137
|
+
if not isinstance(obj, dict):
|
|
138
|
+
return cls.model_validate(obj)
|
|
139
|
+
|
|
140
|
+
_obj = cls.model_validate(
|
|
141
|
+
{
|
|
142
|
+
"groupBy": obj.get("groupBy"),
|
|
143
|
+
"groupInterval": obj.get("groupInterval") if obj.get("groupInterval") is not None else "5m",
|
|
144
|
+
"groupWait": obj.get("groupWait") if obj.get("groupWait") is not None else "30s",
|
|
145
|
+
"match": obj.get("match"),
|
|
146
|
+
"matchRe": obj.get("matchRe"),
|
|
147
|
+
"matchers": obj.get("matchers"),
|
|
148
|
+
"receiver": obj.get("receiver"),
|
|
149
|
+
"repeatInterval": obj.get("repeatInterval") if obj.get("repeatInterval") is not None else "4h",
|
|
150
|
+
"routes": (
|
|
151
|
+
[CreateAlertConfigRoutePayloadRoutesInner.from_dict(_item) for _item in obj["routes"]]
|
|
152
|
+
if obj.get("routes") is not None
|
|
153
|
+
else None
|
|
154
|
+
),
|
|
155
|
+
}
|
|
156
|
+
)
|
|
157
|
+
return _obj
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT Observability API
|
|
5
|
+
|
|
6
|
+
API endpoints for Observability on STACKIT
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.1.1
|
|
9
|
+
Contact: stackit-argus@mail.schwarz
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501 docstring might be too long
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
17
|
+
import json
|
|
18
|
+
import pprint
|
|
19
|
+
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
22
|
+
from typing_extensions import Self
|
|
23
|
+
|
|
24
|
+
from stackit.observability.models.update_alert_configs_payload_global import (
|
|
25
|
+
UpdateAlertConfigsPayloadGlobal,
|
|
26
|
+
)
|
|
27
|
+
from stackit.observability.models.update_alert_configs_payload_inhibit_rules import (
|
|
28
|
+
UpdateAlertConfigsPayloadInhibitRules,
|
|
29
|
+
)
|
|
30
|
+
from stackit.observability.models.update_alert_configs_payload_receivers_inner import (
|
|
31
|
+
UpdateAlertConfigsPayloadReceiversInner,
|
|
32
|
+
)
|
|
33
|
+
from stackit.observability.models.update_alert_configs_payload_route import (
|
|
34
|
+
UpdateAlertConfigsPayloadRoute,
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class UpdateAlertConfigsPayload(BaseModel):
|
|
39
|
+
"""
|
|
40
|
+
Alert config
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
var_global: Optional[UpdateAlertConfigsPayloadGlobal] = Field(default=None, alias="global")
|
|
44
|
+
inhibit_rules: Optional[UpdateAlertConfigsPayloadInhibitRules] = Field(default=None, alias="inhibitRules")
|
|
45
|
+
receivers: List[UpdateAlertConfigsPayloadReceiversInner] = Field(description="A list of notification receivers.")
|
|
46
|
+
route: UpdateAlertConfigsPayloadRoute
|
|
47
|
+
__properties: ClassVar[List[str]] = ["global", "inhibitRules", "receivers", "route"]
|
|
48
|
+
|
|
49
|
+
model_config = ConfigDict(
|
|
50
|
+
populate_by_name=True,
|
|
51
|
+
validate_assignment=True,
|
|
52
|
+
protected_namespaces=(),
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
def to_str(self) -> str:
|
|
56
|
+
"""Returns the string representation of the model using alias"""
|
|
57
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
58
|
+
|
|
59
|
+
def to_json(self) -> str:
|
|
60
|
+
"""Returns the JSON representation of the model using alias"""
|
|
61
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
62
|
+
return json.dumps(self.to_dict())
|
|
63
|
+
|
|
64
|
+
@classmethod
|
|
65
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
66
|
+
"""Create an instance of UpdateAlertConfigsPayload from a JSON string"""
|
|
67
|
+
return cls.from_dict(json.loads(json_str))
|
|
68
|
+
|
|
69
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
70
|
+
"""Return the dictionary representation of the model using alias.
|
|
71
|
+
|
|
72
|
+
This has the following differences from calling pydantic's
|
|
73
|
+
`self.model_dump(by_alias=True)`:
|
|
74
|
+
|
|
75
|
+
* `None` is only added to the output dict for nullable fields that
|
|
76
|
+
were set at model initialization. Other fields with value `None`
|
|
77
|
+
are ignored.
|
|
78
|
+
"""
|
|
79
|
+
excluded_fields: Set[str] = set([])
|
|
80
|
+
|
|
81
|
+
_dict = self.model_dump(
|
|
82
|
+
by_alias=True,
|
|
83
|
+
exclude=excluded_fields,
|
|
84
|
+
exclude_none=True,
|
|
85
|
+
)
|
|
86
|
+
# override the default output from pydantic by calling `to_dict()` of var_global
|
|
87
|
+
if self.var_global:
|
|
88
|
+
_dict["global"] = self.var_global.to_dict()
|
|
89
|
+
# override the default output from pydantic by calling `to_dict()` of inhibit_rules
|
|
90
|
+
if self.inhibit_rules:
|
|
91
|
+
_dict["inhibitRules"] = self.inhibit_rules.to_dict()
|
|
92
|
+
# override the default output from pydantic by calling `to_dict()` of each item in receivers (list)
|
|
93
|
+
_items = []
|
|
94
|
+
if self.receivers:
|
|
95
|
+
for _item in self.receivers:
|
|
96
|
+
if _item:
|
|
97
|
+
_items.append(_item.to_dict())
|
|
98
|
+
_dict["receivers"] = _items
|
|
99
|
+
# override the default output from pydantic by calling `to_dict()` of route
|
|
100
|
+
if self.route:
|
|
101
|
+
_dict["route"] = self.route.to_dict()
|
|
102
|
+
return _dict
|
|
103
|
+
|
|
104
|
+
@classmethod
|
|
105
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
106
|
+
"""Create an instance of UpdateAlertConfigsPayload from a dict"""
|
|
107
|
+
if obj is None:
|
|
108
|
+
return None
|
|
109
|
+
|
|
110
|
+
if not isinstance(obj, dict):
|
|
111
|
+
return cls.model_validate(obj)
|
|
112
|
+
|
|
113
|
+
_obj = cls.model_validate(
|
|
114
|
+
{
|
|
115
|
+
"global": (
|
|
116
|
+
UpdateAlertConfigsPayloadGlobal.from_dict(obj["global"]) if obj.get("global") is not None else None
|
|
117
|
+
),
|
|
118
|
+
"inhibitRules": (
|
|
119
|
+
UpdateAlertConfigsPayloadInhibitRules.from_dict(obj["inhibitRules"])
|
|
120
|
+
if obj.get("inhibitRules") is not None
|
|
121
|
+
else None
|
|
122
|
+
),
|
|
123
|
+
"receivers": (
|
|
124
|
+
[UpdateAlertConfigsPayloadReceiversInner.from_dict(_item) for _item in obj["receivers"]]
|
|
125
|
+
if obj.get("receivers") is not None
|
|
126
|
+
else None
|
|
127
|
+
),
|
|
128
|
+
"route": (
|
|
129
|
+
UpdateAlertConfigsPayloadRoute.from_dict(obj["route"]) if obj.get("route") is not None else None
|
|
130
|
+
),
|
|
131
|
+
}
|
|
132
|
+
)
|
|
133
|
+
return _obj
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT Observability API
|
|
5
|
+
|
|
6
|
+
API endpoints for Observability on STACKIT
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.1.1
|
|
9
|
+
Contact: stackit-argus@mail.schwarz
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501 docstring might be too long
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
17
|
+
import json
|
|
18
|
+
import pprint
|
|
19
|
+
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
22
|
+
from typing_extensions import Annotated, Self
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class UpdateAlertConfigsPayloadGlobal(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
Global config. If nothing passed the default argus config will be used.
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
opsgenie_api_key: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=200)]] = Field(
|
|
31
|
+
default=None,
|
|
32
|
+
description="Opsgenie api key `Additional Validators:` * should only include the characters: a-zA-Z0-9-",
|
|
33
|
+
alias="opsgenieApiKey",
|
|
34
|
+
)
|
|
35
|
+
opsgenie_api_url: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=200)]] = Field(
|
|
36
|
+
default=None,
|
|
37
|
+
description="Opsgenie api url `Additional Validators:` * must be a syntactically valid url address",
|
|
38
|
+
alias="opsgenieApiUrl",
|
|
39
|
+
)
|
|
40
|
+
resolve_timeout: Optional[Annotated[str, Field(min_length=2, strict=True, max_length=8)]] = Field(
|
|
41
|
+
default="5m",
|
|
42
|
+
description="ResolveTimeout is the default value used by alertmanager if the alert does not include EndsAt, after this time passes it can declare the alert as resolved if it has not been updated. This has no impact on alerts from Prometheus, as they always include EndsAt. `Additional Validators:` * must be a valid time format",
|
|
43
|
+
alias="resolveTimeout",
|
|
44
|
+
)
|
|
45
|
+
smtp_auth_identity: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=200)]] = Field(
|
|
46
|
+
default=None,
|
|
47
|
+
description="Auth identity. `Additional Validators:` * must be a syntactically valid email address",
|
|
48
|
+
alias="smtpAuthIdentity",
|
|
49
|
+
)
|
|
50
|
+
smtp_auth_password: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=200)]] = Field(
|
|
51
|
+
default=None, description="SMTP Auth using LOGIN and PLAIN.", alias="smtpAuthPassword"
|
|
52
|
+
)
|
|
53
|
+
smtp_auth_username: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=200)]] = Field(
|
|
54
|
+
default=None,
|
|
55
|
+
description="SMTP Auth using CRAM-MD5, LOGIN and PLAIN. If empty, Alertmanager doesn't authenticate to the SMTP server.",
|
|
56
|
+
alias="smtpAuthUsername",
|
|
57
|
+
)
|
|
58
|
+
smtp_from: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=200)]] = Field(
|
|
59
|
+
default=None,
|
|
60
|
+
description="The default SMTP From header field. `Additional Validators:` * must be a syntactically valid email address",
|
|
61
|
+
alias="smtpFrom",
|
|
62
|
+
)
|
|
63
|
+
smtp_smarthost: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=200)]] = Field(
|
|
64
|
+
default=None,
|
|
65
|
+
description="The default SMTP smarthost used for sending emails, including port number. Port number usually is 25, or 587 for SMTP over TLS (sometimes referred to as STARTTLS). Example: smtp.example.org:587 `Additional Validators:` * should only include the characters: a-zA-Z0-9_./@&?:-",
|
|
66
|
+
alias="smtpSmarthost",
|
|
67
|
+
)
|
|
68
|
+
__properties: ClassVar[List[str]] = [
|
|
69
|
+
"opsgenieApiKey",
|
|
70
|
+
"opsgenieApiUrl",
|
|
71
|
+
"resolveTimeout",
|
|
72
|
+
"smtpAuthIdentity",
|
|
73
|
+
"smtpAuthPassword",
|
|
74
|
+
"smtpAuthUsername",
|
|
75
|
+
"smtpFrom",
|
|
76
|
+
"smtpSmarthost",
|
|
77
|
+
]
|
|
78
|
+
|
|
79
|
+
model_config = ConfigDict(
|
|
80
|
+
populate_by_name=True,
|
|
81
|
+
validate_assignment=True,
|
|
82
|
+
protected_namespaces=(),
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
def to_str(self) -> str:
|
|
86
|
+
"""Returns the string representation of the model using alias"""
|
|
87
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
88
|
+
|
|
89
|
+
def to_json(self) -> str:
|
|
90
|
+
"""Returns the JSON representation of the model using alias"""
|
|
91
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
92
|
+
return json.dumps(self.to_dict())
|
|
93
|
+
|
|
94
|
+
@classmethod
|
|
95
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
96
|
+
"""Create an instance of UpdateAlertConfigsPayloadGlobal from a JSON string"""
|
|
97
|
+
return cls.from_dict(json.loads(json_str))
|
|
98
|
+
|
|
99
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
100
|
+
"""Return the dictionary representation of the model using alias.
|
|
101
|
+
|
|
102
|
+
This has the following differences from calling pydantic's
|
|
103
|
+
`self.model_dump(by_alias=True)`:
|
|
104
|
+
|
|
105
|
+
* `None` is only added to the output dict for nullable fields that
|
|
106
|
+
were set at model initialization. Other fields with value `None`
|
|
107
|
+
are ignored.
|
|
108
|
+
"""
|
|
109
|
+
excluded_fields: Set[str] = set([])
|
|
110
|
+
|
|
111
|
+
_dict = self.model_dump(
|
|
112
|
+
by_alias=True,
|
|
113
|
+
exclude=excluded_fields,
|
|
114
|
+
exclude_none=True,
|
|
115
|
+
)
|
|
116
|
+
return _dict
|
|
117
|
+
|
|
118
|
+
@classmethod
|
|
119
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
120
|
+
"""Create an instance of UpdateAlertConfigsPayloadGlobal from a dict"""
|
|
121
|
+
if obj is None:
|
|
122
|
+
return None
|
|
123
|
+
|
|
124
|
+
if not isinstance(obj, dict):
|
|
125
|
+
return cls.model_validate(obj)
|
|
126
|
+
|
|
127
|
+
_obj = cls.model_validate(
|
|
128
|
+
{
|
|
129
|
+
"opsgenieApiKey": obj.get("opsgenieApiKey"),
|
|
130
|
+
"opsgenieApiUrl": obj.get("opsgenieApiUrl"),
|
|
131
|
+
"resolveTimeout": obj.get("resolveTimeout") if obj.get("resolveTimeout") is not None else "5m",
|
|
132
|
+
"smtpAuthIdentity": obj.get("smtpAuthIdentity"),
|
|
133
|
+
"smtpAuthPassword": obj.get("smtpAuthPassword"),
|
|
134
|
+
"smtpAuthUsername": obj.get("smtpAuthUsername"),
|
|
135
|
+
"smtpFrom": obj.get("smtpFrom"),
|
|
136
|
+
"smtpSmarthost": obj.get("smtpSmarthost"),
|
|
137
|
+
}
|
|
138
|
+
)
|
|
139
|
+
return _obj
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT Observability API
|
|
5
|
+
|
|
6
|
+
API endpoints for Observability on STACKIT
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.1.1
|
|
9
|
+
Contact: stackit-argus@mail.schwarz
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501 docstring might be too long
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
17
|
+
import json
|
|
18
|
+
import pprint
|
|
19
|
+
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
22
|
+
from typing_extensions import Annotated, Self
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class UpdateAlertConfigsPayloadInhibitRules(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
A list of inhibition rules.
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
equal: Optional[List[Annotated[str, Field(min_length=1, strict=True, max_length=200)]]] = Field(
|
|
31
|
+
default=None,
|
|
32
|
+
description="Labels that must have an equal value in the source and target alert for the inhibition to take effect. `Additional Validators:` * should only include the characters: a-zA-Z0-9_./@&?:-",
|
|
33
|
+
)
|
|
34
|
+
source_match: Optional[Dict[str, Any]] = Field(
|
|
35
|
+
default=None,
|
|
36
|
+
description="map of key:value. Matchers for which one or more alerts have to exist for the inhibition to take effect. `Additional Validators:` * should not contain more than 5 keys * each key and value should not have more than 200 characters * each key and value should only include the characters: a-zA-Z0-9_./@&?:-",
|
|
37
|
+
alias="sourceMatch",
|
|
38
|
+
)
|
|
39
|
+
source_match_re: Optional[Dict[str, Any]] = Field(
|
|
40
|
+
default=None,
|
|
41
|
+
description="map of key:value. Regex match `Additional Validators:` * should not contain more than 5 keys * each key and value should not have more than 200 characters",
|
|
42
|
+
alias="sourceMatchRe",
|
|
43
|
+
)
|
|
44
|
+
target_match: Optional[Dict[str, Any]] = Field(
|
|
45
|
+
default=None,
|
|
46
|
+
description="map of key:value. Matchers that have to be fulfilled in the alerts to be muted. `Additional Validators:` * should not contain more than 5 keys * each key and value should not have more than 200 characters * each key and value should only include the characters: a-zA-Z0-9_./@&?:-",
|
|
47
|
+
alias="targetMatch",
|
|
48
|
+
)
|
|
49
|
+
target_match_re: Optional[Dict[str, Any]] = Field(
|
|
50
|
+
default=None,
|
|
51
|
+
description="map of key:value. Matchers that have to be fulfilled in the alerts to be muted. Regex. `Additional Validators:` * should not contain more than 5 keys * each key and value should not have more than 200 characters",
|
|
52
|
+
alias="targetMatchRe",
|
|
53
|
+
)
|
|
54
|
+
__properties: ClassVar[List[str]] = ["equal", "sourceMatch", "sourceMatchRe", "targetMatch", "targetMatchRe"]
|
|
55
|
+
|
|
56
|
+
model_config = ConfigDict(
|
|
57
|
+
populate_by_name=True,
|
|
58
|
+
validate_assignment=True,
|
|
59
|
+
protected_namespaces=(),
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
def to_str(self) -> str:
|
|
63
|
+
"""Returns the string representation of the model using alias"""
|
|
64
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
65
|
+
|
|
66
|
+
def to_json(self) -> str:
|
|
67
|
+
"""Returns the JSON representation of the model using alias"""
|
|
68
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
69
|
+
return json.dumps(self.to_dict())
|
|
70
|
+
|
|
71
|
+
@classmethod
|
|
72
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
73
|
+
"""Create an instance of UpdateAlertConfigsPayloadInhibitRules from a JSON string"""
|
|
74
|
+
return cls.from_dict(json.loads(json_str))
|
|
75
|
+
|
|
76
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
77
|
+
"""Return the dictionary representation of the model using alias.
|
|
78
|
+
|
|
79
|
+
This has the following differences from calling pydantic's
|
|
80
|
+
`self.model_dump(by_alias=True)`:
|
|
81
|
+
|
|
82
|
+
* `None` is only added to the output dict for nullable fields that
|
|
83
|
+
were set at model initialization. Other fields with value `None`
|
|
84
|
+
are ignored.
|
|
85
|
+
"""
|
|
86
|
+
excluded_fields: Set[str] = set([])
|
|
87
|
+
|
|
88
|
+
_dict = self.model_dump(
|
|
89
|
+
by_alias=True,
|
|
90
|
+
exclude=excluded_fields,
|
|
91
|
+
exclude_none=True,
|
|
92
|
+
)
|
|
93
|
+
return _dict
|
|
94
|
+
|
|
95
|
+
@classmethod
|
|
96
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
97
|
+
"""Create an instance of UpdateAlertConfigsPayloadInhibitRules from a dict"""
|
|
98
|
+
if obj is None:
|
|
99
|
+
return None
|
|
100
|
+
|
|
101
|
+
if not isinstance(obj, dict):
|
|
102
|
+
return cls.model_validate(obj)
|
|
103
|
+
|
|
104
|
+
_obj = cls.model_validate(
|
|
105
|
+
{
|
|
106
|
+
"equal": obj.get("equal"),
|
|
107
|
+
"sourceMatch": obj.get("sourceMatch"),
|
|
108
|
+
"sourceMatchRe": obj.get("sourceMatchRe"),
|
|
109
|
+
"targetMatch": obj.get("targetMatch"),
|
|
110
|
+
"targetMatchRe": obj.get("targetMatchRe"),
|
|
111
|
+
}
|
|
112
|
+
)
|
|
113
|
+
return _obj
|