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,112 @@
|
|
|
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
|
+
|
|
16
|
+
class HostConfiguration:
|
|
17
|
+
def __init__(
|
|
18
|
+
self,
|
|
19
|
+
region=None,
|
|
20
|
+
server_index=None,
|
|
21
|
+
server_variables=None,
|
|
22
|
+
server_operation_index=None,
|
|
23
|
+
server_operation_variables=None,
|
|
24
|
+
ignore_operation_servers=False,
|
|
25
|
+
) -> None:
|
|
26
|
+
"""Constructor"""
|
|
27
|
+
self._base_path = "https://argus.api.eu01.stackit.cloud"
|
|
28
|
+
"""Default Base url
|
|
29
|
+
"""
|
|
30
|
+
self.server_index = 0 if server_index is None else server_index
|
|
31
|
+
self.server_operation_index = server_operation_index or {}
|
|
32
|
+
"""Default server index
|
|
33
|
+
"""
|
|
34
|
+
self.server_variables = server_variables or {}
|
|
35
|
+
if region:
|
|
36
|
+
self.server_variables["region"] = "{}.".format(region)
|
|
37
|
+
self.server_operation_variables = server_operation_variables or {}
|
|
38
|
+
"""Default server variables
|
|
39
|
+
"""
|
|
40
|
+
self.ignore_operation_servers = ignore_operation_servers
|
|
41
|
+
"""Ignore operation servers
|
|
42
|
+
"""
|
|
43
|
+
|
|
44
|
+
def get_host_settings(self):
|
|
45
|
+
"""Gets an array of host settings
|
|
46
|
+
|
|
47
|
+
:return: An array of host settings
|
|
48
|
+
"""
|
|
49
|
+
return [
|
|
50
|
+
{
|
|
51
|
+
"url": "https://argus.api.{region}stackit.cloud",
|
|
52
|
+
"description": "No description provided",
|
|
53
|
+
"variables": {
|
|
54
|
+
"region": {
|
|
55
|
+
"description": "No description provided",
|
|
56
|
+
"default_value": "eu01.",
|
|
57
|
+
"enum_values": ["eu01."],
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
|
|
63
|
+
def get_host_from_settings(self, index, variables=None, servers=None):
|
|
64
|
+
"""Gets host URL based on the index and variables
|
|
65
|
+
:param index: array index of the host settings
|
|
66
|
+
:param variables: hash of variable and the corresponding value
|
|
67
|
+
:param servers: an array of host settings or None
|
|
68
|
+
:return: URL based on host settings
|
|
69
|
+
"""
|
|
70
|
+
if index is None:
|
|
71
|
+
return self._base_path
|
|
72
|
+
|
|
73
|
+
variables = {} if variables is None else variables
|
|
74
|
+
servers = self.get_host_settings() if servers is None else servers
|
|
75
|
+
|
|
76
|
+
try:
|
|
77
|
+
server = servers[index]
|
|
78
|
+
except IndexError:
|
|
79
|
+
raise ValueError(
|
|
80
|
+
"Invalid index {0} when selecting the host settings. "
|
|
81
|
+
"Must be less than {1}".format(index, len(servers))
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
url = server["url"]
|
|
85
|
+
|
|
86
|
+
# go through variables and replace placeholders
|
|
87
|
+
for variable_name, variable in server.get("variables", {}).items():
|
|
88
|
+
used_value = variables.get(variable_name, variable["default_value"])
|
|
89
|
+
|
|
90
|
+
if "enum_values" in variable and used_value not in variable["enum_values"]:
|
|
91
|
+
given_value = variables[variable_name].replace(".", "")
|
|
92
|
+
valid_values = [v.replace(".", "") for v in variable["enum_values"]]
|
|
93
|
+
raise ValueError(
|
|
94
|
+
"The variable `{0}` in the host URL has invalid value '{1}'. Must be '{2}'.".format(
|
|
95
|
+
variable_name, given_value, valid_values
|
|
96
|
+
)
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
url = url.replace("{" + variable_name + "}", used_value)
|
|
100
|
+
|
|
101
|
+
return url
|
|
102
|
+
|
|
103
|
+
@property
|
|
104
|
+
def host(self):
|
|
105
|
+
"""Return generated host."""
|
|
106
|
+
return self.get_host_from_settings(self.server_index, variables=self.server_variables)
|
|
107
|
+
|
|
108
|
+
@host.setter
|
|
109
|
+
def host(self, value):
|
|
110
|
+
"""Fix base path."""
|
|
111
|
+
self._base_path = value
|
|
112
|
+
self.server_index = None
|
|
@@ -0,0 +1,199 @@
|
|
|
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 typing import Any, Optional
|
|
16
|
+
|
|
17
|
+
from typing_extensions import Self
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class OpenApiException(Exception):
|
|
21
|
+
"""The base exception class for all OpenAPIExceptions"""
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class ApiTypeError(OpenApiException, TypeError):
|
|
25
|
+
def __init__(self, msg, path_to_item=None, valid_classes=None, key_type=None) -> None:
|
|
26
|
+
"""Raises an exception for TypeErrors
|
|
27
|
+
|
|
28
|
+
Args:
|
|
29
|
+
msg (str): the exception message
|
|
30
|
+
|
|
31
|
+
Keyword Args:
|
|
32
|
+
path_to_item (list): a list of keys an indices to get to the
|
|
33
|
+
current_item
|
|
34
|
+
None if unset
|
|
35
|
+
valid_classes (tuple): the primitive classes that current item
|
|
36
|
+
should be an instance of
|
|
37
|
+
None if unset
|
|
38
|
+
key_type (bool): False if our value is a value in a dict
|
|
39
|
+
True if it is a key in a dict
|
|
40
|
+
False if our item is an item in a list
|
|
41
|
+
None if unset
|
|
42
|
+
"""
|
|
43
|
+
self.path_to_item = path_to_item
|
|
44
|
+
self.valid_classes = valid_classes
|
|
45
|
+
self.key_type = key_type
|
|
46
|
+
full_msg = msg
|
|
47
|
+
if path_to_item:
|
|
48
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
|
49
|
+
super(ApiTypeError, self).__init__(full_msg)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class ApiValueError(OpenApiException, ValueError):
|
|
53
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
|
54
|
+
"""
|
|
55
|
+
Args:
|
|
56
|
+
msg (str): the exception message
|
|
57
|
+
|
|
58
|
+
Keyword Args:
|
|
59
|
+
path_to_item (list) the path to the exception in the
|
|
60
|
+
received_data dict. None if unset
|
|
61
|
+
"""
|
|
62
|
+
|
|
63
|
+
self.path_to_item = path_to_item
|
|
64
|
+
full_msg = msg
|
|
65
|
+
if path_to_item:
|
|
66
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
|
67
|
+
super(ApiValueError, self).__init__(full_msg)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
class ApiAttributeError(OpenApiException, AttributeError):
|
|
71
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
|
72
|
+
"""
|
|
73
|
+
Raised when an attribute reference or assignment fails.
|
|
74
|
+
|
|
75
|
+
Args:
|
|
76
|
+
msg (str): the exception message
|
|
77
|
+
|
|
78
|
+
Keyword Args:
|
|
79
|
+
path_to_item (None/list) the path to the exception in the
|
|
80
|
+
received_data dict
|
|
81
|
+
"""
|
|
82
|
+
self.path_to_item = path_to_item
|
|
83
|
+
full_msg = msg
|
|
84
|
+
if path_to_item:
|
|
85
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
|
86
|
+
super(ApiAttributeError, self).__init__(full_msg)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
class ApiKeyError(OpenApiException, KeyError):
|
|
90
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
|
91
|
+
"""
|
|
92
|
+
Args:
|
|
93
|
+
msg (str): the exception message
|
|
94
|
+
|
|
95
|
+
Keyword Args:
|
|
96
|
+
path_to_item (None/list) the path to the exception in the
|
|
97
|
+
received_data dict
|
|
98
|
+
"""
|
|
99
|
+
self.path_to_item = path_to_item
|
|
100
|
+
full_msg = msg
|
|
101
|
+
if path_to_item:
|
|
102
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
|
103
|
+
super(ApiKeyError, self).__init__(full_msg)
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
class ApiException(OpenApiException):
|
|
107
|
+
|
|
108
|
+
def __init__(
|
|
109
|
+
self,
|
|
110
|
+
status=None,
|
|
111
|
+
reason=None,
|
|
112
|
+
http_resp=None,
|
|
113
|
+
*,
|
|
114
|
+
body: Optional[str] = None,
|
|
115
|
+
data: Optional[Any] = None,
|
|
116
|
+
) -> None:
|
|
117
|
+
self.status = status
|
|
118
|
+
self.reason = reason
|
|
119
|
+
self.body = body
|
|
120
|
+
self.data = data
|
|
121
|
+
self.headers = None
|
|
122
|
+
|
|
123
|
+
if http_resp:
|
|
124
|
+
if self.status is None:
|
|
125
|
+
self.status = http_resp.status
|
|
126
|
+
if self.reason is None:
|
|
127
|
+
self.reason = http_resp.reason
|
|
128
|
+
if self.body is None:
|
|
129
|
+
try:
|
|
130
|
+
self.body = http_resp.data.decode("utf-8")
|
|
131
|
+
except Exception: # noqa: S110
|
|
132
|
+
pass
|
|
133
|
+
self.headers = http_resp.getheaders()
|
|
134
|
+
|
|
135
|
+
@classmethod
|
|
136
|
+
def from_response(
|
|
137
|
+
cls,
|
|
138
|
+
*,
|
|
139
|
+
http_resp,
|
|
140
|
+
body: Optional[str],
|
|
141
|
+
data: Optional[Any],
|
|
142
|
+
) -> Self:
|
|
143
|
+
if http_resp.status == 400:
|
|
144
|
+
raise BadRequestException(http_resp=http_resp, body=body, data=data)
|
|
145
|
+
|
|
146
|
+
if http_resp.status == 401:
|
|
147
|
+
raise UnauthorizedException(http_resp=http_resp, body=body, data=data)
|
|
148
|
+
|
|
149
|
+
if http_resp.status == 403:
|
|
150
|
+
raise ForbiddenException(http_resp=http_resp, body=body, data=data)
|
|
151
|
+
|
|
152
|
+
if http_resp.status == 404:
|
|
153
|
+
raise NotFoundException(http_resp=http_resp, body=body, data=data)
|
|
154
|
+
|
|
155
|
+
if 500 <= http_resp.status <= 599:
|
|
156
|
+
raise ServiceException(http_resp=http_resp, body=body, data=data)
|
|
157
|
+
raise ApiException(http_resp=http_resp, body=body, data=data)
|
|
158
|
+
|
|
159
|
+
def __str__(self):
|
|
160
|
+
"""Custom error messages for exception"""
|
|
161
|
+
error_message = "({0})\n" "Reason: {1}\n".format(self.status, self.reason)
|
|
162
|
+
if self.headers:
|
|
163
|
+
error_message += "HTTP response headers: {0}\n".format(self.headers)
|
|
164
|
+
|
|
165
|
+
if self.data or self.body:
|
|
166
|
+
error_message += "HTTP response body: {0}\n".format(self.data or self.body)
|
|
167
|
+
|
|
168
|
+
return error_message
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
class BadRequestException(ApiException):
|
|
172
|
+
pass
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
class NotFoundException(ApiException):
|
|
176
|
+
pass
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
class UnauthorizedException(ApiException):
|
|
180
|
+
pass
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
class ForbiddenException(ApiException):
|
|
184
|
+
pass
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
class ServiceException(ApiException):
|
|
188
|
+
pass
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
def render_path(path_to_item):
|
|
192
|
+
"""Returns a string representation of a path"""
|
|
193
|
+
result = ""
|
|
194
|
+
for pth in path_to_item:
|
|
195
|
+
if isinstance(pth, int):
|
|
196
|
+
result += "[{0}]".format(pth)
|
|
197
|
+
else:
|
|
198
|
+
result += "['{0}']".format(pth)
|
|
199
|
+
return result
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
# flake8: noqa
|
|
4
|
+
"""
|
|
5
|
+
STACKIT Observability API
|
|
6
|
+
|
|
7
|
+
API endpoints for Observability on STACKIT
|
|
8
|
+
|
|
9
|
+
The version of the OpenAPI document: 1.1.1
|
|
10
|
+
Contact: stackit-argus@mail.schwarz
|
|
11
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
12
|
+
|
|
13
|
+
Do not edit the class manually.
|
|
14
|
+
""" # noqa: E501 docstring might be too long
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# import models into model package
|
|
18
|
+
from stackit.observability.models.alert import Alert
|
|
19
|
+
from stackit.observability.models.alert_config_receivers_response import (
|
|
20
|
+
AlertConfigReceiversResponse,
|
|
21
|
+
)
|
|
22
|
+
from stackit.observability.models.alert_config_route_response import (
|
|
23
|
+
AlertConfigRouteResponse,
|
|
24
|
+
)
|
|
25
|
+
from stackit.observability.models.basic_auth import BasicAuth
|
|
26
|
+
from stackit.observability.models.create_alert_config_receiver_payload import (
|
|
27
|
+
CreateAlertConfigReceiverPayload,
|
|
28
|
+
)
|
|
29
|
+
from stackit.observability.models.create_alert_config_receiver_payload_email_configs_inner import (
|
|
30
|
+
CreateAlertConfigReceiverPayloadEmailConfigsInner,
|
|
31
|
+
)
|
|
32
|
+
from stackit.observability.models.create_alert_config_receiver_payload_opsgenie_configs_inner import (
|
|
33
|
+
CreateAlertConfigReceiverPayloadOpsgenieConfigsInner,
|
|
34
|
+
)
|
|
35
|
+
from stackit.observability.models.create_alert_config_receiver_payload_web_hook_configs_inner import (
|
|
36
|
+
CreateAlertConfigReceiverPayloadWebHookConfigsInner,
|
|
37
|
+
)
|
|
38
|
+
from stackit.observability.models.create_alert_config_route_payload import (
|
|
39
|
+
CreateAlertConfigRoutePayload,
|
|
40
|
+
)
|
|
41
|
+
from stackit.observability.models.create_alert_config_route_payload_routes_inner import (
|
|
42
|
+
CreateAlertConfigRoutePayloadRoutesInner,
|
|
43
|
+
)
|
|
44
|
+
from stackit.observability.models.create_credentials_response import (
|
|
45
|
+
CreateCredentialsResponse,
|
|
46
|
+
)
|
|
47
|
+
from stackit.observability.models.create_instance_payload import CreateInstancePayload
|
|
48
|
+
from stackit.observability.models.create_instance_response import CreateInstanceResponse
|
|
49
|
+
from stackit.observability.models.create_scrape_config_payload import (
|
|
50
|
+
CreateScrapeConfigPayload,
|
|
51
|
+
)
|
|
52
|
+
from stackit.observability.models.create_scrape_config_payload_basic_auth import (
|
|
53
|
+
CreateScrapeConfigPayloadBasicAuth,
|
|
54
|
+
)
|
|
55
|
+
from stackit.observability.models.create_scrape_config_payload_http_sd_configs_inner import (
|
|
56
|
+
CreateScrapeConfigPayloadHttpSdConfigsInner,
|
|
57
|
+
)
|
|
58
|
+
from stackit.observability.models.create_scrape_config_payload_http_sd_configs_inner_oauth2 import (
|
|
59
|
+
CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2,
|
|
60
|
+
)
|
|
61
|
+
from stackit.observability.models.create_scrape_config_payload_http_sd_configs_inner_oauth2_tls_config import (
|
|
62
|
+
CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig,
|
|
63
|
+
)
|
|
64
|
+
from stackit.observability.models.create_scrape_config_payload_metrics_relabel_configs_inner import (
|
|
65
|
+
CreateScrapeConfigPayloadMetricsRelabelConfigsInner,
|
|
66
|
+
)
|
|
67
|
+
from stackit.observability.models.create_scrape_config_payload_static_configs_inner import (
|
|
68
|
+
CreateScrapeConfigPayloadStaticConfigsInner,
|
|
69
|
+
)
|
|
70
|
+
from stackit.observability.models.credentials import Credentials
|
|
71
|
+
from stackit.observability.models.credentials_remote_write_config import (
|
|
72
|
+
CredentialsRemoteWriteConfig,
|
|
73
|
+
)
|
|
74
|
+
from stackit.observability.models.credentials_remote_write_delete_response import (
|
|
75
|
+
CredentialsRemoteWriteDeleteResponse,
|
|
76
|
+
)
|
|
77
|
+
from stackit.observability.models.delete_scrape_config_response import (
|
|
78
|
+
DeleteScrapeConfigResponse,
|
|
79
|
+
)
|
|
80
|
+
from stackit.observability.models.email_config import EmailConfig
|
|
81
|
+
from stackit.observability.models.error import Error
|
|
82
|
+
from stackit.observability.models.get_alert_configs_response import (
|
|
83
|
+
GetAlertConfigsResponse,
|
|
84
|
+
)
|
|
85
|
+
from stackit.observability.models.get_credentials_response import GetCredentialsResponse
|
|
86
|
+
from stackit.observability.models.get_instance_response import GetInstanceResponse
|
|
87
|
+
from stackit.observability.models.get_metrics_storage_retention_response import (
|
|
88
|
+
GetMetricsStorageRetentionResponse,
|
|
89
|
+
)
|
|
90
|
+
from stackit.observability.models.get_scrape_config_response import (
|
|
91
|
+
GetScrapeConfigResponse,
|
|
92
|
+
)
|
|
93
|
+
from stackit.observability.models.grafana_configs import GrafanaConfigs
|
|
94
|
+
from stackit.observability.models.grafana_oauth import GrafanaOauth
|
|
95
|
+
from stackit.observability.models.http_service_sd import HTTPServiceSD
|
|
96
|
+
from stackit.observability.models.inhibit_rules import InhibitRules
|
|
97
|
+
from stackit.observability.models.instance import Instance
|
|
98
|
+
from stackit.observability.models.instance_response import InstanceResponse
|
|
99
|
+
from stackit.observability.models.instance_sensitive_data import InstanceSensitiveData
|
|
100
|
+
from stackit.observability.models.job import Job
|
|
101
|
+
from stackit.observability.models.list_acl_response import ListACLResponse
|
|
102
|
+
from stackit.observability.models.list_credentials_response import (
|
|
103
|
+
ListCredentialsResponse,
|
|
104
|
+
)
|
|
105
|
+
from stackit.observability.models.list_instances_response import ListInstancesResponse
|
|
106
|
+
from stackit.observability.models.list_scrape_configs_response import (
|
|
107
|
+
ListScrapeConfigsResponse,
|
|
108
|
+
)
|
|
109
|
+
from stackit.observability.models.message import Message
|
|
110
|
+
from stackit.observability.models.metrics_relabel_config import MetricsRelabelConfig
|
|
111
|
+
from stackit.observability.models.model_global import ModelGlobal
|
|
112
|
+
from stackit.observability.models.o_auth2 import OAuth2
|
|
113
|
+
from stackit.observability.models.opsgenie_config import OpsgenieConfig
|
|
114
|
+
from stackit.observability.models.permission_denied import PermissionDenied
|
|
115
|
+
from stackit.observability.models.plan import Plan
|
|
116
|
+
from stackit.observability.models.plan_model import PlanModel
|
|
117
|
+
from stackit.observability.models.plans_response import PlansResponse
|
|
118
|
+
from stackit.observability.models.project_instance_full import ProjectInstanceFull
|
|
119
|
+
from stackit.observability.models.receiver import Receiver
|
|
120
|
+
from stackit.observability.models.receivers import Receivers
|
|
121
|
+
from stackit.observability.models.route import Route
|
|
122
|
+
from stackit.observability.models.route_serializer import RouteSerializer
|
|
123
|
+
from stackit.observability.models.scrape_configs_response import ScrapeConfigsResponse
|
|
124
|
+
from stackit.observability.models.service_keys_list import ServiceKeysList
|
|
125
|
+
from stackit.observability.models.static_configs import StaticConfigs
|
|
126
|
+
from stackit.observability.models.tls_config import TLSConfig
|
|
127
|
+
from stackit.observability.models.update_acl_payload import UpdateACLPayload
|
|
128
|
+
from stackit.observability.models.update_alert_config_receiver_payload import (
|
|
129
|
+
UpdateAlertConfigReceiverPayload,
|
|
130
|
+
)
|
|
131
|
+
from stackit.observability.models.update_alert_config_route_payload import (
|
|
132
|
+
UpdateAlertConfigRoutePayload,
|
|
133
|
+
)
|
|
134
|
+
from stackit.observability.models.update_alert_configs_payload import (
|
|
135
|
+
UpdateAlertConfigsPayload,
|
|
136
|
+
)
|
|
137
|
+
from stackit.observability.models.update_alert_configs_payload_global import (
|
|
138
|
+
UpdateAlertConfigsPayloadGlobal,
|
|
139
|
+
)
|
|
140
|
+
from stackit.observability.models.update_alert_configs_payload_inhibit_rules import (
|
|
141
|
+
UpdateAlertConfigsPayloadInhibitRules,
|
|
142
|
+
)
|
|
143
|
+
from stackit.observability.models.update_alert_configs_payload_receivers_inner import (
|
|
144
|
+
UpdateAlertConfigsPayloadReceiversInner,
|
|
145
|
+
)
|
|
146
|
+
from stackit.observability.models.update_alert_configs_payload_route import (
|
|
147
|
+
UpdateAlertConfigsPayloadRoute,
|
|
148
|
+
)
|
|
149
|
+
from stackit.observability.models.update_alert_configs_response import (
|
|
150
|
+
UpdateAlertConfigsResponse,
|
|
151
|
+
)
|
|
152
|
+
from stackit.observability.models.update_credentials_remote_write_config_payload import (
|
|
153
|
+
UpdateCredentialsRemoteWriteConfigPayload,
|
|
154
|
+
)
|
|
155
|
+
from stackit.observability.models.update_grafana_configs_payload import (
|
|
156
|
+
UpdateGrafanaConfigsPayload,
|
|
157
|
+
)
|
|
158
|
+
from stackit.observability.models.update_grafana_configs_payload_generic_oauth import (
|
|
159
|
+
UpdateGrafanaConfigsPayloadGenericOauth,
|
|
160
|
+
)
|
|
161
|
+
from stackit.observability.models.update_instance_payload import UpdateInstancePayload
|
|
162
|
+
from stackit.observability.models.update_metrics_storage_retention_payload import (
|
|
163
|
+
UpdateMetricsStorageRetentionPayload,
|
|
164
|
+
)
|
|
165
|
+
from stackit.observability.models.update_scrape_config_payload import (
|
|
166
|
+
UpdateScrapeConfigPayload,
|
|
167
|
+
)
|
|
168
|
+
from stackit.observability.models.update_scrape_config_payload_static_configs_inner import (
|
|
169
|
+
UpdateScrapeConfigPayloadStaticConfigsInner,
|
|
170
|
+
)
|
|
171
|
+
from stackit.observability.models.web_hook import WebHook
|
|
@@ -0,0 +1,125 @@
|
|
|
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.inhibit_rules import InhibitRules
|
|
25
|
+
from stackit.observability.models.model_global import ModelGlobal
|
|
26
|
+
from stackit.observability.models.receivers import Receivers
|
|
27
|
+
from stackit.observability.models.route import Route
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class Alert(BaseModel):
|
|
31
|
+
"""
|
|
32
|
+
Alert
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
var_global: Optional[ModelGlobal] = Field(default=None, alias="global")
|
|
36
|
+
inhibit_rules: Optional[List[InhibitRules]] = Field(default=None, alias="inhibitRules")
|
|
37
|
+
receivers: List[Receivers]
|
|
38
|
+
route: Route
|
|
39
|
+
__properties: ClassVar[List[str]] = ["global", "inhibitRules", "receivers", "route"]
|
|
40
|
+
|
|
41
|
+
model_config = ConfigDict(
|
|
42
|
+
populate_by_name=True,
|
|
43
|
+
validate_assignment=True,
|
|
44
|
+
protected_namespaces=(),
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
def to_str(self) -> str:
|
|
48
|
+
"""Returns the string representation of the model using alias"""
|
|
49
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
50
|
+
|
|
51
|
+
def to_json(self) -> str:
|
|
52
|
+
"""Returns the JSON representation of the model using alias"""
|
|
53
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
54
|
+
return json.dumps(self.to_dict())
|
|
55
|
+
|
|
56
|
+
@classmethod
|
|
57
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
58
|
+
"""Create an instance of Alert from a JSON string"""
|
|
59
|
+
return cls.from_dict(json.loads(json_str))
|
|
60
|
+
|
|
61
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
62
|
+
"""Return the dictionary representation of the model using alias.
|
|
63
|
+
|
|
64
|
+
This has the following differences from calling pydantic's
|
|
65
|
+
`self.model_dump(by_alias=True)`:
|
|
66
|
+
|
|
67
|
+
* `None` is only added to the output dict for nullable fields that
|
|
68
|
+
were set at model initialization. Other fields with value `None`
|
|
69
|
+
are ignored.
|
|
70
|
+
"""
|
|
71
|
+
excluded_fields: Set[str] = set([])
|
|
72
|
+
|
|
73
|
+
_dict = self.model_dump(
|
|
74
|
+
by_alias=True,
|
|
75
|
+
exclude=excluded_fields,
|
|
76
|
+
exclude_none=True,
|
|
77
|
+
)
|
|
78
|
+
# override the default output from pydantic by calling `to_dict()` of var_global
|
|
79
|
+
if self.var_global:
|
|
80
|
+
_dict["global"] = self.var_global.to_dict()
|
|
81
|
+
# override the default output from pydantic by calling `to_dict()` of each item in inhibit_rules (list)
|
|
82
|
+
_items = []
|
|
83
|
+
if self.inhibit_rules:
|
|
84
|
+
for _item in self.inhibit_rules:
|
|
85
|
+
if _item:
|
|
86
|
+
_items.append(_item.to_dict())
|
|
87
|
+
_dict["inhibitRules"] = _items
|
|
88
|
+
# override the default output from pydantic by calling `to_dict()` of each item in receivers (list)
|
|
89
|
+
_items = []
|
|
90
|
+
if self.receivers:
|
|
91
|
+
for _item in self.receivers:
|
|
92
|
+
if _item:
|
|
93
|
+
_items.append(_item.to_dict())
|
|
94
|
+
_dict["receivers"] = _items
|
|
95
|
+
# override the default output from pydantic by calling `to_dict()` of route
|
|
96
|
+
if self.route:
|
|
97
|
+
_dict["route"] = self.route.to_dict()
|
|
98
|
+
return _dict
|
|
99
|
+
|
|
100
|
+
@classmethod
|
|
101
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
102
|
+
"""Create an instance of Alert from a dict"""
|
|
103
|
+
if obj is None:
|
|
104
|
+
return None
|
|
105
|
+
|
|
106
|
+
if not isinstance(obj, dict):
|
|
107
|
+
return cls.model_validate(obj)
|
|
108
|
+
|
|
109
|
+
_obj = cls.model_validate(
|
|
110
|
+
{
|
|
111
|
+
"global": ModelGlobal.from_dict(obj["global"]) if obj.get("global") is not None else None,
|
|
112
|
+
"inhibitRules": (
|
|
113
|
+
[InhibitRules.from_dict(_item) for _item in obj["inhibitRules"]]
|
|
114
|
+
if obj.get("inhibitRules") is not None
|
|
115
|
+
else None
|
|
116
|
+
),
|
|
117
|
+
"receivers": (
|
|
118
|
+
[Receivers.from_dict(_item) for _item in obj["receivers"]]
|
|
119
|
+
if obj.get("receivers") is not None
|
|
120
|
+
else None
|
|
121
|
+
),
|
|
122
|
+
"route": Route.from_dict(obj["route"]) if obj.get("route") is not None else None,
|
|
123
|
+
}
|
|
124
|
+
)
|
|
125
|
+
return _obj
|