Fortinet Document Library

Version:

Version:


Table of Contents

Download PDF
Copy Link

REST API for IP group management

IP groups and the members of each group can be created, deleted, and managed through the REST API.

Note

REST API only supports IP range values. The IP/netmask format is not accepted.

Create a new IP group

URL

HTTP method

http(s)://ip_or_hostname/api/v1/ProfIp_address_group/new_group_name POST

Delete an IP group

URL

HTTP method

http(s)://ip_or_hostname/api/v1/ProfIp_address_group/group_to_delete DELETE

Add a new member to an IP group

Note that members can only be added when expressed as an IP range.

URL

HTTP method

http://ip_or_hostname/api/v1/profip_address_group/group_name/ProfIp_address_groupIpAddressGroupMember/member_ip_range POST
Example:

In the following example, the IP range 172.20.200.11-172.20.200.30 is added to the IP group named group3:

http://ip_or_hostname/api/v1/ProfIp_address_group/group3/ProfIp_address_groupIpAddressGroupMember/172.20.200.11-172.20.200.30

Delete a member from an IP group

URL

HTTP method

http://ip_or_hostname/api/v1/ProfIp_address_group/group_name/ProfIp_address_groupIpAddressGroupMember/member_ip_range DELETE

Replace all members of an IP group

URL

HTTP method

http://ip_or_hostname/api/v1/ProfIp_address_group/group_name/ProfIp_address_groupIpAddressGroupMember/ PUT or POST
JSON data:

{ "reqAction":10, // set to 10 to replace all existing members

"reqObjCount":n, // size of the new member list

"mkey_0":"ip_range_1", // first new member

"mkey_1":"ip_range_2", // second new member

...

"mkey_[n-1]":"ip_range_n" // nth new member

}

Example:

The following URL and will clear the member list for the IP group group3, then add two new members:

http://ip_or_hostname/api/v1/ProfIp_address_group/group3/ProfIp_address_groupIpAddressGroupMember/

JSON data:

{ "reqAction":10,

"reqObjCount":2,

"mkey_0":"172.20.110.10-172.20.110.20",

"mkey_1":"172.20.130.10-172.20.130.30"

}

REST API for IP group management

IP groups and the members of each group can be created, deleted, and managed through the REST API.

Note

REST API only supports IP range values. The IP/netmask format is not accepted.

Create a new IP group

URL

HTTP method

http(s)://ip_or_hostname/api/v1/ProfIp_address_group/new_group_name POST

Delete an IP group

URL

HTTP method

http(s)://ip_or_hostname/api/v1/ProfIp_address_group/group_to_delete DELETE

Add a new member to an IP group

Note that members can only be added when expressed as an IP range.

URL

HTTP method

http://ip_or_hostname/api/v1/profip_address_group/group_name/ProfIp_address_groupIpAddressGroupMember/member_ip_range POST
Example:

In the following example, the IP range 172.20.200.11-172.20.200.30 is added to the IP group named group3:

http://ip_or_hostname/api/v1/ProfIp_address_group/group3/ProfIp_address_groupIpAddressGroupMember/172.20.200.11-172.20.200.30

Delete a member from an IP group

URL

HTTP method

http://ip_or_hostname/api/v1/ProfIp_address_group/group_name/ProfIp_address_groupIpAddressGroupMember/member_ip_range DELETE

Replace all members of an IP group

URL

HTTP method

http://ip_or_hostname/api/v1/ProfIp_address_group/group_name/ProfIp_address_groupIpAddressGroupMember/ PUT or POST
JSON data:

{ "reqAction":10, // set to 10 to replace all existing members

"reqObjCount":n, // size of the new member list

"mkey_0":"ip_range_1", // first new member

"mkey_1":"ip_range_2", // second new member

...

"mkey_[n-1]":"ip_range_n" // nth new member

}

Example:

The following URL and will clear the member list for the IP group group3, then add two new members:

http://ip_or_hostname/api/v1/ProfIp_address_group/group3/ProfIp_address_groupIpAddressGroupMember/

JSON data:

{ "reqAction":10,

"reqObjCount":2,

"mkey_0":"172.20.110.10-172.20.110.20",

"mkey_1":"172.20.130.10-172.20.130.30"

}