{"action":"created","issue":{"url":"https://api.github.com/repos/grafana/grafana/issues/13046","repository_url":"https://api.github.com/repos/grafana/grafana","labels_url":"https://api.github.com/repos/grafana/grafana/issues/13046/labels{/name}","comments_url":"https://api.github.com/repos/grafana/grafana/issues/13046/comments","events_url":"https://api.github.com/repos/grafana/grafana/issues/13046/events","html_url":"https://github.com/grafana/grafana/issues/13046","id":354484745,"node_id":"MDU6SXNzdWUzNTQ0ODQ3NDU=","number":13046,"title":"API: datasources PUT breaks datasource edit UI","user":{"login":"TimSimmons","id":5033523,"node_id":"MDQ6VXNlcjUwMzM1MjM=","avatar_url":"https://avatars3.githubusercontent.com/u/5033523?v=4","gravatar_id":"","url":"https://api.github.com/users/TimSimmons","html_url":"https://github.com/TimSimmons","followers_url":"https://api.github.com/users/TimSimmons/followers","following_url":"https://api.github.com/users/TimSimmons/following{/other_user}","gists_url":"https://api.github.com/users/TimSimmons/gists{/gist_id}","starred_url":"https://api.github.com/users/TimSimmons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TimSimmons/subscriptions","organizations_url":"https://api.github.com/users/TimSimmons/orgs","repos_url":"https://api.github.com/users/TimSimmons/repos","events_url":"https://api.github.com/users/TimSimmons/events{/privacy}","received_events_url":"https://api.github.com/users/TimSimmons/received_events","type":"User","site_admin":false},"labels":[{"id":120793823,"node_id":"MDU6TGFiZWwxMjA3OTM4MjM=","url":"https://api.github.com/repos/grafana/grafana/labels/state:%20needs%20more%20detail","name":"state: needs more detail","color":"1d76db","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-08-27T21:26:41Z","updated_at":"2018-08-28T14:40:01Z","closed_at":null,"author_association":"NONE","body":"### What Grafana version are you using?\r\n\r\nv5.2.2\r\n\r\n### What datasource are you using?\r\n\r\nPrometheus\r\n\r\n### What OS are you running grafana on?\r\n\r\nLinux (in Kubernetes)\r\n\r\n### What did you do?\r\n\r\nUse http://docs.grafana.org/http_api/data_source/#update-an-existing-data-source to update a datasource URL.\r\n\r\n1. Created a new datasource with a working Prometheus url\r\n2. I performed a GET /api/datasources/id\r\n3. Substituted the URL to a new URL that also worked and performed a PUT /api/datasources/id with the slightly modified HTTP body.\r\n4. Viewed /datasources/edit/id\r\n\r\n### What was the expected result?\r\n\r\nThe URL would be updated, and the datasource would continue working as it would have otherwise.\r\n\r\n### What happened instead?\r\n\r\nThe datasource continued to work in dashboards, however it broke in the datasource edit UI, making it unchangeable by hand in the future.\r\n\r\nBefore:\r\n![before](https://i.imgur.com/Z7MVbvg.png)\r\n\r\nAfter:\r\n![after](https://i.imgur.com/wwgD7b9.png)\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/grafana/grafana/issues/comments/416611215","html_url":"https://github.com/grafana/grafana/issues/13046#issuecomment-416611215","issue_url":"https://api.github.com/repos/grafana/grafana/issues/13046","id":416611215,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNjYxMTIxNQ==","user":{"login":"TimSimmons","id":5033523,"node_id":"MDQ6VXNlcjUwMzM1MjM=","avatar_url":"https://avatars3.githubusercontent.com/u/5033523?v=4","gravatar_id":"","url":"https://api.github.com/users/TimSimmons","html_url":"https://github.com/TimSimmons","followers_url":"https://api.github.com/users/TimSimmons/followers","following_url":"https://api.github.com/users/TimSimmons/following{/other_user}","gists_url":"https://api.github.com/users/TimSimmons/gists{/gist_id}","starred_url":"https://api.github.com/users/TimSimmons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TimSimmons/subscriptions","organizations_url":"https://api.github.com/users/TimSimmons/orgs","repos_url":"https://api.github.com/users/TimSimmons/repos","events_url":"https://api.github.com/users/TimSimmons/events{/privacy}","received_events_url":"https://api.github.com/users/TimSimmons/received_events","type":"User","site_admin":false},"created_at":"2018-08-28T14:40:01Z","updated_at":"2018-08-28T14:40:01Z","author_association":"NONE","body":"I took the body from a `GET /api/datasources/<id>` and changed the URL and did the `PUT /api/datsources/<id>`.\r\n```\r\n{\r\n  \"id\": 498,\r\n  \"orgId\": 1,\r\n  \"name\": \"temporary boi\",\r\n  \"type\": \"prometheus\",\r\n  \"typeLogoUrl\": \"\",\r\n  \"access\": \"proxy\",\r\n  \"url\": \"http://mynewurl.com\",\r\n  \"password\": \"\",\r\n  \"user\": \"\",\r\n  \"database\": \"\",\r\n  \"basicAuth\": false,\r\n  \"basicAuthUser\": \"\",\r\n  \"basicAuthPassword\": \"\",\r\n  \"withCredentials\": false,\r\n  \"isDefault\": false,\r\n  \"secureJsonFields\": {},\r\n  \"version\": 1,\r\n  \"readOnly\": false\r\n}\r\n```"}}
{"actor":{"display_login":"TimSimmons"}}