Skip to content

Commit f0e8f55

Browse files
Generate ske
1 parent 55f6205 commit f0e8f55

15 files changed

Lines changed: 232 additions & 22 deletions

services/ske/oas_commit

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

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/api/default_api.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -610,9 +610,10 @@ def create_or_update_cluster(
610610
project_id: StrictStr,
611611
region: StrictStr,
612612
cluster_name: Annotated[
613-
StrictStr,
613+
str,
614614
Field(
615-
description="Use lowercase alphanumeric characters or -, must start and end with an alphanumeric character, and be between 1 and 11 characters long."
615+
strict=True,
616+
description="Use lowercase alphanumeric characters or -, must start and end with an alphanumeric character, and be between 1 and 11 characters long.",
616617
),
617618
],
618619
create_or_update_cluster_payload: CreateOrUpdateClusterPayload,
@@ -690,9 +691,10 @@ def create_or_update_cluster_with_http_info(
690691
project_id: StrictStr,
691692
region: StrictStr,
692693
cluster_name: Annotated[
693-
StrictStr,
694+
str,
694695
Field(
695-
description="Use lowercase alphanumeric characters or -, must start and end with an alphanumeric character, and be between 1 and 11 characters long."
696+
strict=True,
697+
description="Use lowercase alphanumeric characters or -, must start and end with an alphanumeric character, and be between 1 and 11 characters long.",
696698
),
697699
],
698700
create_or_update_cluster_payload: CreateOrUpdateClusterPayload,
@@ -770,9 +772,10 @@ def create_or_update_cluster_without_preload_content(
770772
project_id: StrictStr,
771773
region: StrictStr,
772774
cluster_name: Annotated[
773-
StrictStr,
775+
str,
774776
Field(
775-
description="Use lowercase alphanumeric characters or -, must start and end with an alphanumeric character, and be between 1 and 11 characters long."
777+
strict=True,
778+
description="Use lowercase alphanumeric characters or -, must start and end with an alphanumeric character, and be between 1 and 11 characters long.",
776779
),
777780
],
778781
create_or_update_cluster_payload: CreateOrUpdateClusterPayload,

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,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
class AccessScope(str, Enum):
2323
"""
24-
The access scope of the Control Plane. It defines if the Kubernetes control plane is public or only available inside a STACKIT Network Area. This field is immutable. ⚠️ Note: This feature is in private preview. Supplying this object is only permitted for enabled accounts. If your account does not have access, the request will be rejected.
24+
The access scope of the Control Plane. It defines if the Kubernetes control plane is public or only available inside a STACKIT Network Area. ⚠️ Warning: Changing the access scope on an existing cluster directly impacts its network exposure (e.g., making a private cluster publicly accessible) ⚠️ Note: This feature is in private preview. Supplying this object is only permitted for enabled accounts. If your account does not have access, the request will be rejected.
2525
"""
2626

2727
"""
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
),

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
class ClusterStatusState(str, Enum):
2323
"""
24-
ClusterStatusState
24+
ClusterStatusState holds information about the current state of the Cluster
2525
"""
2626

2727
"""
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
),

0 commit comments

Comments
 (0)