Ce contenu n'est pas disponible dans la langue sélectionnée.
Chapter 1. Introduction to Hammer
Hammer is a powerful command-line tool provided with Red Hat Satellite 6. You can use Hammer to configure and manage a Satellite Server either through CLI commands or automation in shell scripts. Hammer also provides an interactive shell.
1.1. Hammer compared to Satellite web UI
Compared to navigating the Satellite web UI, using Hammer can result in much faster interaction with the Satellite Server, as common shell features such as environment variables and aliases are at your disposal. You can also incorporate Hammer commands into reusable scripts for automating tasks of various complexity. Output from Hammer commands can be redirected to other tools, which allows for integration with your existing environment. You can issue Hammer commands directly on the base operating system running Red Hat Satellite.
Access to base operating system on Satellite Server is required to issue Hammer commands, which can limit the number of potential users compared to the Satellite web UI. Although the parity between Hammer and the Satellite web UI is almost complete, the Satellite web UI has development priority and can be ahead especially for newly introduced features.
1.2. Hammer compared to Satellite API
For many tasks, both Hammer and Satellite API are equally applicable. Hammer can be used as a human friendly interface to Satellite API, for example to test responses to API calls before applying them in a script (use the -d
option to inspect API calls issued by Hammer, for example hammer -d organization list
). Changes in the API are automatically reflected in Hammer, while scripts using the API directly have to be updated manually.
In the background, each Hammer command first establishes a binding to the API, then sends a request. This can have performance implications when executing a large number of Hammer commands in sequence. In contrast, a script communicating directly with the API establishes the binding only once.
For more information, see the Using the Satellite REST API.
1.3. Getting help
View the full list of hammer
options and subcommands by executing:
$ hammer --help
Use --help
to inspect any subcommand, for example:
$ hammer organization --help
You can search the help output using grep
, or redirect it to a text viewer, for example:
$ hammer | less