Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

How to restart a role of the specified service using CM REST API?

avatar
Contributor

I just tried these command and failed.
curl -X POST -H "Content-Type:application/json" -u admin:serving -d ' { "items" : [ { "name" : "yarn-NODEMANAGER-ecaa167810719b1adf26481d06c14891" }, {"name" : "yarn-NODEMANAGER-4618314a51eefc788471cec21e1c3164"} ] }' 'http://cm-server:7180/api/v10/clusters/cluster/services/yarn/roleCommands/restart'

error message below.
{
"message" : "Can not deserialize instance of java.lang.String out of START_OBJECT token\n at [Source: org.apache.cxf.transport.http.AbstractHTTPDestination$1@5e19f6e5; line: 1, column: 16] (through reference chain: com.cloudera.api.model.ApiRoleNameList[\"items\"])"
}

so what's next?

1 ACCEPTED SOLUTION

avatar
Contributor

curl -X POST  -H "Content-Type:application/json" -u admin:admin  -d ' { "items" : [ "yarn-NODEMANAGER-ecaa167810719b1adf26481d06c14891", "yarn-NODEMANAGER-4618314a51eefc788471cec21e1c3164"] }' 'http://cm-server:7180/api/v10/clusters/cluster/services/yarn/roleCommands/restart'

View solution in original post

1 REPLY 1

avatar
Contributor

curl -X POST  -H "Content-Type:application/json" -u admin:admin  -d ' { "items" : [ "yarn-NODEMANAGER-ecaa167810719b1adf26481d06c14891", "yarn-NODEMANAGER-4618314a51eefc788471cec21e1c3164"] }' 'http://cm-server:7180/api/v10/clusters/cluster/services/yarn/roleCommands/restart'