Hi Matt:
Thanks for your reply!
But it seems that your description is a "sevice level action". I want to
add a "host level action" likes "Start/Stop/Restart All Components" on the
Hosts page.
In fact, I want to add a "Shutdown" action, so that I can shutdown a host
on the ambari web page.
Thanks!
At 2016-02-23 01:47:45, "Mithun Mathew" <[email protected]> wrote:
I'm not sure if a documentation exists, but here's the procedure on how to add
a custom action.
To define a host level custom action for a service component, you would have to
do the following:
- Add the custom action for the service component to metainfo.xml
https://github.com/apache/ambari/blob/trunk/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/metainfo.xml#L39-#L46
- Add the definition of the custom action in the component's script
https://github.com/apache/ambari/blob/trunk/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/namenode.py#L120-#L124
Please note that the naming convention for the action in metainfo.xml is
MY_CUSTOM_COMMAND and the corresponding function signature in the script would
be my_custom_command (self, env)
On Mon, Feb 22, 2016 at 6:27 AM, Zhang Ruiqiang <[email protected]> wrote:
Hi all:
I want to add a host level action, is there any document that I can follow?
Thanks!
--
Mithun Mathew (Matt)
www.linkedin.com/in/mithunmatt/