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
61666e6da6a7eaa8ac113f9bf8748266058f493d
8 changes: 8 additions & 0 deletions services/ske/src/stackit/ske/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@
"ACL",
"Access",
"AccessScope",
"ApplicationLoadBalancer",
"Audit",
"AvailabilityZone",
"CNI",
"CRI",
"Cluster",
"ClusterError",
Expand All @@ -51,6 +53,7 @@
"IDP",
"IDPKubeconfig",
"Image",
"Kata",
"Kubeconfig",
"Kubernetes",
"KubernetesVersion",
Expand Down Expand Up @@ -93,6 +96,9 @@

# 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.cluster import Cluster as Cluster
Expand All @@ -101,6 +107,7 @@
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 +137,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 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
3 changes: 3 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,14 @@

# 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.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 +44,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 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
8 changes: 7 additions & 1 deletion services/ske/src/stackit/ske/models/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import re # noqa: F401
from typing import Any, ClassVar, Dict, List, Optional, Set

from pydantic import BaseModel, ConfigDict, Field, field_validator
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
from pydantic_core import to_jsonable_python
from typing_extensions import Annotated, Self

Expand All @@ -43,6 +43,10 @@ class Cluster(BaseModel):
extensions: Optional[Extension] = None
hibernation: Optional[Hibernation] = None
kubernetes: Kubernetes
labels: Optional[Dict[str, StrictStr]] = Field(
default=None,
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.",
)
maintenance: Optional[Maintenance] = None
name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=11)]] = Field(
default=None,
Expand All @@ -57,6 +61,7 @@ class Cluster(BaseModel):
"extensions",
"hibernation",
"kubernetes",
"labels",
"maintenance",
"name",
"network",
Expand Down Expand Up @@ -170,6 +175,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
Hibernation.from_dict(obj["hibernation"]) if obj.get("hibernation") is not None else None
),
"kubernetes": Kubernetes.from_dict(obj["kubernetes"]) if obj.get("kubernetes") is not None else None,
"labels": obj.get("labels"),
"maintenance": (
Maintenance.from_dict(obj["maintenance"]) if obj.get("maintenance") is not None else None
),
Expand Down
14 changes: 14 additions & 0 deletions services/ske/src/stackit/ske/models/cluster_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,22 @@ class ClusterStatus(BaseModel):
expiration: Optional[ExpirationStatus] = None
hibernated: Optional[StrictBool] = None
identity: Optional[StrictStr] = None
node_address_ranges: Optional[List[StrictStr]] = Field(
default=None,
description="The network ranges (in CIDR notation) used by nodes of the cluster.",
alias="nodeAddressRanges",
)
pod_address_ranges: Optional[List[StrictStr]] = Field(
default=None,
description="The network ranges (in CIDR notation) used by pods of the cluster.",
alias="podAddressRanges",
)
service_account_issuer: Optional[StrictStr] = Field(default=None, alias="serviceAccountIssuer")
service_address_ranges: Optional[List[StrictStr]] = Field(
default=None,
description="The network ranges (in CIDR notation) used by services of the cluster.",
alias="serviceAddressRanges",
)
__properties: ClassVar[List[str]] = [
"aggregated",
"creationTime",
Expand All @@ -73,8 +83,10 @@ class ClusterStatus(BaseModel):
"expiration",
"hibernated",
"identity",
"nodeAddressRanges",
"podAddressRanges",
"serviceAccountIssuer",
"serviceAddressRanges",
]

@field_validator("creation_time", mode="before")
Expand Down Expand Up @@ -175,8 +187,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
),
"hibernated": obj.get("hibernated"),
"identity": obj.get("identity"),
"nodeAddressRanges": obj.get("nodeAddressRanges"),
"podAddressRanges": obj.get("podAddressRanges"),
"serviceAccountIssuer": obj.get("serviceAccountIssuer"),
"serviceAddressRanges": obj.get("serviceAddressRanges"),
}
)
return _obj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

class ClusterStatusState(str, Enum):
"""
ClusterStatusState
ClusterStatusState holds information about the current state of the Cluster
"""

"""
Expand Down
82 changes: 82 additions & 0 deletions services/ske/src/stackit/ske/models/cni.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# 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
from pydantic_core import to_jsonable_python
from typing_extensions import Self


class CNI(BaseModel):
"""
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
""" # noqa: E501

calico: Optional[Dict[str, Any]] = Field(default=None, description="configuration options for the Calico CNI")
__properties: ClassVar[List[str]] = ["calico"]

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 CNI 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 CNI from a dict"""
if obj is None:
return None

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

_obj = cls.model_validate({"calico": obj.get("calico")})
return _obj
Loading
Loading