Builders¶
Fluent builders for constructing complex AXL configuration payloads. See the Fluent Builders user guide for detailed usage examples.
axltoolkit.builders.PhoneBuilder
¶
Fluent builder for phone device payloads.
Creates the nested dict structure required by
:meth:~axltoolkit.axl.AXLClient.add_phone.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Device name (e.g. |
required |
product
|
str
|
Phone model (e.g. |
'Cisco 8845'
|
protocol
|
str
|
|
'SIP'
|
Example::
phone = (
PhoneBuilder("SEP001122334455", product="Cisco 8845")
.device_pool("Default")
.sip_profile("Standard SIP Profile")
.security_profile("Cisco 8845 - Standard SIP Non-Secure Profile")
.phone_template("Standard 8845 SIP")
.add_line(1, "1001", "Internal-PT")
.build()
)
calling_search_space
¶
Set the calling search space.
common_device_config
¶
Set the common device configuration.
common_phone_config
¶
Set the common phone configuration profile.
load_information
¶
Set the firmware load information.
set
¶
Set an arbitrary key-value pair on the phone payload.
add_line
¶
add_line(index: int, pattern: str, route_partition_name: str = '', *, display: str = '', display_ascii: str = '', label: str = '', e164_mask: str = '', max_num_calls: int = 4, busy_trigger: int = 2) -> PhoneBuilder
Add a line association.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index
|
int
|
Line button index (1-based). |
required |
pattern
|
str
|
Directory number pattern. |
required |
route_partition_name
|
str
|
Route partition for the DN. |
''
|
display
|
str
|
Display name. |
''
|
display_ascii
|
str
|
ASCII display name. |
''
|
label
|
str
|
Line text label. |
''
|
e164_mask
|
str
|
E.164 alternate number mask. |
''
|
max_num_calls
|
int
|
Maximum simultaneous calls on this line. |
4
|
busy_trigger
|
int
|
Busy trigger threshold. |
2
|
build
¶
Build and return the phone data dict.
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
A dict suitable for passing to |
Dict[str, Any]
|
meth: |
Raises:
| Type | Description |
|---|---|
ValueError
|
If required fields are missing. |
axltoolkit.builders.SipTrunkBuilder
¶
Fluent builder for SIP Trunk payloads.
Creates the nested dict structure required by
:meth:~axltoolkit.axl.AXLClient.add_sip_trunk.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Trunk name. |
required |
Example::
trunk = (
SipTrunkBuilder("SIP-Trunk-ITSP")
.device_pool("Default")
.security_profile("Non Secure SIP Trunk Profile")
.sip_profile("Standard SIP Profile")
.add_destination("10.0.0.100", 5060)
.calling_search_space("CSS-Trunk")
.build()
)
calling_search_space
¶
Set the calling search space.
security_profile
¶
Set the SIP trunk security profile.
media_resource_list
¶
Set the media resource list.
run_on_every_node
¶
Set whether the trunk runs on every node.
trunk_type
¶
Set the SIP trunk type (e.g. "None(Default)").
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
trunk_type
|
str
|
The trunk type string. |
required |
set
¶
Set an arbitrary key-value pair on the trunk payload.
add_destination
¶
add_destination(address: str, port: int = 5060, *, sort_order: Optional[int] = None, ipv6: bool = False) -> SipTrunkBuilder
Add a destination (SIP peer).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
address
|
str
|
IP address or hostname of the SIP peer. |
required |
port
|
int
|
SIP port (default 5060). |
5060
|
sort_order
|
Optional[int]
|
Route priority order. If |
None
|
ipv6
|
bool
|
If |
False
|
build
¶
Build and return the SIP trunk data dict.
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
A dict suitable for passing to |
Dict[str, Any]
|
meth: |
Raises:
| Type | Description |
|---|---|
ValueError
|
If required fields are missing. |
axltoolkit.builders.CssBuilder
¶
Fluent builder for Calling Search Space payloads.
Example::
css = (
CssBuilder("CSS-Internal")
.description("Internal dialing CSS")
.add_partition("PT-Internal")
.add_partition("PT-Local")
.add_partition("PT-LD")
.build()
)