thanks Sid - that worked From: Siddharth Wagle <[email protected]> Reply-To: <[email protected]> Date: Wed, 26 Feb 2014 16:48:04 -0800 To: <[email protected]> Subject: Re: REST api question
Hi Aaron,
You should be able to do this by changing state of a Service component.
Sample API call:
curl -H "X-Requested-By:ambari" -u admin:admin -i -X PUT -d
'{"RequestInfo":{"context":"Stop all datanodes"},"ServiceComponentInfo":
{"state": "INSTALLED"}}'
http://localhost:8080/api/v1/clusters/c1/services/HDFS/components/DATANODE
-Sid
On Wed, Feb 26, 2014 at 4:44 PM, Aaron Cody <[email protected]> wrote:
> but that¹s to stop the component on a specific host I want to stop all of
> them throughout the cluster.
>
>
> From: Sumit Mohanty <[email protected]>
> Reply-To: <[email protected]>
> Date: Wed, 26 Feb 2014 16:40:39 -0800
> To: "[email protected]" <[email protected]>
> Subject: Re: REST api question
>
> You need to use this API to stop the component. The reason its different is
> that stop of the host component is a processed on the host component resource.
>
> curl -u admin:admin -X PUT -d '{"RequestInfo":{"context":"Stop
> Component"},"Body":{"HostRoles":{"state":"INSTALLED"}}}'
> http://AMBARI_SERVER_HOST:8080/api/v1/clusters/c1/hosts/HOSTNAME/host_componen
> ts/COMPONENT_NAME
>
> You can use the wiki to get sample API calls -
> https://cwiki.apache.org/confluence/display/AMBARI/API+usage+scenarios%2C+trou
> bleshooting%2C+and+other+FAQs
>
>
> On Wed, Feb 26, 2014 at 4:30 PM, Aaron Cody <[email protected]> wrote:
>> we can stop an entire service like so:
>>
>> curl --user admin:admin -i -X PUT -d '{"ServiceInfo":{"state":"INSTALLED"}}'
>> http://ambari-master.foo.com:8080/api/v1/clusters/c1/services/HDFS
>>
>> but how can I stop all instances of a running component? I had hoped with
>> something like :
>>
>> curl --user admin:admin -i -X PUT -d '{"ServiceInfo":{"state":"INSTALLED"}}'
>> http://ambari-master.foo.com:8080/api/v1/clusters/c1/services/HDFS/components
>> /DATANODE
>>
>> but this throws an invalid property exception
>>
>> is my URL wrong or are we not allowed to do this sort of thing?
>>
>
>
> CONFIDENTIALITY NOTICE
> NOTICE: This message is intended for the use of the individual or entity to
> which it is addressed and may contain information that is confidential,
> privileged and exempt from disclosure under applicable law. If the reader of
> this message is not the intended recipient, you are hereby notified that any
> printing, copying, dissemination, distribution, disclosure or forwarding of
> this communication is strictly prohibited. If you have received this
> communication in error, please contact the sender immediately and delete it
> from your system. Thank You.
CONFIDENTIALITY NOTICE
NOTICE: This message is intended for the use of the individual or entity to
which it is addressed and may contain information that is confidential,
privileged and exempt from disclosure under applicable law. If the reader of
this message is not the intended recipient, you are hereby notified that any
printing, copying, dissemination, distribution, disclosure or forwarding of
this communication is strictly prohibited. If you have received this
communication in error, please contact the sender immediately and delete it
from your system. Thank You.
smime.p7s
Description: S/MIME cryptographic signature
