Hi,

Please find below REST API calls to create a service component, associate a 
host with the created service component and install the service component.?


Below APIs uses c1 as the cluster name, YARN as a service, APP_TIMELINE_SERVER? 
as service component, c6401.ambari.apache.org? as the host component and 
admin:admin as admin user credentials to cluster.


1) Create Service Component:

curl --user admin:admin -H "X-Requested-By: ambari" -i -X POST http://`hostname 
-f`:8080/api/v1/clusters/c1/services/YARN/components/APP_TIMELINE_SERVER?


2) Create Service Host Component:

curl --user admin:admin -H "X-Requested-By: ambari" -i -X POST http://`hostname 
-f`:8080/api/v1/clusters/c1/hosts/c6401.ambari.apache.org/host_components/APP_TIMELINE_SERVER


3) Install Service Host Component:

curl --user admin:admin -H "X-Requested-By: ambari" -i -X PUT -d '{"HostRoles": 
{"state": "INSTALLED"}}' http://`hostname 
-f`:8080/api/v1/clusters/c1/hosts/c6401.ambari.apache.org/host_components/APP_TIMELINE_SERVER



-- Thanks

    Jaimin

________________________________
From: Zhao Wei ZW Shen <[email protected]>
Sent: Tuesday, December 22, 2015 6:40 PM
To: [email protected]
Subject: Add service component question


Hi Expects,

Does Ambari support to add a new component definition with Rest API?
I wanna  add and update a service component with Rest.


Regards,
Micle

Reply via email to