paloalto防火牆接口使用方法及實例


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=<ip-netmask>9.9.9.9/32</ip-netmask>

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=<static><member>heimingdan_9.9.9.9</member></static>

4.提交更改

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

  查看提交結果:https://x.x.x.x/api/?key=apikey&type=op&cmd=<show><jobs><id>33607</id></jobs></show>

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=<show><system><info></info></system></show>&key=apikey'

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM