Dynamic Objects Error

Announcements

ATTENTION Customers, All Partners and Employees: The Customer Support Portal (CSP) will be undergoing maintenance and unavailable on Saturday, November 7, 2020, from 11 am to 11 pm PST. Please read our blog for more information.

Reply
Highlighted
L2 Linker

Dynamic Objects Error

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>

Highlighted
L3 Networker

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...

Highlighted
L4 Transporter

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

Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

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 Live Community as a whole!

The Live Community thanks you for your participation!