Skip to content

dvmdb

Device DB objects

ADOM_FLAGS module-attribute #

ADOM_FLAGS = Literal[
    "migration",
    "db_export",
    "no_vpn_console",
    "backup",
    "other_devices",
    "is_autosync",
    "per_device_wtp",
    "policy_check_on_install",
    "install_on_policy_check_fail",
    "auto_push_cfg",
    "per_device_fsw",
]

ADOM_MODE module-attribute #

ADOM_MODE = Literal['ems', 'gms', 'provider']

ADOM_RESTRICTED_PRDS module-attribute #

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

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']

ADOM #

Bases: FMGObject

ADOM object

Attributes:

Name Type Description
create_time Optional[int]
desc Optional[str]
flags Optional[Union[ADOM_FLAGS, List[ADOM_FLAGS]]]
log_db_retention_hours Optional[int]
log_disk_quota Optional[int]
log_disk_quota_alert_thres Optional[int]
log_disk_quota_split_ratio Optional[int]
log_file_retention_hours Optional[int]
meta_fields Optional[dict[str, str]]
mig_mr Optional[int]
mig_os_ver Optional[OS_VER]
mode Optional[ADOM_MODE]
mr Optional[int]
name Optional[str]
os_ver Optional[OS_VER]
restricted_prds Optional[ADOM_RESTRICTED_PRDS]
state Optional[int]
uuid Optional[str]
workspace_mode Optional[int]

Device #

Bases: FMGObject

ADOM level Device object

Attributes:

Name Type Description
device str

device name to target by API call

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

desc str

Device description

ha_group_id int

HA group ID

ha_group_name str

HA group Name

hostname str

hostname

ip str

Device IP address

meta_fields dict

Meta fields data

mgmt_if str

management interface name

mgmt_mode MGMT_MODE

Management mode of the device

mgmt_uuid str
mgt_vdom str

management VDOM

mr int

OS minor version

os_type OS_TYPE

OS type of the device

os_ver OS_VER

OS major version

patch int

OS patch version

psk str

pre-shared secret

sn str

Serial number of the device

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

validate_conf_status #

validate_conf_status(v) -> CONF_STATUS

ensure using text variant

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

validate_conn_mode #

validate_conn_mode(v) -> CONN_MODE

ensure using text variant

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

validate_conn_type #

validate_conn_type(v) -> CONN_STATUS

ensure using text variant

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

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

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

VDOM #

Bases: FMGObject

Device Virtual Domain