I have a node.js application that uses the octopus API. I’m trying to modify the environments bound to a machine and the machines role. I have the machines id and the id of the environment i wish to bind it to. However looking through the API documentation its unclear how to actually do this.
I’ve tried PUT’ing http://{ip}/api/machines/{id}
and providing it the environments i wish to change but i get a 405 status back. However the user im trying to perform this under is an administrator.
I used fiddler performing the same action through the GUI and found the portal actually performs a post not put which according to the documentation creates a new machine. I tried to replicate this using the same data from fiddler and get an error back asking for an environment id, name, roles and thumbprint.
Could someone tell me how exactly to format the properties to perform this task and what properties are actually needed? I would have thought it would just be the id of the machine, environment id and roles but according to fiddler the portal is sending everything about the machine back to perform the same task.
Thanks all Stephen