We are trying to use the SDK to retrieve information about workers but cannot figure out which field is returned or not (boundary/api/workers/worker.gen.go at 132a52c5d9b409b46b0630ea48960640faaeb555 · hashicorp/boundary · GitHub). We would like to know whether there is a contract for the API to get this kind of information.
At the moment, what we are really interested in is to find if a worker is authenticated and more importantly if the token has changed or is different from the one we are expected
The API documentation for the Worker Service contains all the fields returned in the request: Boundary controller HTTP API | Boundary | HashiCorp Developer. You’re probably interested in checking the last_status_time
, which will tell you when the worker last successfully reported to the controller, which means it is authenticated. What do you mean by “token” in this context? There’s both the worker_generated_auth_token
, which is generated by the worker on startup and output to the log, and the controller_generated_activation_token
, which is generated by the controller and can be used on the worker to activate it.
I was referring to the worker generated token. Not all the fields are set in the response from what we are experiencing
Yeah the worker generated auth token will only be available from the worker on startup, I don’t think you can retrieve that from the API anywhere. It should only change when the worker restarts.