{"action":"created","comment":{"url":"https://api.github.com/repos/eucalyptus/eucaconsole/pulls/comments/26230519","id":26230519,"diff_hunk":"@@ -267,12 +274,252 @@ def stack_events(self):\n             for event in stack_events:\n                 events.append({\n                     'timestamp': event.timestamp.strftime('%Y-%m-%dT%H:%M:%SZ'),\n-                    'status': event.resource_status,\n+                    'status': event.resource_status.lower().replace('_', '-'),\n                     'status_reason': event.resource_status_reason,\n                     'type': event.resource_type,\n                     'logical_id': event.logical_resource_id,\n-                    'physical_id': event.physical_resource_id})\n+                    'physical_id': event.physical_resource_id,\n+                    'url': self.get_url_for_resource(event.resource_type, event.physical_resource_id)\n+                })\n             return dict(\n                 results=dict(events=events)\n             )\n \n+    def get_url_for_resource(self, res_type, resource_id):\n+        url = None\n+        if res_type == \"AWS::ElasticLoadBalancing::LoadBalancer\":\n+            url = self.request.route_path('elb_view', id=resource_id)\n+        elif \"AWS::EC2::\" in res_type:\n+            if \"SecurityGroup\" in res_type:\n+                url = self.request.route_path('securitygroup_view', id=resource_id)\n+            elif \"EIP\" in res_type:\n+                url = self.request.route_path('ipaddress_view', id=resource_id)\n+            elif \"Instance\" in res_type:\n+                url = self.request.route_path('instance_view', id=resource_id)\n+            elif \"Volume\" in res_type:\n+                url = self.request.route_path('volume_view', id=resource_id)\n+        elif \"AWS::AutoScaling::\" in res_type:\n+            if \"LaunchConfiguration\" in res_type:\n+                url = self.request.route_path('launchconfig_view', id=resource_id)\n+            if \"ScalingGroup\" in res_type:\n+                url = self.request.route_path('scalinggroup_view', id=resource_id)\n+        elif \"AWS::IAM::\" in res_type:\n+            if \"Group\" in res_type:\n+                url = self.request.route_path('group_view', id=resource_id)\n+            elif \"Role\" in res_type:\n+                url = self.request.route_path('role_view', id=resource_id)\n+            elif \"User\" in res_type:\n+                url = self.request.route_path('user_view', id=resource_id)\n+        elif \"AWS::S3::\" in res_type:\n+            if \"Bucket\" in res_type:\n+                url = self.request.route_path('bucket_contents', id=resource_id)\n+        return url\n+\n+\n+class StackWizardView(BaseView):\n+    \"\"\"View for Create Stack wizard\"\"\"\n+    TEMPLATE = '../templates/stacks/stack_wizard.pt'\n+\n+    def __init__(self, request):\n+        super(StackWizardView, self).__init__(request)\n+        self.request = request\n+        self.create_form = None\n+        with boto_error_handler(self.request):\n+            s3_bucket = self.get_template_samples_bucket()\n+            self.create_form = StacksCreateForm(request, s3_bucket)\n+        self.render_dict = dict(\n+            create_form=self.create_form,\n+            controller_options_json=self.get_controller_options_json(),\n+        )\n+\n+    def get_template_samples_bucket(self):\n+        sample_bucket = self.request.registry.settings.get('cloudformation.samples.bucket')\n+        if sample_bucket is None:\n+            return None\n+        s3_conn = self.get_connection(conn_type=\"s3\")\n+        return s3_conn.get_bucket(sample_bucket)\n+\n+    def get_controller_options_json(self):\n+        return BaseView.escape_json(json.dumps({\n+            'stack_template_url': self.request.route_path('stack_template_parse'),\n+        }))\n+\n+    @view_config(route_name='stack_new', renderer=TEMPLATE, request_method='GET')\n+    def stack_new(self):\n+        \"\"\"Displays the Stack wizard\"\"\"\n+        return self.render_dict\n+\n+    @view_config(route_name='stack_template_parse', renderer='json', request_method='POST')\n+    def stack_template_parse(self):\n+        \"\"\"\n+        Fetches then parsed template to return information needed by wizard,\n+        namely description and parameters.\n+        \"\"\"\n+        (template_url, parsed) = self.parse_store_template()\n+        params = []\n+        for name in parsed['Parameters'].keys():\n+            param = parsed['Parameters'][name]\n+            param_vals = {\n+                'name': name,\n+                'description': param['Description'] if 'Description' in param else '',\n+                'type': param['Type']\n+            }\n+            if 'Default' in param:\n+                param_vals['default'] = param['Default']\n+            if 'MinLength' in param:\n+                param_vals['min'] = param['MinLength']\n+            if 'MaxLength' in param:\n+                param_vals['max'] = param['MaxLength']\n+            if 'AllowedPattern' in param:\n+                param_vals['regex'] = param['AllowedPattern']\n+            if 'ConstraintDescription' in param:\n+                param_vals['constraint'] = param['ConstraintDescription']\n+            if 'AllowedValues' in param:\n+                param_vals['options'] = [(val, val) for val in param['AllowedValues']]\n+            # guess at more options\n+            if 'key' in name.lower():\n+                param_vals['options'] = self.get_key_options()  # fetch keypair names\n+            if 'image' in name.lower():\n+                param_vals['options'] = self.get_image_options()  # fetch image ids\n+            if 'kernel' in name.lower():\n+                param_vals['options'] = self.get_image_options(type='kernel')  # fetch kernel ids\n+            if 'ramdisk' in name.lower():\n+                param_vals['options'] = self.get_image_options(type='ramdisk')  # fetch ramdisk ids","path":"eucaconsole/views/stacks.py","position":148,"original_position":148,"commit_id":"2bc3285d2c1a1cb24b71792c4f2bc5ecbfc34602","original_commit_id":"2bc3285d2c1a1cb24b71792c4f2bc5ecbfc34602","user":{"login":"kamalgill","id":133923,"avatar_url":"https://avatars.githubusercontent.com/u/133923?v=3","gravatar_id":"","url":"https://api.github.com/users/kamalgill","html_url":"https://github.com/kamalgill","followers_url":"https://api.github.com/users/kamalgill/followers","following_url":"https://api.github.com/users/kamalgill/following{/other_user}","gists_url":"https://api.github.com/users/kamalgill/gists{/gist_id}","starred_url":"https://api.github.com/users/kamalgill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kamalgill/subscriptions","organizations_url":"https://api.github.com/users/kamalgill/orgs","repos_url":"https://api.github.com/users/kamalgill/repos","events_url":"https://api.github.com/users/kamalgill/events{/privacy}","received_events_url":"https://api.github.com/users/kamalgill/received_events","type":"User","site_admin":false},"body":"@dkavanagh: This line should be `param_vals['options'] = self.get_image_options(img_type='ramdisk')`","created_at":"2015-03-11T16:48:52Z","updated_at":"2015-03-11T16:48:52Z","html_url":"https://github.com/eucalyptus/eucaconsole/pull/1312#discussion_r26230519","pull_request_url":"https://api.github.com/repos/eucalyptus/eucaconsole/pulls/1312","_links":{"self":{"href":"https://api.github.com/repos/eucalyptus/eucaconsole/pulls/comments/26230519"},"html":{"href":"https://github.com/eucalyptus/eucaconsole/pull/1312#discussion_r26230519"},"pull_request":{"href":"https://api.github.com/repos/eucalyptus/eucaconsole/pulls/1312"}}},"pull_request":{"url":"https://api.github.com/repos/eucalyptus/eucaconsole/pulls/1312","id":30415188,"html_url":"https://github.com/eucalyptus/eucaconsole/pull/1312","diff_url":"https://github.com/eucalyptus/eucaconsole/pull/1312.diff","patch_url":"https://github.com/eucalyptus/eucaconsole/pull/1312.patch","issue_url":"https://api.github.com/repos/eucalyptus/eucaconsole/issues/1312","number":1312,"state":"open","locked":false,"title":"GUI-1488 A good first pass at the stack wizard","user":{"login":"dkavanagh","id":367566,"avatar_url":"https://avatars.githubusercontent.com/u/367566?v=3","gravatar_id":"","url":"https://api.github.com/users/dkavanagh","html_url":"https://github.com/dkavanagh","followers_url":"https://api.github.com/users/dkavanagh/followers","following_url":"https://api.github.com/users/dkavanagh/following{/other_user}","gists_url":"https://api.github.com/users/dkavanagh/gists{/gist_id}","starred_url":"https://api.github.com/users/dkavanagh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dkavanagh/subscriptions","organizations_url":"https://api.github.com/users/dkavanagh/orgs","repos_url":"https://api.github.com/users/dkavanagh/repos","events_url":"https://api.github.com/users/dkavanagh/events{/privacy}","received_events_url":"https://api.github.com/users/dkavanagh/received_events","type":"User","site_admin":false},"body":"https://eucalyptus.atlassian.net/browse/GUI-1488\r\nContains other fixes for stack related screens as well.","created_at":"2015-03-03T21:38:45Z","updated_at":"2015-03-11T16:48:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"39a9ff53867286c66834db14a2a935e390d9e4bd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/eucalyptus/eucaconsole/pulls/1312/commits","review_comments_url":"https://api.github.com/repos/eucalyptus/eucaconsole/pulls/1312/comments","review_comment_url":"https://api.github.com/repos/eucalyptus/eucaconsole/pulls/comments{/number}","comments_url":"https://api.github.com/repos/eucalyptus/eucaconsole/issues/1312/comments","statuses_url":"https://api.github.com/repos/eucalyptus/eucaconsole/statuses/2bc3285d2c1a1cb24b71792c4f2bc5ecbfc34602","head":{"label":"eucalyptus:GUI-1488","ref":"GUI-1488","sha":"2bc3285d2c1a1cb24b71792c4f2bc5ecbfc34602","user":{"login":"eucalyptus","id":808244,"avatar_url":"https://avatars.githubusercontent.com/u/808244?v=3","gravatar_id":"","url":"https://api.github.com/users/eucalyptus","html_url":"https://github.com/eucalyptus","followers_url":"https://api.github.com/users/eucalyptus/followers","following_url":"https://api.github.com/users/eucalyptus/following{/other_user}","gists_url":"https://api.github.com/users/eucalyptus/gists{/gist_id}","starred_url":"https://api.github.com/users/eucalyptus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eucalyptus/subscriptions","organizations_url":"https://api.github.com/users/eucalyptus/orgs","repos_url":"https://api.github.com/users/eucalyptus/repos","events_url":"https://api.github.com/users/eucalyptus/events{/privacy}","received_events_url":"https://api.github.com/users/eucalyptus/received_events","type":"Organization","site_admin":false},"repo":{"id":13843551,"name":"eucaconsole","full_name":"eucalyptus/eucaconsole","owner":{"login":"eucalyptus","id":808244,"avatar_url":"https://avatars.githubusercontent.com/u/808244?v=3","gravatar_id":"","url":"https://api.github.com/users/eucalyptus","html_url":"https://github.com/eucalyptus","followers_url":"https://api.github.com/users/eucalyptus/followers","following_url":"https://api.github.com/users/eucalyptus/following{/other_user}","gists_url":"https://api.github.com/users/eucalyptus/gists{/gist_id}","starred_url":"https://api.github.com/users/eucalyptus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eucalyptus/subscriptions","organizations_url":"https://api.github.com/users/eucalyptus/orgs","repos_url":"https://api.github.com/users/eucalyptus/repos","events_url":"https://api.github.com/users/eucalyptus/events{/privacy}","received_events_url":"https://api.github.com/users/eucalyptus/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/eucalyptus/eucaconsole","description":"Eucalyptus Management Console","fork":false,"url":"https://api.github.com/repos/eucalyptus/eucaconsole","forks_url":"https://api.github.com/repos/eucalyptus/eucaconsole/forks","keys_url":"https://api.github.com/repos/eucalyptus/eucaconsole/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eucalyptus/eucaconsole/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eucalyptus/eucaconsole/teams","hooks_url":"https://api.github.com/repos/eucalyptus/eucaconsole/hooks","issue_events_url":"https://api.github.com/repos/eucalyptus/eucaconsole/issues/events{/number}","events_url":"https://api.github.com/repos/eucalyptus/eucaconsole/events","assignees_url":"https://api.github.com/repos/eucalyptus/eucaconsole/assignees{/user}","branches_url":"https://api.github.com/repos/eucalyptus/eucaconsole/branches{/branch}","tags_url":"https://api.github.com/repos/eucalyptus/eucaconsole/tags","blobs_url":"https://api.github.com/repos/eucalyptus/eucaconsole/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eucalyptus/eucaconsole/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eucalyptus/eucaconsole/git/refs{/sha}","trees_url":"https://api.github.com/repos/eucalyptus/eucaconsole/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eucalyptus/eucaconsole/statuses/{sha}","languages_url":"https://api.github.com/repos/eucalyptus/eucaconsole/languages","stargazers_url":"https://api.github.com/repos/eucalyptus/eucaconsole/stargazers","contributors_url":"https://api.github.com/repos/eucalyptus/eucaconsole/contributors","subscribers_url":"https://api.github.com/repos/eucalyptus/eucaconsole/subscribers","subscription_url":"https://api.github.com/repos/eucalyptus/eucaconsole/subscription","commits_url":"https://api.github.com/repos/eucalyptus/eucaconsole/commits{/sha}","git_commits_url":"https://api.github.com/repos/eucalyptus/eucaconsole/git/commits{/sha}","comments_url":"https://api.github.com/repos/eucalyptus/eucaconsole/comments{/number}","issue_comment_url":"https://api.github.com/repos/eucalyptus/eucaconsole/issues/comments{/number}","contents_url":"https://api.github.com/repos/eucalyptus/eucaconsole/contents/{+path}","compare_url":"https://api.github.com/repos/eucalyptus/eucaconsole/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eucalyptus/eucaconsole/merges","archive_url":"https://api.github.com/repos/eucalyptus/eucaconsole/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eucalyptus/eucaconsole/downloads","issues_url":"https://api.github.com/repos/eucalyptus/eucaconsole/issues{/number}","pulls_url":"https://api.github.com/repos/eucalyptus/eucaconsole/pulls{/number}","milestones_url":"https://api.github.com/repos/eucalyptus/eucaconsole/milestones{/number}","notifications_url":"https://api.github.com/repos/eucalyptus/eucaconsole/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eucalyptus/eucaconsole/labels{/name}","releases_url":"https://api.github.com/repos/eucalyptus/eucaconsole/releases{/id}","created_at":"2013-10-24T20:31:49Z","updated_at":"2015-03-11T13:09:34Z","pushed_at":"2015-03-11T15:16:28Z","git_url":"git://github.com/eucalyptus/eucaconsole.git","ssh_url":"git@github.com:eucalyptus/eucaconsole.git","clone_url":"https://github.com/eucalyptus/eucaconsole.git","svn_url":"https://github.com/eucalyptus/eucaconsole","homepage":"","size":37562,"stargazers_count":7,"watchers_count":7,"language":"Gettext Catalog","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"open_issues_count":8,"forks":16,"open_issues":8,"watchers":7,"default_branch":"master"}},"base":{"label":"eucalyptus:master","ref":"master","sha":"56e147b7d17b2e2dc13550619c1a3cf84bf7e967","user":{"login":"eucalyptus","id":808244,"avatar_url":"https://avatars.githubusercontent.com/u/808244?v=3","gravatar_id":"","url":"https://api.github.com/users/eucalyptus","html_url":"https://github.com/eucalyptus","followers_url":"https://api.github.com/users/eucalyptus/followers","following_url":"https://api.github.com/users/eucalyptus/following{/other_user}","gists_url":"https://api.github.com/users/eucalyptus/gists{/gist_id}","starred_url":"https://api.github.com/users/eucalyptus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eucalyptus/subscriptions","organizations_url":"https://api.github.com/users/eucalyptus/orgs","repos_url":"https://api.github.com/users/eucalyptus/repos","events_url":"https://api.github.com/users/eucalyptus/events{/privacy}","received_events_url":"https://api.github.com/users/eucalyptus/received_events","type":"Organization","site_admin":false},"repo":{"id":13843551,"name":"eucaconsole","full_name":"eucalyptus/eucaconsole","owner":{"login":"eucalyptus","id":808244,"avatar_url":"https://avatars.githubusercontent.com/u/808244?v=3","gravatar_id":"","url":"https://api.github.com/users/eucalyptus","html_url":"https://github.com/eucalyptus","followers_url":"https://api.github.com/users/eucalyptus/followers","following_url":"https://api.github.com/users/eucalyptus/following{/other_user}","gists_url":"https://api.github.com/users/eucalyptus/gists{/gist_id}","starred_url":"https://api.github.com/users/eucalyptus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eucalyptus/subscriptions","organizations_url":"https://api.github.com/users/eucalyptus/orgs","repos_url":"https://api.github.com/users/eucalyptus/repos","events_url":"https://api.github.com/users/eucalyptus/events{/privacy}","received_events_url":"https://api.github.com/users/eucalyptus/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/eucalyptus/eucaconsole","description":"Eucalyptus Management Console","fork":false,"url":"https://api.github.com/repos/eucalyptus/eucaconsole","forks_url":"https://api.github.com/repos/eucalyptus/eucaconsole/forks","keys_url":"https://api.github.com/repos/eucalyptus/eucaconsole/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eucalyptus/eucaconsole/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eucalyptus/eucaconsole/teams","hooks_url":"https://api.github.com/repos/eucalyptus/eucaconsole/hooks","issue_events_url":"https://api.github.com/repos/eucalyptus/eucaconsole/issues/events{/number}","events_url":"https://api.github.com/repos/eucalyptus/eucaconsole/events","assignees_url":"https://api.github.com/repos/eucalyptus/eucaconsole/assignees{/user}","branches_url":"https://api.github.com/repos/eucalyptus/eucaconsole/branches{/branch}","tags_url":"https://api.github.com/repos/eucalyptus/eucaconsole/tags","blobs_url":"https://api.github.com/repos/eucalyptus/eucaconsole/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eucalyptus/eucaconsole/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eucalyptus/eucaconsole/git/refs{/sha}","trees_url":"https://api.github.com/repos/eucalyptus/eucaconsole/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eucalyptus/eucaconsole/statuses/{sha}","languages_url":"https://api.github.com/repos/eucalyptus/eucaconsole/languages","stargazers_url":"https://api.github.com/repos/eucalyptus/eucaconsole/stargazers","contributors_url":"https://api.github.com/repos/eucalyptus/eucaconsole/contributors","subscribers_url":"https://api.github.com/repos/eucalyptus/eucaconsole/subscribers","subscription_url":"https://api.github.com/repos/eucalyptus/eucaconsole/subscription","commits_url":"https://api.github.com/repos/eucalyptus/eucaconsole/commits{/sha}","git_commits_url":"https://api.github.com/repos/eucalyptus/eucaconsole/git/commits{/sha}","comments_url":"https://api.github.com/repos/eucalyptus/eucaconsole/comments{/number}","issue_comment_url":"https://api.github.com/repos/eucalyptus/eucaconsole/issues/comments{/number}","contents_url":"https://api.github.com/repos/eucalyptus/eucaconsole/contents/{+path}","compare_url":"https://api.github.com/repos/eucalyptus/eucaconsole/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eucalyptus/eucaconsole/merges","archive_url":"https://api.github.com/repos/eucalyptus/eucaconsole/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eucalyptus/eucaconsole/downloads","issues_url":"https://api.github.com/repos/eucalyptus/eucaconsole/issues{/number}","pulls_url":"https://api.github.com/repos/eucalyptus/eucaconsole/pulls{/number}","milestones_url":"https://api.github.com/repos/eucalyptus/eucaconsole/milestones{/number}","notifications_url":"https://api.github.com/repos/eucalyptus/eucaconsole/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eucalyptus/eucaconsole/labels{/name}","releases_url":"https://api.github.com/repos/eucalyptus/eucaconsole/releases{/id}","created_at":"2013-10-24T20:31:49Z","updated_at":"2015-03-11T13:09:34Z","pushed_at":"2015-03-11T15:16:28Z","git_url":"git://github.com/eucalyptus/eucaconsole.git","ssh_url":"git@github.com:eucalyptus/eucaconsole.git","clone_url":"https://github.com/eucalyptus/eucaconsole.git","svn_url":"https://github.com/eucalyptus/eucaconsole","homepage":"","size":37562,"stargazers_count":7,"watchers_count":7,"language":"Gettext Catalog","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"open_issues_count":8,"forks":16,"open_issues":8,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/eucalyptus/eucaconsole/pulls/1312"},"html":{"href":"https://github.com/eucalyptus/eucaconsole/pull/1312"},"issue":{"href":"https://api.github.com/repos/eucalyptus/eucaconsole/issues/1312"},"comments":{"href":"https://api.github.com/repos/eucalyptus/eucaconsole/issues/1312/comments"},"review_comments":{"href":"https://api.github.com/repos/eucalyptus/eucaconsole/pulls/1312/comments"},"review_comment":{"href":"https://api.github.com/repos/eucalyptus/eucaconsole/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/eucalyptus/eucaconsole/pulls/1312/commits"},"statuses":{"href":"https://api.github.com/repos/eucalyptus/eucaconsole/statuses/2bc3285d2c1a1cb24b71792c4f2bc5ecbfc34602"}}}}