Ok, got this. Will try with Slave...

One more question: is it possible execute Ambari REST API call from custom
service script? May be there is ambari client (or someting like that)
in resource_management lib?

Also is there any documentation on all functions avaliable for custom
scripts in python?

Regards,
Andrey

2017-10-05 18:26 GMT+03:00 Gonzalo Herreros <[email protected]>:

> "CLIENT" category components are meant to be just libraries without any
> actions.
> Have you tried with a "SLAVE" component?, it would be a bit odd but you
> don't really need to run any process
>
> On 5 October 2017 at 15:27, Markovich <[email protected]> wrote:
>
>> Hi Gonzalo,
>>
>> Thank you for answers.
>>
>> The custom action is not just shell command. I need to add custom action
>> to ambari Service page but for client roles (components).
>> I know how to do it for Master component, but same function is not beeing
>> triggered for Client.
>>
>> Regards,
>> Andrey
>>
>> 2017-10-05 17:16 GMT+03:00 Gonzalo Herreros <[email protected]>:
>>
>>> 1) By custom action I guess you mean a shell command, example:
>>> from resource_management import Execute
>>> Execute("mkdir /var/lib/mydir")
>>>
>>> Typically you would put that in the "install" or "start" method of your
>>> component script that extends:  from resource_management import Script
>>>
>>> 2) AFAIK there is no "uninstall" callback you can implement.
>>> You could do some cleanup every time you stop the service (assuming it
>>> doesn't take long to recreate on start) since to delete it you need to stop
>>> it first.
>>> Ambari doesn't have a tradition of cleaning up things on deletion
>>>
>>> Regards,
>>> Gonzalo
>>>
>>>
>>> On 5 October 2017 at 14:33, Markovich <[email protected]> wrote:
>>>
>>>> Hello ambari users!
>>>>
>>>> I've got two questions about implementing custom service.
>>>> Here they are:
>>>> 1) How to execute custom action on client host?
>>>> 2) Is it possible to runs some code on host before deleting the service
>>>> (for example some cleanup)?
>>>>
>>>> Thanks for your time.
>>>>
>>>> Regards,
>>>> Andrey
>>>>
>>>
>>>
>>
>

Reply via email to