[uyuni-users] API curl example
Hello community, can someone give a short example via curl & xml/json for accessing the API. Sadly my skills in python/perl/ruby are close to 0 . Thanks in advance. Best Regards, Strahil Nikolov -- To unsubscribe, e-mail: uyuni-users+unsubscribe@opensuse.org To contact the owner, e-mail: uyuni-users+owner@opensuse.org
On 6/2/19 7:05 PM, Strahil Nikolov wrote:
can someone give a short example via curl & xml/json for accessing the API. Sadly my skills in python/perl/ruby are close to 0 .
The API uses the XMLRPC protocol, which means you need to parse and create non-trivial XML data for each call. I can only imagine this to be pretty difficult to do in a shell script and would not recommend it. OTOH, even if you are not very proficient in programming, I would still recommend trying - basic examples are not very difficult. Example: https://gist.github.com/moio/2369fad0babdeb85b1a21af06386c497 If you still want to use shell scripting only, I would suggest to script spacecmd instead of the raw API - spacecmd wraps the API and exposes it in a familiar command-line fashion. HTH Regards, -- Silvio Moioli SUSE Manager Development Team -- To unsubscribe, e-mail: uyuni-users+unsubscribe@opensuse.org To contact the owner, e-mail: uyuni-users+owner@opensuse.org
The API uses the XMLRPC protocol, which means you need to parse and create non-trivial XML data for each call. I can only imagine >this to be pretty difficult to do in a shell script and would not recommend it. OTOH, even if you are not very proficient in programming, I would still recommend trying - basic examples are not very difficult.
Example: https://gist.github.com/moio/2369fad0babdeb85b1a21af06386c497
If you still want to use shell scripting only, I would suggest to script spacecmd instead of the raw API - spacecmd wraps the API >and exposes it in a familiar command-line fashion.
Thanks Silvio, spacecmd seems to suite my needs. Best Regards, Strahil Nikolov -- To unsubscribe, e-mail: uyuni-users+unsubscribe@opensuse.org To contact the owner, e-mail: uyuni-users+owner@opensuse.org
participants (2)
-
Silvio Moioli
-
Strahil Nikolov