Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion services/ske/oas_commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ea0931a6f93703c990517136e0d4c7a88455b282
716f4d2bf40383fc9a9c3ee0f67a0490d4a15d81
16 changes: 16 additions & 0 deletions services/ske/src/stackit/ske/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@
"ACL",
"Access",
"AccessScope",
"ApplicationLoadBalancer",
"Audit",
"AvailabilityZone",
"CNI",
"CRI",
"CiliumConfig",
"CiliumHubble",
"Cluster",
"ClusterError",
"ClusterStatus",
Expand All @@ -51,6 +55,7 @@
"IDP",
"IDPKubeconfig",
"Image",
"Kata",
"Kubeconfig",
"Kubernetes",
"KubernetesVersion",
Expand All @@ -59,6 +64,7 @@
"Machine",
"MachineImage",
"MachineImageVersion",
"MachineImageVersionCRI",
"MachineType",
"Maintenance",
"MaintenanceAutoUpdate",
Expand Down Expand Up @@ -93,14 +99,20 @@

# import models into sdk package
from stackit.ske.models.acl import ACL as ACL
from stackit.ske.models.application_load_balancer import (
ApplicationLoadBalancer as ApplicationLoadBalancer,
)
from stackit.ske.models.audit import Audit as Audit
from stackit.ske.models.availability_zone import AvailabilityZone as AvailabilityZone
from stackit.ske.models.cilium_config import CiliumConfig as CiliumConfig
from stackit.ske.models.cilium_hubble import CiliumHubble as CiliumHubble
from stackit.ske.models.cluster import Cluster as Cluster
from stackit.ske.models.cluster_error import ClusterError as ClusterError
from stackit.ske.models.cluster_status import ClusterStatus as ClusterStatus
from stackit.ske.models.cluster_status_state import (
ClusterStatusState as ClusterStatusState,
)
from stackit.ske.models.cni import CNI as CNI
from stackit.ske.models.create_kubeconfig_payload import (
CreateKubeconfigPayload as CreateKubeconfigPayload,
)
Expand Down Expand Up @@ -130,6 +142,7 @@
from stackit.ske.models.idp import IDP as IDP
from stackit.ske.models.idp_kubeconfig import IDPKubeconfig as IDPKubeconfig
from stackit.ske.models.image import Image as Image
from stackit.ske.models.kata import Kata as Kata
from stackit.ske.models.kubeconfig import Kubeconfig as Kubeconfig
from stackit.ske.models.kubernetes import Kubernetes as Kubernetes
from stackit.ske.models.kubernetes_version import KubernetesVersion as KubernetesVersion
Expand All @@ -142,6 +155,9 @@
from stackit.ske.models.machine_image_version import (
MachineImageVersion as MachineImageVersion,
)
from stackit.ske.models.machine_image_version_cri import (
MachineImageVersionCRI as MachineImageVersionCRI,
)
from stackit.ske.models.machine_type import MachineType as MachineType
from stackit.ske.models.maintenance import Maintenance as Maintenance
from stackit.ske.models.maintenance_auto_update import (
Expand Down
15 changes: 9 additions & 6 deletions services/ske/src/stackit/ske/api/default_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,9 +610,10 @@ def create_or_update_cluster(
project_id: StrictStr,
region: StrictStr,
cluster_name: Annotated[
StrictStr,
str,
Field(
description="Use lowercase alphanumeric characters or -, must start and end with an alphanumeric character, and be between 1 and 11 characters long."
strict=True,
description="Use lowercase alphanumeric characters or -, must start and end with an alphanumeric character, and be between 1 and 11 characters long.",
),
],
create_or_update_cluster_payload: CreateOrUpdateClusterPayload,
Expand Down Expand Up @@ -690,9 +691,10 @@ def create_or_update_cluster_with_http_info(
project_id: StrictStr,
region: StrictStr,
cluster_name: Annotated[
StrictStr,
str,
Field(
description="Use lowercase alphanumeric characters or -, must start and end with an alphanumeric character, and be between 1 and 11 characters long."
strict=True,
description="Use lowercase alphanumeric characters or -, must start and end with an alphanumeric character, and be between 1 and 11 characters long.",
),
],
create_or_update_cluster_payload: CreateOrUpdateClusterPayload,
Expand Down Expand Up @@ -770,9 +772,10 @@ def create_or_update_cluster_without_preload_content(
project_id: StrictStr,
region: StrictStr,
cluster_name: Annotated[
StrictStr,
str,
Field(
description="Use lowercase alphanumeric characters or -, must start and end with an alphanumeric character, and be between 1 and 11 characters long."
strict=True,
description="Use lowercase alphanumeric characters or -, must start and end with an alphanumeric character, and be between 1 and 11 characters long.",
),
],
create_or_update_cluster_payload: CreateOrUpdateClusterPayload,
Expand Down
6 changes: 6 additions & 0 deletions services/ske/src/stackit/ske/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,16 @@

# import models into model package
from stackit.ske.models.acl import ACL
from stackit.ske.models.application_load_balancer import ApplicationLoadBalancer
from stackit.ske.models.audit import Audit
from stackit.ske.models.availability_zone import AvailabilityZone
from stackit.ske.models.cilium_config import CiliumConfig
from stackit.ske.models.cilium_hubble import CiliumHubble
from stackit.ske.models.cluster import Cluster
from stackit.ske.models.cluster_error import ClusterError
from stackit.ske.models.cluster_status import ClusterStatus
from stackit.ske.models.cluster_status_state import ClusterStatusState
from stackit.ske.models.cni import CNI
from stackit.ske.models.create_kubeconfig_payload import CreateKubeconfigPayload
from stackit.ske.models.create_or_update_cluster_payload import (
CreateOrUpdateClusterPayload,
Expand All @@ -42,6 +46,7 @@
from stackit.ske.models.idp import IDP
from stackit.ske.models.idp_kubeconfig import IDPKubeconfig
from stackit.ske.models.image import Image
from stackit.ske.models.kata import Kata
from stackit.ske.models.kubeconfig import Kubeconfig
from stackit.ske.models.kubernetes import Kubernetes
from stackit.ske.models.kubernetes_version import KubernetesVersion
Expand All @@ -50,6 +55,7 @@
from stackit.ske.models.machine import Machine
from stackit.ske.models.machine_image import MachineImage
from stackit.ske.models.machine_image_version import MachineImageVersion
from stackit.ske.models.machine_image_version_cri import MachineImageVersionCRI
from stackit.ske.models.machine_type import MachineType
from stackit.ske.models.maintenance import Maintenance
from stackit.ske.models.maintenance_auto_update import MaintenanceAutoUpdate
Expand Down
2 changes: 1 addition & 1 deletion services/ske/src/stackit/ske/models/access_scope.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

class AccessScope(str, Enum):
"""
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.
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.
"""

"""
Expand Down
4 changes: 2 additions & 2 deletions services/ske/src/stackit/ske/models/acl.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@
StrictStr,
)
from pydantic_core import to_jsonable_python
from typing_extensions import Annotated, Self
from typing_extensions import Self


class ACL(BaseModel):
"""
ACL
""" # noqa: E501

allowed_cidrs: Annotated[List[StrictStr], Field(max_length=10)] = Field(
allowed_cidrs: List[StrictStr] = Field(
description="Array of CIDRs to allow access to the kubernetes API.", alias="allowedCidrs"
)
enabled: StrictBool = Field(description="Enables the acl extension.")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# coding: utf-8

"""
STACKIT Kubernetes Engine API
The SKE API provides endpoints to create, update or delete clusters within STACKIT projects and to trigger further cluster management tasks.
The version of the OpenAPI document: 2.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501

from __future__ import annotations

import json
import pprint
from typing import Any, ClassVar, Dict, List, Optional, Set

from pydantic import BaseModel, ConfigDict, Field, StrictBool
from pydantic_core import to_jsonable_python
from typing_extensions import Self


class ApplicationLoadBalancer(BaseModel):
"""
ApplicationLoadBalancer
""" # noqa: E501

enabled: StrictBool = Field(
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."
)
__properties: ClassVar[List[str]] = ["enabled"]

model_config = ConfigDict(
validate_by_name=True,
validate_by_alias=True,
validate_assignment=True,
protected_namespaces=(),
)

def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))

def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
return json.dumps(to_jsonable_python(self.to_dict()))

@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of ApplicationLoadBalancer from a JSON string"""
return cls.from_dict(json.loads(json_str))

def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([])

_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict

@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of ApplicationLoadBalancer from a dict"""
if obj is None:
return None

if not isinstance(obj, dict):
return cls.model_validate(obj)

_obj = cls.model_validate({"enabled": obj.get("enabled")})
return _obj
89 changes: 89 additions & 0 deletions services/ske/src/stackit/ske/models/cilium_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# coding: utf-8

"""
STACKIT Kubernetes Engine API

The SKE API provides endpoints to create, update or delete clusters within STACKIT projects and to trigger further cluster management tasks.

The version of the OpenAPI document: 2.0
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
""" # noqa: E501

from __future__ import annotations

import json
import pprint
from typing import Any, ClassVar, Dict, List, Optional, Set

from pydantic import BaseModel, ConfigDict
from pydantic_core import to_jsonable_python
from typing_extensions import Self

from stackit.ske.models.cilium_hubble import CiliumHubble


class CiliumConfig(BaseModel):
"""
Configuration options for the Cilium CNI ⚠️ Note: This feature is in private preview. Enabling Cilium is only possible for enabled accounts. If your account does not have access, the request will be rejected.
""" # noqa: E501

hubble: Optional[CiliumHubble] = None
__properties: ClassVar[List[str]] = ["hubble"]

model_config = ConfigDict(
validate_by_name=True,
validate_by_alias=True,
validate_assignment=True,
protected_namespaces=(),
)

def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))

def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
return json.dumps(to_jsonable_python(self.to_dict()))

@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of CiliumConfig from a JSON string"""
return cls.from_dict(json.loads(json_str))

def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:

* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([])

_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of hubble
if self.hubble:
_dict["hubble"] = self.hubble.to_dict()
return _dict

@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of CiliumConfig from a dict"""
if obj is None:
return None

if not isinstance(obj, dict):
return cls.model_validate(obj)

_obj = cls.model_validate(
{"hubble": CiliumHubble.from_dict(obj["hubble"]) if obj.get("hubble") is not None else None}
)
return _obj
Loading
Loading