Skip to content

Commit d3fd6fd

Browse files
Generate telemetrylink
1 parent 4b7c7df commit d3fd6fd

12 files changed

Lines changed: 3380 additions & 178 deletions

‎services/telemetrylink/oas_commit‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
da4701b7dbe20e984aef89711bb9ba716e19fcba
1+
7db6460b25eee93a646427ec41a08f06d75615d3

‎services/telemetrylink/src/stackit/telemetrylink/__init__.py‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,14 @@
2727
"ApiKeyError",
2828
"ApiAttributeError",
2929
"ApiException",
30+
"BackflushJobResponse",
31+
"CreateFolderBackflushJobPayload",
3032
"CreateOrUpdateFolderTelemetryLinkPayload",
3133
"CreateOrUpdateOrganizationTelemetryLinkPayload",
3234
"CreateOrUpdateProjectTelemetryLinkPayload",
35+
"CreateOrganizationBackflushJobPayload",
36+
"CreateProjectBackflushJobPayload",
37+
"ListBackflushJobsResponse",
3338
"PartialUpdateFolderTelemetryLinkPayload",
3439
"PartialUpdateOrganizationTelemetryLinkPayload",
3540
"PartialUpdateProjectTelemetryLinkPayload",
@@ -53,6 +58,12 @@
5358
from stackit.telemetrylink.exceptions import OpenApiException as OpenApiException
5459

5560
# import models into sdk package
61+
from stackit.telemetrylink.models.backflush_job_response import (
62+
BackflushJobResponse as BackflushJobResponse,
63+
)
64+
from stackit.telemetrylink.models.create_folder_backflush_job_payload import (
65+
CreateFolderBackflushJobPayload as CreateFolderBackflushJobPayload,
66+
)
5667
from stackit.telemetrylink.models.create_or_update_folder_telemetry_link_payload import (
5768
CreateOrUpdateFolderTelemetryLinkPayload as CreateOrUpdateFolderTelemetryLinkPayload,
5869
)
@@ -62,6 +73,15 @@
6273
from stackit.telemetrylink.models.create_or_update_project_telemetry_link_payload import (
6374
CreateOrUpdateProjectTelemetryLinkPayload as CreateOrUpdateProjectTelemetryLinkPayload,
6475
)
76+
from stackit.telemetrylink.models.create_organization_backflush_job_payload import (
77+
CreateOrganizationBackflushJobPayload as CreateOrganizationBackflushJobPayload,
78+
)
79+
from stackit.telemetrylink.models.create_project_backflush_job_payload import (
80+
CreateProjectBackflushJobPayload as CreateProjectBackflushJobPayload,
81+
)
82+
from stackit.telemetrylink.models.list_backflush_jobs_response import (
83+
ListBackflushJobsResponse as ListBackflushJobsResponse,
84+
)
6585
from stackit.telemetrylink.models.partial_update_folder_telemetry_link_payload import (
6686
PartialUpdateFolderTelemetryLinkPayload as PartialUpdateFolderTelemetryLinkPayload,
6787
)

‎services/telemetrylink/src/stackit/telemetrylink/api/default_api.py‎

Lines changed: 2740 additions & 171 deletions
Large diffs are not rendered by default.

