Unable to add workers to worker pool Via REST API

Using Octopus v2018.8.7

When making a POST request to https://octopus.services.DOMAIN.com/api/workers with a valid X-Octopus-ApiKey header and a body in the following format:

{ "WorkerPoolIds": [ "WorkerPools-223" ], "Name": "testworkerpaymentplatform", "Thumbprint": "THUMBPRINTHERE", "Uri": "https://aspoteunnp:10933/" }

I am getting the following response:

{ "ErrorMessage": "There was a problem with your request.", "Errors": [ "Only tentacles and ssh machines can be workers." ], "ParsedHelpLinks": [] }

I’ve tried a number of different tentacles but all return this error (and each one is definitely a tentacle, one was also a worker, i tried removing it manually and adding it via this call, but it didnt work so I had to manually re-add it)

So after playing about a bit more i finally figured this out. Although I’ve found zero documentation on this.

The POST request needs a body with the following format and fields as a minimum:

{ "WorkerPoolIds": [ "WorkerPools-223" ], "Name": "ASPOTEUNNPTEST", "Endpoint": { "CommunicationStyle": "TentaclePassive", "Uri": "https://aspoteunnp:10933", "Thumbprint": "THUMBPRINTHERE" } }

Hi @benmillaneasos

Sorry that you had a bad time with this one.

I’m not sure it would have helped in this case but I want to make sure you are aware of our Swagger UI for the Octopus API? Unfortunately we don’t have any automated way of marking fields as required or optional at this point in time, although this is something that we are hoping to be able to implement in future.

Sorry I don’t have a better answer for you at this point,

Regards
Alex

Hi Alex. Yes I was using the swagger UI to build my requests, it was pure trial and error that got me into a working state with it. The optional/mandatory tags would be incredibly helpful, as im sure that other people will run into these kinds of issues for the REST calls which are not otherwise documented.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.