Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Support Questions

Find answers, ask questions, and share your expertise
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!

CLI tool to manage cluster

avatar

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

avatar
Super Collaborator

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

avatar
Super Collaborator

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

avatar

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

avatar
Master 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.

avatar

Thank you. This help me a lot.