On 07/09/2009 06:29 AM, Miroslav Suchý wrote:
SPACEWALK-API(1) User Contributed Perl Documentation
SPACEWALK-API(1)
NAME
spacewalk-api - Call Spacawalk API from command line.
I had yesterday some time, so I picked up:
https://bugzilla.redhat.com/show_bug.cgi?id=499161
You can download this script from:
http://miroslav.suchy.cz/spacewalk/
Scroll down for description.
Before I commit it to git, I would like to hear feedback from you.
Do you like it? Do you dislike it? Is name OK. I do not want to name
it simple "spacewalk", I suppose that spacewalk should be what is now
/usr/sbin/rhn-satellite.
Do you like the format of substition strings?
Do you like the output?
In which package it should land? rhn-client-tools? new package?
SYNOPSIS
spacewalk-api [OPTIONS] --server=spacewalk.domain.com FUNCTION
[PARAM1 PARAM2 ...]
DESCRIPTION
spacewalk-api interact with the Spacewalk server and expose its
API layer.
FUNCTION is api method you wish to call and is followed by its
parameters. There is few special substitution available:
%session%
Is replaced with sessionid. If you use --nologin
option, then it is replaced by empty string.
%file:/some/file%
Is replaced by content of given file.
OPTIONS
--server
URL of your Spacewalk server.
--login --nologin
If we should log in or not. Default is to log in.
--user
Name of user to log in.
--password
If you do not specify this and unless --nologin is
specified, you will be prompted for your password.
EXAMPLES
spacewalk-api --server=spacewalk.com --nologin api.systemVersion
spacewalk-api --server=spacewalk.com --user=foo
--password=bar channel.listAllChannels "%session%"
spacewalk-api --server=spacewalk.com --nologin proxy.isProxy
’%file:/etc/sysconfig/rhn/systemid%’
AUTHOR
Miroslav Suchý <[email protected]>
COPYRIGHT AND LICENSE
Copyright (c) 2009 Red Hat, Inc. Released under GNU General
Public License, version 2 (GPLv2).
perl v5.8.8 2009-07-09 SPACEWALK-API(1)
Mirek,
Just a quick initial response... :)
I like the idea of the script. Since it uses the XMLRPC APIs, I'd
recommend placing it in the current spacewalk-utils package which is
where we have a couple of other scripts that are based on the APIs.
That package is intended to contain utilities that can be installed and
run on the server or client. The source for the package is currently
located in $GITDIR/utils.
Also, for naming, I'd recommend using sw-api; however, that is just an
opinion since I had named a script recently added using the sw-*
convention :)
I haven't tried the script out, yet, so cannot comment on the
usage/output; however, I will try it out though. :)
Nicely done !
cheers,
Brad
_______________________________________________
Spacewalk-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/spacewalk-devel