Manage Hadoop clusters through Ambari REST API (supports Ambari 2.7.5 and 3.0.0).
bash
# Install dependencies
pip install -r ~/.claude/skills/ambari-api/scripts/requirements.txt
# Add cluster configuration
python ~/.claude/skills/ambari-api/scripts/ambari_api.py config --add \
--name prod \
--url https://ambari.example.com:8080 \
--username admin \
--password admin
# List clusters
python ~/.claude/skills/ambari-api/scripts/ambari_api.py clusters --config prod
bash
# List services in a cluster
python ambari_api.py services --config prod --cluster mycluster
# Start/Stop/Restart a service
python ambari_api.py services --config prod --cluster mycluster --service HDFS --action START
python ambari_api.py services --config prod --cluster mycluster --service YARN --action STOP
python ambari_api.py services --config prod --cluster mycluster --service HIVE --action RESTART
bash
# List components on a host
python ambari_api.py components --config prod --cluster mycluster --host node01
# Start/Stop specific component on a host
python ambari_api.py components --config prod --cluster mycluster --host node01 \
--service HDFS --component DATANODE --action START
python ambari_api.py components --config prod --cluster mycluster --host node01 \
--service HDFS --component DATANODE --action STOP
bash
# List all hosts
python ambari_api.py hosts --config prod --cluster mycluster
# Get service status
python ambari_api.py status --config prod --cluster mycluster --service HDFS
bash
# List configured clusters
python ambari_api.py config --list
# Remove a cluster configuration
python ambari_api.py config --remove --name prod
CommandDescriptionconfig --addAdd cluster config with URL, username, passwordconfig --listList all saved configurationsclustersList clusters in AmbariservicesList services or perform START/STOP/RESTARThostsList hosts in a clustercomponentsList or manage components on specific hoststatusGet detailed service status