05-19-2020 08:54 PM
Hi,
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.
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 ..."
If I take the spaces out it works perfectly.
How do you get x-path to process spaces?
Thanks,
Shannon
05-19-2020 08:56 PM
Note: just to clarify the actual policy name is "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.
05-19-2020 10:56 PM
Replace the plus signs with spaces. The name is already embraced by quotes.
05-25-2020 01:41 AM
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.
Thanks,
Shannon
05-31-2020 11:03 PM
Hey @SARowe_NZ
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.
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.
All the best mate!
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!