Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 44 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ Optional settings:
- ## Parameters
* name: Can lock specific adom using name as a filter.

### 4) Unlock Adom (in workspace mode)
### 4) Save Adom (in workspace mode)
```python
>>> fortimngr.save_adom()

### 5) Unlock Adom (in workspace mode)
```python
>>> fortimngr.unlock_adom()
```
Expand All @@ -78,7 +82,7 @@ Optional settings:
* name: Can lock specific adom using name as a filter.

# User Operations : Policy Package
### 5) Get all the policy packages configured on FortiManager.
### 6) Get all the policy packages configured on FortiManager.
```python
>>> fortimngr.get_policy_packages()
```
Expand All @@ -89,7 +93,7 @@ Optional settings:
* name: Can get specific package using name as a filter.


### 6) Add your own policy package in FortiManager.
### 7) Add your own policy package in FortiManager.
```python
>>> fortimngr.add_policy_package(name="TestPackage")
```
Expand All @@ -99,7 +103,7 @@ Optional settings:

# User Operations : Address Objects

### 7) Get all address objects from FortiManager.
### 8) Get all address objects from FortiManager.

```python
>>> fortimngr.get_firewall_address_objects()
Expand All @@ -111,7 +115,7 @@ Optional settings:
>>> fortimngr.get_firewall_address_v6_objects()
```

### 8) Get specific address object from FortiManager.
### 9) Get specific address object from FortiManager.

```python
>>> fortimngr.get_firewall_address_objects(name="YourObjectName")
Expand All @@ -122,7 +126,7 @@ Optional settings:

* name: Specify object name that you want to see.

### 9) Create an address object.
### 10) Create an address object.

