Skip to content

Commit 888b3bb

Browse files
Generate ske
1 parent 1f6317f commit 888b3bb

11 files changed

Lines changed: 219 additions & 12 deletions

services/ske/oas_commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ea0931a6f93703c990517136e0d4c7a88455b282
1+
46f03c1468dd453695c05e72c088a6bfb5a4bbab

services/ske/src/stackit/ske/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@
3030
"ACL",
3131
"Access",
3232
"AccessScope",
33+
"ApplicationLoadBalancer",
3334
"Audit",
3435
"AvailabilityZone",
36+
"CNI",
3537
"CRI",
3638
"Cluster",
3739
"ClusterError",
@@ -93,6 +95,9 @@
9395

9496
# import models into sdk package
9597
from stackit.ske.models.acl import ACL as ACL
98+
from stackit.ske.models.application_load_balancer import (
99+
ApplicationLoadBalancer as ApplicationLoadBalancer,
100+
)
96101
from stackit.ske.models.audit import Audit as Audit
97102
from stackit.ske.models.availability_zone import AvailabilityZone as AvailabilityZone
98103
from stackit.ske.models.cluster import Cluster as Cluster
@@ -101,6 +106,7 @@
101106
from stackit.ske.models.cluster_status_state import (
102107
ClusterStatusState as ClusterStatusState,
103108
)
109+
from stackit.ske.models.cni import CNI as CNI
104110
from stackit.ske.models.create_kubeconfig_payload import (
105111
CreateKubeconfigPayload as CreateKubeconfigPayload,
106112
)

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@
1717

