Support Questions
Find answers, ask questions, and share your expertise

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

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

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

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

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.

Thank you. This help me a lot. 

; ;