{"action":"created","comment":{"url":"https://api.github.com/repos/lxc/pylxd/pulls/comments/72115687","id":72115687,"diff_hunk":"@@ -84,3 +84,25 @@ def export(self):\n         \"\"\"Export the image.\"\"\"\n         response = self.api.export.get()\n         return response.content\n+\n+    def add_alias(self, name, description):\n+        \"\"\"Add an alias to the image.\"\"\"\n+        self.client.api.images.aliases.post(json={\n+            'description': description,\n+            'target': self.fingerprint,\n+            'name': name\n+        })\n+\n+        # Update current aliases list\n+        self.sync()","path":"pylxd/image.py","position":23,"original_position":23,"commit_id":"22ce137fb7d312dfdf125c2211070488d6989f40","original_commit_id":"22ce137fb7d312dfdf125c2211070488d6989f40","user":{"login":"rockstar","id":60306,"avatar_url":"https://avatars.githubusercontent.com/u/60306?v=3","gravatar_id":"","url":"https://api.github.com/users/rockstar","html_url":"https://github.com/rockstar","followers_url":"https://api.github.com/users/rockstar/followers","following_url":"https://api.github.com/users/rockstar/following{/other_user}","gists_url":"https://api.github.com/users/rockstar/gists{/gist_id}","starred_url":"https://api.github.com/users/rockstar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rockstar/subscriptions","organizations_url":"https://api.github.com/users/rockstar/orgs","repos_url":"https://api.github.com/users/rockstar/repos","events_url":"https://api.github.com/users/rockstar/events{/privacy}","received_events_url":"https://api.github.com/users/rockstar/received_events","type":"User","site_admin":false},"body":"Rather than call `sync` here, you should just add the alias to the object locally. Doing a sync will wipe away any local changes (which is a known issue), but it seems an awkward side effect that adding an alias loses local/unsync'd changes.","created_at":"2016-07-25T18:16:01Z","updated_at":"2016-07-25T18:16:01Z","html_url":"https://github.com/lxc/pylxd/pull/168#discussion_r72115687","pull_request_url":"https://api.github.com/repos/lxc/pylxd/pulls/168","_links":{"self":{"href":"https://api.github.com/repos/lxc/pylxd/pulls/comments/72115687"},"html":{"href":"https://github.com/lxc/pylxd/pull/168#discussion_r72115687"},"pull_request":{"href":"https://api.github.com/repos/lxc/pylxd/pulls/168"}}},"pull_request":{"url":"https://api.github.com/repos/lxc/pylxd/pulls/168","id":78715697,"html_url":"https://github.com/lxc/pylxd/pull/168","diff_url":"https://github.com/lxc/pylxd/pull/168.diff","patch_url":"https://github.com/lxc/pylxd/pull/168.patch","issue_url":"https://api.github.com/repos/lxc/pylxd/issues/168","number":168,"state":"open","locked":false,"title":"Add image aliases support.","user":{"login":"pcdummy","id":358074,"avatar_url":"https://avatars.githubusercontent.com/u/358074?v=3","gravatar_id":"","url":"https://api.github.com/users/pcdummy","html_url":"https://github.com/pcdummy","followers_url":"https://api.github.com/users/pcdummy/followers","following_url":"https://api.github.com/users/pcdummy/following{/other_user}","gists_url":"https://api.github.com/users/pcdummy/gists{/gist_id}","starred_url":"https://api.github.com/users/pcdummy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pcdummy/subscriptions","organizations_url":"https://api.github.com/users/pcdummy/orgs","repos_url":"https://api.github.com/users/pcdummy/repos","events_url":"https://api.github.com/users/pcdummy/events{/privacy}","received_events_url":"https://api.github.com/users/pcdummy/received_events","type":"User","site_admin":false},"body":"As discussed in the IRC with @rockstar here comes the IAS - Image Alias Support.\r\n\r\n\r\nSigned-off-by: Rene Jochum <rene@jochums.at>","created_at":"2016-07-25T16:56:48Z","updated_at":"2016-07-25T18:16:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4261136bbfeb00a193f66b1f0a634eeb07e06ef3","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/lxc/pylxd/pulls/168/commits","review_comments_url":"https://api.github.com/repos/lxc/pylxd/pulls/168/comments","review_comment_url":"https://api.github.com/repos/lxc/pylxd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lxc/pylxd/issues/168/comments","statuses_url":"https://api.github.com/repos/lxc/pylxd/statuses/22ce137fb7d312dfdf125c2211070488d6989f40","head":{"label":"pcdummy:image_alias_support","ref":"image_alias_support","sha":"22ce137fb7d312dfdf125c2211070488d6989f40","user":{"login":"pcdummy","id":358074,"avatar_url":"https://avatars.githubusercontent.com/u/358074?v=3","gravatar_id":"","url":"https://api.github.com/users/pcdummy","html_url":"https://github.com/pcdummy","followers_url":"https://api.github.com/users/pcdummy/followers","following_url":"https://api.github.com/users/pcdummy/following{/other_user}","gists_url":"https://api.github.com/users/pcdummy/gists{/gist_id}","starred_url":"https://api.github.com/users/pcdummy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pcdummy/subscriptions","organizations_url":"https://api.github.com/users/pcdummy/orgs","repos_url":"https://api.github.com/users/pcdummy/repos","events_url":"https://api.github.com/users/pcdummy/events{/privacy}","received_events_url":"https://api.github.com/users/pcdummy/received_events","type":"User","site_admin":false},"repo":{"id":63544833,"name":"pylxd","full_name":"pcdummy/pylxd","owner":{"login":"pcdummy","id":358074,"avatar_url":"https://avatars.githubusercontent.com/u/358074?v=3","gravatar_id":"","url":"https://api.github.com/users/pcdummy","html_url":"https://github.com/pcdummy","followers_url":"https://api.github.com/users/pcdummy/followers","following_url":"https://api.github.com/users/pcdummy/following{/other_user}","gists_url":"https://api.github.com/users/pcdummy/gists{/gist_id}","starred_url":"https://api.github.com/users/pcdummy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pcdummy/subscriptions","organizations_url":"https://api.github.com/users/pcdummy/orgs","repos_url":"https://api.github.com/users/pcdummy/repos","events_url":"https://api.github.com/users/pcdummy/events{/privacy}","received_events_url":"https://api.github.com/users/pcdummy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pcdummy/pylxd","description":"Python module for LXD","fork":true,"url":"https://api.github.com/repos/pcdummy/pylxd","forks_url":"https://api.github.com/repos/pcdummy/pylxd/forks","keys_url":"https://api.github.com/repos/pcdummy/pylxd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pcdummy/pylxd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pcdummy/pylxd/teams","hooks_url":"https://api.github.com/repos/pcdummy/pylxd/hooks","issue_events_url":"https://api.github.com/repos/pcdummy/pylxd/issues/events{/number}","events_url":"https://api.github.com/repos/pcdummy/pylxd/events","assignees_url":"https://api.github.com/repos/pcdummy/pylxd/assignees{/user}","branches_url":"https://api.github.com/repos/pcdummy/pylxd/branches{/branch}","tags_url":"https://api.github.com/repos/pcdummy/pylxd/tags","blobs_url":"https://api.github.com/repos/pcdummy/pylxd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pcdummy/pylxd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pcdummy/pylxd/git/refs{/sha}","trees_url":"https://api.github.com/repos/pcdummy/pylxd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pcdummy/pylxd/statuses/{sha}","languages_url":"https://api.github.com/repos/pcdummy/pylxd/languages","stargazers_url":"https://api.github.com/repos/pcdummy/pylxd/stargazers","contributors_url":"https://api.github.com/repos/pcdummy/pylxd/contributors","subscribers_url":"https://api.github.com/repos/pcdummy/pylxd/subscribers","subscription_url":"https://api.github.com/repos/pcdummy/pylxd/subscription","commits_url":"https://api.github.com/repos/pcdummy/pylxd/commits{/sha}","git_commits_url":"https://api.github.com/repos/pcdummy/pylxd/git/commits{/sha}","comments_url":"https://api.github.com/repos/pcdummy/pylxd/comments{/number}","issue_comment_url":"https://api.github.com/repos/pcdummy/pylxd/issues/comments{/number}","contents_url":"https://api.github.com/repos/pcdummy/pylxd/contents/{+path}","compare_url":"https://api.github.com/repos/pcdummy/pylxd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pcdummy/pylxd/merges","archive_url":"https://api.github.com/repos/pcdummy/pylxd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pcdummy/pylxd/downloads","issues_url":"https://api.github.com/repos/pcdummy/pylxd/issues{/number}","pulls_url":"https://api.github.com/repos/pcdummy/pylxd/pulls{/number}","milestones_url":"https://api.github.com/repos/pcdummy/pylxd/milestones{/number}","notifications_url":"https://api.github.com/repos/pcdummy/pylxd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pcdummy/pylxd/labels{/name}","releases_url":"https://api.github.com/repos/pcdummy/pylxd/releases{/id}","deployments_url":"https://api.github.com/repos/pcdummy/pylxd/deployments","created_at":"2016-07-17T17:47:12Z","updated_at":"2016-07-17T17:47:13Z","pushed_at":"2016-07-25T17:46:29Z","git_url":"git://github.com/pcdummy/pylxd.git","ssh_url":"git@github.com:pcdummy/pylxd.git","clone_url":"https://github.com/pcdummy/pylxd.git","svn_url":"https://github.com/pcdummy/pylxd","homepage":"https://linuxcontainers.org/lxd","size":66714,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"lxc:master","ref":"master","sha":"0296aa35752f4edceb7ec845257ccbf578031377","user":{"login":"lxc","id":2301756,"avatar_url":"https://avatars.githubusercontent.com/u/2301756?v=3","gravatar_id":"","url":"https://api.github.com/users/lxc","html_url":"https://github.com/lxc","followers_url":"https://api.github.com/users/lxc/followers","following_url":"https://api.github.com/users/lxc/following{/other_user}","gists_url":"https://api.github.com/users/lxc/gists{/gist_id}","starred_url":"https://api.github.com/users/lxc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lxc/subscriptions","organizations_url":"https://api.github.com/users/lxc/orgs","repos_url":"https://api.github.com/users/lxc/repos","events_url":"https://api.github.com/users/lxc/events{/privacy}","received_events_url":"https://api.github.com/users/lxc/received_events","type":"Organization","site_admin":false},"repo":{"id":36316984,"name":"pylxd","full_name":"lxc/pylxd","owner":{"login":"lxc","id":2301756,"avatar_url":"https://avatars.githubusercontent.com/u/2301756?v=3","gravatar_id":"","url":"https://api.github.com/users/lxc","html_url":"https://github.com/lxc","followers_url":"https://api.github.com/users/lxc/followers","following_url":"https://api.github.com/users/lxc/following{/other_user}","gists_url":"https://api.github.com/users/lxc/gists{/gist_id}","starred_url":"https://api.github.com/users/lxc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lxc/subscriptions","organizations_url":"https://api.github.com/users/lxc/orgs","repos_url":"https://api.github.com/users/lxc/repos","events_url":"https://api.github.com/users/lxc/events{/privacy}","received_events_url":"https://api.github.com/users/lxc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lxc/pylxd","description":"Python module for LXD","fork":false,"url":"https://api.github.com/repos/lxc/pylxd","forks_url":"https://api.github.com/repos/lxc/pylxd/forks","keys_url":"https://api.github.com/repos/lxc/pylxd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lxc/pylxd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lxc/pylxd/teams","hooks_url":"https://api.github.com/repos/lxc/pylxd/hooks","issue_events_url":"https://api.github.com/repos/lxc/pylxd/issues/events{/number}","events_url":"https://api.github.com/repos/lxc/pylxd/events","assignees_url":"https://api.github.com/repos/lxc/pylxd/assignees{/user}","branches_url":"https://api.github.com/repos/lxc/pylxd/branches{/branch}","tags_url":"https://api.github.com/repos/lxc/pylxd/tags","blobs_url":"https://api.github.com/repos/lxc/pylxd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lxc/pylxd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lxc/pylxd/git/refs{/sha}","trees_url":"https://api.github.com/repos/lxc/pylxd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lxc/pylxd/statuses/{sha}","languages_url":"https://api.github.com/repos/lxc/pylxd/languages","stargazers_url":"https://api.github.com/repos/lxc/pylxd/stargazers","contributors_url":"https://api.github.com/repos/lxc/pylxd/contributors","subscribers_url":"https://api.github.com/repos/lxc/pylxd/subscribers","subscription_url":"https://api.github.com/repos/lxc/pylxd/subscription","commits_url":"https://api.github.com/repos/lxc/pylxd/commits{/sha}","git_commits_url":"https://api.github.com/repos/lxc/pylxd/git/commits{/sha}","comments_url":"https://api.github.com/repos/lxc/pylxd/comments{/number}","issue_comment_url":"https://api.github.com/repos/lxc/pylxd/issues/comments{/number}","contents_url":"https://api.github.com/repos/lxc/pylxd/contents/{+path}","compare_url":"https://api.github.com/repos/lxc/pylxd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lxc/pylxd/merges","archive_url":"https://api.github.com/repos/lxc/pylxd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lxc/pylxd/downloads","issues_url":"https://api.github.com/repos/lxc/pylxd/issues{/number}","pulls_url":"https://api.github.com/repos/lxc/pylxd/pulls{/number}","milestones_url":"https://api.github.com/repos/lxc/pylxd/milestones{/number}","notifications_url":"https://api.github.com/repos/lxc/pylxd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lxc/pylxd/labels{/name}","releases_url":"https://api.github.com/repos/lxc/pylxd/releases{/id}","deployments_url":"https://api.github.com/repos/lxc/pylxd/deployments","created_at":"2015-05-26T18:54:16Z","updated_at":"2016-07-20T15:11:48Z","pushed_at":"2016-07-25T17:46:29Z","git_url":"git://github.com/lxc/pylxd.git","ssh_url":"git@github.com:lxc/pylxd.git","clone_url":"https://github.com/lxc/pylxd.git","svn_url":"https://github.com/lxc/pylxd","homepage":"https://linuxcontainers.org/lxd","size":66724,"stargazers_count":62,"watchers_count":62,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":38,"mirror_url":null,"open_issues_count":8,"forks":38,"open_issues":8,"watchers":62,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lxc/pylxd/pulls/168"},"html":{"href":"https://github.com/lxc/pylxd/pull/168"},"issue":{"href":"https://api.github.com/repos/lxc/pylxd/issues/168"},"comments":{"href":"https://api.github.com/repos/lxc/pylxd/issues/168/comments"},"review_comments":{"href":"https://api.github.com/repos/lxc/pylxd/pulls/168/comments"},"review_comment":{"href":"https://api.github.com/repos/lxc/pylxd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lxc/pylxd/pulls/168/commits"},"statuses":{"href":"https://api.github.com/repos/lxc/pylxd/statuses/22ce137fb7d312dfdf125c2211070488d6989f40"}}}}
{"actor":{"display_login":"rockstar"}}