topic Re: Pulling interface and zone details for an IP using PAN device framework in Automation/API Discussionshttps://live.paloaltonetworks.com/t5/automation-api-discussions/pulling-interface-and-zone-details-for-an-ip-using-pan-device/m-p/310784#M2176
<P><LI-USER uid="46544"></LI-USER>&nbsp;</P><P>&nbsp;</P><P>Thanks for your help .&nbsp; <LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"></LI-EMOJI></P><P>&nbsp;</P><P>&nbsp;</P>Wed, 12 Feb 2020 13:58:01 GMTdeepak122020-02-12T13:58:01ZPulling interface and zone details for an IP using PAN device frameworkhttps://live.paloaltonetworks.com/t5/automation-api-discussions/pulling-interface-and-zone-details-for-an-ip-using-pan-device/m-p/308632#M2153
<P><LI-USER uid="15566"></LI-USER>&nbsp;and all ,</P><P>&nbsp;</P><P>I am trying to pull interface and zone details for an IP using PAN device framework.</P><P>&nbsp;</P><P>Could you please help me on this. My end goal is to run test_security match cmd to find if rule is allow or not .</P><P>Current i can do this using fw.op() but i need to put pull zone details manually .</P><P>&nbsp;</P><P>Thanks</P><P>&nbsp;</P>Thu, 30 Jan 2020 07:08:40 GMThttps://live.paloaltonetworks.com/t5/automation-api-discussions/pulling-interface-and-zone-details-for-an-ip-using-pan-device/m-p/308632#M2153deepak122020-01-30T07:08:40ZRe: Pulling interface and zone details for an IP using PAN device frameworkhttps://live.paloaltonetworks.com/t5/automation-api-discussions/pulling-interface-and-zone-details-for-an-ip-using-pan-device/m-p/308812#M2156
<P>If you're using pandevice, there's a function for this specifically:</P>
<P>&nbsp;</P>
<P><A href="https://pandevice.readthedocs.io/en/latest/module-base.html#pandevice.base.PanDevice.test_security_policy_match" target="_blank">https://pandevice.readthedocs.io/en/latest/module-base.html#pandevice.base.PanDevice.test_security_policy_match</A></P>Fri, 31 Jan 2020 00:24:32 GMThttps://live.paloaltonetworks.com/t5/automation-api-discussions/pulling-interface-and-zone-details-for-an-ip-using-pan-device/m-p/308812#M2156gfreeman2020-01-31T00:24:32ZRe: Pulling interface and zone details for an IP using PAN device frameworkhttps://live.paloaltonetworks.com/t5/automation-api-discussions/pulling-interface-and-zone-details-for-an-ip-using-pan-device/m-p/308830#M2157
<P>Hi&nbsp;<LI-USER uid="46544"></LI-USER>&nbsp;,</P><P>&nbsp;</P><P>Yeah , I am using thing . However i was referring Pulling details regrading Zone details for an IP.</P><P>&nbsp;</P><P>Currently i need to verify Zone for an IP from firewall using cli and entering details in function .</P><P>&nbsp;</P><P>I am trying to pull interface and zone details for an IP using pandevice.</P>Fri, 31 Jan 2020 05:55:01 GMThttps://live.paloaltonetworks.com/t5/automation-api-discussions/pulling-interface-and-zone-details-for-an-ip-using-pan-device/m-p/308830#M2157deepak122020-01-31T05:55:01ZRe: Pulling interface and zone details for an IP using PAN device frameworkhttps://live.paloaltonetworks.com/t5/automation-api-discussions/pulling-interface-and-zone-details-for-an-ip-using-pan-device/m-p/309426#M2159
<P><LI-USER uid="46544"></LI-USER>&nbsp;,</P><P>&nbsp;</P><P>HI ,</P><P>Just checking if you can help me on this.</P>Tue, 04 Feb 2020 17:02:18 GMThttps://live.paloaltonetworks.com/t5/automation-api-discussions/pulling-interface-and-zone-details-for-an-ip-using-pan-device/m-p/309426#M2159deepak122020-02-04T17:02:18ZRe: Pulling interface and zone details for an IP using PAN device frameworkhttps://live.paloaltonetworks.com/t5/automation-api-discussions/pulling-interface-and-zone-details-for-an-ip-using-pan-device/m-p/309452#M2160
<P>So if you get the info from the CLI, then just mimic what command the CLI uses with pandevice and then you can invoke the function.</P>
<P>&nbsp;</P>
<P>You can see what op command the CLI is executing by doing <CODE>cli debug enable</CODE> before executing the command, then styling your pandevice <CODE>fw.op()</CODE> similarly.</P>Tue, 04 Feb 2020 19:00:00 GMThttps://live.paloaltonetworks.com/t5/automation-api-discussions/pulling-interface-and-zone-details-for-an-ip-using-pan-device/m-p/309452#M2160gfreeman2020-02-04T19:00:00ZRe: Pulling interface and zone details for an IP using PAN device frameworkhttps://live.paloaltonetworks.com/t5/automation-api-discussions/pulling-interface-and-zone-details-for-an-ip-using-pan-device/m-p/309616#M2167
<P>HI ,<LI-USER uid="46544"></LI-USER>&nbsp;</P><P>Thanks for helping me on this . So i tried but getting below erroro:</P><P>&nbsp;</P><P>"PanURLError: URLError: code: 400 reason: Illegal parameter [request]"</P><P>&nbsp;</P><P>I tried to use fw.op() .&nbsp; As mentioned by you i enable the debug and got below :</P><P>&nbsp;</P><P>&lt;request cmd="op" cookie="9191129909288394" uid="1003"&gt;&lt;operations&gt;&lt;test&gt;&lt;routing&gt;&lt;fib-lookup&gt;&lt;virtual-router&gt;default&lt;/virtual-router&gt;&lt;ip&gt;10.1.1.1&lt;/ip&gt;&lt;/fib-lookup&gt;&lt;/routing&gt;&lt;/test&gt;&lt;/operations&gt;&lt;/request&gt;</P><P>&nbsp;</P><P>Could you please confirm me the value i need to pass for Op function .</P><P>i was trying using below:</P><P>test&gt;&lt;routing&gt;&lt;fib-lookup&gt;&lt;virtual-router&gt;default&lt;/virtual-router&gt;&lt;ip&gt;10.1.1.1&lt;/ip&gt;&lt;/fib-lookup&gt;&lt;/routing&gt;&lt;/test&gt;</P><P>&nbsp;</P><P>Thanks</P><P>&nbsp;</P><P>&nbsp;</P>Wed, 05 Feb 2020 18:46:32 GMThttps://live.paloaltonetworks.com/t5/automation-api-discussions/pulling-interface-and-zone-details-for-an-ip-using-pan-device/m-p/309616#M2167deepak122020-02-05T18:46:32ZRe: Pulling interface and zone details for an IP using PAN device frameworkhttps://live.paloaltonetworks.com/t5/automation-api-discussions/pulling-interface-and-zone-details-for-an-ip-using-pan-device/m-p/310438#M2173
<P>You have a few options for how to pass it in.</P>
<P>&nbsp;</P>
<P><SPAN style="font-family: inherit;">1. Have pandevice create the XML command:</SPAN></P>
<P>&nbsp;</P>
<LI-CODE lang="python">fw.op('test routing fib-lookup virtual-router "default" ip "10.1.1.1"')</LI-CODE>
<P>&nbsp;</P>
<P>2. Pass in the XML command yourself:</P>
<P>&nbsp;</P>
<LI-CODE lang="python">fw.op('&lt;test&gt;&lt;routing&gt;&lt;fib-lookup&gt;&lt;virtual-router&gt;default&lt;/virtual-router&gt;&lt;ip&gt;10.1.1.1&lt;/ip&gt;&lt;/fib-lookup&gt;&lt;/routing&gt;&lt;/test&gt;', cmd_xml=False)</LI-CODE>
<P>&nbsp;</P>Mon, 10 Feb 2020 19:31:41 GMThttps://live.paloaltonetworks.com/t5/automation-api-discussions/pulling-interface-and-zone-details-for-an-ip-using-pan-device/m-p/310438#M2173gfreeman2020-02-10T19:31:41ZRe: Pulling interface and zone details for an IP using PAN device frameworkhttps://live.paloaltonetworks.com/t5/automation-api-discussions/pulling-interface-and-zone-details-for-an-ip-using-pan-device/m-p/310784#M2176
<P><LI-USER uid="46544"></LI-USER>&nbsp;</P><P>&nbsp;</P><P>Thanks for your help .&nbsp; <LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"></LI-EMOJI></P><P>&nbsp;</P><P>&nbsp;</P>Wed, 12 Feb 2020 13:58:01 GMThttps://live.paloaltonetworks.com/t5/automation-api-discussions/pulling-interface-and-zone-details-for-an-ip-using-pan-device/m-p/310784#M2176deepak122020-02-12T13:58:01Z