Skip to content

Commit 797a3ea

Browse files
Generate observability
1 parent 427b7e6 commit 797a3ea

File tree

7 files changed

+136
-7
lines changed

7 files changed

+136
-7
lines changed

services/observability/src/stackit/observability/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"CreateAlertConfigRoutePayloadRoutesInner",
4848
"CreateAlertgroupsPayload",
4949
"CreateAlertrulesPayload",
50+
"CreateCredentialsPayload",
5051
"CreateCredentialsResponse",
5152
"CreateInstancePayload",
5253
"CreateInstanceResponse",
@@ -189,6 +190,9 @@
189190
from stackit.observability.models.create_alertrules_payload import (
190191
CreateAlertrulesPayload as CreateAlertrulesPayload,
191192
)
193+
from stackit.observability.models.create_credentials_payload import (
194+
CreateCredentialsPayload as CreateCredentialsPayload,
195+
)
192196
from stackit.observability.models.create_credentials_response import (
193197
CreateCredentialsResponse as CreateCredentialsResponse,
194198
)

services/observability/src/stackit/observability/api/default_api.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@
4141
from stackit.observability.models.create_alertrules_payload import (
4242
CreateAlertrulesPayload,
4343
)
44+
from stackit.observability.models.create_credentials_payload import (
45+
CreateCredentialsPayload,
46+
)
4447
from stackit.observability.models.create_credentials_response import (
4548
CreateCredentialsResponse,
4649
)
@@ -1248,6 +1251,7 @@ def create_credentials(
12481251
self,
12491252
instance_id: StrictStr,
12501253
project_id: StrictStr,
1254+
create_credentials_payload: Optional[CreateCredentialsPayload] = None,
12511255
_request_timeout: Union[
12521256
None,
12531257
Annotated[StrictFloat, Field(gt=0)],
@@ -1266,6 +1270,8 @@ def create_credentials(
12661270
:type instance_id: str
12671271
:param project_id: (required)
12681272
:type project_id: str
1273+
:param create_credentials_payload:
1274+
:type create_credentials_payload: CreateCredentialsPayload
12691275
:param _request_timeout: timeout setting for this request. If one
12701276
number provided, it will be total request
12711277
timeout. It can also be a pair (tuple) of
@@ -1291,6 +1297,7 @@ def create_credentials(
12911297
_param = self._create_credentials_serialize(
12921298
instance_id=instance_id,
12931299
project_id=project_id,
1300+
create_credentials_payload=create_credentials_payload,
12941301
_request_auth=_request_auth,
12951302
_content_type=_content_type,
12961303
_headers=_headers,
@@ -1299,6 +1306,7 @@ def create_credentials(
12991306

13001307
_response_types_map: Dict[str, Optional[str]] = {
13011308
"201": "CreateCredentialsResponse",
1309+
"400": "Error",
13021310
"403": "PermissionDenied",
13031311
}
13041312
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
@@ -1313,6 +1321,7 @@ def create_credentials_with_http_info(
13131321
self,
13141322
instance_id: StrictStr,
13151323
project_id: StrictStr,
1324+
create_credentials_payload: Optional[CreateCredentialsPayload] = None,
13161325
_request_timeout: Union[
13171326
None,
13181327
Annotated[StrictFloat, Field(gt=0)],
@@ -1331,6 +1340,8 @@ def create_credentials_with_http_info(
13311340
:type instance_id: str
13321341
:param project_id: (required)
13331342
:type project_id: str
1343+
:param create_credentials_payload:
1344+
:type create_credentials_payload: CreateCredentialsPayload
13341345
:param _request_timeout: timeout setting for this request. If one
13351346
number provided, it will be total request
13361347
timeout. It can also be a pair (tuple) of
@@ -1356,6 +1367,7 @@ def create_credentials_with_http_info(
13561367
_param = self._create_credentials_serialize(
13571368
instance_id=instance_id,
13581369
project_id=project_id,
1370+
create_credentials_payload=create_credentials_payload,
13591371
_request_auth=_request_auth,
13601372
_content_type=_content_type,
13611373
_headers=_headers,
@@ -1364,6 +1376,7 @@ def create_credentials_with_http_info(
13641376

13651377
_response_types_map: Dict[str, Optional[str]] = {
13661378
"201": "CreateCredentialsResponse",
1379+
"400": "Error",
13671380
"403": "PermissionDenied",
13681381
}
13691382
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
@@ -1378,6 +1391,7 @@ def create_credentials_without_preload_content(
13781391
self,
13791392
instance_id: StrictStr,
13801393
project_id: StrictStr,
1394+
create_credentials_payload: Optional[CreateCredentialsPayload] = None,
13811395
_request_timeout: Union[
13821396
None,
13831397
Annotated[StrictFloat, Field(gt=0)],
@@ -1396,6 +1410,8 @@ def create_credentials_without_preload_content(
13961410
:type instance_id: str
13971411
:param project_id: (required)
13981412
:type project_id: str
1413+
:param create_credentials_payload:
1414+
:type create_credentials_payload: CreateCredentialsPayload
13991415
:param _request_timeout: timeout setting for this request. If one
14001416
number provided, it will be total request
14011417
timeout. It can also be a pair (tuple) of
@@ -1421,6 +1437,7 @@ def create_credentials_without_preload_content(
14211437
_param = self._create_credentials_serialize(
14221438
instance_id=instance_id,
14231439
project_id=project_id,
1440+
create_credentials_payload=create_credentials_payload,
14241441
_request_auth=_request_auth,
14251442
_content_type=_content_type,
14261443
_headers=_headers,
@@ -1429,6 +1446,7 @@ def create_credentials_without_preload_content(
14291446

14301447
_response_types_map: Dict[str, Optional[str]] = {
14311448
"201": "CreateCredentialsResponse",
1449+
"400": "Error",
14321450
"403": "PermissionDenied",
14331451
}
14341452
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
@@ -1438,6 +1456,7 @@ def _create_credentials_serialize(
14381456
self,
14391457
instance_id,
14401458
project_id,
1459+
create_credentials_payload,
14411460
_request_auth,
14421461
_content_type,
14431462
_headers,
@@ -1464,11 +1483,21 @@ def _create_credentials_serialize(
14641483
# process the header parameters
14651484
# process the form parameters
14661485
# process the body parameter
1486+
if create_credentials_payload is not None:
1487+
_body_params = create_credentials_payload
14671488

14681489
# set the HTTP header `Accept`
14691490
if "Accept" not in _header_params:
14701491
_header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
14711492

1493+
# set the HTTP header `Content-Type`
1494+
if _content_type:
1495+
_header_params["Content-Type"] = _content_type
1496+
else:
1497+
_default_content_type = self.api_client.select_header_content_type(["application/json"])
1498+
if _default_content_type is not None:
1499+
_header_params["Content-Type"] = _default_content_type
1500+
14721501
# authentication setting
14731502
_auth_settings: List[str] = []
14741503

services/observability/src/stackit/observability/models/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@
5353
from stackit.observability.models.create_alertrules_payload import (
5454
CreateAlertrulesPayload,
5555
)
56+
from stackit.observability.models.create_credentials_payload import (
57+
CreateCredentialsPayload,
58+
)
5659
from stackit.observability.models.create_credentials_response import (
5760
CreateCredentialsResponse,
5861
)
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
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+
10+
Generated by OpenAPI Generator (https://openapi-generator.tech)
11+
12+
Do not edit the class manually.
13+
""" # noqa: E501
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 CreateCredentialsPayload(BaseModel):
26+
"""
27+
Create new credentials with (optional) description
28+
""" # noqa: E501
29+
30+
description: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = Field(
31+
default=None, description="description"
32+
)
33+
__properties: ClassVar[List[str]] = ["description"]
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 CreateCredentialsPayload 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 CreateCredentialsPayload 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({"description": obj.get("description")})
84+
return _obj

services/observability/src/stackit/observability/models/credentials.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ class Credentials(BaseModel):
2727
Credentials
2828
""" # noqa: E501
2929

30+
description: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = None
3031
password: Annotated[str, Field(min_length=1, strict=True)]
3132
username: Annotated[str, Field(min_length=1, strict=True)]
32-
__properties: ClassVar[List[str]] = ["password", "username"]
33+
__properties: ClassVar[List[str]] = ["description", "password", "username"]
3334

3435
model_config = ConfigDict(
3536
populate_by_name=True,
@@ -79,5 +80,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
7980
if not isinstance(obj, dict):
8081
return cls.model_validate(obj)
8182

82-
_obj = cls.model_validate({"password": obj.get("password"), "username": obj.get("username")})
83+
_obj = cls.model_validate(
84+
{"description": obj.get("description"), "password": obj.get("password"), "username": obj.get("username")}
85+
)
8386
return _obj

services/observability/src/stackit/observability/models/service_keys_list.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ class ServiceKeysList(BaseModel):
2828
""" # noqa: E501
2929

3030
credentials_info: Optional[Dict[str, Optional[StrictStr]]] = Field(default=None, alias="credentialsInfo")
31+
description: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = None
3132
id: Annotated[str, Field(min_length=1, strict=True, max_length=200)]
3233
name: Annotated[str, Field(min_length=1, strict=True, max_length=200)]
33-
__properties: ClassVar[List[str]] = ["credentialsInfo", "id", "name"]
34+
__properties: ClassVar[List[str]] = ["credentialsInfo", "description", "id", "name"]
3435

3536
model_config = ConfigDict(
3637
populate_by_name=True,
@@ -81,6 +82,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
8182
return cls.model_validate(obj)
8283

8384
_obj = cls.model_validate(
84-
{"credentialsInfo": obj.get("credentialsInfo"), "id": obj.get("id"), "name": obj.get("name")}
85+
{
86+
"credentialsInfo": obj.get("credentialsInfo"),
87+
"description": obj.get("description"),
88+
"id": obj.get("id"),
89+
"name": obj.get("name"),
90+
}
8591
)
8692
return _obj

services/observability/src/stackit/observability/models/update_metrics_storage_retention_payload.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ class UpdateMetricsStorageRetentionPayload(BaseModel):
2828
""" # noqa: E501
2929

3030
metrics_retention_time1h: Annotated[str, Field(min_length=2, strict=True, max_length=8)] = Field(
31-
description="Retention time of longtime storage of 1h sampled data. After that time the data will be deleted permanently. `Additional Validators:` * Should be a valid time string * Should not be bigger than metricsRetentionTime5m",
31+
description="Retention time of longtime storage of 1h sampled data. After that time the 1h sampled data will be deleted permanently. The goal of downsampling is to get fast results for queries over long time intervals. It is recommended to set this value to be the same as metricsRetentionTimeRaw to ensure zoom-in capabilities in your dashboards. The default value is 90 days. `Additional Validators:` * Should be a valid time string (e.g. '90d'). * Should be between '10d' and '780d'. * Note: For compatibility reasons, values between '0d' and '792d' are also accepted. However, these will be automatically adjusted in the backend to the recommended range of '10d' to '780d'.",
3232
alias="metricsRetentionTime1h",
3333
)
3434
metrics_retention_time5m: Annotated[str, Field(min_length=2, strict=True, max_length=8)] = Field(
35-
description="Retention time of longtime storage of 5m sampled data. After that time the data will be down sampled to 1h. `Additional Validators:` * Should be a valid time string * Should not be bigger than metricsRetentionTimeRaw",
35+
description="Retention time of longtime storage of 5m sampled data. After that time the 5m sampled data will be deleted permanently. All 5m resolution metrics older than 10 days are downsampled at a 1h resolution. The goal of downsampling is to get fast results for queries over long time intervals. It is recommended to set this value to be the same as metricsRetentionTimeRaw to ensure zoom-in capabilities in your dashboards. The default value is 90 days. `Additional Validators:` * Should be a valid time string (e.g. '90d'). * Should be between '10d' and '780d'. * Note: For compatibility reasons, values between '0d' and '792d' are also accepted. However, these will be automatically adjusted in the backend to the recommended range of '10d' to '780d'.",
3636
alias="metricsRetentionTime5m",
3737
)
3838
metrics_retention_time_raw: Annotated[str, Field(min_length=2, strict=True, max_length=8)] = Field(
39-
description="Retention time of longtime storage of raw sampled data. After that time the data will be down sampled to 5m. Keep in mind, that the initial goal of downsampling is not saving disk or object storage space. In fact, downsampling doesn't save you any space but instead, it adds 2 more blocks for each raw block which are only slightly smaller or relatively similar size to raw block. This is done by internal downsampling implementation which to be mathematically correct holds various aggregations. This means that downsampling can increase the size of your storage a bit (~3x), if you choose to store all resolutions (recommended). The goal of downsampling is to provide an opportunity to get fast results for range queries of big time intervals like months or years. `Additional Validators:` * Should be a valid time string * Should not be bigger than 13 months",
39+
description="Retention time of longtime storage of raw data. After that time the raw data will be deleted permanently. All raw resolution metrics that are older than 40 hours are downsampled at a 5m resolution. The default value is 90 days. `Additional Validators:` * Should be a valid time string (e.g. '90d'). * Should be between '2d' and '780d'. * Note: For compatibility reasons, values between '0d' and '792d' are also accepted. However, these will be automatically adjusted in the backend to the recommended range of '2d' to '780d'.",
4040
alias="metricsRetentionTimeRaw",
4141
)
4242
__properties: ClassVar[List[str]] = ["metricsRetentionTime1h", "metricsRetentionTime5m", "metricsRetentionTimeRaw"]

0 commit comments

Comments
 (0)