Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

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

Solved Go to solution
Highlighted

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

Explorer

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

Accepted Solutions

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

Explorer

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

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

Explorer

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

Don't have an account?
Coming from Hortonworks? Activate your account here