{"action":"created","issue":{"url":"https://api.github.com/repos/Yelp/paasta/issues/514","repository_url":"https://api.github.com/repos/Yelp/paasta","labels_url":"https://api.github.com/repos/Yelp/paasta/issues/514/labels{/name}","comments_url":"https://api.github.com/repos/Yelp/paasta/issues/514/comments","events_url":"https://api.github.com/repos/Yelp/paasta/issues/514/events","html_url":"https://github.com/Yelp/paasta/issues/514","id":154131769,"number":514,"title":"Create HTTP drain method","user":{"login":"EvanKrall","id":233961,"avatar_url":"https://avatars.githubusercontent.com/u/233961?v=3","gravatar_id":"","url":"https://api.github.com/users/EvanKrall","html_url":"https://github.com/EvanKrall","followers_url":"https://api.github.com/users/EvanKrall/followers","following_url":"https://api.github.com/users/EvanKrall/following{/other_user}","gists_url":"https://api.github.com/users/EvanKrall/gists{/gist_id}","starred_url":"https://api.github.com/users/EvanKrall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EvanKrall/subscriptions","organizations_url":"https://api.github.com/users/EvanKrall/orgs","repos_url":"https://api.github.com/users/EvanKrall/repos","events_url":"https://api.github.com/users/EvanKrall/events{/privacy}","received_events_url":"https://api.github.com/users/EvanKrall/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Yelp/paasta/labels/in%20review","name":"in review","color":"eac04b"}],"state":"open","locked":false,"assignee":{"login":"EvanKrall","id":233961,"avatar_url":"https://avatars.githubusercontent.com/u/233961?v=3","gravatar_id":"","url":"https://api.github.com/users/EvanKrall","html_url":"https://github.com/EvanKrall","followers_url":"https://api.github.com/users/EvanKrall/followers","following_url":"https://api.github.com/users/EvanKrall/following{/other_user}","gists_url":"https://api.github.com/users/EvanKrall/gists{/gist_id}","starred_url":"https://api.github.com/users/EvanKrall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EvanKrall/subscriptions","organizations_url":"https://api.github.com/users/EvanKrall/orgs","repos_url":"https://api.github.com/users/EvanKrall/repos","events_url":"https://api.github.com/users/EvanKrall/events{/privacy}","received_events_url":"https://api.github.com/users/EvanKrall/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2016-05-10T23:51:34Z","updated_at":"2016-06-09T18:23:21Z","closed_at":null,"body":"It would be good to have a drain method that can make fairly arbitrary HTTP calls for its implementation of `drain`, `undrain`, `is_draining`, `safe_to_kill`.\r\n\r\nI'm thinking something whose config could look like this:\r\n\r\n```\r\nmain:\r\n  cpu: 1\r\n  mem: 100\r\n  drain_method: http\r\n  drain_method_params:\r\n    drain:\r\n      url_format: http://{host}:{port}/drain\r\n      method: PUT\r\n    undrain:\r\n      url_format: http://{host}:{port}/drain\r\n      method: DELETE\r\n    is_draining:\r\n      url_format: http://{host}:{port}/drain\r\n      method: GET\r\n      success_codes: 200-399\r\n    is_safe_to_kill:\r\n      url_format: http://{host}:{port}/drain\r\n      method: GET\r\n      success_codes: 200\r\n```\r\n\r\nI'm imagining we'd make several things available in `url_format`, maybe:\r\n\r\n - `{host}`: the ip or hostname of the slave this task is running on\r\n - `{port}`: the allocated port for this container\r\n - `{service_name}`: the name of the service\r\n - `{instance_name}`: the name of the instance\r\n - `{nerve_ns}`: the nerve namespace of this instance\r\n - `{git_sha}`: the 7-hex-digit git SHA prefix that we put into the task ID\r\n - `{config_hash}`: the 7-hex-digit config hash in the task ID\r\n"},"comment":{"url":"https://api.github.com/repos/Yelp/paasta/issues/comments/224983231","html_url":"https://github.com/Yelp/paasta/issues/514#issuecomment-224983231","issue_url":"https://api.github.com/repos/Yelp/paasta/issues/514","id":224983231,"user":{"login":"jcnnghm","id":71814,"avatar_url":"https://avatars.githubusercontent.com/u/71814?v=3","gravatar_id":"","url":"https://api.github.com/users/jcnnghm","html_url":"https://github.com/jcnnghm","followers_url":"https://api.github.com/users/jcnnghm/followers","following_url":"https://api.github.com/users/jcnnghm/following{/other_user}","gists_url":"https://api.github.com/users/jcnnghm/gists{/gist_id}","starred_url":"https://api.github.com/users/jcnnghm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcnnghm/subscriptions","organizations_url":"https://api.github.com/users/jcnnghm/orgs","repos_url":"https://api.github.com/users/jcnnghm/repos","events_url":"https://api.github.com/users/jcnnghm/events{/privacy}","received_events_url":"https://api.github.com/users/jcnnghm/received_events","type":"User","site_admin":false},"created_at":"2016-06-09T18:23:21Z","updated_at":"2016-06-09T18:23:21Z","body":"@EvanKrall Will this also allow running arbitrary commands for non-http services for `drain`, `undrain`, `is_draining`, and `is_safe_to_kill`?"}}
{"actor":{"display_login":"jcnnghm"}}