Integration Question

usability
(Pm Swetz) #1

This is an integration question but for some reason I cannot create a new topic over there.
I am trying to add a cloud region target machine to a worker pool through the API (actually through the client via powershell) and cannot figure out how to go about doing it. I can create the machine correctly, create and load the worker pools but cannot find anything in the api to link the machine and the pool.

(Daniel Fischer) #3

Hi @PMSwetz,

Thanks for getting in touch! I may need to get some more details from you here but the first thing to note is that a Cloud Region target can not be a worker or added to a worker pool.

Currently we only support the following targets as workers:

  • Listening Tentacle
  • Polling Tentacle
  • SSH Target

If you could provide some further details about what your end goal requirements are here I might be able to provide an alternative option to help you achieve what you need

Looking forward to hearing from you. :slight_smile:

Best regards,
Daniel

(Pm Swetz) #4

I believe I worded the question wrong but effectively what I was looking for was this

Powershell

$endpoint = [Octopus.Client.Model.Endpoints.CloudRegionEndpointResource]::new()
$wpoolResource = $repositoryForSpace.WorkerPools.FindByName($WorkerPool)
$endpoint.DefaultWorkerPoolId = $wpoolResource.Id

$newMachine = [Octopus.Client.Model.MachineResource]::new()
$newMachine.Endpoint = $endpoint

The workerpool needed to be setup as the default workerpool for my new machines endpoint.