{"action":"created","comment":{"url":"https://api.github.com/repos/crowbar/crowbar-core/pulls/comments/48234075","id":48234075,"diff_hunk":"@@ -0,0 +1,172 @@\n+#\n+# Copyright 2015, SUSE LINUX GmbH\n+#\n+# Licensed under the Apache License, Version 2.0 (the \"License\");\n+# you may not use this file except in compliance with the License.\n+# You may obtain a copy of the License at\n+#\n+#   http://www.apache.org/licenses/LICENSE-2.0\n+#\n+# Unless required by applicable law or agreed to in writing, software\n+# distributed under the License is distributed on an \"AS IS\" BASIS,\n+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+# See the License for the specific language governing permissions and\n+# limitations under the License.\n+#\n+\n+class BackupController < ApplicationController\n+  skip_before_filter :enforce_installer\n+\n+  #\n+  # Backup\n+  #\n+  # Provides the restful api call for\n+  # /utils/backup \tGET \tReturns a json list of available backups\n+  def index\n+    @backups = Backup.all\n+\n+    respond_to do |format|\n+      format.html\n+      format.json { render json: @backups }\n+    end\n+  end\n+\n+  #\n+  # Backup\n+  #\n+  # Provides the restful api call for\n+  # /utils/backup   POST   Trigger a backup\n+  def backup\n+    @backup = Backup.new(\n+      name: params[:filename]\n+    )\n+    respond_to do |format|\n+      if @backup.save\n+        format.json { head :ok }\n+        format.html { redirect_to backup_path }\n+      else\n+        msg = I18n.t(\".invalid_filename\", scope: \"backup.index\")\n+        render json: { error: msg }","path":"crowbar_framework/app/controllers/backup_controller.rb","position":49,"original_position":49,"commit_id":"9703b14d033952c54e2b180ecc40ddffd5e85f3e","original_commit_id":"9703b14d033952c54e2b180ecc40ddffd5e85f3e","user":{"login":"tboerger","id":156964,"avatar_url":"https://avatars.githubusercontent.com/u/156964?v=3","gravatar_id":"","url":"https://api.github.com/users/tboerger","html_url":"https://github.com/tboerger","followers_url":"https://api.github.com/users/tboerger/followers","following_url":"https://api.github.com/users/tboerger/following{/other_user}","gists_url":"https://api.github.com/users/tboerger/gists{/gist_id}","starred_url":"https://api.github.com/users/tboerger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tboerger/subscriptions","organizations_url":"https://api.github.com/users/tboerger/orgs","repos_url":"https://api.github.com/users/tboerger/repos","events_url":"https://api.github.com/users/tboerger/events{/privacy}","received_events_url":"https://api.github.com/users/tboerger/received_events","type":"User","site_admin":false},"body":"It's wrong to remove `format.json {}`, I just wanted to have the `error` key, e.g. `format.json { render json: { error: msg } }`","created_at":"2015-12-22T09:10:38Z","updated_at":"2015-12-22T09:10:38Z","html_url":"https://github.com/crowbar/crowbar-core/pull/144#discussion_r48234075","pull_request_url":"https://api.github.com/repos/crowbar/crowbar-core/pulls/144","_links":{"self":{"href":"https://api.github.com/repos/crowbar/crowbar-core/pulls/comments/48234075"},"html":{"href":"https://github.com/crowbar/crowbar-core/pull/144#discussion_r48234075"},"pull_request":{"href":"https://api.github.com/repos/crowbar/crowbar-core/pulls/144"}}},"pull_request":{"url":"https://api.github.com/repos/crowbar/crowbar-core/pulls/144","id":51977233,"html_url":"https://github.com/crowbar/crowbar-core/pull/144","diff_url":"https://github.com/crowbar/crowbar-core/pull/144.diff","patch_url":"https://github.com/crowbar/crowbar-core/pull/144.patch","issue_url":"https://api.github.com/repos/crowbar/crowbar-core/issues/144","number":144,"state":"open","locked":false,"title":"Crowbar Backup/Restore/Upgrade","user":{"login":"MaximilianMeister","id":5364817,"avatar_url":"https://avatars.githubusercontent.com/u/5364817?v=3","gravatar_id":"","url":"https://api.github.com/users/MaximilianMeister","html_url":"https://github.com/MaximilianMeister","followers_url":"https://api.github.com/users/MaximilianMeister/followers","following_url":"https://api.github.com/users/MaximilianMeister/following{/other_user}","gists_url":"https://api.github.com/users/MaximilianMeister/gists{/gist_id}","starred_url":"https://api.github.com/users/MaximilianMeister/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaximilianMeister/subscriptions","organizations_url":"https://api.github.com/users/MaximilianMeister/orgs","repos_url":"https://api.github.com/users/MaximilianMeister/repos","events_url":"https://api.github.com/users/MaximilianMeister/events{/privacy}","received_events_url":"https://api.github.com/users/MaximilianMeister/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-27T09:59:07Z","updated_at":"2015-12-22T09:10:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4b6ce65f138c85676d3d3a4e468cdb6f01793e55","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/crowbar/crowbar-core/pulls/144/commits","review_comments_url":"https://api.github.com/repos/crowbar/crowbar-core/pulls/144/comments","review_comment_url":"https://api.github.com/repos/crowbar/crowbar-core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/crowbar/crowbar-core/issues/144/comments","statuses_url":"https://api.github.com/repos/crowbar/crowbar-core/statuses/9703b14d033952c54e2b180ecc40ddffd5e85f3e","head":{"label":"SUSE-Cloud:crowbar-backup","ref":"crowbar-backup","sha":"9703b14d033952c54e2b180ecc40ddffd5e85f3e","user":{"login":"SUSE-Cloud","id":1553906,"avatar_url":"https://avatars.githubusercontent.com/u/1553906?v=3","gravatar_id":"","url":"https://api.github.com/users/SUSE-Cloud","html_url":"https://github.com/SUSE-Cloud","followers_url":"https://api.github.com/users/SUSE-Cloud/followers","following_url":"https://api.github.com/users/SUSE-Cloud/following{/other_user}","gists_url":"https://api.github.com/users/SUSE-Cloud/gists{/gist_id}","starred_url":"https://api.github.com/users/SUSE-Cloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SUSE-Cloud/subscriptions","organizations_url":"https://api.github.com/users/SUSE-Cloud/orgs","repos_url":"https://api.github.com/users/SUSE-Cloud/repos","events_url":"https://api.github.com/users/SUSE-Cloud/events{/privacy}","received_events_url":"https://api.github.com/users/SUSE-Cloud/received_events","type":"Organization","site_admin":false},"repo":{"id":40903364,"name":"crowbar-core","full_name":"SUSE-Cloud/crowbar-core","owner":{"login":"SUSE-Cloud","id":1553906,"avatar_url":"https://avatars.githubusercontent.com/u/1553906?v=3","gravatar_id":"","url":"https://api.github.com/users/SUSE-Cloud","html_url":"https://github.com/SUSE-Cloud","followers_url":"https://api.github.com/users/SUSE-Cloud/followers","following_url":"https://api.github.com/users/SUSE-Cloud/following{/other_user}","gists_url":"https://api.github.com/users/SUSE-Cloud/gists{/gist_id}","starred_url":"https://api.github.com/users/SUSE-Cloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SUSE-Cloud/subscriptions","organizations_url":"https://api.github.com/users/SUSE-Cloud/orgs","repos_url":"https://api.github.com/users/SUSE-Cloud/repos","events_url":"https://api.github.com/users/SUSE-Cloud/events{/privacy}","received_events_url":"https://api.github.com/users/SUSE-Cloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SUSE-Cloud/crowbar-core","description":"Core deployment for Crowbar","fork":true,"url":"https://api.github.com/repos/SUSE-Cloud/crowbar-core","forks_url":"https://api.github.com/repos/SUSE-Cloud/crowbar-core/forks","keys_url":"https://api.github.com/repos/SUSE-Cloud/crowbar-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SUSE-Cloud/crowbar-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SUSE-Cloud/crowbar-core/teams","hooks_url":"https://api.github.com/repos/SUSE-Cloud/crowbar-core/hooks","issue_events_url":"https://api.github.com/repos/SUSE-Cloud/crowbar-core/issues/events{/number}","events_url":"https://api.github.com/repos/SUSE-Cloud/crowbar-core/events","assignees_url":"https://api.github.com/repos/SUSE-Cloud/crowbar-core/assignees{/user}","branches_url":"https://api.github.com/repos/SUSE-Cloud/crowbar-core/branches{/branch}","tags_url":"https://api.github.com/repos/SUSE-Cloud/crowbar-core/tags","blobs_url":"https://api.github.com/repos/SUSE-Cloud/crowbar-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SUSE-Cloud/crowbar-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SUSE-Cloud/crowbar-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/SUSE-Cloud/crowbar-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SUSE-Cloud/crowbar-core/statuses/{sha}","languages_url":"https://api.github.com/repos/SUSE-Cloud/crowbar-core/languages","stargazers_url":"https://api.github.com/repos/SUSE-Cloud/crowbar-core/stargazers","contributors_url":"https://api.github.com/repos/SUSE-Cloud/crowbar-core/contributors","subscribers_url":"https://api.github.com/repos/SUSE-Cloud/crowbar-core/subscribers","subscription_url":"https://api.github.com/repos/SUSE-Cloud/crowbar-core/subscription","commits_url":"https://api.github.com/repos/SUSE-Cloud/crowbar-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/SUSE-Cloud/crowbar-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/SUSE-Cloud/crowbar-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/SUSE-Cloud/crowbar-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/SUSE-Cloud/crowbar-core/contents/{+path}","compare_url":"https://api.github.com/repos/SUSE-Cloud/crowbar-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SUSE-Cloud/crowbar-core/merges","archive_url":"https://api.github.com/repos/SUSE-Cloud/crowbar-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SUSE-Cloud/crowbar-core/downloads","issues_url":"https://api.github.com/repos/SUSE-Cloud/crowbar-core/issues{/number}","pulls_url":"https://api.github.com/repos/SUSE-Cloud/crowbar-core/pulls{/number}","milestones_url":"https://api.github.com/repos/SUSE-Cloud/crowbar-core/milestones{/number}","notifications_url":"https://api.github.com/repos/SUSE-Cloud/crowbar-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SUSE-Cloud/crowbar-core/labels{/name}","releases_url":"https://api.github.com/repos/SUSE-Cloud/crowbar-core/releases{/id}","created_at":"2015-08-17T14:54:48Z","updated_at":"2015-08-17T14:54:50Z","pushed_at":"2015-12-21T16:44:13Z","git_url":"git://github.com/SUSE-Cloud/crowbar-core.git","ssh_url":"git@github.com:SUSE-Cloud/crowbar-core.git","clone_url":"https://github.com/SUSE-Cloud/crowbar-core.git","svn_url":"https://github.com/SUSE-Cloud/crowbar-core","homepage":null,"size":103840,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"crowbar:master","ref":"master","sha":"156ad0968276948a199810559237b8ef65663d5a","user":{"login":"crowbar","id":2910205,"avatar_url":"https://avatars.githubusercontent.com/u/2910205?v=3","gravatar_id":"","url":"https://api.github.com/users/crowbar","html_url":"https://github.com/crowbar","followers_url":"https://api.github.com/users/crowbar/followers","following_url":"https://api.github.com/users/crowbar/following{/other_user}","gists_url":"https://api.github.com/users/crowbar/gists{/gist_id}","starred_url":"https://api.github.com/users/crowbar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crowbar/subscriptions","organizations_url":"https://api.github.com/users/crowbar/orgs","repos_url":"https://api.github.com/users/crowbar/repos","events_url":"https://api.github.com/users/crowbar/events{/privacy}","received_events_url":"https://api.github.com/users/crowbar/received_events","type":"Organization","site_admin":false},"repo":{"id":39003227,"name":"crowbar-core","full_name":"crowbar/crowbar-core","owner":{"login":"crowbar","id":2910205,"avatar_url":"https://avatars.githubusercontent.com/u/2910205?v=3","gravatar_id":"","url":"https://api.github.com/users/crowbar","html_url":"https://github.com/crowbar","followers_url":"https://api.github.com/users/crowbar/followers","following_url":"https://api.github.com/users/crowbar/following{/other_user}","gists_url":"https://api.github.com/users/crowbar/gists{/gist_id}","starred_url":"https://api.github.com/users/crowbar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crowbar/subscriptions","organizations_url":"https://api.github.com/users/crowbar/orgs","repos_url":"https://api.github.com/users/crowbar/repos","events_url":"https://api.github.com/users/crowbar/events{/privacy}","received_events_url":"https://api.github.com/users/crowbar/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/crowbar/crowbar-core","description":"Core deployment for Crowbar","fork":false,"url":"https://api.github.com/repos/crowbar/crowbar-core","forks_url":"https://api.github.com/repos/crowbar/crowbar-core/forks","keys_url":"https://api.github.com/repos/crowbar/crowbar-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crowbar/crowbar-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crowbar/crowbar-core/teams","hooks_url":"https://api.github.com/repos/crowbar/crowbar-core/hooks","issue_events_url":"https://api.github.com/repos/crowbar/crowbar-core/issues/events{/number}","events_url":"https://api.github.com/repos/crowbar/crowbar-core/events","assignees_url":"https://api.github.com/repos/crowbar/crowbar-core/assignees{/user}","branches_url":"https://api.github.com/repos/crowbar/crowbar-core/branches{/branch}","tags_url":"https://api.github.com/repos/crowbar/crowbar-core/tags","blobs_url":"https://api.github.com/repos/crowbar/crowbar-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crowbar/crowbar-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crowbar/crowbar-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/crowbar/crowbar-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crowbar/crowbar-core/statuses/{sha}","languages_url":"https://api.github.com/repos/crowbar/crowbar-core/languages","stargazers_url":"https://api.github.com/repos/crowbar/crowbar-core/stargazers","contributors_url":"https://api.github.com/repos/crowbar/crowbar-core/contributors","subscribers_url":"https://api.github.com/repos/crowbar/crowbar-core/subscribers","subscription_url":"https://api.github.com/repos/crowbar/crowbar-core/subscription","commits_url":"https://api.github.com/repos/crowbar/crowbar-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/crowbar/crowbar-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/crowbar/crowbar-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/crowbar/crowbar-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/crowbar/crowbar-core/contents/{+path}","compare_url":"https://api.github.com/repos/crowbar/crowbar-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crowbar/crowbar-core/merges","archive_url":"https://api.github.com/repos/crowbar/crowbar-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crowbar/crowbar-core/downloads","issues_url":"https://api.github.com/repos/crowbar/crowbar-core/issues{/number}","pulls_url":"https://api.github.com/repos/crowbar/crowbar-core/pulls{/number}","milestones_url":"https://api.github.com/repos/crowbar/crowbar-core/milestones{/number}","notifications_url":"https://api.github.com/repos/crowbar/crowbar-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crowbar/crowbar-core/labels{/name}","releases_url":"https://api.github.com/repos/crowbar/crowbar-core/releases{/id}","created_at":"2015-07-13T09:31:28Z","updated_at":"2015-12-15T18:33:09Z","pushed_at":"2015-12-22T07:33:45Z","git_url":"git://github.com/crowbar/crowbar-core.git","ssh_url":"git@github.com:crowbar/crowbar-core.git","clone_url":"https://github.com/crowbar/crowbar-core.git","svn_url":"https://github.com/crowbar/crowbar-core","homepage":null,"size":118756,"stargazers_count":4,"watchers_count":4,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":25,"forks":21,"open_issues":25,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/crowbar/crowbar-core/pulls/144"},"html":{"href":"https://github.com/crowbar/crowbar-core/pull/144"},"issue":{"href":"https://api.github.com/repos/crowbar/crowbar-core/issues/144"},"comments":{"href":"https://api.github.com/repos/crowbar/crowbar-core/issues/144/comments"},"review_comments":{"href":"https://api.github.com/repos/crowbar/crowbar-core/pulls/144/comments"},"review_comment":{"href":"https://api.github.com/repos/crowbar/crowbar-core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/crowbar/crowbar-core/pulls/144/commits"},"statuses":{"href":"https://api.github.com/repos/crowbar/crowbar-core/statuses/9703b14d033952c54e2b180ecc40ddffd5e85f3e"}}}}