Skip to content

Instantly share code, notes, and snippets.

@onefoursix
Last active October 28, 2020 12:21
Show Gist options
  • Save onefoursix/27d570562fa34b42488d1dc295a3e498 to your computer and use it in GitHub Desktop.
Save onefoursix/27d570562fa34b42488d1dc295a3e498 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
import sys
from cm_api.api_client import ApiResource
## ** CM Connection Settings ******************************
cm_host = "localhost"
cm_port = "7180"
cm_login = "admin"
cm_password = "admin"
cluster_name = "Cluster 1"
print "Connecting to Cloudera Manager at : http://" + cm_host + ":" + cm_port
api = ApiResource(server_host=cm_host, server_port=cm_port, username=cm_login, password=cm_password)
cluster = api.get_cluster(cluster_name)
for service in cluster.get_all_services():
print service.type + " Service " + "(" + service.displayName + ")"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment