Skip to content

data

Pydantic data types

CLITemplate #

Bases: BaseModel

CLI template model

Docs for assigning template to device https://fndn.fortinet.net/index.php?/stackoverflow/topic/607-cli-template/&tab=comments#comment-2602

standardize_provision #

standardize_provision(v)

Convert int to string

Source code in fortimanager_template_sync/fmg_api/data.py
@field_validator("provision", mode="before")
def standardize_provision(cls, v):
    """Convert int to string"""
    if type(v) is int:
        return ["disable", "enable"][v]
    else:
        return v

standardize_type #

standardize_type(v)

Convert int to string

Source code in fortimanager_template_sync/fmg_api/data.py
@field_validator("type", mode="before")
def standardize_type(cls, v):
    """Convert int to string"""
    if type(v) is int:
        return ["cli", "jinja"][v]
    else:
        return v

CLITemplateGroup #

Bases: BaseModel

CLI Template Group model

TemplateTree #

Template data structure

Attributes:

Name Type Description
pre_run_templates List[CLITemplate]

CLI pre-run template list

templates List[CLITemplate]

CLI template list

template_groups List[CLITemplateGroup]

CLI template group list

variables property #

variables: List[Variable]

Get list of all variables

Variable #

Bases: BaseModel

Variable model