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.
Files changed (91) hide show
  1. stackit/observability/__init__.py +190 -0
  2. stackit/observability/api/__init__.py +4 -0
  3. stackit/observability/api/default_api.py +9455 -0
  4. stackit/observability/api_client.py +627 -0
  5. stackit/observability/api_response.py +23 -0
  6. stackit/observability/configuration.py +112 -0
  7. stackit/observability/exceptions.py +199 -0
  8. stackit/observability/models/__init__.py +171 -0
  9. stackit/observability/models/alert.py +125 -0
  10. stackit/observability/models/alert_config_receivers_response.py +97 -0
  11. stackit/observability/models/alert_config_route_response.py +93 -0
  12. stackit/observability/models/basic_auth.py +83 -0
  13. stackit/observability/models/create_alert_config_receiver_payload.py +152 -0
  14. stackit/observability/models/create_alert_config_receiver_payload_email_configs_inner.py +114 -0
  15. stackit/observability/models/create_alert_config_receiver_payload_opsgenie_configs_inner.py +94 -0
  16. stackit/observability/models/create_alert_config_receiver_payload_web_hook_configs_inner.py +92 -0
  17. stackit/observability/models/create_alert_config_route_payload.py +157 -0
  18. stackit/observability/models/create_alert_config_route_payload_routes_inner.py +119 -0
  19. stackit/observability/models/create_credentials_response.py +95 -0
  20. stackit/observability/models/create_instance_payload.py +88 -0
  21. stackit/observability/models/create_instance_response.py +90 -0
  22. stackit/observability/models/create_scrape_config_payload.py +267 -0
  23. stackit/observability/models/create_scrape_config_payload_basic_auth.py +87 -0
  24. stackit/observability/models/create_scrape_config_payload_http_sd_configs_inner.py +133 -0
  25. stackit/observability/models/create_scrape_config_payload_http_sd_configs_inner_oauth2.py +115 -0
  26. stackit/observability/models/create_scrape_config_payload_http_sd_configs_inner_oauth2_tls_config.py +90 -0
  27. stackit/observability/models/create_scrape_config_payload_metrics_relabel_configs_inner.py +146 -0
  28. stackit/observability/models/create_scrape_config_payload_static_configs_inner.py +88 -0
  29. stackit/observability/models/credentials.py +83 -0
  30. stackit/observability/models/credentials_remote_write_config.py +90 -0
  31. stackit/observability/models/credentials_remote_write_delete_response.py +83 -0
  32. stackit/observability/models/delete_scrape_config_response.py +97 -0
  33. stackit/observability/models/email_config.py +114 -0
  34. stackit/observability/models/error.py +83 -0
  35. stackit/observability/models/get_alert_configs_response.py +93 -0
  36. stackit/observability/models/get_credentials_response.py +92 -0
  37. stackit/observability/models/get_instance_response.py +164 -0
  38. stackit/observability/models/get_metrics_storage_retention_response.py +103 -0
  39. stackit/observability/models/get_scrape_config_response.py +90 -0
  40. stackit/observability/models/grafana_configs.py +99 -0
  41. stackit/observability/models/grafana_oauth.py +124 -0
  42. stackit/observability/models/http_service_sd.py +109 -0
  43. stackit/observability/models/inhibit_rules.py +120 -0
  44. stackit/observability/models/instance.py +155 -0
  45. stackit/observability/models/instance_response.py +82 -0
  46. stackit/observability/models/instance_sensitive_data.py +159 -0
  47. stackit/observability/models/job.py +207 -0
  48. stackit/observability/models/list_acl_response.py +83 -0
  49. stackit/observability/models/list_credentials_response.py +101 -0
  50. stackit/observability/models/list_instances_response.py +101 -0
  51. stackit/observability/models/list_scrape_configs_response.py +97 -0
  52. stackit/observability/models/message.py +82 -0
  53. stackit/observability/models/metrics_relabel_config.py +122 -0
  54. stackit/observability/models/model_global.py +125 -0
  55. stackit/observability/models/o_auth2.py +101 -0
  56. stackit/observability/models/opsgenie_config.py +98 -0
  57. stackit/observability/models/permission_denied.py +82 -0
  58. stackit/observability/models/plan.py +156 -0
  59. stackit/observability/models/plan_model.py +147 -0
  60. stackit/observability/models/plans_response.py +97 -0
  61. stackit/observability/models/project_instance_full.py +124 -0
  62. stackit/observability/models/receiver.py +93 -0
  63. stackit/observability/models/receivers.py +129 -0
  64. stackit/observability/models/route.py +135 -0
  65. stackit/observability/models/route_serializer.py +127 -0
  66. stackit/observability/models/scrape_configs_response.py +97 -0
  67. stackit/observability/models/service_keys_list.py +86 -0
  68. stackit/observability/models/static_configs.py +83 -0
  69. stackit/observability/models/tls_config.py +88 -0
  70. stackit/observability/models/update_acl_payload.py +82 -0
  71. stackit/observability/models/update_alert_config_receiver_payload.py +152 -0
  72. stackit/observability/models/update_alert_config_route_payload.py +157 -0
  73. stackit/observability/models/update_alert_configs_payload.py +133 -0
  74. stackit/observability/models/update_alert_configs_payload_global.py +139 -0
  75. stackit/observability/models/update_alert_configs_payload_inhibit_rules.py +113 -0
  76. stackit/observability/models/update_alert_configs_payload_receivers_inner.py +152 -0
  77. stackit/observability/models/update_alert_configs_payload_route.py +157 -0
  78. stackit/observability/models/update_alert_configs_response.py +93 -0
  79. stackit/observability/models/update_credentials_remote_write_config_payload.py +86 -0
  80. stackit/observability/models/update_grafana_configs_payload.py +109 -0
  81. stackit/observability/models/update_grafana_configs_payload_generic_oauth.py +135 -0
  82. stackit/observability/models/update_instance_payload.py +88 -0
  83. stackit/observability/models/update_metrics_storage_retention_payload.py +99 -0
  84. stackit/observability/models/update_scrape_config_payload.py +225 -0
  85. stackit/observability/models/update_scrape_config_payload_static_configs_inner.py +88 -0
  86. stackit/observability/models/web_hook.py +90 -0
  87. stackit/observability/py.typed +0 -0
  88. stackit/observability/rest.py +149 -0
  89. stackit_observability-0.0.1a0.dist-info/METADATA +44 -0
  90. stackit_observability-0.0.1a0.dist-info/RECORD +91 -0
  91. stackit_observability-0.0.1a0.dist-info/WHEEL +4 -0
