4 comments

REST API does not support agent disabling at this time. Feel free to file a feature request into our tracker so that we can collect votes for it.

Right now you can try to use the approach described on this page to disable an agent (you will need to catch the HTTP request sent by web UI on agent disabling and repeat it from command line).

BTW, can you please describewhy do you need the feature?

0

thanks for the reply, I will try that method.
I need this features because I have build configuration witch use few computer via ssh. There are build agent on all computers and in's important don't start build in that computer while test is running.
Actualy will be better if I could change compatible agent for some build configuration for a while, for example is it possible change agent enviroment variables without agent restart, or change build configuration agent requirement?

0

Actualy will be better if I could change compatible agent for some build configuration for a while, for example is it possible change agent enviroment variables without agent restart, or change build configuration agent requirement?

There is no API for that. Agent environment can be changed by editing buildAgent.properties file (agent will detect the change and restart displaying new values).

In general, your need seems to be related to TW-13389 which wehn implemented will allow to write TeamCity plugin that will address your case.

0

thank you very much it's really help.
It's a good news that I don't need to restart agent manualy every time after changing enviromet variable, because I thought that I need do that manualy.

By the way, results of my research :
To disable or enabled agent you can use next linux console command


wget 'http://login:*password*@teamcity:8111/httpAuth/ajax.html?reason=&_should_restore_status=&status_restoring_delay=15&changeAgentStatus=<AGENT_ID>&enable=false&_='
wget 'http://login:*password*@teamcity:8111/httpAuth/ajax.html?reason=&_should_restore_status=&status_restoring_delay=15&changeAgentStatus=<AGENT_ID>&enable=true&_='

To change agent requirement :


wget 'http://tester:passtocuda@teamcity:8111/httpAuth/admin/editRequirements.html?id=buildType:bt15' --post-data='parameterName=<PARAM_NAME>&requirementType=<REQUIREMENT_TYPE>&parameterValue=<PARAM_VALUE>&systemProperty=true&currentName=&submitAction=updateRequirement&submitBuildType=1&_='

0

Please sign in to leave a comment.