pyavd¶
Warning
pyavd is still in the development phase. Please do not use.
Installation¶
Reference¶
validate_inputs(all_hostvars, eos_designs=True, eos_cli_config_gen=True)
¶
Validate input variables according to AVD the eos_designs
schema and/or 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 |
---|---|---|---|
all_hostvars |
dict[str, dict]
|
required | |
eos_designs |
bool
|
Validate variables according to the |
True
|
eos_cli_config_gen |
bool
|
Validate variables according to the |
True
|
Raises:
Type | Description |
---|---|
AristaAvdError
|
List of validation errors across all devices. |
Source code in python-avd/pyavd/validate_inputs.py
get_avd_facts(all_hostvars)
¶
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:
Name | Type | Description | Default |
---|---|---|---|
all_hostvars |
dict[str, dict]
|
required |
Returns:
Type | Description |
---|---|
dict[str, dict]
|
Source code in python-avd/pyavd/get_avd_facts.py
get_device_structured_config(hostname, hostvars, avd_facts)
¶
Build and return the AVD structured configuration for one device.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
hostname |
str
|
Hostname of device. |
required |
hostvars |
dict
|
Dictionary of variables passed 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
get_device_config(hostname, hostvars)
¶
Render and return the device configuration using AVD eos_cli_config_gen templates.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
hostname |
str
|
Hostname of device. |
required |
hostvars |
dict
|
Dictionary of variables applied to template.
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
get_device_doc(hostname, hostvars)
¶
Render and return the device documentation using AVD eos_cli_config_gen templates.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
hostname |
str
|
Hostname of device. |
required |
hostvars |
dict
|
Dictionary of variables applied to template.
Variables should be converted and validated according to AVD |
required |
Returns:
Type | Description |
---|---|
str
|
Device documentation in Markdown format. |