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,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.tls_config import TLSConfig
25
+
26
+
27
+ class OAuth2(BaseModel):
28
+ """
29
+ OAuth2
30
+ """
31
+
32
+ client_id: Annotated[str, Field(min_length=1, strict=True, max_length=200)] = Field(alias="clientId")
33
+ client_secret: Annotated[str, Field(min_length=1, strict=True, max_length=200)] = Field(alias="clientSecret")
34
+ scopes: Optional[
35
+ Annotated[List[Annotated[str, Field(min_length=1, strict=True, max_length=100)]], Field(max_length=10)]
36
+ ] = None
37
+ tls_config: Optional[TLSConfig] = Field(default=None, alias="tlsConfig")
38
+ token_url: Annotated[str, Field(min_length=1, strict=True, max_length=200)] = Field(alias="tokenUrl")
39
+ __properties: ClassVar[List[str]] = ["clientId", "clientSecret", "scopes", "tlsConfig", "tokenUrl"]
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 OAuth2 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 tls_config
79
+ if self.tls_config:
80
+ _dict["tlsConfig"] = self.tls_config.to_dict()
81
+ return _dict
82
+
83
+ @classmethod
84
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
85
+ """Create an instance of OAuth2 from a dict"""
86
+ if obj is None:
87
+ return None
88
+
89
+ if not isinstance(obj, dict):
90
+ return cls.model_validate(obj)
91
+
92
+ _obj = cls.model_validate(
93
+ {
94
+ "clientId": obj.get("clientId"),
95
+ "clientSecret": obj.get("clientSecret"),
96
+ "scopes": obj.get("scopes"),
97
+ "tlsConfig": TLSConfig.from_dict(obj["tlsConfig"]) if obj.get("tlsConfig") is not None else None,
98
+ "tokenUrl": obj.get("tokenUrl"),
99
+ }
100
+ )
101
+ return _obj
@@ -0,0 +1,98 @@
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 Annotated, Self
23
+
24
+
25
+ class OpsgenieConfig(BaseModel):
26
+ """
27
+ OpsgenieConfig
28
+ """
29
+
30
+ api_key: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=200)]] = Field(
31
+ default=None, alias="apiKey"
32
+ )
33
+ api_url: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=400)]] = Field(
34
+ default=None, alias="apiUrl"
35
+ )
36
+ priority: Optional[Annotated[str, Field(min_length=2, strict=True, max_length=2)]] = None
37
+ send_resolved: Optional[StrictBool] = Field(default=True, alias="sendResolved")
38
+ tags: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=400)]] = None
39
+ __properties: ClassVar[List[str]] = ["apiKey", "apiUrl", "priority", "sendResolved", "tags"]
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 OpsgenieConfig 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
+ return _dict
79
+
80
+ @classmethod
81
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
82
+ """Create an instance of OpsgenieConfig from a dict"""
83
+ if obj is None:
84
+ return None
85
+
86
+ if not isinstance(obj, dict):
87
+ return cls.model_validate(obj)
88
+
89
+ _obj = cls.model_validate(
90
+ {
91
+ "apiKey": obj.get("apiKey"),
92
+ "apiUrl": obj.get("apiUrl"),
93
+ "priority": obj.get("priority"),
94
+ "sendResolved": obj.get("sendResolved") if obj.get("sendResolved") is not None else True,
95
+ "tags": obj.get("tags"),
96
+ }
97
+ )
98
+ 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 PermissionDenied(BaseModel):
26
+ """
27
+ PermissionDenied
28
+ """
29
+
30
+ detail: Annotated[str, Field(min_length=1, strict=True)]
31
+ __properties: ClassVar[List[str]] = ["detail"]
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 PermissionDenied 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 PermissionDenied 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({"detail": obj.get("detail")})
82
+ return _obj
@@ -0,0 +1,156 @@
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, StrictBool, StrictInt, StrictStr
22
+ from typing_extensions import Annotated, Self
23
+
24
+
25
+ class Plan(BaseModel):
26
+ """
27
+ Plan
28
+ """
29
+
30
+ alert_matchers: StrictInt = Field(alias="alertMatchers")
31
+ alert_receivers: StrictInt = Field(alias="alertReceivers")
32
+ alert_rules: StrictInt = Field(alias="alertRules")
33
+ amount: Optional[
34
+ Union[
35
+ Annotated[float, Field(le=10000000, strict=True, ge=0)],
36
+ Annotated[int, Field(le=10000000, strict=True, ge=0)],
37
+ ]
38
+ ] = None
39
+ bucket_size: Annotated[int, Field(strict=True, ge=0)] = Field(alias="bucketSize")
40
+ description: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = None
41
+ grafana_global_dashboards: StrictInt = Field(alias="grafanaGlobalDashboards")
42
+ grafana_global_orgs: StrictInt = Field(alias="grafanaGlobalOrgs")
43
+ grafana_global_sessions: StrictInt = Field(alias="grafanaGlobalSessions")
44
+ grafana_global_users: StrictInt = Field(alias="grafanaGlobalUsers")
45
+ id: StrictStr
46
+ is_free: Optional[StrictBool] = Field(default=False, alias="isFree")
47
+ is_public: Optional[StrictBool] = Field(default=True, alias="isPublic")
48
+ logs_alert: StrictInt = Field(alias="logsAlert")
49
+ logs_storage: StrictInt = Field(alias="logsStorage")
50
+ name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=500)]] = None
51
+ plan_id: StrictStr = Field(alias="planId")
52
+ samples_per_scrape: StrictInt = Field(alias="samplesPerScrape")
53
+ var_schema: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default="", alias="schema")
54
+ target_number: StrictInt = Field(alias="targetNumber")
55
+ total_metric_samples: StrictInt = Field(alias="totalMetricSamples")
56
+ traces_storage: StrictInt = Field(alias="tracesStorage")
57
+ __properties: ClassVar[List[str]] = [
58
+ "alertMatchers",
59
+ "alertReceivers",
60
+ "alertRules",
61
+ "amount",
62
+ "bucketSize",
63
+ "description",
64
+ "grafanaGlobalDashboards",
65
+ "grafanaGlobalOrgs",
66
+ "grafanaGlobalSessions",
67
+ "grafanaGlobalUsers",
68
+ "id",
69
+ "isFree",
70
+ "isPublic",
71
+ "logsAlert",
72
+ "logsStorage",
73
+ "name",
74
+ "planId",
75
+ "samplesPerScrape",
76
+ "schema",
77
+ "targetNumber",
78
+ "totalMetricSamples",
79
+ "tracesStorage",
80
+ ]
81
+
82
+ model_config = ConfigDict(
83
+ populate_by_name=True,
84
+ validate_assignment=True,
85
+ protected_namespaces=(),
86
+ )
87
+
88
+ def to_str(self) -> str:
89
+ """Returns the string representation of the model using alias"""
90
+ return pprint.pformat(self.model_dump(by_alias=True))
91
+
92
+ def to_json(self) -> str:
93
+ """Returns the JSON representation of the model using alias"""
94
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
95
+ return json.dumps(self.to_dict())
96
+
97
+ @classmethod
98
+ def from_json(cls, json_str: str) -> Optional[Self]:
99
+ """Create an instance of Plan from a JSON string"""
100
+ return cls.from_dict(json.loads(json_str))
101
+
102
+ def to_dict(self) -> Dict[str, Any]:
103
+ """Return the dictionary representation of the model using alias.
104
+
105
+ This has the following differences from calling pydantic's
106
+ `self.model_dump(by_alias=True)`:
107
+
108
+ * `None` is only added to the output dict for nullable fields that
109
+ were set at model initialization. Other fields with value `None`
110
+ are ignored.
111
+ """
112
+ excluded_fields: Set[str] = set([])
113
+
114
+ _dict = self.model_dump(
115
+ by_alias=True,
116
+ exclude=excluded_fields,
117
+ exclude_none=True,
118
+ )
119
+ return _dict
120
+
121
+ @classmethod
122
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
123
+ """Create an instance of Plan from a dict"""
124
+ if obj is None:
125
+ return None
126
+
127
+ if not isinstance(obj, dict):
128
+ return cls.model_validate(obj)
129
+
130
+ _obj = cls.model_validate(
131
+ {
132
+ "alertMatchers": obj.get("alertMatchers"),
133
+ "alertReceivers": obj.get("alertReceivers"),
134
+ "alertRules": obj.get("alertRules"),
135
+ "amount": obj.get("amount"),
136
+ "bucketSize": obj.get("bucketSize"),
137
+ "description": obj.get("description"),
138
+ "grafanaGlobalDashboards": obj.get("grafanaGlobalDashboards"),
139
+ "grafanaGlobalOrgs": obj.get("grafanaGlobalOrgs"),
140
+ "grafanaGlobalSessions": obj.get("grafanaGlobalSessions"),
141
+ "grafanaGlobalUsers": obj.get("grafanaGlobalUsers"),
142
+ "id": obj.get("id"),
143
+ "isFree": obj.get("isFree") if obj.get("isFree") is not None else False,
144
+ "isPublic": obj.get("isPublic") if obj.get("isPublic") is not None else True,
145
+ "logsAlert": obj.get("logsAlert"),
146
+ "logsStorage": obj.get("logsStorage"),
147
+ "name": obj.get("name"),
148
+ "planId": obj.get("planId"),
149
+ "samplesPerScrape": obj.get("samplesPerScrape"),
150
+ "schema": obj.get("schema") if obj.get("schema") is not None else "",
151
+ "targetNumber": obj.get("targetNumber"),
152
+ "totalMetricSamples": obj.get("totalMetricSamples"),
153
+ "tracesStorage": obj.get("tracesStorage"),
154
+ }
155
+ )
156
+ return _obj
@@ -0,0 +1,147 @@
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, StrictInt, StrictStr
22
+ from typing_extensions import Annotated, Self
23
+
24
+
25
+ class PlanModel(BaseModel):
26
+ """
27
+ PlanModel
28
+ """
29
+
30
+ alert_matchers: StrictInt = Field(alias="alertMatchers")
31
+ alert_receivers: StrictInt = Field(alias="alertReceivers")
32
+ alert_rules: StrictInt = Field(alias="alertRules")
33
+ amount: Optional[
34
+ Union[
35
+ Annotated[float, Field(le=10000000, strict=True, ge=0)],
36
+ Annotated[int, Field(le=10000000, strict=True, ge=0)],
37
+ ]
38
+ ] = None
39
+ bucket_size: Annotated[int, Field(strict=True, ge=0)] = Field(alias="bucketSize")
40
+ description: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = None
41
+ grafana_global_dashboards: StrictInt = Field(alias="grafanaGlobalDashboards")
42
+ grafana_global_orgs: StrictInt = Field(alias="grafanaGlobalOrgs")
43
+ grafana_global_sessions: StrictInt = Field(alias="grafanaGlobalSessions")
44
+ grafana_global_users: StrictInt = Field(alias="grafanaGlobalUsers")
45
+ id: StrictStr
46
+ logs_alert: StrictInt = Field(alias="logsAlert")
47
+ logs_storage: StrictInt = Field(alias="logsStorage")
48
+ name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=500)]] = None
49
+ plan_id: StrictStr = Field(alias="planId")
50
+ samples_per_scrape: StrictInt = Field(alias="samplesPerScrape")
51
+ target_number: StrictInt = Field(alias="targetNumber")
52
+ total_metric_samples: StrictInt = Field(alias="totalMetricSamples")
53
+ traces_storage: StrictInt = Field(alias="tracesStorage")
54
+ __properties: ClassVar[List[str]] = [
55
+ "alertMatchers",
56
+ "alertReceivers",
57
+ "alertRules",
58
+ "amount",
59
+ "bucketSize",
60
+ "description",
61
+ "grafanaGlobalDashboards",
62
+ "grafanaGlobalOrgs",
63
+ "grafanaGlobalSessions",
64
+ "grafanaGlobalUsers",
65
+ "id",
66
+ "logsAlert",
67
+ "logsStorage",
68
+ "name",
69
+ "planId",
70
+ "samplesPerScrape",
71
+ "targetNumber",
72
+ "totalMetricSamples",
73
+ "tracesStorage",
74
+ ]
75
+
76
+ model_config = ConfigDict(
77
+ populate_by_name=True,
78
+ validate_assignment=True,
79
+ protected_namespaces=(),
80
+ )
81
+
82
+ def to_str(self) -> str:
83
+ """Returns the string representation of the model using alias"""
84
+ return pprint.pformat(self.model_dump(by_alias=True))
85
+
86
+ def to_json(self) -> str:
87
+ """Returns the JSON representation of the model using alias"""
88
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
89
+ return json.dumps(self.to_dict())
90
+
91
+ @classmethod
92
+ def from_json(cls, json_str: str) -> Optional[Self]:
93
+ """Create an instance of PlanModel from a JSON string"""
94
+ return cls.from_dict(json.loads(json_str))
95
+
96
+ def to_dict(self) -> Dict[str, Any]:
97
+ """Return the dictionary representation of the model using alias.
98
+
99
+ This has the following differences from calling pydantic's
100
+ `self.model_dump(by_alias=True)`:
101
+
102
+ * `None` is only added to the output dict for nullable fields that
103
+ were set at model initialization. Other fields with value `None`
104
+ are ignored.
105
+ """
106
+ excluded_fields: Set[str] = set([])
107
+
108
+ _dict = self.model_dump(
109
+ by_alias=True,
110
+ exclude=excluded_fields,
111
+ exclude_none=True,
112
+ )
113
+ return _dict
114
+
115
+ @classmethod
116
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
117
+ """Create an instance of PlanModel from a dict"""
118
+ if obj is None:
119
+ return None
120
+
121
+ if not isinstance(obj, dict):
122
+ return cls.model_validate(obj)
123
+
124
+ _obj = cls.model_validate(
125
+ {
126
+ "alertMatchers": obj.get("alertMatchers"),
127
+ "alertReceivers": obj.get("alertReceivers"),
128
+ "alertRules": obj.get("alertRules"),
129
+ "amount": obj.get("amount"),
130
+ "bucketSize": obj.get("bucketSize"),
131
+ "description": obj.get("description"),
132
+ "grafanaGlobalDashboards": obj.get("grafanaGlobalDashboards"),
133
+ "grafanaGlobalOrgs": obj.get("grafanaGlobalOrgs"),
134
+ "grafanaGlobalSessions": obj.get("grafanaGlobalSessions"),
135
+ "grafanaGlobalUsers": obj.get("grafanaGlobalUsers"),
136
+ "id": obj.get("id"),
137
+ "logsAlert": obj.get("logsAlert"),
138
+ "logsStorage": obj.get("logsStorage"),
139
+ "name": obj.get("name"),
140
+ "planId": obj.get("planId"),
141
+ "samplesPerScrape": obj.get("samplesPerScrape"),
142
+ "targetNumber": obj.get("targetNumber"),
143
+ "totalMetricSamples": obj.get("totalMetricSamples"),
144
+ "tracesStorage": obj.get("tracesStorage"),
145
+ }
146
+ )
147
+ 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.plan import Plan
25
+
26
+
27
+ class PlansResponse(BaseModel):
28
+ """
29
+ PlansResponse
30
+ """
31
+
32
+ message: Annotated[str, Field(min_length=1, strict=True)]
33
+ plans: List[Plan]
34
+ __properties: ClassVar[List[str]] = ["message", "plans"]
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 PlansResponse 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 plans (list)
74
+ _items = []
75
+ if self.plans:
76
+ for _item in self.plans:
77
+ if _item:
78
+ _items.append(_item.to_dict())
79
+ _dict["plans"] = _items
80
+ return _dict
81
+
82
+ @classmethod
83
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
84
+ """Create an instance of PlansResponse 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
+ "message": obj.get("message"),
94
+ "plans": [Plan.from_dict(_item) for _item in obj["plans"]] if obj.get("plans") is not None else None,
95
+ }
96
+ )
97
+ return _obj