jimbobhickville / python-ambariclient

Python client bindings for the Apache Ambari REST API
44 stars 31 forks source link

Command to start/stop all services? #26

Closed dimaspivak closed 7 years ago

dimaspivak commented 7 years ago

This project is beautiful and really makes working with Ambari incredibly straightforward. The only thing I haven't been able to find out from my examination of the docs and the code is how to invoke the "Start all services" endpoint that Ambari has for a given cluster. The corresponding code looks straightforward enough, so it is just a question of the functionality not being present or am I overlooking something obvious?

jimbobhickville commented 7 years ago

I honestly don't recall why it is that way. It's possible that ambari-server stopped working properly with that code. The official Python client was basically abandoned which is why I wrote this one. Not sure if that situation has changed, as I've changed jobs and no longer work with Ambari.

There is client.clusters(name).services.restart() which should start any that aren't currently up in addition to restarting the ones that are up.

https://github.com/jimbobhickville/python-ambariclient/blob/master/ambariclient/models.py#L683

Seems like you could just copy that, change RESTART to START and it might do what you need.

dimaspivak commented 7 years ago

:) Cool, glad it wasn’t intentionally left out. Let me get a PR to add the functionality here; it works perfectly in my fork.

jimbobhickville commented 7 years ago

PR merged