```python
>>> fortimngr.add_firewall_address_object(name="TestObject",
Expand All @@ -137,7 +141,7 @@ Optional settings:
* associated_interface: Provide interface to which this object belongs if any. {Default is kept any}
* subnet: Specify the subnet in a list format eg.["1.1.1.1", "255.255.255.255"]

### 9bis) Create an v6 address object.
### 10bis) Create an v6 address object.

```python
>>> fortimngr.add_firewall_address_v6_object(name="TestObject",
Expand All @@ -151,7 +155,7 @@ Optional settings:
* associated_interface: Provide interface to which this object belongs if any. {Default is kept any}
* subnet: Specify the subnet in a list format eg.["1.1.1.1", "255.255.255.255"]
* subnet6 : Specify the subnet IPv6 in a string format eg. "2001:0001::1/128"
### 10) Update address object.
### 11) Update address object.

```python
>>> fortimngr.update_firewall_address_object(name="TestObject",
Expand All @@ -170,7 +174,7 @@ Optional settings:
* name: Enter the name of the object that needs to be updated
* data: You can get the **kwargs parameters with "show_params_for_object_update()" method or "

### 11) Delete address object.
### 12) Delete address object.

```python
>>> fortimngr.delete_firewall_address_object(object_name="TestObject")
Expand All @@ -184,14 +188,14 @@ Optional settings:

# User Operations : Address Groups

### 12) Get all address groups.
### 13) Get all address groups.

```python
>>> fortimngr.get_address_groups()
>>> fortimngr.get_address_v6_groups()
```

### 13) Get specific address group.
### 14) Get specific address group.

```python
>>> fortimngr.get_address_groups(name="TestGroup")
Expand All @@ -202,7 +206,7 @@ Optional settings:

* name: Specify the name the address group.

### 14) Create your own address group.
### 15) Create your own address group.

```python
>>> fortimngr.add_address_group(name="Test_Group",
Expand All @@ -217,7 +221,7 @@ Optional settings:
* members: pass your object names as members in a list eg. ["TestObject1", "TestObject2"]
> Note: An address group should consist atleast 1 member.

### 15) Update the address group.
### 16) Update the address group.

```python
>>> fortimngr.update_address_group(name="Test_Group",
Expand All @@ -236,7 +240,7 @@ Optional settings:
do="add" will add the object in the address group
do="remove" will remove the object from address group

### 16) Delete the address group.
### 17) Delete the address group.

```python
>>> fortimngr.delete_address_group(name="Test_group")
Expand All @@ -250,7 +254,7 @@ Optional settings:
---
# User Operations : VirtualIP Objects

### 17) Get all VIP objects from FortiManager.
### 18) Get all VIP objects from FortiManager.

```python
>>> fortimngr.get_firewall_vip_objects()
Expand All @@ -260,7 +264,7 @@ Optional settings:

# User Operations : Add Devices

### 18) Add devices to FortiManager.
### 19) Add devices to FortiManager.

Add an existing device:

Expand Down Expand Up @@ -292,7 +296,7 @@ Optional arguments:
* mr (default=4)
* platform_str (default "", "FortiGate-VM64" for virtual Fortigate)

### 19) Get devices From FortiManager.
### 20) Get devices From FortiManager.

```python
>>> fortimngr.get_devices()
Expand All @@ -301,12 +305,12 @@ Optional arguments:

# User Operations : Meta Data

### 20) Get Meta Data From FortiManager.
### 21) Get Meta Data From FortiManager.
```python
>>> fortimngr.get_meta_data()
```

### 21) Add Meta Data to FortiManager.
### 22) Add Meta Data to FortiManager.
```python
>>> fortimngr.add_meta_data(name="Meta_Data_1",
status=1)
Expand All @@ -316,7 +320,7 @@ Optional arguments:
* :param name: name of the meta tag
* :param status: status of meta tag whether it should be active(1) or disabled(0)

### 22) Assign Meta Data to a FortiGate.
### 23) Assign Meta Data to a FortiGate.
```python
>>> fortimngr.assign_meta_to_device(device="FortiGateVM64",
meta_name="Meta_Data_1",
Expand All @@ -329,7 +333,7 @@ Optional arguments:
* :param meta_value: value of the meta tag
# User Operations : Policies

### 23) Assign Meta Data to a FortiGate VDOM.
### 24) Assign Meta Data to a FortiGate VDOM.
```python
>>> fortimngr.assign_meta_to_device_vdom(device="FortiGateVM64",
vdom="vdom",
Expand All @@ -344,7 +348,7 @@ Optional arguments:
* :param meta_value: value of the meta tag
# User Operations : Policies

### 24) Get all the policies in your Policy Package.
### 25) Get all the policies in your Policy Package.

```python
>>> fortimngr.get_firewall_policies(policy_package_name="YourPolicyPackageName")
Expand All @@ -354,7 +358,7 @@ Optional arguments:

* policy_package_name: Enter the policy package name.

### 25) Get specific policiy in your Policy Package using PolicyID filter.
### 26) Get specific policiy in your Policy Package using PolicyID filter.

```python
>>> fortimngr.get_firewall_policies(policy_package_name="YourPolicyPackageName", policyid=3)
Expand All @@ -365,23 +369,23 @@ Optional arguments:
* policy_package_name: Enter the policy package name.
* policyid: Can filter and get the policy you want using policyID

### 26) Get global header policy
### 27) Get global header policy

fortimngr.get_global_header_policies

### 27) Get header policy
### 28) Get header policy

fortimngr.get_firewall_header_policies

### 28) Get global footer policy
### 29) Get global footer policy

fortimngr.get_global_footer_policies

### 29) Get footer policy
### 30) Get footer policy

fortimngr.get_firewall_footer_policies

### 30) Create your own policy in your Policy Package.
### 31) Create your own policy in your Policy Package.

```python
>>> fortimngr.add_firewall_policy(policy_package_name="YourPolicyPackageName",
Expand Down Expand Up @@ -426,7 +430,7 @@ fortimngr.get_firewall_footer_policies
logtraffic=2 Means Log All Sessions


### 31) Update the policy in your Policy Package.
### 32) Update the policy in your Policy Package.

```python
>>> fortimngr.update_firewall_policy(policy_package_name="YourPolicyPackageName",
Expand All @@ -443,7 +447,7 @@ fortimngr.get_firewall_footer_policies
* data: You can get the **kwargs parameters with "show_params_for_policy_update()" method


### 32) Delete the policy in your Policy Package.
### 33) Delete the policy in your Policy Package.

```python
>>> fortimngr.delete_firewall_policy(policy_package_name="YourPolicyPackageName",
Expand All @@ -458,7 +462,7 @@ fortimngr.get_firewall_footer_policies



### 33) Move Firewall Policy.
### 34) Move Firewall Policy.

```python
>>> fortimngr.move_firewall_policy(policy_package_name="LocalLab",
Expand All @@ -476,14 +480,14 @@ fortimngr.get_firewall_footer_policies

# User Operations : Installing the Policy Package.

### 34) Installing the Policy Package.
### 35) Installing the Policy Package.

```python
>>> fortimngr.install_policy_package(package_name="Your Policy Package name")

```

### 35) Adding Installation Targets to a Policy Package.
### 36) Adding Installation Targets to a Policy Package.

```python
>>> fortimngr.add_install_target(device_name="FortiGateVM64",
Expand All @@ -500,7 +504,7 @@ fortimngr.get_firewall_footer_policies

# Show Params for updation of Policies and Objects.

### 36) Parameters for updating Address Object.
### 37) Parameters for updating Address Object.

```python
>>> fortimngr.show_params_for_object_update()
Expand All @@ -515,7 +519,7 @@ fortimngr.get_firewall_footer_policies
subnet[list] : IP/Netmask
object_type(int) : Type

### 37) Parameters for updating Policy.
### 38) Parameters for updating Policy.

```python
>>> fortimngr.show_params_for_policy_update()
Expand All @@ -536,7 +540,7 @@ fortimngr.get_firewall_footer_policies

# User Operations : Adding scripts in Fortimanager.

### 38) Add a script in FortiManager's Database.
### 39) Add a script in FortiManager's Database.

```python
>>> fortimngr.create_script(name="Test Script Template",
Expand All @@ -556,13 +560,13 @@ fortimngr.get_firewall_footer_policies
```


### 39) Get all scripts from FortiManager's Database.
### 40) Get all scripts from FortiManager's Database.

```python
>>> fortimngr.get_all_scripts()
```

### 40) Delete a script from FortiManager's Database.
### 41) Delete a script from FortiManager's Database.

```python
>>> fortimngr.delete_script(name="Test Script Template")
Expand All @@ -571,7 +575,7 @@ fortimngr.get_firewall_footer_policies

* :param name: Specify a name for the script tha need to be deleted.

### 41) Run a script on FortiManager's Database/ FortiGate's Remote CLI.
### 42) Run a script on FortiManager's Database/ FortiGate's Remote CLI.

```python
>>> fortimngr.run_script_on_single_device(script_name="test_script",
Expand Down Expand Up @@ -602,7 +606,7 @@ fortimngr.get_firewall_footer_policies
```
* :param script_name: Specify the script name that should be executed on the specified devices

### 42) Backup FortiGate's configuration from FortiManager and store it in TFTP server.
### 43) Backup FortiGate's configuration from FortiManager and store it in TFTP server.

```python
>>> fortimngr.backup_config_of_fortiGate_to_tftp(tftp_ip="1.1.1.1",
Expand Down
Loading