Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

CLI tool to manage cluster

Solved Go to solution
Highlighted

CLI tool to manage cluster

Hi, 

 

I'm planning to bring the Kafka as a Service. I would need any client or command-line tools to add a cluster. Right now, I'm able to add from Cloudera Manager, but I would want to do it from the CLI. Do we have any API or any leads to get this done?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: CLI tool to manage cluster

Expert Contributor

Hi @sharathkumar13 

 

Cloudera Manager comes with an API. Here is a link to the Cloudera Manager API guide:

 

http://cloudera.github.io/cm_api/docs/quick-start/

 

Does that help?

Steve

View solution in original post

4 REPLIES 4
Highlighted

Re: CLI tool to manage cluster

Expert Contributor

Hi @sharathkumar13 

 

Cloudera Manager comes with an API. Here is a link to the Cloudera Manager API guide:

 

http://cloudera.github.io/cm_api/docs/quick-start/

 

Does that help?

Steve

View solution in original post

Re: CLI tool to manage cluster

Thank You. This helped a lot. I wrote the scripts for the basic functionalities. 

Highlighted

Re: CLI tool to manage cluster

Super Mentor

@sharathkumar13 

 

You can use the Cloudera Manager API call something like following to start/stop Kafka Service (or any desired service)

 

In order to stop "kafka" service:

 

# curl -iLv -u admin:admin -X POST --header 'Accept: application/json' 'ttp://dc-1.example.com:7180/api/v40/clusters/TestCluster/services/kafka/commands/stop'

 


In order to start "kafka" Service

 

# curl -iLv -u admin:admin -X POST --header 'Accept: application/json' 'ttp://dc-1.example.com:7180/api/v40/clusters/TestCluster/services/kafka/commands/start'

 

 

.
Please also take a look at the Cloudera Manager Swagger APIs. 
Cloudera Manager(CM) 6.0 introduces new Python API client cm_client based on Swagger. This new API client supports all CM API versions.

https://cloudera.github.io/cm_api/docs/python-client-swagger/
.

 

Here please replace the CM credentials and cluster name in CM host port in the above mentioned API calls.

Highlighted

Re: CLI tool to manage cluster

Thank you. This help me a lot. 

Don't have an account?
Coming from Hortonworks? Activate your account here