Can I write a comment when enable/Disable agent through REST api?

We use Rest API to enable/disable the agent, but the document didn't say how to sent a comment when using REST api. 

0
1 comment
Avatar
Permanently deleted user

You can use the "enabledInfo" endpoint to both disable the agent and set the comment. There's an example in the documentation that uses a PUT that shows how to do this using curl:

curl -v -u user:password --request PUT "http://teamcity:8111/app/rest/agents/id:1/enabledInfo" --data "<enabledInfo status='false'><comment><text>commentText</text></comment></enabledInfo>" --header "Content-Type:application/xml"

 

1

Please sign in to leave a comment.