pyntc.utils.templates
¶
Module to use NTC_TEMPLATES.
pyntc.utils.templates.get_structured_data(template_name, rawtxt)
¶
Return structured data given raw text using TextFSM templates.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
template_name
|
str
|
Name of template to use. |
required |
rawtxt
|
str
|
Raw output from device. |
required |
Returns:
| Type | Description |
|---|---|
list
|
A dict per entry returned by TextFSM. |
pyntc.utils.templates.get_template(template_name)
¶
Path to the template passed in.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
template_name
|
str
|
Name of the template. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Path to the template. |
pyntc.utils.templates.get_template_dir()
¶
Get directory of NTC_TEMPLATE os environment.
Returns:
| Type | Description |
|---|---|
str
|
Path to NTC_TEMPLATES environment variable if set. Otherwise, path to this file. |