{"action":"created","issue":{"url":"https://api.github.com/repos/girder/girder/issues/1151","repository_url":"https://api.github.com/repos/girder/girder","labels_url":"https://api.github.com/repos/girder/girder/issues/1151/labels{/name}","comments_url":"https://api.github.com/repos/girder/girder/issues/1151/comments","events_url":"https://api.github.com/repos/girder/girder/issues/1151/events","html_url":"https://github.com/girder/girder/pull/1151","id":124478090,"number":1151,"title":"[WIP] Collections girder ansible module","user":{"login":"kotfic","id":669959,"avatar_url":"https://avatars.githubusercontent.com/u/669959?v=3","gravatar_id":"","url":"https://api.github.com/users/kotfic","html_url":"https://github.com/kotfic","followers_url":"https://api.github.com/users/kotfic/followers","following_url":"https://api.github.com/users/kotfic/following{/other_user}","gists_url":"https://api.github.com/users/kotfic/gists{/gist_id}","starred_url":"https://api.github.com/users/kotfic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kotfic/subscriptions","organizations_url":"https://api.github.com/users/kotfic/orgs","repos_url":"https://api.github.com/users/kotfic/repos","events_url":"https://api.github.com/users/kotfic/events{/privacy}","received_events_url":"https://api.github.com/users/kotfic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-12-31T14:59:37Z","updated_at":"2016-03-09T18:07:53Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/girder/girder/pulls/1151","html_url":"https://github.com/girder/girder/pull/1151","diff_url":"https://github.com/girder/girder/pull/1151.diff","patch_url":"https://github.com/girder/girder/pull/1151.patch"},"body":"Adds support for idempotent creation of ```collection```, ```folder```, ```item```, ```file``` resources as well as basic ```upload``` functionality to the girder ansible module.\r\n\r\n```yaml\r\n    - name: Create collection\r\n      girder:\r\n        port: 8080\r\n        username: \"admin\"\r\n        password: \"letmein\"\r\n        collection:\r\n          name: \"Test Collection\"\r\n          description: \"A test collection\"\r\n      register: test_collection\r\n\r\n    - name: Create folder\r\n      girder:\r\n        port: 8080\r\n        username: \"admin\"\r\n        password: \"letmein\"\r\n        folder:\r\n          parentType: \"collection\"\r\n          parentId: \"{{test_collection['gc_return']['_id'] }}\"\r\n          name: \"test folder\"\r\n          description: \"A test folder\"\r\n      register: test_folder\r\n\r\n    - name: Create an item\r\n      girder:\r\n        port: 8080\r\n        username: \"admin\"\r\n        password: \"letmein\"\r\n        item:\r\n          folderId: \"{{test_folder['gc_return']['_id'] }}\"\r\n          name: \"test item\"\r\n          description: \"A test item\"\r\n      register: test_item\r\n\r\n    - name: Upload files\r\n      girder:\r\n        port: 8080\r\n        username: \"admin\"\r\n        password: \"letmein\"\r\n        files:\r\n          itemId: \"{{ test_item['gc_return']['_id'] }}\"\r\n          sources:\r\n            - /tmp/data/test1.txt\r\n            - /tmp/data/test2.txt\r\n      register: retval\r\n```\r\n\r\nUploads are guaranteed to be idempotent based on file name (basename) and size. In all cases you may add ```state: absent``` to ensure the resource (e.g.,  collection, folder, item, file) is not present. \r\n\r\nStill left:\r\n- [x] Add access control\r\n  - [x] Create groups\r\n  - [x] Set access on resource for users, groups\r\n- [X] Provide hierarchical processing so ```collection``` can include ```folders``` section, folders can include items, items,  files etc. \r\n- [ ] Testing (i want to include automated testing through Travis)\r\n- [ ] Documentation"},"comment":{"url":"https://api.github.com/repos/girder/girder/issues/comments/194428930","html_url":"https://github.com/girder/girder/pull/1151#issuecomment-194428930","issue_url":"https://api.github.com/repos/girder/girder/issues/1151","id":194428930,"user":{"login":"zachmullen","id":555959,"avatar_url":"https://avatars.githubusercontent.com/u/555959?v=3","gravatar_id":"","url":"https://api.github.com/users/zachmullen","html_url":"https://github.com/zachmullen","followers_url":"https://api.github.com/users/zachmullen/followers","following_url":"https://api.github.com/users/zachmullen/following{/other_user}","gists_url":"https://api.github.com/users/zachmullen/gists{/gist_id}","starred_url":"https://api.github.com/users/zachmullen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zachmullen/subscriptions","organizations_url":"https://api.github.com/users/zachmullen/orgs","repos_url":"https://api.github.com/users/zachmullen/repos","events_url":"https://api.github.com/users/zachmullen/events{/privacy}","received_events_url":"https://api.github.com/users/zachmullen/received_events","type":"User","site_admin":false},"created_at":"2016-03-09T18:07:53Z","updated_at":"2016-03-09T18:07:53Z","body":"Awesome :smile: "}}