Skip to content

dvmdb

Device DB objects

CONF_STATUS module-attribute #

CONF_STATUS = Literal['unknown', 'insync', 'outofsync']

CONN_MODE module-attribute #

CONN_MODE = Literal['active', 'passive']

CONN_STATUS module-attribute #

CONN_STATUS = Literal['UNKNOWN', 'up', 'down']

DB_STATUS module-attribute #

DB_STATUS = Literal['unknown', 'nomod', 'mod']

DEVICE_ACTION module-attribute #

DEVICE_ACTION = Literal['add_model', 'promote_unreg']

DEV_STATUS module-attribute #

DEV_STATUS = Literal['none', 'unknown', 'checkedin', 'inprogress', 'installed', 'aborted', 'sched', 'retry', 'canceled', 'pending', 'retrieved', 'changed_conf', 'sync_fail', 'timeout', 'rev_revert', 'auto_updated']

MGMT_MODE module-attribute #

MGMT_MODE = Literal['unreg', 'fmg', 'faz', 'fmgfaz']

OP_MODE module-attribute #

OP_MODE = Literal['nat', 'transparent']

OS_TYPE module-attribute #

OS_TYPE = Literal['unknown', 'fos', 'fsw', 'foc', 'fml', 'faz', 'fwb', 'fch', 'fct', 'log', 'fmg', 'fsa', 'fdd', 'fac', 'fpx', 'fna', 'ffw', 'fsr', 'fad', 'fdc', 'fap', 'fxt', 'fts', 'fai', 'fwc', 'fis', 'fed']

OS_VER module-attribute #

OS_VER = Literal['unknown', '0.0', '1.0', '2.0', '3.0', '4.0', '5.0', '6.0', '7.0', '8.0', '9.0']

ROLE module-attribute #

ROLE = Literal['slave', 'master']

VDOM_TYPE module-attribute #

VDOM_TYPE = Literal['traffic', 'admin']

BaseDevice #

Bases: BaseModel

validate_ip #

validate_ip(v)

validate input but still represent the string

Source code in pyfortinet/fmg_api/dvmdb.py
@field_validator("ip")
def validate_ip(cls, v):
    """validate input but still represent the string"""
    if v:
        assert IPvAnyAddress(v)
    return v

validate_mgmt_mode #

validate_mgmt_mode(v)

ensure using text variant

Source code in pyfortinet/fmg_api/dvmdb.py
@field_validator("mgmt_mode", mode="before")
def validate_mgmt_mode(cls, v):
    """ensure using text variant"""
    return MGMT_MODE.__dict__.get("__args__")[v] if isinstance(v, int) else v

validate_os_type #

validate_os_type(v)

ensure using text variant

Source code in pyfortinet/fmg_api/dvmdb.py
@field_validator("os_type", mode="before")
def validate_os_type(cls, v):
    """ensure using text variant"""
    return OS_TYPE.__dict__.get("__args__")[v] if isinstance(v, int) else v

validate_os_ver #

validate_os_ver(v)

ensure using text variant

Source code in pyfortinet/fmg_api/dvmdb.py
@field_validator("os_ver", mode="before")
def validate_os_ver(cls, v):
    """ensure using text variant"""
    return OS_VER.__dict__.get("__args__")[v] if isinstance(v, int) else v

Device #

Bases: FMGObject, BaseDevice

ADOM level Device object

Attributes:

Name Type Description
name str

object name

adm_usr str

admin user

adm_pass list[str]

admin password

app_ver str

App DB version

av_ver str

Anti-Virus DB version

checksum str

Configuration checksum

conf_status CONF_STATUS

Configuration status

ha_group_id int

HA group ID

ha_group_name str

HA group Name

hostname str

hostname

mgmt_if str

management interface name

mgmt_uuid str
mgt_vdom str

management VDOM

psk str

pre-shared secret

version int
platform_str str

platform name (device model)

vdom list[VDOM]

VDOM list

ha_slave Optional[List[HASlave]]

Optional[List[HASlave]]

get_vdom_scope #

get_vdom_scope(vdom: str) -> Optional[Scope]

Get Scope for a VDOM to be used by filters

Returns:

Type Description
Scope or None

The scope for the given VDOM

Source code in pyfortinet/fmg_api/dvmdb.py
def get_vdom_scope(self, vdom: str) -> Optional[Scope]:
    """Get Scope for a VDOM to be used by filters

    Returns:
        (Scope or None): The scope for the given VDOM
    """
    if vdom in (s_vdom.name for s_vdom in self.vdom):
        return Scope(name=self.name, vdom=vdom)
    return None

HASlave #

Bases: FMGObject

HA Slave object to inspect HA members

Attributes:

Name Type Description
conf_status CONF_STATUS

member HA config sync status (with other members)

#did str

device ID (cluster name)

#flags str

undocumented

idx int

device number in cluster (0,1)

name str

member device name

#oid int

undocumented

prio int

HA priority

role ROLE

member role

sn str

serial number

status CONN_STATUS

status of HA member

ModelDevice #

Bases: FMGObject, BaseDevice

Model device fields

Attributes:

Name Type Description
name

Device name

adm_usr str

Administrator username

adm_pass str

Administrator password

desc str

Device description

ip str

Device IP address

meta_fields dict

Meta fields data

mgmt_mode MGMT_MODE

Management mode of the device

os_type OS_TYPE

OS type of the device

os_ver OS_VER

OS major version

mr int

OS minor version

patch int

OS patch version

sn str

Serial number of the device

device_action DEVICE_ACTION

Device add or remove action

device_blueprint str

Device blueprint name

platform_str str

Platform string for virtual device

RealDevice #

Bases: FMGObject, BaseDevice

Device class to add or remove firewall

Attributes:

Name Type Description
name

Device name

adm_usr str

Administrator username

adm_pass str

Administrator password

desc str

Device description

ip str

Device IP address

meta_fields dict

Meta fields data

mgmt_mode MGMT_MODE

Management mode of the device

os_type OS_TYPE

OS type of the device

os_ver OS_VER

OS major version

mr int

OS minor version

patch int

OS patch version

sn str

Serial number of the device

device_action DEVICE_ACTION

Device add or remove action

device_blueprint str

Device blueprint name

VDOM #

Bases: FMGObject

Device Virtual Domain