1.3. Using the Red Hat Update Infrastructure Manager from the Shell Prompt

Red Hat Update Infrastructure Manager is designed to be run using the interactive shell, however some functions can also be run from a standard shell prompt.
View all options and commands by using the --help command:
# rhui-manager --help
Usage: rhui-manager [options] [command]

  OPTIONS
    -h/--help  show this help message and exit
    --debug    enables debug logging
    --config   absolute path to the configuration file; defaults to /etc/rhui/rhui.conf
    --server   location of the RHUA server (overrides the config file)
    --username if specified, previously saved authentication credentials are ignored and this username is used to login
    --password used in conjunction with --username

  COMMANDS
    cert      : Red Hat content certificate management
    packages  : package manipulation on repositories
    repo      : repository listing and manipulation
    status    : RHUI status and health information

Note

Commands in this list that begin with a -- can be used both in the interactive shell and at the shell prompt. All other commands can only be used at the shell prompt.

Flags

--debug
Enables more verbose logging. The log file can be found at ~/.rhui/rhui.log
--config /path/examplefilename.conf
This command instructs Red Hat Update Infrastructure Manager (both the interactive shell and the shell prompt) to use the specified configuration file, instead of the default file located at /etc/rhui/rhui-tools.conf
--server rhua.example.com
This command instructs Red Hat Update Infrastructure Manager (both the interactive shell and the shell prompt) to connect to the specified server instead of the server specified in the configuration file. Authentication credentials are stored on a per server basis, so this flag can be used to allow a single Red Hat Update Infrastructure Manager installation to manage multiple Red Hat Update Infrastructure installations.
--username username --password password
This command instructs Red Hat Update Infrastructure Manager to use the specified credentials to log into the Red Hat Update Appliance. When using these commands, the authentication certificate will not be stored. This allows scripts to execute shell prompt commands on the Red Hat Update Infrastructure without needing to manage authentication certificates as well.

Content Certificate Management

The cert command is used to manipulate Red Hat content certificates.
rhui-manager cert info
Display information about the current content certificate.
rhui-manager cert upload
Use this command to upload a new content certificate. Specify the full path to the new certificate with the --cert flag, and the full path to the new key with the --key flag. Red Hat Update Infrastructure Manager and all repositories will be updated automatically when using this command.
# rhui-manager cert upload --cert /home/example/content-cert.crt --key /home/example/content-key.pem

Repository Management

The repo command is used to manipulate repositories on the Red Hat Update Infrastructure.
rhui-manager repo list
Displays a list of repositories currently in the Red Hat Update Infrastructure:
# rhui-manager repo list
ID                             :: Repository Name

Red Hat Repositories
---------------------
rhui-srpms-1.2-5Server-x86_64  :: Red Hat Update Infrastructure 1.2 (SRPMS)
(5Server-x86_64)
rhui-srpms-1.2-5Server-i386    :: Red Hat Update Infrastructure 1.2 (SRPMS)
(5Server-i386)
rhui-1.2-5Server-x86_64        :: Red Hat Update Infrastructure 1.2 (RPMs)
(5Server-x86_64)
rhui-1.2-5Server-i386          :: Red Hat Update Infrastructure 1.2 (RPMs)
(5Server-i386)

Custom Repositories
---------------------
repo_1                         :: Custom Repository 1
rhui-manager repo info
Displays information about a specified repository. Specify the name of the repository with the --repo_id flag. The repository ID is shown in the output of the rhui-manager repo list command.
# rhui-manager repo info --repo_id rhui-1.2-5Server-x86_64
Name:               Red Hat Update Infrastructure 1.2 (RPMs) (5Server-x86_64)
Type:               Red Hat
Relative Path:      content/dist/rhel/rhui/server/5Server/x86_64/rhui/1.2/os
Package Count:      13
Last Sync:          04-16-2011 21:58
Next Sync:          04-16-2011 23:44

Package Management

The packages command is used to manipulate packages on repositories.
rhui-manager packages list
Displays a list of all packages in a repository. Specify the name of the repository with the --repo_id flag. The repository ID is shown in the output of the rhui-manager repo list command:
# rhui-manager packages list --repo_id rhui-1.2-5Server-x86_64
PyYAML-3.08-4.el5.x86_64.rpm
grinder-0.0.57-1.el5.noarch.rpm
httpd-2.2.3-43.el5_5.3.x86_64.rpm
libyaml-0.1.2-3.el5.x86_64.rpm
m2crypto-0.16-6.1.el5_5.1.x86_64.rpm
mod_python-3.3.1-12.el5.x86_64.rpm
python-hashlib-20081119-5.el5.x86_64.rpm
python-pycurl-7.15.5.1-4.el5.x86_64.rpm
rh-cds-0.27-1.el5_5.noarch.rpm
rh-rhua-0.91-1.el5_5.noarch.rpm
rh-rhua-0.95-1.el5_5.noarch.rpm
rh-rhui-tools-0.76-1.el5_5.noarch.rpm
rpm-build-4.4.2.3-20.el5_5.1.x86_64.rpm
rhui-manager packages upload
Use this command to upload a new package to a custom repository. Specify the repository to upload the packages to with the --repo_id flag, and the full path to an .rpm file or directory containing .rpm files with the --packages flag. The repository ID is shown in the output of the rhui-manager repo list command.
# rhui-manager packages upload --repo_id rhui-1.2-5Server-x86_64 --packages /home/example/filename.rpm

Status

The status command is used to check the status of the Red Hat Update Infrastructure.
rhui-manager status
Displays a short summary of whether or not CDS instances are running.
# rhui-manager status
US East Region CDS .......................................... [  UP  ]
Use the --code flag to display a code that reflect the state of the Red Hat Update Infrastructure. An output of 0 means the Red Hat Update Infrastructure is running successfully. For any other outputs and more information about status codes, see Procedure 11.1, “Monitoring the state of Red Hat Update Infrastructure”
# rhui-manager status --code
0