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,92 @@
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 CreateAlertConfigReceiverPayloadWebHookConfigsInner(BaseModel):
26
+ """
27
+ CreateAlertConfigReceiverPayloadWebHookConfigsInner
28
+ """
29
+
30
+ ms_teams: Optional[StrictBool] = Field(
31
+ default=False,
32
+ description="Microsoft Teams webhooks require special handling. If you set this property to true, it is treated as such",
33
+ alias="msTeams",
34
+ )
35
+ url: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=500)]] = Field(
36
+ default=None,
37
+ description="The endpoint to send HTTP POST requests to. `Additional Validators:` * must be a syntactically valid url address",
38
+ )
39
+ __properties: ClassVar[List[str]] = ["msTeams", "url"]
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 CreateAlertConfigReceiverPayloadWebHookConfigsInner 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 CreateAlertConfigReceiverPayloadWebHookConfigsInner 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
+ {"msTeams": obj.get("msTeams") if obj.get("msTeams") is not None else False, "url": obj.get("url")}
91
+ )
92
+ 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 CreateAlertConfigRoutePayload(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 CreateAlertConfigRoutePayload 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 CreateAlertConfigRoutePayload 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,119 @@
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 CreateAlertConfigRoutePayloadRoutesInner(BaseModel):
26
+ """
27
+ As in one level above
28
+ """
29
+
30
+ group_by: Optional[List[Annotated[str, Field(min_length=1, strict=True, max_length=200)]]] = Field(
31
+ default=None, alias="groupBy"
32
+ )
33
+ group_interval: Optional[Annotated[str, Field(min_length=2, strict=True, max_length=8)]] = Field(
34
+ default=None, description="As in one level above", alias="groupInterval"
35
+ )
36
+ group_wait: Optional[Annotated[str, Field(strict=True, max_length=8)]] = Field(
37
+ default=None, description="As in one level above", alias="groupWait"
38
+ )
39
+ match: Optional[Dict[str, Any]] = Field(default=None, description="As in one level above")
40
+ match_re: Optional[Dict[str, Any]] = Field(default=None, description="As in one level above", alias="matchRe")
41
+ receiver: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=100)]] = Field(
42
+ default=None, description="As in one level above"
43
+ )
44
+ repeat_interval: Optional[Annotated[str, Field(min_length=2, strict=True, max_length=8)]] = Field(
45
+ default=None, description="As in one level above", alias="repeatInterval"
46
+ )
47
+ routes: Optional[List[Dict[str, Any]]] = Field(default=None, description="Another child routes")
48
+ __properties: ClassVar[List[str]] = [
49
+ "groupBy",
50
+ "groupInterval",
51
+ "groupWait",
52
+ "match",
53
+ "matchRe",
54
+ "receiver",
55
+ "repeatInterval",
56
+ "routes",
57
+ ]
58
+
59
+ model_config = ConfigDict(
60
+ populate_by_name=True,
61
+ validate_assignment=True,
62
+ protected_namespaces=(),
63
+ )
64
+
65
+ def to_str(self) -> str:
66
+ """Returns the string representation of the model using alias"""
67
+ return pprint.pformat(self.model_dump(by_alias=True))
68
+
69
+ def to_json(self) -> str:
70
+ """Returns the JSON representation of the model using alias"""
71
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
72
+ return json.dumps(self.to_dict())
73
+
74
+ @classmethod
75
+ def from_json(cls, json_str: str) -> Optional[Self]:
76
+ """Create an instance of CreateAlertConfigRoutePayloadRoutesInner from a JSON string"""
77
+ return cls.from_dict(json.loads(json_str))
78
+
79
+ def to_dict(self) -> Dict[str, Any]:
80
+ """Return the dictionary representation of the model using alias.
81
+
82
+ This has the following differences from calling pydantic's
83
+ `self.model_dump(by_alias=True)`:
84
+
85
+ * `None` is only added to the output dict for nullable fields that
86
+ were set at model initialization. Other fields with value `None`
87
+ are ignored.
88
+ """
89
+ excluded_fields: Set[str] = set([])
90
+
91
+ _dict = self.model_dump(
92
+ by_alias=True,
93
+ exclude=excluded_fields,
94
+ exclude_none=True,
95
+ )
96
+ return _dict
97
+
98
+ @classmethod
99
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
100
+ """Create an instance of CreateAlertConfigRoutePayloadRoutesInner from a dict"""
101
+ if obj is None:
102
+ return None
103
+
104
+ if not isinstance(obj, dict):
105
+ return cls.model_validate(obj)
106
+
107
+ _obj = cls.model_validate(
108
+ {
109
+ "groupBy": obj.get("groupBy"),
110
+ "groupInterval": obj.get("groupInterval"),
111
+ "groupWait": obj.get("groupWait"),
112
+ "match": obj.get("match"),
113
+ "matchRe": obj.get("matchRe"),
114
+ "receiver": obj.get("receiver"),
115
+ "repeatInterval": obj.get("repeatInterval"),
116
+ "routes": obj.get("routes"),
117
+ }
118
+ )
119
+ return _obj
@@ -0,0 +1,95 @@
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.credentials import Credentials
25
+
26
+
27
+ class CreateCredentialsResponse(BaseModel):
28
+ """
29
+ CreateCredentialsResponse
30
+ """
31
+
32
+ credentials: Credentials
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 CreateCredentialsResponse 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 credentials
74
+ if self.credentials:
75
+ _dict["credentials"] = self.credentials.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 CreateCredentialsResponse 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
+ "credentials": (
90
+ Credentials.from_dict(obj["credentials"]) if obj.get("credentials") is not None else None
91
+ ),
92
+ "message": obj.get("message"),
93
+ }
94
+ )
95
+ return _obj
@@ -0,0 +1,88 @@
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
22
+ from typing_extensions import Annotated, Self
23
+
24
+
25
+ class CreateInstancePayload(BaseModel):
26
+ """
27
+ Create update instance body.
28
+ """
29
+
30
+ name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=200)]] = Field(
31
+ default=None, description="Name of the service"
32
+ )
33
+ parameter: Optional[Dict[str, Any]] = Field(default=None, description="additional parameters")
34
+ plan_id: StrictStr = Field(description="uuid of the plan to create/update", alias="planId")
35
+ __properties: ClassVar[List[str]] = ["name", "parameter", "planId"]
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 CreateInstancePayload 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 CreateInstancePayload 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(
86
+ {"name": obj.get("name"), "parameter": obj.get("parameter"), "planId": obj.get("planId")}
87
+ )
88
+ return _obj
@@ -0,0 +1,90 @@
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 CreateInstanceResponse(BaseModel):
26
+ """
27
+ CreateInstanceResponse
28
+ """
29
+
30
+ dashboard_url: Annotated[str, Field(min_length=1, strict=True)] = Field(alias="dashboardUrl")
31
+ instance_id: Annotated[str, Field(min_length=1, strict=True)] = Field(alias="instanceId")
32
+ message: Annotated[str, Field(min_length=1, strict=True)]
33
+ __properties: ClassVar[List[str]] = ["dashboardUrl", "instanceId", "message"]
34
+
35
+ model_config = ConfigDict(
36
+ populate_by_name=True,
37
+ validate_assignment=True,
38
+ protected_namespaces=(),
39
+ )
40
+
41
+ def to_str(self) -> str:
42
+ """Returns the string representation of the model using alias"""
43
+ return pprint.pformat(self.model_dump(by_alias=True))
44
+
45
+ def to_json(self) -> str:
46
+ """Returns the JSON representation of the model using alias"""
47
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48
+ return json.dumps(self.to_dict())
49
+
50
+ @classmethod
51
+ def from_json(cls, json_str: str) -> Optional[Self]:
52
+ """Create an instance of CreateInstanceResponse from a JSON string"""
53
+ return cls.from_dict(json.loads(json_str))
54
+
55
+ def to_dict(self) -> Dict[str, Any]:
56
+ """Return the dictionary representation of the model using alias.
57
+
58
+ This has the following differences from calling pydantic's
59
+ `self.model_dump(by_alias=True)`:
60
+
61
+ * `None` is only added to the output dict for nullable fields that
62
+ were set at model initialization. Other fields with value `None`
63
+ are ignored.
64
+ """
65
+ excluded_fields: Set[str] = set([])
66
+
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude=excluded_fields,
70
+ exclude_none=True,
71
+ )
72
+ return _dict
73
+
74
+ @classmethod
75
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
76
+ """Create an instance of CreateInstanceResponse from a dict"""
77
+ if obj is None:
78
+ return None
79
+
80
+ if not isinstance(obj, dict):
81
+ return cls.model_validate(obj)
82
+
83
+ _obj = cls.model_validate(
84
+ {
85
+ "dashboardUrl": obj.get("dashboardUrl"),
86
+ "instanceId": obj.get("instanceId"),
87
+ "message": obj.get("message"),
88
+ }
89
+ )
90
+ return _obj