diff --git a/lib/binarylane/models/create_load_balancer_request.py b/lib/binarylane/models/create_load_balancer_request.py index ec38aca..9aa32bb 100644 --- a/lib/binarylane/models/create_load_balancer_request.py +++ b/lib/binarylane/models/create_load_balancer_request.py @@ -4,8 +4,8 @@ import attr -from binarylane.models.forwarding_rule import ForwardingRule -from binarylane.models.health_check import HealthCheck +from binarylane.models.forwarding_rule_request import ForwardingRuleRequest +from binarylane.models.health_check_request import HealthCheckRequest from binarylane.types import UNSET, Unset T = TypeVar("T", bound="CreateLoadBalancerRequest") @@ -16,18 +16,18 @@ class CreateLoadBalancerRequest: """ Attributes: name (str): The hostname of the load balancer. - forwarding_rules (Union[Unset, None, List[ForwardingRule]]): The rules that control which traffic the load - balancer will forward to servers in the pool. Leave null to accept a default "HTTP" only forwarding rule. - health_check (Union[Unset, None, HealthCheck]): The rules that determine which servers are considered 'healthy' - and in the server pool for the load balancer. Leave this null to accept appropriate defaults based on the - forwarding_rules. + forwarding_rules (Union[Unset, None, List[ForwardingRuleRequest]]): The rules that control which traffic the + load balancer will forward to servers in the pool. Leave null to accept a default "HTTP" only forwarding rule. + health_check (Union[Unset, None, HealthCheckRequest]): The rules that determine which servers are considered + 'healthy' and in the server pool for the load balancer. Leave this null to accept appropriate defaults based on + the forwarding_rules. server_ids (Union[Unset, None, List[int]]): A list of server IDs to assign to this load balancer. region (Union[Unset, None, str]): Leave null to create an anycast load balancer. """ name: str - forwarding_rules: Union[Unset, None, List[ForwardingRule]] = UNSET - health_check: Union[Unset, None, HealthCheck] = UNSET + forwarding_rules: Union[Unset, None, List[ForwardingRuleRequest]] = UNSET + health_check: Union[Unset, None, HealthCheckRequest] = UNSET server_ids: Union[Unset, None, List[int]] = UNSET region: Union[Unset, None, str] = UNSET additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) @@ -84,18 +84,18 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: forwarding_rules = [] _forwarding_rules = d.pop("forwarding_rules", UNSET) for forwarding_rules_item_data in _forwarding_rules or []: - forwarding_rules_item = ForwardingRule.from_dict(forwarding_rules_item_data) + forwarding_rules_item = ForwardingRuleRequest.from_dict(forwarding_rules_item_data) forwarding_rules.append(forwarding_rules_item) _health_check = d.pop("health_check", UNSET) - health_check: Union[Unset, None, HealthCheck] + health_check: Union[Unset, None, HealthCheckRequest] if _health_check is None: health_check = None elif isinstance(_health_check, Unset): health_check = UNSET else: - health_check = HealthCheck.from_dict(_health_check) + health_check = HealthCheckRequest.from_dict(_health_check) server_ids = cast(List[int], d.pop("server_ids", UNSET)) diff --git a/lib/binarylane/models/domain.py b/lib/binarylane/models/domain.py index 40424ca..8ee73dc 100644 --- a/lib/binarylane/models/domain.py +++ b/lib/binarylane/models/domain.py @@ -17,7 +17,8 @@ class Domain: name (str): The name of the domain. current_nameservers (List[str]): The current authoritative name servers for this domain. zone_file (str): The zone file for the selected domain. If the DNS records for this domain are not managed - locally this is what the zone file would be if the authority was delegated to us. + locally this is what the zone file would be if the authority was delegated to us. The serial is will always be 0 + rather than the correct value. ttl (Union[Unset, None, int]): The time to live for records in this domain in seconds. If the DNS records for this domain are not managed locally this will be what the TTL would be if the authority was delegated to us. """ diff --git a/lib/binarylane/models/forwarding_rule_request.py b/lib/binarylane/models/forwarding_rule_request.py new file mode 100644 index 0000000..d9a2fe8 --- /dev/null +++ b/lib/binarylane/models/forwarding_rule_request.py @@ -0,0 +1,68 @@ +from __future__ import annotations + +from typing import Any, Dict, List, Type, TypeVar + +import attr + +from binarylane.models.load_balancer_rule_protocol import LoadBalancerRuleProtocol + +T = TypeVar("T", bound="ForwardingRuleRequest") + + +@attr.s(auto_attribs=True) +class ForwardingRuleRequest: + """ + Attributes: + entry_protocol (LoadBalancerRuleProtocol): The protocol that traffic must match for this load balancer to + forward traffic according to this rule. + + | Value | Description | + | ----- | ----------- | + | http | The load balancer will forward HTTP traffic that matches this rule. | + | https | The load balancer will forward HTTPS traffic that matches this rule. | + + """ + + entry_protocol: LoadBalancerRuleProtocol + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + entry_protocol = self.entry_protocol.value + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "entry_protocol": entry_protocol, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + entry_protocol = LoadBalancerRuleProtocol(d.pop("entry_protocol")) + + forwarding_rule_request = cls( + entry_protocol=entry_protocol, + ) + + forwarding_rule_request.additional_properties = d + return forwarding_rule_request + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/lib/binarylane/models/forwarding_rules_request.py b/lib/binarylane/models/forwarding_rules_request.py index 7a0c50a..25933c8 100644 --- a/lib/binarylane/models/forwarding_rules_request.py +++ b/lib/binarylane/models/forwarding_rules_request.py @@ -4,7 +4,7 @@ import attr -from binarylane.models.forwarding_rule import ForwardingRule +from binarylane.models.forwarding_rule_request import ForwardingRuleRequest T = TypeVar("T", bound="ForwardingRulesRequest") @@ -13,11 +13,11 @@ class ForwardingRulesRequest: """ Attributes: - forwarding_rules (List[ForwardingRule]): The rules that control which traffic the load balancer will forward to - servers in the pool. + forwarding_rules (List[ForwardingRuleRequest]): The rules that control which traffic the load balancer will + forward to servers in the pool. """ - forwarding_rules: List[ForwardingRule] + forwarding_rules: List[ForwardingRuleRequest] additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: @@ -43,7 +43,7 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: forwarding_rules = [] _forwarding_rules = d.pop("forwarding_rules") for forwarding_rules_item_data in _forwarding_rules: - forwarding_rules_item = ForwardingRule.from_dict(forwarding_rules_item_data) + forwarding_rules_item = ForwardingRuleRequest.from_dict(forwarding_rules_item_data) forwarding_rules.append(forwarding_rules_item) diff --git a/lib/binarylane/models/health_check.py b/lib/binarylane/models/health_check.py index ae3b988..836ea83 100644 --- a/lib/binarylane/models/health_check.py +++ b/lib/binarylane/models/health_check.py @@ -1,11 +1,10 @@ from __future__ import annotations -from typing import Any, Dict, List, Type, TypeVar, Union +from typing import Any, Dict, List, Type, TypeVar import attr from binarylane.models.health_check_protocol import HealthCheckProtocol -from binarylane.types import UNSET, Unset T = TypeVar("T", bound="HealthCheck") @@ -14,7 +13,7 @@ class HealthCheck: """ Attributes: - protocol (Union[Unset, None, HealthCheckProtocol]): Leave null to accept the default HTTP protocol. + protocol (HealthCheckProtocol): The protocol used for the health check. | Value | Description | | ----- | ----------- | @@ -23,43 +22,35 @@ class HealthCheck: | both | The health check will be performed via both HTTP and HTTPS. Failing a health check on one protocol will remove the server from the pool of servers only for that protocol. | - path (Union[Unset, None, str]): Leave null to accept the default '/' path. + path (str): The path to the health check endpoint. """ - protocol: Union[Unset, None, HealthCheckProtocol] = UNSET - path: Union[Unset, None, str] = UNSET + protocol: HealthCheckProtocol + path: str additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: - protocol: Union[Unset, None, str] = UNSET - if not isinstance(self.protocol, Unset): - protocol = self.protocol.value if self.protocol else None + protocol = self.protocol.value path = self.path field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) - field_dict.update({}) - if protocol is not UNSET: - field_dict["protocol"] = protocol - if path is not UNSET: - field_dict["path"] = path + field_dict.update( + { + "protocol": protocol, + "path": path, + } + ) return field_dict @classmethod def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: d = src_dict.copy() - _protocol = d.pop("protocol", UNSET) - protocol: Union[Unset, None, HealthCheckProtocol] - if _protocol is None: - protocol = None - elif isinstance(_protocol, Unset): - protocol = UNSET - else: - protocol = HealthCheckProtocol(_protocol) - - path = d.pop("path", UNSET) + protocol = HealthCheckProtocol(d.pop("protocol")) + + path = d.pop("path") health_check = cls( protocol=protocol, diff --git a/lib/binarylane/models/health_check_request.py b/lib/binarylane/models/health_check_request.py new file mode 100644 index 0000000..2be14b6 --- /dev/null +++ b/lib/binarylane/models/health_check_request.py @@ -0,0 +1,86 @@ +from __future__ import annotations + +from typing import Any, Dict, List, Type, TypeVar, Union + +import attr + +from binarylane.models.health_check_protocol import HealthCheckProtocol +from binarylane.types import UNSET, Unset + +T = TypeVar("T", bound="HealthCheckRequest") + + +@attr.s(auto_attribs=True) +class HealthCheckRequest: + """ + Attributes: + protocol (Union[Unset, None, HealthCheckProtocol]): Leave null to accept the default HTTP protocol. + + | Value | Description | + | ----- | ----------- | + | http | The health check will be performed via HTTP. | + | https | The health check will be performed via HTTPS. | + | both | The health check will be performed via both HTTP and HTTPS. Failing a health check on one protocol will + remove the server from the pool of servers only for that protocol. | + + path (Union[Unset, None, str]): Leave null to accept the default '/' path. + """ + + protocol: Union[Unset, None, HealthCheckProtocol] = UNSET + path: Union[Unset, None, str] = UNSET + additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + protocol: Union[Unset, None, str] = UNSET + if not isinstance(self.protocol, Unset): + protocol = self.protocol.value if self.protocol else None + + path = self.path + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if protocol is not UNSET: + field_dict["protocol"] = protocol + if path is not UNSET: + field_dict["path"] = path + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + _protocol = d.pop("protocol", UNSET) + protocol: Union[Unset, None, HealthCheckProtocol] + if _protocol is None: + protocol = None + elif isinstance(_protocol, Unset): + protocol = UNSET + else: + protocol = HealthCheckProtocol(_protocol) + + path = d.pop("path", UNSET) + + health_check_request = cls( + protocol=protocol, + path=path, + ) + + health_check_request.additional_properties = d + return health_check_request + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/lib/binarylane/models/licensed_software.py b/lib/binarylane/models/licensed_software.py index 8657e68..21f9a90 100644 --- a/lib/binarylane/models/licensed_software.py +++ b/lib/binarylane/models/licensed_software.py @@ -15,16 +15,23 @@ class LicensedSoftware: Attributes: software (Software): The currently licensed software. licence_count (int): The current licence count for the software. + incompatible (bool): Software that is incompatible with the server will be automatically removed at the next + plan change. + Servers may have incompatible software due to changes made by support. Software is not incompatible merely + because it is disabled; + disabled software may be retained by servers that already have it, incompatible software will be removed. """ software: Software licence_count: int + incompatible: bool additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) def to_dict(self) -> Dict[str, Any]: software = self.software.to_dict() licence_count = self.licence_count + incompatible = self.incompatible field_dict: Dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -32,6 +39,7 @@ def to_dict(self) -> Dict[str, Any]: { "software": software, "licence_count": licence_count, + "incompatible": incompatible, } ) @@ -44,9 +52,12 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: licence_count = d.pop("licence_count") + incompatible = d.pop("incompatible") + licensed_software = cls( software=software, licence_count=licence_count, + incompatible=incompatible, ) licensed_software.additional_properties = d diff --git a/lib/binarylane/models/load_balancer.py b/lib/binarylane/models/load_balancer.py index 9a5e788..c7e1689 100644 --- a/lib/binarylane/models/load_balancer.py +++ b/lib/binarylane/models/load_balancer.py @@ -22,7 +22,8 @@ class LoadBalancer: id (int): The ID of the load balancer. name (str): The hostname of the load balancer. ip (str): The IPv4 address of the load balancer. - status (LoadBalancerStatus): + status (LoadBalancerStatus): The current status of the load balancer. + | Value | Description | | ----- | ----------- | | new | The load balancer is currently being built and is not ready to accept connections. | diff --git a/lib/binarylane/models/resize.py b/lib/binarylane/models/resize.py index c2f97f8..a8fd0e6 100644 --- a/lib/binarylane/models/resize.py +++ b/lib/binarylane/models/resize.py @@ -29,7 +29,8 @@ class Resize: server. If this is provided the server disks will be destroyed and the server will be rebuilt from the selected image. change_licenses (Union[Unset, None, ChangeLicenses]): This may be left null to keep the current licenses for the - server. If this is provided any licenses that are not included will be removed. + server. If this is provided any licenses that are not included will be removed. Any licences that are invalid + will be removed regardless, see the documentation for `servers/{server_id}/software` for more information. pre_action_backup (Union[Unset, None, TakeBackup]): Specify this to create a backup before any actions are taken, or leave null to skip. """ diff --git a/lib/binarylane/models/update_load_balancer_request.py b/lib/binarylane/models/update_load_balancer_request.py index 8e68958..b78e9a8 100644 --- a/lib/binarylane/models/update_load_balancer_request.py +++ b/lib/binarylane/models/update_load_balancer_request.py @@ -4,8 +4,8 @@ import attr -from binarylane.models.forwarding_rule import ForwardingRule -from binarylane.models.health_check import HealthCheck +from binarylane.models.forwarding_rule_request import ForwardingRuleRequest +from binarylane.models.health_check_request import HealthCheckRequest from binarylane.types import UNSET, Unset T = TypeVar("T", bound="UpdateLoadBalancerRequest") @@ -16,17 +16,17 @@ class UpdateLoadBalancerRequest: """ Attributes: name (str): The hostname of the load balancer. - forwarding_rules (Union[Unset, None, List[ForwardingRule]]): The rules that control which traffic the load - balancer will forward to servers in the pool. Leave null to accept a default "HTTP" only forwarding rule. - health_check (Union[Unset, None, HealthCheck]): The rules that determine which servers are considered 'healthy' - and in the server pool for the load balancer. Leave this null to accept appropriate defaults based on the - forwarding_rules. + forwarding_rules (Union[Unset, None, List[ForwardingRuleRequest]]): The rules that control which traffic the + load balancer will forward to servers in the pool. Leave null to accept a default "HTTP" only forwarding rule. + health_check (Union[Unset, None, HealthCheckRequest]): The rules that determine which servers are considered + 'healthy' and in the server pool for the load balancer. Leave this null to accept appropriate defaults based on + the forwarding_rules. server_ids (Union[Unset, None, List[int]]): A list of server IDs to assign to this load balancer. """ name: str - forwarding_rules: Union[Unset, None, List[ForwardingRule]] = UNSET - health_check: Union[Unset, None, HealthCheck] = UNSET + forwarding_rules: Union[Unset, None, List[ForwardingRuleRequest]] = UNSET + health_check: Union[Unset, None, HealthCheckRequest] = UNSET server_ids: Union[Unset, None, List[int]] = UNSET additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict) @@ -78,18 +78,18 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: forwarding_rules = [] _forwarding_rules = d.pop("forwarding_rules", UNSET) for forwarding_rules_item_data in _forwarding_rules or []: - forwarding_rules_item = ForwardingRule.from_dict(forwarding_rules_item_data) + forwarding_rules_item = ForwardingRuleRequest.from_dict(forwarding_rules_item_data) forwarding_rules.append(forwarding_rules_item) _health_check = d.pop("health_check", UNSET) - health_check: Union[Unset, None, HealthCheck] + health_check: Union[Unset, None, HealthCheckRequest] if _health_check is None: health_check = None elif isinstance(_health_check, Unset): health_check = UNSET else: - health_check = HealthCheck.from_dict(_health_check) + health_check = HealthCheckRequest.from_dict(_health_check) server_ids = cast(List[int], d.pop("server_ids", UNSET)) diff --git a/src/binarylane/console/commands/api/delete_v2_load_balancers_load_balancer_id_forwarding_rules.py b/src/binarylane/console/commands/api/delete_v2_load_balancers_load_balancer_id_forwarding_rules.py index 478fd8e..0f02091 100644 --- a/src/binarylane/console/commands/api/delete_v2_load_balancers_load_balancer_id_forwarding_rules.py +++ b/src/binarylane/console/commands/api/delete_v2_load_balancers_load_balancer_id_forwarding_rules.py @@ -4,7 +4,7 @@ from typing import TYPE_CHECKING, Tuple, Union from binarylane.api.load_balancers.delete_v2_load_balancers_load_balancer_id_forwarding_rules import sync_detailed -from binarylane.models.forwarding_rule import ForwardingRule +from binarylane.models.forwarding_rule_request import ForwardingRuleRequest from binarylane.models.forwarding_rules_request import ForwardingRulesRequest from binarylane.models.load_balancer_rule_protocol import LoadBalancerRuleProtocol from binarylane.models.problem_details import ProblemDetails @@ -52,17 +52,17 @@ def lookup_load_balancer_id(ref: str) -> Union[None, int]: json_body = mapping.add_json_body(ForwardingRulesRequest) - json_body_forwarding_rule = json_body.add( + json_body_forwarding_rule_request = json_body.add( ListAttribute( "forwarding_rules", - ForwardingRule, + ForwardingRuleRequest, required=True, option_name="forwarding-rules", description="""The rules that control which traffic the load balancer will forward to servers in the pool.""", ) ) - json_body_forwarding_rule.add( + json_body_forwarding_rule_request.add( PrimitiveAttribute( "entry_protocol", LoadBalancerRuleProtocol, diff --git a/src/binarylane/console/commands/api/get_v2_domains.py b/src/binarylane/console/commands/api/get_v2_domains.py index 2a97dbd..5ae444b 100644 --- a/src/binarylane/console/commands/api/get_v2_domains.py +++ b/src/binarylane/console/commands/api/get_v2_domains.py @@ -41,7 +41,7 @@ def fields(self) -> Dict[str, str]: "id": """The ID of this domain.""", "name": """The name of the domain.""", "current_nameservers": """The current authoritative name servers for this domain.""", - "zone_file": """The zone file for the selected domain. If the DNS records for this domain are not managed locally this is what the zone file would be if the authority was delegated to us.""", + "zone_file": """The zone file for the selected domain. If the DNS records for this domain are not managed locally this is what the zone file would be if the authority was delegated to us. The serial is will always be 0 rather than the correct value.""", "ttl": """The time to live for records in this domain in seconds. If the DNS records for this domain are not managed locally this will be what the TTL would be if the authority was delegated to us.""", } diff --git a/src/binarylane/console/commands/api/get_v2_load_balancers.py b/src/binarylane/console/commands/api/get_v2_load_balancers.py index 54ded70..ed10a9c 100644 --- a/src/binarylane/console/commands/api/get_v2_load_balancers.py +++ b/src/binarylane/console/commands/api/get_v2_load_balancers.py @@ -41,7 +41,8 @@ def fields(self) -> Dict[str, str]: "id": """The ID of the load balancer.""", "name": """The hostname of the load balancer.""", "ip": """The IPv4 address of the load balancer.""", - "status": """ + "status": """The current status of the load balancer. + | Value | Description | | ----- | ----------- | | new | The load balancer is currently being built and is not ready to accept connections. | diff --git a/src/binarylane/console/commands/api/get_v2_servers_server_id_software.py b/src/binarylane/console/commands/api/get_v2_servers_server_id_software.py index cfaf7c1..f1520e8 100644 --- a/src/binarylane/console/commands/api/get_v2_servers_server_id_software.py +++ b/src/binarylane/console/commands/api/get_v2_servers_server_id_software.py @@ -34,6 +34,7 @@ def response(self, status_code: int, received: Any) -> None: def default_format(self) -> List[str]: return [ "licence_count", + "incompatible", ] @property @@ -41,6 +42,9 @@ def fields(self) -> Dict[str, str]: return { "software": """The currently licensed software.""", "licence_count": """The current licence count for the software.""", + "incompatible": """Software that is incompatible with the server will be automatically removed at the next plan change. +Servers may have incompatible software due to changes made by support. Software is not incompatible merely because it is disabled; +disabled software may be retained by servers that already have it, incompatible software will be removed.""", } @property diff --git a/src/binarylane/console/commands/api/post_v2_load_balancers.py b/src/binarylane/console/commands/api/post_v2_load_balancers.py index 63a535b..3d88194 100644 --- a/src/binarylane/console/commands/api/post_v2_load_balancers.py +++ b/src/binarylane/console/commands/api/post_v2_load_balancers.py @@ -6,9 +6,9 @@ from binarylane.api.load_balancers.post_v2_load_balancers import sync_detailed from binarylane.models.create_load_balancer_request import CreateLoadBalancerRequest from binarylane.models.create_load_balancer_response import CreateLoadBalancerResponse -from binarylane.models.forwarding_rule import ForwardingRule -from binarylane.models.health_check import HealthCheck +from binarylane.models.forwarding_rule_request import ForwardingRuleRequest from binarylane.models.health_check_protocol import HealthCheckProtocol +from binarylane.models.health_check_request import HealthCheckRequest from binarylane.models.load_balancer_rule_protocol import LoadBalancerRuleProtocol from binarylane.models.validation_problem_details import ValidationProblemDetails from binarylane.types import Unset @@ -48,17 +48,17 @@ def create_mapping(self) -> Mapping: ) ) - json_body_forwarding_rule = json_body.add( + json_body_forwarding_rule_request = json_body.add( ListAttribute( "forwarding_rules", - ForwardingRule, + ForwardingRuleRequest, required=False, option_name="forwarding-rules", description="""The rules that control which traffic the load balancer will forward to servers in the pool. Leave null to accept a default "HTTP" only forwarding rule.""", ) ) - json_body_forwarding_rule.add( + json_body_forwarding_rule_request.add( PrimitiveAttribute( "entry_protocol", LoadBalancerRuleProtocol, @@ -75,17 +75,17 @@ def create_mapping(self) -> Mapping: ) ) - json_body_health_check = json_body.add( + json_body_health_check_request = json_body.add( ObjectAttribute( "health_check", - HealthCheck, + HealthCheckRequest, option_name="health-check", required=False, description="""The rules that determine which servers are considered 'healthy' and in the server pool for the load balancer. Leave this null to accept appropriate defaults based on the forwarding_rules.""", ) ) - json_body_health_check.add( + json_body_health_check_request.add( PrimitiveAttribute( "protocol", Union[Unset, None, HealthCheckProtocol], @@ -103,7 +103,7 @@ def create_mapping(self) -> Mapping: ) ) - json_body_health_check.add( + json_body_health_check_request.add( PrimitiveAttribute( "path", Union[Unset, None, str], diff --git a/src/binarylane/console/commands/api/post_v2_load_balancers_load_balancer_id_forwarding_rules.py b/src/binarylane/console/commands/api/post_v2_load_balancers_load_balancer_id_forwarding_rules.py index 11623a6..ae41646 100644 --- a/src/binarylane/console/commands/api/post_v2_load_balancers_load_balancer_id_forwarding_rules.py +++ b/src/binarylane/console/commands/api/post_v2_load_balancers_load_balancer_id_forwarding_rules.py @@ -4,7 +4,7 @@ from typing import TYPE_CHECKING, Tuple, Union from binarylane.api.load_balancers.post_v2_load_balancers_load_balancer_id_forwarding_rules import sync_detailed -from binarylane.models.forwarding_rule import ForwardingRule +from binarylane.models.forwarding_rule_request import ForwardingRuleRequest from binarylane.models.forwarding_rules_request import ForwardingRulesRequest from binarylane.models.load_balancer_rule_protocol import LoadBalancerRuleProtocol from binarylane.models.problem_details import ProblemDetails @@ -52,17 +52,17 @@ def lookup_load_balancer_id(ref: str) -> Union[None, int]: json_body = mapping.add_json_body(ForwardingRulesRequest) - json_body_forwarding_rule = json_body.add( + json_body_forwarding_rule_request = json_body.add( ListAttribute( "forwarding_rules", - ForwardingRule, + ForwardingRuleRequest, required=True, option_name="forwarding-rules", description="""The rules that control which traffic the load balancer will forward to servers in the pool.""", ) ) - json_body_forwarding_rule.add( + json_body_forwarding_rule_request.add( PrimitiveAttribute( "entry_protocol", LoadBalancerRuleProtocol, diff --git a/src/binarylane/console/commands/api/post_v_2_servers_server_id_actions_resize.py b/src/binarylane/console/commands/api/post_v_2_servers_server_id_actions_resize.py index bd95502..30b57bc 100644 --- a/src/binarylane/console/commands/api/post_v_2_servers_server_id_actions_resize.py +++ b/src/binarylane/console/commands/api/post_v_2_servers_server_id_actions_resize.py @@ -282,7 +282,7 @@ def lookup_server_id(ref: str) -> Union[None, int]: ChangeLicenses, option_name="change-licenses", required=False, - description="""This may be left null to keep the current licenses for the server. If this is provided any licenses that are not included will be removed.""", + description="""This may be left null to keep the current licenses for the server. If this is provided any licenses that are not included will be removed. Any licences that are invalid will be removed regardless, see the documentation for `servers/{server_id}/software` for more information.""", ) ) diff --git a/src/binarylane/console/commands/api/put_v2_load_balancers_load_balancer_id.py b/src/binarylane/console/commands/api/put_v2_load_balancers_load_balancer_id.py index 8bca7d9..0804410 100644 --- a/src/binarylane/console/commands/api/put_v2_load_balancers_load_balancer_id.py +++ b/src/binarylane/console/commands/api/put_v2_load_balancers_load_balancer_id.py @@ -4,9 +4,9 @@ from typing import TYPE_CHECKING, List, Tuple, Union from binarylane.api.load_balancers.put_v2_load_balancers_load_balancer_id import sync_detailed -from binarylane.models.forwarding_rule import ForwardingRule -from binarylane.models.health_check import HealthCheck +from binarylane.models.forwarding_rule_request import ForwardingRuleRequest from binarylane.models.health_check_protocol import HealthCheckProtocol +from binarylane.models.health_check_request import HealthCheckRequest from binarylane.models.load_balancer_rule_protocol import LoadBalancerRuleProtocol from binarylane.models.problem_details import ProblemDetails from binarylane.models.update_load_balancer_request import UpdateLoadBalancerRequest @@ -67,17 +67,17 @@ def lookup_load_balancer_id(ref: str) -> Union[None, int]: ) ) - json_body_forwarding_rule = json_body.add( + json_body_forwarding_rule_request = json_body.add( ListAttribute( "forwarding_rules", - ForwardingRule, + ForwardingRuleRequest, required=False, option_name="forwarding-rules", description="""The rules that control which traffic the load balancer will forward to servers in the pool. Leave null to accept a default "HTTP" only forwarding rule.""", ) ) - json_body_forwarding_rule.add( + json_body_forwarding_rule_request.add( PrimitiveAttribute( "entry_protocol", LoadBalancerRuleProtocol, @@ -94,17 +94,17 @@ def lookup_load_balancer_id(ref: str) -> Union[None, int]: ) ) - json_body_health_check = json_body.add( + json_body_health_check_request = json_body.add( ObjectAttribute( "health_check", - HealthCheck, + HealthCheckRequest, option_name="health-check", required=False, description="""The rules that determine which servers are considered 'healthy' and in the server pool for the load balancer. Leave this null to accept appropriate defaults based on the forwarding_rules.""", ) ) - json_body_health_check.add( + json_body_health_check_request.add( PrimitiveAttribute( "protocol", Union[Unset, None, HealthCheckProtocol], @@ -122,7 +122,7 @@ def lookup_load_balancer_id(ref: str) -> Union[None, int]: ) ) - json_body_health_check.add( + json_body_health_check_request.add( PrimitiveAttribute( "path", Union[Unset, None, str], diff --git a/templates/endpoint_module/request.jinja b/templates/endpoint_module/request.jinja index 5c81113..f930fda 100644 --- a/templates/endpoint_module/request.jinja +++ b/templates/endpoint_module/request.jinja @@ -22,7 +22,7 @@ assert isinstance(request, CommandRequest) {% for response_type in endpoint.responses %} - # {{ response_type.status_code }}: {{ response_type.prop.get_type_string() }} + # {{ response_type.status_code.__class__.__name__ }}.{{ response_type.status_code.name }}: {{ response_type.prop.get_type_string() }} {% endfor %} {% if paginated %} page = 0