From 80ee9528d3359a1657c111bf4b193862003b153f Mon Sep 17 00:00:00 2001 From: Tejashree-RS Date: Mon, 13 Jul 2026 15:41:41 +0530 Subject: [PATCH] Updated DHCP Configuration models in UPAM --- src/ipam/docs/DHCPConfig.md | 3 ++ src/ipam/docs/InheritedDHCPConfig.md | 3 ++ src/ipam/models/dhcp_config.py | 24 +++++++++++++-- src/ipam/models/inherited_dhcp_config.py | 38 +++++++++++++++++++++++- 4 files changed, 64 insertions(+), 4 deletions(-) diff --git a/src/ipam/docs/DHCPConfig.md b/src/ipam/docs/DHCPConfig.md index c21e6c3..f903c7d 100644 --- a/src/ipam/docs/DHCPConfig.md +++ b/src/ipam/docs/DHCPConfig.md @@ -10,10 +10,13 @@ Name | Type | Description | Notes **abandoned_reclaim_time_v6** | **int** | The abandoned reclaim time in seconds for IPV6 clients. | [optional] [default to 3600] **allow_unknown** | **bool** | Disable to allow leases only for known IPv4 clients, those for which a fixed address is configured. | [optional] [default to True] **allow_unknown_v6** | **bool** | Disable to allow leases only for known IPV6 clients, those for which a fixed address is configured. | [optional] [default to True] +**authoritative_dhcp** | **bool** | Set DHCP server as authoritative. | [optional] [default to False] **echo_client_id** | **bool** | Enable/disable to include/exclude the client id when responding to discover or request. | [optional] [default to False] **filters** | **List[str]** | The resource identifier. | [optional] **filters_large_selection** | **List[str]** | The resource identifier. | [optional] **filters_v6** | **List[str]** | The resource identifier. | [optional] +**hold_reclaimed_time** | **int** | The hold reclaimed time in seconds for IPv4 clients. | [optional] [default to 3600] +**hold_reclaimed_time_v6** | **int** | The hold reclaimed time in seconds for IPv6 clients. | [optional] [default to 3600] **ignore_client_uid** | **bool** | Enable to ignore the client UID when issuing a DHCP lease. Use this option to prevent assigning two IP addresses for a client which does not have a UID during one phase of PXE boot but acquires one for the other phase. | [optional] [default to False] **ignore_list** | [**List[IgnoreItem]**](IgnoreItem.md) | The list of clients to ignore requests from. | [optional] **lease_time** | **int** | The lease duration in seconds. | [optional] [default to 3600] diff --git a/src/ipam/docs/InheritedDHCPConfig.md b/src/ipam/docs/InheritedDHCPConfig.md index 08af5d4..668ccc0 100644 --- a/src/ipam/docs/InheritedDHCPConfig.md +++ b/src/ipam/docs/InheritedDHCPConfig.md @@ -10,9 +10,12 @@ Name | Type | Description | Notes **abandoned_reclaim_time_v6** | [**InheritanceInheritedUInt32**](InheritanceInheritedUInt32.md) | The inheritance configuration for _abandoned_reclaim_time_v6_ field from _DHCPConfig_ object. | [optional] **allow_unknown** | [**InheritanceInheritedBool**](InheritanceInheritedBool.md) | The inheritance configuration for _allow_unknown_ field from _DHCPConfig_ object. | [optional] **allow_unknown_v6** | [**InheritanceInheritedBool**](InheritanceInheritedBool.md) | The inheritance configuration for _allow_unknown_v6_ field from _DHCPConfig_ object. | [optional] +**authoritative_dhcp** | [**InheritanceInheritedBool**](InheritanceInheritedBool.md) | The inheritance configuration for _authoritative_dhcp_ field from _DHCPConfig_ object. | [optional] **echo_client_id** | [**InheritanceInheritedBool**](InheritanceInheritedBool.md) | The inheritance configuration for _echo_client_id_ field from _DHCPConfig_ object. | [optional] **filters** | [**InheritedDHCPConfigFilterList**](InheritedDHCPConfigFilterList.md) | The inheritance configuration for filters field from _DHCPConfig_ object. | [optional] **filters_v6** | [**InheritedDHCPConfigFilterList**](InheritedDHCPConfigFilterList.md) | The inheritance configuration for _filters_v6_ field from _DHCPConfig_ object. | [optional] +**hold_reclaimed_time** | [**InheritanceInheritedUInt32**](InheritanceInheritedUInt32.md) | The inheritance configuration for _hold_reclaimed_time_ field from _DHCPConfig_ object. | [optional] +**hold_reclaimed_time_v6** | [**InheritanceInheritedUInt32**](InheritanceInheritedUInt32.md) | The inheritance configuration for _hold_reclaimed_time_v6_ field from _DHCPConfig_ object. | [optional] **ignore_client_uid** | [**InheritanceInheritedBool**](InheritanceInheritedBool.md) | The inheritance configuration for _ignore_client_uid_ field from _DHCPConfig_ object. | [optional] **ignore_list** | [**InheritedDHCPConfigIgnoreItemList**](InheritedDHCPConfigIgnoreItemList.md) | The inheritance configuration for _ignore_list_ field from _DHCPConfig_ object. | [optional] **lease_time** | [**InheritanceInheritedUInt32**](InheritanceInheritedUInt32.md) | The inheritance configuration for _lease_time_ field from _DHCPConfig_ object. | [optional] diff --git a/src/ipam/models/dhcp_config.py b/src/ipam/models/dhcp_config.py index 1039253..7bf74e6 100644 --- a/src/ipam/models/dhcp_config.py +++ b/src/ipam/models/dhcp_config.py @@ -43,6 +43,8 @@ class DHCPConfig(BaseModel): description= "Disable to allow leases only for known IPV6 clients, those for which a fixed address is configured." ) + authoritative_dhcp: Optional[StrictBool] = Field( + default=False, description="Set DHCP server as authoritative.") echo_client_id: Optional[StrictBool] = Field( default=False, description= @@ -54,6 +56,12 @@ class DHCPConfig(BaseModel): default=None, description="The resource identifier.") filters_v6: Optional[List[StrictStr]] = Field( default=None, description="The resource identifier.") + hold_reclaimed_time: Optional[StrictInt] = Field( + default=3600, + description="The hold reclaimed time in seconds for IPv4 clients.") + hold_reclaimed_time_v6: Optional[StrictInt] = Field( + default=3600, + description="The hold reclaimed time in seconds for IPv6 clients.") ignore_client_uid: Optional[StrictBool] = Field( default=False, description= @@ -70,9 +78,10 @@ class DHCPConfig(BaseModel): additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = [ "abandoned_reclaim_time", "abandoned_reclaim_time_v6", "allow_unknown", - "allow_unknown_v6", "echo_client_id", "filters", - "filters_large_selection", "filters_v6", "ignore_client_uid", - "ignore_list", "lease_time", "lease_time_v6" + "allow_unknown_v6", "authoritative_dhcp", "echo_client_id", "filters", + "filters_large_selection", "filters_v6", "hold_reclaimed_time", + "hold_reclaimed_time_v6", "ignore_client_uid", "ignore_list", + "lease_time", "lease_time_v6" ] model_config = ConfigDict( @@ -151,6 +160,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "allow_unknown_v6": obj.get("allow_unknown_v6") if obj.get("allow_unknown_v6") is not None else True, + "authoritative_dhcp": + obj.get("authoritative_dhcp") + if obj.get("authoritative_dhcp") is not None else False, "echo_client_id": obj.get("echo_client_id") if obj.get("echo_client_id") is not None else False, @@ -160,6 +172,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: obj.get("filters_large_selection"), "filters_v6": obj.get("filters_v6"), + "hold_reclaimed_time": + obj.get("hold_reclaimed_time") + if obj.get("hold_reclaimed_time") is not None else 3600, + "hold_reclaimed_time_v6": + obj.get("hold_reclaimed_time_v6") + if obj.get("hold_reclaimed_time_v6") is not None else 3600, "ignore_client_uid": obj.get("ignore_client_uid") if obj.get("ignore_client_uid") is not None else False, diff --git a/src/ipam/models/inherited_dhcp_config.py b/src/ipam/models/inherited_dhcp_config.py index c6c42a6..5cd9bb7 100644 --- a/src/ipam/models/inherited_dhcp_config.py +++ b/src/ipam/models/inherited_dhcp_config.py @@ -50,6 +50,11 @@ class InheritedDHCPConfig(BaseModel): description= "The inheritance configuration for _allow_unknown_v6_ field from _DHCPConfig_ object." ) + authoritative_dhcp: Optional[InheritanceInheritedBool] = Field( + default=None, + description= + "The inheritance configuration for _authoritative_dhcp_ field from _DHCPConfig_ object." + ) echo_client_id: Optional[InheritanceInheritedBool] = Field( default=None, description= @@ -65,6 +70,16 @@ class InheritedDHCPConfig(BaseModel): description= "The inheritance configuration for _filters_v6_ field from _DHCPConfig_ object." ) + hold_reclaimed_time: Optional[InheritanceInheritedUInt32] = Field( + default=None, + description= + "The inheritance configuration for _hold_reclaimed_time_ field from _DHCPConfig_ object." + ) + hold_reclaimed_time_v6: Optional[InheritanceInheritedUInt32] = Field( + default=None, + description= + "The inheritance configuration for _hold_reclaimed_time_v6_ field from _DHCPConfig_ object." + ) ignore_client_uid: Optional[InheritanceInheritedBool] = Field( default=None, description= @@ -88,7 +103,8 @@ class InheritedDHCPConfig(BaseModel): additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = [ "abandoned_reclaim_time", "abandoned_reclaim_time_v6", "allow_unknown", - "allow_unknown_v6", "echo_client_id", "filters", "filters_v6", + "allow_unknown_v6", "authoritative_dhcp", "echo_client_id", "filters", + "filters_v6", "hold_reclaimed_time", "hold_reclaimed_time_v6", "ignore_client_uid", "ignore_list", "lease_time", "lease_time_v6" ] @@ -148,6 +164,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of allow_unknown_v6 if self.allow_unknown_v6: _dict['allow_unknown_v6'] = self.allow_unknown_v6.to_dict() + # override the default output from pydantic by calling `to_dict()` of authoritative_dhcp + if self.authoritative_dhcp: + _dict['authoritative_dhcp'] = self.authoritative_dhcp.to_dict() # override the default output from pydantic by calling `to_dict()` of echo_client_id if self.echo_client_id: _dict['echo_client_id'] = self.echo_client_id.to_dict() @@ -157,6 +176,14 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of filters_v6 if self.filters_v6: _dict['filters_v6'] = self.filters_v6.to_dict() + # override the default output from pydantic by calling `to_dict()` of hold_reclaimed_time + if self.hold_reclaimed_time: + _dict['hold_reclaimed_time'] = self.hold_reclaimed_time.to_dict() + # override the default output from pydantic by calling `to_dict()` of hold_reclaimed_time_v6 + if self.hold_reclaimed_time_v6: + _dict[ + 'hold_reclaimed_time_v6'] = self.hold_reclaimed_time_v6.to_dict( + ) # override the default output from pydantic by calling `to_dict()` of ignore_client_uid if self.ignore_client_uid: _dict['ignore_client_uid'] = self.ignore_client_uid.to_dict() @@ -199,6 +226,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "allow_unknown_v6": InheritanceInheritedBool.from_dict(obj["allow_unknown_v6"]) if obj.get("allow_unknown_v6") is not None else None, + "authoritative_dhcp": + InheritanceInheritedBool.from_dict(obj["authoritative_dhcp"]) + if obj.get("authoritative_dhcp") is not None else None, "echo_client_id": InheritanceInheritedBool.from_dict(obj["echo_client_id"]) if obj.get("echo_client_id") is not None else None, @@ -208,6 +238,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "filters_v6": InheritedDHCPConfigFilterList.from_dict(obj["filters_v6"]) if obj.get("filters_v6") is not None else None, + "hold_reclaimed_time": + InheritanceInheritedUInt32.from_dict(obj["hold_reclaimed_time"]) + if obj.get("hold_reclaimed_time") is not None else None, + "hold_reclaimed_time_v6": + InheritanceInheritedUInt32.from_dict(obj["hold_reclaimed_time_v6"]) + if obj.get("hold_reclaimed_time_v6") is not None else None, "ignore_client_uid": InheritanceInheritedBool.from_dict(obj["ignore_client_uid"]) if obj.get("ignore_client_uid") is not None else None,