1818
# import models into model package
1919
from stackit.ske.models.acl import ACL
20+
from stackit.ske.models.application_load_balancer import ApplicationLoadBalancer
2021
from stackit.ske.models.audit import Audit
2122
from stackit.ske.models.availability_zone import AvailabilityZone
2223
from stackit.ske.models.cluster import Cluster
2324
from stackit.ske.models.cluster_error import ClusterError
2425
from stackit.ske.models.cluster_status import ClusterStatus
2526
from stackit.ske.models.cluster_status_state import ClusterStatusState
27+
from stackit.ske.models.cni import CNI
2628
from stackit.ske.models.create_kubeconfig_payload import CreateKubeconfigPayload
2729
from stackit.ske.models.create_or_update_cluster_payload import (
2830
CreateOrUpdateClusterPayload,
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 Kubernetes Engine API
5+
6+
The SKE API provides endpoints to create, update or delete clusters within STACKIT projects and to trigger further cluster management tasks.
7+
8+
The version of the OpenAPI document: 2.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+
from typing import Any, ClassVar, Dict, List, Optional, Set
19+
20+
from pydantic import BaseModel, ConfigDict, Field, StrictBool
21+
from pydantic_core import to_jsonable_python
22+
from typing_extensions import Self
23+
24+
25+
class ApplicationLoadBalancer(BaseModel):
26+
"""
27+
ApplicationLoadBalancer
28+
""" # noqa: E501
29+
30+
enabled: StrictBool = Field(
31+
description="Enables the application load balancer extension. ⚠️ Note: This feature is in private preview. Enabling application load balancer extension is only possible for enabled accounts. Otherwise the request will be rejected."
32+
)
33+
__properties: ClassVar[List[str]] = ["enabled"]
34+
35+
model_config = ConfigDict(
36+
validate_by_name=True,
37+
validate_by_alias=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+
return json.dumps(to_jsonable_python(self.to_dict()))
49+
50+
@classmethod
51+
def from_json(cls, json_str: str) -> Optional[Self]:
52+
"""Create an instance of ApplicationLoadBalancer 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 ApplicationLoadBalancer 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({"enabled": obj.get("enabled")})
84+
return _obj

services/ske/src/stackit/ske/models/cluster.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import re # noqa: F401
1919
from typing import Any, ClassVar, Dict, List, Optional, Set
2020

21-
from pydantic import BaseModel, ConfigDict, Field, field_validator
21+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
2222
from pydantic_core import to_jsonable_python
2323
from typing_extensions import Annotated, Self
2424

@@ -43,6 +43,10 @@ class Cluster(BaseModel):
4343
extensions: Optional[Extension] = None
4444
hibernation: Optional[Hibernation] = None
4545
kubernetes: Kubernetes
46+
labels: Optional[Dict[str, StrictStr]] = Field(
47+
default=None,
48+
description="Labels are key-value pairs. Keys may contain domain prefix separated by a slash(/) and must begin with an alphanumerical character. Values may be empty and if not empty, they must begin and end with an alphanumerical character. Keys can be between 1-314 characters long, whereas values can be 0-63 characters long.",
49+
)
4650
maintenance: Optional[Maintenance] = None
4751
name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=11)]] = Field(
4852
default=None,
@@ -57,6 +61,7 @@ class Cluster(BaseModel):
5761
"extensions",
5862
"hibernation",
5963
"kubernetes",
64+
"labels",
6065
"maintenance",
6166
"name",
6267
"network",
@@ -170,6 +175,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
170175
Hibernation.from_dict(obj["hibernation"]) if obj.get("hibernation") is not None else None
171176
),
172177
"kubernetes": Kubernetes.from_dict(obj["kubernetes"]) if obj.get("kubernetes") is not None else None,
178+
"labels": obj.get("labels"),
173179
"maintenance": (
174180
Maintenance.from_dict(obj["maintenance"]) if obj.get("maintenance") is not None else None
175181
),
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# coding: utf-8
2+
3+
"""
4+
STACKIT Kubernetes Engine API
5+
6+
The SKE API provides endpoints to create, update or delete clusters within STACKIT projects and to trigger further cluster management tasks.
7+
8+
The version of the OpenAPI document: 2.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+
from typing import Any, ClassVar, Dict, List, Optional, Set
19+
20+
from pydantic import BaseModel, ConfigDict, Field
21+
from pydantic_core import to_jsonable_python
22+
from typing_extensions import Self
23+
24+
25+
class CNI(BaseModel):
26+
"""
27+
CNI to use for the cluster. Only one type of CNI can be used. The type of CNI is immutable after creation. Defaults to calico
28+
""" # noqa: E501
29+
30+
calico: Optional[Dict[str, Any]] = Field(default=None, description="configuration options for the Calico CNI")
31+
__properties: ClassVar[List[str]] = ["calico"]
32+
33+
model_config = ConfigDict(
34+
validate_by_name=True,
35+
validate_by_alias=True,
36+
validate_assignment=True,
37+
protected_namespaces=(),
38+
)
39+
40+
def to_str(self) -> str:
41+
"""Returns the string representation of the model using alias"""
42+
return pprint.pformat(self.model_dump(by_alias=True))
43+
44+
def to_json(self) -> str:
45+
"""Returns the JSON representation of the model using alias"""
46+
return json.dumps(to_jsonable_python(self.to_dict()))
47+
48+
@classmethod
49+
def from_json(cls, json_str: str) -> Optional[Self]:
50+
"""Create an instance of CNI 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 CNI 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({"calico": obj.get("calico")})
82+
return _obj

services/ske/src/stackit/ske/models/create_or_update_cluster_payload.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import pprint
1818
from typing import Any, ClassVar, Dict, List, Optional, Set
1919

20-
from pydantic import BaseModel, ConfigDict, Field
20+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
2121
from pydantic_core import to_jsonable_python
2222
from typing_extensions import Annotated, Self
2323

@@ -42,6 +42,10 @@ class CreateOrUpdateClusterPayload(BaseModel):
4242
extensions: Optional[Extension] = None
4343
hibernation: Optional[Hibernation] = None
4444
kubernetes: Kubernetes
45+
labels: Optional[Dict[str, StrictStr]] = Field(
46+
default=None,
47+
description="Labels are key-value pairs. Keys may contain domain prefix separated by a slash(/) and must begin with an alphanumerical character. Values may be empty and if not empty, they must begin and end with an alphanumerical character. Keys can be between 1-314 characters long, whereas values can be 0-63 characters long.",
48+
)
4549
maintenance: Optional[Maintenance] = None
4650
network: Optional[Network] = None
4751
nodepools: Annotated[List[Nodepool], Field(min_length=1, max_length=50)]
@@ -52,6 +56,7 @@ class CreateOrUpdateClusterPayload(BaseModel):
5256
"extensions",
5357
"hibernation",
5458
"kubernetes",
59+
"labels",
5560
"maintenance",
5661
"network",
5762
"nodepools",
@@ -146,6 +151,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
146151
Hibernation.from_dict(obj["hibernation"]) if obj.get("hibernation") is not None else None
147152
),
148153
"kubernetes": Kubernetes.from_dict(obj["kubernetes"]) if obj.get("kubernetes") is not None else None,
154+
"labels": obj.get("labels"),
149155
"maintenance": (
150156
Maintenance.from_dict(obj["maintenance"]) if obj.get("maintenance") is not None else None
151157
),

services/ske/src/stackit/ske/models/extension.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@
1717
import pprint
1818
from typing import Any, ClassVar, Dict, List, Optional, Set
1919

20-
from pydantic import BaseModel, ConfigDict
20+
from pydantic import BaseModel, ConfigDict, Field
2121
from pydantic_core import to_jsonable_python
2222
from typing_extensions import Self
2323

2424
from stackit.ske.models.acl import ACL
25+
from stackit.ske.models.application_load_balancer import ApplicationLoadBalancer
2526
from stackit.ske.models.dns import DNS
2627
from stackit.ske.models.observability import Observability
2728

@@ -32,9 +33,10 @@ class Extension(BaseModel):
3233
""" # noqa: E501
3334

3435
acl: Optional[ACL] = None
36+
application_load_balancer: Optional[ApplicationLoadBalancer] = Field(default=None, alias="applicationLoadBalancer")
3537
dns: Optional[DNS] = None
3638
observability: Optional[Observability] = None
37-
__properties: ClassVar[List[str]] = ["acl", "dns", "observability"]
39+
__properties: ClassVar[List[str]] = ["acl", "applicationLoadBalancer", "dns", "observability"]
3840

3941
model_config = ConfigDict(
4042
validate_by_name=True,
@@ -76,6 +78,9 @@ def to_dict(self) -> Dict[str, Any]:
7678
# override the default output from pydantic by calling `to_dict()` of acl
7779
if self.acl:
7880
_dict["acl"] = self.acl.to_dict()
81+
# override the default output from pydantic by calling `to_dict()` of application_load_balancer
82+
if self.application_load_balancer:
83+
_dict["applicationLoadBalancer"] = self.application_load_balancer.to_dict()
7984
# override the default output from pydantic by calling `to_dict()` of dns
8085
if self.dns:
8186
_dict["dns"] = self.dns.to_dict()
@@ -96,6 +101,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
96101
_obj = cls.model_validate(
97102
{
98103
"acl": ACL.from_dict(obj["acl"]) if obj.get("acl") is not None else None,
104+
"applicationLoadBalancer": (
105+
ApplicationLoadBalancer.from_dict(obj["applicationLoadBalancer"])
106+
if obj.get("applicationLoadBalancer") is not None
107+
else None
108+
),
99109
"dns": DNS.from_dict(obj["dns"]) if obj.get("dns") is not None else None,
100110
"observability": (
101111
Observability.from_dict(obj["observability"]) if obj.get("observability") is not None else None

services/ske/src/stackit/ske/models/hibernation_schedule.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ def end_validate_regular_expression(cls, value):
4040
value = str(value)
4141

4242
if not re.match(
43-
r"(@(annually|yearly|monthly|weekly|daily|hourly|reboot))|(@every (\\d+(ns|us|µs|ms|s|m|h))+)|((((\\d+,)+\\d+|(\\d+(\\/|-)\\d+)|\\d+|\\*) ?){5,7})",
43+
r"(@(annually|yearly|monthly|weekly|daily|hourly|reboot))|(@every (\d+(ns|us|µs|ms|s|m|h))+)|((((\d+,)+\d+|(\d+(\/|-)\d+)|\d+|\*) ?){5,7})",
4444
value,
4545
):
4646
raise ValueError(
47-
r"must validate the regular expression /(@(annually|yearly|monthly|weekly|daily|hourly|reboot))|(@every (\\d+(ns|us|µs|ms|s|m|h))+)|((((\\d+,)+\\d+|(\\d+(\\/|-)\\d+)|\\d+|\\*) ?){5,7})/"
47+
r"must validate the regular expression /(@(annually|yearly|monthly|weekly|daily|hourly|reboot))|(@every (\d+(ns|us|µs|ms|s|m|h))+)|((((\d+,)+\d+|(\d+(\/|-)\d+)|\d+|\*) ?){5,7})/"
4848
)
4949
return value
5050

@@ -55,11 +55,11 @@ def start_validate_regular_expression(cls, value):
5555
value = str(value)
5656

5757
if not re.match(
58-
r"(@(annually|yearly|monthly|weekly|daily|hourly|reboot))|(@every (\\d+(ns|us|µs|ms|s|m|h))+)|((((\\d+,)+\\d+|(\\d+(\\/|-)\\d+)|\\d+|\\*) ?){5,7})",
58+
r"(@(annually|yearly|monthly|weekly|daily|hourly|reboot))|(@every (\d+(ns|us|µs|ms|s|m|h))+)|((((\d+,)+\d+|(\d+(\/|-)\d+)|\d+|\*) ?){5,7})",
5959
value,
6060
):
6161
raise ValueError(
62-
r"must validate the regular expression /(@(annually|yearly|monthly|weekly|daily|hourly|reboot))|(@every (\\d+(ns|us|µs|ms|s|m|h))+)|((((\\d+,)+\\d+|(\\d+(\\/|-)\\d+)|\\d+|\\*) ?){5,7})/"
62+
r"must validate the regular expression /(@(annually|yearly|monthly|weekly|daily|hourly|reboot))|(@every (\d+(ns|us|µs|ms|s|m|h))+)|((((\d+,)+\d+|(\d+(\/|-)\d+)|\d+|\*) ?){5,7})/"
6363
)
6464
return value
6565

services/ske/src/stackit/ske/models/machine_image_version.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,13 @@ def version_validate_regular_expression(cls, value):
5959
if not isinstance(value, str):
6060
value = str(value)
6161

62-
if not re.match(r"^\d+\.\d+\.\d+$", value):
63-
raise ValueError(r"must validate the regular expression /^\d+\.\d+\.\d+$/")
62+
if not re.match(
63+
r"^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$",
64+
value,
65+
):
66+
raise ValueError(
67+
r"must validate the regular expression /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/"
68+
)
6469
return value
6570

6671
model_config = ConfigDict(

0 commit comments

Comments
 (0)