- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
10-04-2013 04:10 AM
I’m trying to test using dynamic objects on 5.0 however I’m not sure If I’m missing something?
The document suggests the syntax to add a new entry do a dynamic address object is as follows:
https://<IP>/api/?type=user-id&action=set&key=<KEY>=&file-name=<XMLFILE>
Where IP is the IP address of the firewall under management, KEY is the pre-generated key for the PAN-OS firewall and XMLFILE is the name of the XML file with the needed additions and/or deletions for the dynamic address object.
I’ve generated the key by creating a dedicated admin account.
But what I’m not sure about is the <XMLFILE>? Do I need to upload a file or do I reference a file somehow?
I get the following error when I run the command just using a generic file name eg. dynobj.xml:
<response status="error" code="400">
<result>
<msg>No file uploaded</msg>
</result>
</response>
10-04-2013 05:20 PM
There is similar issue resolved in 5.0.8.
Please refer to release notes at https://downloads.paloaltonetworks.com/software/PAN-OS-5.0.8-RN-revA.PDF?__gda__=1380975467_35d69ebd...
10-06-2013 07:43 PM
Hello,
I've only seen this done through cli tools, using the filename in the URL does a GET request, instead you need to do a POST to submit data to the resource. Have you tried using curl or wget to import the file?
example:
curl --form file=@userdata.xml
"http://<firewall>/api/?type=user-id&action=set&key=XXXXXX"
Your response should be -
<response status="success">
<msg>
<line>userdata.xml saved</line>
</msg>
</response>
FYI: there is a known bug on files could not be uploaded to the firewall using CURL with the XML API was fixed in 5.0.4.
Refer to page 17 & 18 of the following article for the input file format:
https://live.paloaltonetworks.com/docs/DOC-4126
Hope that helps!
Aditi
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!