@@ -0,0 +1,152 @@
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_receiver_payload_email_configs_inner import (
25
+ CreateAlertConfigReceiverPayloadEmailConfigsInner,
26
+ )
27
+ from stackit.observability.models.create_alert_config_receiver_payload_opsgenie_configs_inner import (
28
+ CreateAlertConfigReceiverPayloadOpsgenieConfigsInner,
29
+ )
30
+ from stackit.observability.models.create_alert_config_receiver_payload_web_hook_configs_inner import (
31
+ CreateAlertConfigReceiverPayloadWebHookConfigsInner,
32
+ )
33
+
34
+
35
+ class UpdateAlertConfigsPayloadReceiversInner(BaseModel):
36
+ """
37
+ Receivers
38
+ """
39
+
40
+ email_configs: Optional[List[CreateAlertConfigReceiverPayloadEmailConfigsInner]] = Field(
41
+ default=None, description="Email configurations", alias="emailConfigs"
42
+ )
43
+ name: Annotated[str, Field(min_length=1, strict=True, max_length=200)] = Field(
44
+ description="`Additional Validators:` * must be unique * should only include the characters: a-zA-Z0-9-"
45
+ )
46
+ opsgenie_configs: Optional[List[CreateAlertConfigReceiverPayloadOpsgenieConfigsInner]] = Field(
47
+ default=None, description="Configuration for ops genie.", alias="opsgenieConfigs"
48
+ )
49
+ web_hook_configs: Optional[List[CreateAlertConfigReceiverPayloadWebHookConfigsInner]] = Field(
50
+ default=None, alias="webHookConfigs"
51
+ )
52
+ __properties: ClassVar[List[str]] = ["emailConfigs", "name", "opsgenieConfigs", "webHookConfigs"]
53
+
54
+ model_config = ConfigDict(
55
+ populate_by_name=True,
56
+ validate_assignment=True,
57
+ protected_namespaces=(),
58
+ )
59
+
60
+ def to_str(self) -> str:
61
+ """Returns the string representation of the model using alias"""
62
+ return pprint.pformat(self.model_dump(by_alias=True))
63
+
64
+ def to_json(self) -> str:
65
+ """Returns the JSON representation of the model using alias"""
66
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
67
+ return json.dumps(self.to_dict())
68
+
69
+ @classmethod
70
+ def from_json(cls, json_str: str) -> Optional[Self]:
71
+ """Create an instance of UpdateAlertConfigsPayloadReceiversInner from a JSON string"""
72
+ return cls.from_dict(json.loads(json_str))
73
+
74
+ def to_dict(self) -> Dict[str, Any]:
75
+ """Return the dictionary representation of the model using alias.
76
+
77
+ This has the following differences from calling pydantic's
78
+ `self.model_dump(by_alias=True)`:
79
+
80
+ * `None` is only added to the output dict for nullable fields that
81
+ were set at model initialization. Other fields with value `None`
82
+ are ignored.
83
+ """
84
+ excluded_fields: Set[str] = set([])
85
+
86
+ _dict = self.model_dump(
87
+ by_alias=True,
88
+ exclude=excluded_fields,
89
+ exclude_none=True,
90
+ )
91
+ # override the default output from pydantic by calling `to_dict()` of each item in email_configs (list)
92
+ _items = []
93
+ if self.email_configs:
94
+ for _item in self.email_configs:
95
+ if _item:
96
+ _items.append(_item.to_dict())
97
+ _dict["emailConfigs"] = _items
98
+ # override the default output from pydantic by calling `to_dict()` of each item in opsgenie_configs (list)
99
+ _items = []
100
+ if self.opsgenie_configs:
101
+ for _item in self.opsgenie_configs:
102
+ if _item:
103
+ _items.append(_item.to_dict())
104
+ _dict["opsgenieConfigs"] = _items
105
+ # override the default output from pydantic by calling `to_dict()` of each item in web_hook_configs (list)
106
+ _items = []
107
+ if self.web_hook_configs:
108
+ for _item in self.web_hook_configs:
109
+ if _item:
110
+ _items.append(_item.to_dict())
111
+ _dict["webHookConfigs"] = _items
112
+ return _dict
113
+
114
+ @classmethod
115
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
116
+ """Create an instance of UpdateAlertConfigsPayloadReceiversInner from a dict"""
117
+ if obj is None:
118
+ return None
119
+
120
+ if not isinstance(obj, dict):
121
+ return cls.model_validate(obj)
122
+
123
+ _obj = cls.model_validate(
124
+ {
125
+ "emailConfigs": (
126
+ [
127
+ CreateAlertConfigReceiverPayloadEmailConfigsInner.from_dict(_item)
128
+ for _item in obj["emailConfigs"]
129
+ ]
130
+ if obj.get("emailConfigs") is not None
131
+ else None
132
+ ),
133
+ "name": obj.get("name"),
134
+ "opsgenieConfigs": (
135
+ [
136
+ CreateAlertConfigReceiverPayloadOpsgenieConfigsInner.from_dict(_item)
137
+ for _item in obj["opsgenieConfigs"]
138
+ ]
139
+ if obj.get("opsgenieConfigs") is not None
140
+ else None
141
+ ),
142
+ "webHookConfigs": (
143
+ [
144
+ CreateAlertConfigReceiverPayloadWebHookConfigsInner.from_dict(_item)
145
+ for _item in obj["webHookConfigs"]
146
+ ]
147
+ if obj.get("webHookConfigs") is not None
148
+ else None
149
+ ),
150
+ }
151
+ )
152
+ return _obj
@@ -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 UpdateAlertConfigsPayloadRoute(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 UpdateAlertConfigsPayloadRoute 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 UpdateAlertConfigsPayloadRoute 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,93 @@
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.alert import Alert
25
+
26
+
27
+ class UpdateAlertConfigsResponse(BaseModel):
28
+ """
29
+ UpdateAlertConfigsResponse
30
+ """
31
+
32
+ data: Alert
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 UpdateAlertConfigsResponse 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 data
74
+ if self.data:
75
+ _dict["data"] = self.data.to_dict()
76
+ return _dict
77
+
78
+ @classmethod
79
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
80
+ """Create an instance of UpdateAlertConfigsResponse from a dict"""
81
+ if obj is None:
82
+ return None
83
+
84
+ if not isinstance(obj, dict):
85
+ return cls.model_validate(obj)
86
+
87
+ _obj = cls.model_validate(
88
+ {
89
+ "data": Alert.from_dict(obj["data"]) if obj.get("data") is not None else None,
90
+ "message": obj.get("message"),
91
+ }
92
+ )
93
+ return _obj
@@ -0,0 +1,86 @@
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, Union
20
+
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt
22
+ from typing_extensions import Self
23
+
24
+
25
+ class UpdateCredentialsRemoteWriteConfigPayload(BaseModel):
26
+ """
27
+ Remote write limit config.
28
+ """
29
+
30
+ max_limit: Optional[Union[StrictFloat, StrictInt]] = Field(
31
+ default=None,
32
+ description="Remote write metric sample limit for credential to push in a single minute.",
33
+ alias="maxLimit",
34
+ )
35
+ __properties: ClassVar[List[str]] = ["maxLimit"]
36
+
37
+ model_config = ConfigDict(
38
+ populate_by_name=True,
39
+ validate_assignment=True,
40
+ protected_namespaces=(),
41
+ )
42
+
43
+ def to_str(self) -> str:
44
+ """Returns the string representation of the model using alias"""
45
+ return pprint.pformat(self.model_dump(by_alias=True))
46
+
47
+ def to_json(self) -> str:
48
+ """Returns the JSON representation of the model using alias"""
49
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
50
+ return json.dumps(self.to_dict())
51
+
52
+ @classmethod
53
+ def from_json(cls, json_str: str) -> Optional[Self]:
54
+ """Create an instance of UpdateCredentialsRemoteWriteConfigPayload from a JSON string"""
55
+ return cls.from_dict(json.loads(json_str))
56
+
57
+ def to_dict(self) -> Dict[str, Any]:
58
+ """Return the dictionary representation of the model using alias.
59
+
60
+ This has the following differences from calling pydantic's
61
+ `self.model_dump(by_alias=True)`:
62
+
63
+ * `None` is only added to the output dict for nullable fields that
64
+ were set at model initialization. Other fields with value `None`
65
+ are ignored.
66
+ """
67
+ excluded_fields: Set[str] = set([])
68
+
69
+ _dict = self.model_dump(
70
+ by_alias=True,
71
+ exclude=excluded_fields,
72
+ exclude_none=True,
73
+ )
74
+ return _dict
75
+
76
+ @classmethod
77
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
78
+ """Create an instance of UpdateCredentialsRemoteWriteConfigPayload from a dict"""
79
+ if obj is None:
80
+ return None
81
+
82
+ if not isinstance(obj, dict):
83
+ return cls.model_validate(obj)
84
+
85
+ _obj = cls.model_validate({"maxLimit": obj.get("maxLimit")})
86
+ return _obj
@@ -0,0 +1,109 @@
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, StrictBool
22
+ from typing_extensions import Self
23
+
24
+ from stackit.observability.models.update_grafana_configs_payload_generic_oauth import (
25
+ UpdateGrafanaConfigsPayloadGenericOauth,
26
+ )
27
+
28
+
29
+ class UpdateGrafanaConfigsPayload(BaseModel):
30
+ """
31
+ Sending any of the attributes results in a set of the attribute and overwrites any previous configuration.
32
+ """
33
+
34
+ generic_oauth: Optional[UpdateGrafanaConfigsPayloadGenericOauth] = Field(default=None, alias="genericOauth")
35
+ public_read_access: Optional[StrictBool] = Field(
36
+ default=None,
37
+ description="If it's true, anyone can access the Grafana dashboards without logging in. If it is wrong, a login is required.",
38
+ alias="publicReadAccess",
39
+ )
40
+ use_stackit_sso: Optional[StrictBool] = Field(
41
+ default=None,
42
+ description="If it's true, it overwrites the current genericOauth config and configures STACKIT SSO for this instance.",
43
+ alias="useStackitSso",
44
+ )
45
+ __properties: ClassVar[List[str]] = ["genericOauth", "publicReadAccess", "useStackitSso"]
46
+
47
+ model_config = ConfigDict(
48
+ populate_by_name=True,
49
+ validate_assignment=True,
50
+ protected_namespaces=(),
51
+ )
52
+
53
+ def to_str(self) -> str:
54
+ """Returns the string representation of the model using alias"""
55
+ return pprint.pformat(self.model_dump(by_alias=True))
56
+
57
+ def to_json(self) -> str:
58
+ """Returns the JSON representation of the model using alias"""
59
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
60
+ return json.dumps(self.to_dict())
61
+
62
+ @classmethod
63
+ def from_json(cls, json_str: str) -> Optional[Self]:
64
+ """Create an instance of UpdateGrafanaConfigsPayload from a JSON string"""
65
+ return cls.from_dict(json.loads(json_str))
66
+
67
+ def to_dict(self) -> Dict[str, Any]:
68
+ """Return the dictionary representation of the model using alias.
69
+
70
+ This has the following differences from calling pydantic's
71
+ `self.model_dump(by_alias=True)`:
72
+
73
+ * `None` is only added to the output dict for nullable fields that
74
+ were set at model initialization. Other fields with value `None`
75
+ are ignored.
76
+ """
77
+ excluded_fields: Set[str] = set([])
78
+
79
+ _dict = self.model_dump(
80
+ by_alias=True,
81
+ exclude=excluded_fields,
82
+ exclude_none=True,
83
+ )
84
+ # override the default output from pydantic by calling `to_dict()` of generic_oauth
85
+ if self.generic_oauth:
86
+ _dict["genericOauth"] = self.generic_oauth.to_dict()
87
+ return _dict
88
+
89
+ @classmethod
90
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
91
+ """Create an instance of UpdateGrafanaConfigsPayload from a dict"""
92
+ if obj is None:
93
+ return None
94
+
95
+ if not isinstance(obj, dict):
96
+ return cls.model_validate(obj)
97
+
98
+ _obj = cls.model_validate(
99
+ {
100
+ "genericOauth": (
101
+ UpdateGrafanaConfigsPayloadGenericOauth.from_dict(obj["genericOauth"])
102
+ if obj.get("genericOauth") is not None
103
+ else None
104
+ ),
105
+ "publicReadAccess": obj.get("publicReadAccess"),
106
+ "useStackitSso": obj.get("useStackitSso"),
107
+ }
108
+ )
109
+ return _obj