Skip to content

settings

Fortimanager settings

FMGSettings #

Bases: BaseSettings

Fortimanager settings

Attributes:

Name Type Description
base_url str

Base URL to access FMG (e.g.: https://myfmg/jsonrpc)

username str

User to authenticate

password str

Password for authentication

adom str

ADOM to use for this connection

verify bool

Verify SSL certificate (REQUESTS_CA_BUNDLE can set accepted CA cert)

timeout float

Connection timeout for requests in seconds

raise_on_error bool

Raise exception on error

check_base_url #

check_base_url(v: str)

check and fix base_url

Source code in pyfortinet/settings.py
@field_validator("base_url", mode="before")
def check_base_url(cls, v: str):
    """check and fix base_url"""
    v = v.rstrip("/ ")
    if not v.endswith("/jsonrpc"):
        v += "/jsonrpc"
    return HttpUrl(v)