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'