Skip to content

Commit e6dfc31

Browse files
Generate telemetrylink
1 parent eb795b4 commit e6dfc31

12 files changed

Lines changed: 3363 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+
915f82be0b0f434901fcedc91fafe58b652035ef

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: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
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: Annotated[str, Field(min_length=1, strict=True, max_length=32)] = Field(
39+
description="The display name is a short name chosen by the user to identify the resource.", alias="displayName"
40+
)
41+
id: UUID = Field(description="A auto generated unique id which identifies the resource.")
42+
region_id: StrictStr = Field(description="The STACKIT region name the resource is located in.", alias="regionId")
43+
status: StrictStr = Field(description="The current state of the link.")
44+
__properties: ClassVar[List[str]] = ["createTime", "description", "displayName", "id", "regionId", "status"]
45+
46+
@field_validator("create_time", mode="before")
47+
def create_time_change_year_zero_to_one(cls, value):
48+
"""Workaround which prevents year 0 issue"""
49+
if isinstance(value, str):
50+
# Check for year "0000" at the beginning of the string
51+
# This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ
52+
if value.startswith("0000-01-01T") and re.match(
53+
r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value
54+
):
55+
# Workaround: Replace "0000" with "0001"
56+
return "0001" + value[4:] # Take "0001" and append the rest of the string
57+
return value
58+
59+
@field_validator("description")
60+
def description_validate_regular_expression(cls, value):
61+
"""Validates the regular expression"""
62+
if value is None:
63+
return value
64+
65+
if not isinstance(value, str):
66+
value = str(value)
67+
68+
if not re.match(r"^([a-zA-Z0-9][a-zA-Z0-9 \-]*)?$", value):
69+
raise ValueError(r"must validate the regular expression /^([a-zA-Z0-9][a-zA-Z0-9 \-]*)?$/")
70+
return value
71+
72+
@field_validator("region_id")
73+
def region_id_validate_enum(cls, value):
74+
"""Validates the enum"""
75+
if value not in set(["eu01", "eu02"]):
76+
raise ValueError("must be one of enum values ('eu01', 'eu02')")
77+
return value
78+
79+
@field_validator("status")
80+
def status_validate_enum(cls, value):
81+
"""Validates the enum"""
82+
if value not in set(["active", "complete", "failed", "reconciling", "deleting"]):
83+
raise ValueError("must be one of enum values ('active', 'complete', 'failed', 'reconciling', 'deleting')")
84+
return value
85+
86+
model_config = ConfigDict(
87+
validate_by_name=True,
88+
validate_by_alias=True,
89+
validate_assignment=True,
90+
protected_namespaces=(),
91+
)
92+
93+
def to_str(self) -> str:
94+
"""Returns the string representation of the model using alias"""
95+
return pprint.pformat(self.model_dump(by_alias=True))
96+
97+
def to_json(self) -> str:
98+
"""Returns the JSON representation of the model using alias"""
99+
return json.dumps(to_jsonable_python(self.to_dict()))
100+
101+
@classmethod
102+
def from_json(cls, json_str: str) -> Optional[Self]:
103+
"""Create an instance of BackflushJobResponse from a JSON string"""
104+
return cls.from_dict(json.loads(json_str))
105+
106+
def to_dict(self) -> Dict[str, Any]:
107+
"""Return the dictionary representation of the model using alias.
108+
109+
This has the following differences from calling pydantic's
110+
`self.model_dump(by_alias=True)`:
111+
112+
* `None` is only added to the output dict for nullable fields that
113+
were set at model initialization. Other fields with value `None`
114+
are ignored.
115+
"""
116+
excluded_fields: Set[str] = set([])
117+
118+
_dict = self.model_dump(
119+
by_alias=True,
120+
exclude=excluded_fields,
121+
exclude_none=True,
122+
)
123+
return _dict
124+
125+
@classmethod
126+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
127+
"""Create an instance of BackflushJobResponse from a dict"""
128+
if obj is None:
129+
return None
130+
131+
if not isinstance(obj, dict):
132+
return cls.model_validate(obj)
133+
134+
_obj = cls.model_validate(
135+
{
136+
"createTime": obj.get("createTime"),
137+
"description": obj.get("description"),
138+
"displayName": obj.get("displayName"),
139+
"id": obj.get("id"),
140+
"regionId": obj.get("regionId"),
141+
"status": obj.get("status"),
142+
}
143+
)
144+
return _obj
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
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: Annotated[str, Field(min_length=1, strict=True, max_length=32)] = Field(
36+
description="The display name is a short name chosen by the user to identify the resource.", alias="displayName"
37+
)
38+
__properties: ClassVar[List[str]] = ["description", "displayName"]
39+
40+
@field_validator("description")
41+
def description_validate_regular_expression(cls, value):
42+
"""Validates the regular expression"""
43+
if value is None:
44+
return value
45+
46+
if not isinstance(value, str):
47+
value = str(value)
48+
49+
if not re.match(r"^([a-zA-Z0-9][a-zA-Z0-9 \-]*)?$", value):
50+
raise ValueError(r"must validate the regular expression /^([a-zA-Z0-9][a-zA-Z0-9 \-]*)?$/")
51+
return value
52+
53+
@field_validator("display_name")
54+
def display_name_validate_regular_expression(cls, value):
55+
"""Validates the regular expression"""
56+
if not isinstance(value, str):
57+
value = str(value)
58+
59+
if not re.match(r"^[a-zA-Z0-9][a-zA-Z0-9 \-]*$", value):
60+
raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9][a-zA-Z0-9 \-]*$/")
61+
return value
62+
63+
model_config = ConfigDict(
64+
validate_by_name=True,
65+
validate_by_alias=True,
66+
validate_assignment=True,
67+
protected_namespaces=(),
68+
)
69+
70+
def to_str(self) -> str:
71+
"""Returns the string representation of the model using alias"""
72+
return pprint.pformat(self.model_dump(by_alias=True))
73+
74+
def to_json(self) -> str:
75+
"""Returns the JSON representation of the model using alias"""
76+
return json.dumps(to_jsonable_python(self.to_dict()))
77+
78+
@classmethod
79+
def from_json(cls, json_str: str) -> Optional[Self]:
80+
"""Create an instance of CreateFolderBackflushJobPayload from a JSON string"""
81+
return cls.from_dict(json.loads(json_str))
82+
83+
def to_dict(self) -> Dict[str, Any]:
84+
"""Return the dictionary representation of the model using alias.
85+
86+
This has the following differences from calling pydantic's
87+
`self.model_dump(by_alias=True)`:
88+
89+
* `None` is only added to the output dict for nullable fields that
90+
were set at model initialization. Other fields with value `None`
91+
are ignored.
92+
"""
93+
excluded_fields: Set[str] = set([])
94+
95+
_dict = self.model_dump(
96+
by_alias=True,
97+
exclude=excluded_fields,
98+
exclude_none=True,
99+
)
100+
return _dict
101+
102+
@classmethod
103+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
104+
"""Create an instance of CreateFolderBackflushJobPayload from a dict"""
105+
if obj is None:
106+
return None
107+
108+
if not isinstance(obj, dict):
109+
return cls.model_validate(obj)
110+
111+
_obj = cls.model_validate({"description": obj.get("description"), "displayName": obj.get("displayName")})
112+
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)