RangerCLI¶
The RangerCLI (command-line interface) provides a straghtforward interface for managing resources within the Apache Ranger framework. The open-source project is hosted on GitHub and is buitl on top of the Apache Ranger public REST APIs.
Installation¶
Before installing the RangerCLI, the following requirements must be met.
Furthermore, the following Python libraries are also required and will be installed with the Ranger CLI.
Using the appropriate version of pip
for your Python installation, invoke the following command to install the RangerCLI:
$ pip install ranger-cli
You can upgrade the RangerCLI with:
$ pip install ranger-cli --upgrade
Once you’ve installed or updated the RangerCLI, you can verify the installation with:
$ ranger-cli --version
Ranger connection profiles¶
The RangerCLI supports multiple Apache Ranger connection profiles. These profiles are stored locally ~/.config/ranger/config.yaml
and are used to make API calls to multiple Apache Ranger environments.
To create a new profile, invoke the following command:
$ ranger-cli configure --policy <profile-name>
Important
If the profile name already exists in the configuration file, it will be overwritten with the new properties.
Example configuration file:
1default:
2 endpoint: https://ranger1.example.com:6182
3 authentication:
4 - jsmith
5 - supersecurepassword
6 verification: /home/jsmith/.config/ranger/ca-bundle.crt
To use the connection profile
$ ranger-cli policy --policy <profile-name>
If --profile
option is not invoked, the default profile is used. If the default profile
is not found, the first profile in the configuration file is used.
Getting Started¶
To start using the RangerCLI, use the --help
option to view the latest available group commands.
$ ranger-cli --help
To view the latest available sub-commands, the --help
option can be used on the group command:
$ ranger-cli <group> --help