Change main_node using rest api does not work

HI

From powershell using this:

$uri = "http://[servername]/app/rest/server/nodes/id:[nodeid]/enabledResponsibilities/MAIN_NODE"
Invoke-restmethod -Method put -Uri $uri -Headers @{"Content-Type" = "text/plain"; "Authorization"="Bearer $token";} -Body {"true"}
 

I get a 200 code back, but the MAIN_NODE responsibility is still under disabledresponsibilities when i look at the /app/rest/server/nodes/

 

so what am i doing wrong ? if i do a FALSE the the node that are set as MAIN_NODE via the GUI, it works - but not the other way around. Everything works using the GUI

 

0
1 comment

I've just checked this on 2023.05, and it worked.

$uri = "http://localhost:8111/app/rest/server/nodes/id:node1/enabledResponsibilities/MAIN_NODE"
$token = "xxx.yyy.zzz"
$headers = @{"Authorization" = "Bearer $token"}
$contentType = "text/plain"
Invoke-RestMethod -Method PUT -Uri $uri -ContentType $contentType -Headers $headers -Body "true"

Could you try the same and report back with the results?

0

Please sign in to leave a comment.