Using R80 API to automate objects

From Tech-Wiki
Jump to: navigation, search

Back to Gaia

You can leverage R80's API to automate objects creation or rule additions/modifications.


Management:

mgmt_cli <command>

Gaia:

 mgmt add host

Web:

 POST https://<mgmt-server>:<port>/web_api/add-host

Content-Type application/json
X-chkp-sid string token returned by login request


SmartConsole:

add host name "abc" ip-address "192.168.0.1" groups.1 "Group 1" groups.2 "Group 2"
add group name "abc" members.1 "Host1" members.2 "Host2"
set group name "abc" members.add "Host"
add group-with-exclusion name "abc" include "Group1" except "Group 2"
add network name "abc" subnet "192.168.0.1" subnet-mask "255.255.255.0"
add address-range name "abc" ip-address-first "192.168.0.1" ip-address-last "192.168.0.254"
add service-tcp name tcp.1234 port 1234
add service-udp name udp.1234 port 1234
add service-group name "abc" members.1 "http"
set service-group name "abc" members.add "http"
add access-rule layer "Network" position 10 name "Rule 1" source.1 "host1" destination.1 "Host2" service.1 "SMTP" action accept track log