{"action":"created","comment":{"url":"https://api.github.com/repos/rackerlabs/mimic/pulls/comments/40475156","id":40475156,"diff_hunk":"@@ -399,6 +410,40 @@ def perform_action(self, request, tenant_id, server_id):\n         \"\"\"\n         return self._region_collection_for_tenant(tenant_id).request_action(request, server_id, self.url)\n \n+    @app.route(\"/v2/<string:tenant_id>/os-keypairs\", methods=['GET'])\n+    def get_key_pairs(self, request, tenant_id):\n+        \"\"\"\n+        Returns current key pairs\n+        \"\"\"\n+        return self._keypair_collection_for_tenant(tenant_id).json_list()\n+\n+    @app.route(\"/v2/<string:tenant_id>/os-keypairs\", methods=['POST'])\n+    def create_key_pair(self, request, tenant_id):\n+        \"\"\"\n+        Returns a newly created key pair with the specified name.\n+        \"\"\"\n+        try:\n+            content = json.loads(request.content.read())\n+        except ValueError:\n+            request.setResponseCode(400)\n+            return json.dumps(bad_request(\"Malformed request body\", request))\n+\n+        keypair = content[\"keypair\"]\n+        keypair_from_request = KeyPair(\n+            name=keypair[\"name\"], public_key=keypair[\"public_key\"])","path":"mimic/rest/nova_api.py","position":49,"original_position":49,"commit_id":"a748b24e01eaa74b2aecc00ccbf490fe847da737","original_commit_id":"a748b24e01eaa74b2aecc00ccbf490fe847da737","user":{"login":"lekhajee","id":1591551,"avatar_url":"https://avatars.githubusercontent.com/u/1591551?v=3","gravatar_id":"","url":"https://api.github.com/users/lekhajee","html_url":"https://github.com/lekhajee","followers_url":"https://api.github.com/users/lekhajee/followers","following_url":"https://api.github.com/users/lekhajee/following{/other_user}","gists_url":"https://api.github.com/users/lekhajee/gists{/gist_id}","starred_url":"https://api.github.com/users/lekhajee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lekhajee/subscriptions","organizations_url":"https://api.github.com/users/lekhajee/orgs","repos_url":"https://api.github.com/users/lekhajee/repos","events_url":"https://api.github.com/users/lekhajee/events{/privacy}","received_events_url":"https://api.github.com/users/lekhajee/received_events","type":"User","site_admin":false},"body":"This will cause an exception if the `name` or `public_key` keys do not exist. Can we please handle this.","created_at":"2015-09-25T21:02:50Z","updated_at":"2015-09-25T21:02:50Z","html_url":"https://github.com/rackerlabs/mimic/pull/436#discussion_r40475156","pull_request_url":"https://api.github.com/repos/rackerlabs/mimic/pulls/436","_links":{"self":{"href":"https://api.github.com/repos/rackerlabs/mimic/pulls/comments/40475156"},"html":{"href":"https://github.com/rackerlabs/mimic/pull/436#discussion_r40475156"},"pull_request":{"href":"https://api.github.com/repos/rackerlabs/mimic/pulls/436"}}},"pull_request":{"url":"https://api.github.com/repos/rackerlabs/mimic/pulls/436","id":45939116,"html_url":"https://github.com/rackerlabs/mimic/pull/436","diff_url":"https://github.com/rackerlabs/mimic/pull/436.diff","patch_url":"https://github.com/rackerlabs/mimic/pull/436.patch","issue_url":"https://api.github.com/repos/rackerlabs/mimic/issues/436","number":436,"state":"open","locked":false,"title":"SSH Keypair Routes","user":{"login":"gabecase","id":8486998,"avatar_url":"https://avatars.githubusercontent.com/u/8486998?v=3","gravatar_id":"","url":"https://api.github.com/users/gabecase","html_url":"https://github.com/gabecase","followers_url":"https://api.github.com/users/gabecase/followers","following_url":"https://api.github.com/users/gabecase/following{/other_user}","gists_url":"https://api.github.com/users/gabecase/gists{/gist_id}","starred_url":"https://api.github.com/users/gabecase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabecase/subscriptions","organizations_url":"https://api.github.com/users/gabecase/orgs","repos_url":"https://api.github.com/users/gabecase/repos","events_url":"https://api.github.com/users/gabecase/events{/privacy}","received_events_url":"https://api.github.com/users/gabecase/received_events","type":"User","site_admin":false},"body":"Now able to create, read and delete SSH Keys for the NovaApi:\r\nhttp://docs.rackspace.com/servers/api/v2/cs-devguide/content/ServersKeyPairs-d1e2545.html\r\n\r\nVerified it works in reach here:\r\n![reach](http://19aa15d9760e52e9d7a6-6bf9c89be6f9d48237983c051ac7f055.r89.cf1.rackcdn.com/ssh_keys_working.gif)","created_at":"2015-09-24T19:28:49Z","updated_at":"2015-09-25T21:02:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e27d84541a62f1f24d700b2a95c80d2f9774ddd5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rackerlabs/mimic/pulls/436/commits","review_comments_url":"https://api.github.com/repos/rackerlabs/mimic/pulls/436/comments","review_comment_url":"https://api.github.com/repos/rackerlabs/mimic/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rackerlabs/mimic/issues/436/comments","statuses_url":"https://api.github.com/repos/rackerlabs/mimic/statuses/a748b24e01eaa74b2aecc00ccbf490fe847da737","head":{"label":"gabecase:final_keypairs","ref":"final_keypairs","sha":"a748b24e01eaa74b2aecc00ccbf490fe847da737","user":{"login":"gabecase","id":8486998,"avatar_url":"https://avatars.githubusercontent.com/u/8486998?v=3","gravatar_id":"","url":"https://api.github.com/users/gabecase","html_url":"https://github.com/gabecase","followers_url":"https://api.github.com/users/gabecase/followers","following_url":"https://api.github.com/users/gabecase/following{/other_user}","gists_url":"https://api.github.com/users/gabecase/gists{/gist_id}","starred_url":"https://api.github.com/users/gabecase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabecase/subscriptions","organizations_url":"https://api.github.com/users/gabecase/orgs","repos_url":"https://api.github.com/users/gabecase/repos","events_url":"https://api.github.com/users/gabecase/events{/privacy}","received_events_url":"https://api.github.com/users/gabecase/received_events","type":"User","site_admin":false},"repo":{"id":40183648,"name":"mimic","full_name":"gabecase/mimic","owner":{"login":"gabecase","id":8486998,"avatar_url":"https://avatars.githubusercontent.com/u/8486998?v=3","gravatar_id":"","url":"https://api.github.com/users/gabecase","html_url":"https://github.com/gabecase","followers_url":"https://api.github.com/users/gabecase/followers","following_url":"https://api.github.com/users/gabecase/following{/other_user}","gists_url":"https://api.github.com/users/gabecase/gists{/gist_id}","starred_url":"https://api.github.com/users/gabecase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabecase/subscriptions","organizations_url":"https://api.github.com/users/gabecase/orgs","repos_url":"https://api.github.com/users/gabecase/repos","events_url":"https://api.github.com/users/gabecase/events{/privacy}","received_events_url":"https://api.github.com/users/gabecase/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gabecase/mimic","description":"An API mock service","fork":true,"url":"https://api.github.com/repos/gabecase/mimic","forks_url":"https://api.github.com/repos/gabecase/mimic/forks","keys_url":"https://api.github.com/repos/gabecase/mimic/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gabecase/mimic/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gabecase/mimic/teams","hooks_url":"https://api.github.com/repos/gabecase/mimic/hooks","issue_events_url":"https://api.github.com/repos/gabecase/mimic/issues/events{/number}","events_url":"https://api.github.com/repos/gabecase/mimic/events","assignees_url":"https://api.github.com/repos/gabecase/mimic/assignees{/user}","branches_url":"https://api.github.com/repos/gabecase/mimic/branches{/branch}","tags_url":"https://api.github.com/repos/gabecase/mimic/tags","blobs_url":"https://api.github.com/repos/gabecase/mimic/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gabecase/mimic/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gabecase/mimic/git/refs{/sha}","trees_url":"https://api.github.com/repos/gabecase/mimic/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gabecase/mimic/statuses/{sha}","languages_url":"https://api.github.com/repos/gabecase/mimic/languages","stargazers_url":"https://api.github.com/repos/gabecase/mimic/stargazers","contributors_url":"https://api.github.com/repos/gabecase/mimic/contributors","subscribers_url":"https://api.github.com/repos/gabecase/mimic/subscribers","subscription_url":"https://api.github.com/repos/gabecase/mimic/subscription","commits_url":"https://api.github.com/repos/gabecase/mimic/commits{/sha}","git_commits_url":"https://api.github.com/repos/gabecase/mimic/git/commits{/sha}","comments_url":"https://api.github.com/repos/gabecase/mimic/comments{/number}","issue_comment_url":"https://api.github.com/repos/gabecase/mimic/issues/comments{/number}","contents_url":"https://api.github.com/repos/gabecase/mimic/contents/{+path}","compare_url":"https://api.github.com/repos/gabecase/mimic/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gabecase/mimic/merges","archive_url":"https://api.github.com/repos/gabecase/mimic/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gabecase/mimic/downloads","issues_url":"https://api.github.com/repos/gabecase/mimic/issues{/number}","pulls_url":"https://api.github.com/repos/gabecase/mimic/pulls{/number}","milestones_url":"https://api.github.com/repos/gabecase/mimic/milestones{/number}","notifications_url":"https://api.github.com/repos/gabecase/mimic/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gabecase/mimic/labels{/name}","releases_url":"https://api.github.com/repos/gabecase/mimic/releases{/id}","created_at":"2015-08-04T12:34:46Z","updated_at":"2015-08-04T12:34:47Z","pushed_at":"2015-09-25T00:51:29Z","git_url":"git://github.com/gabecase/mimic.git","ssh_url":"git@github.com:gabecase/mimic.git","clone_url":"https://github.com/gabecase/mimic.git","svn_url":"https://github.com/gabecase/mimic","homepage":"","size":2090,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"rackerlabs:master","ref":"master","sha":"4dbd5427a32b2c985b7d248834607bd942b8e6e6","user":{"login":"rackerlabs","id":84293,"avatar_url":"https://avatars.githubusercontent.com/u/84293?v=3","gravatar_id":"","url":"https://api.github.com/users/rackerlabs","html_url":"https://github.com/rackerlabs","followers_url":"https://api.github.com/users/rackerlabs/followers","following_url":"https://api.github.com/users/rackerlabs/following{/other_user}","gists_url":"https://api.github.com/users/rackerlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/rackerlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rackerlabs/subscriptions","organizations_url":"https://api.github.com/users/rackerlabs/orgs","repos_url":"https://api.github.com/users/rackerlabs/repos","events_url":"https://api.github.com/users/rackerlabs/events{/privacy}","received_events_url":"https://api.github.com/users/rackerlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":13158707,"name":"mimic","full_name":"rackerlabs/mimic","owner":{"login":"rackerlabs","id":84293,"avatar_url":"https://avatars.githubusercontent.com/u/84293?v=3","gravatar_id":"","url":"https://api.github.com/users/rackerlabs","html_url":"https://github.com/rackerlabs","followers_url":"https://api.github.com/users/rackerlabs/followers","following_url":"https://api.github.com/users/rackerlabs/following{/other_user}","gists_url":"https://api.github.com/users/rackerlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/rackerlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rackerlabs/subscriptions","organizations_url":"https://api.github.com/users/rackerlabs/orgs","repos_url":"https://api.github.com/users/rackerlabs/repos","events_url":"https://api.github.com/users/rackerlabs/events{/privacy}","received_events_url":"https://api.github.com/users/rackerlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rackerlabs/mimic","description":"An API mock service","fork":false,"url":"https://api.github.com/repos/rackerlabs/mimic","forks_url":"https://api.github.com/repos/rackerlabs/mimic/forks","keys_url":"https://api.github.com/repos/rackerlabs/mimic/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rackerlabs/mimic/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rackerlabs/mimic/teams","hooks_url":"https://api.github.com/repos/rackerlabs/mimic/hooks","issue_events_url":"https://api.github.com/repos/rackerlabs/mimic/issues/events{/number}","events_url":"https://api.github.com/repos/rackerlabs/mimic/events","assignees_url":"https://api.github.com/repos/rackerlabs/mimic/assignees{/user}","branches_url":"https://api.github.com/repos/rackerlabs/mimic/branches{/branch}","tags_url":"https://api.github.com/repos/rackerlabs/mimic/tags","blobs_url":"https://api.github.com/repos/rackerlabs/mimic/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rackerlabs/mimic/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rackerlabs/mimic/git/refs{/sha}","trees_url":"https://api.github.com/repos/rackerlabs/mimic/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rackerlabs/mimic/statuses/{sha}","languages_url":"https://api.github.com/repos/rackerlabs/mimic/languages","stargazers_url":"https://api.github.com/repos/rackerlabs/mimic/stargazers","contributors_url":"https://api.github.com/repos/rackerlabs/mimic/contributors","subscribers_url":"https://api.github.com/repos/rackerlabs/mimic/subscribers","subscription_url":"https://api.github.com/repos/rackerlabs/mimic/subscription","commits_url":"https://api.github.com/repos/rackerlabs/mimic/commits{/sha}","git_commits_url":"https://api.github.com/repos/rackerlabs/mimic/git/commits{/sha}","comments_url":"https://api.github.com/repos/rackerlabs/mimic/comments{/number}","issue_comment_url":"https://api.github.com/repos/rackerlabs/mimic/issues/comments{/number}","contents_url":"https://api.github.com/repos/rackerlabs/mimic/contents/{+path}","compare_url":"https://api.github.com/repos/rackerlabs/mimic/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rackerlabs/mimic/merges","archive_url":"https://api.github.com/repos/rackerlabs/mimic/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rackerlabs/mimic/downloads","issues_url":"https://api.github.com/repos/rackerlabs/mimic/issues{/number}","pulls_url":"https://api.github.com/repos/rackerlabs/mimic/pulls{/number}","milestones_url":"https://api.github.com/repos/rackerlabs/mimic/milestones{/number}","notifications_url":"https://api.github.com/repos/rackerlabs/mimic/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rackerlabs/mimic/labels{/name}","releases_url":"https://api.github.com/repos/rackerlabs/mimic/releases{/id}","created_at":"2013-09-27T19:01:16Z","updated_at":"2015-09-25T19:47:49Z","pushed_at":"2015-09-25T21:02:04Z","git_url":"git://github.com/rackerlabs/mimic.git","ssh_url":"git@github.com:rackerlabs/mimic.git","clone_url":"https://github.com/rackerlabs/mimic.git","svn_url":"https://github.com/rackerlabs/mimic","homepage":"","size":6020,"stargazers_count":95,"watchers_count":95,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":50,"mirror_url":null,"open_issues_count":92,"forks":50,"open_issues":92,"watchers":95,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rackerlabs/mimic/pulls/436"},"html":{"href":"https://github.com/rackerlabs/mimic/pull/436"},"issue":{"href":"https://api.github.com/repos/rackerlabs/mimic/issues/436"},"comments":{"href":"https://api.github.com/repos/rackerlabs/mimic/issues/436/comments"},"review_comments":{"href":"https://api.github.com/repos/rackerlabs/mimic/pulls/436/comments"},"review_comment":{"href":"https://api.github.com/repos/rackerlabs/mimic/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rackerlabs/mimic/pulls/436/commits"},"statuses":{"href":"https://api.github.com/repos/rackerlabs/mimic/statuses/a748b24e01eaa74b2aecc00ccbf490fe847da737"}}}}