PyAVD¶
PyAVD is a python package providing some of the features from the arista.avd
Ansible collection without requiring Ansible. PyAVD leverages the same logic as the Ansible collection, so the generated outputs should be exactly the same based on the same inputs.
PyAVD does not provide any inventory or variable management, so PyAVD cannot replace a full Ansible based solution by itself. PyAVD could serve as an element in larger framework.
Supported features:
- Validation of inputs based on the
eos_designs
input schema. - Generation of “avd_facts” and “structured config” to be used in other PyAVD functions.
- Validation of “structured config” based on the
eos_cli_config_gen
input schema. - Generation of device configuration.
- Generation of device documentation.
Feedback is very welcome. Please use GitHub discussions.
Functions overview¶
Known limitations¶
Warning
Input data and “structured_configs” will be in-place updated by various PyAVD functions. Make sure to deep copy the data first if modifications are not allowed.
Warning
get_device_structured_config()
, get_device_config()
and get_device_doc()
are not thread-safe, so avoid running them for the same device across multiple threads.
Note
- No support for inline Jinja2 or custom Jinja2 templates.
- The logic uses the hostname as the unique identifier for each device, so overlapping hostnames will not work.
- For
get_avd_facts()
,fabric_name
is not used or verified and may differ between devices. All devices in the given inputs will be treated as one fabric. hostname
must be set in “structured_config” for each device.hostname
will be set correctly when usingget_structured_config()
.
Roadmap¶
Note
Subject to change. No commitments implied.
- Add examples
- Add more tests (current coverage is 85%)
- Add network state validation similar to
eos_validate_state
. - Add CloudVision tag integrations
- Explore support for custom Jinja2 templates.
Installation¶
Install the pyavd
Python package:
Python dependencies are automatically installed with above command.
Optional requirements¶
To install Ansible AVD collection Python requirements install with extra ansible
:
Reference¶
pyavd.validate_inputs.validate_inputs(inputs)
¶
Validate input variables according to the eos_designs
schema as documented on avd.arista.com.
Where supported by the schema, types will be auto type-converted like from “int” to “str”.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
inputs
|
dict
|
Dictionary with inputs for “eos_designs”. |
required |
Returns:
Type | Description |
---|---|
ValidationResult
|
Validation result object with any validation errors or deprecation warnings. |
Source code in python-avd/pyavd/validate_inputs.py
pyavd.get_avd_facts.get_avd_facts(all_inputs)
¶
Build avd_facts using the AVD eos_designs_facts logic.
Variables should be converted and validated according to AVD eos_designs
schema first using pyavd.validate_inputs
.
Note! No support for inline templating or jinja templates for descriptions or ip addressing
Parameters:
Returns:
Source code in python-avd/pyavd/get_avd_facts.py
pyavd.get_device_structured_config.get_device_structured_config(hostname, inputs, avd_facts)
¶
Build and return the AVD structured configuration for one device.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
hostname
|
str
|
Hostname of device. |
required |
inputs
|
dict
|
Dictionary with inputs for “eos_designs”.
Variables should be converted and validated according to AVD |
required |
avd_facts
|
dict
|
Dictionary of avd_facts as returned from |
required |
Returns:
Type | Description |
---|---|
dict
|
Device Structured Configuration as a dictionary |
Source code in python-avd/pyavd/get_device_structured_config.py
pyavd.validate_structured_config.validate_structured_config(structured_config)
¶
Validate structured config according the eos_cli_config_gen
schema as documented on avd.arista.com.
Where supported by the schema, types will be auto type-converted like from “int” to “str”.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
structured_config
|
dict
|
Dictionary with structured configuration. |
required |
Returns:
Type | Description |
---|---|
ValidationResult
|
Validation result object with any validation errors or deprecation warnings. |
Source code in python-avd/pyavd/validate_structured_config.py
pyavd.get_fabric_documentation.get_fabric_documentation(avd_facts, structured_configs, fabric_name, fabric_documentation=True, include_connected_endpoints=False, topology_csv=False, p2p_links_csv=False)
¶
Build and return the AVD fabric documentation.
The returned object will contain the content of the requested documentation areas: - Fabric documentation as Markdown, optionally including connected endpoints. - Topology CSV containing the physical interface connections for every device. - P2P links CSV containing the Routed point-to-point links.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
avd_facts
|
dict[str, dict]
|
Dictionary of avd_facts as returned from |
required |
structured_configs
|
dict[str, dict]
|
Dictionary of structured configurations for all devices, keyed by hostname. |
required |
fabric_name
|
str
|
Name of the fabric. Only used for the main heading in the Markdown documentation. |
required |
fabric_documentation
|
bool
|
Returns fabric documentation when set to True. |
True
|
include_connected_endpoints
|
bool
|
Includes connected endpoints in the fabric documentation when set to True. |
False
|
topology_csv
|
bool
|
Returns topology CSV when set to True. |
False
|
p2p_links_csv
|
bool
|
Returns P2P links CSV when set to True. |
False
|
Returns:
Type | Description |
---|---|
FabricDocumentation
|
FabricDocumentation object containing the requested documentation areas. |
Source code in python-avd/pyavd/get_fabric_documentation.py
pyavd.get_device_config.get_device_config(structured_config)
¶
Render and return the device configuration using AVD eos_cli_config_gen templates.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
structured_config
|
dict
|
Dictionary with structured configuration.
Variables should be converted and validated according to AVD |
required |
Returns:
Type | Description |
---|---|
str
|
Device configuration in EOS CLI format. |
Source code in python-avd/pyavd/get_device_config.py
pyavd.get_device_doc.get_device_doc(structured_config, add_md_toc=False)
¶
Render and return the device documentation using AVD eos_cli_config_gen templates.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
structured_config
|
dict
|
Dictionary with structured configuration.
Variables should be converted and validated according to AVD |
required |
add_md_toc
|
bool
|
Add a table of contents for markdown headings. |
False
|
Returns:
Type | Description |
---|---|
str
|
Device documentation in Markdown format. |
Source code in python-avd/pyavd/get_device_doc.py
pyavd.validation_result.ValidationResult
¶
Object containing result of data validation.
Attributes:
Name | Type | Description |
---|---|---|
failed |
bool
|
True if data is not valid according to the schema. Otherwise False. |
validation_errors |
list[AvdValidationError]
|
List of AvdValidationErrors containing schema violations. |
deprecation_warnings |
list[AvdDeprecationWarning]
|
List of AvdDeprecationWarnings containing warning for deprecated inputs. |
Source code in python-avd/pyavd/validation_result.py
pyavd.validation_result.ValidationResult.merge(other)
¶
Merge another ValidationResult instance into this instance.
Source code in python-avd/pyavd/validation_result.py
pyavd.api.fabric_documentation.FabricDocumentation
¶
Object containing the requested documentation.
Attributes:
Name | Type | Description |
---|---|---|
fabric_documentation |
str
|
Fabric Documentation as Markdown. |
topology_csv |
str
|
Topology CSV containing the physical interface connections for every device. |
p2p_links_csv |
str
|
P2P links CSV containing the Routed point-to-point links. |
Source code in python-avd/pyavd/api/fabric_documentation/__init__.py
AVD eos_designs base module to generate interface descriptions.
pyavd.api.interface_descriptions.AvdInterfaceDescriptions
¶
Bases: AvdFacts
Class used to render Interface Descriptions either from custom Jinja2 templates or using default Python Logic.
Since some templates might contain certain legacy variables (switch_), those are mapped from the switch. model
This class is imported adhoc based on the variable templates.interface_descriptions.python_module
so it can
be overridden by a custom python class.
Attributes starting with _ are internal and may change at any time.
Other attributes are “stable” and changes follow semver practices: - Existing attributes will not be changed in terms of type and value, but the underlying code for cached_properties may change. - New attributes may be added in minor releases. - The init method may change between minor versions as the data may need to be consumed from other sources. - Breaking changes may happen between major releases or in rare cases for bug fixes.
Source code in python-avd/pyavd/api/interface_descriptions/__init__.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 |
|
pyavd.api.interface_descriptions.AvdInterfaceDescriptions.connected_endpoints_ethernet_interface(data)
¶
Build a connected endpoint Ethernet interface description.
If a jinja template is configured, use it. If not, use the adapter.description as a format string template if set. Finally fall back to default templates depending on this being a network_port or not.
Available data
- peer
- peer_type
- peer_interface
- description
- mpls_overlay_role
- mpls_lsr
- overlay_routing_protocol
- type.
Source code in python-avd/pyavd/api/interface_descriptions/__init__.py
pyavd.api.interface_descriptions.AvdInterfaceDescriptions.connected_endpoints_port_channel_interface(data)
¶
Build a connected endpoint Port-channel description.
If a jinja template is configured, use it. If not, use the port_channel.description as a format string template if set. Finally fall back to default templates depending on this being a network_port or not.
Available data
- peer
- peer_interface
- peer_type
- description
- port_channel_id
- port_channel_description
- mpls_overlay_role
- mpls_lsr
- overlay_routing_protocol
- type.
Source code in python-avd/pyavd/api/interface_descriptions/__init__.py
pyavd.api.interface_descriptions.AvdInterfaceDescriptions.mlag_ethernet_interface(data)
¶
Build an MLAG Ethernet interface description.
If a jinja template is configured, use it. If not, use the default template as a format string template.
Available data
- interface
- peer_interface
- mlag_peer
- mlag_port_channel_id
- mlag_peer_port_channel_id
- mpls_overlay_role
- mpls_lsr
- overlay_routing_protocol
- type.
Source code in python-avd/pyavd/api/interface_descriptions/__init__.py
pyavd.api.interface_descriptions.AvdInterfaceDescriptions.mlag_peer_l3_svi(data)
¶
Build an MLAG Peering SVI description.
Available data
- interface
- mlag_peer
- mlag_peer_l3_vlan
- mpls_overlay_role
- mpls_lsr
- overlay_routing_protocol
- type.
Source code in python-avd/pyavd/api/interface_descriptions/__init__.py
pyavd.api.interface_descriptions.AvdInterfaceDescriptions.mlag_peer_l3_vrf_svi(data)
¶
Build an MLAG Peering SVI description.
Available data
- interface
- vlan
- vrf
- mlag_peer
- mpls_overlay_role
- mpls_lsr
- overlay_routing_protocol
- type.
Source code in python-avd/pyavd/api/interface_descriptions/__init__.py
pyavd.api.interface_descriptions.AvdInterfaceDescriptions.mlag_peer_svi(data)
¶
Build an MLAG Peering SVI description.
Available data
- interface
- mlag_peer
- mlag_peer_vlan
- mpls_overlay_role
- mpls_lsr
- overlay_routing_protocol
- type.
Source code in python-avd/pyavd/api/interface_descriptions/__init__.py
pyavd.api.interface_descriptions.AvdInterfaceDescriptions.mlag_port_channel_interface(data)
¶
Build an MLAG Port-Channel interface description.
If a jinja template is configured, use it. If not, use the default template as a format string template.
Available data
- interface
- peer_interface
- mlag_peer
- mlag_port_channel_id
- mlag_peer_port_channel_id
- mpls_overlay_role
- mpls_lsr
- overlay_routing_protocol
- type.
Source code in python-avd/pyavd/api/interface_descriptions/__init__.py
pyavd.api.interface_descriptions.AvdInterfaceDescriptions.router_id_loopback_interface(data)
¶
Build Router ID loopback interface description.
Available data
- description
- mpls_overlay_role
- mpls_lsr
- overlay_routing_protocol
- type.
Source code in python-avd/pyavd/api/interface_descriptions/__init__.py
pyavd.api.interface_descriptions.AvdInterfaceDescriptions.underlay_ethernet_interface(data)
¶
Build an underlay Ethernet interface description.
If a jinja template is configured, use it.
Available data
- link_type
- description
- peer
- peer_interface
- mpls_overlay_role
- mpls_lsr
- overlay_routing_protocol
- type
- vrf
- wan_carrier
- wan_circuit_id.
Source code in python-avd/pyavd/api/interface_descriptions/__init__.py
pyavd.api.interface_descriptions.AvdInterfaceDescriptions.underlay_port_channel_interface(data)
¶
Build an underlay Port-Channel interface description.
If a jinja template is configured, use it.
Available data
- peer
- peer_interface
- peer_channel_group_id
- peer_node_group
- port_channel_id
- port_channel_description
- mpls_overlay_role
- mpls_lsr
- overlay_routing_protocol
- type.
Source code in python-avd/pyavd/api/interface_descriptions/__init__.py
pyavd.api.interface_descriptions.AvdInterfaceDescriptions.vtep_loopback_interface(data)
¶
Build VTEP loopback interface description.
Available data
- description
- mpls_overlay_role
- mpls_lsr
- overlay_routing_protocol
- type
Source code in python-avd/pyavd/api/interface_descriptions/__init__.py
pyavd.api.interface_descriptions.AvdInterfaceDescriptions.wan_ha_ethernet_interface(data)
¶
Build WAN HA ethernet interface description.
Available data
- interface
- peer
- peer_interface
- mpls_overlay_role
- mpls_lsr
- overlay_routing_protocol
- type
Source code in python-avd/pyavd/api/interface_descriptions/__init__.py
pyavd.api.interface_descriptions.AvdInterfaceDescriptions.wan_ha_port_channel_interface(data)
¶
Build WAN HA port-channel interface description.
Available data
- interface
- peer
- peer_interface
- mpls_overlay_role
- mpls_lsr
- overlay_routing_protocol
- type
Source code in python-avd/pyavd/api/interface_descriptions/__init__.py
pyavd.api.interface_descriptions.InterfaceDescriptionData
¶
This class is used as transport of data between AVD code and instances of AvdInterfaceDescriptions class or subclasses hereof.
Attributes starting with _ are internal and may change at any time.
Other attributes are “stable” and changes follow semver practices: - Existing attributes will not be changed in terms of type and value, but the underlying code for cached_properties may change. - New attributes may be added in minor releases. - The init method may change between minor versions as the data may need to be consumed from other sources. - Breaking changes may happen between major releases.
Source code in python-avd/pyavd/api/interface_descriptions/__init__.py
474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 |
|
pyavd.api.interface_descriptions.InterfaceDescriptionData.description: str | None = description
instance-attribute
¶
Set description for interface
pyavd.api.interface_descriptions.InterfaceDescriptionData.interface: str | None = interface
instance-attribute
¶
Local interface
pyavd.api.interface_descriptions.InterfaceDescriptionData.link_type: str | None = link_type
instance-attribute
¶
Type of connection. Like ‘underlay_p2p’ or ‘underlay_l2’
pyavd.api.interface_descriptions.InterfaceDescriptionData.peer: str | None = peer
instance-attribute
¶
Hostname of peer
pyavd.api.interface_descriptions.InterfaceDescriptionData.peer_channel_group_id: int | None = peer_channel_group_id
instance-attribute
¶
Port channel ID of peer
pyavd.api.interface_descriptions.InterfaceDescriptionData.peer_interface: str | None = peer_interface
instance-attribute
¶
Interface of peer
pyavd.api.interface_descriptions.InterfaceDescriptionData.peer_node_group: str | None = peer_node_group
instance-attribute
¶
Node group of peer
pyavd.api.interface_descriptions.InterfaceDescriptionData.peer_type: str | None = peer_type
instance-attribute
¶
Type of peer
pyavd.api.interface_descriptions.InterfaceDescriptionData.port_channel_description: str | None = port_channel_description
instance-attribute
¶
Set description for port-channel
pyavd.api.interface_descriptions.InterfaceDescriptionData.port_channel_id: int | None = port_channel_id
instance-attribute
¶
Port channel ID
pyavd.api.interface_descriptions.InterfaceDescriptionData.vlan: int | None = vlan
instance-attribute
¶
VLAN ID
pyavd.api.interface_descriptions.InterfaceDescriptionData.vrf: str | None = vrf
instance-attribute
¶
Interface VRF
pyavd.api.interface_descriptions.InterfaceDescriptionData.wan_carrier: str | None = wan_carrier
instance-attribute
¶
The WAN Carrier this interface is connected to
pyavd.api.interface_descriptions.InterfaceDescriptionData.wan_circuit_id: str | None = wan_circuit_id
instance-attribute
¶
The WAN Circuit ID for this interface.
pyavd.api.ip_addressing.AvdIpAddressing
¶
Bases: AvdFacts
, UtilsMixin
Class used to render IP addresses either from custom Jinja2 templates or using default Python Logic.
Since some templates might contain certain legacy variables (switch_), those are mapped from the switch. model
This class is imported adhoc based on the variable templates.ip_addressing.python_module
so it can
be overridden by a custom python class.
Source code in python-avd/pyavd/api/ip_addressing/__init__.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 |
|
pyavd.api.ip_addressing.AvdIpAddressing.evpn_underlay_l2_multicast_group(underlay_l2_multicast_group_ipv4_pool, vlan_id, underlay_l2_multicast_group_ipv4_pool_offset)
¶
Return IP address to be used for EVPN underlay L2 multicast group.
Source code in python-avd/pyavd/api/ip_addressing/__init__.py
pyavd.api.ip_addressing.AvdIpAddressing.evpn_underlay_l3_multicast_group(underlay_l3_multicast_group_ipv4_pool, vrf_vni, vrf_id, evpn_underlay_l3_multicast_group_ipv4_pool_offset)
¶
Return IP address to be used for EVPN underlay L3 multicast group.
Source code in python-avd/pyavd/api/ip_addressing/__init__.py
pyavd.api.ip_addressing.AvdIpAddressing.ipv6_router_id()
¶
Return IPv6 address for Router ID.
Default pool is “loopback_ipv6_pool”
Default offset from pool is id + loopback_ipv6_offset
Source code in python-avd/pyavd/api/ip_addressing/__init__.py
pyavd.api.ip_addressing.AvdIpAddressing.mlag_ibgp_peering_ip_primary(mlag_ibgp_peering_ipv4_pool)
¶
Return IP for L3 Peerings in VRFs for MLAG Primary.
Source code in python-avd/pyavd/api/ip_addressing/__init__.py
pyavd.api.ip_addressing.AvdIpAddressing.mlag_ibgp_peering_ip_secondary(mlag_ibgp_peering_ipv4_pool)
¶
Return IP for L3 Peerings in VRFs for MLAG Secondary.
Source code in python-avd/pyavd/api/ip_addressing/__init__.py
pyavd.api.ip_addressing.AvdIpAddressing.mlag_ip_primary()
¶
Return IP for MLAG Primary.
Default pool is “mlag_peer_ipv4_pool”
Source code in python-avd/pyavd/api/ip_addressing/__init__.py
pyavd.api.ip_addressing.AvdIpAddressing.mlag_ip_secondary()
¶
Return IP for MLAG Secondary.
Default pool is “mlag_peer_ipv4_pool”
Source code in python-avd/pyavd/api/ip_addressing/__init__.py
pyavd.api.ip_addressing.AvdIpAddressing.mlag_l3_ip_primary()
¶
Return IP for L3 Peerings for MLAG Primary.
Default pool is “mlag_peer_l3_ipv4_pool”
Source code in python-avd/pyavd/api/ip_addressing/__init__.py
pyavd.api.ip_addressing.AvdIpAddressing.mlag_l3_ip_secondary()
¶
Return IP for L3 Peerings for MLAG Secondary.
Default pool is “mlag_peer_l3_ipv4_pool”
Source code in python-avd/pyavd/api/ip_addressing/__init__.py
pyavd.api.ip_addressing.AvdIpAddressing.p2p_uplinks_ip(uplink_switch_index)
¶
Return Child IP for P2P Uplinks.
Source code in python-avd/pyavd/api/ip_addressing/__init__.py
pyavd.api.ip_addressing.AvdIpAddressing.p2p_uplinks_peer_ip(uplink_switch_index)
¶
Return Parent IP for P2P Uplinks.
Source code in python-avd/pyavd/api/ip_addressing/__init__.py
pyavd.api.ip_addressing.AvdIpAddressing.p2p_vrfs_uplinks_ip(uplink_switch_index, vrf)
¶
Return Child IP for P2P-VRFs Uplinks.
Unless overridden in a custom IP addressing module, this will just reuse the regular ip addressing logic.
Source code in python-avd/pyavd/api/ip_addressing/__init__.py
pyavd.api.ip_addressing.AvdIpAddressing.p2p_vrfs_uplinks_peer_ip(uplink_switch_index, vrf)
¶
Return Parent IP for P2P-VRFs Uplinks.
Unless overridden in a custom IP addressing module, this will just reuse the regular ip addressing logic.
Source code in python-avd/pyavd/api/ip_addressing/__init__.py
pyavd.api.ip_addressing.AvdIpAddressing.router_id()
¶
Return IP address for Router ID.
If “loopback_ipv4_address” is set, it is used.
Default pool is “loopback_ipv4_pool”
Default offset from pool is id + loopback_ipv4_offset
Source code in python-avd/pyavd/api/ip_addressing/__init__.py
pyavd.api.ip_addressing.AvdIpAddressing.vrf_loopback_ip(pool)
¶
Return IP address for a Loopback interface based on the given pool.
Default offset from pool is id + loopback_ipv4_offset
.
Used for “vtep_diagnostic.loopback”.
Source code in python-avd/pyavd/api/ip_addressing/__init__.py
pyavd.api.ip_addressing.AvdIpAddressing.vtep_ip()
¶
Return IP address for VTEP.
If “vtep_loopback_ipv4_address” is set, it is used.
Default pool is “vtep_loopback_ipv4_pool”
Default offset from pool is id + loopback_ipv4_offset
Source code in python-avd/pyavd/api/ip_addressing/__init__.py
pyavd.api.ip_addressing.AvdIpAddressing.vtep_ip_mlag()
¶
Return IP address for VTEP for MLAG Leaf.
If “vtep_loopback_ipv4_address” is set, it is used.
Default pool is “vtep_loopback_ipv4_pool”
Default offset from pool is mlag_primary_id + loopback_ipv4_offset
Source code in python-avd/pyavd/api/ip_addressing/__init__.py
pyavd.api.ip_addressing.AvdIpAddressing.wan_ha_ip()
¶
Return the WAN HA local IP address.
Source code in python-avd/pyavd/api/ip_addressing/__init__.py
pyavd.api.ip_addressing.AvdIpAddressing.wan_ha_peer_ip()
¶
Return the WAN HA peer IP.