‎services/telemetrylink/src/stackit/telemetrylink/models/__init__.py‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
""" # noqa: E501
1414

1515
# import models into model package
16+
from stackit.telemetrylink.models.backflush_job_response import BackflushJobResponse
17+
from stackit.telemetrylink.models.create_folder_backflush_job_payload import (
18+
CreateFolderBackflushJobPayload,
19+
)
1620
from stackit.telemetrylink.models.create_or_update_folder_telemetry_link_payload import (
1721
CreateOrUpdateFolderTelemetryLinkPayload,
1822
)
@@ -22,6 +26,15 @@
2226
from stackit.telemetrylink.models.create_or_update_project_telemetry_link_payload import (
2327
CreateOrUpdateProjectTelemetryLinkPayload,
2428
)
29+
from stackit.telemetrylink.models.create_organization_backflush_job_payload import (
30+
CreateOrganizationBackflushJobPayload,
31+
)
32+
from stackit.telemetrylink.models.create_project_backflush_job_payload import (
33+
CreateProjectBackflushJobPayload,
34+
)
35+
from stackit.telemetrylink.models.list_backflush_jobs_response import (
36+
ListBackflushJobsResponse,
37+
)
2538
from stackit.telemetrylink.models.partial_update_folder_telemetry_link_payload import (
2639
PartialUpdateFolderTelemetryLinkPayload,
2740
)
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
# coding: utf-8
2+
3+
"""
4+
STACKIT Telemetry Link API
5+
6+
This API provides endpoints for managing Telemetry Links. The Telemetry Link enables Log Routing towards a defined Telemetry Router.
7+
8+
The version of the OpenAPI document: 1.0
9+
Generated by OpenAPI Generator (https://openapi-generator.tech)
10+
11+
Do not edit the class manually.
12+
""" # noqa: E501
13+
14+
from __future__ import annotations
15+
16+
import json
17+
import pprint
18+
import re # noqa: F401
19+
from datetime import datetime
20+
from typing import Any, ClassVar, Dict, List, Optional, Set
21+
from uuid import UUID
22+
23+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
24+
from pydantic_core import to_jsonable_python
25+
from typing_extensions import Annotated, Self
26+
27+
28+
class BackflushJobResponse(BaseModel):
29+
"""
30+
BackflushJobResponse
31+
""" # noqa: E501
32+
33+
create_time: datetime = Field(description="The point in time the resource was created.", alias="createTime")
34+
description: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field(
35+
default=None,
36+
description="The description is a longer text chosen by the user to provide more context for the resource.",
37+
)
38+
display_name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=32)]] = Field(
39+
default=None,
40+
description="The display name is a short name chosen by the user to identify the resource.",
41+
alias="displayName",
42+
)
43+
id: UUID = Field(description="A auto generated unique id which identifies the resource.")
44+
region_id: StrictStr = Field(description="The STACKIT region name the resource is located in.", alias="regionId")
45+
status: StrictStr = Field(description="The current state of the link.")
46+
__properties: ClassVar[List[str]] = ["createTime", "description", "displayName", "id", "regionId", "status"]
47+
48+
@field_validator("create_time", mode="before")
49+
def create_time_change_year_zero_to_one(cls, value):
50+
"""Workaround which prevents year 0 issue"""
51+
if isinstance(value, str):
52+
# Check for year "0000" at the beginning of the string
53+
# This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ
54+
if value.startswith("0000-01-01T") and re.match(
55+
r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value
56+
):
57+
# Workaround: Replace "0000" with "0001"
58+
return "0001" + value[4:] # Take "0001" and append the rest of the string
59+
return value
60+
61+
@field_validator("description")
62+
def description_validate_regular_expression(cls, value):
63+
"""Validates the regular expression"""
64+
if value is None:
65+
return value
66+
67+
if not isinstance(value, str):
68+
value = str(value)
69+
70+
if not re.match(r"^([a-zA-Z0-9][a-zA-Z0-9 \-]*)?$", value):
71+
raise ValueError(r"must validate the regular expression /^([a-zA-Z0-9][a-zA-Z0-9 \-]*)?$/")
72+
return value
73+
74+
@field_validator("region_id")
75+
def region_id_validate_enum(cls, value):
76+
"""Validates the enum"""
77+
if value not in set(["eu01", "eu02"]):
78+
raise ValueError("must be one of enum values ('eu01', 'eu02')")
79+
return value
80+
81+
@field_validator("status")
82+
def status_validate_enum(cls, value):
83+
"""Validates the enum"""
84+
if value not in set(["active", "complete", "failed", "reconciling", "deleting"]):
85+
raise ValueError("must be one of enum values ('active', 'complete', 'failed', 'reconciling', 'deleting')")
86+
return value
87+
88+
model_config = ConfigDict(
89+
validate_by_name=True,
90+
validate_by_alias=True,
91+
validate_assignment=True,
92+
protected_namespaces=(),
93+
)
94+
95+
def to_str(self) -> str:
96+
"""Returns the string representation of the model using alias"""
97+
return pprint.pformat(self.model_dump(by_alias=True))
98+
99+
def to_json(self) -> str:
100+
"""Returns the JSON representation of the model using alias"""
101+
return json.dumps(to_jsonable_python(self.to_dict()))
102+
103+
@classmethod
104+
def from_json(cls, json_str: str) -> Optional[Self]:
105+
"""Create an instance of BackflushJobResponse from a JSON string"""
106+
return cls.from_dict(json.loads(json_str))
107+
108+
def to_dict(self) -> Dict[str, Any]:
109+
"""Return the dictionary representation of the model using alias.
110+
111+
This has the following differences from calling pydantic's
112+
`self.model_dump(by_alias=True)`:
113+
114+
* `None` is only added to the output dict for nullable fields that
115+
were set at model initialization. Other fields with value `None`
116+
are ignored.
117+
"""
118+
excluded_fields: Set[str] = set([])
119+
120+
_dict = self.model_dump(
121+
by_alias=True,
122+
exclude=excluded_fields,
123+
exclude_none=True,
124+
)
125+
return _dict
126+
127+
@classmethod
128+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
129+
"""Create an instance of BackflushJobResponse from a dict"""
130+
if obj is None:
131+
return None
132+
133+
if not isinstance(obj, dict):
134+
return cls.model_validate(obj)
135+
136+
_obj = cls.model_validate(
137+
{
138+
"createTime": obj.get("createTime"),
139+
"description": obj.get("description"),
140+
"displayName": obj.get("displayName"),
141+
"id": obj.get("id"),
142+
"regionId": obj.get("regionId"),
143+
"status": obj.get("status"),
144+
}
145+
)
146+
return _obj
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
# coding: utf-8
2+
3+
"""
4+
STACKIT Telemetry Link API
5+
6+
This API provides endpoints for managing Telemetry Links. The Telemetry Link enables Log Routing towards a defined Telemetry Router.
7+
8+
The version of the OpenAPI document: 1.0
9+
Generated by OpenAPI Generator (https://openapi-generator.tech)
10+
11+
Do not edit the class manually.
12+
""" # noqa: E501
13+
14+
from __future__ import annotations
15+
16+
import json
17+
import pprint
18+
import re # noqa: F401
19+
from typing import Any, ClassVar, Dict, List, Optional, Set
20+
21+
from pydantic import BaseModel, ConfigDict, Field, field_validator
22+
from pydantic_core import to_jsonable_python
23+
from typing_extensions import Annotated, Self
24+
25+
26+
class CreateFolderBackflushJobPayload(BaseModel):
27+
"""
28+
CreateFolderBackflushJobPayload
29+
""" # noqa: E501
30+
31+
description: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = Field(
32+
default=None,
33+
description="The description is a longer text chosen by the user to provide more context for the resource.",
34+
)
35+
display_name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=32)]] = Field(
36+
default=None,
37+
description="The display name is a short name chosen by the user to identify the resource.",
38+
alias="displayName",
39+
)
40+
__properties: ClassVar[List[str]] = ["description", "displayName"]
41+
42+
@field_validator("description")
43+
def description_validate_regular_expression(cls, value):
44+
"""Validates the regular expression"""
45+
if value is None:
46+
return value
47+
48+
if not isinstance(value, str):
49+
value = str(value)
50+
51+
if not re.match(r"^([a-zA-Z0-9][a-zA-Z0-9 \-]*)?$", value):
52+
raise ValueError(r"must validate the regular expression /^([a-zA-Z0-9][a-zA-Z0-9 \-]*)?$/")
53+
return value
54+
55+
@field_validator("display_name")
56+
def display_name_validate_regular_expression(cls, value):
57+
"""Validates the regular expression"""
58+
if value is None:
59+
return value
60+
61+
if not isinstance(value, str):
62+
value = str(value)
63+
64+
if not re.match(r"^[a-zA-Z0-9][a-zA-Z0-9 \-]*$", value):
65+
raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9][a-zA-Z0-9 \-]*$/")
66+
return value
67+
68+
model_config = ConfigDict(
69+
validate_by_name=True,
70+
validate_by_alias=True,
71+
validate_assignment=True,
72+
protected_namespaces=(),
73+
)
74+
75+
def to_str(self) -> str:
76+
"""Returns the string representation of the model using alias"""
77+
return pprint.pformat(self.model_dump(by_alias=True))
78+
79+
def to_json(self) -> str:
80+
"""Returns the JSON representation of the model using alias"""
81+
return json.dumps(to_jsonable_python(self.to_dict()))
82+
83+
@classmethod
84+
def from_json(cls, json_str: str) -> Optional[Self]:
85+
"""Create an instance of CreateFolderBackflushJobPayload from a JSON string"""
86+
return cls.from_dict(json.loads(json_str))
87+
88+
def to_dict(self) -> Dict[str, Any]:
89+
"""Return the dictionary representation of the model using alias.
90+
91+
This has the following differences from calling pydantic's
92+
`self.model_dump(by_alias=True)`:
93+
94+
* `None` is only added to the output dict for nullable fields that
95+
were set at model initialization. Other fields with value `None`
96+
are ignored.
97+
"""
98+
excluded_fields: Set[str] = set([])
99+
100+
_dict = self.model_dump(
101+
by_alias=True,
102+
exclude=excluded_fields,
103+
exclude_none=True,
104+
)
105+
return _dict
106+
107+
@classmethod
108+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
109+
"""Create an instance of CreateFolderBackflushJobPayload from a dict"""
110+
if obj is None:
111+
return None
112+
113+
if not isinstance(obj, dict):
114+
return cls.model_validate(obj)
115+
116+
_obj = cls.model_validate({"description": obj.get("description"), "displayName": obj.get("displayName")})
117+
return _obj

‎services/telemetrylink/src/stackit/telemetrylink/models/create_or_update_folder_telemetry_link_payload.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ class CreateOrUpdateFolderTelemetryLinkPayload(BaseModel):
3636
display_name: Annotated[str, Field(min_length=1, strict=True, max_length=32)] = Field(
3737
description="The display name is a short name chosen by the user to identify the resource.", alias="displayName"
3838
)
39-
enabled: StrictBool = Field(
40-
description="Indicates whether routing through the link to a telemetry-router is active."
39+
enabled: Optional[StrictBool] = Field(
40+
default=True, description="Indicates whether routing through the link to a telemetry-router is active."
4141
)
4242
telemetry_router_id: Annotated[str, Field(strict=True, max_length=1024)] = Field(
4343
description="The ID of the telemetry-router to route the telemetry data.", alias="telemetryRouterId"

‎services/telemetrylink/src/stackit/telemetrylink/models/create_or_update_organization_telemetry_link_payload.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ class CreateOrUpdateOrganizationTelemetryLinkPayload(BaseModel):
3636
display_name: Annotated[str, Field(min_length=1, strict=True, max_length=32)] = Field(
3737
description="The display name is a short name chosen by the user to identify the resource.", alias="displayName"
3838
)
39-
enabled: StrictBool = Field(
40-
description="Indicates whether routing through the link to a telemetry-router is active."
39+
enabled: Optional[StrictBool] = Field(
40+
default=True, description="Indicates whether routing through the link to a telemetry-router is active."
4141
)
4242
telemetry_router_id: Annotated[str, Field(strict=True, max_length=1024)] = Field(
4343
description="The ID of the telemetry-router to route the telemetry data.", alias="telemetryRouterId"

‎services/telemetrylink/src/stackit/telemetrylink/models/create_or_update_project_telemetry_link_payload.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ class CreateOrUpdateProjectTelemetryLinkPayload(BaseModel):
3636
display_name: Annotated[str, Field(min_length=1, strict=True, max_length=32)] = Field(
3737
description="The display name is a short name chosen by the user to identify the resource.", alias="displayName"
3838
)
39-
enabled: StrictBool = Field(
40-
description="Indicates whether routing through the link to a telemetry-router is active."
39+
enabled: Optional[StrictBool] = Field(
40+
default=True, description="Indicates whether routing through the link to a telemetry-router is active."
4141
)
4242
telemetry_router_id: Annotated[str, Field(strict=True, max_length=1024)] = Field(
4343
description="The ID of the telemetry-router to route the telemetry data.", alias="telemetryRouterId"

0 commit comments

Comments
 (0)