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,101 @@
|
|
|
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.service_keys_list import ServiceKeysList
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class ListCredentialsResponse(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
ListCredentialsResponse
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
credentials: List[ServiceKeysList]
|
|
33
|
+
message: Annotated[str, Field(min_length=1, strict=True)]
|
|
34
|
+
__properties: ClassVar[List[str]] = ["credentials", "message"]
|
|
35
|
+
|
|
36
|
+
model_config = ConfigDict(
|
|
37
|
+
populate_by_name=True,
|
|
38
|
+
validate_assignment=True,
|
|
39
|
+
protected_namespaces=(),
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
def to_str(self) -> str:
|
|
43
|
+
"""Returns the string representation of the model using alias"""
|
|
44
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
45
|
+
|
|
46
|
+
def to_json(self) -> str:
|
|
47
|
+
"""Returns the JSON representation of the model using alias"""
|
|
48
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
49
|
+
return json.dumps(self.to_dict())
|
|
50
|
+
|
|
51
|
+
@classmethod
|
|
52
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
53
|
+
"""Create an instance of ListCredentialsResponse from a JSON string"""
|
|
54
|
+
return cls.from_dict(json.loads(json_str))
|
|
55
|
+
|
|
56
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
57
|
+
"""Return the dictionary representation of the model using alias.
|
|
58
|
+
|
|
59
|
+
This has the following differences from calling pydantic's
|
|
60
|
+
`self.model_dump(by_alias=True)`:
|
|
61
|
+
|
|
62
|
+
* `None` is only added to the output dict for nullable fields that
|
|
63
|
+
were set at model initialization. Other fields with value `None`
|
|
64
|
+
are ignored.
|
|
65
|
+
"""
|
|
66
|
+
excluded_fields: Set[str] = set([])
|
|
67
|
+
|
|
68
|
+
_dict = self.model_dump(
|
|
69
|
+
by_alias=True,
|
|
70
|
+
exclude=excluded_fields,
|
|
71
|
+
exclude_none=True,
|
|
72
|
+
)
|
|
73
|
+
# override the default output from pydantic by calling `to_dict()` of each item in credentials (list)
|
|
74
|
+
_items = []
|
|
75
|
+
if self.credentials:
|
|
76
|
+
for _item in self.credentials:
|
|
77
|
+
if _item:
|
|
78
|
+
_items.append(_item.to_dict())
|
|
79
|
+
_dict["credentials"] = _items
|
|
80
|
+
return _dict
|
|
81
|
+
|
|
82
|
+
@classmethod
|
|
83
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
84
|
+
"""Create an instance of ListCredentialsResponse from a dict"""
|
|
85
|
+
if obj is None:
|
|
86
|
+
return None
|
|
87
|
+
|
|
88
|
+
if not isinstance(obj, dict):
|
|
89
|
+
return cls.model_validate(obj)
|
|
90
|
+
|
|
91
|
+
_obj = cls.model_validate(
|
|
92
|
+
{
|
|
93
|
+
"credentials": (
|
|
94
|
+
[ServiceKeysList.from_dict(_item) for _item in obj["credentials"]]
|
|
95
|
+
if obj.get("credentials") is not None
|
|
96
|
+
else None
|
|
97
|
+
),
|
|
98
|
+
"message": obj.get("message"),
|
|
99
|
+
}
|
|
100
|
+
)
|
|
101
|
+
return _obj
|
|
@@ -0,0 +1,101 @@
|
|
|
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.project_instance_full import ProjectInstanceFull
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class ListInstancesResponse(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
ListInstancesResponse
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
instances: List[ProjectInstanceFull]
|
|
33
|
+
message: Annotated[str, Field(min_length=1, strict=True)]
|
|
34
|
+
__properties: ClassVar[List[str]] = ["instances", "message"]
|
|
35
|
+
|
|
36
|
+
model_config = ConfigDict(
|
|
37
|
+
populate_by_name=True,
|
|
38
|
+
validate_assignment=True,
|
|
39
|
+
protected_namespaces=(),
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
def to_str(self) -> str:
|
|
43
|
+
"""Returns the string representation of the model using alias"""
|
|
44
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
45
|
+
|
|
46
|
+
def to_json(self) -> str:
|
|
47
|
+
"""Returns the JSON representation of the model using alias"""
|
|
48
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
49
|
+
return json.dumps(self.to_dict())
|
|
50
|
+
|
|
51
|
+
@classmethod
|
|
52
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
53
|
+
"""Create an instance of ListInstancesResponse from a JSON string"""
|
|
54
|
+
return cls.from_dict(json.loads(json_str))
|
|
55
|
+
|
|
56
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
57
|
+
"""Return the dictionary representation of the model using alias.
|
|
58
|
+
|
|
59
|
+
This has the following differences from calling pydantic's
|
|
60
|
+
`self.model_dump(by_alias=True)`:
|
|
61
|
+
|
|
62
|
+
* `None` is only added to the output dict for nullable fields that
|
|
63
|
+
were set at model initialization. Other fields with value `None`
|
|
64
|
+
are ignored.
|
|
65
|
+
"""
|
|
66
|
+
excluded_fields: Set[str] = set([])
|
|
67
|
+
|
|
68
|
+
_dict = self.model_dump(
|
|
69
|
+
by_alias=True,
|
|
70
|
+
exclude=excluded_fields,
|
|
71
|
+
exclude_none=True,
|
|
72
|
+
)
|
|
73
|
+
# override the default output from pydantic by calling `to_dict()` of each item in instances (list)
|
|
74
|
+
_items = []
|
|
75
|
+
if self.instances:
|
|
76
|
+
for _item in self.instances:
|
|
77
|
+
if _item:
|
|
78
|
+
_items.append(_item.to_dict())
|
|
79
|
+
_dict["instances"] = _items
|
|
80
|
+
return _dict
|
|
81
|
+
|
|
82
|
+
@classmethod
|
|
83
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
84
|
+
"""Create an instance of ListInstancesResponse from a dict"""
|
|
85
|
+
if obj is None:
|
|
86
|
+
return None
|
|
87
|
+
|
|
88
|
+
if not isinstance(obj, dict):
|
|
89
|
+
return cls.model_validate(obj)
|
|
90
|
+
|
|
91
|
+
_obj = cls.model_validate(
|
|
92
|
+
{
|
|
93
|
+
"instances": (
|
|
94
|
+
[ProjectInstanceFull.from_dict(_item) for _item in obj["instances"]]
|
|
95
|
+
if obj.get("instances") is not None
|
|
96
|
+
else None
|
|
97
|
+
),
|
|
98
|
+
"message": obj.get("message"),
|
|
99
|
+
}
|
|
100
|
+
)
|
|
101
|
+
return _obj
|
|
@@ -0,0 +1,97 @@
|
|
|
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.job import Job
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class ListScrapeConfigsResponse(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
ListScrapeConfigsResponse
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
data: List[Job]
|
|
33
|
+
message: Annotated[str, Field(min_length=1, strict=True)]
|
|
34
|
+
__properties: ClassVar[List[str]] = ["data", "message"]
|
|
35
|
+
|
|
36
|
+
model_config = ConfigDict(
|
|
37
|
+
populate_by_name=True,
|
|
38
|
+
validate_assignment=True,
|
|
39
|
+
protected_namespaces=(),
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
def to_str(self) -> str:
|
|
43
|
+
"""Returns the string representation of the model using alias"""
|
|
44
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
45
|
+
|
|
46
|
+
def to_json(self) -> str:
|
|
47
|
+
"""Returns the JSON representation of the model using alias"""
|
|
48
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
49
|
+
return json.dumps(self.to_dict())
|
|
50
|
+
|
|
51
|
+
@classmethod
|
|
52
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
53
|
+
"""Create an instance of ListScrapeConfigsResponse from a JSON string"""
|
|
54
|
+
return cls.from_dict(json.loads(json_str))
|
|
55
|
+
|
|
56
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
57
|
+
"""Return the dictionary representation of the model using alias.
|
|
58
|
+
|
|
59
|
+
This has the following differences from calling pydantic's
|
|
60
|
+
`self.model_dump(by_alias=True)`:
|
|
61
|
+
|
|
62
|
+
* `None` is only added to the output dict for nullable fields that
|
|
63
|
+
were set at model initialization. Other fields with value `None`
|
|
64
|
+
are ignored.
|
|
65
|
+
"""
|
|
66
|
+
excluded_fields: Set[str] = set([])
|
|
67
|
+
|
|
68
|
+
_dict = self.model_dump(
|
|
69
|
+
by_alias=True,
|
|
70
|
+
exclude=excluded_fields,
|
|
71
|
+
exclude_none=True,
|
|
72
|
+
)
|
|
73
|
+
# override the default output from pydantic by calling `to_dict()` of each item in data (list)
|
|
74
|
+
_items = []
|
|
75
|
+
if self.data:
|
|
76
|
+
for _item in self.data:
|
|
77
|
+
if _item:
|
|
78
|
+
_items.append(_item.to_dict())
|
|
79
|
+
_dict["data"] = _items
|
|
80
|
+
return _dict
|
|
81
|
+
|
|
82
|
+
@classmethod
|
|
83
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
84
|
+
"""Create an instance of ListScrapeConfigsResponse from a dict"""
|
|
85
|
+
if obj is None:
|
|
86
|
+
return None
|
|
87
|
+
|
|
88
|
+
if not isinstance(obj, dict):
|
|
89
|
+
return cls.model_validate(obj)
|
|
90
|
+
|
|
91
|
+
_obj = cls.model_validate(
|
|
92
|
+
{
|
|
93
|
+
"data": [Job.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None,
|
|
94
|
+
"message": obj.get("message"),
|
|
95
|
+
}
|
|
96
|
+
)
|
|
97
|
+
return _obj
|
|
@@ -0,0 +1,82 @@
|
|
|
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 Message(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
Message
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
message: Annotated[str, Field(min_length=1, strict=True)]
|
|
31
|
+
__properties: ClassVar[List[str]] = ["message"]
|
|
32
|
+
|
|
33
|
+
model_config = ConfigDict(
|
|
34
|
+
populate_by_name=True,
|
|
35
|
+
validate_assignment=True,
|
|
36
|
+
protected_namespaces=(),
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
def to_str(self) -> str:
|
|
40
|
+
"""Returns the string representation of the model using alias"""
|
|
41
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
42
|
+
|
|
43
|
+
def to_json(self) -> str:
|
|
44
|
+
"""Returns the JSON representation of the model using alias"""
|
|
45
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
46
|
+
return json.dumps(self.to_dict())
|
|
47
|
+
|
|
48
|
+
@classmethod
|
|
49
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
50
|
+
"""Create an instance of Message from a JSON string"""
|
|
51
|
+
return cls.from_dict(json.loads(json_str))
|
|
52
|
+
|
|
53
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
54
|
+
"""Return the dictionary representation of the model using alias.
|
|
55
|
+
|
|
56
|
+
This has the following differences from calling pydantic's
|
|
57
|
+
`self.model_dump(by_alias=True)`:
|
|
58
|
+
|
|
59
|
+
* `None` is only added to the output dict for nullable fields that
|
|
60
|
+
were set at model initialization. Other fields with value `None`
|
|
61
|
+
are ignored.
|
|
62
|
+
"""
|
|
63
|
+
excluded_fields: Set[str] = set([])
|
|
64
|
+
|
|
65
|
+
_dict = self.model_dump(
|
|
66
|
+
by_alias=True,
|
|
67
|
+
exclude=excluded_fields,
|
|
68
|
+
exclude_none=True,
|
|
69
|
+
)
|
|
70
|
+
return _dict
|
|
71
|
+
|
|
72
|
+
@classmethod
|
|
73
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
74
|
+
"""Create an instance of Message from a dict"""
|
|
75
|
+
if obj is None:
|
|
76
|
+
return None
|
|
77
|
+
|
|
78
|
+
if not isinstance(obj, dict):
|
|
79
|
+
return cls.model_validate(obj)
|
|
80
|
+
|
|
81
|
+
_obj = cls.model_validate({"message": obj.get("message")})
|
|
82
|
+
return _obj
|
|
@@ -0,0 +1,122 @@
|
|
|
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, StrictStr, field_validator
|
|
22
|
+
from typing_extensions import Annotated, Self
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class MetricsRelabelConfig(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
MetricsRelabelConfig
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
action: Optional[StrictStr] = "replace"
|
|
31
|
+
modulus: Optional[Annotated[int, Field(le=200, strict=True)]] = None
|
|
32
|
+
regex: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=400)]] = ".*"
|
|
33
|
+
replacement: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=200)]] = "$1"
|
|
34
|
+
separator: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=20)]] = ";"
|
|
35
|
+
source_labels: Annotated[
|
|
36
|
+
List[Annotated[str, Field(min_length=1, strict=True, max_length=200)]], Field(max_length=5)
|
|
37
|
+
] = Field(alias="sourceLabels")
|
|
38
|
+
target_label: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=200)]] = Field(
|
|
39
|
+
default=None, alias="targetLabel"
|
|
40
|
+
)
|
|
41
|
+
__properties: ClassVar[List[str]] = [
|
|
42
|
+
"action",
|
|
43
|
+
"modulus",
|
|
44
|
+
"regex",
|
|
45
|
+
"replacement",
|
|
46
|
+
"separator",
|
|
47
|
+
"sourceLabels",
|
|
48
|
+
"targetLabel",
|
|
49
|
+
]
|
|
50
|
+
|
|
51
|
+
@field_validator("action")
|
|
52
|
+
def action_validate_enum(cls, value):
|
|
53
|
+
"""Validates the enum"""
|
|
54
|
+
if value is None:
|
|
55
|
+
return value
|
|
56
|
+
|
|
57
|
+
if value not in set(["replace", "keep", "drop", "hashmod", "labelmap", "labeldrop", "labelkeep"]):
|
|
58
|
+
raise ValueError(
|
|
59
|
+
"must be one of enum values ('replace', 'keep', 'drop', 'hashmod', 'labelmap', 'labeldrop', 'labelkeep')"
|
|
60
|
+
)
|
|
61
|
+
return value
|
|
62
|
+
|
|
63
|
+
model_config = ConfigDict(
|
|
64
|
+
populate_by_name=True,
|
|
65
|
+
validate_assignment=True,
|
|
66
|
+
protected_namespaces=(),
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
def to_str(self) -> str:
|
|
70
|
+
"""Returns the string representation of the model using alias"""
|
|
71
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
72
|
+
|
|
73
|
+
def to_json(self) -> str:
|
|
74
|
+
"""Returns the JSON representation of the model using alias"""
|
|
75
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
76
|
+
return json.dumps(self.to_dict())
|
|
77
|
+
|
|
78
|
+
@classmethod
|
|
79
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
80
|
+
"""Create an instance of MetricsRelabelConfig from a JSON string"""
|
|
81
|
+
return cls.from_dict(json.loads(json_str))
|
|
82
|
+
|
|
83
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
84
|
+
"""Return the dictionary representation of the model using alias.
|
|
85
|
+
|
|
86
|
+
This has the following differences from calling pydantic's
|
|
87
|
+
`self.model_dump(by_alias=True)`:
|
|
88
|
+
|
|
89
|
+
* `None` is only added to the output dict for nullable fields that
|
|
90
|
+
were set at model initialization. Other fields with value `None`
|
|
91
|
+
are ignored.
|
|
92
|
+
"""
|
|
93
|
+
excluded_fields: Set[str] = set([])
|
|
94
|
+
|
|
95
|
+
_dict = self.model_dump(
|
|
96
|
+
by_alias=True,
|
|
97
|
+
exclude=excluded_fields,
|
|
98
|
+
exclude_none=True,
|
|
99
|
+
)
|
|
100
|
+
return _dict
|
|
101
|
+
|
|
102
|
+
@classmethod
|
|
103
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
104
|
+
"""Create an instance of MetricsRelabelConfig from a dict"""
|
|
105
|
+
if obj is None:
|
|
106
|
+
return None
|
|
107
|
+
|
|
108
|
+
if not isinstance(obj, dict):
|
|
109
|
+
return cls.model_validate(obj)
|
|
110
|
+
|
|
111
|
+
_obj = cls.model_validate(
|
|
112
|
+
{
|
|
113
|
+
"action": obj.get("action") if obj.get("action") is not None else "replace",
|
|
114
|
+
"modulus": obj.get("modulus"),
|
|
115
|
+
"regex": obj.get("regex") if obj.get("regex") is not None else ".*",
|
|
116
|
+
"replacement": obj.get("replacement") if obj.get("replacement") is not None else "$1",
|
|
117
|
+
"separator": obj.get("separator") if obj.get("separator") is not None else ";",
|
|
118
|
+
"sourceLabels": obj.get("sourceLabels"),
|
|
119
|
+
"targetLabel": obj.get("targetLabel"),
|
|
120
|
+
}
|
|
121
|
+
)
|
|
122
|
+
return _obj
|
|
@@ -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 Annotated, Self
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class ModelGlobal(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
ModelGlobal
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
opsgenie_api_key: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=200)]] = Field(
|
|
31
|
+
default=None, alias="opsgenieApiKey"
|
|
32
|
+
)
|
|
33
|
+
opsgenie_api_url: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=200)]] = Field(
|
|
34
|
+
default=None, alias="opsgenieApiUrl"
|
|
35
|
+
)
|
|
36
|
+
resolve_timeout: Optional[Annotated[str, Field(min_length=2, strict=True, max_length=8)]] = Field(
|
|
37
|
+
default="5m", alias="resolveTimeout"
|
|
38
|
+
)
|
|
39
|
+
smtp_auth_identity: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=200)]] = Field(
|
|
40
|
+
default=None, alias="smtpAuthIdentity"
|
|
41
|
+
)
|
|
42
|
+
smtp_auth_password: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=200)]] = Field(
|
|
43
|
+
default=None, alias="smtpAuthPassword"
|
|
44
|
+
)
|
|
45
|
+
smtp_auth_username: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=200)]] = Field(
|
|
46
|
+
default=None, alias="smtpAuthUsername"
|
|
47
|
+
)
|
|
48
|
+
smtp_from: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=200)]] = Field(
|
|
49
|
+
default=None, alias="smtpFrom"
|
|
50
|
+
)
|
|
51
|
+
smtp_smarthost: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=200)]] = Field(
|
|
52
|
+
default=None, alias="smtpSmarthost"
|
|
53
|
+
)
|
|
54
|
+
__properties: ClassVar[List[str]] = [
|
|
55
|
+
"opsgenieApiKey",
|
|
56
|
+
"opsgenieApiUrl",
|
|
57
|
+
"resolveTimeout",
|
|
58
|
+
"smtpAuthIdentity",
|
|
59
|
+
"smtpAuthPassword",
|
|
60
|
+
"smtpAuthUsername",
|
|
61
|
+
"smtpFrom",
|
|
62
|
+
"smtpSmarthost",
|
|
63
|
+
]
|
|
64
|
+
|
|
65
|
+
model_config = ConfigDict(
|
|
66
|
+
populate_by_name=True,
|
|
67
|
+
validate_assignment=True,
|
|
68
|
+
protected_namespaces=(),
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
def to_str(self) -> str:
|
|
72
|
+
"""Returns the string representation of the model using alias"""
|
|
73
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
74
|
+
|
|
75
|
+
def to_json(self) -> str:
|
|
76
|
+
"""Returns the JSON representation of the model using alias"""
|
|
77
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
78
|
+
return json.dumps(self.to_dict())
|
|
79
|
+
|
|
80
|
+
@classmethod
|
|
81
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
82
|
+
"""Create an instance of ModelGlobal from a JSON string"""
|
|
83
|
+
return cls.from_dict(json.loads(json_str))
|
|
84
|
+
|
|
85
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
86
|
+
"""Return the dictionary representation of the model using alias.
|
|
87
|
+
|
|
88
|
+
This has the following differences from calling pydantic's
|
|
89
|
+
`self.model_dump(by_alias=True)`:
|
|
90
|
+
|
|
91
|
+
* `None` is only added to the output dict for nullable fields that
|
|
92
|
+
were set at model initialization. Other fields with value `None`
|
|
93
|
+
are ignored.
|
|
94
|
+
"""
|
|
95
|
+
excluded_fields: Set[str] = set([])
|
|
96
|
+
|
|
97
|
+
_dict = self.model_dump(
|
|
98
|
+
by_alias=True,
|
|
99
|
+
exclude=excluded_fields,
|
|
100
|
+
exclude_none=True,
|
|
101
|
+
)
|
|
102
|
+
return _dict
|
|
103
|
+
|
|
104
|
+
@classmethod
|
|
105
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
106
|
+
"""Create an instance of ModelGlobal 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
|
+
"opsgenieApiKey": obj.get("opsgenieApiKey"),
|
|
116
|
+
"opsgenieApiUrl": obj.get("opsgenieApiUrl"),
|
|
117
|
+
"resolveTimeout": obj.get("resolveTimeout") if obj.get("resolveTimeout") is not None else "5m",
|
|
118
|
+
"smtpAuthIdentity": obj.get("smtpAuthIdentity"),
|
|
119
|
+
"smtpAuthPassword": obj.get("smtpAuthPassword"),
|
|
120
|
+
"smtpAuthUsername": obj.get("smtpAuthUsername"),
|
|
121
|
+
"smtpFrom": obj.get("smtpFrom"),
|
|
122
|
+
"smtpSmarthost": obj.get("smtpSmarthost"),
|
|
123
|
+
}
|
|
124
|
+
)
|
|
125
|
+
return _obj
|