paloalto防火墙接口使用方法及实例

原文链接: http://www.cnblogs.com/xinghen1216/p/10712098.html

1.获取账号相关的唯一API KEY  

  windows:https://x.x.x.x/api/?type=keygen&user=username&password=password
  linux:curl -k -X GET https:///x.x.x.x/api/?type=keygen&user=username&password=password

2.新建IP地址:以heimingdan_9.9.9.9为例

  https://x.x.x.x/api/?key=apikey&type=config&action=set&xpath=/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/address/entry[@name='heimingdan_9.9.9.9']&element=9.9.9.9/32

3.将IP地址添加到IP地址组:以将heimingdan_9.9.9.9添加到heimingdan_extranet为例  

  https://x.x.x.x/api/?key=apikey&type=config&action=set&xpath=/config/devices/entry/vsys/entry[@name='vsys1']/address-group/entry[@name='heimingdan_extranet']&element=heimingdan_9.9.9.9

4.提交更改

  https://x.x.x.x/api/?key=apikey&type=commit&action=partial&cmd=paapi1

  查看提交结果:https://x.x.x.x/api/?key=apikey&type=op&cmd=33607

5.将IP地址移除IP地址组

  https://x.x.x.x/api/?key=apikey&type=config&action=delete&xpath=/config/devices/entry/vsys/entry[@name='vsys1']/address-group/entry[@name='heimingdan_extranet']/static/member[text()='heimingdan_9.9.9.9']

6.删除IP地址

  https://x.x.x.x/api/?key=apikey&type=config&action=delete&xpath=/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/address/entry[@name='heimingdan_9.9.9.9']

7.获取系统信息

  curl -k 'https://x.x.x.x//api/?type=op&cmd=&key=apikey'

 

转载于:https://www.cnblogs.com/xinghen1216/p/10712098.html

你可能感兴趣的:(paloalto防火墙接口使用方法及实例)