connection
FMG connection
FMGSync #
Bases: FMG
Fortimanager connection class
add_cli_template #
add_cli_template(name: str, script: str, description: str = '', provision: Literal['disable', 'enable'] = 'disable', type: Literal['cli', 'jinja'] = 'jinja', variables: Optional[List[dict]] = None) -> FMGResponse
Add CLI template
Source code in fortimanager_template_sync/fmg_api/connection.py
add_cli_template_group #
add_cli_template_group(name: str, description: str = '', member: Optional[List[str]] = None, variables: Optional[List[dict]] = None) -> FMGResponse
Add CLI template group
Source code in fortimanager_template_sync/fmg_api/connection.py
add_fmg_variable #
add_fmg_variable(name: str, value: Optional[str] = None, description: Optional[str] = None) -> FMGResponse
Add metadata variable to use in CLI templates
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
variable name |
required |
value |
str
|
default value |
None
|
description |
str
|
variable description |
None
|
Source code in fortimanager_template_sync/fmg_api/connection.py
assign_cli_template #
Assign group or device to template
Examples:
target = {"name": "mygroup"}
target = {"name": "myfw", "vdom": "root"}
target = [ {"name": "group1"}, {"name": "group2"} ]
Parameters:
Name | Type | Description | Default |
---|---|---|---|
template |
str
|
name of template |
required |
target |
Union[Dict[str, str], List[Dict[str, str]]]
|
a single object or a list of objects to assign to the template |
required |
Source code in fortimanager_template_sync/fmg_api/connection.py
assign_cli_template_group #
Assign group or device to template group
Examples:
target = {"name": "mygroup"}
target = {"name": "myfw", "vdom": "root"}
target = [ {"name": "group1"}, {"name": "group2"} ]
Parameters:
Name | Type | Description | Default |
---|---|---|---|
template_group |
str
|
name of template |
required |
target |
Union[Dict[str, str], List[Dict[str, str]]]
|
a single object or a list of objects to assign to the template |
required |
Raises:
Type | Description |
---|---|
FMGInvalidDataException
|
if target is invalid or non-existent |
Source code in fortimanager_template_sync/fmg_api/connection.py
delete_cli_template #
Delete CLI template
Source code in fortimanager_template_sync/fmg_api/connection.py
delete_cli_template_group #
Delete CLI template
Source code in fortimanager_template_sync/fmg_api/connection.py
get_cli_template #
Get a specific CLI template
Source code in fortimanager_template_sync/fmg_api/connection.py
get_cli_template_group #
Get a specific CLI template group
Source code in fortimanager_template_sync/fmg_api/connection.py
get_cli_template_groups #
Get CLI template groups
Source code in fortimanager_template_sync/fmg_api/connection.py
get_cli_templates #
Get CLI templates
Source code in fortimanager_template_sync/fmg_api/connection.py
get_devices #
Get devices
Source code in fortimanager_template_sync/fmg_api/connection.py
get_fmg_variable #
Get a specific variable
Source code in fortimanager_template_sync/fmg_api/connection.py
get_fmg_variables #
Get metadata variables based on filter
Source code in fortimanager_template_sync/fmg_api/connection.py
get_group_members #
Get group members
Source code in fortimanager_template_sync/fmg_api/connection.py
set_cli_template #
set_cli_template(name: str, script: str, new_name: str = '', description: str = '', provision: Literal['disable', 'enable'] = 'disable', type: Literal['cli', 'jinja'] = 'jinja', variables: Optional[List[dict]] = None) -> FMGResponse
Update a CLI template
Source code in fortimanager_template_sync/fmg_api/connection.py
set_cli_template_group #
set_cli_template_group(name: str, description: str = '', member: Optional[List[str]] = None, variables: Optional[List[dict]] = None) -> FMGResponse
Set CLI template group
Source code in fortimanager_template_sync/fmg_api/connection.py
set_fmg_variable #
set_fmg_variable(name: str, value: Optional[str] = None, description: Optional[str] = None) -> FMGResponse
Update metadata variable to use in CLI templates
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
variable name |
required |
value |
str
|
default value |
None
|
description |
str
|
variable description |
None
|
Source code in fortimanager_template_sync/fmg_api/connection.py
update_cli_template #
update_cli_template(name: str, script: str, new_name: str = '', description: str = '', provision: Literal['disable', 'enable'] = 'disable', type: Literal['cli', 'jinja'] = 'jinja', variables: Optional[List[dict]] = None) -> FMGResponse
Update a CLI template
Source code in fortimanager_template_sync/fmg_api/connection.py
update_cli_template_group #
update_cli_template_group(name: str, description: str = '', member: Optional[List[str]] = None, variables: Optional[List[dict]] = None) -> FMGResponse
Update CLI template group
Source code in fortimanager_template_sync/fmg_api/connection.py
update_fmg_variable #
update_fmg_variable(name: str, value: Optional[str] = None, description: Optional[str] = None) -> FMGResponse
Update metadata variable to use in CLI templates
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
variable name |
required |
value |
str
|
default value |
None
|
description |
str
|
variable description |
None
|