From c9ba1c4f4689b213004c8b56f73175eacb48e734 Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Fri, 4 Jul 2025 09:06:01 +0000 Subject: [PATCH] Generate ske --- services/ske/src/stackit/ske/__init__.py | 159 +++++--- .../ske/src/stackit/ske/api/default_api.py | 379 +++++++++++++++--- services/ske/src/stackit/ske/api_client.py | 25 +- services/ske/src/stackit/ske/configuration.py | 53 ++- services/ske/src/stackit/ske/exceptions.py | 25 +- .../ske/src/stackit/ske/models/__init__.py | 6 +- services/ske/src/stackit/ske/models/acl.py | 10 +- .../stackit/ske/models/availability_zone.py | 6 +- .../ske/src/stackit/ske/models/cluster.py | 6 +- .../src/stackit/ske/models/cluster_error.py | 6 +- .../src/stackit/ske/models/cluster_status.py | 6 +- .../ske/models/cluster_status_state.py | 4 +- .../ske/models/create_kubeconfig_payload.py | 6 +- .../create_or_update_cluster_payload.py | 6 +- .../ske/models/credentials_rotation_state.py | 8 +- services/ske/src/stackit/ske/models/cri.py | 6 +- services/ske/src/stackit/ske/models/dns.py | 6 +- .../ske/src/stackit/ske/models/extension.py | 22 +- .../ske/src/stackit/ske/models/hibernation.py | 6 +- .../ske/models/hibernation_schedule.py | 8 +- services/ske/src/stackit/ske/models/image.py | 6 +- .../ske/src/stackit/ske/models/kubeconfig.py | 6 +- .../ske/src/stackit/ske/models/kubernetes.py | 21 +- .../stackit/ske/models/kubernetes_version.py | 8 +- .../ske/models/list_clusters_response.py | 6 +- .../stackit/ske/models/login_kubeconfig.py | 6 +- .../ske/src/stackit/ske/models/machine.py | 6 +- .../src/stackit/ske/models/machine_image.py | 6 +- .../ske/models/machine_image_version.py | 8 +- .../src/stackit/ske/models/machine_type.py | 6 +- .../ske/src/stackit/ske/models/maintenance.py | 6 +- .../ske/models/maintenance_auto_update.py | 6 +- .../ske/src/stackit/ske/models/network.py | 6 +- .../ske/src/stackit/ske/models/nodepool.py | 6 +- .../ske/models/{argus.py => observability.py} | 24 +- .../stackit/ske/models/provider_options.py | 6 +- .../src/stackit/ske/models/runtime_error.py | 12 +- services/ske/src/stackit/ske/models/taint.py | 6 +- .../ske/src/stackit/ske/models/time_window.py | 6 +- services/ske/src/stackit/ske/models/volume.py | 6 +- .../ske/src/stackit/ske/models/volume_type.py | 6 +- services/ske/src/stackit/ske/rest.py | 6 +- 42 files changed, 643 insertions(+), 285 deletions(-) rename services/ske/src/stackit/ske/models/{argus.py => observability.py} (75%) diff --git a/services/ske/src/stackit/ske/__init__.py b/services/ske/src/stackit/ske/__init__.py index 2a0cd796..5550611d 100644 --- a/services/ske/src/stackit/ske/__init__.py +++ b/services/ske/src/stackit/ske/__init__.py @@ -7,66 +7,127 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 __version__ = "1.0.0" +# Define package exports +__all__ = [ + "DefaultApi", + "ApiResponse", + "ApiClient", + "HostConfiguration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "ACL", + "AvailabilityZone", + "CRI", + "Cluster", + "ClusterError", + "ClusterStatus", + "ClusterStatusState", + "CreateKubeconfigPayload", + "CreateOrUpdateClusterPayload", + "CredentialsRotationState", + "DNS", + "Extension", + "Hibernation", + "HibernationSchedule", + "Image", + "Kubeconfig", + "Kubernetes", + "KubernetesVersion", + "ListClustersResponse", + "LoginKubeconfig", + "Machine", + "MachineImage", + "MachineImageVersion", + "MachineType", + "Maintenance", + "MaintenanceAutoUpdate", + "Network", + "Nodepool", + "Observability", + "ProviderOptions", + "RuntimeError", + "Taint", + "TimeWindow", + "Volume", + "VolumeType", +] + # import apis into sdk package -from stackit.ske.api.default_api import DefaultApi -from stackit.ske.api_client import ApiClient +from stackit.ske.api.default_api import DefaultApi as DefaultApi +from stackit.ske.api_client import ApiClient as ApiClient # import ApiClient -from stackit.ske.api_response import ApiResponse -from stackit.ske.configuration import HostConfiguration -from stackit.ske.exceptions import ( - ApiAttributeError, - ApiException, - ApiKeyError, - ApiTypeError, - ApiValueError, - OpenApiException, -) +from stackit.ske.api_response import ApiResponse as ApiResponse +from stackit.ske.configuration import HostConfiguration as HostConfiguration +from stackit.ske.exceptions import ApiAttributeError as ApiAttributeError +from stackit.ske.exceptions import ApiException as ApiException +from stackit.ske.exceptions import ApiKeyError as ApiKeyError +from stackit.ske.exceptions import ApiTypeError as ApiTypeError +from stackit.ske.exceptions import ApiValueError as ApiValueError +from stackit.ske.exceptions import OpenApiException as OpenApiException # import models into sdk package -from stackit.ske.models.acl import ACL -from stackit.ske.models.argus import Argus -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.create_kubeconfig_payload import CreateKubeconfigPayload +from stackit.ske.models.acl import ACL as ACL +from stackit.ske.models.availability_zone import AvailabilityZone as AvailabilityZone +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.create_kubeconfig_payload import ( + CreateKubeconfigPayload as CreateKubeconfigPayload, +) from stackit.ske.models.create_or_update_cluster_payload import ( - CreateOrUpdateClusterPayload, + CreateOrUpdateClusterPayload as CreateOrUpdateClusterPayload, +) +from stackit.ske.models.credentials_rotation_state import ( + CredentialsRotationState as CredentialsRotationState, +) +from stackit.ske.models.cri import CRI as CRI +from stackit.ske.models.dns import DNS as DNS +from stackit.ske.models.extension import Extension as Extension +from stackit.ske.models.hibernation import Hibernation as Hibernation +from stackit.ske.models.hibernation_schedule import ( + HibernationSchedule as HibernationSchedule, +) +from stackit.ske.models.image import Image as Image +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 +from stackit.ske.models.list_clusters_response import ( + ListClustersResponse as ListClustersResponse, +) +from stackit.ske.models.login_kubeconfig import LoginKubeconfig as LoginKubeconfig +from stackit.ske.models.machine import Machine as Machine +from stackit.ske.models.machine_image import MachineImage as MachineImage +from stackit.ske.models.machine_image_version import ( + MachineImageVersion as MachineImageVersion, +) +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 ( + MaintenanceAutoUpdate as MaintenanceAutoUpdate, ) -from stackit.ske.models.credentials_rotation_state import CredentialsRotationState -from stackit.ske.models.cri import CRI -from stackit.ske.models.dns import DNS -from stackit.ske.models.extension import Extension -from stackit.ske.models.hibernation import Hibernation -from stackit.ske.models.hibernation_schedule import HibernationSchedule -from stackit.ske.models.image import Image -from stackit.ske.models.kubeconfig import Kubeconfig -from stackit.ske.models.kubernetes import Kubernetes -from stackit.ske.models.kubernetes_version import KubernetesVersion -from stackit.ske.models.list_clusters_response import ListClustersResponse -from stackit.ske.models.login_kubeconfig import LoginKubeconfig -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_type import MachineType -from stackit.ske.models.maintenance import Maintenance -from stackit.ske.models.maintenance_auto_update import MaintenanceAutoUpdate -from stackit.ske.models.network import Network -from stackit.ske.models.nodepool import Nodepool -from stackit.ske.models.provider_options import ProviderOptions -from stackit.ske.models.runtime_error import RuntimeError -from stackit.ske.models.taint import Taint -from stackit.ske.models.time_window import TimeWindow -from stackit.ske.models.volume import Volume -from stackit.ske.models.volume_type import VolumeType +from stackit.ske.models.network import Network as Network +from stackit.ske.models.nodepool import Nodepool as Nodepool +from stackit.ske.models.observability import Observability as Observability +from stackit.ske.models.provider_options import ProviderOptions as ProviderOptions +from stackit.ske.models.runtime_error import RuntimeError as RuntimeError +from stackit.ske.models.taint import Taint as Taint +from stackit.ske.models.time_window import TimeWindow as TimeWindow +from stackit.ske.models.volume import Volume as Volume +from stackit.ske.models.volume_type import VolumeType as VolumeType diff --git a/services/ske/src/stackit/ske/api/default_api.py b/services/ske/src/stackit/ske/api/default_api.py index d9a364e0..9ab8fccb 100644 --- a/services/ske/src/stackit/ske/api/default_api.py +++ b/services/ske/src/stackit/ske/api/default_api.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Dict, List, Optional, Tuple, Union @@ -48,6 +48,7 @@ def __init__(self, configuration: Configuration = None) -> None: def complete_credentials_rotation( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -65,6 +66,8 @@ def complete_credentials_rotation( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -87,10 +90,11 @@ def complete_credentials_rotation( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._complete_credentials_rotation_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -102,6 +106,7 @@ def complete_credentials_rotation( "200": "object", "202": "object", "400": "object", + "401": "object", "404": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -115,6 +120,7 @@ def complete_credentials_rotation( def complete_credentials_rotation_with_http_info( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -132,6 +138,8 @@ def complete_credentials_rotation_with_http_info( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -154,10 +162,11 @@ def complete_credentials_rotation_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._complete_credentials_rotation_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -169,6 +178,7 @@ def complete_credentials_rotation_with_http_info( "200": "object", "202": "object", "400": "object", + "401": "object", "404": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -182,6 +192,7 @@ def complete_credentials_rotation_with_http_info( def complete_credentials_rotation_without_preload_content( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -199,6 +210,8 @@ def complete_credentials_rotation_without_preload_content( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -221,10 +234,11 @@ def complete_credentials_rotation_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._complete_credentials_rotation_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -236,6 +250,7 @@ def complete_credentials_rotation_without_preload_content( "200": "object", "202": "object", "400": "object", + "401": "object", "404": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -244,6 +259,7 @@ def complete_credentials_rotation_without_preload_content( def _complete_credentials_rotation_serialize( self, project_id, + region, cluster_name, _request_auth, _content_type, @@ -259,12 +275,14 @@ def _complete_credentials_rotation_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters if project_id is not None: _path_params["projectId"] = project_id + if region is not None: + _path_params["region"] = region if cluster_name is not None: _path_params["clusterName"] = cluster_name # process the query parameters @@ -281,7 +299,7 @@ def _complete_credentials_rotation_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v1/projects/{projectId}/clusters/{clusterName}/complete-credentials-rotation", + resource_path="/v2/projects/{projectId}/regions/{region}/clusters/{clusterName}/complete-credentials-rotation", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -298,6 +316,7 @@ def _complete_credentials_rotation_serialize( def create_kubeconfig( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, create_kubeconfig_payload: CreateKubeconfigPayload, _request_timeout: Union[ @@ -316,6 +335,8 @@ def create_kubeconfig( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param create_kubeconfig_payload: (required) @@ -340,10 +361,11 @@ def create_kubeconfig( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_kubeconfig_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, create_kubeconfig_payload=create_kubeconfig_payload, _request_auth=_request_auth, @@ -354,6 +376,8 @@ def create_kubeconfig( _response_types_map: Dict[str, Optional[str]] = { "200": "Kubeconfig", + "400": "object", + "401": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -366,6 +390,7 @@ def create_kubeconfig( def create_kubeconfig_with_http_info( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, create_kubeconfig_payload: CreateKubeconfigPayload, _request_timeout: Union[ @@ -384,6 +409,8 @@ def create_kubeconfig_with_http_info( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param create_kubeconfig_payload: (required) @@ -408,10 +435,11 @@ def create_kubeconfig_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_kubeconfig_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, create_kubeconfig_payload=create_kubeconfig_payload, _request_auth=_request_auth, @@ -422,6 +450,8 @@ def create_kubeconfig_with_http_info( _response_types_map: Dict[str, Optional[str]] = { "200": "Kubeconfig", + "400": "object", + "401": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -434,6 +464,7 @@ def create_kubeconfig_with_http_info( def create_kubeconfig_without_preload_content( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, create_kubeconfig_payload: CreateKubeconfigPayload, _request_timeout: Union[ @@ -452,6 +483,8 @@ def create_kubeconfig_without_preload_content( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param create_kubeconfig_payload: (required) @@ -476,10 +509,11 @@ def create_kubeconfig_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_kubeconfig_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, create_kubeconfig_payload=create_kubeconfig_payload, _request_auth=_request_auth, @@ -490,6 +524,8 @@ def create_kubeconfig_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { "200": "Kubeconfig", + "400": "object", + "401": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response @@ -497,6 +533,7 @@ def create_kubeconfig_without_preload_content( def _create_kubeconfig_serialize( self, project_id, + region, cluster_name, create_kubeconfig_payload, _request_auth, @@ -513,12 +550,14 @@ def _create_kubeconfig_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters if project_id is not None: _path_params["projectId"] = project_id + if region is not None: + _path_params["region"] = region if cluster_name is not None: _path_params["clusterName"] = cluster_name # process the query parameters @@ -545,7 +584,7 @@ def _create_kubeconfig_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v1/projects/{projectId}/clusters/{clusterName}/kubeconfig", + resource_path="/v2/projects/{projectId}/regions/{region}/clusters/{clusterName}/kubeconfig", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -562,6 +601,7 @@ def _create_kubeconfig_serialize( def create_or_update_cluster( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, create_or_update_cluster_payload: CreateOrUpdateClusterPayload, _request_timeout: Union[ @@ -580,6 +620,8 @@ def create_or_update_cluster( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param create_or_update_cluster_payload: (required) @@ -604,10 +646,11 @@ def create_or_update_cluster( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_or_update_cluster_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, create_or_update_cluster_payload=create_or_update_cluster_payload, _request_auth=_request_auth, @@ -620,6 +663,7 @@ def create_or_update_cluster( "200": "Cluster", "202": "object", "400": "object", + "401": "object", "404": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -633,6 +677,7 @@ def create_or_update_cluster( def create_or_update_cluster_with_http_info( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, create_or_update_cluster_payload: CreateOrUpdateClusterPayload, _request_timeout: Union[ @@ -651,6 +696,8 @@ def create_or_update_cluster_with_http_info( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param create_or_update_cluster_payload: (required) @@ -675,10 +722,11 @@ def create_or_update_cluster_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_or_update_cluster_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, create_or_update_cluster_payload=create_or_update_cluster_payload, _request_auth=_request_auth, @@ -691,6 +739,7 @@ def create_or_update_cluster_with_http_info( "200": "Cluster", "202": "object", "400": "object", + "401": "object", "404": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -704,6 +753,7 @@ def create_or_update_cluster_with_http_info( def create_or_update_cluster_without_preload_content( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, create_or_update_cluster_payload: CreateOrUpdateClusterPayload, _request_timeout: Union[ @@ -722,6 +772,8 @@ def create_or_update_cluster_without_preload_content( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param create_or_update_cluster_payload: (required) @@ -746,10 +798,11 @@ def create_or_update_cluster_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_or_update_cluster_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, create_or_update_cluster_payload=create_or_update_cluster_payload, _request_auth=_request_auth, @@ -762,6 +815,7 @@ def create_or_update_cluster_without_preload_content( "200": "Cluster", "202": "object", "400": "object", + "401": "object", "404": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -770,6 +824,7 @@ def create_or_update_cluster_without_preload_content( def _create_or_update_cluster_serialize( self, project_id, + region, cluster_name, create_or_update_cluster_payload, _request_auth, @@ -786,12 +841,14 @@ def _create_or_update_cluster_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters if project_id is not None: _path_params["projectId"] = project_id + if region is not None: + _path_params["region"] = region if cluster_name is not None: _path_params["clusterName"] = cluster_name # process the query parameters @@ -818,7 +875,7 @@ def _create_or_update_cluster_serialize( return self.api_client.param_serialize( method="PUT", - resource_path="/v1/projects/{projectId}/clusters/{clusterName}", + resource_path="/v2/projects/{projectId}/regions/{region}/clusters/{clusterName}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -835,6 +892,7 @@ def _create_or_update_cluster_serialize( def delete_cluster( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -852,6 +910,8 @@ def delete_cluster( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -874,10 +934,11 @@ def delete_cluster( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_cluster_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -888,6 +949,8 @@ def delete_cluster( _response_types_map: Dict[str, Optional[str]] = { "200": "object", "202": "object", + "400": "object", + "401": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -900,6 +963,7 @@ def delete_cluster( def delete_cluster_with_http_info( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -917,6 +981,8 @@ def delete_cluster_with_http_info( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -939,10 +1005,11 @@ def delete_cluster_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_cluster_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -953,6 +1020,8 @@ def delete_cluster_with_http_info( _response_types_map: Dict[str, Optional[str]] = { "200": "object", "202": "object", + "400": "object", + "401": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -965,6 +1034,7 @@ def delete_cluster_with_http_info( def delete_cluster_without_preload_content( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -982,6 +1052,8 @@ def delete_cluster_without_preload_content( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -1004,10 +1076,11 @@ def delete_cluster_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_cluster_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -1018,6 +1091,8 @@ def delete_cluster_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { "200": "object", "202": "object", + "400": "object", + "401": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response @@ -1025,6 +1100,7 @@ def delete_cluster_without_preload_content( def _delete_cluster_serialize( self, project_id, + region, cluster_name, _request_auth, _content_type, @@ -1040,12 +1116,14 @@ def _delete_cluster_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters if project_id is not None: _path_params["projectId"] = project_id + if region is not None: + _path_params["region"] = region if cluster_name is not None: _path_params["clusterName"] = cluster_name # process the query parameters @@ -1062,7 +1140,7 @@ def _delete_cluster_serialize( return self.api_client.param_serialize( method="DELETE", - resource_path="/v1/projects/{projectId}/clusters/{clusterName}", + resource_path="/v2/projects/{projectId}/regions/{region}/clusters/{clusterName}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1079,6 +1157,7 @@ def _delete_cluster_serialize( def get_cluster( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -1096,6 +1175,8 @@ def get_cluster( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -1118,10 +1199,11 @@ def get_cluster( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_cluster_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -1131,6 +1213,8 @@ def get_cluster( _response_types_map: Dict[str, Optional[str]] = { "200": "Cluster", + "400": "object", + "401": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -1143,6 +1227,7 @@ def get_cluster( def get_cluster_with_http_info( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -1160,6 +1245,8 @@ def get_cluster_with_http_info( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -1182,10 +1269,11 @@ def get_cluster_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_cluster_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -1195,6 +1283,8 @@ def get_cluster_with_http_info( _response_types_map: Dict[str, Optional[str]] = { "200": "Cluster", + "400": "object", + "401": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -1207,6 +1297,7 @@ def get_cluster_with_http_info( def get_cluster_without_preload_content( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -1224,6 +1315,8 @@ def get_cluster_without_preload_content( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -1246,10 +1339,11 @@ def get_cluster_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_cluster_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -1259,6 +1353,8 @@ def get_cluster_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { "200": "Cluster", + "400": "object", + "401": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response @@ -1266,6 +1362,7 @@ def get_cluster_without_preload_content( def _get_cluster_serialize( self, project_id, + region, cluster_name, _request_auth, _content_type, @@ -1281,12 +1378,14 @@ def _get_cluster_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters if project_id is not None: _path_params["projectId"] = project_id + if region is not None: + _path_params["region"] = region if cluster_name is not None: _path_params["clusterName"] = cluster_name # process the query parameters @@ -1303,7 +1402,7 @@ def _get_cluster_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1/projects/{projectId}/clusters/{clusterName}", + resource_path="/v2/projects/{projectId}/regions/{region}/clusters/{clusterName}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1320,6 +1419,7 @@ def _get_cluster_serialize( def get_login_kubeconfig( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -1337,6 +1437,8 @@ def get_login_kubeconfig( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -1359,10 +1461,11 @@ def get_login_kubeconfig( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_login_kubeconfig_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -1372,6 +1475,8 @@ def get_login_kubeconfig( _response_types_map: Dict[str, Optional[str]] = { "200": "LoginKubeconfig", + "400": "object", + "401": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -1384,6 +1489,7 @@ def get_login_kubeconfig( def get_login_kubeconfig_with_http_info( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -1401,6 +1507,8 @@ def get_login_kubeconfig_with_http_info( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -1423,10 +1531,11 @@ def get_login_kubeconfig_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_login_kubeconfig_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -1436,6 +1545,8 @@ def get_login_kubeconfig_with_http_info( _response_types_map: Dict[str, Optional[str]] = { "200": "LoginKubeconfig", + "400": "object", + "401": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -1448,6 +1559,7 @@ def get_login_kubeconfig_with_http_info( def get_login_kubeconfig_without_preload_content( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -1465,6 +1577,8 @@ def get_login_kubeconfig_without_preload_content( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -1487,10 +1601,11 @@ def get_login_kubeconfig_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_login_kubeconfig_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -1500,6 +1615,8 @@ def get_login_kubeconfig_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { "200": "LoginKubeconfig", + "400": "object", + "401": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response @@ -1507,6 +1624,7 @@ def get_login_kubeconfig_without_preload_content( def _get_login_kubeconfig_serialize( self, project_id, + region, cluster_name, _request_auth, _content_type, @@ -1522,12 +1640,14 @@ def _get_login_kubeconfig_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters if project_id is not None: _path_params["projectId"] = project_id + if region is not None: + _path_params["region"] = region if cluster_name is not None: _path_params["clusterName"] = cluster_name # process the query parameters @@ -1544,7 +1664,7 @@ def _get_login_kubeconfig_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1/projects/{projectId}/clusters/{clusterName}/kubeconfig/login", + resource_path="/v2/projects/{projectId}/regions/{region}/clusters/{clusterName}/kubeconfig/login", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1561,6 +1681,7 @@ def _get_login_kubeconfig_serialize( def list_clusters( self, project_id: StrictStr, + region: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1577,6 +1698,8 @@ def list_clusters( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1597,10 +1720,11 @@ def list_clusters( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_clusters_serialize( project_id=project_id, + region=region, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1610,6 +1734,7 @@ def list_clusters( _response_types_map: Dict[str, Optional[str]] = { "200": "ListClustersResponse", "400": "object", + "401": "object", "404": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -1623,6 +1748,7 @@ def list_clusters( def list_clusters_with_http_info( self, project_id: StrictStr, + region: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1639,6 +1765,8 @@ def list_clusters_with_http_info( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1659,10 +1787,11 @@ def list_clusters_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_clusters_serialize( project_id=project_id, + region=region, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1672,6 +1801,7 @@ def list_clusters_with_http_info( _response_types_map: Dict[str, Optional[str]] = { "200": "ListClustersResponse", "400": "object", + "401": "object", "404": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -1685,6 +1815,7 @@ def list_clusters_with_http_info( def list_clusters_without_preload_content( self, project_id: StrictStr, + region: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1701,6 +1832,8 @@ def list_clusters_without_preload_content( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1721,10 +1854,11 @@ def list_clusters_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_clusters_serialize( project_id=project_id, + region=region, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1734,6 +1868,7 @@ def list_clusters_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { "200": "ListClustersResponse", "400": "object", + "401": "object", "404": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -1742,6 +1877,7 @@ def list_clusters_without_preload_content( def _list_clusters_serialize( self, project_id, + region, _request_auth, _content_type, _headers, @@ -1756,12 +1892,14 @@ def _list_clusters_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters if project_id is not None: _path_params["projectId"] = project_id + if region is not None: + _path_params["region"] = region # process the query parameters # process the header parameters # process the form parameters @@ -1776,7 +1914,7 @@ def _list_clusters_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1/projects/{projectId}/clusters", + resource_path="/v2/projects/{projectId}/regions/{region}/clusters", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1792,6 +1930,7 @@ def _list_clusters_serialize( @validate_call def list_provider_options( self, + region: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1806,6 +1945,8 @@ def list_provider_options( Returns a list of supported Kubernetes versions and a list of supported machine types for the cluster nodes. + :param region: (required) + :type region: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1826,14 +1967,20 @@ def list_provider_options( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_provider_options_serialize( - _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index + region=region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { "200": "ProviderOptions", + "400": "object", + "401": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -1845,6 +1992,7 @@ def list_provider_options( @validate_call def list_provider_options_with_http_info( self, + region: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1859,6 +2007,8 @@ def list_provider_options_with_http_info( Returns a list of supported Kubernetes versions and a list of supported machine types for the cluster nodes. + :param region: (required) + :type region: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1879,14 +2029,20 @@ def list_provider_options_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_provider_options_serialize( - _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index + region=region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { "200": "ProviderOptions", + "400": "object", + "401": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -1898,6 +2054,7 @@ def list_provider_options_with_http_info( @validate_call def list_provider_options_without_preload_content( self, + region: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1912,6 +2069,8 @@ def list_provider_options_without_preload_content( Returns a list of supported Kubernetes versions and a list of supported machine types for the cluster nodes. + :param region: (required) + :type region: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1932,20 +2091,27 @@ def list_provider_options_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_provider_options_serialize( - _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index + region=region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { "200": "ProviderOptions", + "400": "object", + "401": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response def _list_provider_options_serialize( self, + region, _request_auth, _content_type, _headers, @@ -1960,10 +2126,12 @@ def _list_provider_options_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters + if region is not None: + _path_params["region"] = region # process the query parameters # process the header parameters # process the form parameters @@ -1978,7 +2146,7 @@ def _list_provider_options_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1/provider-options", + resource_path="/v2/regions/{region}/provider-options", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1995,6 +2163,7 @@ def _list_provider_options_serialize( def start_credentials_rotation( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -2012,6 +2181,8 @@ def start_credentials_rotation( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -2034,10 +2205,11 @@ def start_credentials_rotation( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._start_credentials_rotation_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -2049,6 +2221,7 @@ def start_credentials_rotation( "200": "object", "202": "object", "400": "object", + "401": "object", "404": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2062,6 +2235,7 @@ def start_credentials_rotation( def start_credentials_rotation_with_http_info( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -2079,6 +2253,8 @@ def start_credentials_rotation_with_http_info( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -2101,10 +2277,11 @@ def start_credentials_rotation_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._start_credentials_rotation_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -2116,6 +2293,7 @@ def start_credentials_rotation_with_http_info( "200": "object", "202": "object", "400": "object", + "401": "object", "404": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2129,6 +2307,7 @@ def start_credentials_rotation_with_http_info( def start_credentials_rotation_without_preload_content( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -2146,6 +2325,8 @@ def start_credentials_rotation_without_preload_content( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -2168,10 +2349,11 @@ def start_credentials_rotation_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._start_credentials_rotation_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -2183,6 +2365,7 @@ def start_credentials_rotation_without_preload_content( "200": "object", "202": "object", "400": "object", + "401": "object", "404": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2191,6 +2374,7 @@ def start_credentials_rotation_without_preload_content( def _start_credentials_rotation_serialize( self, project_id, + region, cluster_name, _request_auth, _content_type, @@ -2206,12 +2390,14 @@ def _start_credentials_rotation_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters if project_id is not None: _path_params["projectId"] = project_id + if region is not None: + _path_params["region"] = region if cluster_name is not None: _path_params["clusterName"] = cluster_name # process the query parameters @@ -2228,7 +2414,7 @@ def _start_credentials_rotation_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v1/projects/{projectId}/clusters/{clusterName}/start-credentials-rotation", + resource_path="/v2/projects/{projectId}/regions/{region}/clusters/{clusterName}/start-credentials-rotation", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2245,6 +2431,7 @@ def _start_credentials_rotation_serialize( def trigger_hibernate( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -2262,6 +2449,8 @@ def trigger_hibernate( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -2284,10 +2473,11 @@ def trigger_hibernate( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_hibernate_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -2298,6 +2488,8 @@ def trigger_hibernate( _response_types_map: Dict[str, Optional[str]] = { "200": "object", "202": "object", + "400": "object", + "401": "object", "404": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2311,6 +2503,7 @@ def trigger_hibernate( def trigger_hibernate_with_http_info( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -2328,6 +2521,8 @@ def trigger_hibernate_with_http_info( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -2350,10 +2545,11 @@ def trigger_hibernate_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_hibernate_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -2364,6 +2560,8 @@ def trigger_hibernate_with_http_info( _response_types_map: Dict[str, Optional[str]] = { "200": "object", "202": "object", + "400": "object", + "401": "object", "404": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2377,6 +2575,7 @@ def trigger_hibernate_with_http_info( def trigger_hibernate_without_preload_content( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -2394,6 +2593,8 @@ def trigger_hibernate_without_preload_content( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -2416,10 +2617,11 @@ def trigger_hibernate_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_hibernate_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -2430,6 +2632,8 @@ def trigger_hibernate_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { "200": "object", "202": "object", + "400": "object", + "401": "object", "404": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2438,6 +2642,7 @@ def trigger_hibernate_without_preload_content( def _trigger_hibernate_serialize( self, project_id, + region, cluster_name, _request_auth, _content_type, @@ -2453,12 +2658,14 @@ def _trigger_hibernate_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters if project_id is not None: _path_params["projectId"] = project_id + if region is not None: + _path_params["region"] = region if cluster_name is not None: _path_params["clusterName"] = cluster_name # process the query parameters @@ -2475,7 +2682,7 @@ def _trigger_hibernate_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v1/projects/{projectId}/clusters/{clusterName}/hibernate", + resource_path="/v2/projects/{projectId}/regions/{region}/clusters/{clusterName}/hibernate", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2492,6 +2699,7 @@ def _trigger_hibernate_serialize( def trigger_maintenance( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -2509,6 +2717,8 @@ def trigger_maintenance( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -2531,10 +2741,11 @@ def trigger_maintenance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_maintenance_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -2545,6 +2756,8 @@ def trigger_maintenance( _response_types_map: Dict[str, Optional[str]] = { "200": "object", "202": "object", + "400": "object", + "401": "object", "404": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2558,6 +2771,7 @@ def trigger_maintenance( def trigger_maintenance_with_http_info( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -2575,6 +2789,8 @@ def trigger_maintenance_with_http_info( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -2597,10 +2813,11 @@ def trigger_maintenance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_maintenance_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -2611,6 +2828,8 @@ def trigger_maintenance_with_http_info( _response_types_map: Dict[str, Optional[str]] = { "200": "object", "202": "object", + "400": "object", + "401": "object", "404": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2624,6 +2843,7 @@ def trigger_maintenance_with_http_info( def trigger_maintenance_without_preload_content( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -2641,6 +2861,8 @@ def trigger_maintenance_without_preload_content( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -2663,10 +2885,11 @@ def trigger_maintenance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_maintenance_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -2677,6 +2900,8 @@ def trigger_maintenance_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { "200": "object", "202": "object", + "400": "object", + "401": "object", "404": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2685,6 +2910,7 @@ def trigger_maintenance_without_preload_content( def _trigger_maintenance_serialize( self, project_id, + region, cluster_name, _request_auth, _content_type, @@ -2700,12 +2926,14 @@ def _trigger_maintenance_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters if project_id is not None: _path_params["projectId"] = project_id + if region is not None: + _path_params["region"] = region if cluster_name is not None: _path_params["clusterName"] = cluster_name # process the query parameters @@ -2722,7 +2950,7 @@ def _trigger_maintenance_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v1/projects/{projectId}/clusters/{clusterName}/maintenance", + resource_path="/v2/projects/{projectId}/regions/{region}/clusters/{clusterName}/maintenance", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2739,6 +2967,7 @@ def _trigger_maintenance_serialize( def trigger_reconcile( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -2756,6 +2985,8 @@ def trigger_reconcile( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -2778,10 +3009,11 @@ def trigger_reconcile( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_reconcile_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -2792,6 +3024,8 @@ def trigger_reconcile( _response_types_map: Dict[str, Optional[str]] = { "200": "object", "202": "object", + "400": "object", + "401": "object", "404": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2805,6 +3039,7 @@ def trigger_reconcile( def trigger_reconcile_with_http_info( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -2822,6 +3057,8 @@ def trigger_reconcile_with_http_info( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -2844,10 +3081,11 @@ def trigger_reconcile_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_reconcile_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -2858,6 +3096,8 @@ def trigger_reconcile_with_http_info( _response_types_map: Dict[str, Optional[str]] = { "200": "object", "202": "object", + "400": "object", + "401": "object", "404": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2871,6 +3111,7 @@ def trigger_reconcile_with_http_info( def trigger_reconcile_without_preload_content( self, project_id: StrictStr, + region: StrictStr, cluster_name: StrictStr, _request_timeout: Union[ None, @@ -2888,6 +3129,8 @@ def trigger_reconcile_without_preload_content( :param project_id: (required) :type project_id: str + :param region: (required) + :type region: str :param cluster_name: (required) :type cluster_name: str :param _request_timeout: timeout setting for this request. If one @@ -2910,10 +3153,11 @@ def trigger_reconcile_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_reconcile_serialize( project_id=project_id, + region=region, cluster_name=cluster_name, _request_auth=_request_auth, _content_type=_content_type, @@ -2924,6 +3168,8 @@ def trigger_reconcile_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { "200": "object", "202": "object", + "400": "object", + "401": "object", "404": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2932,6 +3178,7 @@ def trigger_reconcile_without_preload_content( def _trigger_reconcile_serialize( self, project_id, + region, cluster_name, _request_auth, _content_type, @@ -2947,12 +3194,14 @@ def _trigger_reconcile_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters if project_id is not None: _path_params["projectId"] = project_id + if region is not None: + _path_params["region"] = region if cluster_name is not None: _path_params["clusterName"] = cluster_name # process the query parameters @@ -2969,7 +3218,7 @@ def _trigger_reconcile_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v1/projects/{projectId}/clusters/{clusterName}/reconcile", + resource_path="/v2/projects/{projectId}/regions/{region}/clusters/{clusterName}/reconcile", path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/services/ske/src/stackit/ske/api_client.py b/services/ske/src/stackit/ske/api_client.py index eb3998b1..26158744 100644 --- a/services/ske/src/stackit/ske/api_client.py +++ b/services/ske/src/stackit/ske/api_client.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import datetime import json @@ -331,6 +331,10 @@ def sanitize_for_serialization(self, obj): else: obj_dict = obj.__dict__ + if isinstance(obj_dict, list): + # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() + return self.sanitize_for_serialization(obj_dict) + return {key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()} def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): @@ -350,12 +354,12 @@ def deserialize(self, response_text: str, response_type: str, content_type: Opti data = json.loads(response_text) except ValueError: data = response_text - elif content_type.startswith("application/json"): + elif re.match(r"^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)", content_type, re.IGNORECASE): if response_text == "": data = "" else: data = json.loads(response_text) - elif content_type.startswith("text/plain"): + elif re.match(r"^text\/[a-z.+-]+\s*(;|$)", content_type, re.IGNORECASE): data = response_text else: raise ApiException(status=0, reason="Unsupported content type: {0}".format(content_type)) @@ -457,7 +461,7 @@ def parameters_to_url_query(self, params, collection_formats): if k in collection_formats: collection_format = collection_formats[k] if collection_format == "multi": - new_params.extend((k, str(value)) for value in v) + new_params.extend((k, quote(str(value))) for value in v) else: if collection_format == "ssv": delimiter = " " @@ -473,7 +477,10 @@ def parameters_to_url_query(self, params, collection_formats): return "&".join(["=".join(map(str, item)) for item in new_params]) - def files_parameters(self, files: Dict[str, Union[str, bytes]]): + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): """Builds form parameters. :param files: File parameters. @@ -488,6 +495,12 @@ def files_parameters(self, files: Dict[str, Union[str, bytes]]): elif isinstance(v, bytes): filename = k filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue else: raise ValueError("Unsupported file value") mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" diff --git a/services/ske/src/stackit/ske/configuration.py b/services/ske/src/stackit/ske/configuration.py index 18f50ee3..7af39b87 100644 --- a/services/ske/src/stackit/ske/configuration.py +++ b/services/ske/src/stackit/ske/configuration.py @@ -1,20 +1,37 @@ # coding: utf-8 -import sys - -import os - - """ SKE-API The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 + +import sys +from typing import Dict, List, Optional, TypedDict + +from typing_extensions import NotRequired + +import os + + +ServerVariablesT = Dict[str, str] + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] class HostConfiguration: @@ -36,7 +53,7 @@ def __init__( ) """Constructor """ - self._base_path = "https://ske.api.eu01.stackit.cloud" + self._base_path = "https://ske.api.stackit.cloud" """Default Base url """ self.server_index = 0 if server_index is None else server_index @@ -53,26 +70,30 @@ def __init__( """Ignore operation servers """ - def get_host_settings(self): + def get_host_settings(self) -> List[HostSetting]: """Gets an array of host settings :return: An array of host settings """ return [ { - "url": "https://ske.api.{region}stackit.cloud", + "url": "https://ske.api.stackit.cloud", "description": "No description provided", "variables": { "region": { "description": "No description provided", - "default_value": "eu01.", - "enum_values": ["eu01."], + "default_value": "global", } }, } ] - def get_host_from_settings(self, index, variables=None, servers=None): + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT] = None, + servers: Optional[List[HostSetting]] = None, + ) -> str: """Gets host URL based on the index and variables :param index: array index of the host settings :param variables: hash of variable and the corresponding value @@ -112,7 +133,7 @@ def get_host_from_settings(self, index, variables=None, servers=None): and variables.get(variable_name) is not None ): raise ValueError( - "this API does not support setting a region in the the client configuration, " + "this API does not support setting a region in the client configuration, " "please check if the region can be specified as a function parameter" ) used_value = variables.get(variable_name, variable["default_value"]) @@ -131,12 +152,12 @@ def get_host_from_settings(self, index, variables=None, servers=None): return url @property - def host(self): + def host(self) -> str: """Return generated host.""" return self.get_host_from_settings(self.server_index, variables=self.server_variables) @host.setter - def host(self, value): + def host(self, value: str) -> None: """Fix base path.""" self._base_path = value self.server_index = None diff --git a/services/ske/src/stackit/ske/exceptions.py b/services/ske/src/stackit/ske/exceptions.py index e302d148..b5261e0c 100644 --- a/services/ske/src/stackit/ske/exceptions.py +++ b/services/ske/src/stackit/ske/exceptions.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Optional @@ -127,7 +127,7 @@ def __init__( if self.body is None: try: self.body = http_resp.data.decode("utf-8") - except Exception: # noqa: S110 + except Exception: pass self.headers = http_resp.getheaders() @@ -151,6 +151,13 @@ def from_response( if http_resp.status == 404: raise NotFoundException(http_resp=http_resp, body=body, data=data) + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + if 500 <= http_resp.status <= 599: raise ServiceException(http_resp=http_resp, body=body, data=data) raise ApiException(http_resp=http_resp, body=body, data=data) @@ -187,6 +194,18 @@ class ServiceException(ApiException): pass +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + + pass + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + + pass + + def render_path(path_to_item): """Returns a string representation of a path""" result = "" diff --git a/services/ske/src/stackit/ske/models/__init__.py b/services/ske/src/stackit/ske/models/__init__.py index f4fa80bd..e27a6df8 100644 --- a/services/ske/src/stackit/ske/models/__init__.py +++ b/services/ske/src/stackit/ske/models/__init__.py @@ -6,16 +6,15 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 # import models into model package from stackit.ske.models.acl import ACL -from stackit.ske.models.argus import Argus from stackit.ske.models.availability_zone import AvailabilityZone from stackit.ske.models.cluster import Cluster from stackit.ske.models.cluster_error import ClusterError @@ -45,6 +44,7 @@ from stackit.ske.models.maintenance_auto_update import MaintenanceAutoUpdate from stackit.ske.models.network import Network from stackit.ske.models.nodepool import Nodepool +from stackit.ske.models.observability import Observability from stackit.ske.models.provider_options import ProviderOptions from stackit.ske.models.runtime_error import RuntimeError from stackit.ske.models.taint import Taint diff --git a/services/ske/src/stackit/ske/models/acl.py b/services/ske/src/stackit/ske/models/acl.py index d9485a1f..8d133134 100644 --- a/services/ske/src/stackit/ske/models/acl.py +++ b/services/ske/src/stackit/ske/models/acl.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -18,15 +18,15 @@ from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing_extensions import Self +from typing_extensions import Annotated, Self class ACL(BaseModel): """ ACL - """ + """ # noqa: E501 - allowed_cidrs: List[StrictStr] = Field( + allowed_cidrs: Annotated[List[StrictStr], Field(max_length=10)] = Field( description="Array of CIDRs to allow access to the kubernetes API.", alias="allowedCidrs" ) enabled: StrictBool = Field(description="Enables the acl extension.") diff --git a/services/ske/src/stackit/ske/models/availability_zone.py b/services/ske/src/stackit/ske/models/availability_zone.py index 707a09f7..bc3015e9 100644 --- a/services/ske/src/stackit/ske/models/availability_zone.py +++ b/services/ske/src/stackit/ske/models/availability_zone.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class AvailabilityZone(BaseModel): """ AvailabilityZone - """ + """ # noqa: E501 name: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["name"] diff --git a/services/ske/src/stackit/ske/models/cluster.py b/services/ske/src/stackit/ske/models/cluster.py index 574dc127..2168bdc7 100644 --- a/services/ske/src/stackit/ske/models/cluster.py +++ b/services/ske/src/stackit/ske/models/cluster.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -32,7 +32,7 @@ class Cluster(BaseModel): """ Cluster - """ + """ # noqa: E501 extensions: Optional[Extension] = None hibernation: Optional[Hibernation] = None diff --git a/services/ske/src/stackit/ske/models/cluster_error.py b/services/ske/src/stackit/ske/models/cluster_error.py index 9a1c2da8..ff0b3820 100644 --- a/services/ske/src/stackit/ske/models/cluster_error.py +++ b/services/ske/src/stackit/ske/models/cluster_error.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class ClusterError(BaseModel): """ ClusterError - """ + """ # noqa: E501 code: Optional[StrictStr] = None message: Optional[StrictStr] = None diff --git a/services/ske/src/stackit/ske/models/cluster_status.py b/services/ske/src/stackit/ske/models/cluster_status.py index 93b7aca6..4c2a9b37 100644 --- a/services/ske/src/stackit/ske/models/cluster_status.py +++ b/services/ske/src/stackit/ske/models/cluster_status.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -30,7 +30,7 @@ class ClusterStatus(BaseModel): """ ClusterStatus - """ + """ # noqa: E501 aggregated: Optional[ClusterStatusState] = ClusterStatusState.STATE_UNSPECIFIED creation_time: Optional[datetime] = Field( diff --git a/services/ske/src/stackit/ske/models/cluster_status_state.py b/services/ske/src/stackit/ske/models/cluster_status_state.py index d7a54bf0..feeaf8e9 100644 --- a/services/ske/src/stackit/ske/models/cluster_status_state.py +++ b/services/ske/src/stackit/ske/models/cluster_status_state.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations diff --git a/services/ske/src/stackit/ske/models/create_kubeconfig_payload.py b/services/ske/src/stackit/ske/models/create_kubeconfig_payload.py index 6497e49f..0d1609c3 100644 --- a/services/ske/src/stackit/ske/models/create_kubeconfig_payload.py +++ b/services/ske/src/stackit/ske/models/create_kubeconfig_payload.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class CreateKubeconfigPayload(BaseModel): """ CreateKubeconfigPayload - """ + """ # noqa: E501 expiration_seconds: Optional[StrictStr] = Field(default=None, alias="expirationSeconds") __properties: ClassVar[List[str]] = ["expirationSeconds"] diff --git a/services/ske/src/stackit/ske/models/create_or_update_cluster_payload.py b/services/ske/src/stackit/ske/models/create_or_update_cluster_payload.py index bbcd4222..d411fccd 100644 --- a/services/ske/src/stackit/ske/models/create_or_update_cluster_payload.py +++ b/services/ske/src/stackit/ske/models/create_or_update_cluster_payload.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -32,7 +32,7 @@ class CreateOrUpdateClusterPayload(BaseModel): """ CreateOrUpdateClusterPayload - """ + """ # noqa: E501 extensions: Optional[Extension] = None hibernation: Optional[Hibernation] = None diff --git a/services/ske/src/stackit/ske/models/credentials_rotation_state.py b/services/ske/src/stackit/ske/models/credentials_rotation_state.py index 31369153..adda37e8 100644 --- a/services/ske/src/stackit/ske/models/credentials_rotation_state.py +++ b/services/ske/src/stackit/ske/models/credentials_rotation_state.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class CredentialsRotationState(BaseModel): """ CredentialsRotationState - """ + """ # noqa: E501 last_completion_time: Optional[datetime] = Field( default=None, description="Format: `2024-02-15T11:06:29Z`", alias="lastCompletionTime" @@ -35,7 +35,7 @@ class CredentialsRotationState(BaseModel): ) phase: Optional[StrictStr] = Field( default=None, - description="Phase of the credentials rotation. `NEVER` indicates that no credentials rotation has been performed using the new credentials rotation endpoints yet.", + description="Phase of the credentials rotation. `NEVER` indicates that no credentials rotation has been performed using the new credentials rotation endpoints yet. Using the deprecated [rotate-credentials](#tag/Credentials/operation/SkeService_GetClusterCredentials) endpoint will not update this status field.", ) __properties: ClassVar[List[str]] = ["lastCompletionTime", "lastInitiationTime", "phase"] diff --git a/services/ske/src/stackit/ske/models/cri.py b/services/ske/src/stackit/ske/models/cri.py index cb38abdc..174e71b3 100644 --- a/services/ske/src/stackit/ske/models/cri.py +++ b/services/ske/src/stackit/ske/models/cri.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class CRI(BaseModel): """ CRI - """ + """ # noqa: E501 name: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["name"] diff --git a/services/ske/src/stackit/ske/models/dns.py b/services/ske/src/stackit/ske/models/dns.py index d069540a..3902f6d2 100644 --- a/services/ske/src/stackit/ske/models/dns.py +++ b/services/ske/src/stackit/ske/models/dns.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class DNS(BaseModel): """ DNS - """ + """ # noqa: E501 enabled: StrictBool = Field(description="Enables the dns extension.") zones: Optional[Annotated[List[Annotated[str, Field(strict=True)]], Field(max_length=20)]] = Field( diff --git a/services/ske/src/stackit/ske/models/extension.py b/services/ske/src/stackit/ske/models/extension.py index f7bed02b..c8c55afb 100644 --- a/services/ske/src/stackit/ske/models/extension.py +++ b/services/ske/src/stackit/ske/models/extension.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -21,19 +21,19 @@ from typing_extensions import Self from stackit.ske.models.acl import ACL -from stackit.ske.models.argus import Argus from stackit.ske.models.dns import DNS +from stackit.ske.models.observability import Observability class Extension(BaseModel): """ Extension - """ + """ # noqa: E501 acl: Optional[ACL] = None - argus: Optional[Argus] = None dns: Optional[DNS] = None - __properties: ClassVar[List[str]] = ["acl", "argus", "dns"] + observability: Optional[Observability] = None + __properties: ClassVar[List[str]] = ["acl", "dns", "observability"] model_config = ConfigDict( populate_by_name=True, @@ -75,12 +75,12 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of acl if self.acl: _dict["acl"] = self.acl.to_dict() - # override the default output from pydantic by calling `to_dict()` of argus - if self.argus: - _dict["argus"] = self.argus.to_dict() # override the default output from pydantic by calling `to_dict()` of dns if self.dns: _dict["dns"] = self.dns.to_dict() + # override the default output from pydantic by calling `to_dict()` of observability + if self.observability: + _dict["observability"] = self.observability.to_dict() return _dict @classmethod @@ -95,8 +95,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { "acl": ACL.from_dict(obj["acl"]) if obj.get("acl") is not None else None, - "argus": Argus.from_dict(obj["argus"]) if obj.get("argus") is not None else None, "dns": DNS.from_dict(obj["dns"]) if obj.get("dns") is not None else None, + "observability": ( + Observability.from_dict(obj["observability"]) if obj.get("observability") is not None else None + ), } ) return _obj diff --git a/services/ske/src/stackit/ske/models/hibernation.py b/services/ske/src/stackit/ske/models/hibernation.py index 58078c70..79b03f4a 100644 --- a/services/ske/src/stackit/ske/models/hibernation.py +++ b/services/ske/src/stackit/ske/models/hibernation.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class Hibernation(BaseModel): """ Hibernation - """ + """ # noqa: E501 schedules: List[HibernationSchedule] __properties: ClassVar[List[str]] = ["schedules"] diff --git a/services/ske/src/stackit/ske/models/hibernation_schedule.py b/services/ske/src/stackit/ske/models/hibernation_schedule.py index 61634af8..b0ac8a54 100644 --- a/services/ske/src/stackit/ske/models/hibernation_schedule.py +++ b/services/ske/src/stackit/ske/models/hibernation_schedule.py @@ -5,17 +5,17 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator @@ -25,7 +25,7 @@ class HibernationSchedule(BaseModel): """ HibernationSchedule - """ + """ # noqa: E501 end: Annotated[str, Field(strict=True)] start: Annotated[str, Field(strict=True)] diff --git a/services/ske/src/stackit/ske/models/image.py b/services/ske/src/stackit/ske/models/image.py index 9483ff85..900f297a 100644 --- a/services/ske/src/stackit/ske/models/image.py +++ b/services/ske/src/stackit/ske/models/image.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Image(BaseModel): """ For valid names and versions please take a look at [provider-options](#tag/ProviderOptions/operation/SkeService_GetProviderOptions) `machineImages`. - """ + """ # noqa: E501 name: StrictStr version: StrictStr diff --git a/services/ske/src/stackit/ske/models/kubeconfig.py b/services/ske/src/stackit/ske/models/kubeconfig.py index e4595746..e1bcc901 100644 --- a/services/ske/src/stackit/ske/models/kubeconfig.py +++ b/services/ske/src/stackit/ske/models/kubeconfig.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class Kubeconfig(BaseModel): """ Kubeconfig - """ + """ # noqa: E501 expiration_timestamp: Optional[datetime] = Field(default=None, alias="expirationTimestamp") kubeconfig: Optional[StrictStr] = None diff --git a/services/ske/src/stackit/ske/models/kubernetes.py b/services/ske/src/stackit/ske/models/kubernetes.py index 0f6ff58e..b905000c 100644 --- a/services/ske/src/stackit/ske/models/kubernetes.py +++ b/services/ske/src/stackit/ske/models/kubernetes.py @@ -5,35 +5,30 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, Field, StrictBool, field_validator +from pydantic import BaseModel, ConfigDict, Field, field_validator from typing_extensions import Annotated, Self class Kubernetes(BaseModel): """ For valid versions please take a look at [provider-options](#tag/ProviderOptions/operation/SkeService_GetProviderOptions) `kubernetesVersions`. - """ + """ # noqa: E501 - allow_privileged_containers: Optional[StrictBool] = Field( - default=None, - description="DEPRECATED as of Kubernetes 1.25+ Flag to specify if privileged mode for containers is enabled or not. This should be used with care since it also disables a couple of other features like the use of some volume type (e.g. PVCs). By default this is set to true.", - alias="allowPrivilegedContainers", - ) version: Annotated[str, Field(strict=True)] - __properties: ClassVar[List[str]] = ["allowPrivilegedContainers", "version"] + __properties: ClassVar[List[str]] = ["version"] @field_validator("version") def version_validate_regular_expression(cls, value): @@ -90,7 +85,5 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate( - {"allowPrivilegedContainers": obj.get("allowPrivilegedContainers"), "version": obj.get("version")} - ) + _obj = cls.model_validate({"version": obj.get("version")}) return _obj diff --git a/services/ske/src/stackit/ske/models/kubernetes_version.py b/services/ske/src/stackit/ske/models/kubernetes_version.py index 516fdfe0..b5d506e7 100644 --- a/services/ske/src/stackit/ske/models/kubernetes_version.py +++ b/services/ske/src/stackit/ske/models/kubernetes_version.py @@ -5,17 +5,17 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from datetime import datetime from typing import Any, ClassVar, Dict, List, Optional, Set @@ -26,7 +26,7 @@ class KubernetesVersion(BaseModel): """ KubernetesVersion - """ + """ # noqa: E501 expiration_date: Optional[datetime] = Field(default=None, alias="expirationDate") feature_gates: Optional[Dict[str, StrictStr]] = Field(default=None, alias="featureGates") diff --git a/services/ske/src/stackit/ske/models/list_clusters_response.py b/services/ske/src/stackit/ske/models/list_clusters_response.py index 4061fa55..4e222e8a 100644 --- a/services/ske/src/stackit/ske/models/list_clusters_response.py +++ b/services/ske/src/stackit/ske/models/list_clusters_response.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListClustersResponse(BaseModel): """ ListClustersResponse - """ + """ # noqa: E501 items: Optional[List[Cluster]] = None __properties: ClassVar[List[str]] = ["items"] diff --git a/services/ske/src/stackit/ske/models/login_kubeconfig.py b/services/ske/src/stackit/ske/models/login_kubeconfig.py index 7573b413..1f69552e 100644 --- a/services/ske/src/stackit/ske/models/login_kubeconfig.py +++ b/services/ske/src/stackit/ske/models/login_kubeconfig.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class LoginKubeconfig(BaseModel): """ LoginKubeconfig - """ + """ # noqa: E501 kubeconfig: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["kubeconfig"] diff --git a/services/ske/src/stackit/ske/models/machine.py b/services/ske/src/stackit/ske/models/machine.py index 1dafce96..946bab74 100644 --- a/services/ske/src/stackit/ske/models/machine.py +++ b/services/ske/src/stackit/ske/models/machine.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class Machine(BaseModel): """ Machine - """ + """ # noqa: E501 image: Image type: StrictStr = Field( diff --git a/services/ske/src/stackit/ske/models/machine_image.py b/services/ske/src/stackit/ske/models/machine_image.py index c482241f..2793dddf 100644 --- a/services/ske/src/stackit/ske/models/machine_image.py +++ b/services/ske/src/stackit/ske/models/machine_image.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class MachineImage(BaseModel): """ MachineImage - """ + """ # noqa: E501 name: Optional[StrictStr] = None versions: Optional[List[MachineImageVersion]] = None diff --git a/services/ske/src/stackit/ske/models/machine_image_version.py b/services/ske/src/stackit/ske/models/machine_image_version.py index 641e8404..22939cbc 100644 --- a/services/ske/src/stackit/ske/models/machine_image_version.py +++ b/services/ske/src/stackit/ske/models/machine_image_version.py @@ -5,17 +5,17 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from datetime import datetime from typing import Any, ClassVar, Dict, List, Optional, Set @@ -28,7 +28,7 @@ class MachineImageVersion(BaseModel): """ MachineImageVersion - """ + """ # noqa: E501 cri: Optional[List[CRI]] = None expiration_date: Optional[datetime] = Field(default=None, alias="expirationDate") diff --git a/services/ske/src/stackit/ske/models/machine_type.py b/services/ske/src/stackit/ske/models/machine_type.py index ff2cc013..8e82508a 100644 --- a/services/ske/src/stackit/ske/models/machine_type.py +++ b/services/ske/src/stackit/ske/models/machine_type.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class MachineType(BaseModel): """ MachineType - """ + """ # noqa: E501 architecture: Optional[StrictStr] = None cpu: Optional[StrictInt] = None diff --git a/services/ske/src/stackit/ske/models/maintenance.py b/services/ske/src/stackit/ske/models/maintenance.py index b2bee629..2a3f5f61 100644 --- a/services/ske/src/stackit/ske/models/maintenance.py +++ b/services/ske/src/stackit/ske/models/maintenance.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class Maintenance(BaseModel): """ Maintenance - """ + """ # noqa: E501 auto_update: MaintenanceAutoUpdate = Field(alias="autoUpdate") time_window: TimeWindow = Field(alias="timeWindow") diff --git a/services/ske/src/stackit/ske/models/maintenance_auto_update.py b/services/ske/src/stackit/ske/models/maintenance_auto_update.py index bf3f9288..ffa803bf 100644 --- a/services/ske/src/stackit/ske/models/maintenance_auto_update.py +++ b/services/ske/src/stackit/ske/models/maintenance_auto_update.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class MaintenanceAutoUpdate(BaseModel): """ MaintenanceAutoUpdate - """ + """ # noqa: E501 kubernetes_version: Optional[StrictBool] = Field(default=None, alias="kubernetesVersion") machine_image_version: Optional[StrictBool] = Field(default=None, alias="machineImageVersion") diff --git a/services/ske/src/stackit/ske/models/network.py b/services/ske/src/stackit/ske/models/network.py index d3282c1a..4737457d 100644 --- a/services/ske/src/stackit/ske/models/network.py +++ b/services/ske/src/stackit/ske/models/network.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Network(BaseModel): """ Network - """ + """ # noqa: E501 id: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["id"] diff --git a/services/ske/src/stackit/ske/models/nodepool.py b/services/ske/src/stackit/ske/models/nodepool.py index 0bf62610..df8d62d3 100644 --- a/services/ske/src/stackit/ske/models/nodepool.py +++ b/services/ske/src/stackit/ske/models/nodepool.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -29,7 +29,7 @@ class Nodepool(BaseModel): """ Nodepool - """ + """ # noqa: E501 allow_system_components: Optional[StrictBool] = Field( default=None, description="This needs to be true for at least one node pool.", alias="allowSystemComponents" diff --git a/services/ske/src/stackit/ske/models/argus.py b/services/ske/src/stackit/ske/models/observability.py similarity index 75% rename from services/ske/src/stackit/ske/models/argus.py rename to services/ske/src/stackit/ske/models/observability.py index ed7cbb35..9c28159d 100644 --- a/services/ske/src/stackit/ske/models/argus.py +++ b/services/ske/src/stackit/ske/models/observability.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -21,16 +21,16 @@ from typing_extensions import Self -class Argus(BaseModel): - """ - Argus +class Observability(BaseModel): """ + Observability + """ # noqa: E501 - argus_instance_id: StrictStr = Field( - description="Argus instance ID to choose which Argus instance is used.", alias="argusInstanceId" + enabled: StrictBool = Field(description="Enables the Observability extension.") + instance_id: StrictStr = Field( + description="Instance ID to choose which Observability instance is used.", alias="instanceId" ) - enabled: StrictBool = Field(description="Enables the argus extension.") - __properties: ClassVar[List[str]] = ["argusInstanceId", "enabled"] + __properties: ClassVar[List[str]] = ["enabled", "instanceId"] model_config = ConfigDict( populate_by_name=True, @@ -49,7 +49,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of Argus from a JSON string""" + """Create an instance of Observability from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -73,12 +73,12 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Argus from a dict""" + """Create an instance of Observability from a dict""" if obj is None: return None if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"argusInstanceId": obj.get("argusInstanceId"), "enabled": obj.get("enabled")}) + _obj = cls.model_validate({"enabled": obj.get("enabled"), "instanceId": obj.get("instanceId")}) return _obj diff --git a/services/ske/src/stackit/ske/models/provider_options.py b/services/ske/src/stackit/ske/models/provider_options.py index 3a6699d3..bf59ed95 100644 --- a/services/ske/src/stackit/ske/models/provider_options.py +++ b/services/ske/src/stackit/ske/models/provider_options.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -30,7 +30,7 @@ class ProviderOptions(BaseModel): """ ProviderOptions - """ + """ # noqa: E501 availability_zones: Optional[List[AvailabilityZone]] = Field(default=None, alias="availabilityZones") kubernetes_versions: Optional[List[KubernetesVersion]] = Field(default=None, alias="kubernetesVersions") diff --git a/services/ske/src/stackit/ske/models/runtime_error.py b/services/ske/src/stackit/ske/models/runtime_error.py index d05a6f96..b4fa5006 100644 --- a/services/ske/src/stackit/ske/models/runtime_error.py +++ b/services/ske/src/stackit/ske/models/runtime_error.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,11 +24,11 @@ class RuntimeError(BaseModel): """ RuntimeError - """ + """ # noqa: E501 code: Optional[StrictStr] = Field( default=None, - description='- Code: `SKE_UNSPECIFIED` Message: "An error occurred. Please open a support ticket if this error persists." - Code: `SKE_TMP_AUTH_ERROR` Message: "Authentication failed. This is a temporary error. Please wait while the system recovers." - Code: `SKE_QUOTA_EXCEEDED` Message: "Your project\'s resource quotas are exhausted. Please make sure your quota is sufficient for the ordered cluster." - Code: `SKE_ARGUS_INSTANCE_NOT_FOUND` Message: "The provided Argus instance could not be found." - Code: `SKE_RATE_LIMITS` Message: "While provisioning your cluster, request rate limits where incurred. Please wait while the system recovers." - Code: `SKE_INFRA_ERROR` Message: "An error occurred with the underlying infrastructure. Please open a support ticket if this error persists." - Code: `SKE_REMAINING_RESOURCES` Message: "There are remaining Kubernetes resources in your cluster that prevent deletion. Please make sure to remove them." - Code: `SKE_CONFIGURATION_PROBLEM` Message: "A configuration error occurred. Please open a support ticket if this error persists." - Code: `SKE_UNREADY_NODES` Message: "Not all worker nodes are ready. Please open a support ticket if this error persists." - Code: `SKE_API_SERVER_ERROR` Message: "The Kubernetes API server is not reporting readiness. Please open a support ticket if this error persists." - Code: `SKE_DNS_ZONE_NOT_FOUND` Message: "The provided DNS zone for the STACKIT DNS extension could not be found. Please ensure you defined a valid domain that belongs to a STACKIT DNS zone." ', + description='- Code: `SKE_UNSPECIFIED` Message: "An error occurred. Please open a support ticket if this error persists." - Code: `SKE_TMP_AUTH_ERROR` Message: "Authentication failed. This is a temporary error. Please wait while the system recovers." - Code: `SKE_QUOTA_EXCEEDED` Message: "Your project\'s resource quotas are exhausted. Please make sure your quota is sufficient for the ordered cluster." - Code: `SKE_OBSERVABILITY_INSTANCE_NOT_FOUND` Message: "The provided Observability instance could not be found." - Code: `SKE_RATE_LIMITS` Message: "While provisioning your cluster, request rate limits where incurred. Please wait while the system recovers." - Code: `SKE_INFRA_ERROR` Message: "An error occurred with the underlying infrastructure. Please open a support ticket if this error persists." - Code: `SKE_REMAINING_RESOURCES` Message: "There are remaining Kubernetes resources in your cluster that prevent deletion. Please make sure to remove them." - Code: `SKE_CONFIGURATION_PROBLEM` Message: "A configuration error occurred. Please open a support ticket if this error persists." - Code: `SKE_UNREADY_NODES` Message: "Not all worker nodes are ready. Please open a support ticket if this error persists." - Code: `SKE_API_SERVER_ERROR` Message: "The Kubernetes API server is not reporting readiness. Please open a support ticket if this error persists." - Code: `SKE_DNS_ZONE_NOT_FOUND` Message: "The provided DNS zone for the STACKIT DNS extension could not be found. Please ensure you defined a valid domain that belongs to a STACKIT DNS zone." ', ) details: Optional[StrictStr] = None message: Optional[StrictStr] = None @@ -45,7 +45,7 @@ def code_validate_enum(cls, value): "SKE_UNSPECIFIED", "SKE_TMP_AUTH_ERROR", "SKE_QUOTA_EXCEEDED", - "SKE_ARGUS_INSTANCE_NOT_FOUND", + "SKE_OBSERVABILITY_INSTANCE_NOT_FOUND", "SKE_RATE_LIMITS", "SKE_INFRA_ERROR", "SKE_REMAINING_RESOURCES", @@ -56,7 +56,7 @@ def code_validate_enum(cls, value): ] ): raise ValueError( - "must be one of enum values ('SKE_UNSPECIFIED', 'SKE_TMP_AUTH_ERROR', 'SKE_QUOTA_EXCEEDED', 'SKE_ARGUS_INSTANCE_NOT_FOUND', 'SKE_RATE_LIMITS', 'SKE_INFRA_ERROR', 'SKE_REMAINING_RESOURCES', 'SKE_CONFIGURATION_PROBLEM', 'SKE_UNREADY_NODES', 'SKE_API_SERVER_ERROR', 'SKE_DNS_ZONE_NOT_FOUND')" + "must be one of enum values ('SKE_UNSPECIFIED', 'SKE_TMP_AUTH_ERROR', 'SKE_QUOTA_EXCEEDED', 'SKE_OBSERVABILITY_INSTANCE_NOT_FOUND', 'SKE_RATE_LIMITS', 'SKE_INFRA_ERROR', 'SKE_REMAINING_RESOURCES', 'SKE_CONFIGURATION_PROBLEM', 'SKE_UNREADY_NODES', 'SKE_API_SERVER_ERROR', 'SKE_DNS_ZONE_NOT_FOUND')" ) return value diff --git a/services/ske/src/stackit/ske/models/taint.py b/services/ske/src/stackit/ske/models/taint.py index b4d7be73..d9e5852b 100644 --- a/services/ske/src/stackit/ske/models/taint.py +++ b/services/ske/src/stackit/ske/models/taint.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Taint(BaseModel): """ Taint - """ + """ # noqa: E501 effect: StrictStr key: StrictStr diff --git a/services/ske/src/stackit/ske/models/time_window.py b/services/ske/src/stackit/ske/models/time_window.py index 0bbdbe72..47e6964d 100644 --- a/services/ske/src/stackit/ske/models/time_window.py +++ b/services/ske/src/stackit/ske/models/time_window.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class TimeWindow(BaseModel): """ TimeWindow - """ + """ # noqa: E501 end: datetime start: datetime diff --git a/services/ske/src/stackit/ske/models/volume.py b/services/ske/src/stackit/ske/models/volume.py index e27c288e..55472491 100644 --- a/services/ske/src/stackit/ske/models/volume.py +++ b/services/ske/src/stackit/ske/models/volume.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Volume(BaseModel): """ Volume - """ + """ # noqa: E501 size: Annotated[int, Field(le=10240, strict=True, ge=20)] type: Optional[StrictStr] = Field( diff --git a/services/ske/src/stackit/ske/models/volume_type.py b/services/ske/src/stackit/ske/models/volume_type.py index 0d70b8dd..9e37df52 100644 --- a/services/ske/src/stackit/ske/models/volume_type.py +++ b/services/ske/src/stackit/ske/models/volume_type.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class VolumeType(BaseModel): """ VolumeType - """ + """ # noqa: E501 name: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["name"] diff --git a/services/ske/src/stackit/ske/rest.py b/services/ske/src/stackit/ske/rest.py index 1e2fe8e1..3f6e1fde 100644 --- a/services/ske/src/stackit/ske/rest.py +++ b/services/ske/src/stackit/ske/rest.py @@ -5,11 +5,11 @@ The SKE API provides endpoints to create, update, delete clusters within STACKIT portal projects and to trigger further cluster management tasks. - The version of the OpenAPI document: 1.1 + The version of the OpenAPI document: 2.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import io import json @@ -124,7 +124,7 @@ def request(self, method, url, headers=None, body=None, post_params=None, _reque data=body, headers=headers, ) - elif headers["Content-Type"] == "text/plain" and isinstance(body, bool): + elif headers["Content-Type"].startswith("text/") and isinstance(body, bool): request_body = "true" if body else "false" r = self.session.request(method, url, data=request_body, headers=headers) else: