stackit-loadbalancer 0.0.1a1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- stackit/loadbalancer/__init__.py +94 -0
- stackit/loadbalancer/api/__init__.py +4 -0
- stackit/loadbalancer/api/default_api.py +4224 -0
- stackit/loadbalancer/api_client.py +626 -0
- stackit/loadbalancer/api_response.py +23 -0
- stackit/loadbalancer/configuration.py +111 -0
- stackit/loadbalancer/exceptions.py +198 -0
- stackit/loadbalancer/models/__init__.py +75 -0
- stackit/loadbalancer/models/active_health_check.py +142 -0
- stackit/loadbalancer/models/create_credentials_payload.py +104 -0
- stackit/loadbalancer/models/create_credentials_response.py +92 -0
- stackit/loadbalancer/models/create_load_balancer_payload.py +231 -0
- stackit/loadbalancer/models/credentials_response.py +106 -0
- stackit/loadbalancer/models/get_credentials_response.py +92 -0
- stackit/loadbalancer/models/get_quota_response.py +106 -0
- stackit/loadbalancer/models/get_service_status_response.py +103 -0
- stackit/loadbalancer/models/google_protobuf_any.py +97 -0
- stackit/loadbalancer/models/list_credentials_response.py +98 -0
- stackit/loadbalancer/models/list_load_balancers_response.py +115 -0
- stackit/loadbalancer/models/list_plans_response.py +98 -0
- stackit/loadbalancer/models/listener.py +162 -0
- stackit/loadbalancer/models/load_balancer.py +231 -0
- stackit/loadbalancer/models/load_balancer_error.py +113 -0
- stackit/loadbalancer/models/load_balancer_options.py +116 -0
- stackit/loadbalancer/models/loadbalancer_option_access_control.py +85 -0
- stackit/loadbalancer/models/loadbalancer_option_logs.py +90 -0
- stackit/loadbalancer/models/loadbalancer_option_metrics.py +90 -0
- stackit/loadbalancer/models/loadbalancer_option_observability.py +100 -0
- stackit/loadbalancer/models/network.py +112 -0
- stackit/loadbalancer/models/options_tcp.py +96 -0
- stackit/loadbalancer/models/options_udp.py +96 -0
- stackit/loadbalancer/models/plan_details.py +97 -0
- stackit/loadbalancer/models/server_name_indicator.py +81 -0
- stackit/loadbalancer/models/session_persistence.py +85 -0
- stackit/loadbalancer/models/status.py +111 -0
- stackit/loadbalancer/models/target.py +97 -0
- stackit/loadbalancer/models/target_pool.py +137 -0
- stackit/loadbalancer/models/update_credentials_payload.py +104 -0
- stackit/loadbalancer/models/update_credentials_response.py +92 -0
- stackit/loadbalancer/models/update_load_balancer_payload.py +231 -0
- stackit/loadbalancer/models/update_target_pool_payload.py +137 -0
- stackit/loadbalancer/py.typed +0 -0
- stackit/loadbalancer/rest.py +148 -0
- stackit_loadbalancer-0.0.1a1.dist-info/METADATA +46 -0
- stackit_loadbalancer-0.0.1a1.dist-info/RECORD +46 -0
- stackit_loadbalancer-0.0.1a1.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Load Balancer API
|
|
5
|
+
|
|
6
|
+
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 load balancer provided, two VMs are deployed in your OpenStack project subject to a fee.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.7.2
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501 docstring might be too long
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
import json
|
|
17
|
+
import pprint
|
|
18
|
+
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
21
|
+
from typing_extensions import Self
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class GetServiceStatusResponse(BaseModel):
|
|
25
|
+
"""
|
|
26
|
+
Response with customer project status.
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
status: Optional[StrictStr] = Field(default=None, description="status of the project")
|
|
30
|
+
__properties: ClassVar[List[str]] = ["status"]
|
|
31
|
+
|
|
32
|
+
@field_validator("status")
|
|
33
|
+
def status_validate_enum(cls, value):
|
|
34
|
+
"""Validates the enum"""
|
|
35
|
+
if value is None:
|
|
36
|
+
return value
|
|
37
|
+
|
|
38
|
+
if value not in set(
|
|
39
|
+
[
|
|
40
|
+
"STATUS_UNSPECIFIED",
|
|
41
|
+
"STATUS_READY",
|
|
42
|
+
"STATUS_FAILED",
|
|
43
|
+
"STATUS_UPDATING",
|
|
44
|
+
"STATUS_DELETING",
|
|
45
|
+
"STATUS_DISABLED",
|
|
46
|
+
"STATUS_PROJECT_UNKNOWN",
|
|
47
|
+
]
|
|
48
|
+
):
|
|
49
|
+
raise ValueError(
|
|
50
|
+
"must be one of enum values ('STATUS_UNSPECIFIED', 'STATUS_READY', 'STATUS_FAILED', 'STATUS_UPDATING', 'STATUS_DELETING', 'STATUS_DISABLED', 'STATUS_PROJECT_UNKNOWN')"
|
|
51
|
+
)
|
|
52
|
+
return value
|
|
53
|
+
|
|
54
|
+
model_config = ConfigDict(
|
|
55
|
+
populate_by_name=True,
|
|
56
|
+
validate_assignment=True,
|
|
57
|
+
protected_namespaces=(),
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
def to_str(self) -> str:
|
|
61
|
+
"""Returns the string representation of the model using alias"""
|
|
62
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
63
|
+
|
|
64
|
+
def to_json(self) -> str:
|
|
65
|
+
"""Returns the JSON representation of the model using alias"""
|
|
66
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
67
|
+
return json.dumps(self.to_dict())
|
|
68
|
+
|
|
69
|
+
@classmethod
|
|
70
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
71
|
+
"""Create an instance of GetServiceStatusResponse from a JSON string"""
|
|
72
|
+
return cls.from_dict(json.loads(json_str))
|
|
73
|
+
|
|
74
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
75
|
+
"""Return the dictionary representation of the model using alias.
|
|
76
|
+
|
|
77
|
+
This has the following differences from calling pydantic's
|
|
78
|
+
`self.model_dump(by_alias=True)`:
|
|
79
|
+
|
|
80
|
+
* `None` is only added to the output dict for nullable fields that
|
|
81
|
+
were set at model initialization. Other fields with value `None`
|
|
82
|
+
are ignored.
|
|
83
|
+
"""
|
|
84
|
+
excluded_fields: Set[str] = set([])
|
|
85
|
+
|
|
86
|
+
_dict = self.model_dump(
|
|
87
|
+
by_alias=True,
|
|
88
|
+
exclude=excluded_fields,
|
|
89
|
+
exclude_none=True,
|
|
90
|
+
)
|
|
91
|
+
return _dict
|
|
92
|
+
|
|
93
|
+
@classmethod
|
|
94
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
95
|
+
"""Create an instance of GetServiceStatusResponse from a dict"""
|
|
96
|
+
if obj is None:
|
|
97
|
+
return None
|
|
98
|
+
|
|
99
|
+
if not isinstance(obj, dict):
|
|
100
|
+
return cls.model_validate(obj)
|
|
101
|
+
|
|
102
|
+
_obj = cls.model_validate({"status": obj.get("status")})
|
|
103
|
+
return _obj
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Load Balancer API
|
|
5
|
+
|
|
6
|
+
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 load balancer provided, two VMs are deployed in your OpenStack project subject to a fee.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.7.2
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501 docstring might be too long
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
import json
|
|
17
|
+
import pprint
|
|
18
|
+
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
21
|
+
from typing_extensions import Self
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class GoogleProtobufAny(BaseModel):
|
|
25
|
+
"""
|
|
26
|
+
Contains an arbitrary serialized message along with a @type that describes the type of the serialized message.
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
type: Optional[StrictStr] = Field(default=None, description="The type of the serialized message.", alias="@type")
|
|
30
|
+
additional_properties: Dict[str, Any] = {}
|
|
31
|
+
__properties: ClassVar[List[str]] = ["@type"]
|
|
32
|
+
|
|
33
|
+
model_config = ConfigDict(
|
|
34
|
+
populate_by_name=True,
|
|
35
|
+
validate_assignment=True,
|
|
36
|
+
protected_namespaces=(),
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
def to_str(self) -> str:
|
|
40
|
+
"""Returns the string representation of the model using alias"""
|
|
41
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
42
|
+
|
|
43
|
+
def to_json(self) -> str:
|
|
44
|
+
"""Returns the JSON representation of the model using alias"""
|
|
45
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
46
|
+
return json.dumps(self.to_dict())
|
|
47
|
+
|
|
48
|
+
@classmethod
|
|
49
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
50
|
+
"""Create an instance of GoogleProtobufAny from a JSON string"""
|
|
51
|
+
return cls.from_dict(json.loads(json_str))
|
|
52
|
+
|
|
53
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
54
|
+
"""Return the dictionary representation of the model using alias.
|
|
55
|
+
|
|
56
|
+
This has the following differences from calling pydantic's
|
|
57
|
+
`self.model_dump(by_alias=True)`:
|
|
58
|
+
|
|
59
|
+
* `None` is only added to the output dict for nullable fields that
|
|
60
|
+
were set at model initialization. Other fields with value `None`
|
|
61
|
+
are ignored.
|
|
62
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
|
63
|
+
"""
|
|
64
|
+
excluded_fields: Set[str] = set(
|
|
65
|
+
[
|
|
66
|
+
"additional_properties",
|
|
67
|
+
]
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
_dict = self.model_dump(
|
|
71
|
+
by_alias=True,
|
|
72
|
+
exclude=excluded_fields,
|
|
73
|
+
exclude_none=True,
|
|
74
|
+
)
|
|
75
|
+
# puts key-value pairs in additional_properties in the top level
|
|
76
|
+
if self.additional_properties is not None:
|
|
77
|
+
for _key, _value in self.additional_properties.items():
|
|
78
|
+
_dict[_key] = _value
|
|
79
|
+
|
|
80
|
+
return _dict
|
|
81
|
+
|
|
82
|
+
@classmethod
|
|
83
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
84
|
+
"""Create an instance of GoogleProtobufAny from a dict"""
|
|
85
|
+
if obj is None:
|
|
86
|
+
return None
|
|
87
|
+
|
|
88
|
+
if not isinstance(obj, dict):
|
|
89
|
+
return cls.model_validate(obj)
|
|
90
|
+
|
|
91
|
+
_obj = cls.model_validate({"@type": obj.get("@type")})
|
|
92
|
+
# store additional fields in additional_properties
|
|
93
|
+
for _key in obj.keys():
|
|
94
|
+
if _key not in cls.__properties:
|
|
95
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
|
96
|
+
|
|
97
|
+
return _obj
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Load Balancer API
|
|
5
|
+
|
|
6
|
+
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 load balancer provided, two VMs are deployed in your OpenStack project subject to a fee.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.7.2
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501 docstring might be too long
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
import json
|
|
17
|
+
import pprint
|
|
18
|
+
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict
|
|
21
|
+
from typing_extensions import Self
|
|
22
|
+
|
|
23
|
+
from stackit.loadbalancer.models.credentials_response import CredentialsResponse
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class ListCredentialsResponse(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
ListCredentialsResponse
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
credentials: Optional[List[CredentialsResponse]] = None
|
|
32
|
+
__properties: ClassVar[List[str]] = ["credentials"]
|
|
33
|
+
|
|
34
|
+
model_config = ConfigDict(
|
|
35
|
+
populate_by_name=True,
|
|
36
|
+
validate_assignment=True,
|
|
37
|
+
protected_namespaces=(),
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
def to_str(self) -> str:
|
|
41
|
+
"""Returns the string representation of the model using alias"""
|
|
42
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
43
|
+
|
|
44
|
+
def to_json(self) -> str:
|
|
45
|
+
"""Returns the JSON representation of the model using alias"""
|
|
46
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
47
|
+
return json.dumps(self.to_dict())
|
|
48
|
+
|
|
49
|
+
@classmethod
|
|
50
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
51
|
+
"""Create an instance of ListCredentialsResponse from a JSON string"""
|
|
52
|
+
return cls.from_dict(json.loads(json_str))
|
|
53
|
+
|
|
54
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
55
|
+
"""Return the dictionary representation of the model using alias.
|
|
56
|
+
|
|
57
|
+
This has the following differences from calling pydantic's
|
|
58
|
+
`self.model_dump(by_alias=True)`:
|
|
59
|
+
|
|
60
|
+
* `None` is only added to the output dict for nullable fields that
|
|
61
|
+
were set at model initialization. Other fields with value `None`
|
|
62
|
+
are ignored.
|
|
63
|
+
"""
|
|
64
|
+
excluded_fields: Set[str] = set([])
|
|
65
|
+
|
|
66
|
+
_dict = self.model_dump(
|
|
67
|
+
by_alias=True,
|
|
68
|
+
exclude=excluded_fields,
|
|
69
|
+
exclude_none=True,
|
|
70
|
+
)
|
|
71
|
+
# override the default output from pydantic by calling `to_dict()` of each item in credentials (list)
|
|
72
|
+
_items = []
|
|
73
|
+
if self.credentials:
|
|
74
|
+
for _item in self.credentials:
|
|
75
|
+
if _item:
|
|
76
|
+
_items.append(_item.to_dict())
|
|
77
|
+
_dict["credentials"] = _items
|
|
78
|
+
return _dict
|
|
79
|
+
|
|
80
|
+
@classmethod
|
|
81
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
82
|
+
"""Create an instance of ListCredentialsResponse from a dict"""
|
|
83
|
+
if obj is None:
|
|
84
|
+
return None
|
|
85
|
+
|
|
86
|
+
if not isinstance(obj, dict):
|
|
87
|
+
return cls.model_validate(obj)
|
|
88
|
+
|
|
89
|
+
_obj = cls.model_validate(
|
|
90
|
+
{
|
|
91
|
+
"credentials": (
|
|
92
|
+
[CredentialsResponse.from_dict(_item) for _item in obj["credentials"]]
|
|
93
|
+
if obj.get("credentials") is not None
|
|
94
|
+
else None
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
)
|
|
98
|
+
return _obj
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Load Balancer API
|
|
5
|
+
|
|
6
|
+
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 load balancer provided, two VMs are deployed in your OpenStack project subject to a fee.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.7.2
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501 docstring might be too long
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
import json
|
|
17
|
+
import pprint
|
|
18
|
+
import re
|
|
19
|
+
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, field_validator
|
|
22
|
+
from typing_extensions import Annotated, Self
|
|
23
|
+
|
|
24
|
+
from stackit.loadbalancer.models.load_balancer import LoadBalancer
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class ListLoadBalancersResponse(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
ListLoadBalancersResponse
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
load_balancers: Optional[List[LoadBalancer]] = Field(default=None, alias="loadBalancers")
|
|
33
|
+
next_page_id: Optional[Annotated[str, Field(strict=True)]] = Field(
|
|
34
|
+
default=None,
|
|
35
|
+
description="Continue token from the ListLoadBalancerResponse with Limit option",
|
|
36
|
+
alias="nextPageId",
|
|
37
|
+
)
|
|
38
|
+
__properties: ClassVar[List[str]] = ["loadBalancers", "nextPageId"]
|
|
39
|
+
|
|
40
|
+
@field_validator("next_page_id")
|
|
41
|
+
def next_page_id_validate_regular_expression(cls, value):
|
|
42
|
+
"""Validates the regular expression"""
|
|
43
|
+
if value is None:
|
|
44
|
+
return value
|
|
45
|
+
|
|
46
|
+
if not re.match(r"^[0-9a-z](?:(?:[0-9a-z]|-){0,61}[0-9a-z])?$", value):
|
|
47
|
+
raise ValueError(r"must validate the regular expression /^[0-9a-z](?:(?:[0-9a-z]|-){0,61}[0-9a-z])?$/")
|
|
48
|
+
return value
|
|
49
|
+
|
|
50
|
+
model_config = ConfigDict(
|
|
51
|
+
populate_by_name=True,
|
|
52
|
+
validate_assignment=True,
|
|
53
|
+
protected_namespaces=(),
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
def to_str(self) -> str:
|
|
57
|
+
"""Returns the string representation of the model using alias"""
|
|
58
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
59
|
+
|
|
60
|
+
def to_json(self) -> str:
|
|
61
|
+
"""Returns the JSON representation of the model using alias"""
|
|
62
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
63
|
+
return json.dumps(self.to_dict())
|
|
64
|
+
|
|
65
|
+
@classmethod
|
|
66
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
67
|
+
"""Create an instance of ListLoadBalancersResponse from a JSON string"""
|
|
68
|
+
return cls.from_dict(json.loads(json_str))
|
|
69
|
+
|
|
70
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
71
|
+
"""Return the dictionary representation of the model using alias.
|
|
72
|
+
|
|
73
|
+
This has the following differences from calling pydantic's
|
|
74
|
+
`self.model_dump(by_alias=True)`:
|
|
75
|
+
|
|
76
|
+
* `None` is only added to the output dict for nullable fields that
|
|
77
|
+
were set at model initialization. Other fields with value `None`
|
|
78
|
+
are ignored.
|
|
79
|
+
"""
|
|
80
|
+
excluded_fields: Set[str] = set([])
|
|
81
|
+
|
|
82
|
+
_dict = self.model_dump(
|
|
83
|
+
by_alias=True,
|
|
84
|
+
exclude=excluded_fields,
|
|
85
|
+
exclude_none=True,
|
|
86
|
+
)
|
|
87
|
+
# override the default output from pydantic by calling `to_dict()` of each item in load_balancers (list)
|
|
88
|
+
_items = []
|
|
89
|
+
if self.load_balancers:
|
|
90
|
+
for _item in self.load_balancers:
|
|
91
|
+
if _item:
|
|
92
|
+
_items.append(_item.to_dict())
|
|
93
|
+
_dict["loadBalancers"] = _items
|
|
94
|
+
return _dict
|
|
95
|
+
|
|
96
|
+
@classmethod
|
|
97
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
98
|
+
"""Create an instance of ListLoadBalancersResponse from a dict"""
|
|
99
|
+
if obj is None:
|
|
100
|
+
return None
|
|
101
|
+
|
|
102
|
+
if not isinstance(obj, dict):
|
|
103
|
+
return cls.model_validate(obj)
|
|
104
|
+
|
|
105
|
+
_obj = cls.model_validate(
|
|
106
|
+
{
|
|
107
|
+
"loadBalancers": (
|
|
108
|
+
[LoadBalancer.from_dict(_item) for _item in obj["loadBalancers"]]
|
|
109
|
+
if obj.get("loadBalancers") is not None
|
|
110
|
+
else None
|
|
111
|
+
),
|
|
112
|
+
"nextPageId": obj.get("nextPageId"),
|
|
113
|
+
}
|
|
114
|
+
)
|
|
115
|
+
return _obj
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Load Balancer API
|
|
5
|
+
|
|
6
|
+
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 load balancer provided, two VMs are deployed in your OpenStack project subject to a fee.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.7.2
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501 docstring might be too long
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
import json
|
|
17
|
+
import pprint
|
|
18
|
+
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
21
|
+
from typing_extensions import Self
|
|
22
|
+
|
|
23
|
+
from stackit.loadbalancer.models.plan_details import PlanDetails
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class ListPlansResponse(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
ListPlansResponse
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
valid_plans: Optional[List[PlanDetails]] = Field(default=None, alias="validPlans")
|
|
32
|
+
__properties: ClassVar[List[str]] = ["validPlans"]
|
|
33
|
+
|
|
34
|
+
model_config = ConfigDict(
|
|
35
|
+
populate_by_name=True,
|
|
36
|
+
validate_assignment=True,
|
|
37
|
+
protected_namespaces=(),
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
def to_str(self) -> str:
|
|
41
|
+
"""Returns the string representation of the model using alias"""
|
|
42
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
43
|
+
|
|
44
|
+
def to_json(self) -> str:
|
|
45
|
+
"""Returns the JSON representation of the model using alias"""
|
|
46
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
47
|
+
return json.dumps(self.to_dict())
|
|
48
|
+
|
|
49
|
+
@classmethod
|
|
50
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
51
|
+
"""Create an instance of ListPlansResponse from a JSON string"""
|
|
52
|
+
return cls.from_dict(json.loads(json_str))
|
|
53
|
+
|
|
54
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
55
|
+
"""Return the dictionary representation of the model using alias.
|
|
56
|
+
|
|
57
|
+
This has the following differences from calling pydantic's
|
|
58
|
+
`self.model_dump(by_alias=True)`:
|
|
59
|
+
|
|
60
|
+
* `None` is only added to the output dict for nullable fields that
|
|
61
|
+
were set at model initialization. Other fields with value `None`
|
|
62
|
+
are ignored.
|
|
63
|
+
"""
|
|
64
|
+
excluded_fields: Set[str] = set([])
|
|
65
|
+
|
|
66
|
+
_dict = self.model_dump(
|
|
67
|
+
by_alias=True,
|
|
68
|
+
exclude=excluded_fields,
|
|
69
|
+
exclude_none=True,
|
|
70
|
+
)
|
|
71
|
+
# override the default output from pydantic by calling `to_dict()` of each item in valid_plans (list)
|
|
72
|
+
_items = []
|
|
73
|
+
if self.valid_plans:
|
|
74
|
+
for _item in self.valid_plans:
|
|
75
|
+
if _item:
|
|
76
|
+
_items.append(_item.to_dict())
|
|
77
|
+
_dict["validPlans"] = _items
|
|
78
|
+
return _dict
|
|
79
|
+
|
|
80
|
+
@classmethod
|
|
81
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
82
|
+
"""Create an instance of ListPlansResponse from a dict"""
|
|
83
|
+
if obj is None:
|
|
84
|
+
return None
|
|
85
|
+
|
|
86
|
+
if not isinstance(obj, dict):
|
|
87
|
+
return cls.model_validate(obj)
|
|
88
|
+
|
|
89
|
+
_obj = cls.model_validate(
|
|
90
|
+
{
|
|
91
|
+
"validPlans": (
|
|
92
|
+
[PlanDetails.from_dict(_item) for _item in obj["validPlans"]]
|
|
93
|
+
if obj.get("validPlans") is not None
|
|
94
|
+
else None
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
)
|
|
98
|
+
return _obj
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Load Balancer API
|
|
5
|
+
|
|
6
|
+
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 load balancer provided, two VMs are deployed in your OpenStack project subject to a fee.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.7.2
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501 docstring might be too long
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
import json
|
|
17
|
+
import pprint
|
|
18
|
+
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
21
|
+
from typing_extensions import Annotated, Self
|
|
22
|
+
|
|
23
|
+
from stackit.loadbalancer.models.options_tcp import OptionsTCP
|
|
24
|
+
from stackit.loadbalancer.models.options_udp import OptionsUDP
|
|
25
|
+
from stackit.loadbalancer.models.server_name_indicator import ServerNameIndicator
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class Listener(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
Listener
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
display_name: Optional[StrictStr] = Field(default=None, alias="displayName")
|
|
34
|
+
name: Optional[StrictStr] = Field(
|
|
35
|
+
default=None,
|
|
36
|
+
description="Will be used to reference a listener and will replace display name in the future. Currently uses <protocol>-<port> as the name if no display name is given.",
|
|
37
|
+
)
|
|
38
|
+
port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1)]] = Field(
|
|
39
|
+
default=None, description="Port number where we listen for traffic"
|
|
40
|
+
)
|
|
41
|
+
protocol: Optional[StrictStr] = Field(
|
|
42
|
+
default=None,
|
|
43
|
+
description="Protocol is the highest network protocol we understand to load balance. Currently only PROTOCOL_TCP, PROTOCOL_TCP_PROXY and PROTOCOL_TLS_PASSTHROUGH are supported.",
|
|
44
|
+
)
|
|
45
|
+
server_name_indicators: Optional[List[ServerNameIndicator]] = Field(
|
|
46
|
+
default=None,
|
|
47
|
+
description="Server Name Idicators config for domains to be routed to the desired target pool for this listener.",
|
|
48
|
+
alias="serverNameIndicators",
|
|
49
|
+
)
|
|
50
|
+
target_pool: Optional[StrictStr] = Field(
|
|
51
|
+
default=None, description="Reference target pool by target pool name.", alias="targetPool"
|
|
52
|
+
)
|
|
53
|
+
tcp: Optional[OptionsTCP] = None
|
|
54
|
+
udp: Optional[OptionsUDP] = None
|
|
55
|
+
__properties: ClassVar[List[str]] = [
|
|
56
|
+
"displayName",
|
|
57
|
+
"name",
|
|
58
|
+
"port",
|
|
59
|
+
"protocol",
|
|
60
|
+
"serverNameIndicators",
|
|
61
|
+
"targetPool",
|
|
62
|
+
"tcp",
|
|
63
|
+
"udp",
|
|
64
|
+
]
|
|
65
|
+
|
|
66
|
+
@field_validator("protocol")
|
|
67
|
+
def protocol_validate_enum(cls, value):
|
|
68
|
+
"""Validates the enum"""
|
|
69
|
+
if value is None:
|
|
70
|
+
return value
|
|
71
|
+
|
|
72
|
+
if value not in set(
|
|
73
|
+
["PROTOCOL_UNSPECIFIED", "PROTOCOL_TCP", "PROTOCOL_UDP", "PROTOCOL_TCP_PROXY", "PROTOCOL_TLS_PASSTHROUGH"]
|
|
74
|
+
):
|
|
75
|
+
raise ValueError(
|
|
76
|
+
"must be one of enum values ('PROTOCOL_UNSPECIFIED', 'PROTOCOL_TCP', 'PROTOCOL_UDP', 'PROTOCOL_TCP_PROXY', 'PROTOCOL_TLS_PASSTHROUGH')"
|
|
77
|
+
)
|
|
78
|
+
return value
|
|
79
|
+
|
|
80
|
+
model_config = ConfigDict(
|
|
81
|
+
populate_by_name=True,
|
|
82
|
+
validate_assignment=True,
|
|
83
|
+
protected_namespaces=(),
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
def to_str(self) -> str:
|
|
87
|
+
"""Returns the string representation of the model using alias"""
|
|
88
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
89
|
+
|
|
90
|
+
def to_json(self) -> str:
|
|
91
|
+
"""Returns the JSON representation of the model using alias"""
|
|
92
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
93
|
+
return json.dumps(self.to_dict())
|
|
94
|
+
|
|
95
|
+
@classmethod
|
|
96
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
97
|
+
"""Create an instance of Listener from a JSON string"""
|
|
98
|
+
return cls.from_dict(json.loads(json_str))
|
|
99
|
+
|
|
100
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
101
|
+
"""Return the dictionary representation of the model using alias.
|
|
102
|
+
|
|
103
|
+
This has the following differences from calling pydantic's
|
|
104
|
+
`self.model_dump(by_alias=True)`:
|
|
105
|
+
|
|
106
|
+
* `None` is only added to the output dict for nullable fields that
|
|
107
|
+
were set at model initialization. Other fields with value `None`
|
|
108
|
+
are ignored.
|
|
109
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
110
|
+
"""
|
|
111
|
+
excluded_fields: Set[str] = set(
|
|
112
|
+
[
|
|
113
|
+
"name",
|
|
114
|
+
]
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
_dict = self.model_dump(
|
|
118
|
+
by_alias=True,
|
|
119
|
+
exclude=excluded_fields,
|
|
120
|
+
exclude_none=True,
|
|
121
|
+
)
|
|
122
|
+
# override the default output from pydantic by calling `to_dict()` of each item in server_name_indicators (list)
|
|
123
|
+
_items = []
|
|
124
|
+
if self.server_name_indicators:
|
|
125
|
+
for _item in self.server_name_indicators:
|
|
126
|
+
if _item:
|
|
127
|
+
_items.append(_item.to_dict())
|
|
128
|
+
_dict["serverNameIndicators"] = _items
|
|
129
|
+
# override the default output from pydantic by calling `to_dict()` of tcp
|
|
130
|
+
if self.tcp:
|
|
131
|
+
_dict["tcp"] = self.tcp.to_dict()
|
|
132
|
+
# override the default output from pydantic by calling `to_dict()` of udp
|
|
133
|
+
if self.udp:
|
|
134
|
+
_dict["udp"] = self.udp.to_dict()
|
|
135
|
+
return _dict
|
|
136
|
+
|
|
137
|
+
@classmethod
|
|
138
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
139
|
+
"""Create an instance of Listener from a dict"""
|
|
140
|
+
if obj is None:
|
|
141
|
+
return None
|
|
142
|
+
|
|
143
|
+
if not isinstance(obj, dict):
|
|
144
|
+
return cls.model_validate(obj)
|
|
145
|
+
|
|
146
|
+
_obj = cls.model_validate(
|
|
147
|
+
{
|
|
148
|
+
"displayName": obj.get("displayName"),
|
|
149
|
+
"name": obj.get("name"),
|
|
150
|
+
"port": obj.get("port"),
|
|
151
|
+
"protocol": obj.get("protocol"),
|
|
152
|
+
"serverNameIndicators": (
|
|
153
|
+
[ServerNameIndicator.from_dict(_item) for _item in obj["serverNameIndicators"]]
|
|
154
|
+
if obj.get("serverNameIndicators") is not None
|
|
155
|
+
else None
|
|
156
|
+
),
|
|
157
|
+
"targetPool": obj.get("targetPool"),
|
|
158
|
+
"tcp": OptionsTCP.from_dict(obj["tcp"]) if obj.get("tcp") is not None else None,
|
|
159
|
+
"udp": OptionsUDP.from_dict(obj["udp"]) if obj.get("udp") is not None else None,
|
|
160
|
+
}
|
|
161
|
+
)
|
|
162
|
+
return _obj
|