{"action":"created","comment":{"url":"https://api.github.com/repos/clusto/clusto-apiserver/pulls/comments/40199276","id":40199276,"diff_hunk":"@@ -379,6 +379,45 @@ def get_driverlist():\n     return util.dumps(driverlist, 200)\n \n \n+@root_app.get('/typelist')\n+def get_driverlist():\n+    \"\"\"\n+Returns clusto.typelist, a list of the most recent drivers to register with that type.\n+\n+Examples:\n+\n+.. code:: bash\n+\n+    $ ${get} ${server_url}/typelist\n+    {\n+        \"appliance\": \"clusto.drivers.devices.appliance.basicappliance.BasicAppliance\",\n+        \"cage\": \"clusto.drivers.locations.datacenters.basiccage.BasicCage\",\n+        \"clustometa\": \"clusto.drivers.base.clustometa.ClustoMeta\",\n+        \"consoleserver\": \"clusto.drivers.devices.consoleservers.basicconsoleserver.BasicConsoleServer\",\n+        \"datacenter\": \"clusto.drivers.locations.datacenters.basicdatacenter.BasicDatacenter\",\n+        \"generic\": \"clusto.drivers.base.device.Device\",\n+        \"location\": \"clusto.drivers.base.location.Location\",\n+        \"networkswitch\": \"clusto.drivers.devices.networkswitches.basicnetworkswitch.BasicNetworkSwitch\",\n+        \"pool\": \"clusto.drivers.categories.pool.UniquePool\",\n+        \"powerstrip\": \"clusto.drivers.devices.powerstrips.basicpowerstrip.BasicPowerStrip\",\n+        \"rack\": \"clusto.drivers.locations.racks.basicrack.BasicRack\",\n+        \"resourcemanager\": \"clusto.drivers.resourcemanagers.ipmanager.IPManager\",\n+        \"server\": \"clusto.drivers.devices.servers.basicserver.BasicVirtualServer\",\n+        \"zone\": \"clusto.drivers.locations.zones.basiczone.BasicZone\"\n+    }\n+    HTTP: 200\n+    Content-type: application/json\n+\n+\"\"\"\n+\n+    typelist = {}\n+    for name, driver in clusto.typelist.items():\n+        # This looks silly, but it is the easiest way to get class paths in a string.\n+        typelist[name] = \"{0}.{1}\".format(driver.__module__, driver.__name__)\n+\n+    return util.dumps(typelist, 200)","path":"clustoapi/server.py","position":40,"original_position":40,"commit_id":"8130d978cac582fd2c21c8cbb4b9637ec6c51273","original_commit_id":"8130d978cac582fd2c21c8cbb4b9637ec6c51273","user":{"login":"plathrop","id":9075,"avatar_url":"https://avatars.githubusercontent.com/u/9075?v=3","gravatar_id":"","url":"https://api.github.com/users/plathrop","html_url":"https://github.com/plathrop","followers_url":"https://api.github.com/users/plathrop/followers","following_url":"https://api.github.com/users/plathrop/following{/other_user}","gists_url":"https://api.github.com/users/plathrop/gists{/gist_id}","starred_url":"https://api.github.com/users/plathrop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plathrop/subscriptions","organizations_url":"https://api.github.com/users/plathrop/orgs","repos_url":"https://api.github.com/users/plathrop/repos","events_url":"https://api.github.com/users/plathrop/events{/privacy}","received_events_url":"https://api.github.com/users/plathrop/received_events","type":"User","site_admin":false},"body":"Instead of string encoding everything in all of these endpoints, I usually have web services have a \"respond\" function/method that takes care of the encoding step. YMMV","created_at":"2015-09-23T12:56:21Z","updated_at":"2015-09-23T12:56:21Z","html_url":"https://github.com/clusto/clusto-apiserver/pull/28#discussion_r40199276","pull_request_url":"https://api.github.com/repos/clusto/clusto-apiserver/pulls/28","_links":{"self":{"href":"https://api.github.com/repos/clusto/clusto-apiserver/pulls/comments/40199276"},"html":{"href":"https://github.com/clusto/clusto-apiserver/pull/28#discussion_r40199276"},"pull_request":{"href":"https://api.github.com/repos/clusto/clusto-apiserver/pulls/28"}}},"pull_request":{"url":"https://api.github.com/repos/clusto/clusto-apiserver/pulls/28","id":45739997,"html_url":"https://github.com/clusto/clusto-apiserver/pull/28","diff_url":"https://github.com/clusto/clusto-apiserver/pull/28.diff","patch_url":"https://github.com/clusto/clusto-apiserver/pull/28.patch","issue_url":"https://api.github.com/repos/clusto/clusto-apiserver/issues/28","number":28,"state":"open","locked":false,"title":"typelist and the addition of the type in util.show.","user":{"login":"JTCunning","id":1189446,"avatar_url":"https://avatars.githubusercontent.com/u/1189446?v=3","gravatar_id":"","url":"https://api.github.com/users/JTCunning","html_url":"https://github.com/JTCunning","followers_url":"https://api.github.com/users/JTCunning/followers","following_url":"https://api.github.com/users/JTCunning/following{/other_user}","gists_url":"https://api.github.com/users/JTCunning/gists{/gist_id}","starred_url":"https://api.github.com/users/JTCunning/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JTCunning/subscriptions","organizations_url":"https://api.github.com/users/JTCunning/orgs","repos_url":"https://api.github.com/users/JTCunning/repos","events_url":"https://api.github.com/users/JTCunning/events{/privacy}","received_events_url":"https://api.github.com/users/JTCunning/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-09-23T03:03:34Z","updated_at":"2015-09-23T12:56:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"358c6628f23cfe74cf6b1b33796fdcd8054b092d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/clusto/clusto-apiserver/pulls/28/commits","review_comments_url":"https://api.github.com/repos/clusto/clusto-apiserver/pulls/28/comments","review_comment_url":"https://api.github.com/repos/clusto/clusto-apiserver/pulls/comments{/number}","comments_url":"https://api.github.com/repos/clusto/clusto-apiserver/issues/28/comments","statuses_url":"https://api.github.com/repos/clusto/clusto-apiserver/statuses/8130d978cac582fd2c21c8cbb4b9637ec6c51273","head":{"label":"clusto:types","ref":"types","sha":"8130d978cac582fd2c21c8cbb4b9637ec6c51273","user":{"login":"clusto","id":647646,"avatar_url":"https://avatars.githubusercontent.com/u/647646?v=3","gravatar_id":"","url":"https://api.github.com/users/clusto","html_url":"https://github.com/clusto","followers_url":"https://api.github.com/users/clusto/followers","following_url":"https://api.github.com/users/clusto/following{/other_user}","gists_url":"https://api.github.com/users/clusto/gists{/gist_id}","starred_url":"https://api.github.com/users/clusto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clusto/subscriptions","organizations_url":"https://api.github.com/users/clusto/orgs","repos_url":"https://api.github.com/users/clusto/repos","events_url":"https://api.github.com/users/clusto/events{/privacy}","received_events_url":"https://api.github.com/users/clusto/received_events","type":"Organization","site_admin":false},"repo":{"id":20116079,"name":"clusto-apiserver","full_name":"clusto/clusto-apiserver","owner":{"login":"clusto","id":647646,"avatar_url":"https://avatars.githubusercontent.com/u/647646?v=3","gravatar_id":"","url":"https://api.github.com/users/clusto","html_url":"https://github.com/clusto","followers_url":"https://api.github.com/users/clusto/followers","following_url":"https://api.github.com/users/clusto/following{/other_user}","gists_url":"https://api.github.com/users/clusto/gists{/gist_id}","starred_url":"https://api.github.com/users/clusto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clusto/subscriptions","organizations_url":"https://api.github.com/users/clusto/orgs","repos_url":"https://api.github.com/users/clusto/repos","events_url":"https://api.github.com/users/clusto/events{/privacy}","received_events_url":"https://api.github.com/users/clusto/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/clusto/clusto-apiserver","description":"RESTful HTTP server frontend for clusto","fork":false,"url":"https://api.github.com/repos/clusto/clusto-apiserver","forks_url":"https://api.github.com/repos/clusto/clusto-apiserver/forks","keys_url":"https://api.github.com/repos/clusto/clusto-apiserver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/clusto/clusto-apiserver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/clusto/clusto-apiserver/teams","hooks_url":"https://api.github.com/repos/clusto/clusto-apiserver/hooks","issue_events_url":"https://api.github.com/repos/clusto/clusto-apiserver/issues/events{/number}","events_url":"https://api.github.com/repos/clusto/clusto-apiserver/events","assignees_url":"https://api.github.com/repos/clusto/clusto-apiserver/assignees{/user}","branches_url":"https://api.github.com/repos/clusto/clusto-apiserver/branches{/branch}","tags_url":"https://api.github.com/repos/clusto/clusto-apiserver/tags","blobs_url":"https://api.github.com/repos/clusto/clusto-apiserver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/clusto/clusto-apiserver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/clusto/clusto-apiserver/git/refs{/sha}","trees_url":"https://api.github.com/repos/clusto/clusto-apiserver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/clusto/clusto-apiserver/statuses/{sha}","languages_url":"https://api.github.com/repos/clusto/clusto-apiserver/languages","stargazers_url":"https://api.github.com/repos/clusto/clusto-apiserver/stargazers","contributors_url":"https://api.github.com/repos/clusto/clusto-apiserver/contributors","subscribers_url":"https://api.github.com/repos/clusto/clusto-apiserver/subscribers","subscription_url":"https://api.github.com/repos/clusto/clusto-apiserver/subscription","commits_url":"https://api.github.com/repos/clusto/clusto-apiserver/commits{/sha}","git_commits_url":"https://api.github.com/repos/clusto/clusto-apiserver/git/commits{/sha}","comments_url":"https://api.github.com/repos/clusto/clusto-apiserver/comments{/number}","issue_comment_url":"https://api.github.com/repos/clusto/clusto-apiserver/issues/comments{/number}","contents_url":"https://api.github.com/repos/clusto/clusto-apiserver/contents/{+path}","compare_url":"https://api.github.com/repos/clusto/clusto-apiserver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/clusto/clusto-apiserver/merges","archive_url":"https://api.github.com/repos/clusto/clusto-apiserver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/clusto/clusto-apiserver/downloads","issues_url":"https://api.github.com/repos/clusto/clusto-apiserver/issues{/number}","pulls_url":"https://api.github.com/repos/clusto/clusto-apiserver/pulls{/number}","milestones_url":"https://api.github.com/repos/clusto/clusto-apiserver/milestones{/number}","notifications_url":"https://api.github.com/repos/clusto/clusto-apiserver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/clusto/clusto-apiserver/labels{/name}","releases_url":"https://api.github.com/repos/clusto/clusto-apiserver/releases{/id}","created_at":"2014-05-23T22:33:03Z","updated_at":"2015-02-17T21:41:43Z","pushed_at":"2015-09-23T03:03:34Z","git_url":"git://github.com/clusto/clusto-apiserver.git","ssh_url":"git@github.com:clusto/clusto-apiserver.git","clone_url":"https://github.com/clusto/clusto-apiserver.git","svn_url":"https://github.com/clusto/clusto-apiserver","homepage":"","size":657,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":3,"forks":3,"open_issues":3,"watchers":1,"default_branch":"master"}},"base":{"label":"clusto:master","ref":"master","sha":"83bf57de433b73cdc50f6cd7a16ca694c684e1db","user":{"login":"clusto","id":647646,"avatar_url":"https://avatars.githubusercontent.com/u/647646?v=3","gravatar_id":"","url":"https://api.github.com/users/clusto","html_url":"https://github.com/clusto","followers_url":"https://api.github.com/users/clusto/followers","following_url":"https://api.github.com/users/clusto/following{/other_user}","gists_url":"https://api.github.com/users/clusto/gists{/gist_id}","starred_url":"https://api.github.com/users/clusto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clusto/subscriptions","organizations_url":"https://api.github.com/users/clusto/orgs","repos_url":"https://api.github.com/users/clusto/repos","events_url":"https://api.github.com/users/clusto/events{/privacy}","received_events_url":"https://api.github.com/users/clusto/received_events","type":"Organization","site_admin":false},"repo":{"id":20116079,"name":"clusto-apiserver","full_name":"clusto/clusto-apiserver","owner":{"login":"clusto","id":647646,"avatar_url":"https://avatars.githubusercontent.com/u/647646?v=3","gravatar_id":"","url":"https://api.github.com/users/clusto","html_url":"https://github.com/clusto","followers_url":"https://api.github.com/users/clusto/followers","following_url":"https://api.github.com/users/clusto/following{/other_user}","gists_url":"https://api.github.com/users/clusto/gists{/gist_id}","starred_url":"https://api.github.com/users/clusto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clusto/subscriptions","organizations_url":"https://api.github.com/users/clusto/orgs","repos_url":"https://api.github.com/users/clusto/repos","events_url":"https://api.github.com/users/clusto/events{/privacy}","received_events_url":"https://api.github.com/users/clusto/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/clusto/clusto-apiserver","description":"RESTful HTTP server frontend for clusto","fork":false,"url":"https://api.github.com/repos/clusto/clusto-apiserver","forks_url":"https://api.github.com/repos/clusto/clusto-apiserver/forks","keys_url":"https://api.github.com/repos/clusto/clusto-apiserver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/clusto/clusto-apiserver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/clusto/clusto-apiserver/teams","hooks_url":"https://api.github.com/repos/clusto/clusto-apiserver/hooks","issue_events_url":"https://api.github.com/repos/clusto/clusto-apiserver/issues/events{/number}","events_url":"https://api.github.com/repos/clusto/clusto-apiserver/events","assignees_url":"https://api.github.com/repos/clusto/clusto-apiserver/assignees{/user}","branches_url":"https://api.github.com/repos/clusto/clusto-apiserver/branches{/branch}","tags_url":"https://api.github.com/repos/clusto/clusto-apiserver/tags","blobs_url":"https://api.github.com/repos/clusto/clusto-apiserver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/clusto/clusto-apiserver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/clusto/clusto-apiserver/git/refs{/sha}","trees_url":"https://api.github.com/repos/clusto/clusto-apiserver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/clusto/clusto-apiserver/statuses/{sha}","languages_url":"https://api.github.com/repos/clusto/clusto-apiserver/languages","stargazers_url":"https://api.github.com/repos/clusto/clusto-apiserver/stargazers","contributors_url":"https://api.github.com/repos/clusto/clusto-apiserver/contributors","subscribers_url":"https://api.github.com/repos/clusto/clusto-apiserver/subscribers","subscription_url":"https://api.github.com/repos/clusto/clusto-apiserver/subscription","commits_url":"https://api.github.com/repos/clusto/clusto-apiserver/commits{/sha}","git_commits_url":"https://api.github.com/repos/clusto/clusto-apiserver/git/commits{/sha}","comments_url":"https://api.github.com/repos/clusto/clusto-apiserver/comments{/number}","issue_comment_url":"https://api.github.com/repos/clusto/clusto-apiserver/issues/comments{/number}","contents_url":"https://api.github.com/repos/clusto/clusto-apiserver/contents/{+path}","compare_url":"https://api.github.com/repos/clusto/clusto-apiserver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/clusto/clusto-apiserver/merges","archive_url":"https://api.github.com/repos/clusto/clusto-apiserver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/clusto/clusto-apiserver/downloads","issues_url":"https://api.github.com/repos/clusto/clusto-apiserver/issues{/number}","pulls_url":"https://api.github.com/repos/clusto/clusto-apiserver/pulls{/number}","milestones_url":"https://api.github.com/repos/clusto/clusto-apiserver/milestones{/number}","notifications_url":"https://api.github.com/repos/clusto/clusto-apiserver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/clusto/clusto-apiserver/labels{/name}","releases_url":"https://api.github.com/repos/clusto/clusto-apiserver/releases{/id}","created_at":"2014-05-23T22:33:03Z","updated_at":"2015-02-17T21:41:43Z","pushed_at":"2015-09-23T03:03:34Z","git_url":"git://github.com/clusto/clusto-apiserver.git","ssh_url":"git@github.com:clusto/clusto-apiserver.git","clone_url":"https://github.com/clusto/clusto-apiserver.git","svn_url":"https://github.com/clusto/clusto-apiserver","homepage":"","size":657,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":3,"forks":3,"open_issues":3,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/clusto/clusto-apiserver/pulls/28"},"html":{"href":"https://github.com/clusto/clusto-apiserver/pull/28"},"issue":{"href":"https://api.github.com/repos/clusto/clusto-apiserver/issues/28"},"comments":{"href":"https://api.github.com/repos/clusto/clusto-apiserver/issues/28/comments"},"review_comments":{"href":"https://api.github.com/repos/clusto/clusto-apiserver/pulls/28/comments"},"review_comment":{"href":"https://api.github.com/repos/clusto/clusto-apiserver/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/clusto/clusto-apiserver/pulls/28/commits"},"statuses":{"href":"https://api.github.com/repos/clusto/clusto-apiserver/statuses/8130d978cac582fd2c21c8cbb4b9637ec6c51273"}}}}