From 4bdc6d27272a2cd56a1bf54cedc6e67ce1f3c830 Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Wed, 30 Apr 2025 13:44:19 +0000 Subject: [PATCH 1/2] Generate alb --- services/alb/src/stackit/alb/__init__.py | 10 +- .../alb/src/stackit/alb/api/default_api.py | 28 ++-- services/alb/src/stackit/alb/api_client.py | 2 +- services/alb/src/stackit/alb/configuration.py | 10 +- services/alb/src/stackit/alb/exceptions.py | 2 +- .../alb/src/stackit/alb/models/__init__.py | 10 +- .../stackit/alb/models/active_health_check.py | 2 +- .../stackit/alb/models/certificate_config.py | 4 +- .../stackit/alb/models/cookie_persistence.py | 2 +- .../alb/models/create_credentials_payload.py | 2 +- .../alb/models/create_credentials_response.py | 2 +- .../models/create_load_balancer_payload.py | 4 +- .../alb/models/credentials_response.py | 2 +- .../alb/models/get_credentials_response.py | 2 +- .../stackit/alb/models/get_quota_response.py | 2 +- .../stackit/alb/models/google_protobuf_any.py | 2 +- .../alb/src/stackit/alb/models/host_config.py | 100 ++++++++++++ .../alb/models/{header.py => http_header.py} | 10 +- .../stackit/alb/models/http_health_checks.py | 2 +- .../alb/models/list_credentials_response.py | 2 +- .../models/list_load_balancers_response.py | 2 +- .../stackit/alb/models/list_plans_response.py | 2 +- .../alb/src/stackit/alb/models/listener.py | 30 ++-- .../src/stackit/alb/models/load_balancer.py | 4 +- .../stackit/alb/models/load_balancer_error.py | 2 +- .../alb/models/load_balancer_options.py | 2 +- .../loadbalancer_option_access_control.py | 2 +- .../alb/models/loadbalancer_option_logs.py | 2 +- .../alb/models/loadbalancer_option_metrics.py | 2 +- .../loadbalancer_option_observability.py | 2 +- .../alb/src/stackit/alb/models/network.py | 2 +- .../src/stackit/alb/models/plan_details.py | 2 +- ...ttp_config.py => protocol_options_http.py} | 30 ++-- .../alb/models/protocol_options_https.py | 2 +- ...query_parameters.py => query_parameter.py} | 14 +- services/alb/src/stackit/alb/models/rule.py | 77 ++++++++-- services/alb/src/stackit/alb/models/status.py | 2 +- .../alb/src/stackit/alb/models/sub_rule.py | 143 ------------------ services/alb/src/stackit/alb/models/target.py | 2 +- .../alb/src/stackit/alb/models/target_pool.py | 2 +- .../alb/models/target_pool_tls_config.py | 2 +- .../alb/models/update_credentials_payload.py | 2 +- .../alb/models/update_credentials_response.py | 2 +- .../models/update_load_balancer_payload.py | 4 +- .../alb/models/update_target_pool_payload.py | 2 +- services/alb/src/stackit/alb/rest.py | 2 +- 46 files changed, 271 insertions(+), 269 deletions(-) create mode 100644 services/alb/src/stackit/alb/models/host_config.py rename services/alb/src/stackit/alb/models/{header.py => http_header.py} (92%) rename services/alb/src/stackit/alb/models/{http_config.py => protocol_options_http.py} (76%) rename services/alb/src/stackit/alb/models/{query_parameters.py => query_parameter.py} (90%) delete mode 100644 services/alb/src/stackit/alb/models/sub_rule.py diff --git a/services/alb/src/stackit/alb/__init__.py b/services/alb/src/stackit/alb/__init__.py index a43bf4bc..38e7ff75 100644 --- a/services/alb/src/stackit/alb/__init__.py +++ b/services/alb/src/stackit/alb/__init__.py @@ -7,7 +7,7 @@ This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. - The version of the OpenAPI document: 2beta.0.0 + The version of the OpenAPI document: 2beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -43,8 +43,8 @@ from stackit.alb.models.get_credentials_response import GetCredentialsResponse from stackit.alb.models.get_quota_response import GetQuotaResponse from stackit.alb.models.google_protobuf_any import GoogleProtobufAny -from stackit.alb.models.header import Header -from stackit.alb.models.http_config import HTTPConfig +from stackit.alb.models.host_config import HostConfig +from stackit.alb.models.http_header import HttpHeader from stackit.alb.models.http_health_checks import HttpHealthChecks from stackit.alb.models.list_credentials_response import ListCredentialsResponse from stackit.alb.models.list_load_balancers_response import ListLoadBalancersResponse @@ -63,11 +63,11 @@ ) from stackit.alb.models.network import Network from stackit.alb.models.plan_details import PlanDetails +from stackit.alb.models.protocol_options_http import ProtocolOptionsHTTP from stackit.alb.models.protocol_options_https import ProtocolOptionsHTTPS -from stackit.alb.models.query_parameters import QueryParameters +from stackit.alb.models.query_parameter import QueryParameter from stackit.alb.models.rule import Rule from stackit.alb.models.status import Status -from stackit.alb.models.sub_rule import SubRule from stackit.alb.models.target import Target from stackit.alb.models.target_pool import TargetPool from stackit.alb.models.target_pool_tls_config import TargetPoolTlsConfig diff --git a/services/alb/src/stackit/alb/api/default_api.py b/services/alb/src/stackit/alb/api/default_api.py index 0fbe7097..b97a9bbb 100644 --- a/services/alb/src/stackit/alb/api/default_api.py +++ b/services/alb/src/stackit/alb/api/default_api.py @@ -5,7 +5,7 @@ This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. - The version of the OpenAPI document: 2beta.0.0 + The version of the OpenAPI document: 2beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -327,7 +327,7 @@ def _create_credentials_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v2beta/projects/{projectId}/regions/{region}/credentials", + resource_path="/v2beta2/projects/{projectId}/regions/{region}/credentials", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -621,7 +621,7 @@ def _create_load_balancer_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v2beta/projects/{projectId}/regions/{region}/load-balancers", + resource_path="/v2beta2/projects/{projectId}/regions/{region}/load-balancers", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -889,7 +889,7 @@ def _delete_credentials_serialize( return self.api_client.param_serialize( method="DELETE", - resource_path="/v2beta/projects/{projectId}/regions/{region}/credentials/{credentialsRef}", + resource_path="/v2beta2/projects/{projectId}/regions/{region}/credentials/{credentialsRef}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1157,7 +1157,7 @@ def _delete_load_balancer_serialize( return self.api_client.param_serialize( method="DELETE", - resource_path="/v2beta/projects/{projectId}/regions/{region}/load-balancers/{name}", + resource_path="/v2beta2/projects/{projectId}/regions/{region}/load-balancers/{name}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1428,7 +1428,7 @@ def _get_credentials_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v2beta/projects/{projectId}/regions/{region}/credentials/{credentialsRef}", + resource_path="/v2beta2/projects/{projectId}/regions/{region}/credentials/{credentialsRef}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1699,7 +1699,7 @@ def _get_load_balancer_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v2beta/projects/{projectId}/regions/{region}/load-balancers/{name}", + resource_path="/v2beta2/projects/{projectId}/regions/{region}/load-balancers/{name}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1952,7 +1952,7 @@ def _get_quota_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v2beta/projects/{projectId}/regions/{region}/quota", + resource_path="/v2beta2/projects/{projectId}/regions/{region}/quota", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2205,7 +2205,7 @@ def _list_credentials_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v2beta/projects/{projectId}/regions/{region}/credentials", + resource_path="/v2beta2/projects/{projectId}/regions/{region}/credentials", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2522,7 +2522,7 @@ def _list_load_balancers_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v2beta/projects/{projectId}/regions/{region}/load-balancers", + resource_path="/v2beta2/projects/{projectId}/regions/{region}/load-balancers", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2760,7 +2760,7 @@ def _list_plans_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v2beta/regions/{region}/plans", + resource_path="/v2beta2/regions/{region}/plans", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3054,7 +3054,7 @@ def _update_credentials_serialize( return self.api_client.param_serialize( method="PUT", - resource_path="/v2beta/projects/{projectId}/regions/{region}/credentials/{credentialsRef}", + resource_path="/v2beta2/projects/{projectId}/regions/{region}/credentials/{credentialsRef}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3348,7 +3348,7 @@ def _update_load_balancer_serialize( return self.api_client.param_serialize( method="PUT", - resource_path="/v2beta/projects/{projectId}/regions/{region}/load-balancers/{name}", + resource_path="/v2beta2/projects/{projectId}/regions/{region}/load-balancers/{name}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3654,7 +3654,7 @@ def _update_target_pool_serialize( return self.api_client.param_serialize( method="PUT", - resource_path="/v2beta/projects/{projectId}/regions/{region}/load-balancers/{name}/target-pools/{targetPoolName}", + resource_path="/v2beta2/projects/{projectId}/regions/{region}/load-balancers/{name}/target-pools/{targetPoolName}", path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/services/alb/src/stackit/alb/api_client.py b/services/alb/src/stackit/alb/api_client.py index da57605a..3ee40852 100644 --- a/services/alb/src/stackit/alb/api_client.py +++ b/services/alb/src/stackit/alb/api_client.py @@ -5,7 +5,7 @@ This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. - The version of the OpenAPI document: 2beta.0.0 + The version of the OpenAPI document: 2beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/alb/src/stackit/alb/configuration.py b/services/alb/src/stackit/alb/configuration.py index 14029e16..667c33d4 100644 --- a/services/alb/src/stackit/alb/configuration.py +++ b/services/alb/src/stackit/alb/configuration.py @@ -1,18 +1,21 @@ # coding: utf-8 +import sys + +import os + + """ Application Load Balancer API This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. - The version of the OpenAPI document: 2beta.0.0 + The version of the OpenAPI document: 2beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. """ # noqa: E501 docstring might be too long -import os - class HostConfiguration: def __init__( @@ -29,6 +32,7 @@ def __init__( "as a function argument instead of being set in the client configuration.\n" "Once all services have migrated, the methods to specify the region in the client configuration " "will be removed.", + file=sys.stderr, ) """Constructor """ diff --git a/services/alb/src/stackit/alb/exceptions.py b/services/alb/src/stackit/alb/exceptions.py index f5561aeb..a387fd19 100644 --- a/services/alb/src/stackit/alb/exceptions.py +++ b/services/alb/src/stackit/alb/exceptions.py @@ -5,7 +5,7 @@ This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. - The version of the OpenAPI document: 2beta.0.0 + The version of the OpenAPI document: 2beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/alb/src/stackit/alb/models/__init__.py b/services/alb/src/stackit/alb/models/__init__.py index d2d30e9d..e4dba07e 100644 --- a/services/alb/src/stackit/alb/models/__init__.py +++ b/services/alb/src/stackit/alb/models/__init__.py @@ -6,7 +6,7 @@ This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. - The version of the OpenAPI document: 2beta.0.0 + The version of the OpenAPI document: 2beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -24,8 +24,8 @@ from stackit.alb.models.get_credentials_response import GetCredentialsResponse from stackit.alb.models.get_quota_response import GetQuotaResponse from stackit.alb.models.google_protobuf_any import GoogleProtobufAny -from stackit.alb.models.header import Header -from stackit.alb.models.http_config import HTTPConfig +from stackit.alb.models.host_config import HostConfig +from stackit.alb.models.http_header import HttpHeader from stackit.alb.models.http_health_checks import HttpHealthChecks from stackit.alb.models.list_credentials_response import ListCredentialsResponse from stackit.alb.models.list_load_balancers_response import ListLoadBalancersResponse @@ -44,11 +44,11 @@ ) from stackit.alb.models.network import Network from stackit.alb.models.plan_details import PlanDetails +from stackit.alb.models.protocol_options_http import ProtocolOptionsHTTP from stackit.alb.models.protocol_options_https import ProtocolOptionsHTTPS -from stackit.alb.models.query_parameters import QueryParameters +from stackit.alb.models.query_parameter import QueryParameter from stackit.alb.models.rule import Rule from stackit.alb.models.status import Status -from stackit.alb.models.sub_rule import SubRule from stackit.alb.models.target import Target from stackit.alb.models.target_pool import TargetPool from stackit.alb.models.target_pool_tls_config import TargetPoolTlsConfig diff --git a/services/alb/src/stackit/alb/models/active_health_check.py b/services/alb/src/stackit/alb/models/active_health_check.py index 7c9f7db5..263ffcf6 100644 --- a/services/alb/src/stackit/alb/models/active_health_check.py +++ b/services/alb/src/stackit/alb/models/active_health_check.py @@ -5,7 +5,7 @@ This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. - The version of the OpenAPI document: 2beta.0.0 + The version of the OpenAPI document: 2beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/alb/src/stackit/alb/models/certificate_config.py b/services/alb/src/stackit/alb/models/certificate_config.py index f18a4b7b..228fe62f 100644 --- a/services/alb/src/stackit/alb/models/certificate_config.py +++ b/services/alb/src/stackit/alb/models/certificate_config.py @@ -5,7 +5,7 @@ This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. - The version of the OpenAPI document: 2beta.0.0 + The version of the OpenAPI document: 2beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -27,7 +27,7 @@ class CertificateConfig(BaseModel): """ certificate_ids: Optional[List[StrictStr]] = Field( - default=None, description="Certificate IDs for TLS termination", alias="certificateIds" + default=None, description="Certificate IDs for TLS termination.", alias="certificateIds" ) __properties: ClassVar[List[str]] = ["certificateIds"] diff --git a/services/alb/src/stackit/alb/models/cookie_persistence.py b/services/alb/src/stackit/alb/models/cookie_persistence.py index a6e302a9..4d88eea8 100644 --- a/services/alb/src/stackit/alb/models/cookie_persistence.py +++ b/services/alb/src/stackit/alb/models/cookie_persistence.py @@ -5,7 +5,7 @@ This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. - The version of the OpenAPI document: 2beta.0.0 + The version of the OpenAPI document: 2beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/alb/src/stackit/alb/models/create_credentials_payload.py b/services/alb/src/stackit/alb/models/create_credentials_payload.py index c608b808..d2c913b5 100644 --- a/services/alb/src/stackit/alb/models/create_credentials_payload.py +++ b/services/alb/src/stackit/alb/models/create_credentials_payload.py @@ -5,7 +5,7 @@ This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. - The version of the OpenAPI document: 2beta.0.0 + The version of the OpenAPI document: 2beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/alb/src/stackit/alb/models/create_credentials_response.py b/services/alb/src/stackit/alb/models/create_credentials_response.py index eac751ce..ceeef945 100644 --- a/services/alb/src/stackit/alb/models/create_credentials_response.py +++ b/services/alb/src/stackit/alb/models/create_credentials_response.py @@ -5,7 +5,7 @@ This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. - The version of the OpenAPI document: 2beta.0.0 + The version of the OpenAPI document: 2beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/alb/src/stackit/alb/models/create_load_balancer_payload.py b/services/alb/src/stackit/alb/models/create_load_balancer_payload.py index 302f7019..ed4d2ffb 100644 --- a/services/alb/src/stackit/alb/models/create_load_balancer_payload.py +++ b/services/alb/src/stackit/alb/models/create_load_balancer_payload.py @@ -5,7 +5,7 @@ This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. - The version of the OpenAPI document: 2beta.0.0 + The version of the OpenAPI document: 2beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -60,7 +60,7 @@ class CreateLoadBalancerPayload(BaseModel): description="Transient private application load balancer IP address that can change any time.", alias="privateAddress", ) - region: Optional[StrictStr] = Field(default=None, description="Region of the LoadBalancer") + region: Optional[StrictStr] = Field(default=None, description="Region of the LoadBalancer.") status: Optional[StrictStr] = None target_pools: Optional[List[TargetPool]] = Field( default=None, diff --git a/services/alb/src/stackit/alb/models/credentials_response.py b/services/alb/src/stackit/alb/models/credentials_response.py index d9f9c262..a0d50608 100644 --- a/services/alb/src/stackit/alb/models/credentials_response.py +++ b/services/alb/src/stackit/alb/models/credentials_response.py @@ -5,7 +5,7 @@ This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. - The version of the OpenAPI document: 2beta.0.0 + The version of the OpenAPI document: 2beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/alb/src/stackit/alb/models/get_credentials_response.py b/services/alb/src/stackit/alb/models/get_credentials_response.py index 06e492d4..c39c6352 100644 --- a/services/alb/src/stackit/alb/models/get_credentials_response.py +++ b/services/alb/src/stackit/alb/models/get_credentials_response.py @@ -5,7 +5,7 @@ This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. - The version of the OpenAPI document: 2beta.0.0 + The version of the OpenAPI document: 2beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/alb/src/stackit/alb/models/get_quota_response.py b/services/alb/src/stackit/alb/models/get_quota_response.py index da836144..3d1d1ca9 100644 --- a/services/alb/src/stackit/alb/models/get_quota_response.py +++ b/services/alb/src/stackit/alb/models/get_quota_response.py @@ -5,7 +5,7 @@ This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. - The version of the OpenAPI document: 2beta.0.0 + The version of the OpenAPI document: 2beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/alb/src/stackit/alb/models/google_protobuf_any.py b/services/alb/src/stackit/alb/models/google_protobuf_any.py index cede0446..b87fa5dd 100644 --- a/services/alb/src/stackit/alb/models/google_protobuf_any.py +++ b/services/alb/src/stackit/alb/models/google_protobuf_any.py @@ -5,7 +5,7 @@ This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. - The version of the OpenAPI document: 2beta.0.0 + The version of the OpenAPI document: 2beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/alb/src/stackit/alb/models/host_config.py b/services/alb/src/stackit/alb/models/host_config.py new file mode 100644 index 00000000..5b542100 --- /dev/null +++ b/services/alb/src/stackit/alb/models/host_config.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Application Load Balancer API + + This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. + + The version of the OpenAPI document: 2beta2.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + +from stackit.alb.models.rule import Rule + + +class HostConfig(BaseModel): + """ + HostConfig + """ + + host: Optional[StrictStr] = Field( + default=None, description="Hostname to match. Supports wildcards (e.g. *.example.com)." + ) + rules: Optional[List[Rule]] = Field( + default=None, description="Routing rules under the specified host, matched by path prefix." + ) + __properties: ClassVar[List[str]] = ["host", "rules"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HostConfig from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in rules (list) + _items = [] + if self.rules: + for _item in self.rules: + if _item: + _items.append(_item.to_dict()) + _dict["rules"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HostConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "host": obj.get("host"), + "rules": [Rule.from_dict(_item) for _item in obj["rules"]] if obj.get("rules") is not None else None, + } + ) + return _obj diff --git a/services/alb/src/stackit/alb/models/header.py b/services/alb/src/stackit/alb/models/http_header.py similarity index 92% rename from services/alb/src/stackit/alb/models/header.py rename to services/alb/src/stackit/alb/models/http_header.py index 4b702dae..7d4be82d 100644 --- a/services/alb/src/stackit/alb/models/header.py +++ b/services/alb/src/stackit/alb/models/http_header.py @@ -5,7 +5,7 @@ This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. - The version of the OpenAPI document: 2beta.0.0 + The version of the OpenAPI document: 2beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -21,9 +21,9 @@ from typing_extensions import Self -class Header(BaseModel): +class HttpHeader(BaseModel): """ - Header + HttpHeader """ exact_match: Optional[StrictStr] = Field( @@ -49,7 +49,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of Header from a JSON string""" + """Create an instance of HttpHeader from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -73,7 +73,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Header from a dict""" + """Create an instance of HttpHeader from a dict""" if obj is None: return None diff --git a/services/alb/src/stackit/alb/models/http_health_checks.py b/services/alb/src/stackit/alb/models/http_health_checks.py index 87c7a29e..c376130e 100644 --- a/services/alb/src/stackit/alb/models/http_health_checks.py +++ b/services/alb/src/stackit/alb/models/http_health_checks.py @@ -5,7 +5,7 @@ This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. - The version of the OpenAPI document: 2beta.0.0 + The version of the OpenAPI document: 2beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/alb/src/stackit/alb/models/list_credentials_response.py b/services/alb/src/stackit/alb/models/list_credentials_response.py index 00a51323..5cff605f 100644 --- a/services/alb/src/stackit/alb/models/list_credentials_response.py +++ b/services/alb/src/stackit/alb/models/list_credentials_response.py @@ -5,7 +5,7 @@ This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. - The version of the OpenAPI document: 2beta.0.0 + The version of the OpenAPI document: 2beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/alb/src/stackit/alb/models/list_load_balancers_response.py b/services/alb/src/stackit/alb/models/list_load_balancers_response.py index 91f6b768..c3e05af5 100644 --- a/services/alb/src/stackit/alb/models/list_load_balancers_response.py +++ b/services/alb/src/stackit/alb/models/list_load_balancers_response.py @@ -5,7 +5,7 @@ This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. - The version of the OpenAPI document: 2beta.0.0 + The version of the OpenAPI document: 2beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/alb/src/stackit/alb/models/list_plans_response.py b/services/alb/src/stackit/alb/models/list_plans_response.py index d61e776d..3038fa5f 100644 --- a/services/alb/src/stackit/alb/models/list_plans_response.py +++ b/services/alb/src/stackit/alb/models/list_plans_response.py @@ -5,7 +5,7 @@ This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. - The version of the OpenAPI document: 2beta.0.0 + The version of the OpenAPI document: 2beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/alb/src/stackit/alb/models/listener.py b/services/alb/src/stackit/alb/models/listener.py index 1cfada7e..38e376d9 100644 --- a/services/alb/src/stackit/alb/models/listener.py +++ b/services/alb/src/stackit/alb/models/listener.py @@ -5,7 +5,7 @@ This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. - The version of the OpenAPI document: 2beta.0.0 + The version of the OpenAPI document: 2beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -20,8 +20,8 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing_extensions import Annotated, Self +from stackit.alb.models.protocol_options_http import ProtocolOptionsHTTP from stackit.alb.models.protocol_options_https import ProtocolOptionsHTTPS -from stackit.alb.models.rule import Rule class Listener(BaseModel): @@ -29,24 +29,20 @@ class Listener(BaseModel): Listener """ - display_name: Optional[StrictStr] = Field(default=None, alias="displayName") - http: Optional[Dict[str, Any]] = None + http: Optional[ProtocolOptionsHTTP] = None https: Optional[ProtocolOptionsHTTPS] = None name: Optional[StrictStr] = Field( default=None, - description="Will be used to reference a listener and will replace display name in the future. Currently uses - as the name if no display name is given.", + description="Unique, system-generated identifier for the listener. It is derived from the protocol and port.", ) port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1)]] = Field( - default=None, description="Port number where we listen for traffic" + default=None, description="Port number on which the listener receives incoming traffic." ) protocol: Optional[StrictStr] = Field( default=None, description="Protocol is the highest network protocol we understand to load balance. Currently PROTOCOL_HTTP and PROTOCOL_HTTPS are supported.", ) - rules: Optional[List[Rule]] = Field( - default=None, description="Rules define the routing parameters for the HTTP and HTTPS listeners." - ) - __properties: ClassVar[List[str]] = ["displayName", "http", "https", "name", "port", "protocol", "rules"] + __properties: ClassVar[List[str]] = ["http", "https", "name", "port", "protocol"] @field_validator("protocol") def protocol_validate_enum(cls, value): @@ -100,16 +96,12 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of http + if self.http: + _dict["http"] = self.http.to_dict() # override the default output from pydantic by calling `to_dict()` of https if self.https: _dict["https"] = self.https.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in rules (list) - _items = [] - if self.rules: - for _item in self.rules: - if _item: - _items.append(_item.to_dict()) - _dict["rules"] = _items return _dict @classmethod @@ -123,13 +115,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { - "displayName": obj.get("displayName"), - "http": obj.get("http"), + "http": ProtocolOptionsHTTP.from_dict(obj["http"]) if obj.get("http") is not None else None, "https": ProtocolOptionsHTTPS.from_dict(obj["https"]) if obj.get("https") is not None else None, "name": obj.get("name"), "port": obj.get("port"), "protocol": obj.get("protocol"), - "rules": [Rule.from_dict(_item) for _item in obj["rules"]] if obj.get("rules") is not None else None, } ) return _obj diff --git a/services/alb/src/stackit/alb/models/load_balancer.py b/services/alb/src/stackit/alb/models/load_balancer.py index 6a9cd038..ac523d33 100644 --- a/services/alb/src/stackit/alb/models/load_balancer.py +++ b/services/alb/src/stackit/alb/models/load_balancer.py @@ -5,7 +5,7 @@ This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. - The version of the OpenAPI document: 2beta.0.0 + The version of the OpenAPI document: 2beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -60,7 +60,7 @@ class LoadBalancer(BaseModel): description="Transient private application load balancer IP address that can change any time.", alias="privateAddress", ) - region: Optional[StrictStr] = Field(default=None, description="Region of the LoadBalancer") + region: Optional[StrictStr] = Field(default=None, description="Region of the LoadBalancer.") status: Optional[StrictStr] = None target_pools: Optional[List[TargetPool]] = Field( default=None, diff --git a/services/alb/src/stackit/alb/models/load_balancer_error.py b/services/alb/src/stackit/alb/models/load_balancer_error.py index 8d2341e8..1a31862e 100644 --- a/services/alb/src/stackit/alb/models/load_balancer_error.py +++ b/services/alb/src/stackit/alb/models/load_balancer_error.py @@ -5,7 +5,7 @@ This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. - The version of the OpenAPI document: 2beta.0.0 + The version of the OpenAPI document: 2beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/alb/src/stackit/alb/models/load_balancer_options.py b/services/alb/src/stackit/alb/models/load_balancer_options.py index fdaf530c..48248c1e 100644 --- a/services/alb/src/stackit/alb/models/load_balancer_options.py +++ b/services/alb/src/stackit/alb/models/load_balancer_options.py @@ -5,7 +5,7 @@ This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. - The version of the OpenAPI document: 2beta.0.0 + The version of the OpenAPI document: 2beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/alb/src/stackit/alb/models/loadbalancer_option_access_control.py b/services/alb/src/stackit/alb/models/loadbalancer_option_access_control.py index 356331eb..1b9f2e99 100644 --- a/services/alb/src/stackit/alb/models/loadbalancer_option_access_control.py +++ b/services/alb/src/stackit/alb/models/loadbalancer_option_access_control.py @@ -5,7 +5,7 @@ This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. - The version of the OpenAPI document: 2beta.0.0 + The version of the OpenAPI document: 2beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/alb/src/stackit/alb/models/loadbalancer_option_logs.py b/services/alb/src/stackit/alb/models/loadbalancer_option_logs.py index b2267033..5a1805fa 100644 --- a/services/alb/src/stackit/alb/models/loadbalancer_option_logs.py +++ b/services/alb/src/stackit/alb/models/loadbalancer_option_logs.py @@ -5,7 +5,7 @@ This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. - The version of the OpenAPI document: 2beta.0.0 + The version of the OpenAPI document: 2beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/alb/src/stackit/alb/models/loadbalancer_option_metrics.py b/services/alb/src/stackit/alb/models/loadbalancer_option_metrics.py index 5bd8b7de..9a53f641 100644 --- a/services/alb/src/stackit/alb/models/loadbalancer_option_metrics.py +++ b/services/alb/src/stackit/alb/models/loadbalancer_option_metrics.py @@ -5,7 +5,7 @@ This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. - The version of the OpenAPI document: 2beta.0.0 + The version of the OpenAPI document: 2beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/alb/src/stackit/alb/models/loadbalancer_option_observability.py b/services/alb/src/stackit/alb/models/loadbalancer_option_observability.py index baa1f95f..19821a21 100644 --- a/services/alb/src/stackit/alb/models/loadbalancer_option_observability.py +++ b/services/alb/src/stackit/alb/models/loadbalancer_option_observability.py @@ -5,7 +5,7 @@ This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. - The version of the OpenAPI document: 2beta.0.0 + The version of the OpenAPI document: 2beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/alb/src/stackit/alb/models/network.py b/services/alb/src/stackit/alb/models/network.py index 259ab003..be6fb0ed 100644 --- a/services/alb/src/stackit/alb/models/network.py +++ b/services/alb/src/stackit/alb/models/network.py @@ -5,7 +5,7 @@ This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. - The version of the OpenAPI document: 2beta.0.0 + The version of the OpenAPI document: 2beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/alb/src/stackit/alb/models/plan_details.py b/services/alb/src/stackit/alb/models/plan_details.py index 238ec301..0f81a2ab 100644 --- a/services/alb/src/stackit/alb/models/plan_details.py +++ b/services/alb/src/stackit/alb/models/plan_details.py @@ -5,7 +5,7 @@ This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. - The version of the OpenAPI document: 2beta.0.0 + The version of the OpenAPI document: 2beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/alb/src/stackit/alb/models/http_config.py b/services/alb/src/stackit/alb/models/protocol_options_http.py similarity index 76% rename from services/alb/src/stackit/alb/models/http_config.py rename to services/alb/src/stackit/alb/models/protocol_options_http.py index cee63836..10211fce 100644 --- a/services/alb/src/stackit/alb/models/http_config.py +++ b/services/alb/src/stackit/alb/models/protocol_options_http.py @@ -5,7 +5,7 @@ This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. - The version of the OpenAPI document: 2beta.0.0 + The version of the OpenAPI document: 2beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -20,16 +20,16 @@ from pydantic import BaseModel, ConfigDict, Field from typing_extensions import Self -from stackit.alb.models.sub_rule import SubRule +from stackit.alb.models.host_config import HostConfig -class HTTPConfig(BaseModel): +class ProtocolOptionsHTTP(BaseModel): """ - HTTPConfig + ProtocolOptionsHTTP """ - sub_rules: Optional[List[SubRule]] = Field(default=None, alias="subRules") - __properties: ClassVar[List[str]] = ["subRules"] + hosts: Optional[List[HostConfig]] = Field(default=None, description="Defines routing rules grouped by hostname.") + __properties: ClassVar[List[str]] = ["hosts"] model_config = ConfigDict( populate_by_name=True, @@ -48,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of HTTPConfig from a JSON string""" + """Create an instance of ProtocolOptionsHTTP from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -68,18 +68,18 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of each item in sub_rules (list) + # override the default output from pydantic by calling `to_dict()` of each item in hosts (list) _items = [] - if self.sub_rules: - for _item in self.sub_rules: + if self.hosts: + for _item in self.hosts: if _item: _items.append(_item.to_dict()) - _dict["subRules"] = _items + _dict["hosts"] = _items return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of HTTPConfig from a dict""" + """Create an instance of ProtocolOptionsHTTP from a dict""" if obj is None: return None @@ -87,10 +87,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate( - { - "subRules": ( - [SubRule.from_dict(_item) for _item in obj["subRules"]] if obj.get("subRules") is not None else None - ) - } + {"hosts": [HostConfig.from_dict(_item) for _item in obj["hosts"]] if obj.get("hosts") is not None else None} ) return _obj diff --git a/services/alb/src/stackit/alb/models/protocol_options_https.py b/services/alb/src/stackit/alb/models/protocol_options_https.py index 8f196722..a0d66efa 100644 --- a/services/alb/src/stackit/alb/models/protocol_options_https.py +++ b/services/alb/src/stackit/alb/models/protocol_options_https.py @@ -5,7 +5,7 @@ This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. - The version of the OpenAPI document: 2beta.0.0 + The version of the OpenAPI document: 2beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/alb/src/stackit/alb/models/query_parameters.py b/services/alb/src/stackit/alb/models/query_parameter.py similarity index 90% rename from services/alb/src/stackit/alb/models/query_parameters.py rename to services/alb/src/stackit/alb/models/query_parameter.py index c56cbbe3..ce6d2feb 100644 --- a/services/alb/src/stackit/alb/models/query_parameters.py +++ b/services/alb/src/stackit/alb/models/query_parameter.py @@ -5,7 +5,7 @@ This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. - The version of the OpenAPI document: 2beta.0.0 + The version of the OpenAPI document: 2beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -21,15 +21,15 @@ from typing_extensions import Self -class QueryParameters(BaseModel): +class QueryParameter(BaseModel): """ - QueryParameters + QueryParameter """ exact_match: Optional[StrictStr] = Field( - default=None, description="Exact match for the parameter value", alias="exactMatch" + default=None, description="Exact match for the parameter value.", alias="exactMatch" ) - name: Optional[StrictStr] = Field(default=None, description="Parameter name") + name: Optional[StrictStr] = Field(default=None, description="Parameter name.") __properties: ClassVar[List[str]] = ["exactMatch", "name"] model_config = ConfigDict( @@ -49,7 +49,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of QueryParameters from a JSON string""" + """Create an instance of QueryParameter from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -73,7 +73,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of QueryParameters from a dict""" + """Create an instance of QueryParameter from a dict""" if obj is None: return None diff --git a/services/alb/src/stackit/alb/models/rule.py b/services/alb/src/stackit/alb/models/rule.py index d5a6c241..ca7dd2de 100644 --- a/services/alb/src/stackit/alb/models/rule.py +++ b/services/alb/src/stackit/alb/models/rule.py @@ -5,7 +5,7 @@ This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. - The version of the OpenAPI document: 2beta.0.0 + The version of the OpenAPI document: 2beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -17,10 +17,12 @@ import pprint from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing_extensions import Self -from stackit.alb.models.http_config import HTTPConfig +from stackit.alb.models.cookie_persistence import CookiePersistence +from stackit.alb.models.http_header import HttpHeader +from stackit.alb.models.query_parameter import QueryParameter class Rule(BaseModel): @@ -28,9 +30,32 @@ class Rule(BaseModel): Rule """ - host: Optional[StrictStr] = Field(default=None, description="Host for the rule") - http: Optional[HTTPConfig] = None - __properties: ClassVar[List[str]] = ["host", "http"] + cookie_persistence: Optional[CookiePersistence] = Field(default=None, alias="cookiePersistence") + headers: Optional[List[HttpHeader]] = Field(default=None, description="Headers for the rule.") + path_prefix: Optional[StrictStr] = Field( + default=None, + description="Path prefix for the rule. If empty or '/', it matches the root path.", + alias="pathPrefix", + ) + query_parameters: Optional[List[QueryParameter]] = Field( + default=None, description="Query Parameters for the rule.", alias="queryParameters" + ) + target_pool: Optional[StrictStr] = Field( + default=None, description="Reference target pool by target pool name.", alias="targetPool" + ) + web_socket: Optional[StrictBool] = Field( + default=None, + description="If enabled, when client sends an HTTP request with and Upgrade header, indicating the desire to establish a Websocket connection, if backend server supports WebSocket, it responds with HTTP 101 status code, switching protocols from HTTP to WebSocket. Hence the client and the server can exchange data in real-time using one long-lived TCP connection.", + alias="webSocket", + ) + __properties: ClassVar[List[str]] = [ + "cookiePersistence", + "headers", + "pathPrefix", + "queryParameters", + "targetPool", + "webSocket", + ] model_config = ConfigDict( populate_by_name=True, @@ -69,9 +94,23 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of http - if self.http: - _dict["http"] = self.http.to_dict() + # override the default output from pydantic by calling `to_dict()` of cookie_persistence + if self.cookie_persistence: + _dict["cookiePersistence"] = self.cookie_persistence.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in headers (list) + _items = [] + if self.headers: + for _item in self.headers: + if _item: + _items.append(_item.to_dict()) + _dict["headers"] = _items + # override the default output from pydantic by calling `to_dict()` of each item in query_parameters (list) + _items = [] + if self.query_parameters: + for _item in self.query_parameters: + if _item: + _items.append(_item.to_dict()) + _dict["queryParameters"] = _items return _dict @classmethod @@ -85,8 +124,24 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { - "host": obj.get("host"), - "http": HTTPConfig.from_dict(obj["http"]) if obj.get("http") is not None else None, + "cookiePersistence": ( + CookiePersistence.from_dict(obj["cookiePersistence"]) + if obj.get("cookiePersistence") is not None + else None + ), + "headers": ( + [HttpHeader.from_dict(_item) for _item in obj["headers"]] + if obj.get("headers") is not None + else None + ), + "pathPrefix": obj.get("pathPrefix"), + "queryParameters": ( + [QueryParameter.from_dict(_item) for _item in obj["queryParameters"]] + if obj.get("queryParameters") is not None + else None + ), + "targetPool": obj.get("targetPool"), + "webSocket": obj.get("webSocket"), } ) return _obj diff --git a/services/alb/src/stackit/alb/models/status.py b/services/alb/src/stackit/alb/models/status.py index ff5b6870..f20a1623 100644 --- a/services/alb/src/stackit/alb/models/status.py +++ b/services/alb/src/stackit/alb/models/status.py @@ -5,7 +5,7 @@ This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. - The version of the OpenAPI document: 2beta.0.0 + The version of the OpenAPI document: 2beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/alb/src/stackit/alb/models/sub_rule.py b/services/alb/src/stackit/alb/models/sub_rule.py deleted file mode 100644 index 0e8ea6dc..00000000 --- a/services/alb/src/stackit/alb/models/sub_rule.py +++ /dev/null @@ -1,143 +0,0 @@ -# coding: utf-8 - -""" - Application Load Balancer API - - This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. - - The version of the OpenAPI document: 2beta.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 docstring might be too long - -from __future__ import annotations - -import json -import pprint -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing_extensions import Self - -from stackit.alb.models.cookie_persistence import CookiePersistence -from stackit.alb.models.header import Header -from stackit.alb.models.query_parameters import QueryParameters - - -class SubRule(BaseModel): - """ - SubRule - """ - - cookie_persistence: Optional[CookiePersistence] = Field(default=None, alias="cookiePersistence") - headers: Optional[List[Header]] = Field(default=None, description="Headers for the subRule") - path_prefix: Optional[StrictStr] = Field( - default=None, description="Path prefix for the subRule", alias="pathPrefix" - ) - query_parameters: Optional[List[QueryParameters]] = Field( - default=None, description="Query Parameters for the subRule", alias="queryParameters" - ) - target_pool: Optional[StrictStr] = Field( - default=None, description="Reference target pool by target pool name.", alias="targetPool" - ) - web_socket: Optional[StrictBool] = Field( - default=None, - description="If enabled, when client sends an HTTP request with and Upgrade header, indicating the desire to establish a Websocket connection, if backend server supports WebSocket, it responds with HTTP 101 status code, switching protocols from HTTP to WebSocket. Hence the client and the server can exchange data in real-time using one long-lived TCP connection.", - alias="webSocket", - ) - __properties: ClassVar[List[str]] = [ - "cookiePersistence", - "headers", - "pathPrefix", - "queryParameters", - "targetPool", - "webSocket", - ] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SubRule from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of cookie_persistence - if self.cookie_persistence: - _dict["cookiePersistence"] = self.cookie_persistence.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in headers (list) - _items = [] - if self.headers: - for _item in self.headers: - if _item: - _items.append(_item.to_dict()) - _dict["headers"] = _items - # override the default output from pydantic by calling `to_dict()` of each item in query_parameters (list) - _items = [] - if self.query_parameters: - for _item in self.query_parameters: - if _item: - _items.append(_item.to_dict()) - _dict["queryParameters"] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SubRule from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "cookiePersistence": ( - CookiePersistence.from_dict(obj["cookiePersistence"]) - if obj.get("cookiePersistence") is not None - else None - ), - "headers": ( - [Header.from_dict(_item) for _item in obj["headers"]] if obj.get("headers") is not None else None - ), - "pathPrefix": obj.get("pathPrefix"), - "queryParameters": ( - [QueryParameters.from_dict(_item) for _item in obj["queryParameters"]] - if obj.get("queryParameters") is not None - else None - ), - "targetPool": obj.get("targetPool"), - "webSocket": obj.get("webSocket"), - } - ) - return _obj diff --git a/services/alb/src/stackit/alb/models/target.py b/services/alb/src/stackit/alb/models/target.py index 25bd3f70..c4d37436 100644 --- a/services/alb/src/stackit/alb/models/target.py +++ b/services/alb/src/stackit/alb/models/target.py @@ -5,7 +5,7 @@ This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. - The version of the OpenAPI document: 2beta.0.0 + The version of the OpenAPI document: 2beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/alb/src/stackit/alb/models/target_pool.py b/services/alb/src/stackit/alb/models/target_pool.py index 20bdf891..a8767939 100644 --- a/services/alb/src/stackit/alb/models/target_pool.py +++ b/services/alb/src/stackit/alb/models/target_pool.py @@ -5,7 +5,7 @@ This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. - The version of the OpenAPI document: 2beta.0.0 + The version of the OpenAPI document: 2beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/alb/src/stackit/alb/models/target_pool_tls_config.py b/services/alb/src/stackit/alb/models/target_pool_tls_config.py index 49aed60e..23fb7e2d 100644 --- a/services/alb/src/stackit/alb/models/target_pool_tls_config.py +++ b/services/alb/src/stackit/alb/models/target_pool_tls_config.py @@ -5,7 +5,7 @@ This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. - The version of the OpenAPI document: 2beta.0.0 + The version of the OpenAPI document: 2beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/alb/src/stackit/alb/models/update_credentials_payload.py b/services/alb/src/stackit/alb/models/update_credentials_payload.py index 43231317..dde90e1f 100644 --- a/services/alb/src/stackit/alb/models/update_credentials_payload.py +++ b/services/alb/src/stackit/alb/models/update_credentials_payload.py @@ -5,7 +5,7 @@ This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. - The version of the OpenAPI document: 2beta.0.0 + The version of the OpenAPI document: 2beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/alb/src/stackit/alb/models/update_credentials_response.py b/services/alb/src/stackit/alb/models/update_credentials_response.py index 562f48d1..ab5c0867 100644 --- a/services/alb/src/stackit/alb/models/update_credentials_response.py +++ b/services/alb/src/stackit/alb/models/update_credentials_response.py @@ -5,7 +5,7 @@ This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. - The version of the OpenAPI document: 2beta.0.0 + The version of the OpenAPI document: 2beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/alb/src/stackit/alb/models/update_load_balancer_payload.py b/services/alb/src/stackit/alb/models/update_load_balancer_payload.py index f2f28b39..543e5d59 100644 --- a/services/alb/src/stackit/alb/models/update_load_balancer_payload.py +++ b/services/alb/src/stackit/alb/models/update_load_balancer_payload.py @@ -5,7 +5,7 @@ This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. - The version of the OpenAPI document: 2beta.0.0 + The version of the OpenAPI document: 2beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -60,7 +60,7 @@ class UpdateLoadBalancerPayload(BaseModel): description="Transient private application load balancer IP address that can change any time.", alias="privateAddress", ) - region: Optional[StrictStr] = Field(default=None, description="Region of the LoadBalancer") + region: Optional[StrictStr] = Field(default=None, description="Region of the LoadBalancer.") status: Optional[StrictStr] = None target_pools: Optional[List[TargetPool]] = Field( default=None, diff --git a/services/alb/src/stackit/alb/models/update_target_pool_payload.py b/services/alb/src/stackit/alb/models/update_target_pool_payload.py index 5336811a..06f90ef8 100644 --- a/services/alb/src/stackit/alb/models/update_target_pool_payload.py +++ b/services/alb/src/stackit/alb/models/update_target_pool_payload.py @@ -5,7 +5,7 @@ This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. - The version of the OpenAPI document: 2beta.0.0 + The version of the OpenAPI document: 2beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/alb/src/stackit/alb/rest.py b/services/alb/src/stackit/alb/rest.py index 867cc03f..65bd14d4 100644 --- a/services/alb/src/stackit/alb/rest.py +++ b/services/alb/src/stackit/alb/rest.py @@ -5,7 +5,7 @@ This API offers an interface to provision and manage load balancing servers in your STACKIT project. It also has the possibility of pooling target servers for load balancing purposes. For each application load balancer provided, two VMs are deployed in your OpenStack project subject to a fee. - The version of the OpenAPI document: 2beta.0.0 + The version of the OpenAPI document: 2beta2.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. From 574c151e35cb3b45e1771b6738dd14c8162d6e8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BCdiger=20Schmitz?= <152157960+bahkauv70@users.noreply.github.com> Date: Mon, 5 May 2025 10:56:52 +0200 Subject: [PATCH 2/2] chore(sdk): add changelogs --- CHANGELOG.md | 2 ++ services/alb/CHANGELOG.md | 3 +++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 505b828e..51c05f8d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ - **Minor change:** Service update. - `git`: [v0.1.1](services/git/CHANGELOG.md#v011-2025-05-05) - **Bugfix**: Spelling corrections in documentation +- `alb`: [v0.1.1](services/alb/CHANGELOG.md#v011-2025-05-05) + - **Feature:** Switch to beta2 API - `cdn`[v1.0.0](services/cdn/CHANGELOG.md#v100-2025-05-05) - **Feature:** Support for log management - **Feature:** Create distribution payload has additional optional attributes for blocked countries, IPs and volume limitation diff --git a/services/alb/CHANGELOG.md b/services/alb/CHANGELOG.md index f1162665..6b1532ed 100644 --- a/services/alb/CHANGELOG.md +++ b/services/alb/CHANGELOG.md @@ -1,2 +1,5 @@ +## v0.1.1 (2025-05-05) +- **Feature:** Switch to beta2 API + ## v0.1.0 (2025-03-18) - **New**: Client for managing the ALB service