Interact with Agent Tokens
By operating tokens, one can authorize/unauthorize agents, or access agent details including token value and latest usage information.
Authorize build agent
Syntax
New build agent can be authorized to join the build grid by accessing below url:
http://localhost:8810/rest/tokens/authorize?ip=<ip address of build agent>&port=<port of build agent>
The response is of mime type text/plain and the content is identifier of the newly created token for the build agent.
Security
You will need to use http BASIC authentication to login as administrator to authorize the build agent.
Demo
We use curl to demonstrate how to authorize the build agent:
-
Download the build agent package from Grid page and run it from a machine not authorized to join the grid. Assume IP address of the build agent is 192.168.2.100 and port is 8811.
-
Open grid page of QuickBuild server and you should see the new build agent appearing in unauthorized agent list.
-
Now run below command from anywhere:
curl -u admin:admin "http://<QB server>:8810/rest/tokens/authorize?ip=192.168.2.100&port=8811"
-
If above command succeeds, the newly connected agent will appear in active node list after a while in grid page.
Unauthorize build agent
Syntax
Authorized build agent can be unauthorized by accessing below url:
http://localhost:8810/rest/tokens/unauthorize?ip=<ip address of build agent>&port=<port of build agent>
The response is of mime type text/plain and the content is identifier of the removed token representing the build agent.
Security
You will need to use http BASIC authentication to login as administrator to unauthorize the build agent.
Demo
We use curl to demonstrate how to unauthorize the build agent:
-
Assume you have an existing active build agent with ip address 192.168.2.100 and port 8811.
-
Now run below command from anywhere:
curl -u admin:admin "http://<QB server>:8810/rest/tokens/unauthorize?ip=192.168.2.100&port=8811"
-
If above command succeeds, the build agent will be removed from active node list after a while.
Get token value and latest used information of agents
Syntax
Agent details can be accessed by accessing below url:
http://localhost:8810/rest/tokens?address=<address of build agent>
If param address is not supplied, details of all agents will be returned.
The response is of mime type text/plain and the content is XML representation of the agent details.
Security
You will need to use http BASIC authentication to login as administrator to get agent details.
Demo
We use curl to demonstrate how to access details of the build agent:
-
Assume you have an active build agent with address matrix:8811.
-
Now run below command from anywhere:
curl -u admin:admin "http://<QB server>:8810/rest/tokens?address=matrix:8811"
-
If above command succeeds, you will get XML representation of build agent details