我们使用Ansible为不同的技术栈配置构建代理,如:前端构建器(Nodejs、libs、Dart SDK)、后端构建器(JDK)等,等等。
用API调用为新的代理生成新的authorizationToken是可行的吗?或者通过API调用注册新的代理以能够连接新的linux盒而不需要管理/人工?
发布于 2016-07-04 09:26:33
有REST调用来实现这一点,只需将true或false字符串作为请求数据通过PUT请求传递给/httpAuth/app/rest/agents/<agentLocator>/authorized,<agentLocator>语法描述为这里。
下面是一个curl命令的示例:
curl -X PUT "http://teamcity/httpAuth/app/rest/agents/id:3/authorized" --data true --header "Content-Type: text/plain" -u user:pass 应该使用PUT方法,并提供Content-Type: text/plain头。
https://stackoverflow.com/questions/37999198
复制相似问题