{"action":"created","issue":{"url":"https://api.github.com/repos/joyent/sdc-vmapi/issues/14","labels_url":"https://api.github.com/repos/joyent/sdc-vmapi/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/joyent/sdc-vmapi/issues/14/comments","events_url":"https://api.github.com/repos/joyent/sdc-vmapi/issues/14/events","html_url":"https://github.com/joyent/sdc-vmapi/pull/14","id":119114803,"number":14,"title":"ZAPI-685: do not start a workflow on DELETE /vms if not needed","user":{"login":"misterdjules","id":811047,"avatar_url":"https://avatars.githubusercontent.com/u/811047?v=3","gravatar_id":"","url":"https://api.github.com/users/misterdjules","html_url":"https://github.com/misterdjules","followers_url":"https://api.github.com/users/misterdjules/followers","following_url":"https://api.github.com/users/misterdjules/following{/other_user}","gists_url":"https://api.github.com/users/misterdjules/gists{/gist_id}","starred_url":"https://api.github.com/users/misterdjules/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/misterdjules/subscriptions","organizations_url":"https://api.github.com/users/misterdjules/orgs","repos_url":"https://api.github.com/users/misterdjules/repos","events_url":"https://api.github.com/users/misterdjules/events{/privacy}","received_events_url":"https://api.github.com/users/misterdjules/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-11-27T00:52:06Z","updated_at":"2015-12-01T00:09:46Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/joyent/sdc-vmapi/pulls/14","html_url":"https://github.com/joyent/sdc-vmapi/pull/14","diff_url":"https://github.com/joyent/sdc-vmapi/pull/14.diff","patch_url":"https://github.com/joyent/sdc-vmapi/pull/14.patch"},"body":"When handling a DELETE /vms/some-vm request, do not start a workflow if\r\none of the following conditions are true:\r\n\r\n1. The VM is in state 'provisioning'\r\n2. The VM doesn't have a server_uuid\r\n3. The server_uuid of the VM is not present in CNAPI\r\n\r\nIn cases 2 and 3, mark the VM as destroyed and return a 200 HTTP status\r\ncode. In case 1, return an error.\r\n\r\nReturning early and not starting a destroy workflow in these cases is\r\nfaster and doesn't take any resource in the workflow's queue, thus\r\nallowing other workflows who have a chance to succeed to be processed\r\nmore quickly."},"comment":{"url":"https://api.github.com/repos/joyent/sdc-vmapi/issues/comments/160804784","html_url":"https://github.com/joyent/sdc-vmapi/pull/14#issuecomment-160804784","issue_url":"https://api.github.com/repos/joyent/sdc-vmapi/issues/14","id":160804784,"user":{"login":"richardkiene","id":656216,"avatar_url":"https://avatars.githubusercontent.com/u/656216?v=3","gravatar_id":"","url":"https://api.github.com/users/richardkiene","html_url":"https://github.com/richardkiene","followers_url":"https://api.github.com/users/richardkiene/followers","following_url":"https://api.github.com/users/richardkiene/following{/other_user}","gists_url":"https://api.github.com/users/richardkiene/gists{/gist_id}","starred_url":"https://api.github.com/users/richardkiene/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richardkiene/subscriptions","organizations_url":"https://api.github.com/users/richardkiene/orgs","repos_url":"https://api.github.com/users/richardkiene/repos","events_url":"https://api.github.com/users/richardkiene/events{/privacy}","received_events_url":"https://api.github.com/users/richardkiene/received_events","type":"User","site_admin":false},"created_at":"2015-12-01T00:09:46Z","updated_at":"2015-12-01T00:09:46Z","body":"@misterdjules LGTM. I missed the fact that a provisioning VM cannot be deleted."}}