<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Using x-path with spaces in Automation/API Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/using-x-path-with-spaces/m-p/331785#M2370</link>
    <description>&lt;P&gt;Ah ok yeah from my limited understanding and knowledge I can't really see how to modify the cli command to allow for random objects with spaces. Potentially if you are wanting to persist with x-path you may need to edit these xml config files prior to importing and strip the spaces with a find and replace, before uploading the configuration file to the Palo.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However I think spending some time Python or even using Powershells API module is the better way moving forward to do scripted tasks like this as the API's are far more flexible and programmable than x-path. But I do appreciate why you might not want to make this effort, so hopefully doing a find and replace might be a workable solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 05 Jun 2020 04:36:49 GMT</pubDate>
    <dc:creator>DanielBostock</dc:creator>
    <dc:date>2020-06-05T04:36:49Z</dc:date>
    <item>
      <title>Using x-path with spaces</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/using-x-path-with-spaces/m-p/328913#M2345</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The "load config partial from x-path" is great for copy or moving config but I can't work out how to get it to deal with spaces. e.g. if I want to copy a policy and the policy name has a space in it I can't get the correct syntax.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The XML API Browser gives me an x-path of .../entry[@name='Policy+Name+Here'] however the CLI returns an error "Server error : Failed to compose effective config to load. input file doesn't have anything at ..."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I take the spaces out it works perfectly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do you get x-path to process spaces?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Shannon&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2020 03:54:47 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/using-x-path-with-spaces/m-p/328913#M2345</guid>
      <dc:creator>SARowe_NZ</dc:creator>
      <dc:date>2020-05-20T03:54:47Z</dc:date>
    </item>
    <item>
      <title>Re: Using x-path with spaces</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/using-x-path-with-spaces/m-p/328914#M2346</link>
      <description>&lt;P&gt;Note: just to clarify the actual policy name is "&lt;SPAN&gt;Policy Name Here" - the XML API Browser adds the "+" symbols shown in the original post automatically wherever a space exists, but the x-path call from the CLI does not seem to accept it.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2020 03:56:42 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/using-x-path-with-spaces/m-p/328914#M2346</guid>
      <dc:creator>SARowe_NZ</dc:creator>
      <dc:date>2020-05-20T03:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: Using x-path with spaces</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/using-x-path-with-spaces/m-p/328928#M2347</link>
      <description>&lt;P&gt;Replace the plus signs with spaces. The name is already embraced by quotes.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2020 05:56:11 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/using-x-path-with-spaces/m-p/328928#M2347</guid>
      <dc:creator>JoergSchuetter</dc:creator>
      <dc:date>2020-05-20T05:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: Using x-path with spaces</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/using-x-path-with-spaces/m-p/329726#M2358</link>
      <description>&lt;P&gt;Hey - thanks for the response, unfortunately I have tried that and it still does not accept it. Does not like the syntax. I tried with single and double quotes.&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Shannon&lt;/P&gt;</description>
      <pubDate>Mon, 25 May 2020 08:41:07 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/using-x-path-with-spaces/m-p/329726#M2358</guid>
      <dc:creator>SARowe_NZ</dc:creator>
      <dc:date>2020-05-25T08:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: Using x-path with spaces</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/using-x-path-with-spaces/m-p/330765#M2361</link>
      <description>&lt;P&gt;Hey &lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/58478"&gt;@SARowe_NZ&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I had a similar issue with this when I was writing my Python code as I needed to move config around devices where other methods available wouldn't work. I have learned how to work with Python (only 2nd week in), in a very basic sense and have written this code. It is only very basic for the moment, but allows for bulk importing of objects. I am working on Policies and Network configurations this week.&lt;BR /&gt;&lt;BR /&gt;So depending on your familiarity with Python this might help you out or at least get you started, if it's not working for you and want me to make some modifications to the code to allow it to work in your environment just let me know via the methods I have suggested in github repo.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All the best mate!&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jun 2020 06:03:10 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/using-x-path-with-spaces/m-p/330765#M2361</guid>
      <dc:creator>DanielBostock</dc:creator>
      <dc:date>2020-06-01T06:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: Using x-path with spaces</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/using-x-path-with-spaces/m-p/331779#M2367</link>
      <description>&lt;P&gt;Hey Daniel,&lt;/P&gt;&lt;P&gt;Thanks for that - appreciate your help!&lt;/P&gt;&lt;P&gt;Unfortunately my knowledge of python is zero.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Surely it must be possible to parse a space in the CLI x-path call.&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Shannon&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jun 2020 03:31:56 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/using-x-path-with-spaces/m-p/331779#M2367</guid>
      <dc:creator>SARowe_NZ</dc:creator>
      <dc:date>2020-06-05T03:31:56Z</dc:date>
    </item>
    <item>
      <title>Re: Using x-path with spaces</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/using-x-path-with-spaces/m-p/331781#M2368</link>
      <description>&lt;P&gt;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/58478"&gt;@SARowe_NZ&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hey in your initial comments you say you want to copy a policy, so to be clear is it only one policy at a time that you are copying or are you want to copy all security policies in one Palo to another Palo?&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jun 2020 03:50:11 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/using-x-path-with-spaces/m-p/331781#M2368</guid>
      <dc:creator>DanielBostock</dc:creator>
      <dc:date>2020-06-05T03:50:11Z</dc:date>
    </item>
    <item>
      <title>Re: Using x-path with spaces</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/using-x-path-with-spaces/m-p/331782#M2369</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;That was an example - its actually lots of different configuration elements (policies / objects / VPNs etc). I'm moving config around between firewalls and different Templates/Device Groups on our Panorama. For the most part it is quite granular (per policy / vpn etc) which is the challenge. If it was all of them I could just use the root x-path for (e.g.) policies as the root x-path would have no spaces, but unfortunately much of this has to be done at individual item level.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;BR /&gt;Shannon&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jun 2020 03:59:07 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/using-x-path-with-spaces/m-p/331782#M2369</guid>
      <dc:creator>SARowe_NZ</dc:creator>
      <dc:date>2020-06-05T03:59:07Z</dc:date>
    </item>
    <item>
      <title>Re: Using x-path with spaces</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/using-x-path-with-spaces/m-p/331785#M2370</link>
      <description>&lt;P&gt;Ah ok yeah from my limited understanding and knowledge I can't really see how to modify the cli command to allow for random objects with spaces. Potentially if you are wanting to persist with x-path you may need to edit these xml config files prior to importing and strip the spaces with a find and replace, before uploading the configuration file to the Palo.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However I think spending some time Python or even using Powershells API module is the better way moving forward to do scripted tasks like this as the API's are far more flexible and programmable than x-path. But I do appreciate why you might not want to make this effort, so hopefully doing a find and replace might be a workable solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jun 2020 04:36:49 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/using-x-path-with-spaces/m-p/331785#M2370</guid>
      <dc:creator>DanielBostock</dc:creator>
      <dc:date>2020-06-05T04:36:49Z</dc:date>
    </item>
    <item>
      <title>Re: Using x-path with spaces</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/using-x-path-with-spaces/m-p/331786#M2371</link>
      <description>&lt;P&gt;Thanks - given I'd be starting at the zero with python the learning curve would be too much and I'd need to dedicate too much time to justify it just for this. I have not looked at the powershell option though so that could definitely work, as I suspect it is much simpler for a script notice like me - I will check it out!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Shannon&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jun 2020 04:43:28 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/using-x-path-with-spaces/m-p/331786#M2371</guid>
      <dc:creator>SARowe_NZ</dc:creator>
      <dc:date>2020-06-05T04:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: Using x-path with spaces</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/using-x-path-with-spaces/m-p/331788#M2372</link>
      <description>&lt;P&gt;Yeah I get ya mate, I would also recommend getting familiar with using Postman as well, it is a very helpful tool in writing a API call in powershell or any scripting language. For example you can formulate the API call with postman then get the code you need to put in powershell to make the script.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DanielBostock_0-1591333024749.png" style="width: 999px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/26043i4278C05CAB665524/image-size/large/is-moderation-mode/true?v=v2&amp;amp;px=999" role="button" title="DanielBostock_0-1591333024749.png" alt="DanielBostock_0-1591333024749.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jun 2020 04:57:25 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/using-x-path-with-spaces/m-p/331788#M2372</guid>
      <dc:creator>DanielBostock</dc:creator>
      <dc:date>2020-06-05T04:57:25Z</dc:date>
    </item>
    <item>
      <title>Re: Using x-path with spaces</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/using-x-path-with-spaces/m-p/331790#M2373</link>
      <description>&lt;P&gt;Cool thanks for that - really appreciate all your help!&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jun 2020 05:04:08 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/using-x-path-with-spaces/m-p/331790#M2373</guid>
      <dc:creator>SARowe_NZ</dc:creator>
      <dc:date>2020-06-05T05:04:08Z</dc:date>
    </item>
    <item>
      <title>Re: Using x-path with spaces</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/using-x-path-with-spaces/m-p/331791#M2374</link>
      <description>&lt;P&gt;No worries mate, my pleasure, all the best with getting it sorted!&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jun 2020 05:14:23 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/using-x-path-with-spaces/m-p/331791#M2374</guid>
      <dc:creator>DanielBostock</dc:creator>
      <dc:date>2020-06-05T05:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: Using x-path with spaces</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/using-x-path-with-spaces/m-p/344364#M2441</link>
      <description>&lt;P&gt;In the CLI, use the policy name with spaces instead of the plus sign but enclose the entire xpath in double quotes.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Aug 2020 16:01:07 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/using-x-path-with-spaces/m-p/344364#M2441</guid>
      <dc:creator>HowsThisWork</dc:creator>
      <dc:date>2020-08-18T16:01:07Z</dc:date>
    </item>
  </channel>
</rss>

