{"action":"opened","issue":{"url":"https://api.github.com/repos/gocd/gocd/issues/1794","labels_url":"https://api.github.com/repos/gocd/gocd/issues/1794/labels{/name}","comments_url":"https://api.github.com/repos/gocd/gocd/issues/1794/comments","events_url":"https://api.github.com/repos/gocd/gocd/issues/1794/events","html_url":"https://github.com/gocd/gocd/issues/1794","id":126250979,"number":1794,"title":"Enabling agents via Update Agent API has no effect","user":{"login":"rmarcinik","id":4670415,"avatar_url":"https://avatars.githubusercontent.com/u/4670415?v=3","gravatar_id":"","url":"https://api.github.com/users/rmarcinik","html_url":"https://github.com/rmarcinik","followers_url":"https://api.github.com/users/rmarcinik/followers","following_url":"https://api.github.com/users/rmarcinik/following{/other_user}","gists_url":"https://api.github.com/users/rmarcinik/gists{/gist_id}","starred_url":"https://api.github.com/users/rmarcinik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmarcinik/subscriptions","organizations_url":"https://api.github.com/users/rmarcinik/orgs","repos_url":"https://api.github.com/users/rmarcinik/repos","events_url":"https://api.github.com/users/rmarcinik/events{/privacy}","received_events_url":"https://api.github.com/users/rmarcinik/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-12T19:03:57Z","updated_at":"2016-01-12T19:03:57Z","closed_at":null,"body":"First, I want to thank you all for improving the go api in the latest release.  I am already using the new features to manage agent settings. (Go Version: 15.3.1) \r\nHowever I think there is a bug with updating an agent.  I am following the examples here:  [api.go.cd/current/#update-an-agent](https://api.go.cd/current/#update-an-agent ), and when I run the command it does not enable/disable the agent.  It does actually set the resources/environments so I know something is working behind the scenes.  \r\nHere is the command:\r\n```\r\ncurl 'http://my-server/go/api/agents/my-uuid' \\\r\n-u 'user:pw' \\\r\n-H 'Accept: application/vnd.go.cd.v2+json' \\\r\n-H 'Content-Type: application/json' \\\r\n-X PATCH \\\r\n-d '{ \r\n        \"environments\":\"test\",\r\n        \"resources\":\"blah\",\r\n        \"enabled\":true \r\n    }'\r\n```\r\n\r\nI am still able to toggle an agents status by hitting `/go/api/agents/my-uuid/enable`, but it looks like using update is the preferred method.\r\n"}}