{"action":"created","issue":{"url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/issues/4708","repository_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy","labels_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/issues/4708/labels{/name}","comments_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/issues/4708/comments","events_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/issues/4708/events","html_url":"https://github.com/openmicroscopy/openmicroscopy/pull/4708","id":160170653,"number":4708,"title":"Webgateway api2","user":{"login":"will-moore","id":900055,"avatar_url":"https://avatars.githubusercontent.com/u/900055?v=3","gravatar_id":"","url":"https://api.github.com/users/will-moore","html_url":"https://github.com/will-moore","followers_url":"https://api.github.com/users/will-moore/followers","following_url":"https://api.github.com/users/will-moore/following{/other_user}","gists_url":"https://api.github.com/users/will-moore/gists{/gist_id}","starred_url":"https://api.github.com/users/will-moore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/will-moore/subscriptions","organizations_url":"https://api.github.com/users/will-moore/orgs","repos_url":"https://api.github.com/users/will-moore/repos","events_url":"https://api.github.com/users/will-moore/events{/privacy}","received_events_url":"https://api.github.com/users/will-moore/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/labels/breaking","name":"breaking","color":"ffaacc"},{"url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/labels/develop","name":"develop","color":"02e10c"},{"url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/labels/exclude","name":"exclude","color":"e10c02"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":36,"created_at":"2016-06-14T12:37:34Z","updated_at":"2016-09-13T16:11:00Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/pulls/4708","html_url":"https://github.com/openmicroscopy/openmicroscopy/pull/4708","diff_url":"https://github.com/openmicroscopy/openmicroscopy/pull/4708.diff","patch_url":"https://github.com/openmicroscopy/openmicroscopy/pull/4708.patch"},"body":"This is a subset of webgateway api methods explored in https://github.com/openmicroscopy/openmicroscopy/pull/4572.\r\n\r\nUser guide for the API which covers all urls added in this PR can be found at https://github.com/will-moore/design/blob/webgateway_json_api/webgateway_json_api.md\r\n\r\nI have also added an example test script at\r\nhttps://github.com/will-moore/openmicroscopy/blob/webgateway_api2/examples/Training/python/Json_Api/Login.py\r\nwhich can be used for testing this PR.\r\n\r\nBrowse API at http://10.0.51.145/web/api/\r\n\r\nThis PR uses ```omero-marshal``` which is included in the build.\r\nWe also add /version/ into the url to allow versioning, E.g.\r\n```\r\n/api/v1/m/projects/\r\n```\r\nThe supported versions are specified in settings ```API_VERSIONS = ['0.1']``` \r\nDetails of our versioning strategy are to be decided.\r\nThis PR splits the querying and marshalling into api_query.py and api_marshal.py respectively.\r\n\r\nNew tests are under OmeroWeb/test/integration/test_api_*\r\nI have ported some integration tests from test_tree.py, and turned them into Django session-based tests to test the actual json api, not just the underlying querying and marshalling. These tests also use ```omero-marshal```.\r\n\r\n--exclude\r\n\r\nTODO / discuss\r\n - [x] OmeroWeb Tests\r\n - [x] Filter by owner & group\r\n - [x] Single project  ```/webgateway/api/v1/m/projects/:id/ ```\r\n - [x] Test page, limit, normalize, childCount & callback query params in test_api_projects.py\r\n - [x] Test Project creation, update and delete in test_api_projects.py\r\n - [x] Test 404 in test_api_projects.py\r\n - [x] Complete test_api_login.py with success and error handling as in [gist]\r\n(https://gist.github.com/will-moore/3677206681b1ea4bd966bf838f7ec63d)\r\n - [x] IF we're dropping Django 1.6, can use 1.7 Http imports in omeroweb/http See https://github.com/openmicroscopy/openmicroscopy/pull/4708/commits/440ce90c9bb40efbd36333700872e5f4b05ca092\r\n - [x] Make sure GET, PUT & POST return correct status codes See https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.5\r\n\r\nFuture TODOs:\r\n - Investigate CORS instead of jsonp().\r\n - Register ```OMERO.webapi``` user agent with QA\r\n - Split 'api' out of webgateway into separate app\r\n - Handle 'normalize' by unloading groups & experimenters?"},"comment":{"url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/issues/comments/246735208","html_url":"https://github.com/openmicroscopy/openmicroscopy/pull/4708#issuecomment-246735208","issue_url":"https://api.github.com/repos/openmicroscopy/openmicroscopy/issues/4708","id":246735208,"user":{"login":"will-moore","id":900055,"avatar_url":"https://avatars.githubusercontent.com/u/900055?v=3","gravatar_id":"","url":"https://api.github.com/users/will-moore","html_url":"https://github.com/will-moore","followers_url":"https://api.github.com/users/will-moore/followers","following_url":"https://api.github.com/users/will-moore/following{/other_user}","gists_url":"https://api.github.com/users/will-moore/gists{/gist_id}","starred_url":"https://api.github.com/users/will-moore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/will-moore/subscriptions","organizations_url":"https://api.github.com/users/will-moore/orgs","repos_url":"https://api.github.com/users/will-moore/repos","events_url":"https://api.github.com/users/will-moore/events{/privacy}","received_events_url":"https://api.github.com/users/will-moore/received_events","type":"User","site_admin":false},"created_at":"2016-09-13T16:11:00Z","updated_at":"2016-09-13T16:11:00Z","body":"@chris-allan: Re: this morning's discussion:\r\n - Using status_code 500 for any uncaught exceptions, but wrapping omero_marshal decode in try/except to return 400 response\r\n - Reverted api changes, since we now handle non-dict responses\r\n - Merged origin/develop\r\n - Couldn't fix conflicts with #4805 by updating requirements.txt to same as in that PR - still caused merge conflicts."}}
{"actor":{"display_login":"will-moore"}}