Address
Configuration endpoint for firewall/address.
Python Attribute
fgt.api.cmdb.firewall.address
Available Methods
get()- Retrieve one entry (byname=) or list all entriespost()- Create a new entryput()- Update an existing entrydelete()- Delete an entryset()- Idempotent create-or-updateexists()- Check whether an entry exists
Examples
from hfortix_fortios import FortiOS
fgt = FortiOS(host='192.168.1.99', token='your-token')
# List all items
items = fgt.api.cmdb.firewall.address.get()
# Get specific item by name
item = fgt.api.cmdb.firewall.address.get(name='item-name')
# Create new item
result = fgt.api.cmdb.firewall.address.post(
name='web-server',
subnet='192.0.2.10 255.255.255.255',
comment='Production web server',
)
# Update existing item
result = fgt.api.cmdb.firewall.address.put(
name='web-server',
comment='Updated comment',
color=3,
)
# Delete item
result = fgt.api.cmdb.firewall.address.delete(name='web-server')
Method Reference
get()
get(
name=None, # Key field: fetch one entry when given
filter=None, # list[str] of filter expressions
sort=None,
format=None,
count=None,
start=None,
payload_dict=None,
vdom=None,
error_mode=None, # 'raise' | 'return' | 'print'
error_format=None, # 'detailed' | 'simple' | 'code_only'
)
Select a specific entry (name=) or list all entries from the table.
Returns FortiObject for a single entry, FortiObjectList for a listing.
post()
post(
payload_dict=None,
name=None,
uuid=None,
subnet=None,
type=None, # 'ipmask' | 'iprange' | 'fqdn' | 'geography' | ...
route_tag=None,
sub_type=None,
clearpass_spt=None,
macaddr=None,
start_ip=None,
end_ip=None,
fqdn=None,
country=None,
wildcard_fqdn=None,
comment=None,
associated_interface=None,
color=None,
allow_routing=None, # 'enable' | 'disable'
fabric_object=None, # 'enable' | 'disable'
# ... more schema fields; keyword names mirror the API field
# names with '-' replaced by '_'
q_action=None, # 'clone'
q_nkey=None, # New key when cloning
q_scope=None,
vdom=None,
error_mode=None,
error_format=None,
)
Create object(s) in this table. There is no **kwargs — only the schema
fields above (and the remaining generated ones) are accepted.
put()
put(
payload_dict=None,
name=None, # Key field of the entry to update
uuid=None,
subnet=None,
type=None,
route_tag=None,
sub_type=None,
clearpass_spt=None,
macaddr=None,
start_ip=None,
end_ip=None,
fqdn=None,
country=None,
wildcard_fqdn=None,
comment=None,
# ... more schema fields, same set as post()
q_action=None, # 'move'
q_before=None, # Move before this key
q_after=None, # Move after this key
q_scope=None,
vdom=None,
error_mode=None,
error_format=None,
)
Update this specific resource (identified by name=).
delete()
delete(
name=None, # Key field of the entry to delete
q_scope=None,
vdom=None,
error_mode=None,
error_format=None,
)
Delete this specific resource.
set() and exists()
# True/False without raising
fgt.api.cmdb.firewall.address.exists(name='web-server')
# Create if missing, update if present (same parameters as post()/put())
fgt.api.cmdb.firewall.address.set(
name='web-server',
subnet='192.0.2.10 255.255.255.255',
)