To make life easier for you, I have attached a simpler RestAPI demo to this thread
NOTE:
Do all test and dev work in a safe non-critical environment.
The notes below and the attached code may not be perfect. Do NOT cavalierly treat
them like a fully tested document / product .... they are for instructional purposes only
[] Create a directory to store and test demo scripts
c:\demos
# note: annoying features of new Windows versions may
# make it difficult for you to create directories ( outside of your profile )
# I'll assume that you know how to deal with all of these silly msoft annoyances
[] Copy the attached zip file to the directory you created
[] extract the contents of the zip file
You should end up with this directory:
c:\demos\RestDemo
In the RestDemo directory there should be:
- several files
- a logs sub-directory
[] Run the CMD_Shell bat file
( this opens a Windows shell prompt in the current directory )
[] From the cmd shell prompt, run the script using python 3.x ( latest version )
# note: annoying features of new Fisher-Price Windows versions may
# make it difficult for you to run scripts ...
# I'll assume that you know how to deal with all of these silly msoft annoyances
I have both python 2 and python 3 on my workstation, so I use the py launcher
to specify python 3
py -3 DpLdevMgr.py
When run directly from the command line, the module's built-in test main
function is called.
I stripped all lines from the test main that modify array elements.
Only the call to a function that lists DP LDEVs remains.
Output is to a file in the logs directory.
For nice reporting you will want to use the response_py element of the
tuple returned by oDpLdevMgr.ListDpLdevs(). The data structure
referenced by response_py is in python "format" ( ie. list of dictionaries ...etc. )
and is easy to deal with.
Andy