{"action":"created","issue":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-node/issues/1027","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-node/issues/1027/labels{/name}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-node/issues/1027/comments","events_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-node/issues/1027/events","html_url":"https://github.com/GoogleCloudPlatform/gcloud-node/issues/1027","id":122824700,"number":1027,"title":"Not able to implement Big Query cancel job","user":{"login":"peterwillis","id":653756,"avatar_url":"https://avatars.githubusercontent.com/u/653756?v=3","gravatar_id":"","url":"https://api.github.com/users/peterwillis","html_url":"https://github.com/peterwillis","followers_url":"https://api.github.com/users/peterwillis/followers","following_url":"https://api.github.com/users/peterwillis/following{/other_user}","gists_url":"https://api.github.com/users/peterwillis/gists{/gist_id}","starred_url":"https://api.github.com/users/peterwillis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterwillis/subscriptions","organizations_url":"https://api.github.com/users/peterwillis/orgs","repos_url":"https://api.github.com/users/peterwillis/repos","events_url":"https://api.github.com/users/peterwillis/events{/privacy}","received_events_url":"https://api.github.com/users/peterwillis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-17T21:16:27Z","updated_at":"2015-12-17T21:19:33Z","closed_at":null,"body":"The cancel job function is not implemented for big query so I went about putting together a pull request. It should be straight forward but it's not because the url structure for all the other job api calls are slightly different...\r\n\r\nTo cancel a job:\r\n```POST https://www.googleapis.com/bigquery/v2/project/projectId/jobs/jobId/cancel```\r\n\r\nThis is the correct URL because it works on the documentation site through the try it tester.\r\n\r\nAll the others have a pluralised 'projects' rather than 'project':\r\n```GET https://www.googleapis.com/bigquery/v2/projects/projectId/jobs/jobId```\r\n```POST https://www.googleapis.com/bigquery/v2/projects/projectId/queries```\r\n```GET https://www.googleapis.com/bigquery/v2/projects/projectId/jobs```\r\n...etc\r\n\r\nI don't think this could be neatly worked around for the purposes of this library because that part of the url is baked into the service class. Is this a mistake in the Big Query REST api? If so where should I raise that issue?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-node/issues/comments/165585027","html_url":"https://github.com/GoogleCloudPlatform/gcloud-node/issues/1027#issuecomment-165585027","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-node/issues/1027","id":165585027,"user":{"login":"stephenplusplus","id":723048,"avatar_url":"https://avatars.githubusercontent.com/u/723048?v=3","gravatar_id":"","url":"https://api.github.com/users/stephenplusplus","html_url":"https://github.com/stephenplusplus","followers_url":"https://api.github.com/users/stephenplusplus/followers","following_url":"https://api.github.com/users/stephenplusplus/following{/other_user}","gists_url":"https://api.github.com/users/stephenplusplus/gists{/gist_id}","starred_url":"https://api.github.com/users/stephenplusplus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephenplusplus/subscriptions","organizations_url":"https://api.github.com/users/stephenplusplus/orgs","repos_url":"https://api.github.com/users/stephenplusplus/repos","events_url":"https://api.github.com/users/stephenplusplus/events{/privacy}","received_events_url":"https://api.github.com/users/stephenplusplus/received_events","type":"User","site_admin":false},"created_at":"2015-12-17T21:19:33Z","updated_at":"2015-12-17T21:19:33Z","body":"Yikes, that's weird.\r\n\r\n> Is this a mistake in the Big Query REST api? If so where should I raise that issue?\r\n\r\n@jgeewax?\r\n\r\nIf we have to get around it, we can use request interceptors, something like:\r\n\r\n```js\r\nfunction Job() {\r\n  this.interceptors.push({\r\n    request: function(reqOpts) {\r\n      reqOpts.uri = reqOpts.uri.replace('/projects/', '/project/');\r\n      return reqOpts;\r\n    }\r\n  });\r\n}\r\n```"}}