Rest API PUT or POST operation to enable tentacle

Why can’t I post or put the following:-

{
“IsDisabled”: true
}

at say endpoint:-
http://localhost:8282/api/machines/Machines-1

For some reason I have to GET the entire machine object and then post it back with enabled flag set.
I already have the id of the machine, this means to http requests.

Hi Ben,

Thanks for getting in touch! When using the API, Octopus expects entire resources to be PUT back (not just fields you want to change). The usual pattern would be to GET the machine, make the change, then PUT the whole machine back. For example, if you do a GET and you get:

{ Name: "Foo", Description: "Bar", ... }

And you PUT just this:

{ Name: "Foo" }

It doesn’t mean “don’t change the Description”, it means “there is no description”, so it will be set to the default value which is null. I understand this might not be consistent will all REST API’s nor intuitive, but it’s unfortunately how our API expects to work.

Let me know if you have any further questions here or run into any issues. :slight_smile:

Best regards,
Daniel