Katello CLI

Hello,

I Heard forman devs are handling CLI for katello … i need some help with
katello cli… i want to write standalone scripts so i can put my own
wrappers … now i dont know which modules i should import before i call api
?

i am looking at katello-cli on github…

so in short i want to write like … ./install_package.py --package <name
of package> --name <system name >

any suggestions ?

Regards,
DJ

> Hello,
>
> I Heard forman devs are handling CLI for katello … i need some help
> with katello cli… i want to write standalone scripts so i can put my
> own wrappers … now i dont know which modules i should import before i
> call api ?
>
> i am looking at katello-cli on github…
>
> so in short i want to write like … ./install_package.py --package
> <name of package> --name <system name >
>
>
> any suggestions ?

Hello,
more precisely foreman team is working on the CLI framework [1] used for
the next version of katello cli. It's written in ruby.

Anyway if you wan to use python bindings in your custom scripts, install
katello-cli and then in your script:

setup a connection

from katello.client.server import BasicAuthentication, KatelloServer,
set_active_server
kat_server = KatelloServer(host, int(port), scheme, path)
kat_server.set_auth_method(BasicAuthentication(username, password))
set_active_server(kat_server)

call the api

from katello.client.api.system import SystemAPI
api = SystemAPI()
api.install_packages(system_id, list_of_package_names_to_install)

See katello-cli's git for more examples.

You may also be interested in new ruby bindings for katello [2]. They
are a bit easier to use IMO.

[1] https://github.com/theforeman/hammer-cli
[2] https://github.com/Katello/katello_api

Regards,
Tomas

··· On 01/04/2014 10:50 AM, Unix SA wrote:

Regards,
DJ


You received this message because you are subscribed to the Google
Groups “Foreman users” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/groups/opt_out.