ambari-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zhang Ruiqiang" <zh....@163.com>
Subject Re:Re: How to add a host level action?
Date Tue, 23 Feb 2016 03:55:45 GMT
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" <mithmatt@gmail.com> 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 <zh.r.q@163.com> 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/
Mime
View raw message